mis-crystal-design-system 4.0.27 → 4.0.29-test

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 (117) 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 +641 -495
  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 +1 -15
  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 +555 -409
  7. package/bundles/mis-crystal-design-system-analytics.umd.js.map +1 -1
  8. package/bundles/mis-crystal-design-system-analytics.umd.min.js +1 -15
  9. package/bundles/mis-crystal-design-system-analytics.umd.min.js.map +1 -1
  10. package/bundles/mis-crystal-design-system-checkbox.umd.js +1 -1
  11. package/bundles/mis-crystal-design-system-checkbox.umd.min.js +1 -1
  12. package/bundles/mis-crystal-design-system-checkbox.umd.min.js.map +1 -1
  13. package/bundles/mis-crystal-design-system-datepicker_v2.umd.js +836 -690
  14. package/bundles/mis-crystal-design-system-datepicker_v2.umd.js.map +1 -1
  15. package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js +1 -15
  16. package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js.map +1 -1
  17. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js +889 -743
  18. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js.map +1 -1
  19. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js +1 -15
  20. package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js.map +1 -1
  21. package/bundles/mis-crystal-design-system-dropdown.umd.js +648 -493
  22. package/bundles/mis-crystal-design-system-dropdown.umd.js.map +1 -1
  23. package/bundles/mis-crystal-design-system-dropdown.umd.min.js +1 -15
  24. package/bundles/mis-crystal-design-system-dropdown.umd.min.js.map +1 -1
  25. package/bundles/mis-crystal-design-system-dynamic-form.umd.js +869 -723
  26. package/bundles/mis-crystal-design-system-dynamic-form.umd.js.map +1 -1
  27. package/bundles/mis-crystal-design-system-dynamic-form.umd.min.js +1 -15
  28. package/bundles/mis-crystal-design-system-dynamic-form.umd.min.js.map +1 -1
  29. package/bundles/mis-crystal-design-system-input.umd.js +1 -1
  30. package/bundles/mis-crystal-design-system-input.umd.min.js +1 -1
  31. package/bundles/mis-crystal-design-system-input.umd.min.js.map +1 -1
  32. package/bundles/mis-crystal-design-system-loader.umd.js +1 -1
  33. package/bundles/mis-crystal-design-system-loader.umd.min.js +1 -1
  34. package/bundles/mis-crystal-design-system-loader.umd.min.js.map +1 -1
  35. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.js +756 -610
  36. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.js.map +1 -1
  37. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.min.js +1 -15
  38. package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.min.js.map +1 -1
  39. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.js +769 -623
  40. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.js.map +1 -1
  41. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.min.js +1 -15
  42. package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.min.js.map +1 -1
  43. package/bundles/mis-crystal-design-system-ske-loader.umd.js +1 -1
  44. package/bundles/mis-crystal-design-system-ske-loader.umd.min.js +1 -1
  45. package/bundles/mis-crystal-design-system-ske-loader.umd.min.js.map +1 -1
  46. package/bundles/mis-crystal-design-system-specificdatepicker.umd.js +1107 -961
  47. package/bundles/mis-crystal-design-system-specificdatepicker.umd.js.map +1 -1
  48. package/bundles/mis-crystal-design-system-specificdatepicker.umd.min.js +1 -15
  49. package/bundles/mis-crystal-design-system-specificdatepicker.umd.min.js.map +1 -1
  50. package/bundles/mis-crystal-design-system-table.umd.js +921 -775
  51. package/bundles/mis-crystal-design-system-table.umd.js.map +1 -1
  52. package/bundles/mis-crystal-design-system-table.umd.min.js +1 -15
  53. package/bundles/mis-crystal-design-system-table.umd.min.js.map +1 -1
  54. package/bundles/mis-crystal-design-system-timepicker.umd.js +813 -667
  55. package/bundles/mis-crystal-design-system-timepicker.umd.js.map +1 -1
  56. package/bundles/mis-crystal-design-system-timepicker.umd.min.js +1 -15
  57. package/bundles/mis-crystal-design-system-timepicker.umd.min.js.map +1 -1
  58. package/bundles/mis-crystal-design-system-toast.umd.js +1 -1
  59. package/bundles/mis-crystal-design-system-toast.umd.js.map +1 -1
  60. package/bundles/mis-crystal-design-system-toast.umd.min.js +1 -1
  61. package/bundles/mis-crystal-design-system-virtual-scroll.umd.js +603 -457
  62. package/bundles/mis-crystal-design-system-virtual-scroll.umd.js.map +1 -1
  63. package/bundles/mis-crystal-design-system-virtual-scroll.umd.min.js +1 -15
  64. package/bundles/mis-crystal-design-system-virtual-scroll.umd.min.js.map +1 -1
  65. package/bundles/mis-crystal-design-system-widgets.umd.js +608 -462
  66. package/bundles/mis-crystal-design-system-widgets.umd.js.map +1 -1
  67. package/bundles/mis-crystal-design-system-widgets.umd.min.js +1 -15
  68. package/bundles/mis-crystal-design-system-widgets.umd.min.js.map +1 -1
  69. package/checkbox/mis-crystal-design-system-checkbox.metadata.json +1 -1
  70. package/datepicker_v2/mis-crystal-design-system-datepicker_v2.metadata.json +1 -1
  71. package/daterangepicker_v2/mis-crystal-design-system-daterangepicker_v2.metadata.json +1 -1
  72. package/dropdown/dropdown.component.d.ts +8 -0
  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/checkbox/checkbox.component.js +1 -1
  77. package/esm2015/datepicker_v2/tz-dp-container/tz-dp-container.component.js +1 -1
  78. package/esm2015/daterangepicker_v2/tz-drp-container/tz-drp-container.component.js +1 -1
  79. package/esm2015/dropdown/dropdown.component.js +12 -3
  80. package/esm2015/dynamic-form/dynamic-form.component.js +1 -1
  81. package/esm2015/input/mis-input.component.js +1 -1
  82. package/esm2015/loader/loader.component.js +1 -1
  83. package/esm2015/multi-select-dropdown/multi-select-dropdown.component.js +3 -3
  84. package/esm2015/nested-multi-select-dropdown/nested-multi-select-dropdown.component.js +1 -1
  85. package/esm2015/ske-loader/ske-loader.component.js +1 -1
  86. package/esm2015/specificdatepicker/tz-sdp-container/tz-sdp-container.component.js +1 -1
  87. package/esm2015/table/table.component.js +1 -1
  88. package/esm2015/toast/mis-crystal-design-system-toast.js +1 -2
  89. package/esm2015/toast/public_api.js +2 -1
  90. package/fesm2015/mis-crystal-design-system-action-list.js +1 -1
  91. package/fesm2015/mis-crystal-design-system-checkbox.js +1 -1
  92. package/fesm2015/mis-crystal-design-system-datepicker_v2.js +1 -1
  93. package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js +1 -1
  94. package/fesm2015/mis-crystal-design-system-dropdown.js +11 -2
  95. package/fesm2015/mis-crystal-design-system-dropdown.js.map +1 -1
  96. package/fesm2015/mis-crystal-design-system-dynamic-form.js +1 -1
  97. package/fesm2015/mis-crystal-design-system-input.js +1 -1
  98. package/fesm2015/mis-crystal-design-system-loader.js +1 -1
  99. package/fesm2015/mis-crystal-design-system-multi-select-dropdown.js +2 -2
  100. package/fesm2015/mis-crystal-design-system-multi-select-dropdown.js.map +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/fesm2015/mis-crystal-design-system-toast.js +1 -1
  106. package/fesm2015/mis-crystal-design-system-toast.js.map +1 -1
  107. package/input/mis-crystal-design-system-input.metadata.json +1 -1
  108. package/loader/mis-crystal-design-system-loader.metadata.json +1 -1
  109. package/multi-select-dropdown/mis-crystal-design-system-multi-select-dropdown.metadata.json +1 -1
  110. package/nested-multi-select-dropdown/mis-crystal-design-system-nested-multi-select-dropdown.metadata.json +1 -1
  111. package/package.json +1 -1
  112. package/ske-loader/mis-crystal-design-system-ske-loader.metadata.json +1 -1
  113. package/specificdatepicker/mis-crystal-design-system-specificdatepicker.metadata.json +1 -1
  114. package/table/mis-crystal-design-system-table.metadata.json +1 -1
  115. package/toast/mis-crystal-design-system-toast.d.ts +0 -1
  116. package/toast/mis-crystal-design-system-toast.metadata.json +1 -1
  117. package/toast/public_api.d.ts +1 -0
