@fluid-topics/ftds-period-picker 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.`,l.colorGray200),contentGlobalSubtle:n.extend("--ftds-con
68
68
  width:auto;
69
69
  height:auto;
70
70
  }
71
- `;var Cc={};j(Cc,{withAriaNotification:()=>_3});var R3={checkVisibility:!0},_3=Re(Symbol("withAriaNotification"),function(t){class e extends t{sendAriaNotification(o,i){let{checkVisibility:a}={...R3,...i};setTimeout(()=>{(!a||this.checkVisibility())&&(o=typeof o=="string"?o:o?.message,o&&this.dispatchEvent(new qo({type:"aria",message:o})))},20)}}return e});var Ec={};j(Ec,{withConditionalVisibility:()=>I3});var w2=function(t,e,r,o){var i=arguments.length,a=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};function I3(t){class e extends t{constructor(){super(...arguments),this.forceVisible=!1,this.isVisible=!0,this.isElementWithConditionalVisibility=!0}calculateStyles(o,i){if(o){let a=document.createElement("style");a.classList.add("conditional-visibility-style"),a.innerHTML=i,this.shadowRoot.append(a)}}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(i=>i.remove()),this.hideIfNecessary(),this.highlightIfForceVisible()})}}return w2([b({type:Boolean,attribute:!1})],e.prototype,"forceVisible",void 0),w2([B()],e.prototype,"isVisible",void 0),e}var Oc={};j(Oc,{FormController:()=>Lc});function M3(t){let e={};for(let r of Object.keys(t))e[r]=t[r].initial;return e}var Lc=class{constructor(e,r){this.host=e,this.config=r,this.errors=new Map,this.submitting=!1,e.addController(this),this.initial=M3(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.checkValidity()}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,i;let a=(i=(o=this.config[e]).validator)===null||i===void 0?void 0:i.call(o,this.value(e),this.data,r);a!==void 0&&this.errors.set(e,a)}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,i;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(a){let s=Ka(a)?a:void 0;if(!this.checkValidity(s)){this.focusFirstFieldInError(),(o=e.onInvalid)===null||o===void 0||o.call(e);return}(i=e.onFailure)===null||i===void 0||i.call(e,s)}finally{this.submitting=!1,this.host.requestUpdate()}}}};var wc={};j(wc,{MetadataValueLocalizer:()=>Ac});var Ac=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}};var N3=/^https?:\/\//,k3=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;function Rc(t,e,r){return r?t.test(r)?!0:e:!0}var _c={required:function(t){return e=>!!e?.trim()||t},regex:function(t,e){return r=>Rc(t,e,r)},email:function(t){return e=>Rc(k3,t,e)},url:function(t){return e=>Rc(N3,t,e)},min:function(t,e,r=!1){return o=>o===void 0||(r?o>e:o>=e)?!0:t},max:function(t,e,r=!1){return o=>o===void 0||(r?o<e:o<=e)?!0:t},maxLength:function(t,e,r=!1){return o=>o===void 0||o.length===void 0||(r?o.length<e:o.length<=e)?!0:t}};function Ic(t,e){return e.map(r=>r(t)).filter(r=>r!==!0).map(r=>r)}function Qe(t,e,r){return t?e(t):r?.(t)}var Oe=function(t,e,r,o){var i=arguments.length,a=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ir;(function(t){t.blur="blur",t.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",t.input="input"})(Ir||(Ir={}));var le;(function(t){t.default="default",t.warning="warning",t.error="error"})(le||(le={}));var vn=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}},Mi=class extends CustomEvent{constructor(e){super("change",{detail:e,bubbles:!0,composed:!0})}},rr=Re(Symbol("toFtInput"),function(t){class e extends t{constructor(){super(...arguments),this.warningRules=[],this.errorRules=[],this.validateOn=Ir.blurWithStatusResolutionOnInput,this.validateAtRender=!1,this.label="",this.hideLabel=!1,this.name="",this.disabled=!1,this.errorMessages=[],this.warningMessages=[],this.status=le.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 vn(this.status)))}connectedCallback(){super.connectedCallback(),this.validateAtRender&&this.triggerValidation()}onBlur(){this.focused=!1,(this.validateOn===Ir.blur||this.validateOn===Ir.blurWithStatusResolutionOnInput)&&this.triggerValidation()}onFocus(){this.focused=!0}onInput(){this.externalErrorMessages.length>0&&(this.externalErrorMessages=[]),(this.status!==le.default&&this.validateOn===Ir.blurWithStatusResolutionOnInput||this.validateOn===Ir.input)&&this.triggerValidation()}triggerValidation(){this.ruleErrorMessages=Ic(this.value,[...this.errorRules,...this.additionalErrorRules]),this.errorMessages=[...this.externalErrorMessages,...this.ruleErrorMessages],this.warningMessages=Ic(this.value,[...this.warningRules,...this.additionalWarningRules]),this.status=this.resolveStatus(),this.dispatchEvent(new vn(this.status))}resetValidation(){this.externalErrorMessages=[],this.ruleErrorMessages=[],this.errorMessages=[],this.warningMessages=[],this.status=this.resolveStatus(),this.dispatchEvent(new vn(this.status))}get messagesForScreenReaderElementId(){return"sr-helper-text-list"}renderMessagesForScreenReader(){return N`
71
+ `;var Cc={};j(Cc,{withAriaNotification:()=>_3});var R3={checkVisibility:!0},_3=Re(Symbol("withAriaNotification"),function(t){class e extends t{sendAriaNotification(o,i){let{checkVisibility:a}={...R3,...i};setTimeout(()=>{(!a||this.checkVisibility())&&(o=typeof o=="string"?o:o?.message,o&&this.dispatchEvent(new qo({type:"aria",message:o})))},20)}}return e});var Ec={};j(Ec,{withConditionalVisibility:()=>I3});var w2=function(t,e,r,o){var i=arguments.length,a=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};function I3(t){class e extends t{constructor(){super(...arguments),this.forceVisible=!1,this.isVisible=!0,this.isElementWithConditionalVisibility=!0}calculateStyles(o,i){if(o){let a=document.createElement("style");a.classList.add("conditional-visibility-style"),a.innerHTML=i,this.shadowRoot.append(a)}}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(i=>i.remove()),this.hideIfNecessary(),this.highlightIfForceVisible()})}}return w2([b({type:Boolean,attribute:!1})],e.prototype,"forceVisible",void 0),w2([B()],e.prototype,"isVisible",void 0),e}var Oc={};j(Oc,{FormController:()=>Lc});function M3(t){let e={};for(let r of Object.keys(t))e[r]=t[r].initial;return e}var Lc=class{constructor(e,r){this.host=e,this.config=r,this.errors=new Map,this.submitting=!1,e.addController(this),this.initial=M3(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,i;let a=(i=(o=this.config[e]).validator)===null||i===void 0?void 0:i.call(o,this.value(e),this.data,r);a!==void 0&&this.errors.set(e,a)}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,i;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(a){let s=Ka(a)?a:void 0;if(!this.checkValidity(s)){this.focusFirstFieldInError(),(o=e.onInvalid)===null||o===void 0||o.call(e);return}(i=e.onFailure)===null||i===void 0||i.call(e,s)}finally{this.submitting=!1,this.host.requestUpdate()}}}};var wc={};j(wc,{MetadataValueLocalizer:()=>Ac});var Ac=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}};var N3=/^https?:\/\//,k3=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;function Rc(t,e,r){return r?t.test(r)?!0:e:!0}var _c={required:function(t){return e=>!!e?.trim()||t},regex:function(t,e){return r=>Rc(t,e,r)},email:function(t){return e=>Rc(k3,t,e)},url:function(t){return e=>Rc(N3,t,e)},min:function(t,e,r=!1){return o=>o===void 0||(r?o>e:o>=e)?!0:t},max:function(t,e,r=!1){return o=>o===void 0||(r?o<e:o<=e)?!0:t},maxLength:function(t,e,r=!1){return o=>o===void 0||o.length===void 0||(r?o.length<e:o.length<=e)?!0:t}};function Ic(t,e){return e.map(r=>r(t)).filter(r=>r!==!0).map(r=>r)}function Qe(t,e,r){return t?e(t):r?.(t)}var Oe=function(t,e,r,o){var i=arguments.length,a=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ir;(function(t){t.blur="blur",t.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",t.input="input"})(Ir||(Ir={}));var le;(function(t){t.default="default",t.warning="warning",t.error="error"})(le||(le={}));var vn=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}},Mi=class extends CustomEvent{constructor(e){super("change",{detail:e,bubbles:!0,composed:!0})}},rr=Re(Symbol("toFtInput"),function(t){class e extends t{constructor(){super(...arguments),this.warningRules=[],this.errorRules=[],this.validateOn=Ir.blurWithStatusResolutionOnInput,this.validateAtRender=!1,this.label="",this.hideLabel=!1,this.name="",this.disabled=!1,this.errorMessages=[],this.warningMessages=[],this.status=le.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 vn(this.status)))}connectedCallback(){super.connectedCallback(),this.validateAtRender&&this.triggerValidation()}onBlur(){this.focused=!1,(this.validateOn===Ir.blur||this.validateOn===Ir.blurWithStatusResolutionOnInput)&&this.triggerValidation()}onFocus(){this.focused=!0}onInput(){this.externalErrorMessages.length>0&&(this.externalErrorMessages=[]),(this.status!==le.default&&this.validateOn===Ir.blurWithStatusResolutionOnInput||this.validateOn===Ir.input)&&this.triggerValidation()}triggerValidation(){this.ruleErrorMessages=Ic(this.value,[...this.errorRules,...this.additionalErrorRules]),this.errorMessages=[...this.externalErrorMessages,...this.ruleErrorMessages],this.warningMessages=Ic(this.value,[...this.warningRules,...this.additionalWarningRules]),this.status=this.resolveStatus(),this.dispatchEvent(new vn(this.status))}resetValidation(){this.externalErrorMessages=[],this.ruleErrorMessages=[],this.errorMessages=[],this.warningMessages=[],this.status=this.resolveStatus(),this.dispatchEvent(new vn(this.status))}get messagesForScreenReaderElementId(){return"sr-helper-text-list"}renderMessagesForScreenReader(){return N`
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
  ${Pt(this.errorMessages,o=>N`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ftds-period-picker",
3
- "version": "2.2.56",
3
+ "version": "2.2.57",
4
4
  "description": "The design system period picker component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -20,19 +20,19 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@fluid-topics/design-system-variables": "3.19.0",
23
- "@fluid-topics/ft-i18n": "2.2.56",
24
- "@fluid-topics/ft-input-label": "2.2.56",
25
- "@fluid-topics/ft-wc-utils": "2.2.56",
26
- "@fluid-topics/ftds-base-input": "2.2.56",
27
- "@fluid-topics/ftds-button": "2.2.56",
28
- "@fluid-topics/ftds-floating-menu": "2.2.56",
29
- "@fluid-topics/ftds-icon": "2.2.56",
30
- "@fluid-topics/ftds-radio": "2.2.56",
31
- "@fluid-topics/ftds-text-input": "2.2.56",
23
+ "@fluid-topics/ft-i18n": "2.2.57",
24
+ "@fluid-topics/ft-input-label": "2.2.57",
25
+ "@fluid-topics/ft-wc-utils": "2.2.57",
26
+ "@fluid-topics/ftds-base-input": "2.2.57",
27
+ "@fluid-topics/ftds-button": "2.2.57",
28
+ "@fluid-topics/ftds-floating-menu": "2.2.57",
29
+ "@fluid-topics/ftds-icon": "2.2.57",
30
+ "@fluid-topics/ftds-radio": "2.2.57",
31
+ "@fluid-topics/ftds-text-input": "2.2.57",
32
32
  "lit": "3.3.3"
33
33
  },
34
34
  "devDependencies": {
35
- "@fluid-topics/ft-wc-test-utils": "2.2.56"
35
+ "@fluid-topics/ft-wc-test-utils": "2.2.57"
36
36
  },
37
- "gitHead": "124ea5b474e39940d6a15050661fbed97ac823c3"
37
+ "gitHead": "a902c6335614244438e63b068a745c42f1bafda5"
38
38
  }