mis-crystal-design-system 4.0.37 → 4.0.39-test-1

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.
Files changed (112) hide show
  1. package/action-list/mis-crystal-design-system-action-list.metadata.json +1 -1
  2. package/bundles/mis-crystal-design-system-action-list.umd.js +495 -641
  3. package/bundles/mis-crystal-design-system-action-list.umd.js.map +1 -1
  4. package/bundles/mis-crystal-design-system-action-list.umd.min.js +15 -1
  5. package/bundles/mis-crystal-design-system-action-list.umd.min.js.map +1 -1
  6. package/bundles/mis-crystal-design-system-analytics.umd.js +409 -555
  7. package/bundles/mis-crystal-design-system-analytics.umd.js.map +1 -1
  8. package/bundles/mis-crystal-design-system-analytics.umd.min.js +15 -1
  9. package/bundles/mis-crystal-design-system-analytics.umd.min.js.map +1 -1
  10. package/bundles/mis-crystal-design-system-async-search-dropdown.umd.js +1 -5
  11. package/bundles/mis-crystal-design-system-async-search-dropdown.umd.js.map +1 -1
  12. package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js +1 -1
  13. package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js.map +1 -1
  14. package/bundles/mis-crystal-design-system-checkbox.umd.js +1 -1
  15. package/bundles/mis-crystal-design-system-checkbox.umd.min.js +1 -1
  16. package/bundles/mis-crystal-design-system-checkbox.umd.min.js.map +1 -1
  17. package/bundles/mis-crystal-design-system-datepicker_v2.umd.js +690 -836
  18. package/bundles/mis-crystal-design-system-datepicker_v2.umd.js.map +1 -1
  19. package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js +15 -1
  20. package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js.map +1 -1
  21. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js +450 -891
  22. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js.map +1 -1
  23. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js +1 -1
  24. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js.map +1 -1
  25. package/bundles/mis-crystal-design-system-dropdown.umd.js +502 -648
  26. package/bundles/mis-crystal-design-system-dropdown.umd.js.map +1 -1
  27. package/bundles/mis-crystal-design-system-dropdown.umd.min.js +15 -1
  28. package/bundles/mis-crystal-design-system-dropdown.umd.min.js.map +1 -1
  29. package/bundles/mis-crystal-design-system-dynamic-form.umd.js +723 -869
  30. package/bundles/mis-crystal-design-system-dynamic-form.umd.js.map +1 -1
  31. package/bundles/mis-crystal-design-system-dynamic-form.umd.min.js +15 -1
  32. package/bundles/mis-crystal-design-system-dynamic-form.umd.min.js.map +1 -1
  33. package/bundles/mis-crystal-design-system-input.umd.js +1 -1
  34. package/bundles/mis-crystal-design-system-input.umd.min.js +1 -1
  35. package/bundles/mis-crystal-design-system-input.umd.min.js.map +1 -1
  36. package/bundles/mis-crystal-design-system-loader.umd.js +1 -1
  37. package/bundles/mis-crystal-design-system-loader.umd.min.js +1 -1
  38. package/bundles/mis-crystal-design-system-loader.umd.min.js.map +1 -1
  39. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.js +610 -756
  40. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.js.map +1 -1
  41. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.min.js +15 -1
  42. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.min.js.map +1 -1
  43. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.js +623 -769
  44. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.js.map +1 -1
  45. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.min.js +15 -1
  46. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.min.js.map +1 -1
  47. package/bundles/mis-crystal-design-system-ske-loader.umd.js +1 -1
  48. package/bundles/mis-crystal-design-system-ske-loader.umd.min.js +1 -1
  49. package/bundles/mis-crystal-design-system-ske-loader.umd.min.js.map +1 -1
  50. package/bundles/mis-crystal-design-system-specificdatepicker.umd.js +961 -1107
  51. package/bundles/mis-crystal-design-system-specificdatepicker.umd.js.map +1 -1
  52. package/bundles/mis-crystal-design-system-specificdatepicker.umd.min.js +15 -1
  53. package/bundles/mis-crystal-design-system-specificdatepicker.umd.min.js.map +1 -1
  54. package/bundles/mis-crystal-design-system-table.umd.js +768 -914
  55. package/bundles/mis-crystal-design-system-table.umd.js.map +1 -1
  56. package/bundles/mis-crystal-design-system-table.umd.min.js +15 -1
  57. package/bundles/mis-crystal-design-system-table.umd.min.js.map +1 -1
  58. package/bundles/mis-crystal-design-system-timepicker.umd.js +670 -816
  59. package/bundles/mis-crystal-design-system-timepicker.umd.js.map +1 -1
  60. package/bundles/mis-crystal-design-system-timepicker.umd.min.js +15 -1
  61. package/bundles/mis-crystal-design-system-timepicker.umd.min.js.map +1 -1
  62. package/bundles/mis-crystal-design-system-virtual-scroll.umd.js +457 -603
  63. package/bundles/mis-crystal-design-system-virtual-scroll.umd.js.map +1 -1
  64. package/bundles/mis-crystal-design-system-virtual-scroll.umd.min.js +15 -1
  65. package/bundles/mis-crystal-design-system-virtual-scroll.umd.min.js.map +1 -1
  66. package/bundles/mis-crystal-design-system-widgets.umd.js +462 -608
  67. package/bundles/mis-crystal-design-system-widgets.umd.js.map +1 -1
  68. package/bundles/mis-crystal-design-system-widgets.umd.min.js +15 -1
  69. package/bundles/mis-crystal-design-system-widgets.umd.min.js.map +1 -1
  70. package/checkbox/mis-crystal-design-system-checkbox.metadata.json +1 -1
  71. package/datepicker_v2/mis-crystal-design-system-datepicker_v2.metadata.json +1 -1
  72. package/daterangepicker_v2/mis-crystal-design-system-daterangepicker_v2.metadata.json +1 -1
  73. package/dropdown/mis-crystal-design-system-dropdown.metadata.json +1 -1
  74. package/dynamic-form/mis-crystal-design-system-dynamic-form.metadata.json +1 -1
  75. package/esm2015/action-list/action-list.component.js +1 -1
  76. package/esm2015/async-search-dropdown/async-dropdown.component.js +2 -6
  77. package/esm2015/checkbox/checkbox.component.js +1 -1
  78. package/esm2015/datepicker_v2/tz-dp-container/tz-dp-container.component.js +1 -1
  79. package/esm2015/daterangepicker_v2/tz-drp-container/tz-drp-container.component.js +11 -9
  80. package/esm2015/dropdown/dropdown.component.js +1 -1
  81. package/esm2015/dynamic-form/dynamic-form.component.js +1 -1
  82. package/esm2015/input/mis-input.component.js +1 -1
  83. package/esm2015/loader/loader.component.js +1 -1
  84. package/esm2015/multi-select-dropdown/multi-select-dropdown.component.js +1 -1
  85. package/esm2015/nested-multi-select-dropdown/nested-multi-select-dropdown.component.js +1 -1
  86. package/esm2015/ske-loader/ske-loader.component.js +1 -1
  87. package/esm2015/specificdatepicker/tz-sdp-container/tz-sdp-container.component.js +1 -1
  88. package/esm2015/table/table.component.js +1 -1
  89. package/fesm2015/mis-crystal-design-system-action-list.js +1 -1
  90. package/fesm2015/mis-crystal-design-system-async-search-dropdown.js +1 -5
  91. package/fesm2015/mis-crystal-design-system-async-search-dropdown.js.map +1 -1
  92. package/fesm2015/mis-crystal-design-system-checkbox.js +1 -1
  93. package/fesm2015/mis-crystal-design-system-datepicker_v2.js +1 -1
  94. package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js +10 -8
  95. package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js.map +1 -1
  96. package/fesm2015/mis-crystal-design-system-dropdown.js +1 -1
  97. package/fesm2015/mis-crystal-design-system-dynamic-form.js +1 -1
  98. package/fesm2015/mis-crystal-design-system-input.js +1 -1
  99. package/fesm2015/mis-crystal-design-system-loader.js +1 -1
  100. package/fesm2015/mis-crystal-design-system-multi-select-dropdown.js +1 -1
  101. package/fesm2015/mis-crystal-design-system-nested-multi-select-dropdown.js +1 -1
  102. package/fesm2015/mis-crystal-design-system-ske-loader.js +1 -1
  103. package/fesm2015/mis-crystal-design-system-specificdatepicker.js +1 -1
  104. package/fesm2015/mis-crystal-design-system-table.js +1 -1
  105. package/input/mis-crystal-design-system-input.metadata.json +1 -1
  106. package/loader/mis-crystal-design-system-loader.metadata.json +1 -1
  107. package/multi-select-dropdown/mis-crystal-design-system-multi-select-dropdown.metadata.json +1 -1
  108. package/nested-multi-select-dropdown/mis-crystal-design-system-nested-multi-select-dropdown.metadata.json +1 -1
  109. package/package.json +1 -1
  110. package/ske-loader/mis-crystal-design-system-ske-loader.metadata.json +1 -1
  111. package/specificdatepicker/mis-crystal-design-system-specificdatepicker.metadata.json +1 -1
  112. package/table/mis-crystal-design-system-table.metadata.json +1 -1