@@ -1,685 +1,831 @@
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
- });
20
- }
21
- });
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
+ });
22
20
  }
23
- n['default'] = e;
24
- return Object.freeze(n);
21
+ });
25
22
  }
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 */
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
- }
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
+ };
346
492
 
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
- };
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
+ };
410
556
 
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.triggerChange = true;
429
- this.timeEmitter = new core.EventEmitter();
430
- }
431
- Object.defineProperty(TimePickerComponent.prototype, "timeIntervalRefs", {
432
- // gets all the li elements from the dropdown and scrolls to the highlighted element
433
- set: function (intervals) {
434
- intervals.forEach(function (interval) {
435
- if (interval.nativeElement.classList[0] === "highlight") {
436
- var highlighted_1 = interval.nativeElement;
437
- setTimeout(function () { return highlighted_1.scrollIntoView({ block: "center" }); });
438
- }
439
- });
440
- },
441
- enumerable: false,
442
- configurable: true
443
- });
444
- TimePickerComponent.prototype.ngOnInit = function () {
445
- if (!this.givenTime && !this.minTime) {
446
- this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
447
- var chosenTimeMoment = this.getMoment(this.chosenTime);
448
- this.emitTime({
449
- valid: !this.isInvalid,
450
- time: this.chosenTime,
451
- epoch: chosenTimeMoment.valueOf()
452
- });
453
- }
454
- };
455
- TimePickerComponent.prototype.ngOnChanges = function () {
456
- this.timeFormat = this.clockFormat === 12 ? "hh:mm a" : "HH:mm";
457
- moment.tz.setDefault(this.timezone);
458
- if (this.timeFormat) {
459
- var chosenTimeMoment = this.getMoment(this.chosenTime);
460
- // if the first interval is >= the chosen time
461
- // then only update the value of chosen time
462
- // else it remains the same
463
- if (this.firstInterval >= chosenTimeMoment.valueOf() && this.rangeValidity && !this.userInputFlag) {
464
- this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
465
- chosenTimeMoment = this.getMoment(this.chosenTime);
466
- }
467
- if ((this.givenTimeFlag && this.givenTime) || this.minTime) {
468
- this.chosenTime = moment__namespace(this.minTime || this.givenTime).format(this.timeFormat);
469
- }
470
- chosenTimeMoment = this.getMoment(this.chosenTime);
471
- if (!this.userInputFlag)
472
- this.populateDropdown();
473
- this.userInputFlag = false;
474
- if (this.chosenTime) {
475
- this.isInvalid = !this.checkTimeValidity(this.chosenTime.trim());
476
- this.emitTime({
477
- valid: !this.isInvalid,
478
- time: this.chosenTime,
479
- epoch: chosenTimeMoment.valueOf()
480
- });
481
- this.calculateClosestInterval(this.chosenTime);
482
- }
483
- }
484
- };
485
- TimePickerComponent.prototype.emitTime = function (data) {
486
- this.timeEmitter.emit(data);
487
- };
488
- // function to get moment object when time is given in string
489
- TimePickerComponent.prototype.getMoment = function (time) {
490
- return moment__namespace(moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") + " " + time, "'DD-MM-YYYY' " + this.timeFormat);
491
- };
492
- TimePickerComponent.prototype.closeDropdown = function () {
493
- this.userInputFlag = false;
494
- this.openStatus = false;
495
- if (this.timepickerDirective)
496
- this.timepickerDirective.destroyOverlay();
497
- };
498
- // toggle timepicker dropdown
499
- TimePickerComponent.prototype.openDropdown = function () {
500
- this.openStatus = true;
501
- };
502
- TimePickerComponent.prototype.checkTimeValidity = function (time) {
503
- var RE12 = /^(([0][1-9]|1[0-2]):([0-5][0-9])( )?(am|pm|AM|PM))$/i;
504
- var RE24 = /^([01][0-9]|2[0-3]):[0-5][0-9]$/;
505
- var RE = this.clockFormat === 12 ? RE12 : RE24;
506
- var timeMoment = this.getMoment(time);
507
- var flag = false;
508
- // if the first interval is set to the start of the day
509
- // or a time is already provided to the component to show
510
- // then we don't check its validity against the current time
511
- if (this.minTime ||
512
- this.givenTime ||
513
- (this.firstInterval &&
514
- moment__namespace(this.firstInterval).format(this.timeFormat).valueOf() === moment__namespace().startOf("d").format(this.timeFormat).valueOf())) {
515
- flag = time.match(RE) ? true : false;
516
- }
517
- else {
518
- flag = time.match(RE) && timeMoment.diff(moment__namespace(), "m") >= 0 ? true : false;
519
- }
520
- return flag;
521
- };
522
- // update chosen time as soon as the user clicks on an interval
523
- TimePickerComponent.prototype.onTimeSelect = function (time) {
524
- this.isInvalid = !this.checkTimeValidity(time.trim());
525
- if (!this.isInvalid) {
526
- this.chosenTime = time;
527
- this.calculateClosestInterval(this.chosenTime);
528
- }
529
- var timeMoment = this.getMoment(time);
530
- this.emitTime({
531
- valid: !this.isInvalid,
532
- time: time,
533
- epoch: timeMoment.valueOf()
534
- });
535
- this.openStatus = false;
536
- if (this.timepickerDirective)
537
- this.timepickerDirective.destroyOverlay();
538
- };
539
- // checks validity of time on input change and calculates the closest interval
540
- TimePickerComponent.prototype.onTimeChange = function (time) {
541
- this.isInvalid = !this.checkTimeValidity(time.trim());
542
- if (!this.isInvalid) {
543
- this.userInputFlag = true;
544
- this.openStatus = false;
545
- if (this.timepickerDirective)
546
- this.timepickerDirective.destroyOverlay();
547
- this.calculateClosestInterval(time);
548
- }
549
- var timeMoment = this.getMoment(time);
550
- this.emitTime({
551
- valid: !this.isInvalid,
552
- time: time,
553
- epoch: timeMoment.valueOf()
554
- });
555
- };
556
- TimePickerComponent.prototype.calculateClosestInterval = function (time) {
557
- var _this = this;
558
- var roundedEpoch;
559
- // Converting time and date to a moment object
560
- var chosenDate = moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY"); // 05-01-2024
561
- var parsedTimeWithDate = moment__namespace(chosenDate + " " + time, "DD-MM-YYYY " + this.timeFormat);
562
- // Converting moment object to epoch
563
- var chosenTimeEpoch = parsedTimeWithDate.valueOf();
564
- var offset = this.interval - (moment__namespace(chosenTimeEpoch).minutes() % this.interval);
565
- if (this.minTime && !this.givenTime) {
566
- this.isHighlighted = 0;
567
- return;
568
- }
569
- roundedEpoch = offset >= this.interval / 2 ? (moment__namespace(chosenTimeEpoch).subtract(this.interval - offset, "m")).valueOf() : (moment__namespace(chosenTimeEpoch).add(offset, "m")).valueOf();
570
- // finding the index of element that needs to be highlighted
571
- if (moment__namespace(chosenTimeEpoch).format(this.timeFormat) > moment__namespace(this.dateAsEpoch).endOf("d").subtract(this.interval, "m").format(this.timeFormat)) {
572
- this.isHighlighted = this.timeIntervals.length - 1;
573
- }
574
- else {
575
- var roundedEpochMoment_1 = moment__namespace(roundedEpoch);
576
- this.isHighlighted = this.timeIntervals.findIndex(function (interval) {
577
- var intervalObj = moment__namespace(chosenDate + " " + interval, "DD-MM-YYYY " + _this.timeFormat);
578
- return intervalObj.isSame(roundedEpochMoment_1);
579
- });
580
- }
581
- };
582
- // populates the dropdown according to the first interval received
583
- TimePickerComponent.prototype.populateDropdown = function () {
584
- this.timeIntervals = [];
585
- // if picker is used as an individual component
586
- if (!this.firstInterval) {
587
- // firstInterval is initialised according to the current time
588
- // if the date is same as the current date
589
- if (moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") === moment__namespace().format("DD-MM-YYYY") && !this.minTime) {
590
- var offset = this.interval - (moment__namespace().minutes() % this.interval);
591
- this.firstInterval = moment__namespace().add(offset, "m").valueOf();
592
- }
593
- // if minimum time to show is provided
594
- else if (this.minTime) {
595
- var offset = this.interval - (moment__namespace(this.minTime).minutes() % this.interval);
596
- this.firstInterval = moment__namespace(this.minTime).add(offset, "m").valueOf();
597
- }
598
- // else the firstInterval is initialised as start of day
599
- else {
600
- this.firstInterval = moment__namespace().startOf("d").valueOf();
601
- }
602
- }
603
- if (this.givenTime && this.givenTimeFlag) {
604
- this.firstInterval = moment__namespace(this.givenTime).startOf('d').valueOf();
605
- this.givenTimeFlag = false;
606
- }
607
- var dateAsString = moment__namespace(this.dateAsEpoch).format('DD-MM-YYYY');
608
- var intervalAsString = moment__namespace(this.firstInterval).format(this.timeFormat);
609
- var start = moment__namespace(dateAsString + " " + intervalAsString, "DD-MM-YYYY " + this.timeFormat);
610
- var end = moment__namespace("" + dateAsString, 'DD-MM-YYYY').endOf('d');
611
- while (start.valueOf() < end.valueOf()) {
612
- this.timeIntervals.push(start.format(this.timeFormat));
613
- start.add(this.interval, "m");
614
- }
615
- // if the start time is equal to the interval just before midnight
616
- // and the start date = end date
617
- // push 11:59pm only
618
- if (this.timeIntervals.length === 0) {
619
- this.chosenTime = moment__namespace().endOf("d").format(this.timeFormat);
620
- this.timeIntervals.push(moment__namespace().endOf("d").format(this.timeFormat));
621
- }
622
- };
623
- TimePickerComponent.prototype.ngOnDestroy = function () {
624
- if (this.tooltipDirective)
625
- this.tooltipDirective.hideToolTip();
626
- };
627
- return TimePickerComponent;
628
- }());
629
- TimePickerComponent.decorators = [
630
- { type: core.Component, args: [{
631
- selector: "mis-timepicker",
632
- 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)\"\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",
633
- 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}"]
634
- },] }
635
- ];
636
- TimePickerComponent.ctorParameters = function () { return []; };
637
- TimePickerComponent.propDecorators = {
638
- clockFormat: [{ type: core.Input }],
639
- timezone: [{ type: core.Input }],
640
- height: [{ type: core.Input }],
641
- inputWidth: [{ type: core.Input }],
642
- dropdownWidth: [{ type: core.Input }],
643
- interval: [{ type: core.Input }],
644
- dateAsEpoch: [{ type: core.Input }],
645
- firstInterval: [{ type: core.Input }],
646
- rangeValidity: [{ type: core.Input }],
647
- showTooltip: [{ type: core.Input }],
648
- givenTime: [{ type: core.Input }],
649
- minTime: [{ type: core.Input }],
650
- triggerChange: [{ type: core.Input }],
651
- timeEmitter: [{ type: core.Output }],
652
- input: [{ type: core.ViewChild, args: ["input", { static: true },] }],
653
- timepickerDirective: [{ type: core.ViewChild, args: [TimepickerDirective,] }],
654
- tooltipDirective: [{ type: core.ViewChild, args: [tooltip.ToolTipDirective,] }],
655
- timeIntervalRefs: [{ type: core.ViewChildren, args: ["timeInterval",] }]
656
- };
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.triggerChange = true;
575
+ this.timeEmitter = new core.EventEmitter();
576
+ }
577
+ Object.defineProperty(TimePickerComponent.prototype, "timeIntervalRefs", {
578
+ // gets all the li elements from the dropdown and scrolls to the highlighted element
579
+ set: function (intervals) {
580
+ intervals.forEach(function (interval) {
581
+ if (interval.nativeElement.classList[0] === "highlight") {
582
+ var highlighted_1 = interval.nativeElement;
583
+ setTimeout(function () { return highlighted_1.scrollIntoView({ block: "center" }); });
584
+ }
585
+ });
586
+ },
587
+ enumerable: false,
588
+ configurable: true
589
+ });
590
+ TimePickerComponent.prototype.ngOnInit = function () {
591
+ if (!this.givenTime && !this.minTime) {
592
+ this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
593
+ var chosenTimeMoment = this.getMoment(this.chosenTime);
594
+ this.emitTime({
595
+ valid: !this.isInvalid,
596
+ time: this.chosenTime,
597
+ epoch: chosenTimeMoment.valueOf()
598
+ });
599
+ }
600
+ };
601
+ TimePickerComponent.prototype.ngOnChanges = function () {
602
+ this.timeFormat = this.clockFormat === 12 ? "hh:mm a" : "HH:mm";
603
+ moment.tz.setDefault(this.timezone);
604
+ if (this.timeFormat) {
605
+ var chosenTimeMoment = this.getMoment(this.chosenTime);
606
+ // if the first interval is >= the chosen time
607
+ // then only update the value of chosen time
608
+ // else it remains the same
609
+ if (this.firstInterval >= chosenTimeMoment.valueOf() && this.rangeValidity && !this.userInputFlag) {
610
+ this.chosenTime = moment__namespace(this.firstInterval).format(this.timeFormat);
611
+ chosenTimeMoment = this.getMoment(this.chosenTime);
612
+ }
613
+ if ((this.givenTimeFlag && this.givenTime) || this.minTime) {
614
+ this.chosenTime = moment__namespace(this.minTime || this.givenTime).format(this.timeFormat);
615
+ }
616
+ chosenTimeMoment = this.getMoment(this.chosenTime);
617
+ if (!this.userInputFlag)
618
+ this.populateDropdown();
619
+ this.userInputFlag = false;
620
+ if (this.chosenTime) {
621
+ this.isInvalid = !this.checkTimeValidity(this.chosenTime.trim());
622
+ this.emitTime({
623
+ valid: !this.isInvalid,
624
+ time: this.chosenTime,
625
+ epoch: chosenTimeMoment.valueOf()
626
+ });
627
+ this.calculateClosestInterval(this.chosenTime);
628
+ }
629
+ }
630
+ };
631
+ TimePickerComponent.prototype.emitTime = function (data) {
632
+ this.timeEmitter.emit(data);
633
+ };
634
+ // function to get moment object when time is given in string
635
+ TimePickerComponent.prototype.getMoment = function (time) {
636
+ return moment__namespace(moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") + " " + time, "'DD-MM-YYYY' " + this.timeFormat);
637
+ };
638
+ TimePickerComponent.prototype.closeDropdown = function () {
639
+ this.userInputFlag = false;
640
+ this.openStatus = false;
641
+ if (this.timepickerDirective)
642
+ this.timepickerDirective.destroyOverlay();
643
+ };
644
+ // toggle timepicker dropdown
645
+ TimePickerComponent.prototype.openDropdown = function () {
646
+ this.openStatus = true;
647
+ };
648
+ TimePickerComponent.prototype.checkTimeValidity = function (time) {
649
+ var RE12 = /^(([0][1-9]|1[0-2]):([0-5][0-9])( )?(am|pm|AM|PM))$/i;
650
+ var RE24 = /^([01][0-9]|2[0-3]):[0-5][0-9]$/;
651
+ var RE = this.clockFormat === 12 ? RE12 : RE24;
652
+ var timeMoment = this.getMoment(time);
653
+ var flag = false;
654
+ // if the first interval is set to the start of the day
655
+ // or a time is already provided to the component to show
656
+ // then we don't check its validity against the current time
657
+ if (this.minTime ||
658
+ this.givenTime ||
659
+ (this.firstInterval &&
660
+ moment__namespace(this.firstInterval).format(this.timeFormat).valueOf() === moment__namespace().startOf("d").format(this.timeFormat).valueOf())) {
661
+ flag = time.match(RE) ? true : false;
662
+ }
663
+ else {
664
+ flag = time.match(RE) && timeMoment.diff(moment__namespace(), "m") >= 0 ? true : false;
665
+ }
666
+ return flag;
667
+ };
668
+ // update chosen time as soon as the user clicks on an interval
669
+ TimePickerComponent.prototype.onTimeSelect = function (time) {
670
+ this.isInvalid = !this.checkTimeValidity(time.trim());
671
+ if (!this.isInvalid) {
672
+ this.chosenTime = time;
673
+ this.calculateClosestInterval(this.chosenTime);
674
+ }
675
+ var timeMoment = this.getMoment(time);
676
+ this.emitTime({
677
+ valid: !this.isInvalid,
678
+ time: time,
679
+ epoch: timeMoment.valueOf()
680
+ });
681
+ this.openStatus = false;
682
+ if (this.timepickerDirective)
683
+ this.timepickerDirective.destroyOverlay();
684
+ };
685
+ // checks validity of time on input change and calculates the closest interval
686
+ TimePickerComponent.prototype.onTimeChange = function (time) {
687
+ this.isInvalid = !this.checkTimeValidity(time.trim());
688
+ if (!this.isInvalid) {
689
+ this.userInputFlag = true;
690
+ this.openStatus = false;
691
+ if (this.timepickerDirective)
692
+ this.timepickerDirective.destroyOverlay();
693
+ this.calculateClosestInterval(time);
694
+ }
695
+ var timeMoment = this.getMoment(time);
696
+ this.emitTime({
697
+ valid: !this.isInvalid,
698
+ time: time,
699
+ epoch: timeMoment.valueOf()
700
+ });
701
+ };
702
+ TimePickerComponent.prototype.calculateClosestInterval = function (time) {
703
+ var _this = this;
704
+ var roundedEpoch;
705
+ // Converting time and date to a moment object
706
+ var chosenDate = moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY"); // 05-01-2024
707
+ var parsedTimeWithDate = moment__namespace(chosenDate + " " + time, "DD-MM-YYYY " + this.timeFormat);
708
+ // Converting moment object to epoch
709
+ var chosenTimeEpoch = parsedTimeWithDate.valueOf();
710
+ var offset = this.interval - (moment__namespace(chosenTimeEpoch).minutes() % this.interval);
711
+ if (this.minTime && !this.givenTime) {
712
+ this.isHighlighted = 0;
713
+ return;
714
+ }
715
+ roundedEpoch = offset >= this.interval / 2 ? (moment__namespace(chosenTimeEpoch).subtract(this.interval - offset, "m")).valueOf() : (moment__namespace(chosenTimeEpoch).add(offset, "m")).valueOf();
716
+ // finding the index of element that needs to be highlighted
717
+ if (moment__namespace(chosenTimeEpoch).format(this.timeFormat) > moment__namespace(this.dateAsEpoch).endOf("d").subtract(this.interval, "m").format(this.timeFormat)) {
718
+ this.isHighlighted = this.timeIntervals.length - 1;
719
+ }
720
+ else {
721
+ var roundedEpochMoment_1 = moment__namespace(roundedEpoch);
722
+ this.isHighlighted = this.timeIntervals.findIndex(function (interval) {
723
+ var intervalObj = moment__namespace(chosenDate + " " + interval, "DD-MM-YYYY " + _this.timeFormat);
724
+ return intervalObj.isSame(roundedEpochMoment_1);
725
+ });
726
+ }
727
+ };
728
+ // populates the dropdown according to the first interval received
729
+ TimePickerComponent.prototype.populateDropdown = function () {
730
+ this.timeIntervals = [];
731
+ // if picker is used as an individual component
732
+ if (!this.firstInterval) {
733
+ // firstInterval is initialised according to the current time
734
+ // if the date is same as the current date
735
+ if (moment__namespace(this.dateAsEpoch).format("DD-MM-YYYY") === moment__namespace().format("DD-MM-YYYY") && !this.minTime) {
736
+ var offset = this.interval - (moment__namespace().minutes() % this.interval);
737
+ this.firstInterval = moment__namespace().add(offset, "m").valueOf();
738
+ }
739
+ // if minimum time to show is provided
740
+ else if (this.minTime) {
741
+ var offset = this.interval - (moment__namespace(this.minTime).minutes() % this.interval);
742
+ this.firstInterval = moment__namespace(this.minTime).add(offset, "m").valueOf();
743
+ }
744
+ // else the firstInterval is initialised as start of day
745
+ else {
746
+ this.firstInterval = moment__namespace().startOf("d").valueOf();
747
+ }
748
+ }
749
+ if (this.givenTime && this.givenTimeFlag) {
750
+ this.firstInterval = moment__namespace(this.givenTime).startOf('d').valueOf();
751
+ this.givenTimeFlag = false;
752
+ }
753
+ var dateAsString = moment__namespace(this.dateAsEpoch).format('DD-MM-YYYY');
754
+ var intervalAsString = moment__namespace(this.firstInterval).format(this.timeFormat);
755
+ var start = moment__namespace(dateAsString + " " + intervalAsString, "DD-MM-YYYY " + this.timeFormat);
756
+ var end = moment__namespace("" + dateAsString, 'DD-MM-YYYY').endOf('d');
757
+ while (start.valueOf() < end.valueOf()) {
758
+ this.timeIntervals.push(start.format(this.timeFormat));
759
+ start.add(this.interval, "m");
760
+ }
761
+ // if the start time is equal to the interval just before midnight
762
+ // and the start date = end date
763
+ // push 11:59pm only
764
+ if (this.timeIntervals.length === 0) {
765
+ this.chosenTime = moment__namespace().endOf("d").format(this.timeFormat);
766
+ this.timeIntervals.push(moment__namespace().endOf("d").format(this.timeFormat));
767
+ }
768
+ };
769
+ TimePickerComponent.prototype.ngOnDestroy = function () {
770
+ if (this.tooltipDirective)
771
+ this.tooltipDirective.hideToolTip();
772
+ };
773
+ return TimePickerComponent;
774
+ }());
775
+ TimePickerComponent.decorators = [
776
+ { type: core.Component, args: [{
777
+ selector: "mis-timepicker",
778
+ 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)\"\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",
779
+ 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}"]
780
+ },] }
781
+ ];
782
+ TimePickerComponent.ctorParameters = function () { return []; };
783
+ TimePickerComponent.propDecorators = {
784
+ clockFormat: [{ type: core.Input }],
785
+ timezone: [{ type: core.Input }],
786
+ height: [{ type: core.Input }],
787
+ inputWidth: [{ type: core.Input }],
788
+ dropdownWidth: [{ type: core.Input }],
789
+ interval: [{ type: core.Input }],
790
+ dateAsEpoch: [{ type: core.Input }],
791
+ firstInterval: [{ type: core.Input }],
792
+ rangeValidity: [{ type: core.Input }],
793
+ showTooltip: [{ type: core.Input }],
794
+ givenTime: [{ type: core.Input }],
795
+ minTime: [{ type: core.Input }],
796
+ triggerChange: [{ type: core.Input }],
797
+ timeEmitter: [{ type: core.Output }],
798
+ input: [{ type: core.ViewChild, args: ["input", { static: true },] }],
799
+ timepickerDirective: [{ type: core.ViewChild, args: [TimepickerDirective,] }],
800
+ tooltipDirective: [{ type: core.ViewChild, args: [tooltip.ToolTipDirective,] }],
801
+ timeIntervalRefs: [{ type: core.ViewChildren, args: ["timeInterval",] }]
802
+ };
657
803
 
