@fluid-topics/ft-search-selected-facets 1.1.33 → 1.1.34
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.
|
@@ -972,23 +972,23 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
972
972
|
<ft-icon .variant=${this.iconVariant} .value="${this.internalIcon}"></ft-icon>
|
|
973
973
|
</div>
|
|
974
974
|
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new ar))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new ar))}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?"close":void 0)}}sr.elementDefinitions={"ft-ripple":st,"ft-typography":bo,"ft-icon":wo,"ft-button":Vi},sr.styles=rr,nr([r.property({type:Boolean})],sr.prototype,"highlighted",void 0),nr([r.property({type:Boolean})],sr.prototype,"removable",void 0),nr([r.property({type:Boolean})],sr.prototype,"disabled",void 0),nr([r.property({type:Boolean})],sr.prototype,"clickable",void 0),nr([r.property({type:Boolean})],sr.prototype,"iconClickable",void 0),nr([r.property({type:Boolean})],sr.prototype,"dense",void 0),nr([r.property({type:Boolean})],sr.prototype,"multiLine",void 0),nr([r.property()],sr.prototype,"label",void 0),nr([r.property()],sr.prototype,"iconLabel",void 0),nr([r.property()],sr.prototype,"icon",void 0),nr([r.property()],sr.prototype,"iconVariant",void 0),nr([r.property({type:Boolean})],sr.prototype,"trailingIcon",void 0),nr([r.query("ft-typography slot")],sr.prototype,"slottedContent",void 0),e.customElement("ft-chip")(sr);const lr=o.css`
|
|
975
|
-
`;var cr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const pr=Symbol("
|
|
975
|
+
`;var cr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const pr=Symbol("i18nAttributes"),fr=Symbol("i18nProperties"),hr=Symbol("i18nUnsubs");function dr(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?D:z}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[pr])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[fr])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[pr])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[fr])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[fr])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[pr])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[hr].has(t)||this[hr].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[hr].forEach((t=>t())),this[hr].clear()}}return e=hr,cr([r.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class ur extends(dr(e.FtLitElement)){}class gr extends(dr(e.FtLitElementRedux)){}var yr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class br extends gr{constructor(){super(),this.editorMode=!1,this.addStore(E)}render(){return this.key&&this.context?o.html`
|
|
976
976
|
<span class="ft-i18n">
|
|
977
977
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
978
978
|
</span>
|
|
979
|
-
`:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}
|
|
980
|
-
`;var
|
|
979
|
+
`:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}br.elementDefinitions={},br.styles=lr,yr([e.redux()],br.prototype,"editorMode",void 0),yr([r.property()],br.prototype,"context",void 0),yr([r.property()],br.prototype,"key",void 0),yr([e.jsonProperty([])],br.prototype,"args",void 0),yr([r.property()],br.prototype,"defaultMessage",void 0);class mr{static build(t){return new mr(t)}static fromGwt(t){return new mr(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>z.resolveMessage(this.name,e,...t)})}}e.customElement("ft-i18n")(br);const vr=o.css`
|
|
980
|
+
`;var xr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Or extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class wr extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class Sr extends CustomEvent{constructor(t,e,o){super("ft-search-results-change",{detail:{request:t,paging:e,spellcheck:o}})}}class Nr extends e.FtLitElementRedux{get stateManager(){return null==this._stateManager&&(this._stateManager=_.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(E)}render(){return o.html`
|
|
981
981
|
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
982
|
-
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new
|
|
983
|
-
|
|
982
|
+
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new wr(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new Sr(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new Or(t))}reloadSavedSearches(){H.clearMySearches()}clear(){this.stateManager.clear()}}Nr.elementDefinitions={},Nr.styles=vr,xr([r.property()],Nr.prototype,"query",void 0),xr([r.property()],Nr.prototype,"contentLocale",void 0),xr([r.property({type:Number})],Nr.prototype,"pageSize",void 0),xr([r.property({type:Boolean})],Nr.prototype,"searchInDocumentTitlesOnly",void 0),xr([r.property()],Nr.prototype,"scope",void 0),xr([r.property({type:Boolean})],Nr.prototype,"ignoreEmptyQuery",void 0),xr([r.property({type:Boolean})],Nr.prototype,"openExternalDocumentInNewTab",void 0),xr([e.jsonProperty([])],Nr.prototype,"filters",void 0),xr([e.jsonProperty([])],Nr.prototype,"sort",void 0),xr([e.redux({store:"search"})],Nr.prototype,"request",void 0),xr([e.redux({store:"search"})],Nr.prototype,"paging",void 0),xr([e.redux({store:"search",selector:t=>t.spellcheck})],Nr.prototype,"autocorrect",void 0),xr([e.redux({store:E.name})],Nr.prototype,"session",void 0),e.customElement("ft-search-context")(Nr);const $r=o.css`
|
|
983
|
+
`,Cr=e.FtCssVariableFactory.extend("--ft-checkbox-text-color","",e.designSystemVariables.colorOnSurfaceHigh),kr=e.FtCssVariableFactory.extend("--ft-checkbox-font-size","",re.fontSize),Ir=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Er=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),Rr=e.FtCssVariableFactory.extend("--ft-checkbox-border-color","",e.designSystemVariables.colorOnSurfaceMedium),Ur=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),Lr=o.css`
|
|
984
984
|
* {
|
|
985
985
|
box-sizing: border-box;
|
|
986
986
|
}
|
|
987
987
|
|
|
988
988
|
.ft-checkbox {
|
|
989
989
|
box-sizing: border-box;
|
|
990
|
-
color: ${
|
|
991
|
-
font-size: ${
|
|
990
|
+
color: ${Cr};
|
|
991
|
+
font-size: ${kr};
|
|
992
992
|
|
|
993
993
|
display: inline-flex;
|
|
994
994
|
align-items: center;
|
|
@@ -996,7 +996,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
996
996
|
}
|
|
997
997
|
|
|
998
998
|
.ft-checkbox--disabled {
|
|
999
|
-
color: ${
|
|
999
|
+
color: ${Ur};
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
1002
|
input {
|
|
@@ -1020,26 +1020,26 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1020
1020
|
|
|
1021
1021
|
.ft-checkbox--box {
|
|
1022
1022
|
display: flex;
|
|
1023
|
-
border: 2px solid ${
|
|
1023
|
+
border: 2px solid ${Rr};
|
|
1024
1024
|
border-radius: 2px;
|
|
1025
1025
|
|
|
1026
1026
|
width: 18px;
|
|
1027
1027
|
height: 18px;
|
|
1028
1028
|
|
|
1029
|
-
color: ${
|
|
1029
|
+
color: ${Er};
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
1032
1032
|
|
|
1033
1033
|
.ft-checkbox--checked .ft-checkbox--box,
|
|
1034
1034
|
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
1035
|
-
border-color: ${
|
|
1036
|
-
background-color: ${
|
|
1035
|
+
border-color: ${Ir};
|
|
1036
|
+
background-color: ${Ir};
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
1039
|
.ft-checkbox--disabled .ft-checkbox--box {
|
|
1040
|
-
border-color: ${
|
|
1040
|
+
border-color: ${Ur};
|
|
1041
1041
|
background-color: transparent;
|
|
1042
|
-
color: ${
|
|
1042
|
+
color: ${Ur};
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
1045
|
.ft-checkbox--checkmark {
|
|
@@ -1058,7 +1058,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1058
1058
|
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
1059
1059
|
opacity: 1;
|
|
1060
1060
|
}
|
|
1061
|
-
`;var
|
|
1061
|
+
`;var Wr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class zr 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 o.html`
|
|
1062
1062
|
<label class="${n.classMap(t)}" for="checkbox-input">
|
|
1063
1063
|
<div class="ft-checkbox--box-container">
|
|
1064
1064
|
<ft-ripple
|
|
@@ -1084,14 +1084,14 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1084
1084
|
<slot></slot>
|
|
1085
1085
|
</ft-typography>
|
|
1086
1086
|
</label>
|
|
1087
|
-
`}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)}}
|
|
1087
|
+
`}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)}}zr.elementDefinitions={"ft-ripple":st,"ft-typography":bo},zr.styles=Lr,Wr([r.property()],zr.prototype,"name",void 0),Wr([r.property({type:Boolean,reflect:!0})],zr.prototype,"checked",void 0),Wr([r.property({type:Boolean})],zr.prototype,"indeterminate",void 0),Wr([r.property({type:Boolean})],zr.prototype,"disabled",void 0),Wr([r.query(".ft-checkbox")],zr.prototype,"container",void 0),Wr([r.query("ft-ripple")],zr.prototype,"ripple",void 0),e.customElement("ft-checkbox")(zr);const Dr=e.FtCssVariableFactory.extend("--ft-radio-text-color","",e.designSystemVariables.colorOnSurfaceHigh),Ar=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Kr=(e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),e.FtCssVariableFactory.extend("--ft-radio-border-color","",e.designSystemVariables.colorOnSurfaceMedium)),Br=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),Zr=o.css`
|
|
1088
1088
|
* {
|
|
1089
1089
|
box-sizing: border-box;
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
1092
|
.ft-radio {
|
|
1093
1093
|
box-sizing: border-box;
|
|
1094
|
-
color: ${
|
|
1094
|
+
color: ${Dr};
|
|
1095
1095
|
|
|
1096
1096
|
display: inline-flex;
|
|
1097
1097
|
align-items: center;
|
|
@@ -1099,7 +1099,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
1101
|
.ft-radio--disabled {
|
|
1102
|
-
color: ${
|
|
1102
|
+
color: ${Br};
|
|
1103
1103
|
}
|
|
1104
1104
|
|
|
1105
1105
|
input {
|
|
@@ -1122,7 +1122,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1122
1122
|
}
|
|
1123
1123
|
|
|
1124
1124
|
.ft-radio--box {
|
|
1125
|
-
border: 2px solid ${
|
|
1125
|
+
border: 2px solid ${Kr};
|
|
1126
1126
|
border-radius: 50%;
|
|
1127
1127
|
|
|
1128
1128
|
display: flex;
|
|
@@ -1135,7 +1135,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1135
1135
|
|
|
1136
1136
|
.ft-radio--box:after {
|
|
1137
1137
|
content: " ";
|
|
1138
|
-
background-color: ${
|
|
1138
|
+
background-color: ${Ar};
|
|
1139
1139
|
|
|
1140
1140
|
border-radius: 50%;
|
|
1141
1141
|
|
|
@@ -1147,7 +1147,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
1149
|
.ft-radio--checked .ft-radio--box {
|
|
1150
|
-
border-color: ${
|
|
1150
|
+
border-color: ${Ar};
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
1153
|
|
|
@@ -1156,14 +1156,14 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1156
1156
|
}
|
|
1157
1157
|
|
|
1158
1158
|
.ft-radio--disabled .ft-radio--box {
|
|
1159
|
-
border-color: ${
|
|
1159
|
+
border-color: ${Br};
|
|
1160
1160
|
background-color: transparent;
|
|
1161
1161
|
}
|
|
1162
1162
|
|
|
1163
1163
|
.ft-radio--disabled .ft-radio--box:after {
|
|
1164
|
-
background-color: ${
|
|
1164
|
+
background-color: ${Br};
|
|
1165
1165
|
}
|
|
1166
|
-
`;var
|
|
1166
|
+
`;var Fr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Tr extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class Hr 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 o.html`
|
|
1167
1167
|
<div class="${n.classMap(t)}">
|
|
1168
1168
|
<div class="ft-radio--box-container">
|
|
1169
1169
|
<ft-ripple
|
|
@@ -1188,16 +1188,16 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1188
1188
|
</ft-typography>
|
|
1189
1189
|
</label>
|
|
1190
1190
|
</div>
|
|
1191
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new
|
|
1191
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new Tr(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 Tr(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}Hr.elementDefinitions={"ft-ripple":st,"ft-typography":bo},Hr.styles=Zr,Fr([r.property()],Hr.prototype,"value",void 0),Fr([r.property()],Hr.prototype,"name",void 0),Fr([r.property({type:Boolean,reflect:!0})],Hr.prototype,"checked",void 0),Fr([r.property({type:Boolean})],Hr.prototype,"disabled",void 0),Fr([r.query(".ft-radio")],Hr.prototype,"container",void 0),Fr([r.query("ft-ripple")],Hr.prototype,"ripple",void 0),Fr([r.query("input")],Hr.prototype,"input",void 0);const Pr=o.css`
|
|
1192
1192
|
:host {
|
|
1193
1193
|
display: contents;
|
|
1194
1194
|
}
|
|
1195
|
-
`;var
|
|
1195
|
+
`;var jr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Mr extends e.FtLitElement{constructor(){super(...arguments),this.name=""}render(){return o.html`
|
|
1196
1196
|
<slot @slotchange=${this.onSlotChange}
|
|
1197
1197
|
@change=${this.onChange}
|
|
1198
1198
|
@keydown=${this.onKeyDown}
|
|
1199
1199
|
></slot>
|
|
1200
|
-
`}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),o=this.radioButtons.indexOf(e)-1;this.radioButtons[o<0?this.radioButtons.length-1:o].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)}}
|
|
1200
|
+
`}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),o=this.radioButtons.indexOf(e)-1;this.radioButtons[o<0?this.radioButtons.length-1:o].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)}}Mr.elementDefinitions={},Mr.styles=Pr,jr([r.property()],Mr.prototype,"name",void 0),jr([r.queryAssignedElements()],Mr.prototype,"radioButtons",void 0),e.customElement("ft-radio")(Hr),e.customElement("ft-radio-group")(Mr);const _r={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(De.fontFamily,"Body2 typography"),fontSize:e.FtCssVariableFactory.external(De.fontSize,"Body2 typography"),fontWeight:e.FtCssVariableFactory.external(De.fontWeight,"Body2 typography"),letterSpacing:e.FtCssVariableFactory.external(De.letterSpacing,"Body2 typography"),lineHeight:e.FtCssVariableFactory.external(De.lineHeight,"Body2 typography"),textTransform:e.FtCssVariableFactory.external(De.textTransform,"Body2 typography")},Gr=o.css`
|
|
1201
1201
|
.ft-filter-level--container {
|
|
1202
1202
|
display: flex;
|
|
1203
1203
|
flex-direction: column;
|
|
@@ -1211,14 +1211,14 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1211
1211
|
flex-shrink: 0;
|
|
1212
1212
|
text-decoration: none;
|
|
1213
1213
|
position: relative;
|
|
1214
|
-
border-radius: ${
|
|
1214
|
+
border-radius: ${_r.borderRadiusM};
|
|
1215
1215
|
overflow: hidden;
|
|
1216
1216
|
display: flex;
|
|
1217
1217
|
align-items: center;
|
|
1218
1218
|
padding: 4px 4px;
|
|
1219
1219
|
gap: 4px;
|
|
1220
1220
|
cursor: pointer;
|
|
1221
|
-
color: ${
|
|
1221
|
+
color: ${_r.colorOnSurface};
|
|
1222
1222
|
}
|
|
1223
1223
|
|
|
1224
1224
|
.ft-filter-level--go-back:focus {
|
|
@@ -1247,7 +1247,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1247
1247
|
}
|
|
1248
1248
|
|
|
1249
1249
|
ft-button {
|
|
1250
|
-
${e.setVariable(Co.color,
|
|
1250
|
+
${e.setVariable(Co.color,_r.colorOnSurface)};
|
|
1251
1251
|
}
|
|
1252
1252
|
|
|
1253
1253
|
ft-radio, ft-checkbox {
|
|
@@ -1261,9 +1261,9 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1261
1261
|
|
|
1262
1262
|
.ft-filter-level--no-values {
|
|
1263
1263
|
margin: 10px 0;
|
|
1264
|
-
color: ${
|
|
1264
|
+
color: ${_r.colorOnSurfaceMedium};
|
|
1265
1265
|
}
|
|
1266
|
-
`;var
|
|
1266
|
+
`;var Vr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class qr extends e.FtLitElement{constructor(){super(...arguments),this.filterId="",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 o.html`
|
|
1267
1267
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
1268
1268
|
${null==this.parent?null:o.html`
|
|
1269
1269
|
<div tabindex="0"
|
|
@@ -1327,7 +1327,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1327
1327
|
@change=${t=>t.stopPropagation()}>
|
|
1328
1328
|
${t.renderOption?t.renderOption:t.label}
|
|
1329
1329
|
</ft-radio>
|
|
1330
|
-
`}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}))}}
|
|
1330
|
+
`}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}))}}qr.elementDefinitions={"ft-button":Vi,"ft-ripple":st,"ft-typography":bo,"ft-checkbox":zr,"ft-icon":wo,"ft-radio":Hr},qr.styles=Gr,Vr([r.property({type:String})],qr.prototype,"filterId",void 0),Vr([r.property({type:Object})],qr.prototype,"parent",void 0),Vr([r.property({type:Array})],qr.prototype,"options",void 0),Vr([r.property({type:Boolean})],qr.prototype,"multivalued",void 0),Vr([r.property({type:Boolean})],qr.prototype,"disabled",void 0),Vr([r.property({type:Boolean})],qr.prototype,"hideSelectedOptions",void 0),Vr([r.property({type:Boolean})],qr.prototype,"preventNavigation",void 0),Vr([r.property({type:String})],qr.prototype,"filter",void 0),Vr([r.property({type:String})],qr.prototype,"moreValuesButtonLabel",void 0),Vr([r.property({type:String})],qr.prototype,"noValuesLabel",void 0),Vr([r.property({type:Number})],qr.prototype,"displayedValuesLimit",void 0),Vr([r.query(".ft-filter-level--container")],qr.prototype,"container",void 0),Vr([r.state()],qr.prototype,"displayedPages",void 0);const Yr={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")},Qr=o.css`
|
|
1331
1331
|
.ft-snap-scroll {
|
|
1332
1332
|
box-sizing: border-box;
|
|
1333
1333
|
position: relative;
|
|
@@ -1362,7 +1362,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1362
1362
|
flex-wrap: nowrap;
|
|
1363
1363
|
align-items: flex-start;
|
|
1364
1364
|
justify-content: flex-start;
|
|
1365
|
-
gap: ${
|
|
1365
|
+
gap: ${Yr.gap};
|
|
1366
1366
|
}
|
|
1367
1367
|
|
|
1368
1368
|
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
@@ -1405,11 +1405,11 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1405
1405
|
.ft-snap-scroll--next {
|
|
1406
1406
|
position: absolute;
|
|
1407
1407
|
display: flex;
|
|
1408
|
-
z-index: ${
|
|
1408
|
+
z-index: ${Yr.buttonsZIndex};
|
|
1409
1409
|
opacity: 1;
|
|
1410
1410
|
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
1411
1411
|
${e.setVariable(Co.backgroundColor,"transparent")};
|
|
1412
|
-
${e.setVariable(Co.color,
|
|
1412
|
+
${e.setVariable(Co.color,Yr.buttonsColor)};
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
1415
|
.ft-snap-scroll--previous[hidden],
|
|
@@ -1422,37 +1422,37 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1422
1422
|
top: 0;
|
|
1423
1423
|
left: -1px;
|
|
1424
1424
|
bottom: 0;
|
|
1425
|
-
background: linear-gradient(to right, ${
|
|
1425
|
+
background: linear-gradient(to right, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1426
1426
|
}
|
|
1427
1427
|
|
|
1428
1428
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
1429
1429
|
top: -1px;
|
|
1430
1430
|
left: 0;
|
|
1431
1431
|
right: 0;
|
|
1432
|
-
background: linear-gradient(to bottom, ${
|
|
1432
|
+
background: linear-gradient(to bottom, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
1435
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
1436
1436
|
top: 0;
|
|
1437
1437
|
right: -1px;
|
|
1438
1438
|
bottom: 0;
|
|
1439
|
-
background: linear-gradient(to left, ${
|
|
1439
|
+
background: linear-gradient(to left, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1440
1440
|
}
|
|
1441
1441
|
|
|
1442
1442
|
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
1443
1443
|
left: 0;
|
|
1444
1444
|
right: 0;
|
|
1445
1445
|
bottom: -1px;
|
|
1446
|
-
background: linear-gradient(to top, ${
|
|
1446
|
+
background: linear-gradient(to top, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1447
1447
|
}
|
|
1448
1448
|
|
|
1449
1449
|
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
1450
1450
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
1451
1451
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
1452
1452
|
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1453
|
-
background-color: ${
|
|
1453
|
+
background-color: ${Yr.colorSurface};
|
|
1454
1454
|
}
|
|
1455
|
-
`;var
|
|
1455
|
+
`;var Xr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Jr extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class tn 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,o=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<o||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=n.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}),i=this.controls&&this.withScroll;return o.html`
|
|
1456
1456
|
<div part="container" class="${t}">
|
|
1457
1457
|
<ft-button
|
|
1458
1458
|
class="ft-snap-scroll--previous"
|
|
@@ -1476,7 +1476,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1476
1476
|
@click=${this.next}
|
|
1477
1477
|
></ft-button>
|
|
1478
1478
|
</div>
|
|
1479
|
-
`}update(t){super.update(t),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
|
|
1479
|
+
`}update(t){super.update(t),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 Jr(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(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))}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,o;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(o=this.contentSlot)||void 0===o||o.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)}}tn.elementDefinitions={"ft-button":Vi},tn.styles=Qr,Xr([r.property({type:Boolean})],tn.prototype,"horizontal",void 0),Xr([r.property({type:Boolean})],tn.prototype,"hideScrollbar",void 0),Xr([r.property({type:Boolean})],tn.prototype,"controls",void 0),Xr([r.property({type:Boolean})],tn.prototype,"limitSize",void 0),Xr([r.state()],tn.prototype,"elements",void 0),Xr([r.state()],tn.prototype,"currentElement",void 0),Xr([r.state()],tn.prototype,"withScroll",void 0),Xr([r.state()],tn.prototype,"startReached",void 0),Xr([r.state()],tn.prototype,"endReached",void 0),Xr([r.query(".ft-snap-scroll--content")],tn.prototype,"contentSlot",void 0),e.customElement("ft-snap-scroll")(tn);const en=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),on=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),rn=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),nn=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),an=e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),sn=e.FtCssVariableFactory.external(e.designSystemVariables.transitionDuration,"Design system"),ln=e.FtCssVariableFactory.external(e.designSystemVariables.transitionTimingFunction,"Design system"),cn=e.FtCssVariableFactory.extend("--ft-filter-label-color","",e.designSystemVariables.colorOnSurface),pn=e.FtCssVariableFactory.extend("--ft-filter-label-font-size","",re.fontSize,"16px"),fn=[so,o.css`
|
|
1480
1480
|
:host {
|
|
1481
1481
|
display: flex;
|
|
1482
1482
|
max-height: 100%;
|
|
@@ -1511,8 +1511,8 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1511
1511
|
flex-shrink: 1;
|
|
1512
1512
|
flex-grow: 1;
|
|
1513
1513
|
word-break: break-word;
|
|
1514
|
-
color: ${
|
|
1515
|
-
font-size: ${
|
|
1514
|
+
color: ${cn};
|
|
1515
|
+
font-size: ${pn};
|
|
1516
1516
|
${e.setVariable(re.lineHeight,"22px")};
|
|
1517
1517
|
${e.setVariable(re.fontWeight,"bold")};
|
|
1518
1518
|
}
|
|
@@ -1525,8 +1525,8 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1525
1525
|
padding: 0 10px;
|
|
1526
1526
|
overflow: hidden;
|
|
1527
1527
|
height: 32px;
|
|
1528
|
-
transition: height ${
|
|
1529
|
-
margin ${
|
|
1528
|
+
transition: height ${sn} ${ln},
|
|
1529
|
+
margin ${sn} ${ln};
|
|
1530
1530
|
transition-delay: 500ms;
|
|
1531
1531
|
}
|
|
1532
1532
|
|
|
@@ -1539,15 +1539,15 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1539
1539
|
display: block;
|
|
1540
1540
|
width: 100%;
|
|
1541
1541
|
border-radius: 4px;
|
|
1542
|
-
border: 1px solid ${
|
|
1542
|
+
border: 1px solid ${en};
|
|
1543
1543
|
padding: 4px;
|
|
1544
|
-
background-color: ${
|
|
1545
|
-
color: ${
|
|
1546
|
-
outline-color: ${
|
|
1544
|
+
background-color: ${an};
|
|
1545
|
+
color: ${on};
|
|
1546
|
+
outline-color: ${nn};
|
|
1547
1547
|
}
|
|
1548
1548
|
|
|
1549
1549
|
input::placeholder {
|
|
1550
|
-
color: ${
|
|
1550
|
+
color: ${rn};
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
1553
|
input:placeholder-shown {
|
|
@@ -1563,7 +1563,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1563
1563
|
}
|
|
1564
1564
|
|
|
1565
1565
|
.ft-filter--separator {
|
|
1566
|
-
border-top: 1px solid ${
|
|
1566
|
+
border-top: 1px solid ${en};
|
|
1567
1567
|
margin: 4px 10px;
|
|
1568
1568
|
}
|
|
1569
1569
|
|
|
@@ -1588,7 +1588,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1588
1588
|
slot:not([name]) {
|
|
1589
1589
|
display: none;
|
|
1590
1590
|
}
|
|
1591
|
-
`];var
|
|
1591
|
+
`];var hn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class dn extends CustomEvent{constructor(t){super("change",{detail:t})}}class un 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.lastLevelHasHiddenvalues=!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),this.lastDispatchedValues=[]}get flatOptions(){return e.flatDeep(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return e.flatDeep(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,i=this.filterPlaceHolder.replace("{0}",this.label);return o.html`
|
|
1592
1592
|
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1593
1593
|
part="container">
|
|
1594
1594
|
${this.label||t?o.html`
|
|
@@ -1660,18 +1660,18 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1660
1660
|
.exportpartsPrefixes=${["values","available-values"]}
|
|
1661
1661
|
noValuesLabel="${this.noValuesLabel}"
|
|
1662
1662
|
></ft-filter-level>
|
|
1663
|
-
`}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;e.deepEqual(this.lastDispatchedValues,t)||(this.dispatchEvent(new
|
|
1663
|
+
`}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;e.deepEqual(this.lastDispatchedValues,t)||(this.dispatchEvent(new dn(t)),this.lastDispatchedValues=t)}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)}}un.elementDefinitions={"ft-button":Vi,"ft-filter-level":qr,"ft-snap-scroll":tn,"ft-typography":bo},un.styles=fn,hn([r.property({type:String})],un.prototype,"id",void 0),hn([r.property({type:String})],un.prototype,"label",void 0),hn([r.property({type:String})],un.prototype,"filterPlaceHolder",void 0),hn([r.property({type:String})],un.prototype,"clearButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"moreValuesButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"noValuesLabel",void 0),hn([e.jsonProperty([])],un.prototype,"options",void 0),hn([r.property({type:Boolean})],un.prototype,"multivalued",void 0),hn([r.property({type:Boolean})],un.prototype,"disabled",void 0),hn([r.property({type:Boolean})],un.prototype,"raiseSelectedOptions",void 0),hn([r.property({type:Number})],un.prototype,"displayedValuesLimit",void 0),hn([r.property({type:Boolean})],un.prototype,"hideClearButton",void 0),hn([r.query(".ft-filter--slot")],un.prototype,"slotElement",void 0),hn([r.query(".ft-filter--container")],un.prototype,"container",void 0),hn([r.query(".ft-filter--values")],un.prototype,"valuesContainer",void 0),hn([r.query(".ft-filter--levels")],un.prototype,"levelsContainer",void 0),hn([r.state()],un.prototype,"lastLevelHasHiddenvalues",void 0),hn([r.query(".ft-filter--filter input")],un.prototype,"filterInput",void 0),hn([r.queryAll(".ft-filter--levels ft-filter-level")],un.prototype,"levels",void 0),hn([r.state()],un.prototype,"withScroll",void 0),hn([r.state()],un.prototype,"filter",void 0),hn([r.state()],un.prototype,"slideIn",void 0),hn([r.state()],un.prototype,"slideOut",void 0);var gn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class yn extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return o.html`
|
|
1664
1664
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1665
|
-
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}
|
|
1665
|
+
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}yn.elementDefinitions={},gn([r.property({type:String})],yn.prototype,"label",void 0),gn([r.property({type:Object,converter:t=>t})],yn.prototype,"value",void 0),gn([r.property({type:Boolean,reflect:!0})],yn.prototype,"selected",void 0),gn([r.property({type:Object})],yn.prototype,"subOptions",void 0),gn([e.jsonProperty({})],yn.prototype,"renderOption",void 0),gn([r.query(".ft-filter-option--slot")],yn.prototype,"slotElement",void 0),e.customElement("ft-filter")(un),e.customElement("ft-filter-option")(yn);const bn=mr.build("designedSearchType"),mn={label:"Search scope",documentTitlesOnly:"Search in document titles only"};var vn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class xn extends(dr(Y)){constructor(){super(),this.addI18nContext(bn,mn)}render(){return o.html`
|
|
1666
1666
|
<ft-filter
|
|
1667
|
-
label=${
|
|
1668
|
-
.options=${[{label:
|
|
1667
|
+
label=${bn.messages.label()}
|
|
1668
|
+
.options=${[{label:bn.messages.documentTitlesOnly(),value:t=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setSearchInDocumentTitlesOnly(t)},selected:this.searchInDocumentTitlesOnly}]}
|
|
1669
1669
|
part="filter"
|
|
1670
1670
|
.exportpartsPrefixes=${["filter"]}
|
|
1671
1671
|
multivalued
|
|
1672
1672
|
@change=${this.onSelected}
|
|
1673
1673
|
></ft-filter>
|
|
1674
|
-
`}onSelected(t){var e;null===(e=this.filter)||void 0===e||e.options.forEach((t=>t.value(t.selected)))}}
|
|
1674
|
+
`}onSelected(t){var e;null===(e=this.filter)||void 0===e||e.options.forEach((t=>t.value(t.selected)))}}xn.elementDefinitions={"ft-filter":un},xn.styles=$r,vn([e.redux({selector:j})],xn.prototype,"searchInDocumentTitlesOnly",void 0),vn([r.query("ft-filter")],xn.prototype,"filter",void 0),e.customElement("ft-search-type")(xn);var On=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class wn extends(dr(Y)){get hasSomethingToDisplay(){var t;return this.searchInDocumentTitlesOnly||(null===(t=this.facets)||void 0===t?void 0:t.some((t=>this.getSelectedValues(t).length>0)))}constructor(){super(),this.addI18nContext(bn,mn)}render(){return this.hasSomethingToDisplay?o.html`
|
|
1675
1675
|
<div class="ft-search-selected-facets--container">
|
|
1676
1676
|
${i.repeat(this.facets||[],(t=>t.key),(t=>{const e=this.getSelectedValues(t);return i.repeat(e,(e=>t.key+"-"+e),(o=>this.renderFacet(t.key,t.label,e,o)))}))}
|
|
1677
1677
|
${this.renderSearchInDocumentTitlesOnly()}
|
|
@@ -1690,13 +1690,13 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1690
1690
|
</ft-chip>
|
|
1691
1691
|
</ft-tooltip>
|
|
1692
1692
|
`}getSelectedValues(t){return e.flatDeep(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}getLabelFromValue(t){return this.unquote(t).split("|").pop()}getBreadcrumbFromValue(t){return this.unquote(t).split("|").join(" > ")}unquote(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}renderSearchInDocumentTitlesOnly(){return this.searchInDocumentTitlesOnly?o.html`
|
|
1693
|
-
<ft-tooltip inline text="${
|
|
1693
|
+
<ft-tooltip inline text="${bn.messages.documentTitlesOnly()}"
|
|
1694
1694
|
part="tooltips tooltip-search-in-document-titles-only">
|
|
1695
1695
|
<ft-chip
|
|
1696
1696
|
part="ft-search-selected-facets ft-search-selected-facet-search-in-document-titles-only"
|
|
1697
1697
|
removable
|
|
1698
1698
|
@icon-click=${()=>{var t;return null===(t=this.stateManager)||void 0===t?void 0:t.setSearchInDocumentTitlesOnly(!1)}}>
|
|
1699
|
-
${
|
|
1699
|
+
${bn.messages.documentTitlesOnly()}
|
|
1700
1700
|
</ft-chip>
|
|
1701
1701
|
</ft-tooltip>
|
|
1702
|
-
`:o.nothing}}
|
|
1702
|
+
`:o.nothing}}wn.elementDefinitions={"ft-chip":sr,"ft-tooltip":Pi},wn.styles=l,On([e.redux({store:"search"})],wn.prototype,"facets",void 0),On([e.redux({store:"search",selector:j})],wn.prototype,"searchInDocumentTitlesOnly",void 0),e.customElement("ft-search-selected-facets")(wn),t.FtSearchSelectedFacets=wn,t.FtSearchSelectedFacetsCssVariables=s,t.styles=l}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litRepeat,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|
|
@@ -1123,23 +1123,23 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1123
1123
|
<ft-icon .variant=${this.iconVariant} .value="${this.internalIcon}"></ft-icon>
|
|
1124
1124
|
</div>
|
|
1125
1125
|
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new Cl))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new Cl))}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?"close":void 0)}}El.elementDefinitions={"ft-ripple":ya,"ft-typography":As,"ft-icon":Ms,"ft-button":ul},El.styles=Nl,$l([R({type:Boolean})],El.prototype,"highlighted",void 0),$l([R({type:Boolean})],El.prototype,"removable",void 0),$l([R({type:Boolean})],El.prototype,"disabled",void 0),$l([R({type:Boolean})],El.prototype,"clickable",void 0),$l([R({type:Boolean})],El.prototype,"iconClickable",void 0),$l([R({type:Boolean})],El.prototype,"dense",void 0),$l([R({type:Boolean})],El.prototype,"multiLine",void 0),$l([R()],El.prototype,"label",void 0),$l([R()],El.prototype,"iconLabel",void 0),$l([R()],El.prototype,"icon",void 0),$l([R()],El.prototype,"iconVariant",void 0),$l([R({type:Boolean})],El.prototype,"trailingIcon",void 0),$l([W("ft-typography slot")],El.prototype,"slottedContent",void 0),F("ft-chip")(El);const kl=It`
|
|
1126
|
-
`;var Rl=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Il=Symbol("
|
|
1126
|
+
`;var Rl=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Il=Symbol("i18nAttributes"),Ul=Symbol("i18nProperties"),Ll=Symbol("i18nUnsubs");function Wl(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?Tn:Kn}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[Il])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[Ul])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[Il])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[Ul])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Ul])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[Il])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Ll].has(t)||this[Ll].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Ll].forEach((t=>t())),this[Ll].clear()}}return e=Ll,Rl([R({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class Al extends(Wl(Go)){}class Dl extends(Wl(si)){}var zl=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class jl extends Dl{constructor(){super(),this.editorMode=!1,this.addStore(zn)}render(){return this.key&&this.context?pe`
|
|
1127
1127
|
<span class="ft-i18n">
|
|
1128
1128
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1129
1129
|
</span>
|
|
1130
|
-
`:this.editorMode?"Select a context and a label key.":ue}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}
|
|
1131
|
-
`;var
|
|
1130
|
+
`:this.editorMode?"Select a context and a label key.":ue}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}jl.elementDefinitions={},jl.styles=kl,zl([Jo()],jl.prototype,"editorMode",void 0),zl([R()],jl.prototype,"context",void 0),zl([R()],jl.prototype,"key",void 0),zl([B([])],jl.prototype,"args",void 0),zl([R()],jl.prototype,"defaultMessage",void 0);class Fl{static build(t){return new Fl(t)}static fromGwt(t){return new Fl(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>Kn.resolveMessage(this.name,e,...t)})}}F("ft-i18n")(jl);const Bl=It`
|
|
1131
|
+
`;var Pl=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Kl extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class Tl extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class Ml extends CustomEvent{constructor(t,e,o){super("ft-search-results-change",{detail:{request:t,paging:e,spellcheck:o}})}}class Zl extends si{get stateManager(){return null==this._stateManager&&(this._stateManager=Qn.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(zn)}render(){return pe`
|
|
1132
1132
|
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
1133
|
-
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new
|
|
1134
|
-
`,
|
|
1133
|
+
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new Tl(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new Ml(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new Kl(t))}reloadSavedSearches(){qn.clearMySearches()}clear(){this.stateManager.clear()}}Zl.elementDefinitions={},Zl.styles=Bl,Pl([R()],Zl.prototype,"query",void 0),Pl([R()],Zl.prototype,"contentLocale",void 0),Pl([R({type:Number})],Zl.prototype,"pageSize",void 0),Pl([R({type:Boolean})],Zl.prototype,"searchInDocumentTitlesOnly",void 0),Pl([R()],Zl.prototype,"scope",void 0),Pl([R({type:Boolean})],Zl.prototype,"ignoreEmptyQuery",void 0),Pl([R({type:Boolean})],Zl.prototype,"openExternalDocumentInNewTab",void 0),Pl([B([])],Zl.prototype,"filters",void 0),Pl([B([])],Zl.prototype,"sort",void 0),Pl([Jo({store:"search"})],Zl.prototype,"request",void 0),Pl([Jo({store:"search"})],Zl.prototype,"paging",void 0),Pl([Jo({store:"search",selector:t=>t.spellcheck})],Zl.prototype,"autocorrect",void 0),Pl([Jo({store:zn.name})],Zl.prototype,"session",void 0),F("ft-search-context")(Zl);const _l=It`
|
|
1134
|
+
`,Hl=Ie.extend("--ft-checkbox-text-color","",ze.colorOnSurfaceHigh),Gl=Ie.extend("--ft-checkbox-font-size","",Na.fontSize),Vl=Ie.external(ze.colorPrimary,"Design system"),ql=Ie.external(ze.colorOnPrimary,"Design system"),Yl=Ie.extend("--ft-checkbox-border-color","",ze.colorOnSurfaceMedium),Xl=Ie.external(ze.colorOnSurfaceDisabled,"Design system"),Jl=It`
|
|
1135
1135
|
* {
|
|
1136
1136
|
box-sizing: border-box;
|
|
1137
1137
|
}
|
|
1138
1138
|
|
|
1139
1139
|
.ft-checkbox {
|
|
1140
1140
|
box-sizing: border-box;
|
|
1141
|
-
color: ${
|
|
1142
|
-
font-size: ${
|
|
1141
|
+
color: ${Hl};
|
|
1142
|
+
font-size: ${Gl};
|
|
1143
1143
|
|
|
1144
1144
|
display: inline-flex;
|
|
1145
1145
|
align-items: center;
|
|
@@ -1147,7 +1147,7 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
1149
|
.ft-checkbox--disabled {
|
|
1150
|
-
color: ${
|
|
1150
|
+
color: ${Xl};
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
1153
|
input {
|
|
@@ -1171,26 +1171,26 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1171
1171
|
|
|
1172
1172
|
.ft-checkbox--box {
|
|
1173
1173
|
display: flex;
|
|
1174
|
-
border: 2px solid ${
|
|
1174
|
+
border: 2px solid ${Yl};
|
|
1175
1175
|
border-radius: 2px;
|
|
1176
1176
|
|
|
1177
1177
|
width: 18px;
|
|
1178
1178
|
height: 18px;
|
|
1179
1179
|
|
|
1180
|
-
color: ${
|
|
1180
|
+
color: ${ql};
|
|
1181
1181
|
}
|
|
1182
1182
|
|
|
1183
1183
|
|
|
1184
1184
|
.ft-checkbox--checked .ft-checkbox--box,
|
|
1185
1185
|
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
1186
|
-
border-color: ${
|
|
1187
|
-
background-color: ${
|
|
1186
|
+
border-color: ${Vl};
|
|
1187
|
+
background-color: ${Vl};
|
|
1188
1188
|
}
|
|
1189
1189
|
|
|
1190
1190
|
.ft-checkbox--disabled .ft-checkbox--box {
|
|
1191
|
-
border-color: ${
|
|
1191
|
+
border-color: ${Xl};
|
|
1192
1192
|
background-color: transparent;
|
|
1193
|
-
color: ${
|
|
1193
|
+
color: ${Xl};
|
|
1194
1194
|
}
|
|
1195
1195
|
|
|
1196
1196
|
.ft-checkbox--checkmark {
|
|
@@ -1209,7 +1209,7 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1209
1209
|
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
1210
1210
|
opacity: 1;
|
|
1211
1211
|
}
|
|
1212
|
-
`;var
|
|
1212
|
+
`;var Ql=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class tc extends Go{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 pe`
|
|
1213
1213
|
<label class="${ra(t)}" for="checkbox-input">
|
|
1214
1214
|
<div class="ft-checkbox--box-container">
|
|
1215
1215
|
<ft-ripple
|
|
@@ -1235,14 +1235,14 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1235
1235
|
<slot></slot>
|
|
1236
1236
|
</ft-typography>
|
|
1237
1237
|
</label>
|
|
1238
|
-
`}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)}}
|
|
1238
|
+
`}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)}}tc.elementDefinitions={"ft-ripple":ya,"ft-typography":As},tc.styles=Jl,Ql([R()],tc.prototype,"name",void 0),Ql([R({type:Boolean,reflect:!0})],tc.prototype,"checked",void 0),Ql([R({type:Boolean})],tc.prototype,"indeterminate",void 0),Ql([R({type:Boolean})],tc.prototype,"disabled",void 0),Ql([W(".ft-checkbox")],tc.prototype,"container",void 0),Ql([W("ft-ripple")],tc.prototype,"ripple",void 0),F("ft-checkbox")(tc);const ec=Ie.extend("--ft-radio-text-color","",ze.colorOnSurfaceHigh),oc=Ie.external(ze.colorPrimary,"Design system"),ic=(Ie.external(ze.colorOnPrimary,"Design system"),Ie.extend("--ft-radio-border-color","",ze.colorOnSurfaceMedium)),rc=Ie.external(ze.colorOnSurfaceDisabled,"Design system"),nc=It`
|
|
1239
1239
|
* {
|
|
1240
1240
|
box-sizing: border-box;
|
|
1241
1241
|
}
|
|
1242
1242
|
|
|
1243
1243
|
.ft-radio {
|
|
1244
1244
|
box-sizing: border-box;
|
|
1245
|
-
color: ${
|
|
1245
|
+
color: ${ec};
|
|
1246
1246
|
|
|
1247
1247
|
display: inline-flex;
|
|
1248
1248
|
align-items: center;
|
|
@@ -1250,7 +1250,7 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1250
1250
|
}
|
|
1251
1251
|
|
|
1252
1252
|
.ft-radio--disabled {
|
|
1253
|
-
color: ${
|
|
1253
|
+
color: ${rc};
|
|
1254
1254
|
}
|
|
1255
1255
|
|
|
1256
1256
|
input {
|
|
@@ -1273,7 +1273,7 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1273
1273
|
}
|
|
1274
1274
|
|
|
1275
1275
|
.ft-radio--box {
|
|
1276
|
-
border: 2px solid ${
|
|
1276
|
+
border: 2px solid ${ic};
|
|
1277
1277
|
border-radius: 50%;
|
|
1278
1278
|
|
|
1279
1279
|
display: flex;
|
|
@@ -1286,7 +1286,7 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1286
1286
|
|
|
1287
1287
|
.ft-radio--box:after {
|
|
1288
1288
|
content: " ";
|
|
1289
|
-
background-color: ${
|
|
1289
|
+
background-color: ${oc};
|
|
1290
1290
|
|
|
1291
1291
|
border-radius: 50%;
|
|
1292
1292
|
|
|
@@ -1298,7 +1298,7 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1298
1298
|
}
|
|
1299
1299
|
|
|
1300
1300
|
.ft-radio--checked .ft-radio--box {
|
|
1301
|
-
border-color: ${
|
|
1301
|
+
border-color: ${oc};
|
|
1302
1302
|
}
|
|
1303
1303
|
|
|
1304
1304
|
|
|
@@ -1307,14 +1307,14 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1307
1307
|
}
|
|
1308
1308
|
|
|
1309
1309
|
.ft-radio--disabled .ft-radio--box {
|
|
1310
|
-
border-color: ${
|
|
1310
|
+
border-color: ${rc};
|
|
1311
1311
|
background-color: transparent;
|
|
1312
1312
|
}
|
|
1313
1313
|
|
|
1314
1314
|
.ft-radio--disabled .ft-radio--box:after {
|
|
1315
|
-
background-color: ${
|
|
1315
|
+
background-color: ${rc};
|
|
1316
1316
|
}
|
|
1317
|
-
`;var
|
|
1317
|
+
`;var ac=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class sc extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class lc extends Go{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 pe`
|
|
1318
1318
|
<div class="${ra(t)}">
|
|
1319
1319
|
<div class="ft-radio--box-container">
|
|
1320
1320
|
<ft-ripple
|
|
@@ -1339,22 +1339,22 @@ function(t){return(e,o)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([n
|
|
|
1339
1339
|
</ft-typography>
|
|
1340
1340
|
</label>
|
|
1341
1341
|
</div>
|
|
1342
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new
|
|
1342
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new sc(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 sc(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}lc.elementDefinitions={"ft-ripple":ya,"ft-typography":As},lc.styles=nc,ac([R()],lc.prototype,"value",void 0),ac([R()],lc.prototype,"name",void 0),ac([R({type:Boolean,reflect:!0})],lc.prototype,"checked",void 0),ac([R({type:Boolean})],lc.prototype,"disabled",void 0),ac([W(".ft-radio")],lc.prototype,"container",void 0),ac([W("ft-ripple")],lc.prototype,"ripple",void 0),ac([W("input")],lc.prototype,"input",void 0);const cc=It`
|
|
1343
1343
|
:host {
|
|
1344
1344
|
display: contents;
|
|
1345
1345
|
}
|
|
1346
|
-
`;var
|
|
1346
|
+
`;var fc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class hc extends Go{constructor(){super(...arguments),this.name=""}render(){return pe`
|
|
1347
1347
|
<slot @slotchange=${this.onSlotChange}
|
|
1348
1348
|
@change=${this.onChange}
|
|
1349
1349
|
@keydown=${this.onKeyDown}
|
|
1350
1350
|
></slot>
|
|
1351
|
-
`}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),o=this.radioButtons.indexOf(e)-1;this.radioButtons[o<0?this.radioButtons.length-1:o].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)}}
|
|
1351
|
+
`}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),o=this.radioButtons.indexOf(e)-1;this.radioButtons[o<0?this.radioButtons.length-1:o].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)}}hc.elementDefinitions={},hc.styles=cc,fc([R()],hc.prototype,"name",void 0),fc([
|
|
1352
1352
|
/**
|
|
1353
1353
|
* @license
|
|
1354
1354
|
* Copyright 2021 Google LLC
|
|
1355
1355
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1356
1356
|
*/
|
|
1357
|
-
function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}]`:":not([name])");return L(0,0,{get(){const e=this.renderRoot?.querySelector(n),o=e?.assignedElements(t)??[];return void 0===r?o:o.filter((t=>t.matches(r)))}})}}()],
|
|
1357
|
+
function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}]`:":not([name])");return L(0,0,{get(){const e=this.renderRoot?.querySelector(n),o=e?.assignedElements(t)??[];return void 0===r?o:o.filter((t=>t.matches(r)))}})}}()],hc.prototype,"radioButtons",void 0),F("ft-radio")(lc),F("ft-radio-group")(hc);const pc={borderRadiusM:Ie.external(ze.borderRadiusM,"Design system"),colorOutline:Ie.external(ze.colorOutline,"Design system"),colorOnSurface:Ie.external(ze.colorOnSurface,"Design system"),colorOnSurfaceMedium:Ie.external(ze.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:Ie.external(ze.colorOnSurfaceDisabled,"Design system"),colorPrimary:Ie.external(ze.colorPrimary,"Design system"),colorOnPrimary:Ie.external(ze.colorOnPrimary,"Design system"),fontFamily:Ie.external(es.fontFamily,"Body2 typography"),fontSize:Ie.external(es.fontSize,"Body2 typography"),fontWeight:Ie.external(es.fontWeight,"Body2 typography"),letterSpacing:Ie.external(es.letterSpacing,"Body2 typography"),lineHeight:Ie.external(es.lineHeight,"Body2 typography"),textTransform:Ie.external(es.textTransform,"Body2 typography")},dc=It`
|
|
1358
1358
|
.ft-filter-level--container {
|
|
1359
1359
|
display: flex;
|
|
1360
1360
|
flex-direction: column;
|
|
@@ -1368,14 +1368,14 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1368
1368
|
flex-shrink: 0;
|
|
1369
1369
|
text-decoration: none;
|
|
1370
1370
|
position: relative;
|
|
1371
|
-
border-radius: ${
|
|
1371
|
+
border-radius: ${pc.borderRadiusM};
|
|
1372
1372
|
overflow: hidden;
|
|
1373
1373
|
display: flex;
|
|
1374
1374
|
align-items: center;
|
|
1375
1375
|
padding: 4px 4px;
|
|
1376
1376
|
gap: 4px;
|
|
1377
1377
|
cursor: pointer;
|
|
1378
|
-
color: ${
|
|
1378
|
+
color: ${pc.colorOnSurface};
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
1381
|
.ft-filter-level--go-back:focus {
|
|
@@ -1404,7 +1404,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1404
1404
|
}
|
|
1405
1405
|
|
|
1406
1406
|
ft-button {
|
|
1407
|
-
${Ue(Gs.color,
|
|
1407
|
+
${Ue(Gs.color,pc.colorOnSurface)};
|
|
1408
1408
|
}
|
|
1409
1409
|
|
|
1410
1410
|
ft-radio, ft-checkbox {
|
|
@@ -1418,9 +1418,9 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1418
1418
|
|
|
1419
1419
|
.ft-filter-level--no-values {
|
|
1420
1420
|
margin: 10px 0;
|
|
1421
|
-
color: ${
|
|
1421
|
+
color: ${pc.colorOnSurfaceMedium};
|
|
1422
1422
|
}
|
|
1423
|
-
`;var
|
|
1423
|
+
`;var uc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class yc extends Go{constructor(){super(...arguments),this.filterId="",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 pe`
|
|
1424
1424
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
1425
1425
|
${null==this.parent?null:pe`
|
|
1426
1426
|
<div tabindex="0"
|
|
@@ -1484,7 +1484,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1484
1484
|
@change=${t=>t.stopPropagation()}>
|
|
1485
1485
|
${t.renderOption?t.renderOption:t.label}
|
|
1486
1486
|
</ft-radio>
|
|
1487
|
-
`}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}))}}
|
|
1487
|
+
`}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}))}}yc.elementDefinitions={"ft-button":ul,"ft-ripple":ya,"ft-typography":As,"ft-checkbox":tc,"ft-icon":Ms,"ft-radio":lc},yc.styles=dc,uc([R({type:String})],yc.prototype,"filterId",void 0),uc([R({type:Object})],yc.prototype,"parent",void 0),uc([R({type:Array})],yc.prototype,"options",void 0),uc([R({type:Boolean})],yc.prototype,"multivalued",void 0),uc([R({type:Boolean})],yc.prototype,"disabled",void 0),uc([R({type:Boolean})],yc.prototype,"hideSelectedOptions",void 0),uc([R({type:Boolean})],yc.prototype,"preventNavigation",void 0),uc([R({type:String})],yc.prototype,"filter",void 0),uc([R({type:String})],yc.prototype,"moreValuesButtonLabel",void 0),uc([R({type:String})],yc.prototype,"noValuesLabel",void 0),uc([R({type:Number})],yc.prototype,"displayedValuesLimit",void 0),uc([W(".ft-filter-level--container")],yc.prototype,"container",void 0),uc([I()],yc.prototype,"displayedPages",void 0);const gc={buttonsColor:Ie.extend("--ft-snap-scroll-buttons-color","",ze.colorPrimary),buttonsZIndex:Ie.create("--ft-snap-scroll-buttons-z-index","","COLOR","1"),gap:Ie.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:Ie.external(ze.colorSurface,"Design system")},bc=It`
|
|
1488
1488
|
.ft-snap-scroll {
|
|
1489
1489
|
box-sizing: border-box;
|
|
1490
1490
|
position: relative;
|
|
@@ -1519,7 +1519,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1519
1519
|
flex-wrap: nowrap;
|
|
1520
1520
|
align-items: flex-start;
|
|
1521
1521
|
justify-content: flex-start;
|
|
1522
|
-
gap: ${
|
|
1522
|
+
gap: ${gc.gap};
|
|
1523
1523
|
}
|
|
1524
1524
|
|
|
1525
1525
|
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
@@ -1562,11 +1562,11 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1562
1562
|
.ft-snap-scroll--next {
|
|
1563
1563
|
position: absolute;
|
|
1564
1564
|
display: flex;
|
|
1565
|
-
z-index: ${
|
|
1565
|
+
z-index: ${gc.buttonsZIndex};
|
|
1566
1566
|
opacity: 1;
|
|
1567
1567
|
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
1568
1568
|
${Ue(Gs.backgroundColor,"transparent")};
|
|
1569
|
-
${Ue(Gs.color,
|
|
1569
|
+
${Ue(Gs.color,gc.buttonsColor)};
|
|
1570
1570
|
}
|
|
1571
1571
|
|
|
1572
1572
|
.ft-snap-scroll--previous[hidden],
|
|
@@ -1579,37 +1579,37 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1579
1579
|
top: 0;
|
|
1580
1580
|
left: -1px;
|
|
1581
1581
|
bottom: 0;
|
|
1582
|
-
background: linear-gradient(to right, ${
|
|
1582
|
+
background: linear-gradient(to right, ${gc.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1583
1583
|
}
|
|
1584
1584
|
|
|
1585
1585
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
1586
1586
|
top: -1px;
|
|
1587
1587
|
left: 0;
|
|
1588
1588
|
right: 0;
|
|
1589
|
-
background: linear-gradient(to bottom, ${
|
|
1589
|
+
background: linear-gradient(to bottom, ${gc.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1590
1590
|
}
|
|
1591
1591
|
|
|
1592
1592
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
1593
1593
|
top: 0;
|
|
1594
1594
|
right: -1px;
|
|
1595
1595
|
bottom: 0;
|
|
1596
|
-
background: linear-gradient(to left, ${
|
|
1596
|
+
background: linear-gradient(to left, ${gc.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1597
1597
|
}
|
|
1598
1598
|
|
|
1599
1599
|
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
1600
1600
|
left: 0;
|
|
1601
1601
|
right: 0;
|
|
1602
1602
|
bottom: -1px;
|
|
1603
|
-
background: linear-gradient(to top, ${
|
|
1603
|
+
background: linear-gradient(to top, ${gc.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1604
1604
|
}
|
|
1605
1605
|
|
|
1606
1606
|
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
1607
1607
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
1608
1608
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
1609
1609
|
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1610
|
-
background-color: ${
|
|
1610
|
+
background-color: ${gc.colorSurface};
|
|
1611
1611
|
}
|
|
1612
|
-
`;var
|
|
1612
|
+
`;var mc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class vc extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class xc extends Go{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 n(200),this.updateScrollDebouncer=new n(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,o=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<o||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=ra({"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":tn}),e=this.controls&&this.withScroll;return pe`
|
|
1613
1613
|
<div part="container" class="${t}">
|
|
1614
1614
|
<ft-button
|
|
1615
1615
|
class="ft-snap-scroll--previous"
|
|
@@ -1633,7 +1633,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1633
1633
|
@click=${this.next}
|
|
1634
1634
|
></ft-button>
|
|
1635
1635
|
</div>
|
|
1636
|
-
`}update(t){super.update(t),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
|
|
1636
|
+
`}update(t){super.update(t),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 vc(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(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))}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,o;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(o=this.contentSlot)||void 0===o||o.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)}}xc.elementDefinitions={"ft-button":ul},xc.styles=bc,mc([R({type:Boolean})],xc.prototype,"horizontal",void 0),mc([R({type:Boolean})],xc.prototype,"hideScrollbar",void 0),mc([R({type:Boolean})],xc.prototype,"controls",void 0),mc([R({type:Boolean})],xc.prototype,"limitSize",void 0),mc([I()],xc.prototype,"elements",void 0),mc([I()],xc.prototype,"currentElement",void 0),mc([I()],xc.prototype,"withScroll",void 0),mc([I()],xc.prototype,"startReached",void 0),mc([I()],xc.prototype,"endReached",void 0),mc([W(".ft-snap-scroll--content")],xc.prototype,"contentSlot",void 0),F("ft-snap-scroll")(xc);const Oc=Ie.external(ze.colorOutline,"Design system"),wc=Ie.external(ze.colorOnSurface,"Design system"),Sc=Ie.external(ze.colorOnSurfaceMedium,"Design system"),Nc=Ie.external(ze.colorPrimary,"Design system"),$c=Ie.external(ze.colorSurface,"Design system"),Cc=Ie.external(ze.transitionDuration,"Design system"),Ec=Ie.external(ze.transitionTimingFunction,"Design system"),kc=Ie.extend("--ft-filter-label-color","",ze.colorOnSurface),Rc=Ie.extend("--ft-filter-label-font-size","",Na.fontSize,"16px"),Ic=[Es,It`
|
|
1637
1637
|
:host {
|
|
1638
1638
|
display: flex;
|
|
1639
1639
|
max-height: 100%;
|
|
@@ -1668,8 +1668,8 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1668
1668
|
flex-shrink: 1;
|
|
1669
1669
|
flex-grow: 1;
|
|
1670
1670
|
word-break: break-word;
|
|
1671
|
-
color: ${
|
|
1672
|
-
font-size: ${
|
|
1671
|
+
color: ${kc};
|
|
1672
|
+
font-size: ${Rc};
|
|
1673
1673
|
${Ue(Na.lineHeight,"22px")};
|
|
1674
1674
|
${Ue(Na.fontWeight,"bold")};
|
|
1675
1675
|
}
|
|
@@ -1682,8 +1682,8 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1682
1682
|
padding: 0 10px;
|
|
1683
1683
|
overflow: hidden;
|
|
1684
1684
|
height: 32px;
|
|
1685
|
-
transition: height ${
|
|
1686
|
-
margin ${
|
|
1685
|
+
transition: height ${Cc} ${Ec},
|
|
1686
|
+
margin ${Cc} ${Ec};
|
|
1687
1687
|
transition-delay: 500ms;
|
|
1688
1688
|
}
|
|
1689
1689
|
|
|
@@ -1696,15 +1696,15 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1696
1696
|
display: block;
|
|
1697
1697
|
width: 100%;
|
|
1698
1698
|
border-radius: 4px;
|
|
1699
|
-
border: 1px solid ${
|
|
1699
|
+
border: 1px solid ${Oc};
|
|
1700
1700
|
padding: 4px;
|
|
1701
|
-
background-color: ${
|
|
1702
|
-
color: ${
|
|
1703
|
-
outline-color: ${
|
|
1701
|
+
background-color: ${$c};
|
|
1702
|
+
color: ${wc};
|
|
1703
|
+
outline-color: ${Nc};
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
1706
1706
|
input::placeholder {
|
|
1707
|
-
color: ${
|
|
1707
|
+
color: ${Sc};
|
|
1708
1708
|
}
|
|
1709
1709
|
|
|
1710
1710
|
input:placeholder-shown {
|
|
@@ -1720,7 +1720,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1720
1720
|
}
|
|
1721
1721
|
|
|
1722
1722
|
.ft-filter--separator {
|
|
1723
|
-
border-top: 1px solid ${
|
|
1723
|
+
border-top: 1px solid ${Oc};
|
|
1724
1724
|
margin: 4px 10px;
|
|
1725
1725
|
}
|
|
1726
1726
|
|
|
@@ -1745,7 +1745,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1745
1745
|
slot:not([name]) {
|
|
1746
1746
|
display: none;
|
|
1747
1747
|
}
|
|
1748
|
-
`];var
|
|
1748
|
+
`];var Uc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Lc extends CustomEvent{constructor(t){super("change",{detail:t})}}class Wc extends Go{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.lastLevelHasHiddenvalues=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new n(300),this.changeDebouncer=new n(10),this.lastDispatchedValues=[]}get flatOptions(){return z(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return z(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,o=this.filterPlaceHolder.replace("{0}",this.label);return pe`
|
|
1749
1749
|
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1750
1750
|
part="container">
|
|
1751
1751
|
${this.label||t?pe`
|
|
@@ -1817,18 +1817,18 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1817
1817
|
.exportpartsPrefixes=${["values","available-values"]}
|
|
1818
1818
|
noValuesLabel="${this.noValuesLabel}"
|
|
1819
1819
|
></ft-filter-level>
|
|
1820
|
-
`}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;j(this.lastDispatchedValues,t)||(this.dispatchEvent(new
|
|
1820
|
+
`}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;j(this.lastDispatchedValues,t)||(this.dispatchEvent(new Lc(t)),this.lastDispatchedValues=t)}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)}}Wc.elementDefinitions={"ft-button":ul,"ft-filter-level":yc,"ft-snap-scroll":xc,"ft-typography":As},Wc.styles=Ic,Uc([R({type:String})],Wc.prototype,"id",void 0),Uc([R({type:String})],Wc.prototype,"label",void 0),Uc([R({type:String})],Wc.prototype,"filterPlaceHolder",void 0),Uc([R({type:String})],Wc.prototype,"clearButtonLabel",void 0),Uc([R({type:String})],Wc.prototype,"moreValuesButtonLabel",void 0),Uc([R({type:String})],Wc.prototype,"noValuesLabel",void 0),Uc([B([])],Wc.prototype,"options",void 0),Uc([R({type:Boolean})],Wc.prototype,"multivalued",void 0),Uc([R({type:Boolean})],Wc.prototype,"disabled",void 0),Uc([R({type:Boolean})],Wc.prototype,"raiseSelectedOptions",void 0),Uc([R({type:Number})],Wc.prototype,"displayedValuesLimit",void 0),Uc([R({type:Boolean})],Wc.prototype,"hideClearButton",void 0),Uc([W(".ft-filter--slot")],Wc.prototype,"slotElement",void 0),Uc([W(".ft-filter--container")],Wc.prototype,"container",void 0),Uc([W(".ft-filter--values")],Wc.prototype,"valuesContainer",void 0),Uc([W(".ft-filter--levels")],Wc.prototype,"levelsContainer",void 0),Uc([I()],Wc.prototype,"lastLevelHasHiddenvalues",void 0),Uc([W(".ft-filter--filter input")],Wc.prototype,"filterInput",void 0),Uc([function(t){return(e,o)=>L(0,0,{get(){return(this.renderRoot??(A??=document.createDocumentFragment())).querySelectorAll(t)}})}(".ft-filter--levels ft-filter-level")],Wc.prototype,"levels",void 0),Uc([I()],Wc.prototype,"withScroll",void 0),Uc([I()],Wc.prototype,"filter",void 0),Uc([I()],Wc.prototype,"slideIn",void 0),Uc([I()],Wc.prototype,"slideOut",void 0);var Ac=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Dc extends Go{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return pe`
|
|
1821
1821
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1822
|
-
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}
|
|
1822
|
+
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Dc.elementDefinitions={},Ac([R({type:String})],Dc.prototype,"label",void 0),Ac([R({type:Object,converter:t=>t})],Dc.prototype,"value",void 0),Ac([R({type:Boolean,reflect:!0})],Dc.prototype,"selected",void 0),Ac([R({type:Object})],Dc.prototype,"subOptions",void 0),Ac([B({})],Dc.prototype,"renderOption",void 0),Ac([W(".ft-filter-option--slot")],Dc.prototype,"slotElement",void 0),F("ft-filter")(Wc),F("ft-filter-option")(Dc);const zc=Fl.build("designedSearchType"),jc={label:"Search scope",documentTitlesOnly:"Search in document titles only"};var Fc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Bc extends(Wl(ia)){constructor(){super(),this.addI18nContext(zc,jc)}render(){return pe`
|
|
1823
1823
|
<ft-filter
|
|
1824
|
-
label=${
|
|
1825
|
-
.options=${[{label:
|
|
1824
|
+
label=${zc.messages.label()}
|
|
1825
|
+
.options=${[{label:zc.messages.documentTitlesOnly(),value:t=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setSearchInDocumentTitlesOnly(t)},selected:this.searchInDocumentTitlesOnly}]}
|
|
1826
1826
|
part="filter"
|
|
1827
1827
|
.exportpartsPrefixes=${["filter"]}
|
|
1828
1828
|
multivalued
|
|
1829
1829
|
@change=${this.onSelected}
|
|
1830
1830
|
></ft-filter>
|
|
1831
|
-
`}onSelected(t){var e;null===(e=this.filter)||void 0===e||e.options.forEach((t=>t.value(t.selected)))}}
|
|
1831
|
+
`}onSelected(t){var e;null===(e=this.filter)||void 0===e||e.options.forEach((t=>t.value(t.selected)))}}Bc.elementDefinitions={"ft-filter":Wc},Bc.styles=_l,Fc([Jo({selector:Xn})],Bc.prototype,"searchInDocumentTitlesOnly",void 0),Fc([W("ft-filter")],Bc.prototype,"filter",void 0),F("ft-search-type")(Bc);var Pc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Kc extends(Wl(ia)){get hasSomethingToDisplay(){var t;return this.searchInDocumentTitlesOnly||(null===(t=this.facets)||void 0===t?void 0:t.some((t=>this.getSelectedValues(t).length>0)))}constructor(){super(),this.addI18nContext(zc,jc)}render(){return this.hasSomethingToDisplay?pe`
|
|
1832
1832
|
<div class="ft-search-selected-facets--container">
|
|
1833
1833
|
${dn(this.facets||[],(t=>t.key),(t=>{const e=this.getSelectedValues(t);return dn(e,(e=>t.key+"-"+e),(o=>this.renderFacet(t.key,t.label,e,o)))}))}
|
|
1834
1834
|
${this.renderSearchInDocumentTitlesOnly()}
|
|
@@ -1847,13 +1847,13 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
|
|
|
1847
1847
|
</ft-chip>
|
|
1848
1848
|
</ft-tooltip>
|
|
1849
1849
|
`}getSelectedValues(t){return z(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}getLabelFromValue(t){return this.unquote(t).split("|").pop()}getBreadcrumbFromValue(t){return this.unquote(t).split("|").join(" > ")}unquote(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}renderSearchInDocumentTitlesOnly(){return this.searchInDocumentTitlesOnly?pe`
|
|
1850
|
-
<ft-tooltip inline text="${
|
|
1850
|
+
<ft-tooltip inline text="${zc.messages.documentTitlesOnly()}"
|
|
1851
1851
|
part="tooltips tooltip-search-in-document-titles-only">
|
|
1852
1852
|
<ft-chip
|
|
1853
1853
|
part="ft-search-selected-facets ft-search-selected-facet-search-in-document-titles-only"
|
|
1854
1854
|
removable
|
|
1855
1855
|
@icon-click=${()=>{var t;return null===(t=this.stateManager)||void 0===t?void 0:t.setSearchInDocumentTitlesOnly(!1)}}>
|
|
1856
|
-
${
|
|
1856
|
+
${zc.messages.documentTitlesOnly()}
|
|
1857
1857
|
</ft-chip>
|
|
1858
1858
|
</ft-tooltip>
|
|
1859
|
-
`:ue}}
|
|
1859
|
+
`:ue}}Kc.elementDefinitions={"ft-chip":El,"ft-tooltip":cl},Kc.styles=yn,Pc([Jo({store:"search"})],Kc.prototype,"facets",void 0),Pc([Jo({store:"search",selector:Xn})],Kc.prototype,"searchInDocumentTitlesOnly",void 0),F("ft-search-selected-facets")(Kc),t.FtSearchSelectedFacets=Kc,t.FtSearchSelectedFacetsCssVariables=un,t.styles=yn}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-selected-facets",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.34",
|
|
4
4
|
"description": "List of selected facets in a designed search page context",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-chip": "1.1.
|
|
23
|
-
"@fluid-topics/ft-search-context": "1.1.
|
|
24
|
-
"@fluid-topics/ft-search-type": "1.1.
|
|
25
|
-
"@fluid-topics/ft-tooltip": "1.1.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-chip": "1.1.34",
|
|
23
|
+
"@fluid-topics/ft-search-context": "1.1.34",
|
|
24
|
+
"@fluid-topics/ft-search-type": "1.1.34",
|
|
25
|
+
"@fluid-topics/ft-tooltip": "1.1.34",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.1.34",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "1e947e93e937ded84f056955b14b760e9dea7058"
|
|
30
30
|
}
|