@@ -1,834 +1,688 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('moment-timezone'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('mis-crystal-design-system/tooltip'), require('@angular/common'), require('@angular/forms')) :
3
- typeof define === 'function' && define.amd ? define('mis-crystal-design-system/timepicker', ['exports', '@angular/core', 'moment-timezone', '@angular/cdk/overlay', '@angular/cdk/portal', 'mis-crystal-design-system/tooltip', '@angular/common', '@angular/forms'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['mis-crystal-design-system'] = global['mis-crystal-design-system'] || {}, global['mis-crystal-design-system'].timepicker = {}), global.ng.core, global.moment, global.ng.cdk.overlay, global.ng.cdk.portal, global['mis-crystal-design-system'].tooltip, global.ng.common, global.ng.forms));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('moment-timezone'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('mis-crystal-design-system/tooltip'), require('@angular/common'), require('@angular/forms')) :
3
+ typeof define === 'function' && define.amd ? define('mis-crystal-design-system/timepicker', ['exports', '@angular/core', 'moment-timezone', '@angular/cdk/overlay', '@angular/cdk/portal', 'mis-crystal-design-system/tooltip', '@angular/common', '@angular/forms'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['mis-crystal-design-system'] = global['mis-crystal-design-system'] || {}, global['mis-crystal-design-system'].timepicker = {}), global.ng.core, global.moment, global.ng.cdk.overlay, global.ng.cdk.portal, global['mis-crystal-design-system'].tooltip, global.ng.common, global.ng.forms));
5
5
  }(this, (function (exports, core, moment, overlay, portal, tooltip, common, forms) { 'use strict';
6
6
 
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () {
17
+ return e[k];
18
+ }
19
+ });
20
+ }
21
+ });
20
22
  }
21
- });
23
+ n['default'] = e;
24
+ return Object.freeze(n);
22
25
  }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
26
 
27
- var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
27
+ var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
28
28
 
