@anglr/datetime 5.0.0-beta.20221018120203 → 5.0.0-beta.20221019112435
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/changelog.md +63 -1
- package/es2015/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
- package/es2015/src/legacy/picker/components/dayPicker/dayPicker.component.js +0 -1
- package/es2015/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/monthPicker/monthPicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/picker/picker.component.js +4 -4
- package/es2015/src/legacy/picker/components/picker/picker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/pickerBase.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/pickerImplBase.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/components/yearPicker/yearPicker.component.js.map +1 -1
- package/es2015/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
- package/es2015/src/legacy/picker/misc/tokens.js.map +1 -1
- package/es2015/src/legacy/picker/modules/picker.module.js +9 -9
- package/es2015/src/legacy/picker/modules/picker.module.js.map +1 -1
- package/es2015/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js +2 -2
- package/es2015/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js.map +1 -1
- package/es2015/src/legacy/selector/misc/datetimeSelector.interface.js.map +1 -1
- package/es2015/src/legacy/selector/modules/selector.module.js +4 -4
- package/es2015/src/legacy/selector/modules/selector.module.js.map +1 -1
- package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -12
- package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
- package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +48 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +195 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +78 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/components/index.js +5 -0
- package/es2015/src/modules/dateTimePicker/components/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +195 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/directives/index.js +3 -0
- package/es2015/src/modules/dateTimePicker/directives/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/index.js +6 -0
- package/es2015/src/modules/dateTimePicker/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/interfaces/index.js +2 -0
- package/es2015/src/modules/dateTimePicker/interfaces/index.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/misc/tokens.js +10 -0
- package/es2015/src/modules/dateTimePicker/misc/tokens.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/modules/dateTimePicker.module.js +28 -0
- package/es2015/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -0
- package/es2015/src/modules/dateTimePicker/modules/index.js +2 -0
- package/es2015/src/modules/dateTimePicker/modules/index.js.map +1 -0
- package/es2015/src/modules/index.js +1 -0
- package/es2015/src/modules/index.js.map +1 -1
- package/es2015/src/pipes/dateFormat.pipe.js +3 -9
- package/es2015/src/pipes/dateFormat.pipe.js.map +1 -1
- package/es2020/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
- package/es2020/src/legacy/picker/components/dayPicker/dayPicker.component.js +0 -1
- package/es2020/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/monthPicker/monthPicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/picker/picker.component.js +4 -4
- package/es2020/src/legacy/picker/components/picker/picker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/pickerBase.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/pickerImplBase.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/components/yearPicker/yearPicker.component.js.map +1 -1
- package/es2020/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
- package/es2020/src/legacy/picker/misc/tokens.js.map +1 -1
- package/es2020/src/legacy/picker/modules/picker.module.js +9 -9
- package/es2020/src/legacy/picker/modules/picker.module.js.map +1 -1
- package/es2020/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js +2 -2
- package/es2020/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.js.map +1 -1
- package/es2020/src/legacy/selector/misc/datetimeSelector.interface.js.map +1 -1
- package/es2020/src/legacy/selector/modules/selector.module.js +4 -4
- package/es2020/src/legacy/selector/modules/selector.module.js.map +1 -1
- package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -12
- package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
- package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +48 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +192 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +75 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js +2 -0
- package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/components/index.js +5 -0
- package/es2020/src/modules/dateTimePicker/components/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +188 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/directives/index.js +3 -0
- package/es2020/src/modules/dateTimePicker/directives/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/index.js +6 -0
- package/es2020/src/modules/dateTimePicker/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js +2 -0
- package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/interfaces/index.js +2 -0
- package/es2020/src/modules/dateTimePicker/interfaces/index.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/misc/tokens.js +10 -0
- package/es2020/src/modules/dateTimePicker/misc/tokens.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js +28 -0
- package/es2020/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -0
- package/es2020/src/modules/dateTimePicker/modules/index.js +2 -0
- package/es2020/src/modules/dateTimePicker/modules/index.js.map +1 -0
- package/es2020/src/modules/index.js +1 -0
- package/es2020/src/modules/index.js.map +1 -1
- package/es2020/src/pipes/dateFormat.pipe.js +3 -9
- package/es2020/src/pipes/dateFormat.pipe.js.map +1 -1
- package/package.json +7 -1
- package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts +8 -4
- package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts.map +1 -1
- package/src/legacy/picker/components/dayPicker/dayPicker.component.d.ts +2 -2
- package/src/legacy/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/monthPicker/monthPicker.component.d.ts +2 -2
- package/src/legacy/picker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/picker/picker.component.d.ts +11 -11
- package/src/legacy/picker/components/picker/picker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/pickerBase.component.d.ts +2 -2
- package/src/legacy/picker/components/pickerBase.component.d.ts.map +1 -1
- package/src/legacy/picker/components/pickerImplBase.component.d.ts +2 -2
- package/src/legacy/picker/components/pickerImplBase.component.d.ts.map +1 -1
- package/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts +2 -2
- package/src/legacy/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts.map +1 -1
- package/src/legacy/picker/components/yearPicker/yearPicker.component.d.ts +2 -2
- package/src/legacy/picker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
- package/src/legacy/picker/misc/datetimePicker.interface.d.ts +2 -6
- package/src/legacy/picker/misc/datetimePicker.interface.d.ts.map +1 -1
- package/src/legacy/picker/misc/tokens.d.ts +2 -2
- package/src/legacy/picker/misc/tokens.d.ts.map +1 -1
- package/src/legacy/picker/modules/picker.module.d.ts +4 -4
- package/src/legacy/picker/modules/picker.module.d.ts.map +1 -1
- package/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.d.ts +2 -2
- package/src/legacy/selector/directives/dateTimePickerRenderer/dateTimePickerRenderer.directive.d.ts.map +1 -1
- package/src/legacy/selector/misc/datetimeSelector.interface.d.ts +2 -2
- package/src/legacy/selector/misc/datetimeSelector.interface.d.ts.map +1 -1
- package/src/legacy/selector/modules/selector.module.d.ts +1 -1
- package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts +6 -2
- package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
- package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts +66 -0
- package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +80 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html +1 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.d.ts +17 -0
- package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.css +27 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts +35 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html +21 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.d.ts +11 -0
- package/src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.d.ts.map +1 -0
- package/src/modules/dateTimePicker/components/index.d.ts +5 -0
- package/src/modules/dateTimePicker/components/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts +79 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts +31 -0
- package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
- package/src/modules/dateTimePicker/directives/index.d.ts +3 -0
- package/src/modules/dateTimePicker/directives/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/index.d.ts +6 -0
- package/src/modules/dateTimePicker/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts +48 -0
- package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -0
- package/src/modules/dateTimePicker/interfaces/index.d.ts +2 -0
- package/src/modules/dateTimePicker/interfaces/index.d.ts.map +1 -0
- package/src/modules/dateTimePicker/misc/tokens.d.ts +12 -0
- package/src/modules/dateTimePicker/misc/tokens.d.ts.map +1 -0
- package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts +12 -0
- package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts.map +1 -0
- package/src/modules/dateTimePicker/modules/index.d.ts +2 -0
- package/src/modules/dateTimePicker/modules/index.d.ts.map +1 -0
- package/src/modules/index.d.ts +1 -0
- package/src/modules/index.d.ts.map +1 -1
- package/src/pipes/dateFormat.pipe.d.ts +28 -2
- package/src/pipes/dateFormat.pipe.d.ts.map +1 -1
- package/styles/components/_date-time-picker.scss +8 -0
- package/styles/core/_functions.scss +11 -0
- package/styles/core/_misc.scss +199 -0
- package/styles/core/_mixins.scss +23 -0
- package/styles/core/_theme.scss +3 -0
- package/styles/index.scss +2 -0
- package/styles/themes/dark.scss +19 -0
- package/styles/themes/light.scss +19 -0
- package/version.bak +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.ts","../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;;;;AAGjD;;GAEG;AAiBH,MAAM,OAAO,oBAAsC,SAAQ,wBAA+B;IAetF,iEAAiE;IACjE,YAAwC,OAAuB;QAE3D,KAAK,EAAE,CAAC;QAF4B,YAAO,GAAP,OAAO,CAAgB;QAd/D,8FAA8F;QAE9F;;WAEG;QACO,aAAQ,GAAa,EAAE,CAAC;QAElC;;;WAGG;QACI,eAAU,GAAqB,EAAE,CAAC;IAMzC,CAAC;IAED,2FAA2F;IAEjF,SAAS,CAAC,OAAgB;QAEhC,IAAG,CAAC,IAAI,CAAC,KAAK,EACd;YACI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;SAC/F;QAED,cAAc;QACd,IAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAC7B;YACI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YAE5B,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;SAClC;IACL,CAAC;IAED;;;OAGG;IACO,SAAS,CAAC,KAAY;QAE5B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;QAE/B,kCAAkC;IACtC,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,KAAY;QAEhC,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;QAEpC,mCAAmC;IACvC,CAAC;;iHAhEQ,oBAAoB,kBAgBT,QAAQ;qGAhBnB,oBAAoB,yJC7BjC,65CAoBM,2CDIE,YAAY,+PACZ,eAAe;2FAIV,oBAAoB;kBAhBhC,SAAS;+BAEI,YAAY,QAGtB;wBACI,0BAA0B,EAAE,MAAM;qBACrC,cACW,IAAI,WAEhB;wBACI,YAAY;wBACZ,eAAe;qBAClB,mBACgB,uBAAuB,CAAC,MAAM;;0BAkBlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {DateTimePicker} from '../../interfaces';\nimport {DateTimePeriodPickerBase} from '../dateTimePeriodPickerBase';\nimport {DatePipesModule} from '../../../datePipes.module';\nimport {DayData} from '../../../../legacy/picker/interfaces';\nimport {DATE_API} from '../../../../misc/tokens';\nimport {DateApi} from '../../../../services';\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'day-picker',\n templateUrl: 'dayPicker.component.html',\n host:\n {\n '[class.date-time-period]': 'true',\n },\n standalone: true,\n imports:\n [\n CommonModule,\n DatePipesModule,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DayPickerSAComponent<TDate = unknown> extends DateTimePeriodPickerBase<TDate> implements DateTimePicker<TDate>\n{\n //######################### protected properties - template bindings #########################\n\n /**\n * Names of days\n */\n protected weekdays: string[] = [];\n\n /**\n * Array of period data to be displayed\n * @internal\n */\n public periodData: DayData<TDate>[] = [];\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### protected methods - template bindings #########################\n\n protected selectDay(dayData: DayData): void\n {\n if(!this.value)\n {\n this.value = this.displayDate?.clone() ?? this.dateApi.getValue(this.display ?? new Date());\n }\n\n //single value\n if(!Array.isArray(this.value))\n {\n this.value.dayOfMonth(dayData.day);\n this.value.updateOriginal();\n\n this.valueChangeSubject.next();\n }\n }\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n */\n protected nextMonth(event: Event): void\n {\n event.preventDefault();\n event.stopPropagation();\n this.displayDate?.addMonths(1);\n\n // this.display(this.displayDate);\n }\n\n /**\n * Changes displayed month to previous month\n * @param event - Event that occured\n */\n protected previousMonth(event: Event): void\n {\n event.preventDefault();\n event.stopPropagation();\n this.displayDate?.subtractMonths(1);\n\n // this.display(this.displayDate!);\n }\n}","<div class=\"period\">\r\n <div class=\"fas fa-angle-left clickable\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div class=\"period-value\" [class.clickable]=\"canScaleUp\" (mousedown)=\"$event.stopPropagation(); $event.preventDefault(); displayDate ? scaleUpSubject.next(displayDate.value) : undefined\">{{displayDate?.value | dateFormat: 'monthName'}} {{displayDate?.value | dateFormat: 'year'}}</div>\r\n <div class=\"fas fa-angle-right clickable\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div class=\"period-data\">\r\n <div class=\"weekday\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n class=\"period-datum clickable\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (click)=\"$event.stopPropagation(); $event.preventDefault(); selectDay(day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"go-down-button\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canScaleDown\">\r\n <!-- <div [class.clickable]=\"canScaleDown\" (mousedown)=\"$event.stopPropagation(); $event.preventDefault(); displayDate ? goDownSubject.next(displayDate.value) : undefined\">{{timeValue?.from | dateFormat: 'time'}}</div> -->\r\n</div>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayPicker.interfaces.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dayPicker/dayPicker.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {CommonPickerCssClasses} from '../../../../legacy/picker/interfaces';\n\n/**\n * Specific css classes for day picker\n */\nexport interface DayPickerCssClasses extends CommonPickerCssClasses\n{\n /**\n * Element displaying weekday name\n */\n weekdayName?: string;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './dateTimePeriodPickerBase';\nexport * from './dateTimePicker/dateTimePicker.component';\nexport * from './dateTimePicker/dateTimePicker.interface';\nexport * from './dayPicker/dayPicker.component';\n"]}
|
package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Directive, ElementRef, Inject, Input, Optional, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
import { POSITION, applyPositionResult, PositionPlacement } from '@anglr/common';
|
|
5
|
+
import { extend, nameof, isDescendant, BindThis } from '@jscrpt/common';
|
|
6
|
+
import { lastValueFrom, Subscription } from 'rxjs';
|
|
7
|
+
import { DATE_TIME_INPUT } from '../../../../misc/tokens';
|
|
8
|
+
import { DateTimePickerComponent } from '../../components';
|
|
9
|
+
import { DATE_TIME_PICKER_DIRECTIVE_OPTIONS } from '../../misc/tokens';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
/**
|
|
12
|
+
* Default options for date time picker directive
|
|
13
|
+
*/
|
|
14
|
+
const defaultOptions = {
|
|
15
|
+
absolute: true,
|
|
16
|
+
alwaysVisible: false,
|
|
17
|
+
closeOnValueSelect: true,
|
|
18
|
+
disabled: false,
|
|
19
|
+
positionOptions: PositionPlacement.BottomStart,
|
|
20
|
+
showOnFocus: true,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Directive that is used for displaying and attaching date time picker
|
|
24
|
+
*/
|
|
25
|
+
export class DateTimePickerDirective {
|
|
26
|
+
//######################### constructor #########################
|
|
27
|
+
constructor(viewContainer, element, input, document, position, options) {
|
|
28
|
+
this.viewContainer = viewContainer;
|
|
29
|
+
this.element = element;
|
|
30
|
+
this.input = input;
|
|
31
|
+
this.document = document;
|
|
32
|
+
this.position = position;
|
|
33
|
+
//######################### protected properties #########################
|
|
34
|
+
/**
|
|
35
|
+
* Indication whether is value changes disabled
|
|
36
|
+
*/
|
|
37
|
+
this.valueChangeDisabled = false;
|
|
38
|
+
/**
|
|
39
|
+
* Subscriptions created during initialization
|
|
40
|
+
*/
|
|
41
|
+
this.initSubscriptions = new Subscription();
|
|
42
|
+
this.ɵWithPickerOptions = extend(true, {}, defaultOptions, options);
|
|
43
|
+
}
|
|
44
|
+
//######################### public properties - inputs #########################
|
|
45
|
+
/**
|
|
46
|
+
* Gets or sets options for date time picker directive
|
|
47
|
+
*/
|
|
48
|
+
get withPickerOptions() {
|
|
49
|
+
return this.ɵWithPickerOptions;
|
|
50
|
+
}
|
|
51
|
+
set withPickerOptions(value) {
|
|
52
|
+
this.ɵWithPickerOptions = extend(true, {}, this.ɵWithPickerOptions, value);
|
|
53
|
+
}
|
|
54
|
+
//######################### public methods - implementation of OnInit #########################
|
|
55
|
+
/**
|
|
56
|
+
* Initialize component
|
|
57
|
+
*/
|
|
58
|
+
async ngOnInit() {
|
|
59
|
+
if (this.withPickerOptions.alwaysVisible) {
|
|
60
|
+
this.showPicker();
|
|
61
|
+
}
|
|
62
|
+
this.initSubscriptions.add(this.input.valueChange.subscribe(() => {
|
|
63
|
+
this.setPickerValue();
|
|
64
|
+
this.componentRef?.changeDetectorRef.detectChanges();
|
|
65
|
+
}));
|
|
66
|
+
this.initSubscriptions.add(this.input.focus.subscribe(() => {
|
|
67
|
+
if (this.withPickerOptions.showOnFocus) {
|
|
68
|
+
this.showPicker();
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
//######################### public methods - implementation of OnDestroy #########################
|
|
73
|
+
/**
|
|
74
|
+
* Called when component is destroyed
|
|
75
|
+
*/
|
|
76
|
+
ngOnDestroy() {
|
|
77
|
+
this.hidePicker();
|
|
78
|
+
this.initSubscriptions.unsubscribe();
|
|
79
|
+
}
|
|
80
|
+
//######################### public methods #########################
|
|
81
|
+
/**
|
|
82
|
+
* Hides date time picker
|
|
83
|
+
*/
|
|
84
|
+
async showPicker() {
|
|
85
|
+
if (this.withPickerOptions.disabled || this.componentRef) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.componentRef = this.viewContainer.createComponent((DateTimePickerComponent));
|
|
89
|
+
this.componentElement = this.componentRef?.hostView.rootNodes[0];
|
|
90
|
+
this.component = this.componentRef.instance;
|
|
91
|
+
if (this.withPickerOptions.absolute) {
|
|
92
|
+
this.document.body.append(this.componentElement);
|
|
93
|
+
}
|
|
94
|
+
this.valueChangeSubscription = this.component.valueChange.subscribe(() => {
|
|
95
|
+
if (this.component) {
|
|
96
|
+
this.valueChangeDisabled = true;
|
|
97
|
+
this.input.value = this.component.value;
|
|
98
|
+
this.input.valueChange.emit();
|
|
99
|
+
this.valueChangeDisabled = false;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
this.document.addEventListener('click', this.handleClickOutside);
|
|
103
|
+
const result = await lastValueFrom(this.position.placeElement(this.componentElement, this.element.nativeElement, {
|
|
104
|
+
placement: this.withPickerOptions.positionOptions,
|
|
105
|
+
}));
|
|
106
|
+
applyPositionResult(result);
|
|
107
|
+
this.setPickerValue();
|
|
108
|
+
// this.componentRef.setInput(nameof<DateTimePickerComponent>('valueFormat'), this.input.);
|
|
109
|
+
// this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);
|
|
110
|
+
// this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);
|
|
111
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Shows date time picker
|
|
115
|
+
*/
|
|
116
|
+
hidePicker() {
|
|
117
|
+
if (this.withPickerOptions.alwaysVisible) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.valueChangeSubscription?.unsubscribe();
|
|
121
|
+
this.valueChangeSubscription = null;
|
|
122
|
+
this.component = null;
|
|
123
|
+
this.componentRef?.destroy();
|
|
124
|
+
this.componentRef = null;
|
|
125
|
+
this.componentElement?.remove();
|
|
126
|
+
this.componentElement = null;
|
|
127
|
+
this.document.removeEventListener('click', this.handleClickOutside);
|
|
128
|
+
}
|
|
129
|
+
//######################### protected methods #########################
|
|
130
|
+
/**
|
|
131
|
+
* Sets all picker value
|
|
132
|
+
*/
|
|
133
|
+
setPickerValue() {
|
|
134
|
+
if (this.valueChangeDisabled) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (this.componentRef) {
|
|
138
|
+
this.componentRef.setInput(nameof('value'), this.input.value);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Handles clicking outside of picker
|
|
143
|
+
* @param event - Event that occured
|
|
144
|
+
*/
|
|
145
|
+
handleClickOutside(event) {
|
|
146
|
+
if (!this.componentElement) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (this.componentElement != event.target &&
|
|
150
|
+
!isDescendant(this.componentElement, event.target) &&
|
|
151
|
+
(!this.input.element || (this.input.element != event.target &&
|
|
152
|
+
!isDescendant(this.input.element, event.target)))) {
|
|
153
|
+
this.hidePicker();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
DateTimePickerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: DATE_TIME_INPUT }, { token: DOCUMENT }, { token: POSITION }, { token: DATE_TIME_PICKER_DIRECTIVE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
158
|
+
DateTimePickerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: DateTimePickerDirective, selector: "[dateTime][withPicker]", inputs: { withPickerOptions: "withPickerOptions" }, exportAs: ["dateTimePicker"], ngImport: i0 });
|
|
159
|
+
__decorate([
|
|
160
|
+
BindThis,
|
|
161
|
+
__metadata("design:type", Function),
|
|
162
|
+
__metadata("design:paramtypes", [MouseEvent]),
|
|
163
|
+
__metadata("design:returntype", void 0)
|
|
164
|
+
], DateTimePickerDirective.prototype, "handleClickOutside", null);
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerDirective, decorators: [{
|
|
166
|
+
type: Directive,
|
|
167
|
+
args: [{
|
|
168
|
+
selector: '[dateTime][withPicker]',
|
|
169
|
+
exportAs: 'dateTimePicker'
|
|
170
|
+
}]
|
|
171
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
172
|
+
type: Inject,
|
|
173
|
+
args: [DATE_TIME_INPUT]
|
|
174
|
+
}] }, { type: Document, decorators: [{
|
|
175
|
+
type: Inject,
|
|
176
|
+
args: [DOCUMENT]
|
|
177
|
+
}] }, { type: undefined, decorators: [{
|
|
178
|
+
type: Inject,
|
|
179
|
+
args: [POSITION]
|
|
180
|
+
}] }, { type: undefined, decorators: [{
|
|
181
|
+
type: Inject,
|
|
182
|
+
args: [DATE_TIME_PICKER_DIRECTIVE_OPTIONS]
|
|
183
|
+
}, {
|
|
184
|
+
type: Optional
|
|
185
|
+
}] }]; }, propDecorators: { withPickerOptions: [{
|
|
186
|
+
type: Input
|
|
187
|
+
}], handleClickOutside: [] } });
|
|
188
|
+
//# sourceMappingURL=dateTimePicker.directive.js.map
|
package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,SAAS,EAAE,UAAU,EAAmB,MAAM,EAAE,KAAK,EAAqB,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACjJ,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAW,QAAQ,EAAE,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AACzF,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;AAGjD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,kBAAkB,CAA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iBAAiB;sBAD3B,KAAK;gBAyJI,kBAAkB","sourcesContent":["import {ComponentRef, Directive, ElementRef, EmbeddedViewRef, Inject, Input, OnDestroy, OnInit, Optional, ViewContainerRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {Position, POSITION, applyPositionResult, PositionPlacement} from '@anglr/common';\nimport {extend, nameof, isDescendant, BindThis} from '@jscrpt/common';\nimport {lastValueFrom, Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimePickerComponent} from '../../components';\nimport {DateTimePickerDirectiveOptions} from './dateTimePicker.interface';\nimport {DATE_TIME_PICKER_DIRECTIVE_OPTIONS} from '../../misc/tokens';\n\n/**\n * Default options for date time picker directive\n */\nconst defaultOptions: DateTimePickerDirectiveOptions =\n{\n absolute: true,\n alwaysVisible: false,\n closeOnValueSelect: true,\n disabled: false,\n positionOptions: PositionPlacement.BottomStart,\n showOnFocus: true,\n};\n\n/**\n * Directive that is used for displaying and attaching date time picker\n */\n@Directive(\n{\n selector: '[dateTime][withPicker]',\n exportAs: 'dateTimePicker'\n})\nexport class DateTimePickerDirective<TDate = unknown> implements OnInit, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Indication whether is value changes disabled\n */\n protected valueChangeDisabled: boolean = false;\n\n /**\n * Options for date time picker directive\n */\n protected ɵWithPickerOptions: DateTimePickerDirectiveOptions;\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Date time picker component reference\n */\n protected componentRef: ComponentRef<DateTimePickerComponent<TDate>>|undefined|null;\n\n /**\n * Instance of date time picker component\n */\n protected component: DateTimePickerComponent<TDate>|undefined|null;\n\n /**\n * Instance of date time picker element\n */\n protected componentElement: HTMLElement|undefined|null;\n\n /**\n * Subscription for value changes in picker\n */\n protected valueChangeSubscription: Subscription|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets options for date time picker directive\n */\n @Input()\n public get withPickerOptions(): Partial<DateTimePickerDirectiveOptions>\n {\n return this.ɵWithPickerOptions;\n }\n public set withPickerOptions(value: Partial<DateTimePickerDirectiveOptions>)\n {\n this.ɵWithPickerOptions = extend(true, {}, this.ɵWithPickerOptions, value);\n }\n\n //######################### constructor #########################\n constructor(protected viewContainer: ViewContainerRef,\n protected element: ElementRef<HTMLElement>,\n @Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>,\n @Inject(DOCUMENT) protected document: Document,\n @Inject(POSITION) protected position: Position,\n @Inject(DATE_TIME_PICKER_DIRECTIVE_OPTIONS) @Optional() options?: DateTimePickerDirectiveOptions,)\n {\n this.ɵWithPickerOptions = extend(true, {}, defaultOptions, options);\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public async ngOnInit(): Promise<void>\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n this.showPicker();\n }\n\n this.initSubscriptions.add(this.input.valueChange.subscribe(() =>\n {\n this.setPickerValue();\n this.componentRef?.changeDetectorRef.detectChanges();\n }));\n\n this.initSubscriptions.add(this.input.focus.subscribe(() =>\n {\n if(this.withPickerOptions.showOnFocus)\n {\n this.showPicker();\n }\n }));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.hidePicker();\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods #########################\n\n /**\n * Hides date time picker\n */\n public async showPicker(): Promise<void>\n {\n if(this.withPickerOptions.disabled || this.componentRef)\n {\n return;\n }\n\n this.componentRef = this.viewContainer.createComponent(DateTimePickerComponent<TDate>);\n this.componentElement = (this.componentRef?.hostView as EmbeddedViewRef<DateTimePickerComponent<TDate>>).rootNodes[0] as HTMLElement;\n this.component = this.componentRef.instance;\n\n if(this.withPickerOptions.absolute)\n {\n this.document.body.append(this.componentElement);\n }\n\n this.valueChangeSubscription = this.component.valueChange.subscribe(() =>\n {\n if(this.component)\n {\n this.valueChangeDisabled = true;\n this.input.value = this.component.value;\n this.input.valueChange.emit();\n this.valueChangeDisabled = false;\n }\n });\n\n this.document.addEventListener('click', this.handleClickOutside);\n\n const result = await lastValueFrom(this.position.placeElement(this.componentElement, this.element.nativeElement,\n {\n placement: this.withPickerOptions.positionOptions,\n }));\n\n applyPositionResult(result);\n this.setPickerValue();\n // this.componentRef.setInput(nameof<DateTimePickerComponent>('valueFormat'), this.input.);\n // this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);\n // this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n /**\n * Shows date time picker\n */\n public hidePicker(): void\n {\n if(this.withPickerOptions.alwaysVisible)\n {\n return;\n }\n\n this.valueChangeSubscription?.unsubscribe();\n this.valueChangeSubscription = null;\n\n this.component = null;\n\n this.componentRef?.destroy();\n this.componentRef = null;\n\n this.componentElement?.remove();\n this.componentElement = null;\n\n this.document.removeEventListener('click', this.handleClickOutside);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets all picker value\n */\n protected setPickerValue(): void\n {\n if(this.valueChangeDisabled)\n {\n return;\n }\n\n if(this.componentRef)\n {\n this.componentRef.setInput(nameof<DateTimePickerComponent>('value'), this.input.value);\n }\n }\n\n /**\n * Handles clicking outside of picker\n * @param event - Event that occured\n */\n @BindThis\n protected handleClickOutside(event: MouseEvent): void\n {\n if(!this.componentElement)\n {\n return;\n }\n\n if(this.componentElement != event.target &&\n !isDescendant(this.componentElement, event.target as HTMLElement) &&\n (!this.input.element || (this.input.element != event.target &&\n !isDescendant(this.input.element, event.target as HTMLElement))))\n {\n this.hidePicker();\n }\n }\n}"]}
|
package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.interface.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {PositionPlacement} from '@anglr/common';\n\n/**\n * Defintion of date time picker directive options\n */\nexport interface DateTimePickerDirectiveOptions\n{\n /**\n * Indication whether close picker on value selection\n */\n closeOnValueSelect: boolean;\n\n /**\n * Indication whether display picker when date time input gets focus\n */\n showOnFocus: boolean;\n\n /**\n * Indication whether is picker always visible, mostly used for debugging\n */\n alwaysVisible: boolean;\n\n /**\n * Indication whether picker is disabled, if true, you cant display picker\n */\n disabled: boolean;\n\n /**\n * Indication whether use absolute global positioning of picker\n */\n absolute: boolean;\n\n /**\n * Position options that are used to position picker\n */\n positionOptions: Partial<PositionPlacement>;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC","sourcesContent":["export * from './dateTimePicker/dateTimePicker.directive';\nexport * from './dateTimePicker/dateTimePicker.interface';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/dateTimePicker/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC","sourcesContent":["export * from './components';\nexport * from './directives';\nexport * from './interfaces';\nexport * from './misc/tokens';\nexport * from './modules';\n"]}
|
package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.interface.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\nimport {DateTimeObjectValue} from '../../../../misc/types';\n\n/**\n * Describes date time picker API for each date time period\n */\nexport interface DateTimePicker<TDate = unknown, TOptions = unknown>\n{\n /**\n * Value of date time picker\n */\n value: DateTimeObjectValue<TDate>|undefined|null;\n\n /**\n * Options for date time picker period\n */\n options: TOptions|undefined|null;\n\n /**\n * Date that describes which date should be displayed\n */\n display: TDate|undefined|null;\n\n /**\n * Max allowed date\n */\n maxDate: TDate|undefined|null;\n\n /**\n * Min allowed date to be selected\n */\n minDate: TDate|undefined|null;\n\n /**\n * Indication whether picker can display scale date time period up\n */\n canScaleUp: boolean;\n\n /**\n * Indication whether picker can display scale date time period down\n */\n canScaleDown: boolean;\n\n /**\n * Occurs when date time picker value changes\n */\n readonly valueChange: Observable<void>; \n\n /**\n * Occurs when period should be scaled up\n */\n readonly scaleUp: Observable<TDate>;\n\n /**\n * Occurs when period should be scaled down\n */\n readonly scaleDown: Observable<TDate>;\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC","sourcesContent":["export * from './dateTimePicker/dateTimePicker.interface';\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Injection token for global options for date time picker directive
|
|
4
|
+
*/
|
|
5
|
+
export const DATE_TIME_PICKER_DIRECTIVE_OPTIONS = new InjectionToken('DATE_TIME_PICKER_DIRECTIVE_OPTIONS');
|
|
6
|
+
/**
|
|
7
|
+
* Injection token for global options for date time picker component
|
|
8
|
+
*/
|
|
9
|
+
export const DATE_TIME_PICKER_OPTIONS = new InjectionToken('DATE_TIME_PICKER_OPTIONS');
|
|
10
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAK7C;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAA4D,IAAI,cAAc,CAA0C,oCAAoC,CAAC,CAAC;AAE7M;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAmD,IAAI,cAAc,CAAiC,0BAA0B,CAAC,CAAC","sourcesContent":["import {InjectionToken} from '@angular/core';\n\nimport {DateTimePickerOptions} from '../components/dateTimePicker/dateTimePicker.interface';\nimport {DateTimePickerDirectiveOptions} from '../directives/dateTimePicker/dateTimePicker.interface';\n\n/**\n * Injection token for global options for date time picker directive\n */\nexport const DATE_TIME_PICKER_DIRECTIVE_OPTIONS: InjectionToken<Partial<DateTimePickerDirectiveOptions>> = new InjectionToken<Partial<DateTimePickerDirectiveOptions>>('DATE_TIME_PICKER_DIRECTIVE_OPTIONS');\n\n/**\n * Injection token for global options for date time picker component\n */\nexport const DATE_TIME_PICKER_OPTIONS: InjectionToken<Partial<DateTimePickerOptions>> = new InjectionToken<Partial<DateTimePickerOptions>>('DATE_TIME_PICKER_OPTIONS');"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { DateTimePickerComponent } from '../components';
|
|
3
|
+
import { DateTimePickerDirective } from '../directives';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Module for components that are used as date time picker
|
|
7
|
+
*/
|
|
8
|
+
export class DateTimePickerModule {
|
|
9
|
+
}
|
|
10
|
+
DateTimePickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11
|
+
DateTimePickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, declarations: [DateTimePickerComponent,
|
|
12
|
+
DateTimePickerDirective], exports: [DateTimePickerComponent,
|
|
13
|
+
DateTimePickerDirective] });
|
|
14
|
+
DateTimePickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule });
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerModule, decorators: [{
|
|
16
|
+
type: NgModule,
|
|
17
|
+
args: [{
|
|
18
|
+
declarations: [
|
|
19
|
+
DateTimePickerComponent,
|
|
20
|
+
DateTimePickerDirective,
|
|
21
|
+
],
|
|
22
|
+
exports: [
|
|
23
|
+
DateTimePickerComponent,
|
|
24
|
+
DateTimePickerDirective,
|
|
25
|
+
],
|
|
26
|
+
}]
|
|
27
|
+
}] });
|
|
28
|
+
//# sourceMappingURL=dateTimePicker.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimePicker.module.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/modules/dateTimePicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;;AAEtD;;GAEG;AAcH,MAAM,OAAO,oBAAoB;;iHAApB,oBAAoB;kHAApB,oBAAoB,iBATzB,uBAAuB;QACvB,uBAAuB,aAIvB,uBAAuB;QACvB,uBAAuB;kHAGlB,oBAAoB;2FAApB,oBAAoB;kBAbhC,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,uBAAuB;wBACvB,uBAAuB;qBAC1B;oBACD,OAAO,EACP;wBACI,uBAAuB;wBACvB,uBAAuB;qBAC1B;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {DateTimePickerComponent} from '../components';\nimport {DateTimePickerDirective} from '../directives';\n\n/**\n * Module for components that are used as date time picker\n */\n@NgModule(\n{\n declarations:\n [\n DateTimePickerComponent,\n DateTimePickerDirective,\n ],\n exports:\n [\n DateTimePickerComponent,\n DateTimePickerDirective,\n ],\n})\nexport class DateTimePickerModule\n{\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './dateTimePicker.module';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC","sourcesContent":["export * from './datePipes.module';\nexport * from './dateTime';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './datePipes.module';\nexport * from './dateTime';\nexport * from './dateTimePicker';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Inject, Pipe } from '@angular/core';
|
|
2
|
-
import { nameof } from '@jscrpt/common';
|
|
2
|
+
import { isString, nameof } from '@jscrpt/common';
|
|
3
3
|
import { DATE_API, FORMAT_PROVIDER } from '../misc/tokens';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
@@ -11,14 +11,8 @@ export class DateFormatPipe {
|
|
|
11
11
|
this._formatProvider = _formatProvider;
|
|
12
12
|
this._dateApi = _dateApi;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* Formats provided date into formatted string
|
|
17
|
-
* @param value - value to be transformed
|
|
18
|
-
* @param format - Format that is used for formatting, can be also 'FormatProvider' key
|
|
19
|
-
* @param parseFormat - format used for parsing string date
|
|
20
|
-
*/
|
|
21
|
-
transform(value, format = nameof('date'), parseFormat) {
|
|
14
|
+
transform(value, format = nameof('date'), parseFormatOrCustomFormat, _customFormat) {
|
|
15
|
+
const parseFormat = isString(parseFormatOrCustomFormat) ? parseFormatOrCustomFormat : undefined;
|
|
22
16
|
//format provider value
|
|
23
17
|
if (format in this._formatProvider) {
|
|
24
18
|
format = this._formatProvider[format];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFormat.pipe.js","sourceRoot":"","sources":["../../../src/pipes/dateFormat.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"dateFormat.pipe.js","sourceRoot":"","sources":["../../../src/pipes/dateFormat.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;;AAGzD;;GAEG;AAEH,MAAM,OAAO,cAAc;IAEvB,kEAAkE;IAClE,YAA6C,eAA+B,EACtC,QAAwB;QADjB,oBAAe,GAAf,eAAe,CAAgB;QACtC,aAAQ,GAAR,QAAQ,CAAgB;IAE9D,CAAC;IAqCM,SAAS,CAAC,KAAsB,EAAE,SAAsC,MAAM,CAAiB,MAAM,CAAC,EAAE,yBAA0C,EAAE,aAAuB;QAE9K,MAAM,WAAW,GAAqB,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,SAAS,CAAC;QAElH,uBAAuB;QACvB,IAAG,MAAM,IAAI,IAAI,CAAC,eAAe,EACjC;YACI,MAAM,GAAS,IAAI,CAAC,eAAgB,CAAC,MAAM,CAAC,CAAC;SAChD;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAE3D,IAAG,OAAO,CAAC,OAAO,EAAE,EACpB;YACI,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;SAC1D;QAED,OAAO,EAAE,CAAC;IACd,CAAC;;2GA7DQ,cAAc,kBAGH,eAAe,aACf,QAAQ;yGAJnB,cAAc;2FAAd,cAAc;kBAD1B,IAAI;mBAAC,EAAC,IAAI,EAAE,YAAY,EAAC;;0BAIT,MAAM;2BAAC,eAAe;;0BACtB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Pipe, PipeTransform} from '@angular/core';\nimport {isString, nameof} from '@jscrpt/common';\n\nimport {FormatProvider} from '../interfaces';\nimport {DATE_API, FORMAT_PROVIDER} from '../misc/tokens';\nimport {DateApi, DateValue} from '../services';\n\n/**\n * Pipe that is used for formatting date\n */\n@Pipe({name: 'dateFormat'})\nexport class DateFormatPipe<TDate = any> implements PipeTransform\n{\n //######################### constructors #########################\n constructor(@Inject(FORMAT_PROVIDER) private _formatProvider: FormatProvider,\n @Inject(DATE_API) private _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods - implementation of PipeTransform #########################\n\n /**\n * Formats provided date into formatted string, with default format 'date'\n * @param value - value to be transformed\n */\n public transform(value: TDate|DateValue): string\n /**\n * Formats provided date into formatted string\n * @param value - value to be transformed\n * @param format - predefined format that is used for formatting, one of 'FormatProvider' keys\n */\n public transform(value: TDate|DateValue, format: keyof FormatProvider): string\n /**\n * Formats provided date into formatted string\n * @param value - value to be transformed\n * @param format - predefined format that is used for formatting, one of 'FormatProvider' keys\n * @param parseFormat - format used for parsing string date\n */\n public transform(value: TDate|DateValue, format: keyof FormatProvider, parseFormat: string): string\n /**\n * Formats provided date into formatted string\n * @param value - value to be transformed\n * @param format - format that is used for formatting\n * @param customFormat - indication that custom format is used\n */\n public transform(value: TDate|DateValue, format: string, customFormat: true): string\n /**\n * Formats provided date into formatted string\n * @param value - value to be transformed\n * @param format - format that is used for formatting\n * @param parseFormat - format used for parsing string date\n * @param customFormat - indication that custom format is used\n */\n public transform(value: TDate|DateValue, format: string, parseFormat: string, customFormat: true): string\n public transform(value: TDate|DateValue, format: string|keyof FormatProvider = nameof<FormatProvider>('date'), parseFormatOrCustomFormat?: string|boolean, _customFormat?: boolean): string\n {\n const parseFormat: string|undefined = isString(parseFormatOrCustomFormat) ? parseFormatOrCustomFormat : undefined;\n \n //format provider value\n if(format in this._formatProvider)\n {\n format = (<any>this._formatProvider)[format];\n }\n\n const dateObj = this._dateApi.getValue(value, parseFormat);\n\n if(dateObj.isValid())\n {\n return dateObj.format(this._dateApi.getFormat(format));\n }\n\n return '';\n }\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anglr/datetime",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.20221019112435",
|
|
4
4
|
"description": "Angular library for datetime manipulation components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -119,6 +119,12 @@
|
|
|
119
119
|
"./package.json": {
|
|
120
120
|
"default": "./package.json"
|
|
121
121
|
},
|
|
122
|
+
"./styles": {
|
|
123
|
+
"sass": "./styles/index.scss"
|
|
124
|
+
},
|
|
125
|
+
"./styles/themes/*": {
|
|
126
|
+
"sass": "./styles/themes/*.scss"
|
|
127
|
+
},
|
|
122
128
|
"./src/theme.scss": {
|
|
123
129
|
"sass": "./src/theme.scss"
|
|
124
130
|
},
|
|
@@ -11,7 +11,7 @@ export interface DateTimeInputValue<TDate = unknown> {
|
|
|
11
11
|
/**
|
|
12
12
|
* Occurs when value changes
|
|
13
13
|
*/
|
|
14
|
-
valueChange: EventEmitter<void>;
|
|
14
|
+
readonly valueChange: EventEmitter<void>;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Defines date time input and communication API for it
|
|
@@ -20,7 +20,7 @@ export interface DateTimeInput<TDate = unknown> extends DateTimeInputValue<TDate
|
|
|
20
20
|
/**
|
|
21
21
|
* Value of date time, raw string value which is visible to user
|
|
22
22
|
*/
|
|
23
|
-
rawValue: string | undefined | null;
|
|
23
|
+
readonly rawValue: string | undefined | null;
|
|
24
24
|
/**
|
|
25
25
|
* Indication whether is date time disabled
|
|
26
26
|
*/
|
|
@@ -28,10 +28,14 @@ export interface DateTimeInput<TDate = unknown> extends DateTimeInputValue<TDate
|
|
|
28
28
|
/**
|
|
29
29
|
* Occurs when input gains focus
|
|
30
30
|
*/
|
|
31
|
-
focus: EventEmitter<FocusEvent>;
|
|
31
|
+
readonly focus: EventEmitter<FocusEvent>;
|
|
32
32
|
/**
|
|
33
33
|
* Occurs when input loses focus
|
|
34
34
|
*/
|
|
35
|
-
blur: EventEmitter<FocusEvent>;
|
|
35
|
+
readonly blur: EventEmitter<FocusEvent>;
|
|
36
|
+
/**
|
|
37
|
+
* Html element that represents input itself
|
|
38
|
+
*/
|
|
39
|
+
readonly element: HTMLElement;
|
|
36
40
|
}
|
|
37
41
|
//# sourceMappingURL=dateTimeInput.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeInput.interface.d.ts","sourceRoot":"","sources":["dateTimeInput.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,KAAK,GAAG,OAAO;IAE/C;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAAC;IAEtD;;OAEG;IACH,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"dateTimeInput.interface.d.ts","sourceRoot":"","sources":["dateTimeInput.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,KAAK,GAAG,OAAO;IAE/C;;OAEG;IACH,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAAC;IAEtD;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC5C;AACD;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,OAAO,CAAE,SAAQ,kBAAkB,CAAC,KAAK,CAAC;IAE7E;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC;IAEzC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CACjC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { DateTimeValue } from '../../../../interfaces/dateTime/datetime.interface';
|
|
3
3
|
import { DateApi, DateApiObject } from '../../../../services/dateApi/dateApi.interface';
|
|
4
|
-
import {
|
|
4
|
+
import { DateTimeLegacyPicker, DayData, PeriodData } from '../../misc/datetimePicker.interface';
|
|
5
5
|
import { PickerBaseComponent } from '../pickerBase.component';
|
|
6
6
|
import { DayPickerCssClasses } from './dayPicker.interfaces';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
/**
|
|
9
9
|
* Component used for displaying day picker
|
|
10
10
|
*/
|
|
11
|
-
export declare class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements
|
|
11
|
+
export declare class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimeLegacyPicker<TDate, DayPickerCssClasses> {
|
|
12
12
|
/**
|
|
13
13
|
* Stored this picker month data
|
|
14
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dayPicker.component.d.ts","sourceRoot":"","sources":["dayPicker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAC,aAAa,EAAC,MAAM,oDAAoD,CAAC;AAEjF,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"dayPicker.component.d.ts","sourceRoot":"","sources":["dayPicker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAC,aAAa,EAAC,MAAM,oDAAoD,CAAC;AAEjF,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAC,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;;AAiB3D;;GAEG;AACH,qBAOa,0BAA0B,CAAC,KAAK,GAAG,GAAG,CAAE,SAAQ,mBAAmB,CAAC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|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { DateApi, DateApiObject } from '../../../../services/dateApi/dateApi.interface';
|
|
3
|
-
import {
|
|
3
|
+
import { DateTimeLegacyPicker, MonthData, PeriodData } from '../../misc/datetimePicker.interface';
|
|
4
4
|
import { PickerBaseComponent } from '../pickerBase.component';
|
|
5
5
|
import { MonthPickerCssClasses } from './monthPicker.interfaces';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Component used for displaying month picker
|
|
9
9
|
*/
|
|
10
|
-
export declare class DateTimeMonthPickerComponent<TDate = any> extends PickerBaseComponent<TDate, MonthData<TDate>, MonthPickerCssClasses> implements
|
|
10
|
+
export declare class DateTimeMonthPickerComponent<TDate = any> extends PickerBaseComponent<TDate, MonthData<TDate>, MonthPickerCssClasses> implements DateTimeLegacyPicker<TDate, MonthPickerCssClasses> {
|
|
11
11
|
constructor(dateApi: DateApi<TDate>, changeDetector: ChangeDetectorRef);
|
|
12
12
|
/**
|
|
13
13
|
* Changes displayed year to next year
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthPicker.component.d.ts","sourceRoot":"","sources":["monthPicker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAI5F,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"monthPicker.component.d.ts","sourceRoot":"","sources":["monthPicker.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAI5F,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAE,SAAS,EAAE,UAAU,EAAC,MAAM,qCAAqC,CAAC;AAChG,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;;AAgB/D;;GAEG;AACH,qBAOa,4BAA4B,CAAC,KAAK,GAAG,GAAG,CAAE,SAAQ,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,qBAAqB,CAAE,YAAW,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,CAAC;gBAG9J,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EACzC,cAAc,EAAE,iBAAiB;IAS7C;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,KAAK;IAQ5B;;;;OAIG;IACI,YAAY,CAAC,KAAK,EAAE,KAAK;IAUhC;;;OAGG;IACI,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI;IAgCjD;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK;IAKxD;;;OAGG;IACH,SAAS,CAAC,wBAAwB,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,OAAO;IAKtE;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO;IAK1E;;;OAGG;IACH,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC;yCA7G7D,4BAA4B;2CAA5B,4BAA4B;CAiHxC"}
|
|
@@ -2,18 +2,18 @@ import { Type, OnInit, EventEmitter, ChangeDetectorRef, OnDestroy } from '@angul
|
|
|
2
2
|
import { Subscription } from 'rxjs';
|
|
3
3
|
import { DateTimeValue } from '../../../../interfaces/dateTime/datetime.interface';
|
|
4
4
|
import { DateApi } from '../../../../services';
|
|
5
|
-
import {
|
|
5
|
+
import { DateTimeLegacyPicker, DateTimePickerLegacyOptions } from '../../misc/datetimePicker.interface';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* Component used for displaying date time picker
|
|
9
9
|
*/
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class DateTimePickerLegacyComponent<TDate = any> implements OnInit, OnDestroy {
|
|
11
11
|
protected _dateApi: DateApi<TDate>;
|
|
12
12
|
protected _changeDetector: ChangeDetectorRef;
|
|
13
13
|
/**
|
|
14
14
|
* Instance of active date time picker
|
|
15
15
|
*/
|
|
16
|
-
protected _activePicker?:
|
|
16
|
+
protected _activePicker?: DateTimeLegacyPicker<TDate>;
|
|
17
17
|
/**
|
|
18
18
|
* Name, id of displayed picker
|
|
19
19
|
*/
|
|
@@ -45,12 +45,12 @@ export declare class DateTimePickerComponent<TDate = any> implements OnInit, OnD
|
|
|
45
45
|
/**
|
|
46
46
|
* Current options used by picker
|
|
47
47
|
*/
|
|
48
|
-
protected _options:
|
|
48
|
+
protected _options: DateTimePickerLegacyOptions<DateTimeLegacyPicker<TDate>>;
|
|
49
49
|
/**
|
|
50
50
|
* Currently active date time picker component type
|
|
51
51
|
* @internal
|
|
52
52
|
*/
|
|
53
|
-
activePickerComponent?: Type<
|
|
53
|
+
activePickerComponent?: Type<DateTimeLegacyPicker<TDate>>;
|
|
54
54
|
/**
|
|
55
55
|
* Active picker index
|
|
56
56
|
* @internal
|
|
@@ -59,8 +59,8 @@ export declare class DateTimePickerComponent<TDate = any> implements OnInit, OnD
|
|
|
59
59
|
/**
|
|
60
60
|
* Current options used by picker
|
|
61
61
|
*/
|
|
62
|
-
get options(): Partial<
|
|
63
|
-
set options(value: Partial<
|
|
62
|
+
get options(): Partial<DateTimePickerLegacyOptions<DateTimeLegacyPicker<TDate>>>;
|
|
63
|
+
set options(value: Partial<DateTimePickerLegacyOptions<DateTimeLegacyPicker<TDate>>>);
|
|
64
64
|
/**
|
|
65
65
|
* Current selected value
|
|
66
66
|
*/
|
|
@@ -80,7 +80,7 @@ export declare class DateTimePickerComponent<TDate = any> implements OnInit, OnD
|
|
|
80
80
|
* Occurs when value changes
|
|
81
81
|
*/
|
|
82
82
|
valueChange: EventEmitter<DateTimeValue<TDate>>;
|
|
83
|
-
constructor(configuration: Partial<
|
|
83
|
+
constructor(configuration: Partial<DateTimePickerLegacyOptions<DateTimeLegacyPicker<TDate>>>, _dateApi: DateApi<TDate>, _changeDetector: ChangeDetectorRef);
|
|
84
84
|
/**
|
|
85
85
|
* Initialize component
|
|
86
86
|
*/
|
|
@@ -94,12 +94,12 @@ export declare class DateTimePickerComponent<TDate = any> implements OnInit, OnD
|
|
|
94
94
|
* @param picker - Instance of picker or null
|
|
95
95
|
* @internal
|
|
96
96
|
*/
|
|
97
|
-
pickerCreated(picker:
|
|
97
|
+
pickerCreated(picker: DateTimeLegacyPicker<TDate>): void;
|
|
98
98
|
/**
|
|
99
99
|
* Sets picker css classes
|
|
100
100
|
*/
|
|
101
101
|
protected _setPickerCssClasses(): void;
|
|
102
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
103
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerLegacyComponent<any>, [{ optional: true; }, null, null]>;
|
|
103
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerLegacyComponent<any>, "date-time-picker", never, { "options": "options"; "value": "value"; "minValue": "minValue"; "maxValue": "maxValue"; }, { "valueChange": "valueChange"; }, never, never, false>;
|
|
104
104
|
}
|
|
105
105
|
//# sourceMappingURL=picker.component.d.ts.map
|