@fluid-topics/ftds-tree-list 2.2.56 → 2.2.59
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.`,l.colorGray200),contentGlobalSubtle:n.extend("--ftds-con
|
|
|
68
68
|
width:auto;
|
|
69
69
|
height:auto;
|
|
70
70
|
}
|
|
71
|
-
`;var As={};G(As,{withAriaNotification:()=>hp});var pp={checkVisibility:!0},hp=pe(Symbol("withAriaNotification"),function(t){class e extends t{sendAriaNotification(o,a){let{checkVisibility:i}={...pp,...a};setTimeout(()=>{(!i||this.checkVisibility())&&(o=typeof o=="string"?o:o?.message,o&&this.dispatchEvent(new io({type:"aria",message:o})))},20)}}return e});var Os={};G(Os,{withConditionalVisibility:()=>mp});var L2=function(t,e,r,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i};function mp(t){class e extends t{constructor(){super(...arguments),this.forceVisible=!1,this.isVisible=!0,this.isElementWithConditionalVisibility=!0}calculateStyles(o,a){if(o){let i=document.createElement("style");i.classList.add("conditional-visibility-style"),i.innerHTML=a,this.shadowRoot.append(i)}}hideIfNecessary(){let o=!(this.forceVisible||this.isVisible);this.calculateStyles(o,":host { display: none !important; }")}highlightIfForceVisible(){this.calculateStyles(this.forceVisible,":host { box-shadow: 0px 0px 0px 8px rgba(227,119,59,0.4) inset; }")}willUpdate(o){super.willUpdate(o),this.updateComplete.then(()=>{this.shadowRoot.querySelectorAll(".conditional-visibility-style").forEach(a=>a.remove()),this.hideIfNecessary(),this.highlightIfForceVisible()})}}return L2([L({type:Boolean,attribute:!1})],e.prototype,"forceVisible",void 0),L2([q()],e.prototype,"isVisible",void 0),e}var Rs={};G(Rs,{FormController:()=>ws});function gp(t){let e={};for(let r of Object.keys(t))e[r]=t[r].initial;return e}var ws=class{constructor(e,r){this.host=e,this.config=r,this.errors=new Map,this.submitting=!1,e.addController(this),this.initial=gp(r),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,r){if(this.data[e]===r)return;let o={...this.data};o[e]=r,this.data=o,this.
|
|
71
|
+
`;var As={};G(As,{withAriaNotification:()=>hp});var pp={checkVisibility:!0},hp=pe(Symbol("withAriaNotification"),function(t){class e extends t{sendAriaNotification(o,a){let{checkVisibility:i}={...pp,...a};setTimeout(()=>{(!i||this.checkVisibility())&&(o=typeof o=="string"?o:o?.message,o&&this.dispatchEvent(new io({type:"aria",message:o})))},20)}}return e});var Os={};G(Os,{withConditionalVisibility:()=>mp});var L2=function(t,e,r,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i};function mp(t){class e extends t{constructor(){super(...arguments),this.forceVisible=!1,this.isVisible=!0,this.isElementWithConditionalVisibility=!0}calculateStyles(o,a){if(o){let i=document.createElement("style");i.classList.add("conditional-visibility-style"),i.innerHTML=a,this.shadowRoot.append(i)}}hideIfNecessary(){let o=!(this.forceVisible||this.isVisible);this.calculateStyles(o,":host { display: none !important; }")}highlightIfForceVisible(){this.calculateStyles(this.forceVisible,":host { box-shadow: 0px 0px 0px 8px rgba(227,119,59,0.4) inset; }")}willUpdate(o){super.willUpdate(o),this.updateComplete.then(()=>{this.shadowRoot.querySelectorAll(".conditional-visibility-style").forEach(a=>a.remove()),this.hideIfNecessary(),this.highlightIfForceVisible()})}}return L2([L({type:Boolean,attribute:!1})],e.prototype,"forceVisible",void 0),L2([q()],e.prototype,"isVisible",void 0),e}var Rs={};G(Rs,{FormController:()=>ws});function gp(t){let e={};for(let r of Object.keys(t))e[r]=t[r].initial;return e}var ws=class{constructor(e,r){this.host=e,this.config=r,this.errors=new Map,this.submitting=!1,e.addController(this),this.initial=gp(r),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,r){if(this.data[e]===r)return;let o={...this.data};o[e]=r,this.data=o,this.errors.delete(e),this.validateField(e),this.host.requestUpdate()}bind(e){return r=>this.setValue(e,r.detail)}setInitialValues(e){this.initial={...e},this.reset()}reset(){this.data={...this.initial},this.errors.clear(),this.submitting=!1,this.host.requestUpdate()}validateField(e,r){var o,a;let i=(a=(o=this.config[e]).validator)===null||a===void 0?void 0:a.call(o,this.value(e),this.data,r);i!==void 0&&this.errors.set(e,i)}checkValidity(e){return this.errors.clear(),this.fields.forEach(r=>{this.validateField(r,e)}),this.host.requestUpdate(),!this.inError}get firstFieldSelectorInError(){for(let e of this.fields){let r=this.config[e].selector;if(this.errors.has(e)&&r!==void 0)return r}}focusFirstFieldInError(){let e=this.firstFieldSelectorInError;if(e===void 0)return;let r=this.host.renderRoot.querySelector(e);r instanceof HTMLElement&&r.focus()}async submit(e){var r,o,a;if(!this.submitting){this.submitting=!0,this.host.requestUpdate();try{if(!this.checkValidity()){this.focusFirstFieldInError(),(r=e.onInvalid)===null||r===void 0||r.call(e);return}e.onSuccess(await e.request(this.data))}catch(i){let s=Ka(i)?i:void 0;if(!this.checkValidity(s)){this.focusFirstFieldInError(),(o=e.onInvalid)===null||o===void 0||o.call(e);return}(a=e.onFailure)===null||a===void 0||a.call(e,s)}finally{this.submitting=!1,this.host.requestUpdate()}}}};var Ns={};G(Ns,{MetadataValueLocalizer:()=>_s});var _s=class{constructor(e){this.contentLocales=e}localize(e){var r,o;return e?.key!=="ft:locale"?e:{...e,displayValue:(r=this.findLocaleValue(e))!==null&&r!==void 0?r:e.displayValue,displayTooltipValue:(o=this.findLocaleValue(e))!==null&&o!==void 0?o:e.displayTooltipValue}}findLocaleValue(e){var r;return(r=this.contentLocales.find(o=>o.lang===e.value))===null||r===void 0?void 0:r.label}};function Ms(t,e){return e.map(r=>r(t)).filter(r=>r!==!0).map(r=>r)}function Lt(t,e,r){return t?e(t):r?.(t)}var le=function(t,e,r,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Yt;(function(t){t.blur="blur",t.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",t.input="input"})(Yt||(Yt={}));var ut;(function(t){t.default="default",t.warning="warning",t.error="error"})(ut||(ut={}));var No=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}};var Eb=pe(Symbol("toFtInput"),function(t){class e extends t{constructor(){super(...arguments),this.warningRules=[],this.errorRules=[],this.validateOn=Yt.blurWithStatusResolutionOnInput,this.validateAtRender=!1,this.label="",this.hideLabel=!1,this.name="",this.disabled=!1,this.errorMessages=[],this.warningMessages=[],this.status=ut.default,this.focused=!1,this.additionalWarningRules=[],this.additionalErrorRules=[],this.externalErrorMessages=[],this.ruleErrorMessages=[]}willUpdate(o){super.willUpdate(o),o.has("externalErrorMessages")&&(this.errorMessages=[...this.externalErrorMessages,...this.ruleErrorMessages],this.status=this.resolveStatus(),this.dispatchEvent(new No(this.status)))}connectedCallback(){super.connectedCallback(),this.validateAtRender&&this.triggerValidation()}onBlur(){this.focused=!1,(this.validateOn===Yt.blur||this.validateOn===Yt.blurWithStatusResolutionOnInput)&&this.triggerValidation()}onFocus(){this.focused=!0}onInput(){this.externalErrorMessages.length>0&&(this.externalErrorMessages=[]),(this.status!==ut.default&&this.validateOn===Yt.blurWithStatusResolutionOnInput||this.validateOn===Yt.input)&&this.triggerValidation()}triggerValidation(){this.ruleErrorMessages=Ms(this.value,[...this.errorRules,...this.additionalErrorRules]),this.errorMessages=[...this.externalErrorMessages,...this.ruleErrorMessages],this.warningMessages=Ms(this.value,[...this.warningRules,...this.additionalWarningRules]),this.status=this.resolveStatus(),this.dispatchEvent(new No(this.status))}resetValidation(){this.externalErrorMessages=[],this.ruleErrorMessages=[],this.errorMessages=[],this.warningMessages=[],this.status=this.resolveStatus(),this.dispatchEvent(new No(this.status))}get messagesForScreenReaderElementId(){return"sr-helper-text-list"}renderMessagesForScreenReader(){return P`
|
|
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
|
${zt(this.errorMessages,o=>P`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ftds-tree-list",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.59",
|
|
4
4
|
"description": "The design system tree list component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@fluid-topics/design-system-variables": "3.19.0",
|
|
23
|
-
"@fluid-topics/ft-assets": "2.2.
|
|
24
|
-
"@fluid-topics/ft-skeleton": "2.2.
|
|
25
|
-
"@fluid-topics/ft-wc-utils": "2.2.
|
|
26
|
-
"@fluid-topics/ftds-button": "2.2.
|
|
27
|
-
"@fluid-topics/ftds-icon": "2.2.
|
|
28
|
-
"@fluid-topics/ftds-typography": "2.2.
|
|
23
|
+
"@fluid-topics/ft-assets": "2.2.59",
|
|
24
|
+
"@fluid-topics/ft-skeleton": "2.2.59",
|
|
25
|
+
"@fluid-topics/ft-wc-utils": "2.2.59",
|
|
26
|
+
"@fluid-topics/ftds-button": "2.2.59",
|
|
27
|
+
"@fluid-topics/ftds-icon": "2.2.59",
|
|
28
|
+
"@fluid-topics/ftds-typography": "2.2.59",
|
|
29
29
|
"lit": "3.3.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@fluid-topics/ft-wc-test-utils": "2.2.
|
|
32
|
+
"@fluid-topics/ft-wc-test-utils": "2.2.59"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "029e1bc93642f3edaa37aa64565a98e52c6df9bd"
|
|
35
35
|
}
|