29
- /******************************************************************************
30
- Copyright (c) Microsoft Corporation.
29
+ /*! *****************************************************************************
30
+ Copyright (c) Microsoft Corporation.
31
31
 
32
- Permission to use, copy, modify, and/or distribute this software for any
33
- purpose with or without fee is hereby granted.
32
+ Permission to use, copy, modify, and/or distribute this software for any
33
+ purpose with or without fee is hereby granted.
34
34
 
35
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
- PERFORMANCE OF THIS SOFTWARE.
42
- ***************************************************************************** */
43
- /* global Reflect, Promise, SuppressedError, Symbol */
44
- var extendStatics = function (d, b) {
45
- extendStatics = Object.setPrototypeOf ||
46
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
- function (d, b) { for (var p in b)
48
- if (Object.prototype.hasOwnProperty.call(b, p))
49
- d[p] = b[p]; };
50
- return extendStatics(d, b);
51
- };
52
- function __extends(d, b) {
53
- if (typeof b !== "function" && b !== null)
54
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
55
- extendStatics(d, b);
56
- function __() { this.constructor = d; }
57
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58
- }
59
- var __assign = function () {
60
- __assign = Object.assign || function __assign(t) {
61
- for (var s, i = 1, n = arguments.length; i < n; i++) {
62
- s = arguments[i];
63
- for (var p in s)
64
- if (Object.prototype.hasOwnProperty.call(s, p))
65
- t[p] = s[p];
66
- }
67
- return t;
68
- };
69
- return __assign.apply(this, arguments);
70
- };
71
- function __rest(s, e) {
72
- var t = {};
73
- for (var p in s)
74
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
- t[p] = s[p];
76
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
- t[p[i]] = s[p[i]];
80
- }
81
- return t;
82
- }
83
- function __decorate(decorators, target, key, desc) {
84
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
85
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
86
- r = Reflect.decorate(decorators, target, key, desc);
87
- else
88
- for (var i = decorators.length - 1; i >= 0; i--)
89
- if (d = decorators[i])
90
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
91
- return c > 3 && r && Object.defineProperty(target, key, r), r;
92
- }
93
- function __param(paramIndex, decorator) {
94
- return function (target, key) { decorator(target, key, paramIndex); };
95
- }
96
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
97
- function accept(f) { if (f !== void 0 && typeof f !== "function")
98
- throw new TypeError("Function expected"); return f; }
99
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
100
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
101
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
102
- var _, done = false;
103
- for (var i = decorators.length - 1; i >= 0; i--) {
104
- var context = {};
105
- for (var p in contextIn)
106
- context[p] = p === "access" ? {} : contextIn[p];
107
- for (var p in contextIn.access)
108
- context.access[p] = contextIn.access[p];
109
- context.addInitializer = function (f) { if (done)
110
- throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
111
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
112
- if (kind === "accessor") {
113
- if (result === void 0)
114
- continue;
115
- if (result === null || typeof result !== "object")
116
- throw new TypeError("Object expected");
117
- if (_ = accept(result.get))
118
- descriptor.get = _;
119
- if (_ = accept(result.set))
120
- descriptor.set = _;
121
- if (_ = accept(result.init))
122
- initializers.unshift(_);
123
- }
124
- else if (_ = accept(result)) {
125
- if (kind === "field")
126
- initializers.unshift(_);
127
- else
128
- descriptor[key] = _;
129
- }
130
- }
131
- if (target)
132
- Object.defineProperty(target, contextIn.name, descriptor);
133
- done = true;
134
- }
135
- ;
136
- function __runInitializers(thisArg, initializers, value) {
137
- var useValue = arguments.length > 2;
138
- for (var i = 0; i < initializers.length; i++) {
139
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
140
- }
141
- return useValue ? value : void 0;
142
- }
143
- ;
144
- function __propKey(x) {
145
- return typeof x === "symbol" ? x : "".concat(x);
146
- }
147
- ;
148
- function __setFunctionName(f, name, prefix) {
149
- if (typeof name === "symbol")
150
- name = name.description ? "[".concat(name.description, "]") : "";
151
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
152
- }
153
- ;
154
- function __metadata(metadataKey, metadataValue) {
155
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
156
- return Reflect.metadata(metadataKey, metadataValue);
157
- }
158
- function __awaiter(thisArg, _arguments, P, generator) {
159
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
160
- return new (P || (P = Promise))(function (resolve, reject) {
161
- function fulfilled(value) { try {
162
- step(generator.next(value));
163
- }
164
- catch (e) {
165
- reject(e);
166
- } }
167
- function rejected(value) { try {
168
- step(generator["throw"](value));
169
- }
170
- catch (e) {
171
- reject(e);
172
- } }
173
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
174
- step((generator = generator.apply(thisArg, _arguments || [])).next());
175
- });
176
- }
177
- function __generator(thisArg, body) {
178
- var _ = { label: 0, sent: function () { if (t[0] & 1)
179
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
180
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
181
- function verb(n) { return function (v) { return step([n, v]); }; }
182
- function step(op) {
183
- if (f)
184
- throw new TypeError("Generator is already executing.");
185
- while (g && (g = 0, op[0] && (_ = 0)), _)
186
- try {
187
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
188
- return t;
189
- if (y = 0, t)
190
- op = [op[0] & 2, t.value];
191
- switch (op[0]) {
192
- case 0:
193
- case 1:
194
- t = op;
195
- break;
196
- case 4:
197
- _.label++;
198
- return { value: op[1], done: false };
199
- case 5:
200
- _.label++;
201
- y = op[1];
202
- op = [0];
203
- continue;
204
- case 7:
205
- op = _.ops.pop();
206
- _.trys.pop();
207
- continue;
208
- default:
209
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
210
- _ = 0;
211
- continue;
212
- }
213
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
214
- _.label = op[1];
215
- break;
216
- }
217
- if (op[0] === 6 && _.label < t[1]) {
218
- _.label = t[1];
219
- t = op;
220
- break;
221
- }
222
- if (t && _.label < t[2]) {
223
- _.label = t[2];
224
- _.ops.push(op);
225
- break;
226
- }
227
- if (t[2])
228
- _.ops.pop();
229
- _.trys.pop();
230
- continue;
231
- }
232
- op = body.call(thisArg, _);
233
- }
234
- catch (e) {
235
- op = [6, e];
236
- y = 0;
237
- }
238
- finally {
239
- f = t = 0;
240
- }
241
- if (op[0] & 5)
242
- throw op[1];
243
- return { value: op[0] ? op[1] : void 0, done: true };
244
- }
245
- }
246
- var __createBinding = Object.create ? (function (o, m, k, k2) {
247
- if (k2 === undefined)
248
- k2 = k;
249
- var desc = Object.getOwnPropertyDescriptor(m, k);
250
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
251
- desc = { enumerable: true, get: function () { return m[k]; } };
252
- }
253
- Object.defineProperty(o, k2, desc);
254
- }) : (function (o, m, k, k2) {
255
- if (k2 === undefined)
256
- k2 = k;
257
- o[k2] = m[k];
258
- });
259
- function __exportStar(m, o) {
260
- for (var p in m)
261
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
262
- __createBinding(o, m, p);
263
- }
264
- function __values(o) {
265
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
266
- if (m)
267
- return m.call(o);
268
- if (o && typeof o.length === "number")
269
- return {
270
- next: function () {
271
- if (o && i >= o.length)
272
- o = void 0;
273
- return { value: o && o[i++], done: !o };
274
- }
275
- };
276
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
277
- }
278
- function __read(o, n) {
279
- var m = typeof Symbol === "function" && o[Symbol.iterator];
280
- if (!m)
281
- return o;
282
- var i = m.call(o), r, ar = [], e;
283
- try {
284
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
285
- ar.push(r.value);
286
- }
287
- catch (error) {
288
- e = { error: error };
289
- }
290
- finally {
291
- try {
292
- if (r && !r.done && (m = i["return"]))
293
- m.call(i);
294
- }
295
- finally {
296
- if (e)
297
- throw e.error;
298
- }
299
- }
300
- return ar;
301
- }
302
- /** @deprecated */
303
- function __spread() {
304
- for (var ar = [], i = 0; i < arguments.length; i++)
305
- ar = ar.concat(__read(arguments[i]));
306
- return ar;
307
- }
308
- /** @deprecated */
309
- function __spreadArrays() {
310
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
311
- s += arguments[i].length;
312
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
313
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
314
- r[k] = a[j];
315
- return r;
316
- }
317
- function __spreadArray(to, from, pack) {
318
- if (pack || arguments.length === 2)
319
- for (var i = 0, l = from.length, ar; i < l; i++) {
320
- if (ar || !(i in from)) {
321
- if (!ar)
322
- ar = Array.prototype.slice.call(from, 0, i);
323
- ar[i] = from[i];
324
- }
325
- }
326
- return to.concat(ar || Array.prototype.slice.call(from));
327
- }
328
- function __await(v) {
329
- return this instanceof __await ? (this.v = v, this) : new __await(v);
330
- }
331
- function __asyncGenerator(thisArg, _arguments, generator) {
332
- if (!Symbol.asyncIterator)
333
- throw new TypeError("Symbol.asyncIterator is not defined.");
334
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
335
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
336
- function verb(n) { if (g[n])
337
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
338
- function resume(n, v) { try {
339
- step(g[n](v));
340
- }
341
- catch (e) {
342
- settle(q[0][3], e);
343
- } }
344
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
345
- function fulfill(value) { resume("next", value); }
346
- function reject(value) { resume("throw", value); }
347
- function settle(f, v) { if (f(v), q.shift(), q.length)
348
- resume(q[0][0], q[0][1]); }
349
- }
350
- function __asyncDelegator(o) {
351
- var i, p;
352
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
353
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
354
- }
355
- function __asyncValues(o) {
356
- if (!Symbol.asyncIterator)
357
- throw new TypeError("Symbol.asyncIterator is not defined.");
358
- var m = o[Symbol.asyncIterator], i;
359
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
360
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
361
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
362
- }
363
- function __makeTemplateObject(cooked, raw) {
364
- if (Object.defineProperty) {
365
- Object.defineProperty(cooked, "raw", { value: raw });
366
- }
367
- else {
368
- cooked.raw = raw;
369
- }
370
- return cooked;
371
- }
372
- ;
373
- var __setModuleDefault = Object.create ? (function (o, v) {
374
- Object.defineProperty(o, "default", { enumerable: true, value: v });
375
- }) : function (o, v) {
376
- o["default"] = v;
377
- };
378
- function __importStar(mod) {
379
- if (mod && mod.__esModule)
380
- return mod;
381
- var result = {};
382
- if (mod != null)
383
- for (var k in mod)
384
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
385
- __createBinding(result, mod, k);
386
- __setModuleDefault(result, mod);
387
- return result;
388
- }
389
- function __importDefault(mod) {
390
- return (mod && mod.__esModule) ? mod : { default: mod };
391
- }
392
- function __classPrivateFieldGet(receiver, state, kind, f) {
393
- if (kind === "a" && !f)
394
- throw new TypeError("Private accessor was defined without a getter");
395
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
396
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
397
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
398
- }
399
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
400
- if (kind === "m")
401
- throw new TypeError("Private method is not writable");
402
- if (kind === "a" && !f)
403
- throw new TypeError("Private accessor was defined without a setter");
404
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
405
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
406
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
407
- }
408
- function __classPrivateFieldIn(state, receiver) {
409
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
410
- throw new TypeError("Cannot use 'in' operator on non-object");
411
- return typeof state === "function" ? receiver === state : state.has(receiver);
412
- }
413
- function __addDisposableResource(env, value, async) {
414
- if (value !== null && value !== void 0) {
415
- if (typeof value !== "object" && typeof value !== "function")
416
- throw new TypeError("Object expected.");
417
- var dispose;
418
- if (async) {
419
- if (!Symbol.asyncDispose)
420
- throw new TypeError("Symbol.asyncDispose is not defined.");
421
- dispose = value[Symbol.asyncDispose];
422
- }
423
- if (dispose === void 0) {
424
- if (!Symbol.dispose)
425
- throw new TypeError("Symbol.dispose is not defined.");
426
- dispose = value[Symbol.dispose];
427
- }
428
- if (typeof dispose !== "function")
429
- throw new TypeError("Object not disposable.");
430
- env.stack.push({ value: value, dispose: dispose, async: async });
431
- }
432
- else if (async) {
433
- env.stack.push({ async: true });
434
- }
435
- return value;
436
- }
437
- var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
438
- var e = new Error(message);
439
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
440
- };
441
- function __disposeResources(env) {
442
- function fail(e) {
443
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
444
- env.hasError = true;
445
- }
446
- function next() {
447
- while (env.stack.length) {
448
- var rec = env.stack.pop();
449
- try {
450
- var result = rec.dispose && rec.dispose.call(rec.value);
451
- if (rec.async)
452
- return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
453
- }
454
- catch (e) {
455
- fail(e);
456
- }
457
- }
458
- if (env.hasError)
459
- throw env.error;
460
- }
461
- return next();
462
- }
463
- var tslib_es6 = {
464
- __extends: __extends,
465
- __assign: __assign,
466
- __rest: __rest,
467
- __decorate: __decorate,
468
- __param: __param,
469
- __metadata: __metadata,
470
- __awaiter: __awaiter,
471
- __generator: __generator,
472
- __createBinding: __createBinding,
473
- __exportStar: __exportStar,
474
- __values: __values,
475
- __read: __read,
476
- __spread: __spread,
477
- __spreadArrays: __spreadArrays,
478
- __spreadArray: __spreadArray,
479
- __await: __await,
480
- __asyncGenerator: __asyncGenerator,
481
- __asyncDelegator: __asyncDelegator,
482
- __asyncValues: __asyncValues,
483
- __makeTemplateObject: __makeTemplateObject,
484
- __importStar: __importStar,
485
- __importDefault: __importDefault,
486
- __classPrivateFieldGet: __classPrivateFieldGet,
487
- __classPrivateFieldSet: __classPrivateFieldSet,
488
- __classPrivateFieldIn: __classPrivateFieldIn,
489
- __addDisposableResource: __addDisposableResource,
490
- __disposeResources: __disposeResources,
491
- };
35
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
+ PERFORMANCE OF THIS SOFTWARE.
42
+ ***************************************************************************** */
43
+ /* global Reflect, Promise */
44
+ var extendStatics = function (d, b) {
45
+ extendStatics = Object.setPrototypeOf ||
46
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
+ function (d, b) { for (var p in b)
48
+ if (Object.prototype.hasOwnProperty.call(b, p))
49
+ d[p] = b[p]; };
50
+ return extendStatics(d, b);
51
+ };
52
+ function __extends(d, b) {
53
+ if (typeof b !== "function" && b !== null)
54
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
55
+ extendStatics(d, b);
56
+ function __() { this.constructor = d; }
57
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58
+ }
59
+ var __assign = function () {
60
+ __assign = Object.assign || function __assign(t) {
61
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
62
+ s = arguments[i];
63
+ for (var p in s)
64
+ if (Object.prototype.hasOwnProperty.call(s, p))
65
+ t[p] = s[p];
66
+ }
67
+ return t;
68
+ };
69
+ return __assign.apply(this, arguments);
70
+ };
71
+ function __rest(s, e) {
72
+ var t = {};
73
+ for (var p in s)
74
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
+ t[p] = s[p];
76
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
+ t[p[i]] = s[p[i]];
80
+ }
81
+ return t;
82
+ }
83
+ function __decorate(decorators, target, key, desc) {
84
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
85
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
86
+ r = Reflect.decorate(decorators, target, key, desc);
87
+ else
88
+ for (var i = decorators.length - 1; i >= 0; i--)
89
+ if (d = decorators[i])
90
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
91
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
92
+ }
93
+ function __param(paramIndex, decorator) {
94
+ return function (target, key) { decorator(target, key, paramIndex); };
95
+ }
96
+ function __metadata(metadataKey, metadataValue) {
97
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
98
+ return Reflect.metadata(metadataKey, metadataValue);
99
+ }
100
+ function __awaiter(thisArg, _arguments, P, generator) {
101
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
102
+ return new (P || (P = Promise))(function (resolve, reject) {
103
+ function fulfilled(value) { try {
104
+ step(generator.next(value));
105
+ }
106
+ catch (e) {
107
+ reject(e);
108
+ } }
109
+ function rejected(value) { try {
110
+ step(generator["throw"](value));
111
+ }
112
+ catch (e) {
113
+ reject(e);
114
+ } }
115
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
116
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
117
+ });
118
+ }
119
+ function __generator(thisArg, body) {
120
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
121
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
122
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
123
+ function verb(n) { return function (v) { return step([n, v]); }; }
124
+ function step(op) {
125
+ if (f)
126
+ throw new TypeError("Generator is already executing.");
127
+ while (_)
128
+ try {
129
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
130
+ return t;
131
+ if (y = 0, t)
132
+ op = [op[0] & 2, t.value];
133
+ switch (op[0]) {
134
+ case 0:
135
+ case 1:
136
+ t = op;
137
+ break;
138
+ case 4:
139
+ _.label++;
140
+ return { value: op[1], done: false };
141
+ case 5:
142
+ _.label++;
143
+ y = op[1];
144
+ op = [0];
145
+ continue;
146
+ case 7:
147
+ op = _.ops.pop();
148
+ _.trys.pop();
149
+ continue;
150
+ default:
151
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
152
+ _ = 0;
153
+ continue;
154
+ }
155
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
156
+ _.label = op[1];
157
+ break;
158
+ }
159
+ if (op[0] === 6 && _.label < t[1]) {
160
+ _.label = t[1];
161
+ t = op;
162
+ break;
163
+ }
164
+ if (t && _.label < t[2]) {
165
+ _.label = t[2];
166
+ _.ops.push(op);
167
+ break;
168
+ }
169
+ if (t[2])
170
+ _.ops.pop();
171
+ _.trys.pop();
172
+ continue;
173
+ }
174
+ op = body.call(thisArg, _);
175
+ }
176
+ catch (e) {
177
+ op = [6, e];
178
+ y = 0;
179
+ }
180
+ finally {
181
+ f = t = 0;
182
+ }
183
+ if (op[0] & 5)
184
+ throw op[1];
185
+ return { value: op[0] ? op[1] : void 0, done: true };
186
+ }
187
+ }
188
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
189
+ if (k2 === undefined)
190
+ k2 = k;
191
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
192
+ }) : (function (o, m, k, k2) {
193
+ if (k2 === undefined)
194
+ k2 = k;
195
+ o[k2] = m[k];
196
+ });
197
+ function __exportStar(m, o) {
198
+ for (var p in m)
199
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
200
+ __createBinding(o, m, p);
201
+ }
202
+ function __values(o) {
203
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
204
+ if (m)
205
+ return m.call(o);
206
+ if (o && typeof o.length === "number")
207
+ return {
208
+ next: function () {
209
+ if (o && i >= o.length)
210
+ o = void 0;
211
+ return { value: o && o[i++], done: !o };
212
+ }
213
+ };
214
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
215
+ }
216
+ function __read(o, n) {
217
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
218
+ if (!m)
219
+ return o;
220
+ var i = m.call(o), r, ar = [], e;
221
+ try {
222
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
223
+ ar.push(r.value);
224
+ }
225
+ catch (error) {
226
+ e = { error: error };
227
+ }
228
+ finally {
229
+ try {
230
+ if (r && !r.done && (m = i["return"]))
231
+ m.call(i);
232
+ }
233
+ finally {
234
+ if (e)
235
+ throw e.error;
236
+ }
237
+ }
238
+ return ar;
239
+ }
240
+ /** @deprecated */
241
+ function __spread() {
242
+ for (var ar = [], i = 0; i < arguments.length; i++)
243
+ ar = ar.concat(__read(arguments[i]));
244
+ return ar;
245
+ }
246
+ /** @deprecated */
247
+ function __spreadArrays() {
248
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
249
+ s += arguments[i].length;
250
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
251
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
252
+ r[k] = a[j];
253
+ return r;
254
+ }
255
+ function __spreadArray(to, from, pack) {
256
+ if (pack || arguments.length === 2)
257
+ for (var i = 0, l = from.length, ar; i < l; i++) {
258
+ if (ar || !(i in from)) {
259
+ if (!ar)
260
+ ar = Array.prototype.slice.call(from, 0, i);
261
+ ar[i] = from[i];
262
+ }
263
+ }
264
+ return to.concat(ar || Array.prototype.slice.call(from));
265
+ }
266
+ function __await(v) {
267
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
268
+ }
269
+ function __asyncGenerator(thisArg, _arguments, generator) {
270
+ if (!Symbol.asyncIterator)
271
+ throw new TypeError("Symbol.asyncIterator is not defined.");
272
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
273
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
274
+ function verb(n) { if (g[n])
275
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
276
+ function resume(n, v) { try {
277
+ step(g[n](v));
278
+ }
279
+ catch (e) {
280
+ settle(q[0][3], e);
281
+ } }
282
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
283
+ function fulfill(value) { resume("next", value); }
284
+ function reject(value) { resume("throw", value); }
285
+ function settle(f, v) { if (f(v), q.shift(), q.length)
286
+ resume(q[0][0], q[0][1]); }
287
+ }
288
+ function __asyncDelegator(o) {
289
+ var i, p;
290
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
291
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
292
+ }
293
+ function __asyncValues(o) {
294
+ if (!Symbol.asyncIterator)
295
+ throw new TypeError("Symbol.asyncIterator is not defined.");
296
+ var m = o[Symbol.asyncIterator], i;
297
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
298
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
299
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
300
+ }
301
+ function __makeTemplateObject(cooked, raw) {
302
+ if (Object.defineProperty) {
303
+ Object.defineProperty(cooked, "raw", { value: raw });
304
+ }
305
+ else {
306
+ cooked.raw = raw;
307
+ }
308
+ return cooked;
309
+ }
310
+ ;
311
+ var __setModuleDefault = Object.create ? (function (o, v) {
312
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
313
+ }) : function (o, v) {
314
+ o["default"] = v;
315
+ };
316
+ function __importStar(mod) {
317
+ if (mod && mod.__esModule)
318
+ return mod;
319
+ var result = {};
320
+ if (mod != null)
321
+ for (var k in mod)
322
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
323
+ __createBinding(result, mod, k);
324
+ __setModuleDefault(result, mod);
325
+ return result;
326
+ }
327
+ function __importDefault(mod) {
328
+ return (mod && mod.__esModule) ? mod : { default: mod };
329
+ }
330
+ function __classPrivateFieldGet(receiver, state, kind, f) {
331
+ if (kind === "a" && !f)
332
+ throw new TypeError("Private accessor was defined without a getter");
333
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
334
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
335
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
336
+ }
337
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
338
+ if (kind === "m")
339
+ throw new TypeError("Private method is not writable");
340
+ if (kind === "a" && !f)
341
+ throw new TypeError("Private accessor was defined without a setter");
342
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
343
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
344
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
345
+ }
492
346
 
