ngx-bootstrap-timepicker.umd.js 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('rxjs'), require('ngx-bootstrap/mini-ngrx'), require('@angular/common')) :
  3. typeof define === 'function' && define.amd ? define('ngx-bootstrap/timepicker', ['exports', '@angular/core', '@angular/forms', 'rxjs', 'ngx-bootstrap/mini-ngrx', '@angular/common'], factory) :
  4. (global = global || self, factory((global['ngx-bootstrap'] = global['ngx-bootstrap'] || {}, global['ngx-bootstrap'].timepicker = {}), global.ng.core, global.ng.forms, global.rxjs, global.miniNgrx, global.ng.common));
  5. }(this, function (exports, core, forms, rxjs, miniNgrx, common) { 'use strict';
  6. /*! *****************************************************************************
  7. Copyright (c) Microsoft Corporation. All rights reserved.
  8. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  9. this file except in compliance with the License. You may obtain a copy of the
  10. License at http://www.apache.org/licenses/LICENSE-2.0
  11. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  13. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  14. MERCHANTABLITY OR NON-INFRINGEMENT.
  15. See the Apache Version 2.0 License for specific language governing permissions
  16. and limitations under the License.
  17. ***************************************************************************** */
  18. /* global Reflect, Promise */
  19. var extendStatics = function(d, b) {
  20. extendStatics = Object.setPrototypeOf ||
  21. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  22. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  23. return extendStatics(d, b);
  24. };
  25. function __extends(d, b) {
  26. extendStatics(d, b);
  27. function __() { this.constructor = d; }
  28. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  29. }
  30. /**
  31. * @fileoverview added by tsickle
  32. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  33. */
  34. var TimepickerActions = /** @class */ (function () {
  35. function TimepickerActions() {
  36. }
  37. /**
  38. * @param {?} value
  39. * @return {?}
  40. */
  41. TimepickerActions.prototype.writeValue = /**
  42. * @param {?} value
  43. * @return {?}
  44. */
  45. function (value) {
  46. return {
  47. type: TimepickerActions.WRITE_VALUE,
  48. payload: value
  49. };
  50. };
  51. /**
  52. * @param {?} event
  53. * @return {?}
  54. */
  55. TimepickerActions.prototype.changeHours = /**
  56. * @param {?} event
  57. * @return {?}
  58. */
  59. function (event) {
  60. return {
  61. type: TimepickerActions.CHANGE_HOURS,
  62. payload: event
  63. };
  64. };
  65. /**
  66. * @param {?} event
  67. * @return {?}
  68. */
  69. TimepickerActions.prototype.changeMinutes = /**
  70. * @param {?} event
  71. * @return {?}
  72. */
  73. function (event) {
  74. return {
  75. type: TimepickerActions.CHANGE_MINUTES,
  76. payload: event
  77. };
  78. };
  79. /**
  80. * @param {?} event
  81. * @return {?}
  82. */
  83. TimepickerActions.prototype.changeSeconds = /**
  84. * @param {?} event
  85. * @return {?}
  86. */
  87. function (event) {
  88. return {
  89. type: TimepickerActions.CHANGE_SECONDS,
  90. payload: event
  91. };
  92. };
  93. /**
  94. * @param {?} value
  95. * @return {?}
  96. */
  97. TimepickerActions.prototype.setTime = /**
  98. * @param {?} value
  99. * @return {?}
  100. */
  101. function (value) {
  102. return {
  103. type: TimepickerActions.SET_TIME_UNIT,
  104. payload: value
  105. };
  106. };
  107. /**
  108. * @param {?} value
  109. * @return {?}
  110. */
  111. TimepickerActions.prototype.updateControls = /**
  112. * @param {?} value
  113. * @return {?}
  114. */
  115. function (value) {
  116. return {
  117. type: TimepickerActions.UPDATE_CONTROLS,
  118. payload: value
  119. };
  120. };
  121. TimepickerActions.WRITE_VALUE = '[timepicker] write value from ng model';
  122. TimepickerActions.CHANGE_HOURS = '[timepicker] change hours';
  123. TimepickerActions.CHANGE_MINUTES = '[timepicker] change minutes';
  124. TimepickerActions.CHANGE_SECONDS = '[timepicker] change seconds';
  125. TimepickerActions.SET_TIME_UNIT = '[timepicker] set time unit';
  126. TimepickerActions.UPDATE_CONTROLS = '[timepicker] update controls';
  127. TimepickerActions.decorators = [
  128. { type: core.Injectable }
  129. ];
  130. return TimepickerActions;
  131. }());
  132. /**
  133. * @fileoverview added by tsickle
  134. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  135. */
  136. /** @type {?} */
  137. var dex = 10;
  138. /** @type {?} */
  139. var hoursPerDay = 24;
  140. /** @type {?} */
  141. var hoursPerDayHalf = 12;
  142. /** @type {?} */
  143. var minutesPerHour = 60;
  144. /** @type {?} */
  145. var secondsPerMinute = 60;
  146. /**
  147. * @param {?=} value
  148. * @return {?}
  149. */
  150. function isValidDate(value) {
  151. if (!value) {
  152. return false;
  153. }
  154. if (value instanceof Date && isNaN(value.getHours())) {
  155. return false;
  156. }
  157. if (typeof value === 'string') {
  158. return isValidDate(new Date(value));
  159. }
  160. return true;
  161. }
  162. /**
  163. * @param {?} controls
  164. * @param {?} newDate
  165. * @return {?}
  166. */
  167. function isValidLimit(controls, newDate) {
  168. if (controls.min && newDate < controls.min) {
  169. return false;
  170. }
  171. if (controls.max && newDate > controls.max) {
  172. return false;
  173. }
  174. return true;
  175. }
  176. /**
  177. * @param {?} value
  178. * @return {?}
  179. */
  180. function toNumber(value) {
  181. if (typeof value === 'number') {
  182. return value;
  183. }
  184. return parseInt(value, dex);
  185. }
  186. /**
  187. * @param {?} value
  188. * @param {?=} isPM
  189. * @return {?}
  190. */
  191. function parseHours(value, isPM) {
  192. if (isPM === void 0) { isPM = false; }
  193. /** @type {?} */
  194. var hour = toNumber(value);
  195. if (isNaN(hour) ||
  196. hour < 0 ||
  197. hour > (isPM ? hoursPerDayHalf : hoursPerDay)) {
  198. return NaN;
  199. }
  200. return hour;
  201. }
  202. /**
  203. * @param {?} value
  204. * @return {?}
  205. */
  206. function parseMinutes(value) {
  207. /** @type {?} */
  208. var minute = toNumber(value);
  209. if (isNaN(minute) || minute < 0 || minute > minutesPerHour) {
  210. return NaN;
  211. }
  212. return minute;
  213. }
  214. /**
  215. * @param {?} value
  216. * @return {?}
  217. */
  218. function parseSeconds(value) {
  219. /** @type {?} */
  220. var seconds = toNumber(value);
  221. if (isNaN(seconds) || seconds < 0 || seconds > secondsPerMinute) {
  222. return NaN;
  223. }
  224. return seconds;
  225. }
  226. /**
  227. * @param {?} value
  228. * @return {?}
  229. */
  230. function parseTime(value) {
  231. if (typeof value === 'string') {
  232. return new Date(value);
  233. }
  234. return value;
  235. }
  236. /**
  237. * @param {?} value
  238. * @param {?} diff
  239. * @return {?}
  240. */
  241. function changeTime(value, diff) {
  242. if (!value) {
  243. return changeTime(createDate(new Date(), 0, 0, 0), diff);
  244. }
  245. /** @type {?} */
  246. var hour = value.getHours();
  247. /** @type {?} */
  248. var minutes = value.getMinutes();
  249. /** @type {?} */
  250. var seconds = value.getSeconds();
  251. if (diff.hour) {
  252. hour = (hour + toNumber(diff.hour)) % hoursPerDay;
  253. if (hour < 0) {
  254. hour += hoursPerDay;
  255. }
  256. }
  257. if (diff.minute) {
  258. minutes = minutes + toNumber(diff.minute);
  259. }
  260. if (diff.seconds) {
  261. seconds = seconds + toNumber(diff.seconds);
  262. }
  263. return createDate(value, hour, minutes, seconds);
  264. }
  265. /**
  266. * @param {?} value
  267. * @param {?} opts
  268. * @return {?}
  269. */
  270. function setTime(value, opts) {
  271. /** @type {?} */
  272. var hour = parseHours(opts.hour);
  273. /** @type {?} */
  274. var minute = parseMinutes(opts.minute);
  275. /** @type {?} */
  276. var seconds = parseSeconds(opts.seconds) || 0;
  277. if (opts.isPM && hour !== 12) {
  278. hour += hoursPerDayHalf;
  279. }
  280. if (!value) {
  281. if (!isNaN(hour) && !isNaN(minute)) {
  282. return createDate(new Date(), hour, minute, seconds);
  283. }
  284. return value;
  285. }
  286. if (isNaN(hour) || isNaN(minute)) {
  287. return value;
  288. }
  289. return createDate(value, hour, minute, seconds);
  290. }
  291. /**
  292. * @param {?} value
  293. * @param {?} hours
  294. * @param {?} minutes
  295. * @param {?} seconds
  296. * @return {?}
  297. */
  298. function createDate(value, hours, minutes, seconds) {
  299. return new Date(value.getFullYear(), value.getMonth(), value.getDate(), hours, minutes, seconds, value.getMilliseconds());
  300. }
  301. /**
  302. * @param {?} value
  303. * @return {?}
  304. */
  305. function padNumber(value) {
  306. /** @type {?} */
  307. var _value = value.toString();
  308. if (_value.length > 1) {
  309. return _value;
  310. }
  311. return "0" + _value;
  312. }
  313. /**
  314. * @param {?} hours
  315. * @param {?} isPM
  316. * @return {?}
  317. */
  318. function isHourInputValid(hours, isPM) {
  319. return !isNaN(parseHours(hours, isPM));
  320. }
  321. /**
  322. * @param {?} minutes
  323. * @return {?}
  324. */
  325. function isMinuteInputValid(minutes) {
  326. return !isNaN(parseMinutes(minutes));
  327. }
  328. /**
  329. * @param {?} seconds
  330. * @return {?}
  331. */
  332. function isSecondInputValid(seconds) {
  333. return !isNaN(parseSeconds(seconds));
  334. }
  335. /**
  336. * @param {?} diff
  337. * @param {?} max
  338. * @param {?} min
  339. * @return {?}
  340. */
  341. function isInputLimitValid(diff, max, min) {
  342. /** @type {?} */
  343. var newDate = setTime(new Date(), diff);
  344. if (max && newDate > max) {
  345. return false;
  346. }
  347. if (min && newDate < min) {
  348. return false;
  349. }
  350. return true;
  351. }
  352. /**
  353. * @param {?} hours
  354. * @param {?=} minutes
  355. * @param {?=} seconds
  356. * @param {?=} isPM
  357. * @return {?}
  358. */
  359. function isInputValid(hours, minutes, seconds, isPM) {
  360. if (minutes === void 0) { minutes = '0'; }
  361. if (seconds === void 0) { seconds = '0'; }
  362. return isHourInputValid(hours, isPM)
  363. && isMinuteInputValid(minutes)
  364. && isSecondInputValid(seconds);
  365. }
  366. /**
  367. * @fileoverview added by tsickle
  368. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  369. */
  370. /**
  371. * @param {?} state
  372. * @param {?=} event
  373. * @return {?}
  374. */
  375. function canChangeValue(state, event) {
  376. if (state.readonlyInput || state.disabled) {
  377. return false;
  378. }
  379. if (event) {
  380. if (event.source === 'wheel' && !state.mousewheel) {
  381. return false;
  382. }
  383. if (event.source === 'key' && !state.arrowkeys) {
  384. return false;
  385. }
  386. }
  387. return true;
  388. }
  389. /**
  390. * @param {?} event
  391. * @param {?} controls
  392. * @return {?}
  393. */
  394. function canChangeHours(event, controls) {
  395. if (!event.step) {
  396. return false;
  397. }
  398. if (event.step > 0 && !controls.canIncrementHours) {
  399. return false;
  400. }
  401. if (event.step < 0 && !controls.canDecrementHours) {
  402. return false;
  403. }
  404. return true;
  405. }
  406. /**
  407. * @param {?} event
  408. * @param {?} controls
  409. * @return {?}
  410. */
  411. function canChangeMinutes(event, controls) {
  412. if (!event.step) {
  413. return false;
  414. }
  415. if (event.step > 0 && !controls.canIncrementMinutes) {
  416. return false;
  417. }
  418. if (event.step < 0 && !controls.canDecrementMinutes) {
  419. return false;
  420. }
  421. return true;
  422. }
  423. /**
  424. * @param {?} event
  425. * @param {?} controls
  426. * @return {?}
  427. */
  428. function canChangeSeconds(event, controls) {
  429. if (!event.step) {
  430. return false;
  431. }
  432. if (event.step > 0 && !controls.canIncrementSeconds) {
  433. return false;
  434. }
  435. if (event.step < 0 && !controls.canDecrementSeconds) {
  436. return false;
  437. }
  438. return true;
  439. }
  440. /**
  441. * @param {?} state
  442. * @return {?}
  443. */
  444. function getControlsValue(state) {
  445. var hourStep = state.hourStep, minuteStep = state.minuteStep, secondsStep = state.secondsStep, readonlyInput = state.readonlyInput, disabled = state.disabled, mousewheel = state.mousewheel, arrowkeys = state.arrowkeys, showSpinners = state.showSpinners, showMeridian = state.showMeridian, showSeconds = state.showSeconds, meridians = state.meridians, min = state.min, max = state.max;
  446. return {
  447. hourStep: hourStep,
  448. minuteStep: minuteStep,
  449. secondsStep: secondsStep,
  450. readonlyInput: readonlyInput,
  451. disabled: disabled,
  452. mousewheel: mousewheel,
  453. arrowkeys: arrowkeys,
  454. showSpinners: showSpinners,
  455. showMeridian: showMeridian,
  456. showSeconds: showSeconds,
  457. meridians: meridians,
  458. min: min,
  459. max: max
  460. };
  461. }
  462. /**
  463. * @param {?} value
  464. * @param {?} state
  465. * @return {?}
  466. */
  467. function timepickerControls(value, state) {
  468. /** @type {?} */
  469. var hoursPerDayHalf = 12;
  470. var min = state.min, max = state.max, hourStep = state.hourStep, minuteStep = state.minuteStep, secondsStep = state.secondsStep, showSeconds = state.showSeconds;
  471. /** @type {?} */
  472. var res = {
  473. canIncrementHours: true,
  474. canIncrementMinutes: true,
  475. canIncrementSeconds: true,
  476. canDecrementHours: true,
  477. canDecrementMinutes: true,
  478. canDecrementSeconds: true,
  479. canToggleMeridian: true
  480. };
  481. if (!value) {
  482. return res;
  483. }
  484. // compare dates
  485. if (max) {
  486. /** @type {?} */
  487. var _newHour = changeTime(value, { hour: hourStep });
  488. res.canIncrementHours = max > _newHour;
  489. if (!res.canIncrementHours) {
  490. /** @type {?} */
  491. var _newMinutes = changeTime(value, { minute: minuteStep });
  492. res.canIncrementMinutes = showSeconds
  493. ? max > _newMinutes
  494. : max >= _newMinutes;
  495. }
  496. if (!res.canIncrementMinutes) {
  497. /** @type {?} */
  498. var _newSeconds = changeTime(value, { seconds: secondsStep });
  499. res.canIncrementSeconds = max >= _newSeconds;
  500. }
  501. if (value.getHours() < hoursPerDayHalf) {
  502. res.canToggleMeridian = changeTime(value, { hour: hoursPerDayHalf }) < max;
  503. }
  504. }
  505. if (min) {
  506. /** @type {?} */
  507. var _newHour = changeTime(value, { hour: -hourStep });
  508. res.canDecrementHours = min < _newHour;
  509. if (!res.canDecrementHours) {
  510. /** @type {?} */
  511. var _newMinutes = changeTime(value, { minute: -minuteStep });
  512. res.canDecrementMinutes = showSeconds
  513. ? min < _newMinutes
  514. : min <= _newMinutes;
  515. }
  516. if (!res.canDecrementMinutes) {
  517. /** @type {?} */
  518. var _newSeconds = changeTime(value, { seconds: -secondsStep });
  519. res.canDecrementSeconds = min <= _newSeconds;
  520. }
  521. if (value.getHours() >= hoursPerDayHalf) {
  522. res.canToggleMeridian = changeTime(value, { hour: -hoursPerDayHalf }) > min;
  523. }
  524. }
  525. return res;
  526. }
  527. /**
  528. * @fileoverview added by tsickle
  529. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  530. */
  531. /**
  532. * Provides default configuration values for timepicker
  533. */
  534. var TimepickerConfig = /** @class */ (function () {
  535. function TimepickerConfig() {
  536. /**
  537. * hours change step
  538. */
  539. this.hourStep = 1;
  540. /**
  541. * hours change step
  542. */
  543. this.minuteStep = 5;
  544. /**
  545. * seconds changes step
  546. */
  547. this.secondsStep = 10;
  548. /**
  549. * if true works in 12H mode and displays AM/PM. If false works in 24H mode and hides AM/PM
  550. */
  551. this.showMeridian = true;
  552. /**
  553. * meridian labels based on locale
  554. */
  555. this.meridians = ['AM', 'PM'];
  556. /**
  557. * if true hours and minutes fields will be readonly
  558. */
  559. this.readonlyInput = false;
  560. /**
  561. * if true hours and minutes fields will be disabled
  562. */
  563. this.disabled = false;
  564. /**
  565. * if true scroll inside hours and minutes inputs will change time
  566. */
  567. this.mousewheel = true;
  568. /**
  569. * if true the values of hours and minutes can be changed using the up/down arrow keys on the keyboard
  570. */
  571. this.arrowkeys = true;
  572. /**
  573. * if true spinner arrows above and below the inputs will be shown
  574. */
  575. this.showSpinners = true;
  576. /**
  577. * show seconds in timepicker
  578. */
  579. this.showSeconds = false;
  580. /**
  581. * show minutes in timepicker
  582. */
  583. this.showMinutes = true;
  584. /**
  585. * placeholder for hours field in timepicker
  586. */
  587. this.hoursPlaceholder = 'HH';
  588. /**
  589. * placeholder for minutes field in timepicker
  590. */
  591. this.minutesPlaceholder = 'MM';
  592. /**
  593. * placeholder for seconds field in timepicker
  594. */
  595. this.secondsPlaceholder = 'SS';
  596. }
  597. TimepickerConfig.decorators = [
  598. { type: core.Injectable }
  599. ];
  600. return TimepickerConfig;
  601. }());
  602. /**
  603. * @fileoverview added by tsickle
  604. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  605. */
  606. /** @type {?} */
  607. var initialState = {
  608. value: null,
  609. config: new TimepickerConfig(),
  610. controls: {
  611. canIncrementHours: true,
  612. canIncrementMinutes: true,
  613. canIncrementSeconds: true,
  614. canDecrementHours: true,
  615. canDecrementMinutes: true,
  616. canDecrementSeconds: true,
  617. canToggleMeridian: true
  618. }
  619. };
  620. // tslint:disable-next-line:cyclomatic-complexity
  621. /**
  622. * @param {?=} state
  623. * @param {?=} action
  624. * @return {?}
  625. */
  626. function timepickerReducer(state, action) {
  627. if (state === void 0) { state = initialState; }
  628. switch (action.type) {
  629. case TimepickerActions.WRITE_VALUE: {
  630. return Object.assign({}, state, { value: action.payload });
  631. }
  632. case TimepickerActions.CHANGE_HOURS: {
  633. if (!canChangeValue(state.config, action.payload) ||
  634. !canChangeHours(action.payload, state.controls)) {
  635. return state;
  636. }
  637. /** @type {?} */
  638. var _newTime = changeTime(state.value, { hour: action.payload.step });
  639. if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {
  640. return state;
  641. }
  642. return Object.assign({}, state, { value: _newTime });
  643. }
  644. case TimepickerActions.CHANGE_MINUTES: {
  645. if (!canChangeValue(state.config, action.payload) ||
  646. !canChangeMinutes(action.payload, state.controls)) {
  647. return state;
  648. }
  649. /** @type {?} */
  650. var _newTime = changeTime(state.value, { minute: action.payload.step });
  651. if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {
  652. return state;
  653. }
  654. return Object.assign({}, state, { value: _newTime });
  655. }
  656. case TimepickerActions.CHANGE_SECONDS: {
  657. if (!canChangeValue(state.config, action.payload) ||
  658. !canChangeSeconds(action.payload, state.controls)) {
  659. return state;
  660. }
  661. /** @type {?} */
  662. var _newTime = changeTime(state.value, {
  663. seconds: action.payload.step
  664. });
  665. if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {
  666. return state;
  667. }
  668. return Object.assign({}, state, { value: _newTime });
  669. }
  670. case TimepickerActions.SET_TIME_UNIT: {
  671. if (!canChangeValue(state.config)) {
  672. return state;
  673. }
  674. /** @type {?} */
  675. var _newTime = setTime(state.value, action.payload);
  676. return Object.assign({}, state, { value: _newTime });
  677. }
  678. case TimepickerActions.UPDATE_CONTROLS: {
  679. /** @type {?} */
  680. var _newControlsState = timepickerControls(state.value, action.payload);
  681. /** @type {?} */
  682. var _newState = {
  683. value: state.value,
  684. config: action.payload,
  685. controls: _newControlsState
  686. };
  687. if (state.config.showMeridian !== _newState.config.showMeridian) {
  688. if (state.value) {
  689. _newState.value = new Date(state.value);
  690. }
  691. }
  692. return Object.assign({}, state, _newState);
  693. }
  694. default:
  695. return state;
  696. }
  697. }
  698. /**
  699. * @fileoverview added by tsickle
  700. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  701. */
  702. var TimepickerStore = /** @class */ (function (_super) {
  703. __extends(TimepickerStore, _super);
  704. function TimepickerStore() {
  705. var _this = this;
  706. /** @type {?} */
  707. var _dispatcher = new rxjs.BehaviorSubject({
  708. type: '[mini-ngrx] dispatcher init'
  709. });
  710. /** @type {?} */
  711. var state = new miniNgrx.MiniState(initialState, _dispatcher, timepickerReducer);
  712. _this = _super.call(this, _dispatcher, timepickerReducer, state) || this;
  713. return _this;
  714. }
  715. TimepickerStore.decorators = [
  716. { type: core.Injectable }
  717. ];
  718. /** @nocollapse */
  719. TimepickerStore.ctorParameters = function () { return []; };
  720. return TimepickerStore;
  721. }(miniNgrx.MiniStore));
  722. /**
  723. * @fileoverview added by tsickle
  724. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  725. */
  726. /** @type {?} */
  727. var TIMEPICKER_CONTROL_VALUE_ACCESSOR = {
  728. provide: forms.NG_VALUE_ACCESSOR,
  729. /* tslint:disable-next-line: no-use-before-declare */
  730. useExisting: core.forwardRef((/**
  731. * @return {?}
  732. */
  733. function () { return TimepickerComponent; })),
  734. multi: true
  735. };
  736. var TimepickerComponent = /** @class */ (function () {
  737. function TimepickerComponent(_config, _cd, _store, _timepickerActions) {
  738. var _this = this;
  739. this._cd = _cd;
  740. this._store = _store;
  741. this._timepickerActions = _timepickerActions;
  742. /**
  743. * emits true if value is a valid date
  744. */
  745. this.isValid = new core.EventEmitter();
  746. // min\max validation for input fields
  747. this.invalidHours = false;
  748. this.invalidMinutes = false;
  749. this.invalidSeconds = false;
  750. // control value accessor methods
  751. // tslint:disable-next-line:no-any
  752. this.onChange = Function.prototype;
  753. // tslint:disable-next-line:no-any
  754. this.onTouched = Function.prototype;
  755. Object.assign(this, _config);
  756. this.timepickerSub = _store
  757. .select((/**
  758. * @param {?} state
  759. * @return {?}
  760. */
  761. function (state) { return state.value; }))
  762. .subscribe((/**
  763. * @param {?} value
  764. * @return {?}
  765. */
  766. function (value) {
  767. // update UI values if date changed
  768. _this._renderTime(value);
  769. _this.onChange(value);
  770. _this._store.dispatch(_this._timepickerActions.updateControls(getControlsValue(_this)));
  771. }));
  772. _store
  773. .select((/**
  774. * @param {?} state
  775. * @return {?}
  776. */
  777. function (state) { return state.controls; }))
  778. .subscribe((/**
  779. * @param {?} controlsState
  780. * @return {?}
  781. */
  782. function (controlsState) {
  783. _this.isValid.emit(isInputValid(_this.hours, _this.minutes, _this.seconds, _this.isPM()));
  784. Object.assign(_this, controlsState);
  785. _cd.markForCheck();
  786. }));
  787. }
  788. Object.defineProperty(TimepickerComponent.prototype, "isSpinnersVisible", {
  789. /** @deprecated - please use `isEditable` instead */
  790. get: /**
  791. * @deprecated - please use `isEditable` instead
  792. * @return {?}
  793. */
  794. function () {
  795. return this.showSpinners && !this.readonlyInput;
  796. },
  797. enumerable: true,
  798. configurable: true
  799. });
  800. Object.defineProperty(TimepickerComponent.prototype, "isEditable", {
  801. get: /**
  802. * @return {?}
  803. */
  804. function () {
  805. return !(this.readonlyInput || this.disabled);
  806. },
  807. enumerable: true,
  808. configurable: true
  809. });
  810. /**
  811. * @return {?}
  812. */
  813. TimepickerComponent.prototype.resetValidation = /**
  814. * @return {?}
  815. */
  816. function () {
  817. this.invalidHours = false;
  818. this.invalidMinutes = false;
  819. this.invalidSeconds = false;
  820. };
  821. /**
  822. * @return {?}
  823. */
  824. TimepickerComponent.prototype.isPM = /**
  825. * @return {?}
  826. */
  827. function () {
  828. return this.showMeridian && this.meridian === this.meridians[1];
  829. };
  830. /**
  831. * @param {?} $event
  832. * @return {?}
  833. */
  834. TimepickerComponent.prototype.prevDef = /**
  835. * @param {?} $event
  836. * @return {?}
  837. */
  838. function ($event) {
  839. $event.preventDefault();
  840. };
  841. /**
  842. * @param {?} $event
  843. * @return {?}
  844. */
  845. TimepickerComponent.prototype.wheelSign = /**
  846. * @param {?} $event
  847. * @return {?}
  848. */
  849. function ($event) {
  850. return Math.sign($event.deltaY) * -1;
  851. };
  852. /**
  853. * @param {?} changes
  854. * @return {?}
  855. */
  856. TimepickerComponent.prototype.ngOnChanges = /**
  857. * @param {?} changes
  858. * @return {?}
  859. */
  860. function (changes) {
  861. this._store.dispatch(this._timepickerActions.updateControls(getControlsValue(this)));
  862. };
  863. /**
  864. * @param {?} step
  865. * @param {?=} source
  866. * @return {?}
  867. */
  868. TimepickerComponent.prototype.changeHours = /**
  869. * @param {?} step
  870. * @param {?=} source
  871. * @return {?}
  872. */
  873. function (step, source) {
  874. if (source === void 0) { source = ''; }
  875. this.resetValidation();
  876. this._store.dispatch(this._timepickerActions.changeHours({ step: step, source: source }));
  877. };
  878. /**
  879. * @param {?} step
  880. * @param {?=} source
  881. * @return {?}
  882. */
  883. TimepickerComponent.prototype.changeMinutes = /**
  884. * @param {?} step
  885. * @param {?=} source
  886. * @return {?}
  887. */
  888. function (step, source) {
  889. if (source === void 0) { source = ''; }
  890. this.resetValidation();
  891. this._store.dispatch(this._timepickerActions.changeMinutes({ step: step, source: source }));
  892. };
  893. /**
  894. * @param {?} step
  895. * @param {?=} source
  896. * @return {?}
  897. */
  898. TimepickerComponent.prototype.changeSeconds = /**
  899. * @param {?} step
  900. * @param {?=} source
  901. * @return {?}
  902. */
  903. function (step, source) {
  904. if (source === void 0) { source = ''; }
  905. this.resetValidation();
  906. this._store.dispatch(this._timepickerActions.changeSeconds({ step: step, source: source }));
  907. };
  908. /**
  909. * @param {?} hours
  910. * @return {?}
  911. */
  912. TimepickerComponent.prototype.updateHours = /**
  913. * @param {?} hours
  914. * @return {?}
  915. */
  916. function (hours) {
  917. this.resetValidation();
  918. this.hours = hours;
  919. /** @type {?} */
  920. var isValid = isHourInputValid(this.hours, this.isPM()) && this.isValidLimit();
  921. if (!isValid) {
  922. this.invalidHours = true;
  923. this.isValid.emit(false);
  924. this.onChange(null);
  925. return;
  926. }
  927. this._updateTime();
  928. };
  929. /**
  930. * @param {?} minutes
  931. * @return {?}
  932. */
  933. TimepickerComponent.prototype.updateMinutes = /**
  934. * @param {?} minutes
  935. * @return {?}
  936. */
  937. function (minutes) {
  938. this.resetValidation();
  939. this.minutes = minutes;
  940. /** @type {?} */
  941. var isValid = isMinuteInputValid(this.minutes) && this.isValidLimit();
  942. if (!isValid) {
  943. this.invalidMinutes = true;
  944. this.isValid.emit(false);
  945. this.onChange(null);
  946. return;
  947. }
  948. this._updateTime();
  949. };
  950. /**
  951. * @param {?} seconds
  952. * @return {?}
  953. */
  954. TimepickerComponent.prototype.updateSeconds = /**
  955. * @param {?} seconds
  956. * @return {?}
  957. */
  958. function (seconds) {
  959. this.resetValidation();
  960. this.seconds = seconds;
  961. /** @type {?} */
  962. var isValid = isSecondInputValid(this.seconds) && this.isValidLimit();
  963. if (!isValid) {
  964. this.invalidSeconds = true;
  965. this.isValid.emit(false);
  966. this.onChange(null);
  967. return;
  968. }
  969. this._updateTime();
  970. };
  971. /**
  972. * @return {?}
  973. */
  974. TimepickerComponent.prototype.isValidLimit = /**
  975. * @return {?}
  976. */
  977. function () {
  978. return isInputLimitValid({
  979. hour: this.hours,
  980. minute: this.minutes,
  981. seconds: this.seconds,
  982. isPM: this.isPM()
  983. }, this.max, this.min);
  984. };
  985. /**
  986. * @return {?}
  987. */
  988. TimepickerComponent.prototype._updateTime = /**
  989. * @return {?}
  990. */
  991. function () {
  992. /** @type {?} */
  993. var _seconds = this.showSeconds ? this.seconds : void 0;
  994. /** @type {?} */
  995. var _minutes = this.showMinutes ? this.minutes : void 0;
  996. if (!isInputValid(this.hours, _minutes, _seconds, this.isPM())) {
  997. this.isValid.emit(false);
  998. this.onChange(null);
  999. return;
  1000. }
  1001. this._store.dispatch(this._timepickerActions.setTime({
  1002. hour: this.hours,
  1003. minute: this.minutes,
  1004. seconds: this.seconds,
  1005. isPM: this.isPM()
  1006. }));
  1007. };
  1008. /**
  1009. * @return {?}
  1010. */
  1011. TimepickerComponent.prototype.toggleMeridian = /**
  1012. * @return {?}
  1013. */
  1014. function () {
  1015. if (!this.showMeridian || !this.isEditable) {
  1016. return;
  1017. }
  1018. /** @type {?} */
  1019. var _hoursPerDayHalf = 12;
  1020. this._store.dispatch(this._timepickerActions.changeHours({
  1021. step: _hoursPerDayHalf,
  1022. source: ''
  1023. }));
  1024. };
  1025. /**
  1026. * Write a new value to the element.
  1027. */
  1028. /**
  1029. * Write a new value to the element.
  1030. * @param {?} obj
  1031. * @return {?}
  1032. */
  1033. TimepickerComponent.prototype.writeValue = /**
  1034. * Write a new value to the element.
  1035. * @param {?} obj
  1036. * @return {?}
  1037. */
  1038. function (obj) {
  1039. if (isValidDate(obj)) {
  1040. this._store.dispatch(this._timepickerActions.writeValue(parseTime(obj)));
  1041. }
  1042. else if (obj == null) {
  1043. this._store.dispatch(this._timepickerActions.writeValue(null));
  1044. }
  1045. };
  1046. /**
  1047. * Set the function to be called when the control receives a change event.
  1048. */
  1049. // tslint:disable-next-line:no-any
  1050. /**
  1051. * Set the function to be called when the control receives a change event.
  1052. * @param {?} fn
  1053. * @return {?}
  1054. */
  1055. // tslint:disable-next-line:no-any
  1056. TimepickerComponent.prototype.registerOnChange = /**
  1057. * Set the function to be called when the control receives a change event.
  1058. * @param {?} fn
  1059. * @return {?}
  1060. */
  1061. // tslint:disable-next-line:no-any
  1062. function (fn) {
  1063. this.onChange = fn;
  1064. };
  1065. /**
  1066. * Set the function to be called when the control receives a touch event.
  1067. */
  1068. /**
  1069. * Set the function to be called when the control receives a touch event.
  1070. * @param {?} fn
  1071. * @return {?}
  1072. */
  1073. TimepickerComponent.prototype.registerOnTouched = /**
  1074. * Set the function to be called when the control receives a touch event.
  1075. * @param {?} fn
  1076. * @return {?}
  1077. */
  1078. function (fn) {
  1079. this.onTouched = fn;
  1080. };
  1081. /**
  1082. * This function is called when the control status changes to or from "disabled".
  1083. * Depending on the value, it will enable or disable the appropriate DOM element.
  1084. *
  1085. * @param isDisabled
  1086. */
  1087. /**
  1088. * This function is called when the control status changes to or from "disabled".
  1089. * Depending on the value, it will enable or disable the appropriate DOM element.
  1090. *
  1091. * @param {?} isDisabled
  1092. * @return {?}
  1093. */
  1094. TimepickerComponent.prototype.setDisabledState = /**
  1095. * This function is called when the control status changes to or from "disabled".
  1096. * Depending on the value, it will enable or disable the appropriate DOM element.
  1097. *
  1098. * @param {?} isDisabled
  1099. * @return {?}
  1100. */
  1101. function (isDisabled) {
  1102. this.disabled = isDisabled;
  1103. this._cd.markForCheck();
  1104. };
  1105. /**
  1106. * @return {?}
  1107. */
  1108. TimepickerComponent.prototype.ngOnDestroy = /**
  1109. * @return {?}
  1110. */
  1111. function () {
  1112. this.timepickerSub.unsubscribe();
  1113. };
  1114. /**
  1115. * @private
  1116. * @param {?} value
  1117. * @return {?}
  1118. */
  1119. TimepickerComponent.prototype._renderTime = /**
  1120. * @private
  1121. * @param {?} value
  1122. * @return {?}
  1123. */
  1124. function (value) {
  1125. if (!isValidDate(value)) {
  1126. this.hours = '';
  1127. this.minutes = '';
  1128. this.seconds = '';
  1129. this.meridian = this.meridians[0];
  1130. return;
  1131. }
  1132. /** @type {?} */
  1133. var _value = parseTime(value);
  1134. /** @type {?} */
  1135. var _hoursPerDayHalf = 12;
  1136. /** @type {?} */
  1137. var _hours = _value.getHours();
  1138. if (this.showMeridian) {
  1139. this.meridian = this.meridians[_hours >= _hoursPerDayHalf ? 1 : 0];
  1140. _hours = _hours % _hoursPerDayHalf;
  1141. // should be 12 PM, not 00 PM
  1142. if (_hours === 0) {
  1143. _hours = _hoursPerDayHalf;
  1144. }
  1145. }
  1146. this.hours = padNumber(_hours);
  1147. this.minutes = padNumber(_value.getMinutes());
  1148. this.seconds = padNumber(_value.getUTCSeconds());
  1149. };
  1150. TimepickerComponent.decorators = [
  1151. { type: core.Component, args: [{
  1152. selector: 'timepicker',
  1153. changeDetection: core.ChangeDetectionStrategy.OnPush,
  1154. providers: [TIMEPICKER_CONTROL_VALUE_ACCESSOR, TimepickerStore],
  1155. template: "<table>\n <tbody>\n <tr class=\"text-center\" [hidden]=\"!showSpinners\">\n <!-- increment hours button-->\n <td>\n <a class=\"btn btn-link\" [class.disabled]=\"!canIncrementHours || !isEditable\"\n (click)=\"changeHours(hourStep)\"\n ><span class=\"bs-chevron bs-chevron-up\"></span></a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showMinutes\">&nbsp;&nbsp;&nbsp;</td>\n <!-- increment minutes button -->\n <td *ngIf=\"showMinutes\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canIncrementMinutes || !isEditable\"\n (click)=\"changeMinutes(minuteStep)\"\n ><span class=\"bs-chevron bs-chevron-up\"></span></a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showSeconds\">&nbsp;</td>\n <!-- increment seconds button -->\n <td *ngIf=\"showSeconds\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canIncrementSeconds || !isEditable\"\n (click)=\"changeSeconds(secondsStep)\">\n <span class=\"bs-chevron bs-chevron-up\"></span>\n </a>\n </td>\n <!-- space between -->\n <td *ngIf=\"showMeridian\">&nbsp;&nbsp;&nbsp;</td>\n <!-- meridian placeholder-->\n <td *ngIf=\"showMeridian\"></td>\n </tr>\n <tr>\n <!-- hours -->\n <td class=\"form-group\" [class.has-error]=\"invalidHours\">\n <input type=\"text\" [class.is-invalid]=\"invalidHours\"\n class=\"form-control text-center bs-timepicker-field\"\n [placeholder]=\"hoursPlaceholder\"\n maxlength=\"2\"\n [readonly]=\"readonlyInput\"\n [disabled]=\"disabled\"\n [value]=\"hours\"\n (wheel)=\"prevDef($event);changeHours(hourStep * wheelSign($event), 'wheel')\"\n (keydown.ArrowUp)=\"changeHours(hourStep, 'key')\"\n (keydown.ArrowDown)=\"changeHours(-hourStep, 'key')\"\n (change)=\"updateHours($event.target.value)\"></td>\n <!-- divider -->\n <td *ngIf=\"showMinutes\">&nbsp;:&nbsp;</td>\n <!-- minutes -->\n <td class=\"form-group\" *ngIf=\"showMinutes\" [class.has-error]=\"invalidMinutes\">\n <input type=\"text\" [class.is-invalid]=\"invalidMinutes\"\n class=\"form-control text-center bs-timepicker-field\"\n [placeholder]=\"minutesPlaceholder\"\n maxlength=\"2\"\n [readonly]=\"readonlyInput\"\n [disabled]=\"disabled\"\n [value]=\"minutes\"\n (wheel)=\"prevDef($event);changeMinutes(minuteStep * wheelSign($event), 'wheel')\"\n (keydown.ArrowUp)=\"changeMinutes(minuteStep, 'key')\"\n (keydown.ArrowDown)=\"changeMinutes(-minuteStep, 'key')\"\n (change)=\"updateMinutes($event.target.value)\">\n </td>\n <!-- divider -->\n <td *ngIf=\"showSeconds\">&nbsp;:&nbsp;</td>\n <!-- seconds -->\n <td class=\"form-group\" *ngIf=\"showSeconds\" [class.has-error]=\"invalidSeconds\">\n <input type=\"text\" [class.is-invalid]=\"invalidSeconds\"\n class=\"form-control text-center bs-timepicker-field\"\n [placeholder]=\"secondsPlaceholder\"\n maxlength=\"2\"\n [readonly]=\"readonlyInput\"\n [disabled]=\"disabled\"\n [value]=\"seconds\"\n (wheel)=\"prevDef($event);changeSeconds(secondsStep * wheelSign($event), 'wheel')\"\n (keydown.ArrowUp)=\"changeSeconds(secondsStep, 'key')\"\n (keydown.ArrowDown)=\"changeSeconds(-secondsStep, 'key')\"\n (change)=\"updateSeconds($event.target.value)\">\n </td>\n <!-- space between -->\n <td *ngIf=\"showMeridian\">&nbsp;&nbsp;&nbsp;</td>\n <!-- meridian -->\n <td *ngIf=\"showMeridian\">\n <button type=\"button\" class=\"btn btn-default text-center\"\n [disabled]=\"!isEditable || !canToggleMeridian\"\n [class.disabled]=\"!isEditable || !canToggleMeridian\"\n (click)=\"toggleMeridian()\"\n >{{ meridian }}\n </button>\n </td>\n </tr>\n <tr class=\"text-center\" [hidden]=\"!showSpinners\">\n <!-- decrement hours button-->\n <td>\n <a class=\"btn btn-link\" [class.disabled]=\"!canDecrementHours || !isEditable\"\n (click)=\"changeHours(-hourStep)\">\n <span class=\"bs-chevron bs-chevron-down\"></span>\n </a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showMinutes\">&nbsp;&nbsp;&nbsp;</td>\n <!-- decrement minutes button-->\n <td *ngIf=\"showMinutes\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canDecrementMinutes || !isEditable\"\n (click)=\"changeMinutes(-minuteStep)\">\n <span class=\"bs-chevron bs-chevron-down\"></span>\n </a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showSeconds\">&nbsp;</td>\n <!-- decrement seconds button-->\n <td *ngIf=\"showSeconds\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canDecrementSeconds || !isEditable\"\n (click)=\"changeSeconds(-secondsStep)\">\n <span class=\"bs-chevron bs-chevron-down\"></span>\n </a>\n </td>\n <!-- space between -->\n <td *ngIf=\"showMeridian\">&nbsp;&nbsp;&nbsp;</td>\n <!-- meridian placeholder-->\n <td *ngIf=\"showMeridian\"></td>\n </tr>\n </tbody>\n</table>\n",
  1156. encapsulation: core.ViewEncapsulation.None,
  1157. styles: ["\n .bs-chevron {\n border-style: solid;\n display: block;\n width: 9px;\n height: 9px;\n position: relative;\n border-width: 3px 0px 0 3px;\n }\n\n .bs-chevron-up {\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n top: 2px;\n }\n\n .bs-chevron-down {\n -webkit-transform: rotate(-135deg);\n transform: rotate(-135deg);\n top: -2px;\n }\n\n .bs-timepicker-field {\n width: 50px;\n padding: .375rem .55rem;\n }\n "]
  1158. }] }
  1159. ];
  1160. /** @nocollapse */
  1161. TimepickerComponent.ctorParameters = function () { return [
  1162. { type: TimepickerConfig },
  1163. { type: core.ChangeDetectorRef },
  1164. { type: TimepickerStore },
  1165. { type: TimepickerActions }
  1166. ]; };
  1167. TimepickerComponent.propDecorators = {
  1168. hourStep: [{ type: core.Input }],
  1169. minuteStep: [{ type: core.Input }],
  1170. secondsStep: [{ type: core.Input }],
  1171. readonlyInput: [{ type: core.Input }],
  1172. disabled: [{ type: core.Input }],
  1173. mousewheel: [{ type: core.Input }],
  1174. arrowkeys: [{ type: core.Input }],
  1175. showSpinners: [{ type: core.Input }],
  1176. showMeridian: [{ type: core.Input }],
  1177. showMinutes: [{ type: core.Input }],
  1178. showSeconds: [{ type: core.Input }],
  1179. meridians: [{ type: core.Input }],
  1180. min: [{ type: core.Input }],
  1181. max: [{ type: core.Input }],
  1182. hoursPlaceholder: [{ type: core.Input }],
  1183. minutesPlaceholder: [{ type: core.Input }],
  1184. secondsPlaceholder: [{ type: core.Input }],
  1185. isValid: [{ type: core.Output }]
  1186. };
  1187. return TimepickerComponent;
  1188. }());
  1189. /**
  1190. * @fileoverview added by tsickle
  1191. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1192. */
  1193. var TimepickerModule = /** @class */ (function () {
  1194. function TimepickerModule() {
  1195. }
  1196. /**
  1197. * @return {?}
  1198. */
  1199. TimepickerModule.forRoot = /**
  1200. * @return {?}
  1201. */
  1202. function () {
  1203. return {
  1204. ngModule: TimepickerModule,
  1205. providers: [TimepickerConfig, TimepickerActions, TimepickerStore]
  1206. };
  1207. };
  1208. TimepickerModule.decorators = [
  1209. { type: core.NgModule, args: [{
  1210. imports: [common.CommonModule],
  1211. declarations: [TimepickerComponent],
  1212. exports: [TimepickerComponent]
  1213. },] }
  1214. ];
  1215. return TimepickerModule;
  1216. }());
  1217. exports.TimepickerActions = TimepickerActions;
  1218. exports.TimepickerComponent = TimepickerComponent;
  1219. exports.TimepickerConfig = TimepickerConfig;
  1220. exports.TimepickerModule = TimepickerModule;
  1221. exports.TimepickerStore = TimepickerStore;
  1222. exports.ɵa = TIMEPICKER_CONTROL_VALUE_ACCESSOR;
  1223. Object.defineProperty(exports, '__esModule', { value: true });
  1224. }));
  1225. //# sourceMappingURL=ngx-bootstrap-timepicker.umd.js.map