@anglr/datetime 3.0.0-beta.20220328062817 → 3.0.0-beta.20220504102413
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 +7 -2
- package/date-fns/src/services/dateFnsDateApi.service.d.ts +4 -0
- package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js +7 -1
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
- package/es2015/moment/src/services/momentDateApi.service.js +6 -0
- package/es2015/moment/src/services/momentDateApi.service.js.map +1 -1
- package/es2015/src/picker/components/dayPicker/dayPicker.component.js +8 -2
- package/es2015/src/picker/components/dayPicker/dayPicker.component.js.map +1 -1
- package/es2015/src/picker/components/pickerImplBase.component.js.map +1 -1
- package/es2015/src/picker/components/rollerTimePicker/rollerTimePicker.component.js +7 -3
- package/es2015/src/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
- package/es2015/src/picker/directives/loopScroll/loopScroll.directive.js +103 -90
- package/es2015/src/picker/directives/loopScroll/loopScroll.directive.js.map +1 -1
- package/es2015/src/picker/directives/loopScrollData/loopScrollData.directive.js +7 -1
- package/es2015/src/picker/directives/loopScrollData/loopScrollData.directive.js.map +1 -1
- package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +4 -0
- package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -1
- package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +4 -0
- package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -1
- package/es2015/src/services/dateApi.interface.js.map +1 -1
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js +7 -1
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
- package/es2020/moment/src/services/momentDateApi.service.js +6 -0
- package/es2020/moment/src/services/momentDateApi.service.js.map +1 -1
- package/es2020/src/picker/components/dayPicker/dayPicker.component.js +8 -2
- package/es2020/src/picker/components/dayPicker/dayPicker.component.js.map +1 -1
- package/es2020/src/picker/components/pickerImplBase.component.js.map +1 -1
- package/es2020/src/picker/components/rollerTimePicker/rollerTimePicker.component.js +7 -3
- package/es2020/src/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
- package/es2020/src/picker/directives/loopScroll/loopScroll.directive.js +97 -81
- package/es2020/src/picker/directives/loopScroll/loopScroll.directive.js.map +1 -1
- package/es2020/src/picker/directives/loopScrollData/loopScrollData.directive.js +7 -1
- package/es2020/src/picker/directives/loopScrollData/loopScrollData.directive.js.map +1 -1
- package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js +4 -0
- package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -1
- package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +4 -0
- package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -1
- package/es2020/src/services/dateApi.interface.js.map +1 -1
- package/moment/src/services/momentDateApi.service.d.ts +4 -0
- package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/picker/components/dayPicker/dayPicker.component.d.ts +5 -0
- package/src/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
- package/src/picker/components/dayPicker/dayPicker.component.html +1 -1
- package/src/picker/components/pickerImplBase.component.d.ts +1 -1
- package/src/picker/components/rollerTimePicker/rollerTimePicker.component.css +26 -2
- package/src/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts +1 -1
- package/src/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts.map +1 -1
- package/src/picker/components/rollerTimePicker/rollerTimePicker.component.html +27 -1
- package/src/picker/directives/loopScroll/loopScroll.directive.d.ts +35 -17
- package/src/picker/directives/loopScroll/loopScroll.directive.d.ts.map +1 -1
- package/src/picker/directives/loopScrollData/loopScrollData.directive.d.ts +5 -1
- package/src/picker/directives/loopScrollData/loopScrollData.directive.d.ts.map +1 -1
- package/src/selector/components/inputDateTime/inputDateTime.component.d.ts.map +1 -1
- package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts.map +1 -1
- package/src/services/dateApi.interface.d.ts +5 -0
- package/src/services/dateApi.interface.d.ts.map +1 -1
- package/version.bak +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAoC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,mBAAmB;IAgCrB,iEAAiE;IACjE,YAAY,KAA8B,EAAE,MAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAtBD,yGAAyG;IAEzG;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAQD,sGAAsG;IAEtG;;OAEG;IACI,OAAO;QAEV,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,SAAS;QAEZ,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAEzC,OAAO,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAc;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,O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AC9C;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,aAAa;QAEhB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC;QAElC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED;;GAEG;AAEH,MAAM,OAAO,aAAa;IAEtB,iEAAiE;IACjE,YAAsB,eAAsD;QAAtD,oBAAe,GAAf,eAAe,CAAuC;IAE5E,CAAC;IAED,oEAAoE;IAEpE;;;;OAIG;IACI,QAAQ,CAAC,KAA8B,EAAE,MAAe;QAE3D,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACI,GAAG;QAEN,OAAO,IAAI,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,YAAoB;QAEjC,IAAG,yBAAyB,CAAC,IAAI,CAAC,YAAY,CAAC,EAC/C;YACI,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,cAAc,CAAC,GAAwB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrH;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,kBAAkB;QAErB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,aAAa;QAEhB,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;;0GAvDQ,aAAa;8GAAb,aAAa;2FAAb,aAAa;kBADzB,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nclass MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### private fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n private _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n private _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = (this._value.year() % 10);\n\n this._value = moment(this._value).subtract(diff, 'years').startOf('year');\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = 9 - (this._value.year() % 10);\n\n this._value = moment(this._value).add(diff, 'years').endOf('year');\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('year');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('year');\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('month');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('month');\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('week');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('week');\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('day');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('day');\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('hour');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('hour');\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('minute');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('minute');\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return this._value.daysInMonth();\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(year))\n {\n this._value = moment(this._value).year(year);\n\n return this;\n }\n\n return this._value.year();\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<moment.Moment>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(month))\n {\n this._value = moment(this._value).month(month);\n\n return this;\n }\n\n return this._value.month();\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).date(day);\n\n return this;\n }\n\n return this._value.date();\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<moment.Moment>\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).weekday(day);\n\n return this;\n }\n\n return this._value.weekday();\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(hour))\n {\n this._value = moment(this._value).hours(hour);\n\n return this;\n }\n\n return this._value.hours();\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(minute))\n {\n this._value = moment(this._value).minutes(minute);\n\n return this;\n }\n\n return this._value.minutes();\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: moment.Moment): boolean\n {\n return this._value.isBefore(date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: moment.Moment): boolean\n {\n return this._value.isAfter(date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: moment.Moment): number\n {\n return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'week');\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: moment.Moment): boolean\n {\n const year = this._value.year();\n const start = year - (year % 10);\n const end = start + 10;\n\n return date.year() >= start && date.year() < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'year');\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'month');\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'day');\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._value));\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._originalValue));\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: moment.Moment): DateApiObject<moment.Moment>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<moment.Moment>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAoC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,mBAAmB;IAgCrB,iEAAiE;IACjE,YAAY,KAA8B,EAAE,MAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,E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/C;YACI,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,cAAc,CAAC,GAAwB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrH;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,kBAAkB;QAErB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,aAAa;QAEhB,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,KAAK,YAAY,MAAM,CAAC;IACnC,CAAC;;0GA/DQ,aAAa;8GAAb,aAAa;2FAAb,aAAa;kBADzB,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nclass MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### private fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n private _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n private _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = (this._value.year() % 10);\n\n this._value = moment(this._value).subtract(diff, 'years').startOf('year');\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = 9 - (this._value.year() % 10);\n\n this._value = moment(this._value).add(diff, 'years').endOf('year');\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('year');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('year');\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('month');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('month');\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('week');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('week');\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('day');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('day');\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('hour');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('hour');\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('minute');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('minute');\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return this._value.daysInMonth();\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(year))\n {\n this._value = moment(this._value).year(year);\n\n return this;\n }\n\n return this._value.year();\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<moment.Moment>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(month))\n {\n this._value = moment(this._value).month(month);\n\n return this;\n }\n\n return this._value.month();\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).date(day);\n\n return this;\n }\n\n return this._value.date();\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<moment.Moment>\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).weekday(day);\n\n return this;\n }\n\n return this._value.weekday();\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(hour))\n {\n this._value = moment(this._value).hours(hour);\n\n return this;\n }\n\n return this._value.hours();\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(minute))\n {\n this._value = moment(this._value).minutes(minute);\n\n return this;\n }\n\n return this._value.minutes();\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: moment.Moment): boolean\n {\n return this._value.isBefore(date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: moment.Moment): boolean\n {\n return this._value.isAfter(date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: moment.Moment): number\n {\n return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'week');\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: moment.Moment): boolean\n {\n const year = this._value.year();\n const start = year - (year % 10);\n const end = start + 10;\n\n return date.year() >= start && date.year() < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'year');\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'month');\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'day');\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._value));\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._originalValue));\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: moment.Moment): DateApiObject<moment.Moment>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<moment.Moment>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}"]}
|
|
@@ -40,6 +40,12 @@ export class DateTimeDayPickerComponent extends PickerBaseComponent {
|
|
|
40
40
|
this.cssClasses = extend(true, {}, defaultStyles);
|
|
41
41
|
this.weekdays = this._dateApi.weekdaysShort();
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Value used for displaying time
|
|
45
|
+
*/
|
|
46
|
+
get timeValue() {
|
|
47
|
+
return this._value;
|
|
48
|
+
}
|
|
43
49
|
//######################### public methods - template bindings #########################
|
|
44
50
|
/**
|
|
45
51
|
* Changes displayed period to "lower" period
|
|
@@ -197,10 +203,10 @@ export class DateTimeDayPickerComponent extends PickerBaseComponent {
|
|
|
197
203
|
}
|
|
198
204
|
}
|
|
199
205
|
DateTimeDayPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, deps: [{ token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
200
|
-
DateTimeDayPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeDayPickerComponent, selector: "date-time-day-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\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 (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{
|
|
206
|
+
DateTimeDayPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeDayPickerComponent, selector: "date-time-day-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\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 (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "asRequired": i2.AsRequiredTypePipe, "mergeCssClasses": i2.MergeCssClassesPipe, "dateFormat": i3.DateFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
201
207
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, decorators: [{
|
|
202
208
|
type: Component,
|
|
203
|
-
args: [{ selector: 'date-time-day-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\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 (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{
|
|
209
|
+
args: [{ selector: 'date-time-day-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\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 (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"] }]
|
|
204
210
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
205
211
|
type: Inject,
|
|
206
212
|
args: [DATE_API]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.component.ts","../../../../../src/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,WAAW;CACzB,CAAC;AAEF;;GAEG;AAQH,MAAM,OAAO,0BA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AC,aAAa,CAAC,CAAC;SACjC;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;QAErB,qBAAqB;QACrB,IAAG,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAClH;YACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC9B;IACL,CAAC;IAED,uEAAuE;IAEvE;;;OAGG;IACO,YAAY,CAAC,MAAyB;QAE5C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;IAChE,CAAC;IAED;;;OAGG;IACO,wBAAwB,CAAC,GAAyB;QAExD,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,WAAY,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACO,aAAa,CAAC,GAAyB,EAAE,MAAa;QAE5D,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,GAAyB;QAE9C,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;;uHA1OQ,0BAA0B,kBAkBf,QAAQ;2GAlBnB,0BAA0B,mFClCvC,qxCAoBM;2FDcO,0BAA0B;kBAPtC,SAAS;+BAEI,sBAAsB,mBAGf,uBAAuB,CAAC,MAAM;;0BAoBlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday',\n clickable: 'clickable'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"lower\" period\n * @param event - Event that occured\n * @internal\n */\n public goDown(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoDown)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleDown.next(this.displayDate.value);\n }\n }\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event): void\n {\n event.preventDefault();\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 * @internal\n */\n public previousMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>): void\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n this._setPeriod(day);\n\n //when time picker is enabled\n if(this.canGoDown)\n {\n const from = this._dateApi\n .getValue(day.date)\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n const to = this._dateApi\n .getValue(this._endOfPeriod(day))\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n this._value =\n {\n from: from.value,\n to: to.value\n };\n }\n //no time picker\n else\n {\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n }\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n //can go down set minutes and hours\n if(this.canGoDown)\n {\n this.displayDate\n .minute(this._originalMinute)\n .hour(this._originalHour);\n }\n\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\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 (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{displayDate?.value | dateFormat: 'time'}}</div>\r\n</div>"]}
|
|
1
|
+
{"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.component.ts","../../../../../src/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAGtC,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,WAAW;CACzB,CAAC;AAEF;;GAEG;AAQH,MAAM,OAAO,0BAAwC,SAAQ,mBAA+D;IAyBxH,iEAAiE;IACjE,YAA8B,OAAuB,EACzC,cAAiC;QAEzC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QA3BnC,sEAAsE;QAEtE;;WAEG;QACO,mBAAc,GAAqB,EAAE,CAAC;QAEhD,2FAA2F;QAE3F;;;WAGG;QACI,aAAQ,GAAa,EAAE,CAAC;QAgB3B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,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W,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAClH;YACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC9B;IACL,CAAC;IAED,uEAAuE;IAEvE;;;OAGG;IACO,YAAY,CAAC,MAAyB;QAE5C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;IAChE,CAAC;IAED;;;OAGG;IACO,wBAAwB,CAAC,GAAyB;QAExD,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,WAAY,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACO,aAAa,CAAC,GAAyB,EAAE,MAAa;QAE5D,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,GAAyB;QAE9C,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;;uHAlPQ,0BAA0B,kBA0Bf,QAAQ;2GA1BnB,0BAA0B,mFCnCvC,kxCAoBM;2FDeO,0BAA0B;kBAPtC,SAAS;+BAEI,sBAAsB,mBAGf,uBAAuB,CAAC,MAAM;;0BA4BlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DateTimeValue} from '../../../misc/datetime.interface';\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday',\n clickable: 'clickable'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n /**\n * Value used for displaying time\n */\n public get timeValue(): DateTimeValue<TDate> | null\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"lower\" period\n * @param event - Event that occured\n * @internal\n */\n public goDown(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoDown)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleDown.next(this.displayDate.value);\n }\n }\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event): void\n {\n event.preventDefault();\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 * @internal\n */\n public previousMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>): void\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n this._setPeriod(day);\n\n //when time picker is enabled\n if(this.canGoDown)\n {\n const from = this._dateApi\n .getValue(day.date)\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n const to = this._dateApi\n .getValue(this._endOfPeriod(day))\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n this._value =\n {\n from: from.value,\n to: to.value\n };\n }\n //no time picker\n else\n {\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n }\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n //can go down set minutes and hours\n if(this.canGoDown)\n {\n this.displayDate\n .minute(this._originalMinute)\n .hour(this._originalHour);\n }\n\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\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 (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickerImplBase.component.js","sourceRoot":"","sources":["../../../../src/picker/components/pickerImplBase.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;;AAI3C;;GAEG;AAEH,MAAM,OAAgB,uBAAuB;IA8FzC,iEAAiE;IACjE,YAAwC,QAAwB,EAC1C,eAAkC;QADhB,aAAQ,GAAR,QAAQ,CAAgB;QAC1C,oBAAe,GAAf,eAAe,CAAmB;QA9FxD,sEAAsE;QAEtE;;WAEG;QACO,WAAM,GAA8B,IAAI,CAAC;QAEnD;;WAEG;QACO,iBAAY,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAE5D;;WAEG;QACO,aAAQ,GAAmB,IAAI,OAAO,EAAS,CAAC;QAE1D;;WAEG;QACO,eAAU,GAAmB,IAAI,OAAO,EAAS,CAAC;QAE5D;;WAEG;QACO,cAAS,GAAe,IAAI,CAAC;QAEvC;;WAEG;QACO,cAAS,GAAe,IAAI,CAAC;QAoCvC,2FAA2F;QAE3F;;;WAGG;QACI,gBAAW,GAA8B,IAAI,CAAC;QAErD;;;WAGG;QACI,YAAO,GAAY,KAAK,CAAC;QAEhC;;;WAGG;QACI,cAAS,GAAY,KAAK,CAAC;IAYlC,CAAC;IAhED,0GAA0G;IAE1G;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,M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AS;;0BAgGO,MAAM;2BAAC,QAAQ;4EAgGrB,WAAW;sBADjB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ChangeDetectorRef, Directive, HostListener, Inject} from '@angular/core';\nimport {extend} from '@jscrpt/common';\nimport {Observable, Subject} from 'rxjs';\n\nimport {DateTimeValue} from '../../misc/datetime.interface';\nimport {DATE_API} from '../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../services/dateApi.interface';\nimport {DateTimePicker} from '../misc/datetimePicker.interface';\n\n/**\n * Base class used as base for picker as base implementation of DateTimePicker interface\n */\n@Directive()\nexport abstract class PickerImplBaseComponent<TDate = any, TCssClasses = any> implements DateTimePicker<TDate, TCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Current value of datetime\n */\n protected _value: DateTimeValue<TDate>|null = null;\n\n /**\n * Occurs when value changes\n */\n protected _valueChange: Subject<void> = new Subject<void>();\n \n /**\n * Occurs when user scales up\n */\n protected _scaleUp: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Occurs when user scales down\n */\n protected _scaleDown: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Minimal possible value that can be picked\n */\n protected _minValue: TDate|null = null;\n\n /**\n * Maximal possible value that can be picked\n */\n protected _maxValue: TDate|null = null;\n\n //######################### public properties - implementation of DateTimePicker #########################\n\n /**\n * Gets current value of datetime\n */\n public get value(): DateTimeValue<TDate>|null\n {\n return this._value;\n }\n\n /**\n * Occurs when value changes\n */\n public get valueChange(): Observable<void>\n {\n return this._valueChange.asObservable();\n }\n\n /**\n * Occurs when user scales up\n */\n public get scaleUp(): Observable<TDate>\n {\n return this._scaleUp.asObservable();\n }\n\n /**\n * Occurs when user scales down\n */\n public get scaleDown(): Observable<TDate>\n {\n return this._scaleDown.asObservable();\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Date api instance for displayed date\n * @internal\n */\n public displayDate: DateApiObject<TDate>|null = null;\n\n /**\n * Indication whether can go up in period\n * @internal\n */\n public canGoUp: boolean = false;\n\n /**\n * Indication whether can go down in period\n * @internal\n */\n public canGoDown: boolean = false;\n\n /**\n * Css classes that are used within picker\n * @internal\n */\n public cssClasses!: TCssClasses;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n protected _changeDetector: ChangeDetectorRef)\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"higher\" period\n * @param event - Event that occured\n * @internal\n */\n public goUp(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoUp)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleUp.next(this.displayDate.value);\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Sets css classes for picker, allowing to override defaults\n * @param cssClasses - Css classes to be set for picker\n */\n public setCssClasses(cssClasses: TCssClasses): void\n {\n this.cssClasses = extend(true, {}, this.cssClasses, cssClasses);\n }\n\n /**\n * Sets minimal possible value for picker, that can be picked\n * @param value - Minimal possible value that can be picked\n */\n public abstract setMinValue(value: TDate|null): void;\n\n /**\n * Sets maximal possible value for picker, that can be picked\n * @param value - Maximal possible value that can be picked\n */\n public abstract setMaxValue(value: TDate|null): void;\n\n /**\n * Sets value of datetime picker\n * @param value - Value to be set to this picker\n */\n public abstract setValue(value: DateTimeValue<TDate>|null): void;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"pickerImplBase.component.js","sourceRoot":"","sources":["../../../../src/picker/components/pickerImplBase.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;;AAI3C;;GAEG;AAEH,MAAM,OAAgB,uBAAuB;IA8FzC,iEA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AK,CAAC,CAAC;SAC9C;IACL,CAAC;IAED,uGAAuG;IAEvG;;;OAGG;IACI,aAAa,CAAC,UAAuB;QAExC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;IA0BD;;;OAGG;IACI,YAAY,CAAC,KAAc;QAE9B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,KAAc;QAE5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,iBAAiB;QAEpB,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED,2EAA2E;IAE3E;;;;OAIG;IAEI,WAAW,CAAC,KAAY;QAE3B,KAAK,CAAC,cAAc,EAAE,CAAC;IAC3B,CAAC;;oHAlMiB,uBAAuB,kBA+FrB,QAAQ;wGA/FV,uBAAuB;2FAAvB,uBAAuB;kBAD5C,SAAS;;0BAgGO,MAAM;2BAAC,QAAQ;4EAgGrB,WAAW;sBADjB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ChangeDetectorRef, Directive, HostListener, Inject} from '@angular/core';\nimport {extend} from '@jscrpt/common';\nimport {Observable, Subject} from 'rxjs';\n\nimport {DateTimeValue} from '../../misc/datetime.interface';\nimport {DATE_API} from '../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../services/dateApi.interface';\nimport {DateTimePicker} from '../misc/datetimePicker.interface';\n\n/**\n * Base class used as base for picker as base implementation of DateTimePicker interface\n */\n@Directive()\nexport abstract class PickerImplBaseComponent<TDate = any, TCssClasses = any> implements DateTimePicker<TDate, TCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Current value of datetime\n */\n protected _value: DateTimeValue<TDate>|null = null;\n\n /**\n * Occurs when value changes\n */\n protected _valueChange: Subject<void> = new Subject<void>();\n \n /**\n * Occurs when user scales up\n */\n protected _scaleUp: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Occurs when user scales down\n */\n protected _scaleDown: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Minimal possible value that can be picked\n */\n protected _minValue: TDate|null = null;\n\n /**\n * Maximal possible value that can be picked\n */\n protected _maxValue: TDate|null = null;\n\n //######################### public properties - implementation of DateTimePicker #########################\n\n /**\n * Gets current value of datetime\n */\n public get value(): DateTimeValue<TDate>|null\n {\n return this._value;\n }\n\n /**\n * Occurs when value changes\n */\n public get valueChange(): Observable<void>\n {\n return this._valueChange.asObservable();\n }\n\n /**\n * Occurs when user scales up\n */\n public get scaleUp(): Observable<TDate>\n {\n return this._scaleUp.asObservable();\n }\n\n /**\n * Occurs when user scales down\n */\n public get scaleDown(): Observable<TDate>\n {\n return this._scaleDown.asObservable();\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Date api instance for displayed date\n * @internal\n */\n public displayDate: DateApiObject<TDate>|null = null;\n\n /**\n * Indication whether can go up in period\n * @internal\n */\n public canGoUp: boolean = false;\n\n /**\n * Indication whether can go down in period\n * @internal\n */\n public canGoDown: boolean = false;\n\n /**\n * Css classes that are used within picker\n * @internal\n */\n public cssClasses!: TCssClasses;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n protected _changeDetector: ChangeDetectorRef)\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"higher\" period\n * @param event - Event that occured\n * @internal\n */\n public goUp(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoUp)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleUp.next(this.displayDate.value);\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Sets css classes for picker, allowing to override defaults\n * @param cssClasses - Css classes to be set for picker\n */\n public setCssClasses(cssClasses: TCssClasses): void\n {\n this.cssClasses = extend(true, {}, this.cssClasses, cssClasses);\n }\n\n /**\n * Sets minimal possible value for picker, that can be picked\n * @param value - Minimal possible value that can be picked\n */\n public abstract setMinValue(value: TDate|null): void;\n\n /**\n * Sets maximal possible value for picker, that can be picked\n * @param value - Maximal possible value that can be picked\n */\n public abstract setMaxValue(value: TDate|null): void;\n\n /**\n * Sets value of datetime picker\n * @param value - Value to be set to this picker\n */\n public abstract setValue(value: DateTimeValue<TDate>|null): void;\n\n /**\n * Sets display date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public abstract display(value: DateApiObject<TDate>): void;\n\n /**\n * Sets indication whether can go down\n * @param value - Indication whether can go down in period\n */\n public setCanGoDown(value: boolean): void\n {\n this.canGoDown = value;\n }\n\n /**\n * Sets indication whether can go up\n * @param value - Indication whether can go up in period\n */\n public setCanGoUp(value: boolean): void\n {\n this.canGoUp = value;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles click anyway in picker, that blocks blur\n * @param event - Event that occured\n * @internal\n */\n @HostListener('mousedown', ['$event'])\n public handleClick(event: Event): void\n {\n event.preventDefault();\n }\n}"]}
|
|
@@ -69,7 +69,10 @@ export class DateTimeRollerTimePickerComponent extends PickerImplBaseComponent {
|
|
|
69
69
|
/**
|
|
70
70
|
* @inheritdoc
|
|
71
71
|
*/
|
|
72
|
-
setValue(
|
|
72
|
+
setValue(value) {
|
|
73
|
+
if (value) {
|
|
74
|
+
this.displayDate = this._dateApi.getValue(value.from);
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
//######################### public methods - template bindings #########################
|
|
75
78
|
/**
|
|
@@ -85,6 +88,7 @@ export class DateTimeRollerTimePickerComponent extends PickerImplBaseComponent {
|
|
|
85
88
|
event?.stopPropagation();
|
|
86
89
|
event?.preventDefault();
|
|
87
90
|
if (this.hour == value) {
|
|
91
|
+
this.hoursOpen = false;
|
|
88
92
|
return;
|
|
89
93
|
}
|
|
90
94
|
this.hour = value;
|
|
@@ -130,9 +134,9 @@ export class DateTimeRollerTimePickerComponent extends PickerImplBaseComponent {
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
DateTimeRollerTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeRollerTimePickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
133
|
-
DateTimeRollerTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeRollerTimePickerComponent, selector: "date-time-roller-time-picker", usesInheritance: true, ngImport: i0, template: "<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (click)=\"hoursOpen = !hoursOpen\" >\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (click)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n", styles: [".time-area\n{\n display: flex;\n flex-direction: row;\n padding:
|
|
137
|
+
DateTimeRollerTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeRollerTimePickerComponent, selector: "date-time-roller-time-picker", usesInheritance: true, ngImport: i0, template: "<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (click)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (click)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n", styles: [".time-area\n{\n display: flex;\n flex-direction: row;\n padding: 64px 64px;\n font-size: 32px;\n}\n\n.value-container\n{\n position: relative;\n height: 1em;\n width: 2ch;\n}\n\n.roller-scroll\n{\n position: absolute;\n line-height: 1em;\n max-height: 1em;\n overflow: scroll;\n scrollbar-width: none;\n top: 0;\n transition: all 250ms;\n border-radius: 4px;\n scroll-snap-type: y mandatory;\n contain: content;\n}\n\n.roller-scroll::-webkit-scrollbar\n{\n display: none;\n}\n\n.roller-scroll>div\n{\n scroll-snap-align: start;\n}\n\n.roller-item\n{\n opacity: 0.6;\n transition: all 100ms;\n font-weight: 300;\n}\n\n.roller-item.selected\n{\n opacity: 1;\n font-weight: bold;\n}\n\n.roller-scroll.open\n{\n max-height: 5em;\n top: -2em;\n}\n\n.minute-second-separator\n{\n margin-left: 12px;\n margin-right: 12px;\n line-height: 1em;\n}\n"], directives: [{ type: i1.ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutside", "clickOutsideElement"], outputs: ["clickOutsideChange"] }, { type: i2.LoopScrollDirective, selector: "[loopScroll]", inputs: ["loopScroll", "open"], outputs: ["loopScrollChange"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.LoopScrollDataDirective, selector: "[loopScrollData]", inputs: ["loopScrollData", "clone"] }], pipes: { "dateFormat": i5.DateFormatPipe, "slice": i3.SlicePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
134
138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeRollerTimePickerComponent, decorators: [{
|
|
135
139
|
type: Component,
|
|
136
|
-
args: [{ selector: 'date-time-roller-time-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (click)=\"hoursOpen = !hoursOpen\" >\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (click)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n", styles: [".time-area\n{\n display: flex;\n flex-direction: row;\n padding:
|
|
140
|
+
args: [{ selector: 'date-time-roller-time-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (click)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (click)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n", styles: [".time-area\n{\n display: flex;\n flex-direction: row;\n padding: 64px 64px;\n font-size: 32px;\n}\n\n.value-container\n{\n position: relative;\n height: 1em;\n width: 2ch;\n}\n\n.roller-scroll\n{\n position: absolute;\n line-height: 1em;\n max-height: 1em;\n overflow: scroll;\n scrollbar-width: none;\n top: 0;\n transition: all 250ms;\n border-radius: 4px;\n scroll-snap-type: y mandatory;\n contain: content;\n}\n\n.roller-scroll::-webkit-scrollbar\n{\n display: none;\n}\n\n.roller-scroll>div\n{\n scroll-snap-align: start;\n}\n\n.roller-item\n{\n opacity: 0.6;\n transition: all 100ms;\n font-weight: 300;\n}\n\n.roller-item.selected\n{\n opacity: 1;\n font-weight: bold;\n}\n\n.roller-scroll.open\n{\n max-height: 5em;\n top: -2em;\n}\n\n.minute-second-separator\n{\n margin-left: 12px;\n margin-right: 12px;\n line-height: 1em;\n}\n"] }]
|
|
137
141
|
}] });
|
|
138
142
|
//# sourceMappingURL=rollerTimePicker.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollerTimePicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/rollerTimePicker/rollerTimePicker.component.ts","../../../../../src/picker/components/rollerTimePicker/rollerTimePicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAMjE,OAAO,EAAC,uBAAuB,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,yBAAyB,CAAC;;;;;;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AAC,IAAI,GAAG,KAA0B,CAAC;QAEvC,IAAG,KAAK,EACR;YACI,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;SAC1B;QAED,IAAG,IAAI,CAAC,WAAW,EACnB;YACI,IAAI,CAAC,MAAM;gBACX;oBACI,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK;oBAC7B,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK;iBAC9B,CAAC;YAEF,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;SAC5B;IACL,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAc,KAAsB,EAAE,KAAY;QAE9D,IAAG,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,EAC7B;YACI,OAAO;SACV;QAED,KAAK,EAAE,eAAe,EAAE,CAAC;QACzB,KAAK,EAAE,cAAc,EAAE,CAAC;QAExB,IAAG,IAAI,CAAC,MAAM,IAAI,KAA0B,EAC5C;YACI,OAAO;SACV;QAED,IAAI,CAAC,MAAM,GAAG,KAA0B,CAAC;QAEzC,IAAG,KAAK,EACR;YACI,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;SAC5B;QAED,IAAG,IAAI,CAAC,WAAW,EACnB;YACI,IAAI,CAAC,MAAM;gBACX;oBACI,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK;oBAC7B,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK;iBAC9B,CAAC;YAEF,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;SAC5B;IACL,CAAC;;8HA/JQ,iCAAiC;kHAAjC,iCAAiC,2FCpB9C,qnDAyCA;2FDrBa,iCAAiC;kBAP7C,SAAS;+BAEI,8BAA8B,mBAGvB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\n\nimport {DateTimeValue} from '../../../misc/datetime.interface';\nimport {DateApiObject} from '../../../services';\nimport {LoopScrollData} from '../../directives';\nimport {DateTimePicker} from '../../interfaces';\nimport {PickerImplBaseComponent} from '../pickerImplBase.component';\nimport {hours, minutes} from './rollerTimePicker.data';\nimport {RollerTimePickerCssClasses} from './rollerTimePicker.interface';\n\n/**\n * Component used for rendering roller time picker\n */\n@Component(\n{\n selector: 'date-time-roller-time-picker',\n templateUrl: 'rollerTimePicker.component.html',\n styleUrls: ['rollerTimePicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeRollerTimePickerComponent<TDate = any> extends PickerImplBaseComponent<TDate, RollerTimePickerCssClasses> implements DateTimePicker<TDate, RollerTimePickerCssClasses>\n{\n //######################### public properties - template bindings #########################\n\n /**\n * Array of available hours\n */\n public hours: LoopScrollData[] = hours;\n\n /**\n * Array of available minutes\n */\n public minutes: LoopScrollData[] = minutes;\n\n /**\n * Indication whether are minutes open\n */\n public minutesOpen: boolean = false;\n\n /**\n * Indication whether are hours open\n */\n public hoursOpen: boolean = false;\n\n /**\n * Current value of hour\n */\n public get hour(): number\n {\n return this.displayDate?.hour() ?? 0;\n }\n public set hour(value: number)\n {\n this.displayDate?.hour(value);\n }\n\n /**\n * Current value of minute\n */\n public get minute(): number\n {\n return this.displayDate?.minute() ?? 0;\n }\n public set minute(value: number)\n {\n this.displayDate?.minute(value);\n }\n\n //######################### public methods - implementation of PickerBaseComponent #########################\n \n /**\n * @inheritdoc\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n }\n\n /**\n * @inheritdoc\n */\n public setMinValue(_value: TDate | null): void\n {\n }\n\n /**\n * @inheritdoc\n */\n public setMaxValue(_value: TDate | null): void\n {\n }\n\n /**\n * @inheritdoc\n */\n public setValue(_value: DateTimeValue<TDate> | null): void\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Sets hour\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as hour\n * @returns \n */\n public setHour<TData = any>(event: MouseEvent|null, value: TData): void\n {\n if(!this.hoursOpen && event)\n {\n return;\n }\n\n event?.stopPropagation();\n event?.preventDefault();\n\n if(this.hour == value as unknown as number)\n {\n return;\n }\n\n this.hour = value as unknown as number;\n \n if(event)\n {\n this.hoursOpen = false;\n }\n\n if(this.displayDate)\n {\n this._value =\n {\n from: this.displayDate?.value,\n to: this.displayDate?.value\n };\n\n this._valueChange.next();\n }\n }\n\n /**\n * Sets minute\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as minute\n * @returns \n */\n public setMinute<TData = any>(event: MouseEvent|null, value: TData): void\n {\n if(!this.minutesOpen && event)\n {\n return;\n }\n\n event?.stopPropagation();\n event?.preventDefault();\n\n if(this.minute == value as unknown as number)\n {\n return;\n }\n\n this.minute = value as unknown as number;\n \n if(event)\n {\n this.minutesOpen = false;\n }\n\n if(this.displayDate)\n {\n this._value =\n {\n from: this.displayDate?.value,\n to: this.displayDate?.value\n };\n\n this._valueChange.next();\n }\n }\n}","<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (click)=\"hoursOpen = !hoursOpen\" >\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (click)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"rollerTimePicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/rollerTimePicker/rollerTimePicker.component.ts","../../../../../src/picker/components/rollerTimePicker/rollerTimePicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAMjE,OAAO,EAAC,uBAAuB,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,yBAAyB,CAAC;;;;;;;AAGvD;;GAEG;AAQH,MAAM,OAAO,iCAA+C,SAAQ,uBAA0D;IAP9H;;QASI,2FAA2F;QAE3F;;WAEG;QACI,UAAK,GAAqB,KAAK,CAAC;QAEvC;;WAEG;QACI,YAAO,GAAqB,OAAO,CAAC;QAE3C;;WAEG;QACI,gBAAW,GAAY,KAAK,CAAC;QAEpC;;WAEG;QACI,cAAS,GAAY,KAAK,CAAC;KAgJrC;IA9IG;;OAEG;IACH,IAAW,IAAI;QAEX,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IACD,IAAW,IAAI,CAAC,KAAa;QAEzB,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAEb,OAAO,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,IAAW,MAAM,CAAC,KAAa;QAE3B,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,4GAA4G;IAE5G;;OAEG;I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AAG,IAAI,CAAC,MAAM,IAAI,KAA0B,EAC5C;YACI,OAAO;SACV;QAED,IAAI,CAAC,MAAM,GAAG,KAA0B,CAAC;QAEzC,IAAG,KAAK,EACR;YACI,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;SAC5B;QAED,IAAG,IAAI,CAAC,WAAW,EACnB;YACI,IAAI,CAAC,MAAM;gBACX;oBACI,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK;oBAC7B,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK;iBAC9B,CAAC;YAEF,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;SAC5B;IACL,CAAC;;8HArKQ,iCAAiC;kHAAjC,iCAAiC,2FCpB9C,oyFAmEA;2FD/Ca,iCAAiC;kBAP7C,SAAS;+BAEI,8BAA8B,mBAGvB,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy} from '@angular/core';\n\nimport {DateTimeValue} from '../../../misc/datetime.interface';\nimport {DateApiObject} from '../../../services';\nimport {LoopScrollData} from '../../directives';\nimport {DateTimePicker} from '../../interfaces';\nimport {PickerImplBaseComponent} from '../pickerImplBase.component';\nimport {hours, minutes} from './rollerTimePicker.data';\nimport {RollerTimePickerCssClasses} from './rollerTimePicker.interface';\n\n/**\n * Component used for rendering roller time picker\n */\n@Component(\n{\n selector: 'date-time-roller-time-picker',\n templateUrl: 'rollerTimePicker.component.html',\n styleUrls: ['rollerTimePicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeRollerTimePickerComponent<TDate = any> extends PickerImplBaseComponent<TDate, RollerTimePickerCssClasses> implements DateTimePicker<TDate, RollerTimePickerCssClasses>\n{\n //######################### public properties - template bindings #########################\n\n /**\n * Array of available hours\n */\n public hours: LoopScrollData[] = hours;\n\n /**\n * Array of available minutes\n */\n public minutes: LoopScrollData[] = minutes;\n\n /**\n * Indication whether are minutes open\n */\n public minutesOpen: boolean = false;\n\n /**\n * Indication whether are hours open\n */\n public hoursOpen: boolean = false;\n\n /**\n * Current value of hour\n */\n public get hour(): number\n {\n return this.displayDate?.hour() ?? 0;\n }\n public set hour(value: number)\n {\n this.displayDate?.hour(value);\n }\n\n /**\n * Current value of minute\n */\n public get minute(): number\n {\n return this.displayDate?.minute() ?? 0;\n }\n public set minute(value: number)\n {\n this.displayDate?.minute(value);\n }\n\n //######################### public methods - implementation of PickerBaseComponent #########################\n \n /**\n * @inheritdoc\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n }\n\n /**\n * @inheritdoc\n */\n public setMinValue(_value: TDate | null): void\n {\n }\n\n /**\n * @inheritdoc\n */\n public setMaxValue(_value: TDate | null): void\n {\n }\n\n /**\n * @inheritdoc\n */\n public setValue(value: DateTimeValue<TDate> | null): void\n {\n if(value)\n {\n this.displayDate = this._dateApi.getValue(value.from);\n }\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Sets hour\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as hour\n * @returns \n */\n public setHour<TData = any>(event: MouseEvent|null, value: TData): void\n {\n if(!this.hoursOpen && event)\n {\n return;\n }\n\n event?.stopPropagation();\n event?.preventDefault();\n\n if(this.hour == value as unknown as number)\n {\n this.hoursOpen = false;\n\n return;\n }\n\n this.hour = value as unknown as number;\n \n if(event)\n {\n this.hoursOpen = false;\n }\n\n if(this.displayDate)\n {\n this._value =\n {\n from: this.displayDate?.value,\n to: this.displayDate?.value\n };\n\n this._valueChange.next();\n }\n }\n\n /**\n * Sets minute\n * @param event - Mouse event that was triggered\n * @param value - Value to be set as minute\n * @returns \n */\n public setMinute<TData = any>(event: MouseEvent|null, value: TData): void\n {\n if(!this.minutesOpen && event)\n {\n return;\n }\n\n event?.stopPropagation();\n event?.preventDefault();\n\n if(this.minute == value as unknown as number)\n {\n return;\n }\n\n this.minute = value as unknown as number;\n \n if(event)\n {\n this.minutesOpen = false;\n }\n\n if(this.displayDate)\n {\n this._value =\n {\n from: this.displayDate?.value,\n to: this.displayDate?.value\n };\n\n this._valueChange.next();\n }\n }\n}","<div class=\"flex-row\" style=\"justify-content: center;\">\n <div [class.clickable]=\"canGoUp\" (mousedown)=\"goUp($event)\">{{displayDate?.value | dateFormat: 'date'}}</div>\n</div>\n\n<div class=\"time-area\">\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"hoursOpen = false\"\n [clickOutsideElement]=\"hoursScroll\">\n <div #hoursScroll\n class=\"roller-scroll\"\n [class.open]=\"hoursOpen\"\n [loopScroll]=\"hour\"\n [open]=\"hoursOpen\"\n (loopScrollChange)=\"setHour(null, $event)\"\n (click)=\"hoursOpen = !hoursOpen\">\n <div *ngFor=\"let hour of hours | slice: -14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours\"\n [loopScrollData]=\"hour?.data\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n\n <div *ngFor=\"let hour of hours | slice: 0: 14\"\n [loopScrollData]=\"hour?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setHour($event, hour?.data)\">{{hour?.displayText}}</div>\n </div>\n </div>\n\n <div class=\"minute-second-separator\">:</div>\n\n <div class=\"value-container\"\n [clickOutside]=\"true\"\n (clickOutsideChange)=\"minutesOpen = false\"\n [clickOutsideElement]=\"minutesScroll\">\n <div #minutesScroll\n class=\"roller-scroll\"\n [class.open]=\"minutesOpen\"\n [loopScroll]=\"minute\"\n [open]=\"minutesOpen\"\n (loopScrollChange)=\"setMinute(null, $event)\"\n (click)=\"minutesOpen = !minutesOpen\">\n <div *ngFor=\"let minute of minutes | slice: -14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes\"\n [loopScrollData]=\"minute?.data\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n\n <div *ngFor=\"let minute of minutes | slice: 0: 14\"\n [loopScrollData]=\"minute?.data\"\n [clone]=\"true\"\n class=\"roller-item\"\n (click)=\"setMinute($event, minute?.data)\">{{minute?.displayText}}</div>\n </div>\n </div>\n</div>\n"]}
|