493
- var TimepickerDirective = /** @class */ (function () {
494
- function TimepickerDirective(templateRef, overlay, viewContainerRef) {
495
- this.templateRef = templateRef;
496
- this.overlay = overlay;
497
- this.viewContainerRef = viewContainerRef;
498
- this.openStatus = false;
499
- this.statusEmitter = new core.EventEmitter();
500
- }
501
- Object.defineProperty(TimepickerDirective.prototype, "createOverlayOnInput", {
502
- set: function (openStatus) {
503
- this.openStatus = openStatus;
504
- if (this.originEl && this.openStatus)
505
- this.createOverlay(this.originEl);
506
- },
507
- enumerable: false,
508
- configurable: true
509
- });
510
- ;
511
- TimepickerDirective.prototype.createOverlay = function (origin) {
512
- var _this = this;
513
- var positions = [
514
- new overlay.ConnectionPositionPair({ originX: "start", originY: "bottom" }, { overlayX: "start", overlayY: "top" }, 0, 4),
515
- new overlay.ConnectionPositionPair({ originX: "end", originY: "bottom" }, { overlayX: "end", overlayY: "top" }, 0, 4)
516
- ];
517
- var overlayConfig = new overlay.OverlayConfig({
518
- hasBackdrop: true,
519
- backdropClass: "cdk-overlay-transparent-backdrop",
520
- positionStrategy: this.overlay
521
- .position()
522
- //connecting the dropdown overlay to the input element
523
- .flexibleConnectedTo(origin)
524
- .withPositions(__spread(positions))
525
- .withPush(true)
526
- });
527
- this.overlayRef = this.overlay.create(overlayConfig);
528
- var dropdownPortal = new portal.TemplatePortal(this.templateRef, this.viewContainerRef);
529
- this.overlayRef.attach(dropdownPortal);
530
- this.overlayRef.backdropClick().subscribe(function (resp) {
531
- _this.openStatus = false;
532
- _this.statusEmitter.emit(false);
533
- _this.overlayRef.detach();
534
- });
535
- };
536
- TimepickerDirective.prototype.destroyOverlay = function () {
537
- this.overlayRef.detach();
538
- };
539
- return TimepickerDirective;
540
- }());
541
- TimepickerDirective.decorators = [
542
- { type: core.Directive, args: [{
543
- selector: '[libTimepicker]'
544
- },] }
545
- ];
546
- TimepickerDirective.ctorParameters = function () { return [
547
- { type: core.TemplateRef },
548
- { type: overlay.Overlay },
549
- { type: core.ViewContainerRef }
550
- ]; };
551
- TimepickerDirective.propDecorators = {
552
- originEl: [{ type: core.Input, args: ['originEl',] }],
553
- statusEmitter: [{ type: core.Output }],
554
- createOverlayOnInput: [{ type: core.Input, args: ['openStatus',] }]
555
- };
347
+ var TimepickerDirective = /** @class */ (function () {
348
+ function TimepickerDirective(templateRef, overlay, viewContainerRef) {
349
+ this.templateRef = templateRef;
350
+ this.overlay = overlay;
351
+ this.viewContainerRef = viewContainerRef;
352
+ this.openStatus = false;
353
+ this.statusEmitter = new core.EventEmitter();
354
+ }
355
+ Object.defineProperty(TimepickerDirective.prototype, "createOverlayOnInput", {
356
+ set: function (openStatus) {
357
+ this.openStatus = openStatus;
358
+ if (this.originEl && this.openStatus)
359
+ this.createOverlay(this.originEl);
360
+ },
361
+ enumerable: false,
362
+ configurable: true
363
+ });
364
+ ;
365
+ TimepickerDirective.prototype.createOverlay = function (origin) {
366
+ var _this = this;
367
+ var positions = [
368
+ new overlay.ConnectionPositionPair({ originX: "start", originY: "bottom" }, { overlayX: "start", overlayY: "top" }, 0, 4),
369
+ new overlay.ConnectionPositionPair({ originX: "end", originY: "bottom" }, { overlayX: "end", overlayY: "top" }, 0, 4)
370
+ ];
371
+ var overlayConfig = new overlay.OverlayConfig({
372
+ hasBackdrop: true,
373
+ backdropClass: "cdk-overlay-transparent-backdrop",
374
+ positionStrategy: this.overlay
375
+ .position()
376
+ //connecting the dropdown overlay to the input element
377
+ .flexibleConnectedTo(origin)
378
+ .withPositions(__spread(positions))
379
+ .withPush(true)
380
+ });
381
+ this.overlayRef = this.overlay.create(overlayConfig);
382
+ var dropdownPortal = new portal.TemplatePortal(this.templateRef, this.viewContainerRef);
383
+ this.overlayRef.attach(dropdownPortal);
384
+ this.overlayRef.backdropClick().subscribe(function (resp) {
385
+ _this.openStatus = false;
386
+ _this.statusEmitter.emit(false);
387
+ _this.overlayRef.detach();
388
+ });
389
+ };
390
+ TimepickerDirective.prototype.destroyOverlay = function () {
391
+ this.overlayRef.detach();
392
+ };
393
+ return TimepickerDirective;
394
+ }());
395
+ TimepickerDirective.decorators = [
396
+ { type: core.Directive, args: [{
397
+ selector: '[libTimepicker]'
398
+ },] }
399
+ ];
400
+ TimepickerDirective.ctorParameters = function () { return [
401
+ { type: core.TemplateRef },
402
+ { type: overlay.Overlay },
403
+ { type: core.ViewContainerRef }
404
+ ]; };
405
+ TimepickerDirective.propDecorators = {
406
+ originEl: [{ type: core.Input, args: ['originEl',] }],
407
+ statusEmitter: [{ type: core.Output }],
408
+ createOverlayOnInput: [{ type: core.Input, args: ['openStatus',] }]
409
+ };
556
410
 
