@fluid-topics/ft-search-result-title 2.2.56 → 2.2.57
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.
|
@@ -68,7 +68,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
68
68
|
width:auto;
|
|
69
69
|
height:auto;
|
|
70
70
|
}
|
|
71
|
-
`;var Ni={};k(Ni,{withAriaNotification:()=>of});var rf={checkVisibility:!0},of=H(Symbol("withAriaNotification"),function(t){class e extends t{sendAriaNotification(n,i){let{checkVisibility:a}={...rf,...i};setTimeout(()=>{(!a||this.checkVisibility())&&(n=typeof n=="string"?n:n?.message,n&&this.dispatchEvent(new ar({type:"aria",message:n})))},20)}}return e});var Pi={};k(Pi,{withConditionalVisibility:()=>nf});var bl=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a};function nf(t){class e extends t{constructor(){super(...arguments),this.forceVisible=!1,this.isVisible=!0,this.isElementWithConditionalVisibility=!0}calculateStyles(n,i){if(n){let a=document.createElement("style");a.classList.add("conditional-visibility-style"),a.innerHTML=i,this.shadowRoot.append(a)}}hideIfNecessary(){let n=!(this.forceVisible||this.isVisible);this.calculateStyles(n,":host { display: none !important; }")}highlightIfForceVisible(){this.calculateStyles(this.forceVisible,":host { box-shadow: 0px 0px 0px 8px rgba(227,119,59,0.4) inset; }")}willUpdate(n){super.willUpdate(n),this.updateComplete.then(()=>{this.shadowRoot.querySelectorAll(".conditional-visibility-style").forEach(i=>i.remove()),this.hideIfNecessary(),this.highlightIfForceVisible()})}}return bl([O({type:Boolean,attribute:!1})],e.prototype,"forceVisible",void 0),bl([j()],e.prototype,"isVisible",void 0),e}var Mi={};k(Mi,{FormController:()=>Fi});function af(t){let e={};for(let o of Object.keys(t))e[o]=t[o].initial;return e}var Fi=class{constructor(e,o){this.host=e,this.config=o,this.errors=new Map,this.submitting=!1,e.addController(this),this.initial=af(o),this.data={...this.initial}}hostDisconnected(){this.submitting=!1}get values(){return this.data}get fields(){return Object.keys(this.config)}get isSubmitting(){return this.submitting}get inError(){return this.errors.size>0}value(e){return this.data[e]}hasError(e){return this.errors.has(e)}errorFor(e){return this.errors.get(e)}setValue(e,o){if(this.data[e]===o)return;let n={...this.data};n[e]=o,this.data=n,this.
|
|
71
|
+
`;var Ni={};k(Ni,{withAriaNotification:()=>of});var rf={checkVisibility:!0},of=H(Symbol("withAriaNotification"),function(t){class e extends t{sendAriaNotification(n,i){let{checkVisibility:a}={...rf,...i};setTimeout(()=>{(!a||this.checkVisibility())&&(n=typeof n=="string"?n:n?.message,n&&this.dispatchEvent(new ar({type:"aria",message:n})))},20)}}return e});var Pi={};k(Pi,{withConditionalVisibility:()=>nf});var bl=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a};function nf(t){class e extends t{constructor(){super(...arguments),this.forceVisible=!1,this.isVisible=!0,this.isElementWithConditionalVisibility=!0}calculateStyles(n,i){if(n){let a=document.createElement("style");a.classList.add("conditional-visibility-style"),a.innerHTML=i,this.shadowRoot.append(a)}}hideIfNecessary(){let n=!(this.forceVisible||this.isVisible);this.calculateStyles(n,":host { display: none !important; }")}highlightIfForceVisible(){this.calculateStyles(this.forceVisible,":host { box-shadow: 0px 0px 0px 8px rgba(227,119,59,0.4) inset; }")}willUpdate(n){super.willUpdate(n),this.updateComplete.then(()=>{this.shadowRoot.querySelectorAll(".conditional-visibility-style").forEach(i=>i.remove()),this.hideIfNecessary(),this.highlightIfForceVisible()})}}return bl([O({type:Boolean,attribute:!1})],e.prototype,"forceVisible",void 0),bl([j()],e.prototype,"isVisible",void 0),e}var Mi={};k(Mi,{FormController:()=>Fi});function af(t){let e={};for(let o of Object.keys(t))e[o]=t[o].initial;return e}var Fi=class{constructor(e,o){this.host=e,this.config=o,this.errors=new Map,this.submitting=!1,e.addController(this),this.initial=af(o),this.data={...this.initial}}hostDisconnected(){this.submitting=!1}get values(){return this.data}get fields(){return Object.keys(this.config)}get isSubmitting(){return this.submitting}get inError(){return this.errors.size>0}value(e){return this.data[e]}hasError(e){return this.errors.has(e)}errorFor(e){return this.errors.get(e)}setValue(e,o){if(this.data[e]===o)return;let n={...this.data};n[e]=o,this.data=n,this.errors.delete(e),this.validateField(e),this.host.requestUpdate()}bind(e){return o=>this.setValue(e,o.detail)}setInitialValues(e){this.initial={...e},this.reset()}reset(){this.data={...this.initial},this.errors.clear(),this.submitting=!1,this.host.requestUpdate()}validateField(e,o){var n,i;let a=(i=(n=this.config[e]).validator)===null||i===void 0?void 0:i.call(n,this.value(e),this.data,o);a!==void 0&&this.errors.set(e,a)}checkValidity(e){return this.errors.clear(),this.fields.forEach(o=>{this.validateField(o,e)}),this.host.requestUpdate(),!this.inError}get firstFieldSelectorInError(){for(let e of this.fields){let o=this.config[e].selector;if(this.errors.has(e)&&o!==void 0)return o}}focusFirstFieldInError(){let e=this.firstFieldSelectorInError;if(e===void 0)return;let o=this.host.renderRoot.querySelector(e);o instanceof HTMLElement&&o.focus()}async submit(e){var o,n,i;if(!this.submitting){this.submitting=!0,this.host.requestUpdate();try{if(!this.checkValidity()){this.focusFirstFieldInError(),(o=e.onInvalid)===null||o===void 0||o.call(e);return}e.onSuccess(await e.request(this.data))}catch(a){let s=vn(a)?a:void 0;if(!this.checkValidity(s)){this.focusFirstFieldInError(),(n=e.onInvalid)===null||n===void 0||n.call(e);return}(i=e.onFailure)===null||i===void 0||i.call(e,s)}finally{this.submitting=!1,this.host.requestUpdate()}}}};var Ui={};k(Ui,{MetadataValueLocalizer:()=>Di});var Di=class{constructor(e){this.contentLocales=e}localize(e){var o,n;return e?.key!=="ft:locale"?e:{...e,displayValue:(o=this.findLocaleValue(e))!==null&&o!==void 0?o:e.displayValue,displayTooltipValue:(n=this.findLocaleValue(e))!==null&&n!==void 0?n:e.displayTooltipValue}}findLocaleValue(e){var o;return(o=this.contentLocales.find(n=>n.lang===e.value))===null||o===void 0?void 0:o.label}};function Bi(t,e){return e.map(o=>o(t)).filter(o=>o!==!0).map(o=>o)}function xl(t,e,o){return t?e(t):o?.(t)}var V=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},st;(function(t){t.blur="blur",t.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",t.input="input"})(st||(st={}));var Ie;(function(t){t.default="default",t.warning="warning",t.error="error"})(Ie||(Ie={}));var Ir=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}};var U0=H(Symbol("toFtInput"),function(t){class e extends t{constructor(){super(...arguments),this.warningRules=[],this.errorRules=[],this.validateOn=st.blurWithStatusResolutionOnInput,this.validateAtRender=!1,this.label="",this.hideLabel=!1,this.name="",this.disabled=!1,this.errorMessages=[],this.warningMessages=[],this.status=Ie.default,this.focused=!1,this.additionalWarningRules=[],this.additionalErrorRules=[],this.externalErrorMessages=[],this.ruleErrorMessages=[]}willUpdate(n){super.willUpdate(n),n.has("externalErrorMessages")&&(this.errorMessages=[...this.externalErrorMessages,...this.ruleErrorMessages],this.status=this.resolveStatus(),this.dispatchEvent(new Ir(this.status)))}connectedCallback(){super.connectedCallback(),this.validateAtRender&&this.triggerValidation()}onBlur(){this.focused=!1,(this.validateOn===st.blur||this.validateOn===st.blurWithStatusResolutionOnInput)&&this.triggerValidation()}onFocus(){this.focused=!0}onInput(){this.externalErrorMessages.length>0&&(this.externalErrorMessages=[]),(this.status!==Ie.default&&this.validateOn===st.blurWithStatusResolutionOnInput||this.validateOn===st.input)&&this.triggerValidation()}triggerValidation(){this.ruleErrorMessages=Bi(this.value,[...this.errorRules,...this.additionalErrorRules]),this.errorMessages=[...this.externalErrorMessages,...this.ruleErrorMessages],this.warningMessages=Bi(this.value,[...this.warningRules,...this.additionalWarningRules]),this.status=this.resolveStatus(),this.dispatchEvent(new Ir(this.status))}resetValidation(){this.externalErrorMessages=[],this.ruleErrorMessages=[],this.errorMessages=[],this.warningMessages=[],this.status=this.resolveStatus(),this.dispatchEvent(new Ir(this.status))}get messagesForScreenReaderElementId(){return"sr-helper-text-list"}renderMessagesForScreenReader(){return X`
|
|
72
72
|
<ul aria-live="polite" id="${this.messagesForScreenReaderElementId}"
|
|
73
73
|
style="position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;list-style:none;">
|
|
74
74
|
${Gr(this.errorMessages,n=>X`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-result-title",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.57",
|
|
4
4
|
"description": "Search result title for integrated search component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-search-context": "2.2.
|
|
23
|
-
"@fluid-topics/ft-search-result-context": "2.2.
|
|
24
|
-
"@fluid-topics/ft-typography": "2.2.
|
|
25
|
-
"@fluid-topics/ft-wc-utils": "2.2.
|
|
22
|
+
"@fluid-topics/ft-search-context": "2.2.57",
|
|
23
|
+
"@fluid-topics/ft-search-result-context": "2.2.57",
|
|
24
|
+
"@fluid-topics/ft-typography": "2.2.57",
|
|
25
|
+
"@fluid-topics/ft-wc-utils": "2.2.57",
|
|
26
26
|
"lit": "3.3.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@fluid-topics/public-api": "1.0.153"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "a902c6335614244438e63b068a745c42f1bafda5"
|
|
32
32
|
}
|