{"version":3,"sources":["components/datePicker.js","components/dateRangePicker.js"],"names":["dmx","Component","extends","attributes","name","type","String","default","showdropdowns","Boolean","minyear","Number","maxyear","opens","dropsup","showweeknumbers","mindate","maxdate","format","invaliddates","Array","invaliddates-start","invaliddates-end","customdates","customdates-start","customdates-end","customdates-class","disableweekends","direction","weeklabel","applylabel","cancellabel","timepicker","use24hours","minutes-increment","events","show","Event","hide","apply","cancel","render","node","prototype","call","this","createHiddenInput","$node","removeAttribute","autocomplete","update","input","document","createElement","value","$placeholder","parentNode","insertBefore","props","JSON","stringify","$","daterangepicker","singleDatePicker","autoUpdateInput","showWeekNumbers","showDropdowns","minYear","undefined","maxYear","drops","minDate","formatDate","maxDate","locale","weekLabel","applyLabel","cancelLabel","buttonClasses","applyButtonClasses","cancelButtonClasses","isCustomDate","bind","isInvalidDate","timePicker","timePicker24Hour","timePickerIncrement","updateValue","on","onChange","onApply","dispatchEvent","data","moment","defaultValue","setValue","disabled","updateData","event","validate","nextTick","set","dirty","validity","valid","validationMessage","str","m","isValid","date","day","some","range","isInRange","filter","map","start","end","isSameOrAfter","isSameOrBefore","startDate","setStartDate","setEndDate","dateFormat","destroy","off","clickDate","e","container","find","length","initialData","startdate","enddate","autoapply","separator","unlinked","maxspan-years","maxspan-months","maxspan-weeks","maxspan-days","methods","endDate","input1","input2","autoApply","linkedCalendars","maxSpan","years","months","weeks","days"],"mappings":";;;;;;AAAAA,IAAAC,UAAA,cAAA,CAEAC,QAAA,QAEAC,WAAA,CACAC,KAAA,CACAC,KAAAC,OACAC,QAAA,IAGAC,cAAA,CACAH,KAAAI,QACAF,SAAA,GAGAG,QAAA,CACAL,KAAAM,OACAJ,QAAA,MAGAK,QAAA,CACAP,KAAAM,OACAJ,QAAA,MAGAM,MAAA,CACAR,KAAAC,OACAC,QAAA,SAGAO,QAAA,CACAT,KAAAI,QACAF,SAAA,GAGAQ,gBAAA,CACAV,KAAAI,QACAF,SAAA,GAGAS,QAAA,CACAX,KAAAC,OACAC,Q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,KAAAkD,SAAAyB,EAAAsB,GAGApF,EAAAsC,UAAAnD,KAAAa,MAAAsC,WACAnD,KAAAE,MAAAiD,SAAAnD,KAAAa,MAAAsC,SACAnD,KAAAkG,OAAA/C,SAAAnD,KAAAa,MAAAsC,SACAnD,KAAAmG,OAAAhD,SAAAnD,KAAAa,MAAAsC,UAIAnD,KAAAoD,cAGAP,QAAA,SAAAQ,GACArD,KAAA0C,YAAA1C,KAAAiB,gBAAA0D,UAAA3E,KAAAiB,gBAAAgF,UAGAvD,YAAA,SAAAiC,EAAAsB,GACAjG,KAAAkD,SAAAyB,EAAAtG,OAAA,uBAAA4H,EAAA5H,OAAA,yBAGA6E,SAAA,SAAAyB,EAAAsB,GACAtB,GAAA3E,KAAAiB,gBAAA2D,aAAA5E,KAAA2B,WAAAgD,IACAsB,GAAAjG,KAAAiB,gBAAA4D,WAAA7E,KAAA2B,WAAAsE,IACAjG,KAAAE,MAAAO,MAAAkE,GAAAsB,EAAAjG,KAAA2B,WAAAgD,GAAA3E,KAAAa,MAAA6E,UAAA1F,KAAA2B,WAAAsE,GAAA,GACAjG,KAAAM,MAAAG,MAAAkE,GAAAsB,EAAAtB,EAAA,IAAAsB,EAAA,GACAjG,KAAAkG,OAAAzF,MAAAkE,GAAA,GACA3E,KAAAmG,OAAA1F,MAAAwF,GAAA,GACAjG,KAAAwD,IAAA,QAAAmB,GACA3E,KAAAwD,IAAA,MAAAyC,GACAjG,KAAAoD,YAAA","file":"../dmxDatePicker/dmxDatePicker.js","sourcesContent":["dmx.Component('date-picker', {\r\n\r\n extends: 'input',\r\n\r\n attributes: {\r\n name: {\r\n type: String,\r\n default: ''\r\n },\r\n\r\n showdropdowns: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n minyear: {\r\n type: Number,\r\n default: null\r\n },\r\n\r\n maxyear: {\r\n type: Number,\r\n default: null\r\n },\r\n\r\n opens: {\r\n type: String,\r\n default: 'right' // left, right, center\r\n },\r\n\r\n dropsup: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n showweeknumbers: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n mindate: {\r\n type: String,\r\n default: ''\r\n },\r\n\r\n maxdate: {\r\n type: String,\r\n default: ''\r\n },\r\n\r\n format: {\r\n type: String,\r\n default: 'L'\r\n },\r\n\r\n invaliddates: {\r\n type: Array,\r\n default: []\r\n },\r\n\r\n 'invaliddates-start': {\r\n type: String,\r\n default: 'start'\r\n },\r\n\r\n 'invaliddates-end': {\r\n type: String,\r\n default: 'end'\r\n },\r\n\r\n customdates: {\r\n type: Array,\r\n default: []\r\n },\r\n\r\n 'customdates-start': {\r\n type: String,\r\n default: 'start'\r\n },\r\n\r\n 'customdates-end': {\r\n type: String,\r\n default: 'end'\r\n },\r\n\r\n 'customdates-class': {\r\n type: String,\r\n default: 'class'\r\n },\r\n\r\n disableweekends: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n direction: {\r\n type: String,\r\n default: 'ltr'\r\n },\r\n\r\n weeklabel: {\r\n type: String,\r\n default: 'W'\r\n },\r\n\r\n applylabel: {\r\n type: String,\r\n default: 'Apply'\r\n },\r\n\r\n cancellabel: {\r\n type: String,\r\n default: 'Cancel'\r\n },\r\n\r\n timepicker: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n use24hours: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n 'minutes-increment': {\r\n type: Number,\r\n default: 1\r\n }\r\n },\r\n\r\n events: {\r\n show: Event,\r\n hide: Event,\r\n apply: Event,\r\n cancel: Event\r\n },\r\n\r\n render: function(node) {\r\n dmx.Component('form-element').prototype.render.call(this, node);\r\n\r\n this.createHiddenInput();\r\n\r\n this.$node.removeAttribute('name');\r\n this.$node.autocomplete = 'off';\r\n\r\n this.update({});\r\n },\r\n\r\n createHiddenInput: function() {\r\n this.input = document.createElement('input');\r\n if (this.$node.name) this.input.name = this.$node.name;\r\n this.input.value = this.$node.value;\r\n this.input.type = 'hidden';\r\n\r\n this.$placeholder.parentNode.insertBefore(this.input, this.$placeholder);\r\n },\r\n\r\n update: function(props) {\r\n if (this.props.name) {\r\n this.input.name = this.props.name;\r\n }\r\n\r\n if (JSON.stringify(props) != JSON.stringify(this.props)) {\r\n $(this.$node).daterangepicker({\r\n singleDatePicker: true,\r\n autoUpdateInput: false,\r\n showWeekNumbers: !!this.props.showweeknumbers,\r\n showDropdowns: !!this.props.showdropdowns,\r\n minYear: this.props.minyear || undefined,\r\n maxYear: this.props.maxyear || undefined,\r\n opens: this.props.opens,\r\n drops: !!this.props.dropsup ? 'up' : 'down',\r\n minDate: this.formatDate(this.props.mindate),\r\n maxDate: this.formatDate(this.props.maxdate),\r\n locale: {\r\n format: this.props.format,\r\n direction: this.props.direction,\r\n weekLabel: this.props.weeklabel,\r\n applyLabel: this.props.applylabel,\r\n cancelLabel: this.props.cancelLabel\r\n },\r\n buttonClasses: '',\r\n applyButtonClasses: '',\r\n cancelButtonClasses: '',\r\n isCustomDate: this.isCustomDate.bind(this),\r\n isInvalidDate: this.isInvalidDate.bind(this),\r\n timePicker: this.props.timepicker,\r\n timePicker24Hour: this.props.use24hours,\r\n timePickerIncrement: this.props['minutes-increment']\r\n }, this.updateValue.bind(this));\r\n\r\n $(this.$node).on('change.daterangepicker', this.onChange.bind(this));\r\n $(this.$node).on('apply.daterangepicker', this.onApply.bind(this));\r\n \r\n $(this.$node).on('show.daterangepicker', this.dispatchEvent.bind(this, 'show'));\r\n $(this.$node).on('hide.daterangepicker', this.dispatchEvent.bind(this, 'hide'));\r\n $(this.$node).on('apply.daterangepicker', this.dispatchEvent.bind(this, 'apply'));\r\n $(this.$node).on('cancel.daterangepicker', this.dispatchEvent.bind(this, 'cancel'));\r\n\r\n this.daterangepicker = $(this.$node).data('daterangepicker');\r\n\r\n if (props.value !== this.props.value) {\r\n var value = this.props.value;\r\n if (value == 'now' || value == 'today') {\r\n value = moment().format('YYYY-MM-DD HH:mm:ss');\r\n }\r\n this.$node.defaultValue = this.formatDate(value) || '';\r\n this.input.defaultValue = value || '';\r\n this.setValue(value);\r\n }\r\n\r\n if (props.disabled != this.props.disabled) {\r\n this.$node.disabled = this.props.disabled;\r\n this.input.disabled = this.props.disabled;\r\n }\r\n }\r\n\r\n this.updateData();\r\n },\r\n\r\n updateData: function(event) {\r\n if (event) {\r\n dmx.validate(this.$node);\r\n }\r\n\r\n if (this.input.value !== this.data.value) {\r\n dmx.nextTick(function() {\r\n this.dispatchEvent('updated');\r\n }, this);\r\n }\r\n\r\n this.set('value', this.input.value);\r\n this.set('disabled', this.$node.disabled);\r\n\r\n if (this.$node.dirty) {\r\n this.set('invalid', !this.$node.validity.valid);\r\n this.set('validationMessage', this.$node.validationMessage);\r\n }\r\n },\r\n\r\n formatDate: function(str) {\r\n if (!str) return undefined;\r\n if (str == 'now' || str == 'today') return moment().format(this.props.format);\r\n var m = moment(str);\r\n return m.isValid() ? m.format(this.props.format) : undefined;\r\n },\r\n\r\n isInvalidDate: function(date) {\r\n if (this.props.disableweekends) {\r\n var day = date.day();\r\n if (day === 0 || day === 6) return true;\r\n }\r\n\r\n return this.props.invaliddates.some(function(range) {\r\n return this.isInRange(date, range, this.props['invaliddates-start'], this.props['invaliddates-end']);\r\n }, this);\r\n },\r\n\r\n isCustomDate: function(date) {\r\n return this.props.customdates.filter(function(range) {\r\n return this.isInRange(date, range, this.props['customdates-start'], this.props['customdates-end']);\r\n }, this).map(function(range) {\r\n return range[this.props['customdates-class']];\r\n }, this);\r\n },\r\n\r\n isInRange: function(date, range, start, end) {\r\n if (range[start] && range[end]) {\r\n return date.isSameOrAfter(range[start]) && date.isSameOrBefore(range[end]);\r\n }\r\n\r\n if (range[start]) {\r\n return date.isSameOrAfter(range[start]);\r\n }\r\n\r\n if (range[end]) {\r\n return date.isSameOrBefore(range[end]);\r\n }\r\n\r\n return false;\r\n },\r\n\r\n onChange: function(event) {\r\n if (!moment(this.$node.value, this.props.format).isValid()) {\r\n this.setValue('');\r\n }\r\n },\r\n\r\n onApply: function(event) {\r\n this.updateValue(this.daterangepicker.startDate);\r\n },\r\n\r\n updateValue: function(date) {\r\n this.setValue(date.format('YYYY-MM-DD HH:mm:ss'));\r\n },\r\n\r\n setValue: function(value) {\r\n if (value) {\r\n this.daterangepicker.setStartDate(this.formatDate(value));\r\n this.daterangepicker.setEndDate(this.formatDate(value));\r\n }\r\n this.$node.value = this.formatDate(value) || '';\r\n this.input.value = value || '';\r\n this.updateData(true);\r\n },\r\n\r\n format: function(date) {\r\n if (!date) return '';\r\n return moment(date, this.dateFormat).format(this.props.format);\r\n },\r\n\r\n destroy: function() {\r\n this.input.off('.daterangepicker');\r\n }\r\n\r\n});\r\n","(function() {\r\n // hack original clickDate method to disallow selecting range with invalid dates in it\r\n var clickDate = daterangepicker.prototype.clickDate;\r\n daterangepicker.prototype.clickDate = function(e) {\r\n if (this.container.find('.in-range:not(.available)').length) return;\r\n return clickDate.call(this, e);\r\n };\r\n})();\r\n\r\ndmx.Component('date-range-picker', {\r\n\r\n extends: 'date-picker',\r\n\r\n initialData: {\r\n start: '',\r\n end: ''\r\n },\r\n\r\n attributes: {\r\n startdate: {\r\n type: String,\r\n default: ''\r\n },\r\n\r\n enddate: {\r\n type: String,\r\n default: ''\r\n },\r\n\r\n autoapply: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n separator: {\r\n type: String,\r\n default: ' - '\r\n },\r\n\r\n unlinked: {\r\n type: Boolean,\r\n default: false\r\n },\r\n\r\n 'maxspan-years': {\r\n type: Number,\r\n default: null\r\n },\r\n\r\n 'maxspan-months': {\r\n type: Number,\r\n default: null\r\n },\r\n\r\n 'maxspan-weeks': {\r\n type: Number,\r\n default: null\r\n },\r\n\r\n 'maxspan-days': {\r\n type: Number,\r\n default: null\r\n }\r\n },\r\n\r\n methods: {\r\n setValue: function(startDate, endDate) {\r\n this.setValue(startDate, endDate);\r\n }\r\n },\r\n\r\n createHiddenInput: function() {\r\n dmx.Component('date-picker').prototype.createHiddenInput.call(this);\r\n\r\n this.input1 = document.createElement('input');\r\n if (this.$node.name) this.input1.name = this.$node.name + '_start';\r\n this.input1.value = this.props.startDate;\r\n this.input1.type = 'hidden';\r\n\r\n this.input2 = document.createElement('input');\r\n if (this.$node.name) this.input2.name = this.$node.name + '_end';\r\n this.input2.value = this.props.startDate;\r\n this.input2.type = 'hidden';\r\n\r\n this.$placeholder.parentNode.insertBefore(this.input1, this.$placeholder);\r\n this.$placeholder.parentNode.insertBefore(this.input2, this.$placeholder);\r\n },\r\n\r\n update: function(props) {\r\n if (this.props.name) {\r\n this.input.name = this.props.name;\r\n this.input1.name = this.props.name + '_start';\r\n this.input2.name = this.props.name + '_end';\r\n }\r\n\r\n if (JSON.stringify(props) != JSON.stringify(this.props)) {\r\n $(this.$node).daterangepicker({\r\n autoUpdateInput: false,\r\n autoApply: !!this.props.autoapply,\r\n linkedCalendars: !this.props.unlinked,\r\n showWeekNumbers: !!this.props.showweeknumbers,\r\n showDropdowns: !!this.props.showdropdowns,\r\n minYear: this.props.minYear || undefined,\r\n maxYear: this.props.maxYear || undefined,\r\n opens: this.props.opens,\r\n drops: !!this.props.dropsup ? 'up' : 'down',\r\n minDate: this.formatDate(this.props.mindate),\r\n maxDate: this.formatDate(this.props.maxdate),\r\n maxSpan: this.props['maxspan-years'] || this.props['maxspan-months'] ||\r\n this.props['maxspan-weeks'] || this.props['maxspan-days'] ? {\r\n years: this.props['maxspan-years'],\r\n months: this.props['maxspan-months'],\r\n weeks: this.props['maxspan-weeks'],\r\n days: this.props['maxspan-days']\r\n } : undefined,\r\n locale: {\r\n format: this.props.format,\r\n separator: this.props.separator,\r\n direction: this.props.direction,\r\n weekLabel: this.props.weeklabel,\r\n applyLabel: this.props.applylabel,\r\n cancelLabel: this.props.cancellabel\r\n },\r\n buttonClasses: '',\r\n applyButtonClasses: '',\r\n cancelButtonClasses: '',\r\n isCustomDate: this.isCustomDate.bind(this),\r\n isInvalidDate: this.isInvalidDate.bind(this),\r\n timePicker: this.props.timepicker,\r\n timePicker24Hour: this.props.use24hours,\r\n timePickerIncrement: this.props['minutes-increment']\r\n }, this.updateValue.bind(this));\r\n\r\n $(this.$node).on('change.daterangepicker', this.onChange.bind(this));\r\n $(this.$node).on('apply.daterangepicker', this.onApply.bind(this));\r\n \r\n $(this.$node).on('show.daterangepicker', this.dispatchEvent.bind(this, 'show'));\r\n $(this.$node).on('hide.daterangepicker', this.dispatchEvent.bind(this, 'hide'));\r\n $(this.$node).on('apply.daterangepicker', this.dispatchEvent.bind(this, 'apply'));\r\n $(this.$node).on('cancel.daterangepicker', this.dispatchEvent.bind(this, 'cancel'));\r\n\r\n this.daterangepicker = $(this.$node).data('daterangepicker');\r\n\r\n if (props.startdate !== this.props.startdate || props.enddate !== this.props.enddate) {\r\n var startDate = this.props.startdate;\r\n var endDate = this.props.enddate;\r\n if (startDate == 'now' || startDate == 'today') {\r\n startDate = moment().format('YYYY-MM-DD HH:mm:ss');\r\n }\r\n if (endDate == 'now' || endDate == 'today') {\r\n endDate = moment().format('YYYY-MM-DD HH:mm:ss');\r\n }\r\n this.$node.defaultValue = startDate && endDate ? this.formatDate(startDate) + this.props.separator + this.formatDate(endDate) : '';\r\n this.input.defaultValue = startDate && endDate ? startDate + '/' + endDate : '';\r\n this.input1.defaultValue = startDate || '';\r\n this.input2.defaultValue = endDate || '';\r\n this.setValue(startDate, endDate);\r\n }\r\n\r\n if (props.disabled != this.props.disabled) {\r\n this.$node.disabled = this.props.disabled;\r\n this.input1.disabled = this.props.disabled;\r\n this.input2.disabled = this.props.disabled;\r\n }\r\n }\r\n\r\n this.updateData();\r\n },\r\n\r\n onApply: function(event) {\r\n this.updateValue(this.daterangepicker.startDate, this.daterangepicker.endDate);\r\n },\r\n\r\n updateValue: function(startDate, endDate) {\r\n this.setValue(startDate.format('YYYY-MM-DD HH:mm:ss'), endDate.format('YYYY-MM-DD HH:mm:ss'));\r\n },\r\n\r\n setValue: function(startDate, endDate) {\r\n if (startDate) this.daterangepicker.setStartDate(this.formatDate(startDate));\r\n if (endDate) this.daterangepicker.setEndDate(this.formatDate(endDate));\r\n this.$node.value = startDate && endDate ? this.formatDate(startDate) + this.props.separator + this.formatDate(endDate) : '';\r\n this.input.value = startDate && endDate ? startDate + '/' + endDate : '';\r\n this.input1.value = startDate || '';\r\n this.input2.value = endDate || '';\r\n this.set('start', startDate);\r\n this.set('end', endDate);\r\n this.updateData(true);\r\n }\r\n\r\n});\r\n"]}