557
- var TimePickerComponent = /** @class */ (function () {
558
- function TimePickerComponent() {
559
- this.openStatus = false;
560
- this.isHighlighted = 0;
561
- this.isInvalid = false;
562
- this.timeIntervals = [];
563
- this.shouldScroll = false;
564
- this.userInputFlag = false;
565
- this.givenTimeFlag = true;
566
- this.clockFormat = 12;
567
- this.timezone = "Asia/Kolkata";
568
- this.height = "max-content";
569
- this.inputWidth = "100px";
570
- this.interval = 15;
571
- this.dateAsEpoch = moment__namespace().valueOf();
572
- this.rangeValidity = true;
573
- this.showTooltip = true;
574
- this.dispayToolTip = this.showTooltip;
575
- this.triggerChange = true;
576
- this.timeEmitter = new core.EventEmitter();
577
- }
578
- Object.defineProperty(TimePickerComponent.prototype, "timeIntervalRefs", {
579
- // gets all the li elements from the dropdown and scrolls to the highlighted element
580
- set: function (intervals) {
581
- intervals.forEach(function (interval) {
582
- if (interval.nativeElement.classList[0] === "highlight") {
583
- var highlighted_1 = interval.nativeElement;
584
- setTimeout(function () { return highlighted_1.scrollIntoView({ block: "center" }); });
585
- }
586
- });
587
- },
588
- enumerable: false,
589
- configurable: true
590
- });
591
- TimePickerComponent.prototype.ngOnInit = function () {
592
- if (!this.givenTime && !this.minTime) {
593
- this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
594
- var chosenTimeMoment = this.getMoment(this.chosenTime);
595
- this.emitTime({
596
- valid: !this.isInvalid,
597
- time: this.chosenTime,
598
- epoch: chosenTimeMoment.valueOf()
599
- });
600
- }
601
- };
602
- TimePickerComponent.prototype.ngOnChanges = function () {
603
- this.timeFormat = this.clockFormat === 12 ? "hh:mm a" : "HH:mm";
604
- moment.tz.setDefault(this.timezone);
605
- if (this.timeFormat) {
606
- var chosenTimeMoment = this.getMoment(this.chosenTime);
607
- // if the first interval is >= the chosen time
608
- // then only update the value of chosen time
609
- // else it remains the same
610
- if (this.firstInterval >= chosenTimeMoment.valueOf() && this.rangeValidity && !this.userInputFlag) {
611
- this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
612
- chosenTimeMoment = this.getMoment(this.chosenTime);
613
- }
614
- if ((this.givenTimeFlag && this.givenTime) || this.minTime) {
615
- this.chosenTime = moment__namespace(this.minTime || this.givenTime).format(this.timeFormat);
616
- }
617
- chosenTimeMoment = this.getMoment(this.chosenTime);
618
- if (!this.userInputFlag)
619
- this.populateDropdown();
620
- this.userInputFlag = false;
621
- if (this.chosenTime) {
622
- this.isInvalid = !this.checkTimeValidity(this.chosenTime.trim());
623
- this.emitTime({
624
- valid: !this.isInvalid,
625
- time: this.chosenTime,
626
- epoch: chosenTimeMoment.valueOf()
627
- });
628
- this.calculateClosestInterval(this.chosenTime);
629
- }
630
- }
631
- };
632
- TimePickerComponent.prototype.emitTime = function (data) {
633
- this.timeEmitter.emit(data);
634
- };
635
- // function to get moment object when time is given in string
636
- TimePickerComponent.prototype.getMoment = function (time) {
637
- return moment__namespace(moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") + " " + time, "'DD-MM-YYYY' " + this.timeFormat);
638
- };
639
- TimePickerComponent.prototype.closeDropdown = function () {
640
- this.dispayToolTip = false;
641
- this.userInputFlag = false;
642
- this.openStatus = false;
643
- if (this.timepickerDirective)
644
- this.timepickerDirective.destroyOverlay();
645
- };
646
- // toggle timepicker dropdown
647
- TimePickerComponent.prototype.openDropdown = function () {
648
- this.dispayToolTip = true;
649
- this.openStatus = true;
650
- };
651
- TimePickerComponent.prototype.checkTimeValidity = function (time) {
652
- var RE12 = /^(([0][1-9]|1[0-2]):([0-5][0-9])( )?(am|pm|AM|PM))$/i;
653
- var RE24 = /^([01][0-9]|2[0-3]):[0-5][0-9]$/;
654
- var RE = this.clockFormat === 12 ? RE12 : RE24;
655
- var timeMoment = this.getMoment(time);
656
- var flag = false;
657
- // if the first interval is set to the start of the day
658
- // or a time is already provided to the component to show
659
- // then we don't check its validity against the current time
660
- if (this.minTime ||
661
- this.givenTime ||
662
- (this.firstInterval &&
663
- moment__namespace(this.firstInterval).format(this.timeFormat).valueOf() === moment__namespace().startOf("d").format(this.timeFormat).valueOf())) {
664
- flag = time.match(RE) ? true : false;
665
- }
666
- else {
667
- flag = time.match(RE) && timeMoment.diff(moment__namespace(), "m") >= 0 ? true : false;
668
- }
669
- return flag;
670
- };
671
- // update chosen time as soon as the user clicks on an interval
672
- TimePickerComponent.prototype.onTimeSelect = function (time) {
673
- this.isInvalid = !this.checkTimeValidity(time.trim());
674
- if (!this.isInvalid) {
675
- this.chosenTime = time;
676
- this.calculateClosestInterval(this.chosenTime);
677
- }
678
- var timeMoment = this.getMoment(time);
679
- this.emitTime({
680
- valid: !this.isInvalid,
681
- time: time,
682
- epoch: timeMoment.valueOf()
683
- });
684
- this.openStatus = false;
685
- if (this.timepickerDirective)
686
- this.timepickerDirective.destroyOverlay();
687
- };
688
- // checks validity of time on input change and calculates the closest interval
689
- TimePickerComponent.prototype.onTimeChange = function (time) {
690
- this.isInvalid = !this.checkTimeValidity(time.trim());
691
- if (!this.isInvalid) {
692
- this.userInputFlag = true;
693
- this.openStatus = false;
694
- if (this.timepickerDirective)
695
- this.timepickerDirective.destroyOverlay();
696
- this.calculateClosestInterval(time);
697
- }
698
- var timeMoment = this.getMoment(time);
699
- this.emitTime({
700
- valid: !this.isInvalid,
701
- time: time,
702
- epoch: timeMoment.valueOf()
703
- });
704
- };
705
- TimePickerComponent.prototype.calculateClosestInterval = function (time) {
706
- var _this = this;
707
- var roundedEpoch;
708
- // Converting time and date to a moment object
709
- var chosenDate = moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY"); // 05-01-2024
710
- var parsedTimeWithDate = moment__namespace(chosenDate + " " + time, "DD-MM-YYYY " + this.timeFormat);
711
- // Converting moment object to epoch
712
- var chosenTimeEpoch = parsedTimeWithDate.valueOf();
713
- var offset = this.interval - (moment__namespace(chosenTimeEpoch).minutes() % this.interval);
714
- if (this.minTime && !this.givenTime) {
715
- this.isHighlighted = 0;
716
- return;
717
- }
718
- roundedEpoch = offset >= this.interval / 2 ? (moment__namespace(chosenTimeEpoch).subtract(this.interval - offset, "m")).valueOf() : (moment__namespace(chosenTimeEpoch).add(offset, "m")).valueOf();
719
- // finding the index of element that needs to be highlighted
720
- if (moment__namespace(chosenTimeEpoch).format(this.timeFormat) > moment__namespace(this.dateAsEpoch).endOf("d").subtract(this.interval, "m").format(this.timeFormat)) {
721
- this.isHighlighted = this.timeIntervals.length - 1;
722
- }
723
- else {
724
- var roundedEpochMoment_1 = moment__namespace(roundedEpoch);
725
- this.isHighlighted = this.timeIntervals.findIndex(function (interval) {
726
- var intervalObj = moment__namespace(chosenDate + " " + interval, "DD-MM-YYYY " + _this.timeFormat);
727
- return intervalObj.isSame(roundedEpochMoment_1);
728
- });
729
- }
730
- };
731
- // populates the dropdown according to the first interval received
732
- TimePickerComponent.prototype.populateDropdown = function () {
733
- this.timeIntervals = [];
734
- // if picker is used as an individual component
735
- if (!this.firstInterval) {
736
- // firstInterval is initialised according to the current time
737
- // if the date is same as the current date
738
- if (moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") === moment__namespace().format("DD-MM-YYYY") && !this.minTime) {
739
- var offset = this.interval - (moment__namespace().minutes() % this.interval);
740
- this.firstInterval = moment__namespace().add(offset, "m").valueOf();
741
- }
742
- // if minimum time to show is provided
743
- else if (this.minTime) {
744
- var offset = this.interval - (moment__namespace(this.minTime).minutes() % this.interval);
745
- this.firstInterval = moment__namespace(this.minTime).add(offset, "m").valueOf();
746
- }
747
- // else the firstInterval is initialised as start of day
748
- else {
749
- this.firstInterval = moment__namespace().startOf("d").valueOf();
750
- }
751
- }
752
- if (this.givenTime && this.givenTimeFlag) {
753
- this.firstInterval = moment__namespace(this.givenTime).startOf('d').valueOf();
754
- this.givenTimeFlag = false;
755
- }
756
- var dateAsString = moment__namespace(this.dateAsEpoch).format('DD-MM-YYYY');
757
- var intervalAsString = moment__namespace(this.firstInterval).format(this.timeFormat);
758
- var start = moment__namespace(dateAsString + " " + intervalAsString, "DD-MM-YYYY " + this.timeFormat);
759
- var end = moment__namespace("" + dateAsString, 'DD-MM-YYYY').endOf('d');
760
- while (start.valueOf() < end.valueOf()) {
761
- this.timeIntervals.push(start.format(this.timeFormat));
762
- start.add(this.interval, "m");
763
- }
764
- // if the start time is equal to the interval just before midnight
765
- // and the start date = end date
766
- // push 11:59pm only
767
- if (this.timeIntervals.length === 0) {
768
- this.chosenTime = moment__namespace().endOf("d").format(this.timeFormat);
769
- this.timeIntervals.push(moment__namespace().endOf("d").format(this.timeFormat));
770
- }
771
- };
772
- TimePickerComponent.prototype.ngOnDestroy = function () {
773
- if (this.tooltipDirective)
774
- this.tooltipDirective.hideToolTip();
775
- };
776
- return TimePickerComponent;
777
- }());
778
- TimePickerComponent.decorators = [
779
- { type: core.Component, args: [{
780
- selector: "mis-timepicker",
781
- template: "<div class=\"timepicker-container\" [ngStyle]=\"{ height: height }\">\n <input\n type=\"text\"\n [(ngModel)]=\"chosenTime\"\n (ngModelChange)=\"onTimeChange(chosenTime)\"\n [ngClass]=\"{ invalid: isInvalid || !rangeValidity }\"\n [ngStyle]=\"{ width: inputWidth }\"\n (click)=\"openDropdown()\"\n misToolTip\n [showToolTip]=\"showTooltip && (isInvalid || !rangeValidity) && dispayToolTip\"\n [text]=\"'Invalid Time'\"\n [position]=\"'top'\"\n [showOnHover]=\"false\"\n #input\n cdkOverlayOrigin\n class=\"h7\"\n />\n\n <ng-template #dropdownContainer libDropdownScroll libTimepicker [originEl]=\"input\" [openStatus]=\"openStatus\" (statusEmitter)=\"closeDropdown()\">\n <div *ngIf=\"openStatus\" class=\"timepicker-dropdown\" [ngStyle]=\"{ width: dropdownWidth || inputWidth }\">\n <ul #dropdown>\n <li #timeInterval (click)=\"onTimeSelect(interval)\" *ngFor=\"let interval of timeIntervals; index as i\" [ngClass]=\"{ highlight: i === isHighlighted }\">\n {{ interval }}\n <div class=\"ic-ui-check-24 selected-icon\" *ngIf=\"interval === chosenTime\"></div>\n </li>\n </ul>\n </div>\n </ng-template>\n</div>\n",
782
- styles: [".h1{font-size:40px;line-height:48px}.h1,.h2{font-weight:400;letter-spacing:0}.h2{font-size:32px;line-height:40px}.h3{font-size:28px;line-height:36px}.h3,.h4{font-weight:400;letter-spacing:0}.h4{font-size:24px;line-height:32px}.h5-b{font-weight:700;letter-spacing:.25px}.h5,.h5-b{font-size:20px;line-height:28px}.h5{font-weight:400;letter-spacing:.15px}.h6-b{font-weight:700}.h6,.h6-b{font-size:16px;letter-spacing:0;line-height:24px}.h6,.p{font-weight:400}.p{font-size:16px;letter-spacing:0;line-height:180%}.h7-b{font-weight:700;letter-spacing:.25px}.h7,.h7-b{font-size:14px;line-height:20px}.h7{font-weight:400;letter-spacing:.2px}.h8-b{font-weight:700;letter-spacing:.25px}.h8,.h8-b{font-size:12px;line-height:18px}.h8{letter-spacing:.2px}.h8,.h9{font-weight:400}.h9{font-size:10px;letter-spacing:0;line-height:15px}.btn-lg-b{font-weight:700;letter-spacing:.5px}.btn-lg,.btn-lg-b{font-size:16px;line-height:24px}.btn-lg{font-weight:400;letter-spacing:.2px}.btn-sm{font-size:14px;font-weight:400;letter-spacing:.25px;line-height:20px}.btn-link{font-size:16px;line-height:24px}.btn-link,.display-1{font-weight:400;letter-spacing:0}.display-1{font-size:48px;line-height:56px}.display-2{font-size:14px;font-weight:400;letter-spacing:.5px;line-height:20px}*{box-sizing:border-box;font-family:Lato}.timepicker-container{display:inline-block;position:relative}input{text-align:center;border:none;border-bottom:1px solid #e0e0e0;outline:none;height:100%;width:100px;padding:4px 16px}input:hover{background:#f5f7fc}input:active,input:focus{background:#e6ebf7;border-bottom:1px solid #0937b2}.timepicker-dropdown{position:absolute;top:calc(100% + 4px);left:0;max-height:200px;overflow-y:auto;border:1px solid #e0e0e0;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:4px;padding:8px;background:#fff}.timepicker-dropdown::-webkit-scrollbar{display:none}.timepicker-dropdown ul{margin:0;padding:0}.timepicker-dropdown li{text-align:start;list-style:none;padding:6px 12px;cursor:pointer;font-size:14px;color:#181f33;display:flex;justify-content:space-between;align-items:center}.timepicker-dropdown li:hover{background:#f5f7fc;border-radius:6px}.timepicker-dropdown li .selected-icon{font-weight:900}.highlight{background-color:#f5f7fc;border-radius:6px}.invalid{background:#fae1ea!important;border-bottom:1px solid #b00020!important}"]
783
- },] }
784
- ];
785
- TimePickerComponent.ctorParameters = function () { return []; };
786
- TimePickerComponent.propDecorators = {
787
- clockFormat: [{ type: core.Input }],
788
- timezone: [{ type: core.Input }],
789
- height: [{ type: core.Input }],
790
- inputWidth: [{ type: core.Input }],
791
- dropdownWidth: [{ type: core.Input }],
792
- interval: [{ type: core.Input }],
793
- dateAsEpoch: [{ type: core.Input }],
794
- firstInterval: [{ type: core.Input }],
795
- rangeValidity: [{ type: core.Input }],
796
- showTooltip: [{ type: core.Input }],
797
- givenTime: [{ type: core.Input }],
798
- minTime: [{ type: core.Input }],
799
- triggerChange: [{ type: core.Input }],
800
- timeEmitter: [{ type: core.Output }],
801
- input: [{ type: core.ViewChild, args: ["input", { static: true },] }],
802
- timepickerDirective: [{ type: core.ViewChild, args: [TimepickerDirective,] }],
803
- tooltipDirective: [{ type: core.ViewChild, args: [tooltip.ToolTipDirective,] }],
804
- timeIntervalRefs: [{ type: core.ViewChildren, args: ["timeInterval",] }]
805
- };
411
+ var TimePickerComponent = /** @class */ (function () {
412
+ function TimePickerComponent() {
413
+ this.openStatus = false;
414
+ this.isHighlighted = 0;
415
+ this.isInvalid = false;
416
+ this.timeIntervals = [];
417
+ this.shouldScroll = false;
418
+ this.userInputFlag = false;
419
+ this.givenTimeFlag = true;
420
+ this.clockFormat = 12;
421
+ this.timezone = "Asia/Kolkata";
422
+ this.height = "max-content";
423
+ this.inputWidth = "100px";
424
+ this.interval = 15;
425
+ this.dateAsEpoch = moment__namespace().valueOf();
426
+ this.rangeValidity = true;
427
+ this.showTooltip = true;
428
+ this.dispayToolTip = this.showTooltip;
429
+ this.triggerChange = true;
430
+ this.timeEmitter = new core.EventEmitter();
431
+ }
432
+ Object.defineProperty(TimePickerComponent.prototype, "timeIntervalRefs", {
433
+ // gets all the li elements from the dropdown and scrolls to the highlighted element
434
+ set: function (intervals) {
435
+ intervals.forEach(function (interval) {
436
+ if (interval.nativeElement.classList[0] === "highlight") {
437
+ var highlighted_1 = interval.nativeElement;
438
+ setTimeout(function () { return highlighted_1.scrollIntoView({ block: "center" }); });
439
+ }
440
+ });
441
+ },
442
+ enumerable: false,
443
+ configurable: true
444
+ });
445
+ TimePickerComponent.prototype.ngOnInit = function () {
446
+ if (!this.givenTime && !this.minTime) {
447
+ this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
448
+ var chosenTimeMoment = this.getMoment(this.chosenTime);
449
+ this.emitTime({
450
+ valid: !this.isInvalid,
451
+ time: this.chosenTime,
452
+ epoch: chosenTimeMoment.valueOf()
453
+ });
454
+ }
455
+ };
456
+ TimePickerComponent.prototype.ngOnChanges = function () {
457
+ this.timeFormat = this.clockFormat === 12 ? "hh:mm a" : "HH:mm";
458
+ moment.tz.setDefault(this.timezone);
459
+ if (this.timeFormat) {
460
+ var chosenTimeMoment = this.getMoment(this.chosenTime);
461
+ // if the first interval is >= the chosen time
462
+ // then only update the value of chosen time
463
+ // else it remains the same
464
+ if (this.firstInterval >= chosenTimeMoment.valueOf() && this.rangeValidity && !this.userInputFlag) {
465
+ this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
466
+ chosenTimeMoment = this.getMoment(this.chosenTime);
467
+ }
468
+ if ((this.givenTimeFlag && this.givenTime) || this.minTime) {
469
+ this.chosenTime = moment__namespace(this.minTime || this.givenTime).format(this.timeFormat);
470
+ }
471
+ chosenTimeMoment = this.getMoment(this.chosenTime);
472
+ if (!this.userInputFlag)
473
+ this.populateDropdown();
474
+ this.userInputFlag = false;
475
+ if (this.chosenTime) {
476
+ this.isInvalid = !this.checkTimeValidity(this.chosenTime.trim());
477
+ this.emitTime({
478
+ valid: !this.isInvalid,
479
+ time: this.chosenTime,
480
+ epoch: chosenTimeMoment.valueOf()
481
+ });
482
+ this.calculateClosestInterval(this.chosenTime);
483
+ }
484
+ }
485
+ };
486
+ TimePickerComponent.prototype.emitTime = function (data) {
487
+ this.timeEmitter.emit(data);
488
+ };
489
+ // function to get moment object when time is given in string
490
+ TimePickerComponent.prototype.getMoment = function (time) {
491
+ return moment__namespace(moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") + " " + time, "'DD-MM-YYYY' " + this.timeFormat);
492
+ };
493
+ TimePickerComponent.prototype.closeDropdown = function () {
494
+ this.dispayToolTip = false;
495
+ this.userInputFlag = false;
496
+ this.openStatus = false;
497
+ if (this.timepickerDirective)
498
+ this.timepickerDirective.destroyOverlay();
499
+ };
500
+ // toggle timepicker dropdown
501
+ TimePickerComponent.prototype.openDropdown = function () {
502
+ this.dispayToolTip = true;
503
+ this.openStatus = true;
504
+ };
505
+ TimePickerComponent.prototype.checkTimeValidity = function (time) {
506
+ var RE12 = /^(([0][1-9]|1[0-2]):([0-5][0-9])( )?(am|pm|AM|PM))$/i;
507
+ var RE24 = /^([01][0-9]|2[0-3]):[0-5][0-9]$/;
508
+ var RE = this.clockFormat === 12 ? RE12 : RE24;
509
+ var timeMoment = this.getMoment(time);
510
+ var flag = false;
511
+ // if the first interval is set to the start of the day
512
+ // or a time is already provided to the component to show
513
+ // then we don't check its validity against the current time
514
+ if (this.minTime ||
515
+ this.givenTime ||
516
+ (this.firstInterval &&
517
+ moment__namespace(this.firstInterval).format(this.timeFormat).valueOf() === moment__namespace().startOf("d").format(this.timeFormat).valueOf())) {
518
+ flag = time.match(RE) ? true : false;
519
+ }
520
+ else {
521
+ flag = time.match(RE) && timeMoment.diff(moment__namespace(), "m") >= 0 ? true : false;
522
+ }
523
+ return flag;
524
+ };
525
+ // update chosen time as soon as the user clicks on an interval
526
+ TimePickerComponent.prototype.onTimeSelect = function (time) {
527
+ this.isInvalid = !this.checkTimeValidity(time.trim());
528
+ if (!this.isInvalid) {
529
+ this.chosenTime = time;
530
+ this.calculateClosestInterval(this.chosenTime);
531
+ }
532
+ var timeMoment = this.getMoment(time);
533
+ this.emitTime({
534
+ valid: !this.isInvalid,
535
+ time: time,
536
+ epoch: timeMoment.valueOf()
537
+ });
538
+ this.openStatus = false;
539
+ if (this.timepickerDirective)
540
+ this.timepickerDirective.destroyOverlay();
541
+ };
542
+ // checks validity of time on input change and calculates the closest interval
543
+ TimePickerComponent.prototype.onTimeChange = function (time) {
544
+ this.isInvalid = !this.checkTimeValidity(time.trim());
545
+ if (!this.isInvalid) {
546
+ this.userInputFlag = true;
547
+ this.openStatus = false;
548
+ if (this.timepickerDirective)
549
+ this.timepickerDirective.destroyOverlay();
550
+ this.calculateClosestInterval(time);
551
+ }
552
+ var timeMoment = this.getMoment(time);
553
+ this.emitTime({
554
+ valid: !this.isInvalid,
555
+ time: time,
556
+ epoch: timeMoment.valueOf()
557
+ });
558
+ };
559
+ TimePickerComponent.prototype.calculateClosestInterval = function (time) {
560
+ var _this = this;
561
+ var roundedEpoch;
562
+ // Converting time and date to a moment object
563
+ var chosenDate = moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY"); // 05-01-2024
564
+ var parsedTimeWithDate = moment__namespace(chosenDate + " " + time, "DD-MM-YYYY " + this.timeFormat);
565
+ // Converting moment object to epoch
566
+ var chosenTimeEpoch = parsedTimeWithDate.valueOf();
567
+ var offset = this.interval - (moment__namespace(chosenTimeEpoch).minutes() % this.interval);
568
+ if (this.minTime && !this.givenTime) {
569
+ this.isHighlighted = 0;
570
+ return;
571
+ }
572
+ roundedEpoch = offset >= this.interval / 2 ? (moment__namespace(chosenTimeEpoch).subtract(this.interval - offset, "m")).valueOf() : (moment__namespace(chosenTimeEpoch).add(offset, "m")).valueOf();
573
+ // finding the index of element that needs to be highlighted
574
+ if (moment__namespace(chosenTimeEpoch).format(this.timeFormat) > moment__namespace(this.dateAsEpoch).endOf("d").subtract(this.interval, "m").format(this.timeFormat)) {
575
+ this.isHighlighted = this.timeIntervals.length - 1;
576
+ }
577
+ else {
578
+ var roundedEpochMoment_1 = moment__namespace(roundedEpoch);
579
+ this.isHighlighted = this.timeIntervals.findIndex(function (interval) {
580
+ var intervalObj = moment__namespace(chosenDate + " " + interval, "DD-MM-YYYY " + _this.timeFormat);
581
+ return intervalObj.isSame(roundedEpochMoment_1);
582
+ });
583
+ }
584
+ };
585
+ // populates the dropdown according to the first interval received
586
+ TimePickerComponent.prototype.populateDropdown = function () {
587
+ this.timeIntervals = [];
588
+ // if picker is used as an individual component
589
+ if (!this.firstInterval) {
590
+ // firstInterval is initialised according to the current time
591
+ // if the date is same as the current date
592
+ if (moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") === moment__namespace().format("DD-MM-YYYY") && !this.minTime) {
593
+ var offset = this.interval - (moment__namespace().minutes() % this.interval);
594
+ this.firstInterval = moment__namespace().add(offset, "m").valueOf();
595
+ }
596
+ // if minimum time to show is provided
597
+ else if (this.minTime) {
598
+ var offset = this.interval - (moment__namespace(this.minTime).minutes() % this.interval);
599
+ this.firstInterval = moment__namespace(this.minTime).add(offset, "m").valueOf();
600
+ }
601
+ // else the firstInterval is initialised as start of day
602
+ else {
603
+ this.firstInterval = moment__namespace().startOf("d").valueOf();
604
+ }
605
+ }
606
+ if (this.givenTime && this.givenTimeFlag) {
607
+ this.firstInterval = moment__namespace(this.givenTime).startOf('d').valueOf();
608
+ this.givenTimeFlag = false;
609
+ }
610
+ var dateAsString = moment__namespace(this.dateAsEpoch).format('DD-MM-YYYY');
611
+ var intervalAsString = moment__namespace(this.firstInterval).format(this.timeFormat);
612
+ var start = moment__namespace(dateAsString + " " + intervalAsString, "DD-MM-YYYY " + this.timeFormat);
613
+ var end = moment__namespace("" + dateAsString, 'DD-MM-YYYY').endOf('d');
614
+ while (start.valueOf() < end.valueOf()) {
615
+ this.timeIntervals.push(start.format(this.timeFormat));
616
+ start.add(this.interval, "m");
617
+ }
618
+ // if the start time is equal to the interval just before midnight
619
+ // and the start date = end date
620
+ // push 11:59pm only
621
+ if (this.timeIntervals.length === 0) {
622
+ this.chosenTime = moment__namespace().endOf("d").format(this.timeFormat);
623
+ this.timeIntervals.push(moment__namespace().endOf("d").format(this.timeFormat));
624
+ }
625
+ };
626
+ TimePickerComponent.prototype.ngOnDestroy = function () {
627
+ if (this.tooltipDirective)
628
+ this.tooltipDirective.hideToolTip();
629
+ };
630
+ return TimePickerComponent;
631
+ }());
632
+ TimePickerComponent.decorators = [
633
+ { type: core.Component, args: [{
634
+ selector: "mis-timepicker",
635
+ template: "<div class=\"timepicker-container\" [ngStyle]=\"{ height: height }\">\n <input\n type=\"text\"\n [(ngModel)]=\"chosenTime\"\n (ngModelChange)=\"onTimeChange(chosenTime)\"\n [ngClass]=\"{ invalid: isInvalid || !rangeValidity }\"\n [ngStyle]=\"{ width: inputWidth }\"\n (click)=\"openDropdown()\"\n misToolTip\n [showToolTip]=\"showTooltip && (isInvalid || !rangeValidity) && dispayToolTip\"\n [text]=\"'Invalid Time'\"\n [position]=\"'top'\"\n [showOnHover]=\"false\"\n #input\n cdkOverlayOrigin\n class=\"h7\"\n />\n\n <ng-template #dropdownContainer libDropdownScroll libTimepicker [originEl]=\"input\" [openStatus]=\"openStatus\" (statusEmitter)=\"closeDropdown()\">\n <div *ngIf=\"openStatus\" class=\"timepicker-dropdown\" [ngStyle]=\"{ width: dropdownWidth || inputWidth }\">\n <ul #dropdown>\n <li #timeInterval (click)=\"onTimeSelect(interval)\" *ngFor=\"let interval of timeIntervals; index as i\" [ngClass]=\"{ highlight: i === isHighlighted }\">\n {{ interval }}\n <div class=\"ic-ui-check-24 selected-icon\" *ngIf=\"interval === chosenTime\"></div>\n </li>\n </ul>\n </div>\n </ng-template>\n</div>\n",
636
+ styles: [".h1{font-size:40px;line-height:48px}.h1,.h2{font-weight:400;letter-spacing:0}.h2{font-size:32px;line-height:40px}.h3{font-size:28px;line-height:36px}.h3,.h4{font-weight:400;letter-spacing:0}.h4{font-size:24px;line-height:32px}.h5-b{font-weight:700;letter-spacing:.25px}.h5,.h5-b{font-size:20px;line-height:28px}.h5{font-weight:400;letter-spacing:.15px}.h6-b{font-weight:700}.h6,.h6-b{font-size:16px;letter-spacing:0;line-height:24px}.h6,.p{font-weight:400}.p{font-size:16px;letter-spacing:0;line-height:180%}.h7-b{font-weight:700;letter-spacing:.25px}.h7,.h7-b{font-size:14px;line-height:20px}.h7{font-weight:400;letter-spacing:.2px}.h8-b{font-weight:700;letter-spacing:.25px}.h8,.h8-b{font-size:12px;line-height:18px}.h8{letter-spacing:.2px}.h8,.h9{font-weight:400}.h9{font-size:10px;letter-spacing:0;line-height:15px}.btn-lg-b{font-weight:700;letter-spacing:.5px}.btn-lg,.btn-lg-b{font-size:16px;line-height:24px}.btn-lg{font-weight:400;letter-spacing:.2px}.btn-sm{font-size:14px;font-weight:400;letter-spacing:.25px;line-height:20px}.btn-link{font-size:16px;line-height:24px}.btn-link,.display-1{font-weight:400;letter-spacing:0}.display-1{font-size:48px;line-height:56px}.display-2{font-size:14px;font-weight:400;letter-spacing:.5px;line-height:20px}*{box-sizing:border-box;font-family:Lato}.timepicker-container{display:inline-block;position:relative}input{text-align:center;border:none;border-bottom:1px solid #e0e0e0;outline:none;height:100%;width:100px;padding:4px 16px}input:hover{background:#f5f7fc}input:active,input:focus{background:#e6ebf7;border-bottom:1px solid #0937b2}.timepicker-dropdown{position:absolute;top:calc(100% + 4px);left:0;max-height:200px;overflow-y:auto;border:1px solid #e0e0e0;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:4px;padding:8px;background:#fff}.timepicker-dropdown::-webkit-scrollbar{display:none}.timepicker-dropdown ul{margin:0;padding:0}.timepicker-dropdown li{text-align:start;list-style:none;padding:6px 12px;cursor:pointer;font-size:14px;color:#181f33;display:flex;justify-content:space-between;align-items:center}.timepicker-dropdown li:hover{background:#f5f7fc;border-radius:6px}.timepicker-dropdown li .selected-icon{font-weight:900}.highlight{background-color:#f5f7fc;border-radius:6px}.invalid{background:#fae1ea!important;border-bottom:1px solid #b00020!important}"]
637
+ },] }
638
+ ];
639
+ TimePickerComponent.ctorParameters = function () { return []; };
640
+ TimePickerComponent.propDecorators = {
641
+ clockFormat: [{ type: core.Input }],
642
+ timezone: [{ type: core.Input }],
643
+ height: [{ type: core.Input }],
644
+ inputWidth: [{ type: core.Input }],
645
+ dropdownWidth: [{ type: core.Input }],
646
+ interval: [{ type: core.Input }],
647
+ dateAsEpoch: [{ type: core.Input }],
648
+ firstInterval: [{ type: core.Input }],
649
+ rangeValidity: [{ type: core.Input }],
650
+ showTooltip: [{ type: core.Input }],
651
+ givenTime: [{ type: core.Input }],
652
+ minTime: [{ type: core.Input }],
653
+ triggerChange: [{ type: core.Input }],
654
+ timeEmitter: [{ type: core.Output }],
655
+ input: [{ type: core.ViewChild, args: ["input", { static: true },] }],
656
+ timepickerDirective: [{ type: core.ViewChild, args: [TimepickerDirective,] }],
657
+ tooltipDirective: [{ type: core.ViewChild, args: [tooltip.ToolTipDirective,] }],
658
+ timeIntervalRefs: [{ type: core.ViewChildren, args: ["timeInterval",] }]
659
+ };
806
660
 
807
- var TimePickerModule = /** @class */ (function () {
808
- function TimePickerModule() {
809
- }
810
- TimePickerModule.forRoot = function () {
811
- return { ngModule: TimePickerModule, providers: [] };
812
- };
813
- return TimePickerModule;
814
- }());
815
- TimePickerModule.decorators = [
816
- { type: core.NgModule, args: [{
817
- declarations: [TimePickerComponent, TimepickerDirective],
818
- imports: [common.CommonModule, forms.FormsModule, tooltip.ToolTipModule, overlay.OverlayModule],
819
- exports: [TimePickerComponent]
820
- },] }
821
- ];
661
+ var TimePickerModule = /** @class */ (function () {
662
+ function TimePickerModule() {
663
+ }
664
+ TimePickerModule.forRoot = function () {
665
+ return { ngModule: TimePickerModule, providers: [] };
666
+ };
667
+ return TimePickerModule;
668
+ }());
669
+ TimePickerModule.decorators = [
670
+ { type: core.NgModule, args: [{
671
+ declarations: [TimePickerComponent, TimepickerDirective],
672
+ imports: [common.CommonModule, forms.FormsModule, tooltip.ToolTipModule, overlay.OverlayModule],
673
+ exports: [TimePickerComponent]
674
+ },] }
675
+ ];
822
676
 
823
- /**
824
- * Generated bundle index. Do not edit.
825
- */
677
+ /**
678
+ * Generated bundle index. Do not edit.
679
+ */
826
680
 
827
- exports.TimePickerComponent = TimePickerComponent;
828
- exports.TimePickerModule = TimePickerModule;
829
- exports.ɵa = TimepickerDirective;
681
+ exports.TimePickerComponent = TimePickerComponent;
682
+ exports.TimePickerModule = TimePickerModule;
683
+ exports.ɵa = TimepickerDirective;
830
684
 
831
- Object.defineProperty(exports, '__esModule', { value: true });
685
+ Object.defineProperty(exports, '__esModule', { value: true });
832
686
 
833
687
  })));
834
688
  //# sourceMappingURL=mis-crystal-design-system-timepicker.umd.js.map