@momentum-ui/web-components 2.12.1 → 2.12.3

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.
@@ -1,4 +1,4 @@
1
- (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[83],{124:function(t,e,i){"use strict";i.r(e),i.d(e,"timeUnits",(function(){return b})),i.d(e,"timeSpecificity",(function(){return y})),i.d(e,"TimePicker",(function(){return v}));i(24);var o=i(1),a=i(6),r=i(8),s=i(19),n=i(5),m=i(0),l=i(3),c=i(4),h=i(2),u=i(12),d=m.css`.md-timepicker{padding-right:0;width:fit-content}.md-timepicker.twenty-four-hour-format{padding-right:0}.md-timepicker .time-input-box{display:inline-block;height:2rem;width:2.5rem}.md-timepicker .amPm-combo-box{display:inline-block;height:2rem;margin-left:.5rem;width:2.5rem;position:relative}.md-timepicker .amPm-combo-box::part(group){padding:0}.md-timepicker .amPm-combo-box::part(multiwrap-input){text-align:center;text-transform:uppercase;width:100%}.md-timepicker .amPm-combo-box::part(label){padding:0 .4375rem;width:100%}.md-timepicker .amPm-combo-box::part(combobox-option){padding-left:0;padding-right:0}.md-timepicker .amPm-combo-box::part(combobox-options){max-height:5rem;width:2.625rem;padding:0;position:absolute;overflow:visible}.md-timepicker md-input::part(input){padding:0;text-align:center}.md-timepicker md-input::part(message){display:none}.md-timepicker .colon-separator{color:var(--md-secondary-text-color,#545454);font-size:1.25rem;line-height:125%;margin:0 .25rem}`,p=function(t,e,i,o){var a,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const b=[o.c.HOUR,o.c.MINUTE,o.c.SECOND,o.c.AM_PM],y=[o.c.HOUR,o.c.MINUTE,o.c.SECOND],g={[o.c.HOUR]:"HH",[o.c.MINUTE]:"MM",[o.c.SECOND]:"SS",[o.c.AM_PM]:"AM"};var v;!function(t){let e=class extends m.LitElement{constructor(){super(...arguments),this.twoDigitAutoTab=!1,this.twentyFourHourFormat=!1,this.timeSpecificity=o.c.SECOND,this.locale="en-US",this.value="00:00:00-08:00",this.localeTwentyFourFormat=!1,this.finalTwentyFourFormat=!1,this.timeObject=Object(r.n)(),this.tabNext=!1,this.timeValue={[o.c.HOUR]:"12",[o.c.MINUTE]:"00",[o.c.SECOND]:"00",[o.c.AM_PM]:"AM"},this.timeValidity={[o.c.HOUR]:!0,[o.c.MINUTE]:!0,[o.c.SECOND]:!0,[o.c.AM_PM]:!0},this.addLeadingZeros=t=>{if(t){if(0===t.length)return"00";if(1===t.length)return"0"+t}return t},this.formatAndValidate=(t,e)=>{if(t&&(this.updateValidity(t,e),this.timeValidity[e]))return this.addLeadingZeros(t)},this.getLocaleTimeFormat=t=>{const e=t.toFormat("tt"),[i,o]=e.split(" ");return!o},this.updateTimeValues=()=>{let t;t=this.finalTwentyFourFormat?this.timeObject.toFormat("HH:mm:ss"):this.timeObject.toFormat("tt");const[e,i]=t.split(" "),a=e.split(":");y.forEach(t=>{const e=this.formatAndValidate(a.shift(),t);e&&(t===o.c.HOUR&&i&&(this.timeValue[o.c.AM_PM]=i),this.timeValue[t]=e)})},this.updateValidity=(t,e)=>{let i=!0;const a=e=>{null===t.match(e)&&(i=!1)};switch(e){case o.c.HOUR:this.finalTwentyFourFormat?a(new RegExp(s.a.twentyFourHourString)):a(new RegExp(s.a.hourString));break;case o.c.MINUTE:case o.c.SECOND:a(new RegExp(s.a.minuteSecondString));break;case o.c.AM_PM:a(new RegExp(s.a.amPmString))}this.timeValidity[e]=i},this.to12HourFormat=(t,e)=>{if(!this.finalTwentyFourFormat&&this.timeValidity[o.c.HOUR]&&this.timeValidity[o.c.AM_PM]){let i=Number(e);return"PM"===t?i=12+i%12:i%=12,i}},this.isEntireTimeValid=()=>Object.values(this.timeValidity).every(t=>t),this.updateTimeUnit=t=>{var e,i,a;this.updateValidity(this.timeValue[t],t),this.timeObject&&this.timeValidity[t]&&(t!==o.c.AM_PM?this.timeObject=null===(e=this.timeObject)||void 0===e?void 0:e.set({[t]:this.timeValue[t]}):this.timeObject=null===(i=this.timeObject)||void 0===i?void 0:i.set({hour:this.to12HourFormat(this.timeValue[o.c.AM_PM],this.timeValue[o.c.HOUR])}),this.isEntireTimeValid()&&(this.timeObject=null===(a=this.timeObject)||void 0===a?void 0:a.set({hour:this.to12HourFormat(this.timeValue[o.c.AM_PM],this.timeValue[o.c.HOUR])}),this.value=this.timeObject.toISOTime({suppressMilliseconds:!0})||this.value,this.dispatchEvent(new CustomEvent("time-selection-change",{bubbles:!0,composed:!0,detail:{time:this.value,data:this.timeObject}}))))},this.formatTimeUnit=t=>{if(1===this.timeValue[t].length)"0"!==this.timeValue[t]&&(this.timeValue[t]="0"+this.timeValue[t]);else if(this.timeValue[t].length>2&&"0"===this.timeValue[t][0]){const e=this.timeValue[t].substring(1);RegExp(s.a.noPrecedingZerosString).test(e)&&(this.timeValue[t]=e)}this.requestUpdate()},this.messageType=t=>t?"":"error",this.generateTimeBox=t=>{const e=(i=this.finalTwentyFourFormat,{[o.c.HOUR]:{type:"number",min:i?0:1,max:i?23:12},[o.c.MINUTE]:{type:"number",min:0,max:59},[o.c.SECOND]:{type:"number",min:0,max:59},[o.c.AM_PM]:{type:"text",min:void 0,max:void 0}})[t];var i;return m.html`
1
+ (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[83],{124:function(t,e,i){"use strict";i.r(e),i.d(e,"timeUnits",(function(){return b})),i.d(e,"timeSpecificity",(function(){return y})),i.d(e,"TimePicker",(function(){return v}));i(24);var o=i(1),a=i(6),r=i(8),s=i(19),n=i(5),m=i(0),l=i(3),c=i(4),h=i(2),u=i(12),d=m.css`.md-timepicker{padding-right:0;width:fit-content}.md-timepicker.twenty-four-hour-format{padding-right:0}.md-timepicker .time-input-box{display:inline-block;height:2rem;width:2.5rem}.md-timepicker .amPm-combo-box{display:inline-block;height:2rem;margin-left:.5rem;width:2.5rem;position:relative}.md-timepicker .amPm-combo-box::part(group){padding:0}.md-timepicker .amPm-combo-box::part(multiwrap-input){text-align:center;text-transform:uppercase;width:100%}.md-timepicker .amPm-combo-box::part(label){width:100%;display:flex;justify-content:center}.md-timepicker .amPm-combo-box::part(select-label){margin-right:0}.md-timepicker .amPm-combo-box::part(combobox-option){padding-left:0;padding-right:0}.md-timepicker .amPm-combo-box::part(combobox-options){max-height:5.625rem;width:2.625rem;padding:0;position:absolute;overflow:visible}.md-timepicker md-input::part(input){padding:0;text-align:center}.md-timepicker md-input::part(message){display:none}.md-timepicker .colon-separator{color:var(--md-secondary-text-color,#545454);font-size:1.25rem;line-height:125%;margin:0 .25rem}`,p=function(t,e,i,o){var a,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const b=[o.c.HOUR,o.c.MINUTE,o.c.SECOND,o.c.AM_PM],y=[o.c.HOUR,o.c.MINUTE,o.c.SECOND],g={[o.c.HOUR]:"HH",[o.c.MINUTE]:"MM",[o.c.SECOND]:"SS",[o.c.AM_PM]:"AM"};var v;!function(t){let e=class extends m.LitElement{constructor(){super(...arguments),this.twoDigitAutoTab=!1,this.twentyFourHourFormat=!1,this.timeSpecificity=o.c.SECOND,this.locale="en-US",this.value="00:00:00-08:00",this.localeTwentyFourFormat=!1,this.finalTwentyFourFormat=!1,this.timeObject=Object(r.n)(),this.tabNext=!1,this.timeValue={[o.c.HOUR]:"12",[o.c.MINUTE]:"00",[o.c.SECOND]:"00",[o.c.AM_PM]:"AM"},this.timeValidity={[o.c.HOUR]:!0,[o.c.MINUTE]:!0,[o.c.SECOND]:!0,[o.c.AM_PM]:!0},this.addLeadingZeros=t=>{if(t){if(0===t.length)return"00";if(1===t.length)return"0"+t}return t},this.formatAndValidate=(t,e)=>{if(t&&(this.updateValidity(t,e),this.timeValidity[e]))return this.addLeadingZeros(t)},this.getLocaleTimeFormat=t=>{const e=t.toFormat("tt"),[i,o]=e.split(" ");return!o},this.updateTimeValues=()=>{let t;t=this.finalTwentyFourFormat?this.timeObject.toFormat("HH:mm:ss"):this.timeObject.toFormat("tt");const[e,i]=t.split(" "),a=e.split(":");y.forEach(t=>{const e=this.formatAndValidate(a.shift(),t);e&&(t===o.c.HOUR&&i&&(this.timeValue[o.c.AM_PM]=i),this.timeValue[t]=e)})},this.updateValidity=(t,e)=>{let i=!0;const a=e=>{null===t.match(e)&&(i=!1)};switch(e){case o.c.HOUR:this.finalTwentyFourFormat?a(new RegExp(s.a.twentyFourHourString)):a(new RegExp(s.a.hourString));break;case o.c.MINUTE:case o.c.SECOND:a(new RegExp(s.a.minuteSecondString));break;case o.c.AM_PM:a(new RegExp(s.a.amPmString))}this.timeValidity[e]=i},this.to12HourFormat=(t,e)=>{if(!this.finalTwentyFourFormat&&this.timeValidity[o.c.HOUR]&&this.timeValidity[o.c.AM_PM]){let i=Number(e);return"PM"===t?i=12+i%12:i%=12,i}},this.isEntireTimeValid=()=>Object.values(this.timeValidity).every(t=>t),this.updateTimeUnit=t=>{var e,i,a;this.updateValidity(this.timeValue[t],t),this.timeObject&&this.timeValidity[t]&&(t!==o.c.AM_PM?this.timeObject=null===(e=this.timeObject)||void 0===e?void 0:e.set({[t]:this.timeValue[t]}):this.timeObject=null===(i=this.timeObject)||void 0===i?void 0:i.set({hour:this.to12HourFormat(this.timeValue[o.c.AM_PM],this.timeValue[o.c.HOUR])}),this.isEntireTimeValid()&&(this.timeObject=null===(a=this.timeObject)||void 0===a?void 0:a.set({hour:this.to12HourFormat(this.timeValue[o.c.AM_PM],this.timeValue[o.c.HOUR])}),this.value=this.timeObject.toISOTime({suppressMilliseconds:!0})||this.value,this.dispatchEvent(new CustomEvent("time-selection-change",{bubbles:!0,composed:!0,detail:{time:this.value,data:this.timeObject}}))))},this.formatTimeUnit=t=>{if(1===this.timeValue[t].length)"0"!==this.timeValue[t]&&(this.timeValue[t]="0"+this.timeValue[t]);else if(this.timeValue[t].length>2&&"0"===this.timeValue[t][0]){const e=this.timeValue[t].substring(1);RegExp(s.a.noPrecedingZerosString).test(e)&&(this.timeValue[t]=e)}this.requestUpdate()},this.messageType=t=>t?"":"error",this.generateTimeBox=t=>{const e=(i=this.finalTwentyFourFormat,{[o.c.HOUR]:{type:"number",min:i?0:1,max:i?23:12},[o.c.MINUTE]:{type:"number",min:0,max:59},[o.c.SECOND]:{type:"number",min:0,max:59},[o.c.AM_PM]:{type:"text",min:void 0,max:void 0}})[t];var i;return m.html`
2
2
  ${t===o.c.MINUTE||t===o.c.SECOND?m.html`
3
3
  <span class="colon-separator">:</span>
4
4
  `:l.nothing}
@@ -32,6 +32,7 @@ export declare namespace MenuOverlay {
32
32
  allowHoverToggle: boolean;
33
33
  ariaRole: Role;
34
34
  ariaLabel: string;
35
+ isDatePicker: boolean;
35
36
  overlayContainer: HTMLDivElement;
36
37
  arrow: HTMLDivElement;
37
38
  trigger?: NodeListOf<HTMLElement>;
@@ -39,6 +40,7 @@ export declare namespace MenuOverlay {
39
40
  private triggerElement;
40
41
  private renderMaxHeight;
41
42
  shouldWrapFocus: () => boolean;
43
+ private renderOverflowY;
42
44
  private renderWidth;
43
45
  private getStyles;
44
46
  updateActiveMenuOverlayOpened: (event: Event) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momentum-ui/web-components",
3
- "version": "2.12.1",
3
+ "version": "2.12.3",
4
4
  "author": "Yana Harris",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/momentum-design/momentum-ui.git",
@@ -23,7 +23,7 @@
23
23
  "papaparse": "^5.3.0",
24
24
  "sortablejs": "^1.13.0",
25
25
  "lit-virtualizer": "0.4.2",
26
- "@momentum-design/tokens": "0.0.59"
26
+ "@momentum-design/tokens": "0.0.60"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@momentum-ui/core": "19.16.0",