658
- var TimePickerModule = /** @class */ (function () {
659
- function TimePickerModule() {
660
- }
661
- TimePickerModule.forRoot = function () {
662
- return { ngModule: TimePickerModule, providers: [] };
663
- };
664
- return TimePickerModule;
665
- }());
666
- TimePickerModule.decorators = [
667
- { type: core.NgModule, args: [{
668
- declarations: [TimePickerComponent, TimepickerDirective],
669
- imports: [common.CommonModule, forms.FormsModule, tooltip.ToolTipModule, overlay.OverlayModule],
670
- exports: [TimePickerComponent]
671
- },] }
672
- ];
804
+ var TimePickerModule = /** @class */ (function () {
805
+ function TimePickerModule() {
806
+ }
807
+ TimePickerModule.forRoot = function () {
808
+ return { ngModule: TimePickerModule, providers: [] };
809
+ };
810
+ return TimePickerModule;
811
+ }());
812
+ TimePickerModule.decorators = [
813
+ { type: core.NgModule, args: [{
814
+ declarations: [TimePickerComponent, TimepickerDirective],
815
+ imports: [common.CommonModule, forms.FormsModule, tooltip.ToolTipModule, overlay.OverlayModule],
816
+ exports: [TimePickerComponent]
817
+ },] }
818
+ ];
673
819
 
674
- /**
675
- * Generated bundle index. Do not edit.
676
- */
820
+ /**
821
+ * Generated bundle index. Do not edit.
822
+ */
677
823
 
678
- exports.TimePickerComponent = TimePickerComponent;
679
- exports.TimePickerModule = TimePickerModule;
680
- exports.ɵa = TimepickerDirective;
824
+ exports.TimePickerComponent = TimePickerComponent;
825
+ exports.TimePickerModule = TimePickerModule;
826
+ exports.ɵa = TimepickerDirective;
681
827
 
682
- Object.defineProperty(exports, '__esModule', { value: true });
828
+ Object.defineProperty(exports, '__esModule', { value: true });
683
829
 
684
830
  })));
685
831
  //# sourceMappingURL=mis-crystal-design-system-timepicker.umd.js.map