UNPKG

ng-zorro-antd-mobile

Version:

An enterprise-class mobile UI components based on Ant Design and Angular

1 lines 81.3 kB
{"version":3,"file":"ng-zorro-antd-mobile-date-picker.mjs","sources":["../../components/date-picker/date-picker-options.provider.ts","../../components/date-picker/date-picker.component.ts","../../components/date-picker/date-picker.component.html","../../components/date-picker/date-picker.directive.ts","../../components/date-picker/date-picker.module.ts","../../components/date-picker/ng-zorro-antd-mobile-date-picker.ts"],"sourcesContent":["import { EventEmitter, Injectable } from '@angular/core';\n\nexport interface DatePickerOptionsInterface {\n mode: string;\n value: Date;\n minDate: Date;\n maxDate: Date;\n use12Hours: boolean;\n minuteStep: Number;\n locale: any;\n disabled: boolean;\n mask: boolean;\n title: string;\n okText: string;\n dismissText: string;\n appendToBody: boolean;\n showErrorToast: boolean;\n showErrorToastInterval: number;\n}\n\n@Injectable()\nexport class DatePickerOptions implements DatePickerOptionsInterface {\n mode = 'date';\n value = new Date();\n minDate = new Date(2000, 6, 1, 0, 0, 0);\n maxDate = new Date(2030, 1, 1, 23, 59, 59);\n use12Hours = false;\n minuteStep = 1;\n data = [];\n mask: boolean = true;\n title = '';\n okText = '确定';\n dismissText = '取消';\n disabled = false;\n locale;\n appendToBody = false;\n showErrorToast = true;\n showErrorToastInterval = 2000;\n onOk: EventEmitter<any> = new EventEmitter();\n onDismiss: EventEmitter<any> = new EventEmitter();\n onValueChange: EventEmitter<any> = new EventEmitter();\n onChange: EventEmitter<any> = new EventEmitter();\n hidePicker: () => void;\n updateNgModel?: (value: Date) => void;\n}\n","import {\n Component,\n OnInit,\n ElementRef,\n ViewEncapsulation,\n HostListener,\n ViewChild,\n ViewContainerRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { LocaleProviderService } from 'ng-zorro-antd-mobile/locale-provider';\nimport { DatePickerOptions } from './date-picker-options.provider';\nimport { ToastService } from 'ng-zorro-antd-mobile/toast';\nimport { getVelocity } from 'ng-zorro-antd-mobile/core';\nexport type DateMode = 'date' | 'time' | 'datetime' | 'year' | 'month';\n\n@Component({\n selector: 'DatePicker, nzm-date-picker',\n templateUrl: './date-picker.component.html',\n encapsulation: ViewEncapsulation.None\n})\nexport class DatePickerComponent implements OnInit, OnDestroy, AfterViewInit {\n transitionName: string = 'am-slide-up-enter am-slide-up-enter-active';\n maskTransitionName: string = 'am-fade-enter am-fade-enter-active';\n modeSwitch: number[] = [1, 1, 1, 1, 1, 1];\n localMinDate: any[] = [];\n localMaxDate: any[] = [];\n currentTime: any[] = [];\n indexArray: any = [];\n min_date: number[] = [];\n max_date: number[] = [];\n current_time: any[] = [\n new Date().getFullYear(),\n new Date().getMonth() + 1,\n new Date().getDate(),\n new Date().getHours(),\n new Date().getMinutes()\n ];\n clos: number = 0;\n resultArr: any = [];\n resultDate: Date;\n data: any[] = [];\n dataWithStr: any[] = [];\n startY: number = 0;\n differY: number = 0;\n currentY: number = 0;\n len: number = 0;\n dom: any = null;\n index: number = 0;\n maxY: number = 0;\n lineHeight: number = 34;\n selectedTarget: any[] = [];\n isMouseDown: boolean = false;\n currentPicker: any;\n localeNew: any = {};\n unsubscribe$ = new Subject<void>();\n Velocity = getVelocity();\n errorMessage = '';\n curTLessThanMin = false;\n curTMoreThanMax = false;\n ngModelOnChange: (value: Date) => {};\n ngModelOnTouched: () => {};\n\n @ViewChild('picker', { read: ViewContainerRef })\n picker: ViewContainerRef;\n\n @HostListener('mousedown', ['$event'])\n @HostListener('touchstart', ['$event'])\n panstart(event) {\n if (!event.target.classList.contains('am-picker-col-mask')) {\n return;\n }\n this.isMouseDown = true;\n event.preventDefault();\n this.dom = event.target.parentElement.children[2];\n this.len = this.dom.children.length;\n this.maxY = -(this.len - 1);\n\n if (this.dom.style.transform === 'translateY(0px)') {\n this.currentY = 0;\n this.maxY = -(this.len - 1);\n } else if (this.selectedTarget.length > 0) {\n this.selectedTarget.forEach(item => {\n if (item.targetId === event.target.id) {\n this.currentY = item.currentY;\n }\n });\n }\n const ev = this.getEventTarget(event);\n this.startY = ev.clientY;\n }\n @HostListener('mousemove', ['$event'])\n @HostListener('touchmove', ['$event'])\n panmove(event) {\n if (!event.target.classList.contains('am-picker-col-mask') || !this.isMouseDown) {\n return;\n }\n event.preventDefault();\n const ev = this.getEventTarget(event);\n this.differY = ev.clientY - this.startY;\n this.Velocity.record(this.differY);\n this.dom.style.transition = 'transform 0s';\n this.dom.style.transform = `translateY(${this.currentY * this.lineHeight + this.differY}px)`;\n }\n @HostListener('mouseleave', ['$event'])\n @HostListener('mouseup', ['$event'])\n @HostListener('touchend', ['$event'])\n panend(event) {\n if (!event.target.classList.contains('am-picker-col-mask') || !this.isMouseDown) {\n return;\n }\n this.isMouseDown = false;\n event.preventDefault();\n const ev = this.getEventTarget(event);\n this.differY = ev.clientY - this.startY;\n let time = 0.3;\n const velocityTemp = this.Velocity.getVelocity(this.differY) * 4;\n if (velocityTemp) {\n this.differY = velocityTemp * 40 + this.differY;\n time = Math.abs(velocityTemp) * 0.1;\n }\n this.dom.style.transition = 'transform ' + (time < 0.3 ? 0.3 : time) + 's';\n if (this.differY <= -this.lineHeight / 2) {\n this.currentY += Math.floor(this.differY / this.lineHeight);\n if (this.currentY <= this.maxY) {\n this.currentY = this.maxY;\n }\n } else if (this.differY >= this.lineHeight / 2) {\n this.currentY += Math.floor(this.differY / this.lineHeight);\n if (this.currentY >= 0) {\n this.currentY = 0;\n }\n }\n\n if (this.selectedTarget.length > 0) {\n let hasKey = false;\n this.selectedTarget.forEach(item => {\n if (item.targetId === event.target.id) {\n hasKey = true;\n item.targetId = event.target.id;\n item.currentY = this.currentY;\n }\n });\n if (!hasKey) {\n this.selectedTarget.push({ targetId: event.target.id, currentY: this.currentY });\n }\n } else {\n this.selectedTarget.push({ targetId: event.target.id, currentY: this.currentY });\n }\n this.dom.style.transform = `translateY(${this.currentY * this.lineHeight}px)`;\n this.index = Math.floor(Math.abs(this.currentY / 1)); // 记录当前位移在数组中的索引,必须取整,否则会出现浮点数\n this.current_time[this.indexArray[parseInt(event.target.id, 0)]] = this.resultArr[\n this.indexArray[parseInt(event.target.id, 0)]\n ] = this.data[parseInt(event.target.id, 0)][this.index];\n if (this.judgeTime(this.current_time, this.max_date)) {\n this.currentTime = this.current_time =\n this.max_date.slice(0, this.options.mode === 'time' ? this.modeSwitch.length : this.indexArray.length);\n this.resultArr = this.current_time;\n this.options.onValueChange.emit({ date: this.handleReslut(), index: event.target.id });\n if (this.options.updateNgModel) {\n this.options.updateNgModel(this.handleReslut());\n }\n if (this.ngModelOnChange) {\n this.ngModelOnChange(this.handleReslut());\n }\n this.init();\n } else if (this.judgeTime(this.min_date, this.current_time)) {\n this.currentTime = this.current_time =\n this.min_date.slice(0, this.options.mode === 'time' ? this.modeSwitch.length : this.indexArray.length);\n this.resultArr = this.currentTime;\n this.options.onValueChange.emit({ date: this.handleReslut(), index: event.target.id });\n if (this.options.updateNgModel) {\n this.options.updateNgModel(this.handleReslut());\n }\n if (this.ngModelOnChange) {\n this.ngModelOnChange(this.handleReslut());\n }\n this.init();\n } else {\n this.updateLessMoreState();\n this.setCurrentSelected(0, this.differY < 0, this.index);\n this.options.onValueChange.emit({ date: this.handleReslut(), index: event.target.id });\n if (this.options.updateNgModel) {\n this.options.updateNgModel(this.handleReslut());\n }\n if (this.ngModelOnChange) {\n this.ngModelOnChange(this.handleReslut());\n }\n }\n }\n\n updateLessMoreState() {\n const minT = new Date(this.min_date[0], this.min_date[1], this.min_date[2], this.min_date[3], this.min_date[4]).getTime();\n const maxT = new Date(this.max_date[0],this.max_date[1], this.max_date[2], this.max_date[3], this.max_date[4]).getTime();\n const curT = new Date(\n this.current_time[0],\n this.current_time[1],\n this.current_time[2],\n this.current_time[3] || 0,\n this.current_time[4] || 0\n ).getTime();\n this.curTLessThanMin = curT < minT;\n this.curTMoreThanMax = curT > maxT;\n }\n\n constructor(\n public elementRef: ElementRef,\n public options: DatePickerOptions,\n public toast: ToastService,\n public localeProviderService: LocaleProviderService\n ) {}\n\n init() {\n if (!this.checkTime() && this.options.showErrorToast) {\n setTimeout(() => {\n this.toast.fail(this.errorMessage, this.options.showErrorToastInterval);\n }, 0);\n }\n this.initResult();\n this.initReady();\n this.getInitValueIndex();\n }\n\n reloadPicker() {\n if (!this.picker || this.picker === undefined) {\n return;\n }\n this.currentPicker = this.picker.element.nativeElement;\n if (this.currentPicker && this.currentPicker.children.length > 0) {\n const self = this;\n setTimeout(() => {\n self.selectedTarget.forEach((item, i) => {\n self.currentPicker.children[i].children[2].style.transition = 'transform .3s';\n const index = parseInt(item.currentY, 0);\n self.currentPicker.children[i].children[2].style.transform = `translateY(${index * self.lineHeight}px)`;\n });\n }, 0);\n }\n }\n\n localeProvider() {\n const self = this;\n if (self.options.locale || self.options.locale !== undefined) {\n self.localeProviderService.setLocale(self.options.locale);\n }\n self.localeProviderService.localeChange.pipe(takeUntil(self.unsubscribe$)).subscribe(_ => {\n self.options.locale = self.localeProviderService.getLocale();\n self.localeNew = self.localeProviderService.getLocaleSubObj('DatePicker');\n self.options.okText = self.localeNew.okText;\n self.options.dismissText = self.localeNew.dismissText;\n self.init();\n });\n }\n\n transformDateFormat(date: Date): any {\n if (!date) {\n return '';\n } else {\n return 'yyyy-mm-dd-HH-MM'\n .replace('yyyy', date.getFullYear() + '')\n .replace('mm', date.getMonth() + 1 + '')\n .replace('dd', date.getDate() + '')\n .replace('HH', date.getHours() + '')\n .replace('MM', date.getMinutes() + '');\n }\n }\n\n preZero(val: number): string {\n return val < 10 ? '0' + val : val + '';\n }\n\n getInitValueIndex() {\n this.selectedTarget = [];\n this.indexArray.map((index, i) => {\n this.data.forEach((item, j) => {\n item.forEach((item1, k) => {\n if (this.currentTime[index] === item1 && i === j) {\n this.selectedTarget.push({ targetId: `${i}`, currentY: -k });\n }\n });\n });\n });\n this.reloadPicker();\n }\n\n checkMode(mode) {\n this.modeSwitch = [1, 1, 1, 1, 1, 1];\n switch (mode) {\n case 'date':\n this.modeSwitch = [1, 1, 1, 0, 0, 0];\n break;\n case 'time':\n if (this.options.use12Hours) {\n this.modeSwitch = [0, 0, 0, 1, 1, 1];\n } else {\n this.modeSwitch = [0, 0, 0, 1, 1, 0];\n }\n break;\n case 'datetime':\n if (this.options.use12Hours) {\n this.modeSwitch = [1, 1, 1, 1, 1, 1];\n } else {\n this.modeSwitch = [1, 1, 1, 1, 1, 0];\n }\n break;\n case 'year':\n this.modeSwitch = [1, 0, 0, 0, 0];\n break;\n case 'month':\n this.modeSwitch = [1, 1, 0, 0, 0];\n break;\n default:\n break;\n }\n const tempIndexArray = [];\n for (let i = 0; i < this.modeSwitch.length; i++) {\n if (this.modeSwitch[i] > 0) {\n tempIndexArray.push(i);\n }\n }\n this.clos = tempIndexArray[tempIndexArray.length - 1] - tempIndexArray[0] + 1;\n this.indexArray = tempIndexArray;\n }\n\n initResult() {\n this.resultArr = [];\n for (let i = 0; i < this.clos; i++) {\n const res = this.currentTime[i];\n if (this.options.mode === 'time') {\n this.resultArr = this.currentTime;\n } else {\n this.resultArr.push(res);\n }\n }\n }\n\n checkTime() {\n const min_Date = this.transformDateFormat(this.options.minDate).split('-');\n if (min_Date.length > 0) {\n this.min_date = min_Date.map(item => {\n return parseInt(item, 0);\n });\n }\n const max_Date = this.transformDateFormat(this.options.maxDate).split('-');\n if (max_Date.length > 0) {\n this.max_date = max_Date.map(item => {\n return parseInt(item, 0);\n });\n }\n const min_date = [...this.min_date];\n const max_date = [...this.max_date];\n const current_time = [...this.currentTime];\n this.localMinDate = [];\n if (this.localMinDate.length === 0) {\n for (let index = 0; index < this.indexArray.length; index++) {\n this.localMinDate.push(min_date[this.indexArray[index]]);\n }\n }\n this.localMaxDate = [];\n if (this.localMaxDate.length === 0) {\n for (let index = 0; index < this.indexArray.length; index++) {\n this.localMaxDate.push(max_date[this.indexArray[index]]);\n }\n }\n if (this.indexArray.length === this.localMinDate.length && this.localMinDate.length === this.localMaxDate.length) {\n const minT = new Date(min_date[0], min_date[1], min_date[2], min_date[3], min_date[4]).getTime();\n const maxT = new Date(max_date[0], max_date[1], max_date[2], max_date[3], max_date[4]).getTime();\n const curT = new Date(\n current_time[0],\n current_time[1],\n current_time[2],\n current_time[3] || 0,\n current_time[4] || 0\n ).getTime();\n this.curTLessThanMin = false;\n this.curTMoreThanMax = false;\n if (curT < minT) {\n this.curTLessThanMin = true;\n this.currentTime = this.min_date;\n this.errorMessage = this.localeNew.curTLessthanMin;\n }\n if (curT > maxT) {\n this.curTMoreThanMax = true;\n this.currentTime = this.max_date;\n this.errorMessage = this.localeNew.curTMorethanMax;\n }\n let _indexArrayIndex = 0;\n let timeModeIndex = this.options.mode === 'time' ? 3 : 0;\n for (let i = 0; i < this.modeSwitch.length; i++) {\n if (this.modeSwitch[i] === 0) {\n switch (i) {\n case 0:\n min_date[i] = new Date().getFullYear();\n max_date[i] = new Date().getFullYear();\n break;\n case 1:\n min_date[i] = new Date().getMonth() + 1;\n max_date[i] = new Date().getMonth() + 1;\n break;\n case 2:\n min_date[i] = new Date().getDate();\n max_date[i] = new Date().getDate();\n break;\n case 3:\n min_date[i] = new Date().getHours();\n max_date[i] = new Date().getHours();\n break;\n case 4:\n min_date[i] = new Date().getMinutes();\n max_date[i] = new Date().getMinutes();\n break;\n case 5:\n min_date[i] = 0;\n max_date[i] = 1;\n break;\n }\n } else {\n switch (i) {\n case 0:\n this.localMinDate[_indexArrayIndex] = min_date[i] =\n this.localMinDate[_indexArrayIndex] >= 1900\n ? this.localMinDate[_indexArrayIndex]\n : new Date().getFullYear();\n this.localMaxDate[_indexArrayIndex] = max_date[i] =\n this.localMaxDate[_indexArrayIndex] >= 1900\n ? this.localMaxDate[_indexArrayIndex]\n : new Date().getFullYear() + 1;\n break;\n case 1:\n this.localMinDate[_indexArrayIndex] = min_date[i] =\n this.localMinDate[_indexArrayIndex] > 0 && this.localMinDate[_indexArrayIndex] <= 12\n ? this.localMinDate[_indexArrayIndex]\n : 1;\n this.localMaxDate[_indexArrayIndex] = max_date[i] =\n this.localMaxDate[_indexArrayIndex] > 0 && this.localMaxDate[_indexArrayIndex] <= 12\n ? this.localMaxDate[_indexArrayIndex]\n : 12;\n break;\n case 2:\n this.localMinDate[_indexArrayIndex] = min_date[i] =\n this.localMinDate[_indexArrayIndex] > 0 &&\n this.localMinDate[_indexArrayIndex] <= new Date(min_date[0], min_date[1], 0).getDate()\n ? this.localMinDate[_indexArrayIndex]\n : 1;\n this.localMaxDate[_indexArrayIndex] = max_date[i] =\n this.localMaxDate[_indexArrayIndex] > 0 &&\n this.localMaxDate[_indexArrayIndex] <= new Date(max_date[0], max_date[1], 0).getDate()\n ? this.localMaxDate[_indexArrayIndex]\n : new Date(max_date[0], max_date[1], 0).getDate();\n break;\n case 3:\n this.localMinDate[_indexArrayIndex] = min_date[i] =\n this.localMinDate[_indexArrayIndex - timeModeIndex] >= 0 && this.localMinDate[_indexArrayIndex - timeModeIndex] <= 23\n ? this.localMinDate[_indexArrayIndex - timeModeIndex]\n : 0;\n if (this.options.use12Hours) {\n this.localMaxDate[_indexArrayIndex] = max_date[i] =\n this.localMaxDate[_indexArrayIndex - timeModeIndex] >= 0 && this.localMaxDate[_indexArrayIndex - timeModeIndex] <= 11\n ? this.localMaxDate[_indexArrayIndex - timeModeIndex]\n : 11;\n } else {\n this.localMaxDate[_indexArrayIndex] = max_date[i] =\n this.localMaxDate[_indexArrayIndex - timeModeIndex] >= 0 && this.localMaxDate[_indexArrayIndex - timeModeIndex] <= 23\n ? this.localMaxDate[_indexArrayIndex - timeModeIndex]\n : 23;\n }\n break;\n case 4:\n this.localMinDate[_indexArrayIndex] = min_date[i] =\n this.localMinDate[_indexArrayIndex - timeModeIndex] >= 0 && this.localMinDate[_indexArrayIndex - timeModeIndex] <= 59\n ? this.localMinDate[_indexArrayIndex - timeModeIndex]\n : 0;\n this.localMaxDate[_indexArrayIndex] = max_date[i] =\n this.localMaxDate[_indexArrayIndex - timeModeIndex] >= 0 && this.localMaxDate[_indexArrayIndex - timeModeIndex] <= 59\n ? this.localMaxDate[_indexArrayIndex - timeModeIndex]\n : 59;\n break;\n }\n }\n _indexArrayIndex++;\n }\n return minT <= curT && curT <= maxT;\n } else {\n this.errorMessage = this.localeNew.errorMessage;\n return false;\n }\n }\n\n judgeTime(arr1: number[], arr2: number[]): boolean {\n let date1;\n let date2;\n date1 = arr1.slice(0, 3).join('-') + ' ' + arr1.slice(3, 5).join(':');\n date2 = arr2.slice(0, 3).join('-') + ' ' + arr2.slice(3, 5).join(':');\n return new Date(date1).getTime() > new Date(date2).getTime();\n }\n\n judgeEqualArray(arr1, arr2, length) {\n let status = true;\n for (let i = 0; i < length; i++) {\n if (arr1[i] != arr2[i]) {\n status = false;\n }\n }\n return status;\n }\n\n initReady() {\n let realIdx = 0;\n for (let i = 0; i < this.clos; i++) {\n realIdx = this.indexArray[i];\n let min = 0;\n let max = 0;\n const tempArray = [];\n switch (realIdx) {\n case 0:\n this.initData(tempArray, this.localMinDate[i], this.localMaxDate[i], this.localeNew.year, i);\n break;\n case 1:\n min = this.judgeEqualArray(this.min_date, this.current_time, 1) ? this.localMinDate[i] : 1;\n max = this.judgeEqualArray(this.max_date, this.current_time, 1) ? this.localMaxDate[i] : 12;\n this.initData(tempArray, min, max, this.localeNew.month, i);\n break;\n case 2:\n min = this.judgeEqualArray(this.min_date, this.current_time, 2)\n ? this.localMinDate[i]\n : this.curTLessThanMin\n ? this.localMinDate[i]\n : 1;\n max = this.judgeEqualArray(this.max_date, this.current_time, 2)\n ? this.localMaxDate[i]\n : new Date(this.current_time[0], this.current_time[1], 0).getDate();\n this.initData(tempArray, min, max, this.localeNew.day, i);\n break;\n case 3:\n min = this.judgeEqualArray(this.min_date, this.current_time, 3)\n ? this.localMinDate[i]\n : this.curTLessThanMin\n ? this.localMinDate[i]\n : 0;\n max = this.judgeEqualArray(this.max_date, this.current_time, 3)\n ? this.localMaxDate[i]\n : this.curTMoreThanMax\n ? this.localMaxDate[i]\n : 23;\n this.initData(tempArray, min, max, this.localeNew.hour, i);\n break;\n case 4:\n min = this.judgeEqualArray(this.min_date, this.current_time, 4)\n ? this.localMinDate[i]\n : this.curTLessThanMin\n ? this.localMinDate[i]\n : 0;\n max = this.judgeEqualArray(this.max_date, this.current_time, 4)\n ? this.localMaxDate[i]\n : this.curTMoreThanMax\n ? this.localMaxDate[i]\n : 59;\n this.initData(tempArray, min, max, this.localeNew.minute, i);\n break;\n case 5:\n min = 0;\n max = 1;\n this.initData(tempArray, min, max, 'use12Hours', i);\n break;\n }\n }\n }\n\n initData(tempArr, min, max, str, idx) {\n const dataWithStr = [];\n const increaseValue = str === this.localeNew.minute ? this.options.minuteStep : 1;\n for (min; min < max + 1; min += increaseValue) {\n tempArr.push(min);\n dataWithStr.push(min + str);\n }\n if (this.data.length > this.indexArray.length) {\n this.data = [];\n this.dataWithStr = [];\n }\n if (this.data.length > idx && this.data[idx].toString() !== tempArr.toString()) {\n this.data[idx] = tempArr;\n } else if (this.data.length > idx && this.data[idx].toString() === tempArr.toString()) {\n this.data[idx] = tempArr;\n } else {\n this.data.push(tempArr);\n }\n if (this.options.locale === undefined || this.options.locale.locale === 'zh_CN') {\n if (this.dataWithStr.length > idx && this.dataWithStr[idx].toString() !== dataWithStr.toString()) {\n this.dataWithStr[idx] = dataWithStr;\n } else if (this.dataWithStr.length > idx && this.dataWithStr[idx].toString() === dataWithStr.toString()) {\n this.dataWithStr[idx] = dataWithStr;\n } else {\n this.dataWithStr.push(dataWithStr);\n }\n } else {\n this.dataWithStr = this.data;\n }\n }\n\n ok() {\n this.options.onOk.emit(this.handleReslut());\n this.setTransitionName();\n }\n\n handleReslut() {\n let result = '';\n if (this.options.mode === 'datetime' || this.options.mode === 'time') {\n const temp = this.resultArr;\n result = temp.slice(0, 3).join('-') + ' ' + temp.slice(3, 5).join(':');\n } else {\n if (this.resultArr.length < 3) {\n this.resultArr.push('1');\n }\n result = this.resultArr\n .slice(0, 3)\n .map(v => {\n return this.preZero(parseInt(v, 0));\n })\n .join('-');\n }\n this.resultDate = new Date(result.replace(/-/g, '/'));\n if (this.options.minDate.getTime() > this.resultDate.getTime()) {\n if (this.resultArr.length > 0) {\n for (let index = 0; index < this.resultArr.length; index++) {\n this.resultArr = [...this.min_date];\n this.currentTime = this.resultArr;\n this.current_time = this.currentTime;\n }\n }\n this.resultDate = this.options.minDate;\n }\n return this.resultDate;\n }\n\n cancel() {\n this.options.onDismiss.emit();\n this.setTransitionName();\n }\n\n setTransitionName() {\n this.transitionName = 'am-slide-up-leave am-slide-up-leave-active';\n this.maskTransitionName = 'am-fade-leave am-fade-leave-active';\n setTimeout(() => {\n this.options.hidePicker();\n }, 200);\n }\n\n setCurrentSelected(checkIdx, sta, indexT) {\n if (checkIdx >= this.clos - 1) {\n return;\n }\n let status = null;\n if (sta) {\n status = this.judgeEqualArray(this.min_date, this.resultArr, this.options.mode === 'time' ? checkIdx + 4 : checkIdx + 1);\n } else {\n status = this.judgeEqualArray(this.max_date, this.resultArr, this.options.mode === 'time' ? checkIdx + 4 : checkIdx + 1);\n }\n if (!status) {\n let min = 0;\n let max = 0;\n let str = '';\n const realIdx = this.indexArray[checkIdx];\n switch (realIdx) {\n case 0:\n min = this.judgeEqualArray(this.min_date, this.current_time, 1) ? this.localMinDate[checkIdx + 1] : 1;\n max = this.judgeEqualArray(this.max_date, this.current_time, 1) ? this.localMaxDate[checkIdx + 1] : 12;\n str = '月';\n break;\n case 1:\n min = this.judgeEqualArray(this.min_date, this.current_time, 2)\n ? this.localMinDate[checkIdx + 1]\n : this.curTLessThanMin\n ? this.localMinDate[checkIdx + 1]\n : 1;\n max = this.judgeEqualArray(this.max_date, this.current_time, 2)\n ? this.localMaxDate[checkIdx + 1]\n : new Date(this.current_time[0], this.current_time[1], 0).getDate();\n str = '日';\n break;\n case 2:\n min = this.judgeEqualArray(this.min_date, this.current_time, 3)\n ? this.localMinDate[checkIdx + 1]\n : this.curTLessThanMin\n ? this.localMinDate[checkIdx + 1]\n : 0;\n max = this.judgeEqualArray(this.max_date, this.current_time, 3)\n ? this.localMaxDate[checkIdx + 1]\n : this.curTMoreThanMax\n ? this.localMaxDate[checkIdx + 1]\n : 23;\n str = '时';\n break;\n case 3:\n min = this.judgeEqualArray(this.min_date, this.current_time, 4)\n ? this.localMinDate[checkIdx + 1]\n : this.curTLessThanMin\n ? this.localMinDate[checkIdx + 1]\n : 0;\n max = this.judgeEqualArray(this.max_date, this.current_time, 4)\n ? this.localMaxDate[checkIdx + 1]\n : this.curTMoreThanMax\n ? this.localMaxDate[checkIdx + 1]\n : 59;\n str = '分';\n break;\n }\n\n this.initRangeArr(min, max, indexT, checkIdx + 1, str);\n }\n this.setCurrentSelected(checkIdx + 1, sta, indexT);\n }\n\n initRangeArr(min, max, indexT, checkIdx, str) {\n const realIdx = this.indexArray[checkIdx];\n const arr = [];\n let targetLong = 0;\n const increaseValue = str === this.localeNew.minute ? this.options.minuteStep : 1;\n\n for (let index = min; index < max + 1; index += increaseValue) {\n arr.push(index);\n }\n\n if (arr.indexOf(this.resultArr[realIdx]) == -1) {\n if (-this.selectedTarget[checkIdx].currentY > max - min) {\n indexT = max - min;\n this.selectedTarget[checkIdx].currentY = -indexT;\n }\n targetLong = -arr.length * this.lineHeight;\n } else {\n targetLong = -arr.indexOf(this.resultArr[realIdx]) * this.lineHeight;\n this.selectedTarget[checkIdx].currentY = -arr.indexOf(this.resultArr[realIdx]);\n }\n if (this.data[checkIdx].toString() !== arr.toString()) {\n if (checkIdx >= 3) {\n this.current_time[realIdx] = -targetLong / this.lineHeight;\n this.resultArr[realIdx] = -targetLong / this.lineHeight;\n } else {\n const delta = this.judgeEqualArray(this.current_time, this.min_date, realIdx) ? this.min_date[realIdx] : 1;\n this.current_time[realIdx] = -targetLong / this.lineHeight + delta;\n this.resultArr[realIdx] = -targetLong / this.lineHeight + delta;\n }\n\n this.data[checkIdx] = arr;\n this.dataWithStr[checkIdx] =\n this.options.locale.locale === 'zh_CN'\n ? arr.map(item => {\n return item + str;\n })\n : arr;\n setTimeout(() => {\n this.selectedTarget.forEach((item, i) => {\n if (i >= checkIdx) {\n this.currentPicker.children[i].children[2].style.transition = '';\n const index = parseInt(item.currentY, 0);\n this.currentPicker.children[i].children[2].style.transform = `translateY(${index * this.lineHeight}px)`;\n }\n });\n }, 0);\n }\n }\n\n getEventTarget(event) {\n if (\n event.type === 'mousedown' ||\n event.type === 'mousemove' ||\n event.type === 'mouseup' ||\n event.type === 'mouseleave'\n ) {\n return event;\n } else {\n if (event && event.changedTouches && event.changedTouches[0]) {\n return event.changedTouches[0];\n }\n return null;\n }\n }\n\n ngOnInit() {\n this.checkMode(this.options.mode);\n const value = this.transformDateFormat(this.options.value).split('-');\n if (value.length > 1) {\n this.current_time = this.currentTime = value.map(item => {\n return parseInt(item, 0);\n });\n } else {\n this.currentTime = this.current_time;\n }\n this.localeProvider();\n }\n\n ngAfterViewInit() {\n this.reloadPicker();\n }\n\n ngOnDestroy() {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n}\n","<div *ngIf=\"options.mask\" class=\"am-picker-popup-mask {{ maskTransitionName }}\" (click)=\"cancel()\"></div>\n<div class=\"am-picker-popup {{ transitionName }}\" style=\"z-index: 1000\">\n <div class=\"am-picker-popup-content\">\n <div class=\"am-picker-popup-body\">\n <div>\n <div class=\"am-picker-popup-header\">\n <div class=\"am-picker-popup-item am-picker-popup-header-left\" (click)=\"cancel()\">\n {{ options.dismissText }}\n </div>\n <div class=\"am-picker-popup-item am-picker-popup-title\">{{ options.title }}</div>\n <div class=\"am-picker-popup-item am-picker-popup-header-right\" (click)=\"ok()\">\n {{ options.okText }}\n </div>\n </div>\n <div #picker class=\"am-picker\" style=\"flex-direction: row; align-items: center;\">\n <div *ngFor=\"let item of dataWithStr; let i = index\" class=\"am-picker-col\">\n <div class=\"am-picker-col-indicator \" style=\"top: 102px;\"></div>\n <div id=\"{{ i }}\" class=\"am-picker-col-mask\" style=\"background-size: 100% 102px;\"></div>\n <div class=\"am-picker-col-content\">\n <div id=\"{{ i }}\" class=\"am-picker-col-item\" *ngFor=\"let val of item; let i = index\">\n {{ val.label ? val.label : val }}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n","import {\n Input,\n Output,\n OnInit,\n Injector,\n OnChanges,\n OnDestroy,\n Directive,\n forwardRef,\n EventEmitter,\n HostListener,\n ComponentRef,\n SimpleChanges,\n ComponentFactory,\n ViewContainerRef,\n ComponentFactoryResolver\n} from '@angular/core';\nimport { DatePickerComponent } from './date-picker.component';\nimport { DatePickerOptions } from './date-picker-options.provider';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n@Directive({\n selector: '[DatePicker]',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DatePickerDirective),\n multi: true\n }\n ]\n})\nexport class DatePickerDirective implements OnDestroy, OnChanges, OnInit, ControlValueAccessor {\n picker: ComponentRef<DatePickerComponent>;\n appendToBodyElement: HTMLElement;\n private _eventListeners: Array<() => void> = [];\n private _ngModelOnChange: (value: Date) => {};\n private _ngModelOnTouched: () => {};\n\n @Input()\n isOpen: boolean;\n @Input()\n mode: string;\n @Input()\n minDate: string;\n @Input()\n maxDate: string;\n @Input()\n use12Hours: boolean;\n @Input()\n minuteStep: number = 1;\n @Input()\n value: Date = new Date();\n @Input()\n mask: boolean;\n @Input()\n title: string;\n @Input()\n okText: string;\n @Input()\n dismissText: string;\n @Input()\n disabled: boolean;\n @Input()\n locale: any;\n @Input()\n appendToBody: boolean;\n @Input()\n showErrorToast: boolean;\n @Input()\n showErrorToastInterval: number;\n @Output()\n onVisibleChange: EventEmitter<boolean> = new EventEmitter(true);\n @Output()\n onValueChange: EventEmitter<any> = new EventEmitter();\n @Output()\n onOk: EventEmitter<any> = new EventEmitter();\n @Output()\n onDismiss: EventEmitter<any> = new EventEmitter();\n\n @HostListener('click')\n togglePicker(): void {\n if (!this.picker) {\n this.showPicker();\n } else {\n this.hidePicker();\n }\n }\n\n constructor(\n private _viewContainerRef: ViewContainerRef,\n private _defaultOptions: DatePickerOptions,\n private _cfr: ComponentFactoryResolver\n ) {}\n\n showPicker(): void {\n if (!this.picker && !this.disabled) {\n setTimeout(() => {\n this._eventListeners = [];\n });\n\n const options = new DatePickerOptions();\n Object.assign(options, this._defaultOptions, {\n hidePicker: (event): void => {\n this.hidePicker();\n },\n updateNgModel: (value: Date): void => {\n if (this._ngModelOnChange) {\n this.value = value;\n this._ngModelOnChange(value);\n }\n }\n });\n\n const optionalParams: Array<keyof DatePickerDirective> = [\n 'mode',\n 'minDate',\n 'maxDate',\n 'minuteStep',\n 'value',\n 'mask',\n 'title',\n 'okText',\n 'dismissText',\n 'disabled',\n 'locale',\n 'appendToBody',\n 'showErrorToast',\n 'showErrorToastInterval',\n 'onOk',\n 'onDismiss',\n 'onValueChange'\n ];\n optionalParams.forEach(param => {\n if (typeof this[param] !== 'undefined') {\n (options as any)[param] = this[param];\n }\n });\n const componentFactory: ComponentFactory<DatePickerComponent> = this._cfr.resolveComponentFactory(\n DatePickerComponent\n );\n const childInjector = Injector.create([\n {\n provide: DatePickerOptions,\n useValue: options\n }\n ]);\n this.picker = this._viewContainerRef.createComponent(\n componentFactory,\n this._viewContainerRef.length,\n childInjector\n );\n if (options.appendToBody) {\n this.appendToBodyElement = document.body.appendChild(this.picker.location.nativeElement);\n }\n this.onVisibleChange.emit(true);\n }\n }\n\n hidePicker(): void {\n if (this.appendToBodyElement) {\n document.body.removeChild(this.appendToBodyElement);\n this.appendToBodyElement = null;\n }\n if (this.picker) {\n this.picker.destroy();\n delete this.picker;\n this.onVisibleChange.emit(false);\n this._eventListeners.forEach(fn => fn());\n this._eventListeners = [];\n }\n }\n\n writeValue(value: Date): void {\n this.value = value;\n }\n\n registerOnChange(fn: (_: Date) => {}): void {\n this._ngModelOnChange = fn;\n }\n\n registerOnTouched(fn: () => {}): void {\n this._ngModelOnTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n ngOnInit(): void {\n this.onVisibleChange.emit(false);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.isOpen) {\n if (changes.isOpen.currentValue === true) {\n this.showPicker();\n } else {\n this.hidePicker();\n }\n }\n }\n\n ngOnDestroy() {\n this.hidePicker();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { DatePickerComponent } from './date-picker.component';\nimport { DatePickerDirective } from './date-picker.directive';\nimport { DatePickerOptions } from './date-picker-options.provider';\nimport { LocaleProviderModule } from 'ng-zorro-antd-mobile/locale-provider';\nimport { ToastModule } from 'ng-zorro-antd-mobile/toast';\n\n@NgModule({\n imports: [CommonModule, LocaleProviderModule, ToastModule, FormsModule],\n exports: [DatePickerComponent, DatePickerDirective],\n declarations: [DatePickerComponent, DatePickerDirective],\n providers: [DatePickerOptions]\n})\nexport class DatePickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DatePickerOptions"],"mappings":";;;;;;;;;;;;;MAqBa,iBAAiB,CAAA;AAD9B,IAAA,WAAA,GAAA;QAEE,IAAI,CAAA,IAAA,GAAG,MAAM,CAAC;AACd,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;AACnB,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxC,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;QACnB,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC;QACf,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;QACV,IAAI,CAAA,IAAA,GAAY,IAAI,CAAC;QACrB,IAAK,CAAA,KAAA,GAAG,E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