UNPKG

ngx-bootstrap

Version:
1 lines 158 kB
{"version":3,"file":"ngx-bootstrap-timepicker.mjs","sources":["../tmp-esm2022/reducer/timepicker.actions.js","../tmp-esm2022/timepicker.utils.js","../tmp-esm2022/timepicker-controls.util.js","../tmp-esm2022/timepicker.config.js","../tmp-esm2022/reducer/timepicker.reducer.js","../tmp-esm2022/reducer/timepicker.store.js","../tmp-esm2022/timepicker.component.js","../tmp-esm2022/timepicker.module.js","../tmp-esm2022/ngx-bootstrap-timepicker.js"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as i0 from \"@angular/core\";\nexport class TimepickerActions {\n static { this.WRITE_VALUE = '[timepicker] write value from ng model'; }\n static { this.CHANGE_HOURS = '[timepicker] change hours'; }\n static { this.CHANGE_MINUTES = '[timepicker] change minutes'; }\n static { this.CHANGE_SECONDS = '[timepicker] change seconds'; }\n static { this.SET_TIME_UNIT = '[timepicker] set time unit'; }\n static { this.UPDATE_CONTROLS = '[timepicker] update controls'; }\n writeValue(value) {\n return {\n type: TimepickerActions.WRITE_VALUE,\n payload: value\n };\n }\n changeHours(event) {\n return {\n type: TimepickerActions.CHANGE_HOURS,\n payload: event\n };\n }\n changeMinutes(event) {\n return {\n type: TimepickerActions.CHANGE_MINUTES,\n payload: event\n };\n }\n changeSeconds(event) {\n return {\n type: TimepickerActions.CHANGE_SECONDS,\n payload: event\n };\n }\n setTime(value) {\n return {\n type: TimepickerActions.SET_TIME_UNIT,\n payload: value\n };\n }\n updateControls(value) {\n return {\n type: TimepickerActions.UPDATE_CONTROLS,\n payload: value\n };\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.0.2\", ngImport: i0, type: TimepickerActions, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"20.0.2\", ngImport: i0, type: TimepickerActions, providedIn: 'platform' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.0.2\", ngImport: i0, type: TimepickerActions, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'platform' }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXBpY2tlci5hY3Rpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL3RpbWVwaWNrZXIvcmVkdWNlci90aW1lcGlja2VyLmFjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFTM0MsTUFBTSxPQUFPLGlCQUFpQjthQUNaLGdCQUFXLEdBQUcsd0NBQXdDLEFBQTNDLENBQTRDO2FBQ3ZELGlCQUFZLEdBQUcsMkJBQTJCLEFBQTlCLENBQStCO2FBQzNDLG1CQUFjLEdBQUcsNkJBQTZCLEFBQWhDLENBQWlDO2FBQy9DLG1CQUFjLEdBQUcsNkJBQTZCLEFBQWhDLENBQWlDO2FBQy9DLGtCQUFhLEdBQUcsNEJBQTRCLEFBQS9CLENBQWdDO2FBQzdDLG9CQUFlLEdBQUcsOEJBQThCLEFBQWpDLENBQWtDO0lBRWpFLFVBQVUsQ0FBQyxLQUFxQjtRQUM5QixPQUFPO1lBQ0wsSUFBSSxFQUFFLGlCQUFpQixDQUFDLFdBQVc7WUFDbkMsT0FBTyxFQUFFLEtBQUs7U0FDZixDQUFDO0lBQ0osQ0FBQztJQUVELFdBQVcsQ0FBQyxLQUFzQjtRQUNoQyxPQUFPO1lBQ0wsSUFBSSxFQUFFLGlCQUFpQixDQUFDLFlBQVk7WUFDcEMsT0FBTyxFQUFFLEtBQUs7U0FDZixDQUFDO0lBQ0osQ0FBQztJQUVELGFBQWEsQ0FBQyxLQUFzQjtRQUNsQyxPQUFPO1lBQ0wsSUFBSSxFQUFFLGlCQUFpQixDQUFD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ogQWN0aW9uIHtcbiAgICByZXR1cm4ge1xuICAgICAgdHlwZTogVGltZXBpY2tlckFjdGlvbnMuQ0hBTkdFX1NFQ09ORFMsXG4gICAgICBwYXlsb2FkOiBldmVudFxuICAgIH07XG4gIH1cblxuICBzZXRUaW1lKHZhbHVlOiBUaW1lKTogQWN0aW9uIHtcbiAgICByZXR1cm4ge1xuICAgICAgdHlwZTogVGltZXBpY2tlckFjdGlvbnMuU0VUX1RJTUVfVU5JVCxcbiAgICAgIHBheWxvYWQ6IHZhbHVlXG4gICAgfTtcbiAgfVxuXG4gIHVwZGF0ZUNvbnRyb2xzKHZhbHVlOiBUaW1lcGlja2VyQ29tcG9uZW50U3RhdGUpOiBBY3Rpb24ge1xuICAgIHJldHVybiB7XG4gICAgICB0eXBlOiBUaW1lcGlja2VyQWN0aW9ucy5VUERBVEVfQ09OVFJPTFMsXG4gICAgICBwYXlsb2FkOiB2YWx1ZVxuICAgIH07XG4gIH1cbn1cbiJdfQ==","const dex = 10;\nconst hoursPerDay = 24;\nconst hoursPerDayHalf = 12;\nconst minutesPerHour = 60;\nconst secondsPerMinute = 60;\nexport function isValidDate(value) {\n if (!value) {\n return false;\n }\n if (value instanceof Date && isNaN(value.getHours())) {\n return false;\n }\n if (typeof value === 'string') {\n return isValidDate(new Date(value));\n }\n return true;\n}\nexport function isValidLimit(controls, newDate) {\n if (controls.min && newDate < controls.min) {\n return false;\n }\n if (controls.max && newDate > controls.max) {\n return false;\n }\n return true;\n}\nexport function toNumber(value) {\n if (typeof value === 'undefined') {\n return NaN;\n }\n if (typeof value === 'number') {\n return value;\n }\n return parseInt(value, dex);\n}\nexport function isNumber(value) {\n return !isNaN(toNumber(value));\n}\nexport function parseHours(value, isPM = false) {\n const hour = toNumber(value);\n if (isNaN(hour) ||\n hour < 0 ||\n hour > (isPM ? hoursPerDayHalf : hoursPerDay)) {\n return NaN;\n }\n return hour;\n}\nexport function parseMinutes(value) {\n const minute = toNumber(value);\n if (isNaN(minute) || minute < 0 || minute > minutesPerHour) {\n return NaN;\n }\n return minute;\n}\nexport function parseSeconds(value) {\n const seconds = toNumber(value);\n if (isNaN(seconds) || seconds < 0 || seconds > secondsPerMinute) {\n return NaN;\n }\n return seconds;\n}\nexport function parseTime(value) {\n if (typeof value === 'string') {\n return new Date(value);\n }\n return value;\n}\nexport function changeTime(value, diff) {\n if (!value) {\n return changeTime(createDate(new Date(), 0, 0, 0), diff);\n }\n if (!diff) {\n return value;\n }\n let hour = value.getHours();\n let minutes = value.getMinutes();\n let seconds = value.getSeconds();\n if (diff.hour) {\n hour = hour + toNumber(diff.hour);\n }\n if (diff.minute) {\n minutes = minutes + toNumber(diff.minute);\n }\n if (diff.seconds) {\n seconds = seconds + toNumber(diff.seconds);\n }\n return createDate(value, hour, minutes, seconds);\n}\nexport function setTime(value, opts) {\n let hour = parseHours(opts.hour);\n const minute = parseMinutes(opts.minute);\n const seconds = parseSeconds(opts.seconds) || 0;\n if (opts.isPM && hour !== 12) {\n hour += hoursPerDayHalf;\n }\n if (!value) {\n if (!isNaN(hour) && !isNaN(minute)) {\n return createDate(new Date(), hour, minute, seconds);\n }\n return value;\n }\n if (isNaN(hour) || isNaN(minute)) {\n return value;\n }\n return createDate(value, hour, minute, seconds);\n}\nexport function createDate(value, hours, minutes, seconds) {\n const newValue = new Date(value.getFullYear(), value.getMonth(), value.getDate(), hours, minutes, seconds, value.getMilliseconds());\n // #3139 ensure date part remains unchanged\n newValue.setFullYear(value.getFullYear());\n newValue.setMonth(value.getMonth());\n newValue.setDate(value.getDate());\n return newValue;\n}\nexport function padNumber(value) {\n const _value = value.toString();\n if (_value.length > 1) {\n return _value;\n }\n return `0${_value}`;\n}\nexport function isHourInputValid(hours, isPM) {\n return !isNaN(parseHours(hours, isPM));\n}\nexport function isMinuteInputValid(minutes) {\n return !isNaN(parseMinutes(minutes));\n}\nexport function isSecondInputValid(seconds) {\n return !isNaN(parseSeconds(seconds));\n}\nexport function isInputLimitValid(diff, max, min) {\n const newDate = setTime(new Date(), diff);\n if (!newDate) {\n return false;\n }\n if (max && newDate > max) {\n return false;\n }\n if (min && newDate < min) {\n return false;\n }\n return true;\n}\nexport function isOneOfDatesEmpty(hours, minutes, seconds) {\n return hours.length === 0 || minutes.length === 0 || seconds.length === 0;\n}\nexport function isInputValid(hours, minutes = '0', seconds = '0', isPM) {\n return isHourInputValid(hours, isPM)\n && isMinuteInputValid(minutes)\n && isSecondInputValid(seconds);\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXBpY2tlci51dGlscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy90aW1lcGlja2VyL3RpbWVwaWNrZXIudXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxHQUFHLEdBQUcsRUFBRSxDQUFDO0FBQ2YsTUFBTSxXQUFXLEdBQUcsRUFBRSxDQUFDO0FBQ3ZCLE1BQU0sZUFBZSxHQUFHLEVBQUUsQ0FBQztBQUMzQixNQUFNLGNBQWMsR0FBRyxFQUFFLENBQUM7QUFDMUIsTUFBTSxnQkFBZ0IsR0FBRyxFQUFFLENBQUM7QUFFNUIsTUFBTSxVQUFVLFdBQVcsQ0FBQyxLQUFxQjtJQUMvQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUM7UUFDWCxPQUFPLEtBQUssQ0FBQztJQUNmLENBQUM7SUFFRCxJQUFJLEtBQUssWUFBWSxJQUFJLElBQUksS0FBSyxDQUFDLEtBQUssQ0FBQyxRQUFRLEVBQUUsQ0FBQyxFQUFFLENBQUM7UUFDckQsT0FBTyxLQUFLLENBQUM7SUFDZixDQUFDO0lBRUQsSUFBSSxPQUFPLEtBQUssS0FBSyxRQUFRLEVBQUUsQ0FBQztRQUM5QixPQUFPLFdBQVcsQ0FBQyxJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDO0lBQ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5leHBvcnQgZnVuY3Rpb24gaXNJbnB1dExpbWl0VmFsaWQoZGlmZjogVGltZSwgbWF4PzogRGF0ZSwgbWluPzogRGF0ZSk6IGJvb2xlYW4ge1xuICBjb25zdCBuZXdEYXRlID0gc2V0VGltZShuZXcgRGF0ZSgpLCBkaWZmKTtcblxuICBpZiAoIW5ld0RhdGUpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBpZiAobWF4ICYmIG5ld0RhdGUgPiBtYXgpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBpZiAobWluICYmIG5ld0RhdGUgPCBtaW4pIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICByZXR1cm4gdHJ1ZTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzT25lT2ZEYXRlc0VtcHR5KGhvdXJzOiBzdHJpbmcsIG1pbnV0ZXM6IHN0cmluZywgc2Vjb25kczogc3RyaW5nKTogYm9vbGVhbiB7XG4gIHJldHVybiBob3Vycy5sZW5ndGggPT09IDAgfHwgbWludXRlcy5sZW5ndGggPT09IDAgfHwgc2Vjb25kcy5sZW5ndGggPT09IDA7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBpc0lucHV0VmFsaWQoXG4gIGhvdXJzOiBzdHJpbmcsXG4gIG1pbnV0ZXMgPSAnMCcsXG4gIHNlY29uZHMgPSAnMCcsXG4gIGlzUE06IGJvb2xlYW5cbik6IGJvb2xlYW4ge1xuICByZXR1cm4gaXNIb3VySW5wdXRWYWxpZChob3VycywgaXNQTSlcbiAgICAmJiBpc01pbnV0ZUlucHV0VmFsaWQobWludXRlcylcbiAgICAmJiBpc1NlY29uZElucHV0VmFsaWQoc2Vjb25kcyk7XG59XG4iXX0=","import { changeTime } from './timepicker.utils';\nexport function canChangeValue(state, event) {\n if (state.readonlyInput || state.disabled) {\n return false;\n }\n if (event) {\n if (event.source === 'wheel' && !state.mousewheel) {\n return false;\n }\n if (event.source === 'key' && !state.arrowkeys) {\n return false;\n }\n }\n return true;\n}\nexport function canChangeHours(event, controls) {\n if (!event.step) {\n return false;\n }\n if (event.step > 0 && !controls.canIncrementHours) {\n return false;\n }\n if (event.step < 0 && !controls.canDecrementHours) {\n return false;\n }\n return true;\n}\nexport function canChangeMinutes(event, controls) {\n if (!event.step) {\n return false;\n }\n if (event.step > 0 && !controls.canIncrementMinutes) {\n return false;\n }\n if (event.step < 0 && !controls.canDecrementMinutes) {\n return false;\n }\n return true;\n}\nexport function canChangeSeconds(event, controls) {\n if (!event.step) {\n return false;\n }\n if (event.step > 0 && !controls.canIncrementSeconds) {\n return false;\n }\n if (event.step < 0 && !controls.canDecrementSeconds) {\n return false;\n }\n return true;\n}\nexport function getControlsValue(state) {\n const { hourStep, minuteStep, secondsStep, readonlyInput, disabled, mousewheel, arrowkeys, showSpinners, showMeridian, showSeconds, meridians, min, max } = state;\n return {\n hourStep,\n minuteStep,\n secondsStep,\n readonlyInput,\n disabled,\n mousewheel,\n arrowkeys,\n showSpinners,\n showMeridian,\n showSeconds,\n meridians,\n min,\n max\n };\n}\nexport function timepickerControls(value, state) {\n const hoursPerDay = 24;\n const hoursPerDayHalf = 12;\n const { min, max, hourStep, minuteStep, secondsStep, showSeconds } = state;\n const res = {\n canIncrementHours: true,\n canIncrementMinutes: true,\n canIncrementSeconds: true,\n canDecrementHours: true,\n canDecrementMinutes: true,\n canDecrementSeconds: true,\n canToggleMeridian: true\n };\n if (!value) {\n return res;\n }\n // compare dates\n if (max) {\n const _newHour = changeTime(value, { hour: hourStep });\n res.canIncrementHours = max > _newHour && (value.getHours() + hourStep) < hoursPerDay;\n if (!res.canIncrementHours) {\n const _newMinutes = changeTime(value, { minute: minuteStep });\n res.canIncrementMinutes = showSeconds\n ? max > _newMinutes\n : max >= _newMinutes;\n }\n if (!res.canIncrementMinutes) {\n const _newSeconds = changeTime(value, { seconds: secondsStep });\n res.canIncrementSeconds = max >= _newSeconds;\n }\n if (value.getHours() < hoursPerDayHalf) {\n res.canToggleMeridian = changeTime(value, { hour: hoursPerDayHalf }) < max;\n }\n }\n if (min) {\n const _newHour = changeTime(value, { hour: -hourStep });\n res.canDecrementHours = min < _newHour;\n if (!res.canDecrementHours) {\n const _newMinutes = changeTime(value, { minute: -minuteStep });\n res.canDecrementMinutes = showSeconds\n ? min < _newMinutes\n : min <= _newMinutes;\n }\n if (!res.canDecrementMinutes) {\n const _newSeconds = changeTime(value, { seconds: -secondsStep });\n res.canDecrementSeconds = min <= _newSeconds;\n }\n if (value.getHours() >= hoursPerDayHalf) {\n res.canToggleMeridian = changeTime(value, { hour: -hoursPerDayHalf }) > min;\n }\n }\n return res;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXBpY2tlci1jb250cm9scy51dGlsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RpbWVwaWNrZXIvdGltZXBpY2tlci1jb250cm9scy51dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQU9oRCxNQUFNLFVBQVUsY0FBYyxDQUM1QixLQUErQixFQUMvQixLQUF1QjtJQUV2QixJQUFJLEtBQUssQ0FBQyxhQUFhLElBQUksS0FBSyxDQUFDLFFBQVEsRUFBRSxDQUFDO1FBQzFDLE9BQU8sS0FBSyxDQUFDO0lBQ2YsQ0FBQztJQUVELElBQUksS0FBSyxFQUFFLENBQUM7UUFDVixJQUFJLEtBQUssQ0FBQyxNQUFNLEtBQUssT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLFVBQVUsRUFBRSxDQUFDO1lBQ2xELE9BQU8sS0FBSyxDQUFDO1FBQ2YsQ0FBQztRQUVELElBQUksS0FBSyxDQUFDLE1BQU0sS0FBSyxLQUFLLElBQUksQ0FBQyxLQUFLLENBQUMsU0FBUyxFQUFFLENB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biA8IF9uZXdNaW51dGVzXG4gICAgICAgIDogbWluIDw9IF9uZXdNaW51dGVzO1xuICAgIH1cblxuICAgIGlmICghcmVzLmNhbkRlY3JlbWVudE1pbnV0ZXMpIHtcbiAgICAgIGNvbnN0IF9uZXdTZWNvbmRzID0gY2hhbmdlVGltZSh2YWx1ZSwgeyBzZWNvbmRzOiAtc2Vjb25kc1N0ZXAgfSk7XG4gICAgICByZXMuY2FuRGVjcmVtZW50U2Vjb25kcyA9IG1pbiA8PSBfbmV3U2Vjb25kcztcbiAgICB9XG5cbiAgICBpZiAodmFsdWUuZ2V0SG91cnMoKSA+PSBob3Vyc1BlckRheUhhbGYpIHtcbiAgICAgIHJlcy5jYW5Ub2dnbGVNZXJpZGlhbiA9IGNoYW5nZVRpbWUodmFsdWUsIHsgaG91cjogLWhvdXJzUGVyRGF5SGFsZiB9KSA+IG1pbjtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gcmVzO1xufVxuIl19","import { Injectable } from '@angular/core';\nimport * as i0 from \"@angular/core\";\n/** Provides default configuration values for timepicker */\nexport class TimepickerConfig {\n constructor() {\n /** hours change step */\n this.hourStep = 1;\n /** minutes change step */\n this.minuteStep = 5;\n /** seconds changes step */\n this.secondsStep = 10;\n /** if true works in 12H mode and displays AM/PM. If false works in 24H mode and hides AM/PM */\n this.showMeridian = true;\n /** meridian labels based on locale */\n this.meridians = ['AM', 'PM'];\n /** if true hours and minutes fields will be readonly */\n this.readonlyInput = false;\n /** if true hours and minutes fields will be disabled */\n this.disabled = false;\n /** if true emptyTime is not marked as invalid */\n this.allowEmptyTime = false;\n /** if true scroll inside hours and minutes inputs will change time */\n this.mousewheel = true;\n /** if true the values of hours and minutes can be changed using the up/down arrow keys on the keyboard */\n this.arrowkeys = true;\n /** if true spinner arrows above and below the inputs will be shown */\n this.showSpinners = true;\n /** show seconds in timepicker */\n this.showSeconds = false;\n /** show minutes in timepicker */\n this.showMinutes = true;\n /** placeholder for hours field in timepicker */\n this.hoursPlaceholder = 'HH';\n /** placeholder for minutes field in timepicker */\n this.minutesPlaceholder = 'MM';\n /** placeholder for seconds field in timepicker */\n this.secondsPlaceholder = 'SS';\n /** hours aria label */\n this.ariaLabelHours = 'hours';\n /** minutes aria label */\n this.ariaLabelMinutes = 'minutes';\n /** seconds aria label */\n this.ariaLabelSeconds = 'seconds';\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.0.2\", ngImport: i0, type: TimepickerConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"20.0.2\", ngImport: i0, type: TimepickerConfig, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.0.2\", ngImport: i0, type: TimepickerConfig, decorators: [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXBpY2tlci5jb25maWcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdGltZXBpY2tlci90aW1lcGlja2VyLmNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUUzQywyREFBMkQ7QUFJM0QsTUFBTSxPQUFPLGdCQUFnQjtJQUg3QjtRQUlFLHdCQUF3QjtRQUN4QixhQUFRLEdBQUcsQ0FBQyxDQUFDO1FBQ2IsMEJBQTBCO1FBQzFCLGVBQVUsR0FBRyxDQUFDLENBQUM7UUFDZiwyQkFBMkI7UUFDM0IsZ0JBQVcsR0FBRyxFQUFFLENBQUM7UUFDakIsK0ZBQStGO1FBQy9GLGlCQUFZLEdBQUcsSUFBSSxDQUFDO1FBQ3BCLHNDQUFzQztRQUN0QyxjQUFT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ZXMgPSAnbWludXRlcyc7XG4gIC8qKiBzZWNvbmRzIGFyaWEgbGFiZWwgKi9cbiAgYXJpYUxhYmVsU2Vjb25kcyA9ICdzZWNvbmRzJztcbn1cbiJdfQ==","import { canChangeHours, canChangeMinutes, canChangeSeconds, canChangeValue, timepickerControls } from '../timepicker-controls.util';\nimport { TimepickerConfig } from '../timepicker.config';\nimport { changeTime, setTime, isValidLimit } from '../timepicker.utils';\nimport { TimepickerActions } from './timepicker.actions';\nexport const initialState = {\n value: void 0,\n config: new TimepickerConfig(),\n controls: {\n canIncrementHours: true,\n canIncrementMinutes: true,\n canIncrementSeconds: true,\n canDecrementHours: true,\n canDecrementMinutes: true,\n canDecrementSeconds: true,\n canToggleMeridian: true\n }\n};\nexport function timepickerReducer(state = initialState, action) {\n switch (action.type) {\n case TimepickerActions.WRITE_VALUE: {\n return Object.assign({}, state, { value: action.payload });\n }\n case TimepickerActions.CHANGE_HOURS: {\n if (!canChangeValue(state.config, action.payload) ||\n !canChangeHours(action.payload, state.controls)) {\n return state;\n }\n const _newTime = changeTime(state.value, { hour: action.payload.step });\n if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {\n return state;\n }\n return Object.assign({}, state, { value: _newTime });\n }\n case TimepickerActions.CHANGE_MINUTES: {\n if (!canChangeValue(state.config, action.payload) ||\n !canChangeMinutes(action.payload, state.controls)) {\n return state;\n }\n const _newTime = changeTime(state.value, { minute: action.payload.step });\n if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {\n return state;\n }\n return Object.assign({}, state, { value: _newTime });\n }\n case TimepickerActions.CHANGE_SECONDS: {\n if (!canChangeValue(state.config, action.payload) ||\n !canChangeSeconds(action.payload, state.controls)) {\n return state;\n }\n const _newTime = changeTime(state.value, {\n seconds: action.payload.step\n });\n if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {\n return state;\n }\n return Object.assign({}, state, { value: _newTime });\n }\n case TimepickerActions.SET_TIME_UNIT: {\n if (!canChangeValue(state.config)) {\n return state;\n }\n const _newTime = setTime(state.value, action.payload);\n return Object.assign({}, state, { value: _newTime });\n }\n case TimepickerActions.UPDATE_CONTROLS: {\n const _newControlsState = timepickerControls(state.value, action.payload);\n const _newState = {\n value: state.value,\n config: action.payload,\n controls: _newControlsState\n };\n if (state.config.showMeridian !== _newState.config.showMeridian) {\n if (state.value) {\n _newState.value = new Date(state.value);\n }\n }\n return Object.assign({}, state, _newState);\n }\n default:\n return state;\n }\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXBpY2tlci5yZWR1Y2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL3RpbWVwaWNrZXIvcmVkdWNlci90aW1lcGlja2VyLnJlZHVjZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUNMLGNBQWMsRUFDZCxnQkFBZ0IsRUFDaEIsZ0JBQWdCLEVBQ2hCLGNBQWMsRUFDZCxrQkFBa0IsRUFDbkIsTUFBTSw2QkFBNkIsQ0FBQztBQUNyQyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUt4RCxPQUFPLEVBQUUsVUFBVSxFQUFFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN4RSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQVF6RCxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQW9CO0lBQzNDLEtBQUssRUFBRSxLQUFLLENBQUM7SUFDYixNQUFNLEVBQUUsSUFBSSxnQkFBZ0IsRUFBRTtJQUM5QixRQUFRLEVBQUU7UUFDUixpQkFBaUIsRUFBRSxJQUFJO1FBQ3ZCLG1CQUFtQixFQUFFLElBQUk7UUFDekIsbUJBQW1CLEVBQUUsSUFBSTt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