@momentum-ui/web-components 2.5.1-dev2 → 2.5.1-dev3
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.
package/dist/chunks/md-37.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[37],{40:function(e,t,a){"use strict";a.r(t),a.d(t,"DatePicker",(function(){return i}));a(69),a(24),a(32);var i,s=a(5),o=a(8),l=a(19),n=a(18),r=a(0),c=a(6),d=a(12),h=function(e,t,a,i){var s,o=arguments.length,l=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,a,i);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(o<3?s(l):o>3?s(t,a,l):s(t,a))||l);return o>3&&l&&Object.defineProperty(t,a,l),l},p=function(e,t,a,i){return new(a||(a=Promise))((function(s,o){function l(e){try{r(i.next(e))}catch(e){o(e)}}function n(e){try{r(i.throw(e))}catch(e){o(e)}}function r(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(l,n)}r((i=i.apply(e,t||[])).next())}))};!function(e){e.weekStartDays=["Sunday","Monday"];let t=class extends r.LitElement{constructor(){super(...arguments),this.shouldCloseOnSelect=!1,this.maxDate=void 0,this.minDate=void 0,this.value=void 0,this.weekStart="Sunday",this.placeholder=void 0,this.locale="en-US",this.includesTime=!1,this.disabled=!1,this.
|
|
1
|
+
(window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[37],{40:function(e,t,a){"use strict";a.r(t),a.d(t,"DatePicker",(function(){return i}));a(69),a(24),a(32);var i,s=a(5),o=a(8),l=a(19),n=a(18),r=a(0),c=a(6),d=a(12),h=function(e,t,a,i){var s,o=arguments.length,l=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,a,i);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(l=(o<3?s(l):o>3?s(t,a,l):s(t,a))||l);return o>3&&l&&Object.defineProperty(t,a,l),l},p=function(e,t,a,i){return new(a||(a=Promise))((function(s,o){function l(e){try{r(i.next(e))}catch(e){o(e)}}function n(e){try{r(i.throw(e))}catch(e){o(e)}}function r(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(l,n)}r((i=i.apply(e,t||[])).next())}))};!function(e){e.weekStartDays=["Sunday","Monday"];let t=class extends r.LitElement{constructor(){super(...arguments),this.shouldCloseOnSelect=!1,this.maxDate=void 0,this.minDate=void 0,this.value=void 0,this.weekStart="Sunday",this.placeholder=void 0,this.locale="en-US",this.includesTime=!1,this.disabled=!1,this.customTrigger=!1,this.selectedDate=Object(o.n)(),this.focusedDate=Object(o.n)(),this.filterDate=void 0,this.maxDateData=void 0,this.minDateData=void 0,this.handleDateInputChange=e=>{var t,a;(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.value)&&(this.value=null===(a=null==e?void 0:e.detail)||void 0===a?void 0:a.value),this.dispatchEvent(new CustomEvent("date-input-change",{bubbles:!0,composed:!0,detail:{sourceEvent:e,value:this.value}}))},this.setOpen=e=>{this.menuOverlay.isOpen=e},this.handleSelect=e=>{const t=e.detail.date,a=e.detail.sourceEvent;this.setPreSelection(t),this.setSelected(t,a),this.shouldCloseOnSelect&&this.setOpen(!1)},this.setSelected=(e,t)=>{const a={maxDate:this.maxDateData,minDate:this.minDateData,filterDate:this.filterDate};if(!Object(o.j)(e,a)){const t=this.includesTime?e.startOf("second").toISO({suppressMilliseconds:!0}):e.toISODate();this.selectedDate=e,this.value=t}this.dispatchEvent(new CustomEvent("date-selection-change",{bubbles:!0,composed:!0,detail:{sourceEvent:t,data:e}}))},this.setPreSelection=e=>{const t={maxDate:this.maxDateData,minDate:this.minDateData,filterDate:this.filterDate};Object(o.j)(e,t)||(this.focusedDate=e)},this.handleKeyDown=e=>{const t=e.detail.sourceEvent;let a=!1;const i=this.focusedDate;switch(!t.shiftKey&&t.code){case"Space":case"Enter":this.handleSelect(e),a=!0;break;case"Escape":this.setOpen(!1);break;case"ArrowUp":this.setPreSelection(Object(o.s)(i,1)),a=!0;break;case"ArrowLeft":this.setPreSelection(Object(o.q)(i,1)),a=!0;break;case"ArrowRight":this.setPreSelection(Object(o.a)(i,1)),a=!0;break;case"ArrowDown":this.setPreSelection(Object(o.c)(i,1)),a=!0}a&&(t.stopPropagation(),t.preventDefault())},this.chosenDateLabel=()=>this.selectedDate?`, Selected date is ${this.selectedDate.weekdayLong} ${this.selectedDate.monthLong} ${this.selectedDate.day}, ${this.selectedDate.year}`:void 0,this.isValueValid=()=>{const e=Object(l.a)("md-date-range-picker",this),t=e&&e.startDate&&e.endDate?n.a.dateRangeString:this.includesTime?n.a.ISOString:n.a.ISODateString,a=RegExp(t),i={maxDate:this.maxDateData,minDate:this.minDateData,filterDate:this.filterDate};return this.value&&a.test(this.value)&&!Object(o.j)(d.DateTime.fromISO(this.value,{locale:this.locale}),i)}}connectedCallback(){super.connectedCallback(),this.minDate&&(this.minDateData=d.DateTime.fromISO(this.minDate,{locale:this.locale})),this.maxDate&&(this.maxDateData=d.DateTime.fromISO(this.maxDate,{locale:this.locale}))}firstUpdated(e){const t=Object.create(null,{firstUpdated:{get:()=>super.firstUpdated}});var a,i;return p(this,void 0,void 0,(function*(){t.firstUpdated.call(this,e),this.value||(this.value=this.includesTime?null===(a=this.selectedDate)||void 0===a?void 0:a.startOf("second").toISO({suppressMilliseconds:!0}):null===(i=this.selectedDate)||void 0===i?void 0:i.toISODate())}))}updated(e){if(super.updated(e),this.value&&e.has("value")){if(Object(l.a)("md-date-range-picker",this))return;this.selectedDate=d.DateTime.fromISO(this.value,{locale:this.locale}),this.setPreSelection(this.selectedDate)}e.has("locale")&&this.render(),this.minDate&&e.has("minDate")&&(this.minDateData=d.DateTime.fromISO(this.minDate,{locale:this.locale})),this.maxDate&&e.has("maxDate")&&(this.maxDateData=d.DateTime.fromISO(this.maxDate,{locale:this.locale}))}render(){return r.html`
|
|
2
2
|
<md-menu-overlay custom-width="248px" ?disabled=${this.disabled}>
|
|
3
|
-
${this.
|
|
3
|
+
${this.customTrigger?r.html`
|
|
4
4
|
<span slot="menu-trigger">
|
|
5
5
|
<slot name="date-trigger"></slot>
|
|
6
6
|
</span>
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
<slot name="time-picker"></slot>
|
|
32
32
|
</div>
|
|
33
33
|
</md-menu-overlay>
|
|
34
|
-
`}};h([Object(r.property)({type:Boolean,attribute:"should-close-on-select"})],t.prototype,"shouldCloseOnSelect",void 0),h([Object(r.property)({type:String})],t.prototype,"maxDate",void 0),h([Object(r.property)({type:String})],t.prototype,"minDate",void 0),h([Object(r.property)({type:String,reflect:!0})],t.prototype,"value",void 0),h([Object(r.property)({type:String})],t.prototype,"weekStart",void 0),h([Object(r.property)({type:String,reflect:!0})],t.prototype,"placeholder",void 0),h([Object(r.property)({type:String})],t.prototype,"locale",void 0),h([Object(r.property)({type:Boolean,reflect:!0,attribute:"includes-time"})],t.prototype,"includesTime",void 0),h([Object(r.property)({type:Boolean})],t.prototype,"disabled",void 0),h([Object(r.property)({type:Boolean,attribute:"custom-
|
|
34
|
+
`}};h([Object(r.property)({type:Boolean,attribute:"should-close-on-select"})],t.prototype,"shouldCloseOnSelect",void 0),h([Object(r.property)({type:String})],t.prototype,"maxDate",void 0),h([Object(r.property)({type:String})],t.prototype,"minDate",void 0),h([Object(r.property)({type:String,reflect:!0})],t.prototype,"value",void 0),h([Object(r.property)({type:String})],t.prototype,"weekStart",void 0),h([Object(r.property)({type:String,reflect:!0})],t.prototype,"placeholder",void 0),h([Object(r.property)({type:String})],t.prototype,"locale",void 0),h([Object(r.property)({type:Boolean,reflect:!0,attribute:"includes-time"})],t.prototype,"includesTime",void 0),h([Object(r.property)({type:Boolean})],t.prototype,"disabled",void 0),h([Object(r.property)({type:Boolean,attribute:"custom-trigger"})],t.prototype,"customTrigger",void 0),h([Object(r.internalProperty)()],t.prototype,"selectedDate",void 0),h([Object(r.internalProperty)()],t.prototype,"focusedDate",void 0),h([Object(r.internalProperty)()],t.prototype,"filterDate",void 0),h([Object(r.internalProperty)()],t.prototype,"maxDateData",void 0),h([Object(r.internalProperty)()],t.prototype,"minDateData",void 0),h([Object(r.query)("md-menu-overlay")],t.prototype,"menuOverlay",void 0),t=h([Object(s.a)("md-datepicker")],t),e.ELEMENT=t}(i||(i={}))}}]);
|