nxt-pick-datetime 12.0.1 → 13.0.0

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 (74) hide show
  1. package/{esm2015/lib/class/date-time-adapter.class.js → esm2020/lib/class/date-time-adapter.class.mjs} +0 -0
  2. package/{esm2015/lib/class/date-time-format.class.js → esm2020/lib/class/date-time-format.class.mjs} +1 -1
  3. package/esm2020/lib/class/date-time.class.mjs +161 -0
  4. package/{esm2015/lib/class/dialog-config.class.js → esm2020/lib/class/dialog-config.class.mjs} +0 -0
  5. package/esm2020/lib/class/dialog-ref.class.mjs +121 -0
  6. package/esm2020/lib/date-time/calendar/calendar.component.mjs +345 -0
  7. package/esm2020/lib/date-time/calendar-body/calendar-body.component.mjs +145 -0
  8. package/esm2020/lib/date-time/calendar-month-view/calendar-month-view.component.mjs +438 -0
  9. package/esm2020/lib/date-time/calendar-multi-year-view/calendar-multi-year-view.component.mjs +359 -0
  10. package/esm2020/lib/date-time/calendar-year-view/calendar-year-view.component.mjs +369 -0
  11. package/esm2020/lib/date-time/date-time-inline/date-time-inline.component.mjs +264 -0
  12. package/{esm2015/lib/date-time/date-time-picker/date-time-picker.component.js → esm2020/lib/date-time/date-time-picker/date-time-picker.component.mjs} +13 -14
  13. package/{esm2015/lib/date-time/date-time-picker-container/date-time-picker-container.animations.js → esm2020/lib/date-time/date-time-picker-container/date-time-picker-container.animations.mjs} +1 -1
  14. package/{esm2015/lib/date-time/date-time-picker-container/date-time-picker-container.component.js → esm2020/lib/date-time/date-time-picker-container/date-time-picker-container.component.mjs} +6 -14
  15. package/esm2020/lib/date-time/date-time-picker-input.directive.mjs +624 -0
  16. package/{esm2015/lib/date-time/date-time-picker-intl.service.js → esm2020/lib/date-time/date-time-picker-intl.service.mjs} +3 -3
  17. package/{esm2015/lib/date-time/date-time-picker-trigger.directive.js → esm2020/lib/date-time/date-time-picker-trigger.directive.mjs} +3 -3
  18. package/{esm2015/lib/date-time/date-time.module.js → esm2020/lib/date-time/date-time.module.mjs} +4 -4
  19. package/{esm2015/lib/date-time/number-fixed-len.pipe.js → esm2020/lib/date-time/number-fixed-len.pipe.mjs} +3 -3
  20. package/{esm2015/lib/date-time/timer/timer.component.js → esm2020/lib/date-time/timer/timer.component.mjs} +5 -12
  21. package/esm2020/lib/date-time/timer-box/timer-box.component.mjs +88 -0
  22. package/{esm2015/lib/dialog/dialog-container/dialog-container.component.js → esm2020/lib/dialog/dialog-container/dialog-container.component.mjs} +6 -10
  23. package/{esm2015/lib/dialog/dialog.module.js → esm2020/lib/dialog/dialog.module.mjs} +4 -4
  24. package/esm2020/lib/dialog/dialog.service.mjs +240 -0
  25. package/{esm2015/lib/utils/object.js → esm2020/lib/utils/object.mjs} +0 -0
  26. package/{esm2015/moment-adapter/date-time-adapter.class.js → esm2020/moment-adapter/date-time-adapter.class.mjs} +4 -4
  27. package/{esm2015/moment-adapter/date-time-format.class.js → esm2020/moment-adapter/date-time-format.class.mjs} +0 -0
  28. package/{esm2015/moment-adapter/moment-adapter.module.js → esm2020/moment-adapter/moment-adapter.module.mjs} +8 -8
  29. package/{esm2015/moment-adapter/nxt-pick-datetime-moment-adapter.js → esm2020/moment-adapter/nxt-pick-datetime-moment-adapter.mjs} +0 -0
  30. package/{esm2015/moment-adapter/public-api.js → esm2020/moment-adapter/public-api.mjs} +0 -0
  31. package/{esm2015/native-adapter/date-time-adapter.class.js → esm2020/native-adapter/date-time-adapter.class.mjs} +5 -5
  32. package/{esm2015/native-adapter/date-time-format.class.js → esm2020/native-adapter/date-time-format.class.mjs} +0 -0
  33. package/{esm2015/native-adapter/native-adapter.module.js → esm2020/native-adapter/native-adapter.module.mjs} +8 -8
  34. package/{esm2015/native-adapter/nxt-pick-datetime-native-adapter.js → esm2020/native-adapter/nxt-pick-datetime-native-adapter.mjs} +0 -0
  35. package/{esm2015/native-adapter/public-api.js → esm2020/native-adapter/public-api.mjs} +0 -0
  36. package/{esm2015/nxt-pick-datetime.js → esm2020/nxt-pick-datetime.mjs} +0 -0
  37. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  38. package/fesm2015/nxt-pick-datetime-moment-adapter.mjs +269 -0
  39. package/fesm2015/nxt-pick-datetime-moment-adapter.mjs.map +1 -0
  40. package/fesm2015/nxt-pick-datetime-native-adapter.mjs +392 -0
  41. package/fesm2015/nxt-pick-datetime-native-adapter.mjs.map +1 -0
  42. package/fesm2015/nxt-pick-datetime.mjs +4974 -0
  43. package/fesm2015/nxt-pick-datetime.mjs.map +1 -0
  44. package/{fesm2015/nxt-pick-datetime-moment-adapter.js → fesm2020/nxt-pick-datetime-moment-adapter.mjs} +11 -12
  45. package/fesm2020/nxt-pick-datetime-moment-adapter.mjs.map +1 -0
  46. package/{fesm2015/nxt-pick-datetime-native-adapter.js → fesm2020/nxt-pick-datetime-native-adapter.mjs} +12 -13
  47. package/fesm2020/nxt-pick-datetime-native-adapter.mjs.map +1 -0
  48. package/{fesm2015/nxt-pick-datetime.js → fesm2020/nxt-pick-datetime.mjs} +128 -193
  49. package/fesm2020/nxt-pick-datetime.mjs.map +1 -0
  50. package/lib/class/dialog-ref.class.d.ts +2 -0
  51. package/lib/dialog/dialog.service.d.ts +2 -1
  52. package/moment-adapter/package.json +5 -5
  53. package/native-adapter/package.json +5 -5
  54. package/package.json +40 -11
  55. package/bundles/nxt-pick-datetime-moment-adapter.umd.js +0 -629
  56. package/bundles/nxt-pick-datetime-moment-adapter.umd.js.map +0 -1
  57. package/bundles/nxt-pick-datetime-native-adapter.umd.js +0 -750
  58. package/bundles/nxt-pick-datetime-native-adapter.umd.js.map +0 -1
  59. package/bundles/nxt-pick-datetime.umd.js +0 -6150
  60. package/bundles/nxt-pick-datetime.umd.js.map +0 -1
  61. package/esm2015/lib/class/date-time.class.js +0 -163
  62. package/esm2015/lib/class/dialog-ref.class.js +0 -113
  63. package/esm2015/lib/date-time/calendar/calendar.component.js +0 -354
  64. package/esm2015/lib/date-time/calendar-body/calendar-body.component.js +0 -153
  65. package/esm2015/lib/date-time/calendar-month-view/calendar-month-view.component.js +0 -447
  66. package/esm2015/lib/date-time/calendar-multi-year-view/calendar-multi-year-view.component.js +0 -364
  67. package/esm2015/lib/date-time/calendar-year-view/calendar-year-view.component.js +0 -376
  68. package/esm2015/lib/date-time/date-time-inline/date-time-inline.component.js +0 -269
  69. package/esm2015/lib/date-time/date-time-picker-input.directive.js +0 -626
  70. package/esm2015/lib/date-time/timer-box/timer-box.component.js +0 -95
  71. package/esm2015/lib/dialog/dialog.service.js +0 -238
  72. package/fesm2015/nxt-pick-datetime-moment-adapter.js.map +0 -1
  73. package/fesm2015/nxt-pick-datetime-native-adapter.js.map +0 -1
  74. package/fesm2015/nxt-pick-datetime.js.map +0 -1
@@ -1,629 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('nxt-pick-datetime'), require('moment')) :
3
- typeof define === 'function' && define.amd ? define('nxt-pick-datetime/moment-adapter', ['exports', '@angular/core', 'nxt-pick-datetime', 'moment'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['nxt-pick-datetime'] = global['nxt-pick-datetime'] || {}, global['nxt-pick-datetime']['moment-adapter'] = {}), global.ng.core, global['nxt-pick-datetime'], global.moment));
5
- }(this, (function (exports, i0, nxtPickDatetime, moment) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () {
19
- return e[k];
20
- }
21
- });
22
- }
23
- });
24
- }
25
- n['default'] = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
- var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
31
-
32
- /*! *****************************************************************************
33
- Copyright (c) Microsoft Corporation.
34
-
35
- Permission to use, copy, modify, and/or distribute this software for any
36
- purpose with or without fee is hereby granted.
37
-
38
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
39
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
41
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
42
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
43
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
44
- PERFORMANCE OF THIS SOFTWARE.
45
- ***************************************************************************** */
46
- /* global Reflect, Promise */
47
- var extendStatics = function (d, b) {
48
- extendStatics = Object.setPrototypeOf ||
49
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
50
- function (d, b) { for (var p in b)
51
- if (Object.prototype.hasOwnProperty.call(b, p))
52
- d[p] = b[p]; };
53
- return extendStatics(d, b);
54
- };
55
- function __extends(d, b) {
56
- if (typeof b !== "function" && b !== null)
57
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
58
- extendStatics(d, b);
59
- function __() { this.constructor = d; }
60
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
61
- }
62
- var __assign = function () {
63
- __assign = Object.assign || function __assign(t) {
64
- for (var s, i = 1, n = arguments.length; i < n; i++) {
65
- s = arguments[i];
66
- for (var p in s)
67
- if (Object.prototype.hasOwnProperty.call(s, p))
68
- t[p] = s[p];
69
- }
70
- return t;
71
- };
72
- return __assign.apply(this, arguments);
73
- };
74
- function __rest(s, e) {
75
- var t = {};
76
- for (var p in s)
77
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
78
- t[p] = s[p];
79
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
80
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
81
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
82
- t[p[i]] = s[p[i]];
83
- }
84
- return t;
85
- }
86
- function __decorate(decorators, target, key, desc) {
87
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
88
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
89
- r = Reflect.decorate(decorators, target, key, desc);
90
- else
91
- for (var i = decorators.length - 1; i >= 0; i--)
92
- if (d = decorators[i])
93
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
94
- return c > 3 && r && Object.defineProperty(target, key, r), r;
95
- }
96
- function __param(paramIndex, decorator) {
97
- return function (target, key) { decorator(target, key, paramIndex); };
98
- }
99
- function __metadata(metadataKey, metadataValue) {
100
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
101
- return Reflect.metadata(metadataKey, metadataValue);
102
- }
103
- function __awaiter(thisArg, _arguments, P, generator) {
104
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
105
- return new (P || (P = Promise))(function (resolve, reject) {
106
- function fulfilled(value) { try {
107
- step(generator.next(value));
108
- }
109
- catch (e) {
110
- reject(e);
111
- } }
112
- function rejected(value) { try {
113
- step(generator["throw"](value));
114
- }
115
- catch (e) {
116
- reject(e);
117
- } }
118
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
119
- step((generator = generator.apply(thisArg, _arguments || [])).next());
120
- });
121
- }
122
- function __generator(thisArg, body) {
123
- var _ = { label: 0, sent: function () { if (t[0] & 1)
124
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
125
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
126
- function verb(n) { return function (v) { return step([n, v]); }; }
127
- function step(op) {
128
- if (f)
129
- throw new TypeError("Generator is already executing.");
130
- while (_)
131
- try {
132
- 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)
133
- return t;
134
- if (y = 0, t)
135
- op = [op[0] & 2, t.value];
136
- switch (op[0]) {
137
- case 0:
138
- case 1:
139
- t = op;
140
- break;
141
- case 4:
142
- _.label++;
143
- return { value: op[1], done: false };
144
- case 5:
145
- _.label++;
146
- y = op[1];
147
- op = [0];
148
- continue;
149
- case 7:
150
- op = _.ops.pop();
151
- _.trys.pop();
152
- continue;
153
- default:
154
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
155
- _ = 0;
156
- continue;
157
- }
158
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
159
- _.label = op[1];
160
- break;
161
- }
162
- if (op[0] === 6 && _.label < t[1]) {
163
- _.label = t[1];
164
- t = op;
165
- break;
166
- }
167
- if (t && _.label < t[2]) {
168
- _.label = t[2];
169
- _.ops.push(op);
170
- break;
171
- }
172
- if (t[2])
173
- _.ops.pop();
174
- _.trys.pop();
175
- continue;
176
- }
177
- op = body.call(thisArg, _);
178
- }
179
- catch (e) {
180
- op = [6, e];
181
- y = 0;
182
- }
183
- finally {
184
- f = t = 0;
185
- }
186
- if (op[0] & 5)
187
- throw op[1];
188
- return { value: op[0] ? op[1] : void 0, done: true };
189
- }
190
- }
191
- var __createBinding = Object.create ? (function (o, m, k, k2) {
192
- if (k2 === undefined)
193
- k2 = k;
194
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
195
- }) : (function (o, m, k, k2) {
196
- if (k2 === undefined)
197
- k2 = k;
198
- o[k2] = m[k];
199
- });
200
- function __exportStar(m, o) {
201
- for (var p in m)
202
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
203
- __createBinding(o, m, p);
204
- }
205
- function __values(o) {
206
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
207
- if (m)
208
- return m.call(o);
209
- if (o && typeof o.length === "number")
210
- return {
211
- next: function () {
212
- if (o && i >= o.length)
213
- o = void 0;
214
- return { value: o && o[i++], done: !o };
215
- }
216
- };
217
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
218
- }
219
- function __read(o, n) {
220
- var m = typeof Symbol === "function" && o[Symbol.iterator];
221
- if (!m)
222
- return o;
223
- var i = m.call(o), r, ar = [], e;
224
- try {
225
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
226
- ar.push(r.value);
227
- }
228
- catch (error) {
229
- e = { error: error };
230
- }
231
- finally {
232
- try {
233
- if (r && !r.done && (m = i["return"]))
234
- m.call(i);
235
- }
236
- finally {
237
- if (e)
238
- throw e.error;
239
- }
240
- }
241
- return ar;
242
- }
243
- /** @deprecated */
244
- function __spread() {
245
- for (var ar = [], i = 0; i < arguments.length; i++)
246
- ar = ar.concat(__read(arguments[i]));
247
- return ar;
248
- }
249
- /** @deprecated */
250
- function __spreadArrays() {
251
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
252
- s += arguments[i].length;
253
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
254
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
255
- r[k] = a[j];
256
- return r;
257
- }
258
- function __spreadArray(to, from) {
259
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
260
- to[j] = from[i];
261
- return to;
262
- }
263
- function __await(v) {
264
- return this instanceof __await ? (this.v = v, this) : new __await(v);
265
- }
266
- function __asyncGenerator(thisArg, _arguments, generator) {
267
- if (!Symbol.asyncIterator)
268
- throw new TypeError("Symbol.asyncIterator is not defined.");
269
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
270
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
271
- function verb(n) { if (g[n])
272
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
273
- function resume(n, v) { try {
274
- step(g[n](v));
275
- }
276
- catch (e) {
277
- settle(q[0][3], e);
278
- } }
279
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
280
- function fulfill(value) { resume("next", value); }
281
- function reject(value) { resume("throw", value); }
282
- function settle(f, v) { if (f(v), q.shift(), q.length)
283
- resume(q[0][0], q[0][1]); }
284
- }
285
- function __asyncDelegator(o) {
286
- var i, p;
287
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
288
- 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; }
289
- }
290
- function __asyncValues(o) {
291
- if (!Symbol.asyncIterator)
292
- throw new TypeError("Symbol.asyncIterator is not defined.");
293
- var m = o[Symbol.asyncIterator], i;
294
- 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);
295
- 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); }); }; }
296
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
297
- }
298
- function __makeTemplateObject(cooked, raw) {
299
- if (Object.defineProperty) {
300
- Object.defineProperty(cooked, "raw", { value: raw });
301
- }
302
- else {
303
- cooked.raw = raw;
304
- }
305
- return cooked;
306
- }
307
- ;
308
- var __setModuleDefault = Object.create ? (function (o, v) {
309
- Object.defineProperty(o, "default", { enumerable: true, value: v });
310
- }) : function (o, v) {
311
- o["default"] = v;
312
- };
313
- function __importStar(mod) {
314
- if (mod && mod.__esModule)
315
- return mod;
316
- var result = {};
317
- if (mod != null)
318
- for (var k in mod)
319
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
320
- __createBinding(result, mod, k);
321
- __setModuleDefault(result, mod);
322
- return result;
323
- }
324
- function __importDefault(mod) {
325
- return (mod && mod.__esModule) ? mod : { default: mod };
326
- }
327
- function __classPrivateFieldGet(receiver, state, kind, f) {
328
- if (kind === "a" && !f)
329
- throw new TypeError("Private accessor was defined without a getter");
330
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
331
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
332
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
333
- }
334
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
335
- if (kind === "m")
336
- throw new TypeError("Private method is not writable");
337
- if (kind === "a" && !f)
338
- throw new TypeError("Private accessor was defined without a setter");
339
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
340
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
341
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
342
- }
343
-
344
- /** InjectionToken for moment date adapter to configure options. */
345
- var OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS = new i0.InjectionToken('OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS', {
346
- providedIn: 'root',
347
- factory: OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY
348
- });
349
- /** @docs-private */
350
- function OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY() {
351
- return {
352
- useUtc: false
353
- };
354
- }
355
- /** Creates an array and fills it with values. */
356
- function range(length, valueFunction) {
357
- var valuesArray = Array(length);
358
- for (var i = 0; i < length; i++) {
359
- valuesArray[i] = valueFunction(i);
360
- }
361
- return valuesArray;
362
- }
363
- var MomentDateTimeAdapter = /** @class */ (function (_super) {
364
- __extends(MomentDateTimeAdapter, _super);
365
- function MomentDateTimeAdapter(owlDateTimeLocale, options) {
366
- var _this = _super.call(this) || this;
367
- _this.options = options;
368
- _this.setLocale(owlDateTimeLocale || moment__default['default'].locale());
369
- return _this;
370
- }
371
- MomentDateTimeAdapter.prototype.setLocale = function (locale) {
372
- var _this = this;
373
- _super.prototype.setLocale.call(this, locale);
374
- var momentLocaleData = moment__default['default'].localeData(locale);
375
- this._localeData = {
376
- longMonths: momentLocaleData.months(),
377
- shortMonths: momentLocaleData.monthsShort(),
378
- longDaysOfWeek: momentLocaleData.weekdays(),
379
- shortDaysOfWeek: momentLocaleData.weekdaysShort(),
380
- narrowDaysOfWeek: momentLocaleData.weekdaysMin(),
381
- dates: range(31, function (i) { return _this.createDate(2017, 0, i + 1).format('D'); })
382
- };
383
- };
384
- MomentDateTimeAdapter.prototype.getYear = function (date) {
385
- return this.clone(date).year();
386
- };
387
- MomentDateTimeAdapter.prototype.getMonth = function (date) {
388
- return this.clone(date).month();
389
- };
390
- MomentDateTimeAdapter.prototype.getDay = function (date) {
391
- return this.clone(date).day();
392
- };
393
- MomentDateTimeAdapter.prototype.getDate = function (date) {
394
- return this.clone(date).date();
395
- };
396
- MomentDateTimeAdapter.prototype.getHours = function (date) {
397
- return this.clone(date).hours();
398
- };
399
- MomentDateTimeAdapter.prototype.getMinutes = function (date) {
400
- return this.clone(date).minutes();
401
- };
402
- MomentDateTimeAdapter.prototype.getSeconds = function (date) {
403
- return this.clone(date).seconds();
404
- };
405
- MomentDateTimeAdapter.prototype.getTime = function (date) {
406
- return this.clone(date).valueOf();
407
- };
408
- MomentDateTimeAdapter.prototype.getNumDaysInMonth = function (date) {
409
- return this.clone(date).daysInMonth();
410
- };
411
- MomentDateTimeAdapter.prototype.differenceInCalendarDays = function (dateLeft, dateRight) {
412
- return this.clone(dateLeft).diff(dateRight, 'days');
413
- };
414
- MomentDateTimeAdapter.prototype.getYearName = function (date) {
415
- return this.clone(date).format('YYYY');
416
- };
417
- MomentDateTimeAdapter.prototype.getMonthNames = function (style) {
418
- return style === 'long' ? this._localeData.longMonths : this._localeData.shortMonths;
419
- };
420
- MomentDateTimeAdapter.prototype.getDayOfWeekNames = function (style) {
421
- if (style === 'long') {
422
- return this._localeData.longDaysOfWeek;
423
- }
424
- if (style === 'short') {
425
- return this._localeData.shortDaysOfWeek;
426
- }
427
- return this._localeData.narrowDaysOfWeek;
428
- };
429
- MomentDateTimeAdapter.prototype.getDateNames = function () {
430
- return this._localeData.dates;
431
- };
432
- MomentDateTimeAdapter.prototype.toIso8601 = function (date) {
433
- return this.clone(date).format();
434
- };
435
- MomentDateTimeAdapter.prototype.isEqual = function (dateLeft, dateRight) {
436
- if (dateLeft && dateRight) {
437
- return this.clone(dateLeft).isSame(this.clone(dateRight));
438
- }
439
- return dateLeft === dateRight;
440
- };
441
- MomentDateTimeAdapter.prototype.isSameDay = function (dateLeft, dateRight) {
442
- if (dateLeft && dateRight) {
443
- return this.clone(dateLeft).isSame(this.clone(dateRight), 'day');
444
- }
445
- return dateLeft === dateRight;
446
- };
447
- MomentDateTimeAdapter.prototype.isValid = function (date) {
448
- return this.clone(date).isValid();
449
- };
450
- MomentDateTimeAdapter.prototype.invalid = function () {
451
- return moment__default['default'].invalid();
452
- };
453
- MomentDateTimeAdapter.prototype.isDateInstance = function (obj) {
454
- return moment__default['default'].isMoment(obj);
455
- };
456
- MomentDateTimeAdapter.prototype.addCalendarYears = function (date, amount) {
457
- return this.clone(date).add({ years: amount });
458
- };
459
- MomentDateTimeAdapter.prototype.addCalendarMonths = function (date, amount) {
460
- return this.clone(date).add({ months: amount });
461
- };
462
- MomentDateTimeAdapter.prototype.addCalendarDays = function (date, amount) {
463
- return this.clone(date).add({ days: amount });
464
- };
465
- MomentDateTimeAdapter.prototype.setHours = function (date, amount) {
466
- return this.clone(date).hours(amount);
467
- };
468
- MomentDateTimeAdapter.prototype.setMinutes = function (date, amount) {
469
- return this.clone(date).minutes(amount);
470
- };
471
- MomentDateTimeAdapter.prototype.setSeconds = function (date, amount) {
472
- return this.clone(date).seconds(amount);
473
- };
474
- MomentDateTimeAdapter.prototype.createDate = function (year, month, date, hours, minutes, seconds) {
475
- if (hours === void 0) { hours = 0; }
476
- if (minutes === void 0) { minutes = 0; }
477
- if (seconds === void 0) { seconds = 0; }
478
- if (month < 0 || month > 11) {
479
- throw Error("Invalid month index \"" + month + "\". Month index has to be between 0 and 11.");
480
- }
481
- if (date < 1) {
482
- throw Error("Invalid date \"" + date + "\". Date has to be greater than 0.");
483
- }
484
- if (hours < 0 || hours > 23) {
485
- throw Error("Invalid hours \"" + hours + "\". Hours has to be between 0 and 23.");
486
- }
487
- if (minutes < 0 || minutes > 59) {
488
- throw Error("Invalid minutes \"" + minutes + "\". Minutes has to between 0 and 59.");
489
- }
490
- if (seconds < 0 || seconds > 59) {
491
- throw Error("Invalid seconds \"" + seconds + "\". Seconds has to be between 0 and 59.");
492
- }
493
- var result = this.createMoment({ year: year, month: month, date: date, hours: hours, minutes: minutes, seconds: seconds }).locale(this.locale);
494
- // If the result isn't valid, the date must have been out of bounds for this month.
495
- if (!result.isValid()) {
496
- throw Error("Invalid date \"" + date + "\" for month with index \"" + month + "\".");
497
- }
498
- return result;
499
- };
500
- MomentDateTimeAdapter.prototype.clone = function (date) {
501
- return this.createMoment(date).clone().locale(this.locale);
502
- };
503
- MomentDateTimeAdapter.prototype.now = function () {
504
- return this.createMoment().locale(this.locale);
505
- };
506
- MomentDateTimeAdapter.prototype.format = function (date, displayFormat) {
507
- date = this.clone(date);
508
- if (!this.isValid(date)) {
509
- throw Error('MomentDateTimeAdapter: Cannot format invalid date.');
510
- }
511
- return date.format(displayFormat);
512
- };
513
- MomentDateTimeAdapter.prototype.parse = function (value, parseFormat) {
514
- if (value && typeof value === 'string') {
515
- return this.createMoment(value, parseFormat, this.locale);
516
- }
517
- return value ? this.createMoment(value).locale(this.locale) : null;
518
- };
519
- /**
520
- * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings
521
- * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty
522
- * string into null. Returns an invalid date for all other values.
523
- */
524
- MomentDateTimeAdapter.prototype.deserialize = function (value) {
525
- var date;
526
- if (value instanceof Date) {
527
- date = this.createMoment(value);
528
- }
529
- if (typeof value === 'string') {
530
- if (!value) {
531
- return null;
532
- }
533
- date = this.createMoment(value, moment__default['default'].ISO_8601).locale(this.locale);
534
- }
535
- if (date && this.isValid(date)) {
536
- return date;
537
- }
538
- return _super.prototype.deserialize.call(this, value);
539
- };
540
- /** Creates a Moment instance while respecting the current UTC settings. */
541
- MomentDateTimeAdapter.prototype.createMoment = function () {
542
- var args = [];
543
- for (var _i = 0; _i < arguments.length; _i++) {
544
- args[_i] = arguments[_i];
545
- }
546
- return (this.options && this.options.useUtc) ? moment__default['default'].utc.apply(moment__default['default'], __spreadArray([], __read(args))) : moment__default['default'].apply(void 0, __spreadArray([], __read(args)));
547
- };
548
- return MomentDateTimeAdapter;
549
- }(nxtPickDatetime.DateTimeAdapter));
550
- MomentDateTimeAdapter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: MomentDateTimeAdapter, deps: [{ token: nxtPickDatetime.OWL_DATE_TIME_LOCALE, optional: true }, { token: OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
551
- MomentDateTimeAdapter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: MomentDateTimeAdapter });
552
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: MomentDateTimeAdapter, decorators: [{
553
- type: i0.Injectable
554
- }], ctorParameters: function () {
555
- return [{ type: undefined, decorators: [{
556
- type: i0.Optional
557
- }, {
558
- type: i0.Inject,
559
- args: [nxtPickDatetime.OWL_DATE_TIME_LOCALE]
560
- }] }, { type: undefined, decorators: [{
561
- type: i0.Optional
562
- }, {
563
- type: i0.Inject,
564
- args: [OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
565
- }] }];
566
- } });
567
-
568
- var OWL_MOMENT_DATE_TIME_FORMATS = {
569
- parseInput: 'l LT',
570
- fullPickerInput: 'l LT',
571
- datePickerInput: 'l',
572
- timePickerInput: 'LT',
573
- monthYearLabel: 'MMM YYYY',
574
- dateA11yLabel: 'LL',
575
- monthYearA11yLabel: 'MMMM YYYY'
576
- };
577
-
578
- var MomentDateTimeModule = /** @class */ (function () {
579
- function MomentDateTimeModule() {
580
- }
581
- return MomentDateTimeModule;
582
- }());
583
- MomentDateTimeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: MomentDateTimeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
584
- MomentDateTimeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: MomentDateTimeModule });
585
- MomentDateTimeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: MomentDateTimeModule, providers: [
586
- {
587
- provide: nxtPickDatetime.DateTimeAdapter,
588
- useClass: MomentDateTimeAdapter,
589
- deps: [nxtPickDatetime.OWL_DATE_TIME_LOCALE, OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
590
- }
591
- ] });
592
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: MomentDateTimeModule, decorators: [{
593
- type: i0.NgModule,
594
- args: [{
595
- providers: [
596
- {
597
- provide: nxtPickDatetime.DateTimeAdapter,
598
- useClass: MomentDateTimeAdapter,
599
- deps: [nxtPickDatetime.OWL_DATE_TIME_LOCALE, OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
600
- }
601
- ]
602
- }]
603
- }] });
604
- var OwlMomentDateTimeModule = /** @class */ (function () {
605
- function OwlMomentDateTimeModule() {
606
- }
607
- return OwlMomentDateTimeModule;
608
- }());
609
- OwlMomentDateTimeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OwlMomentDateTimeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
610
- OwlMomentDateTimeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OwlMomentDateTimeModule, imports: [MomentDateTimeModule] });
611
- OwlMomentDateTimeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OwlMomentDateTimeModule, providers: [{ provide: nxtPickDatetime.OWL_DATE_TIME_FORMATS, useValue: OWL_MOMENT_DATE_TIME_FORMATS }], imports: [[MomentDateTimeModule]] });
612
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: OwlMomentDateTimeModule, decorators: [{
613
- type: i0.NgModule,
614
- args: [{
615
- imports: [MomentDateTimeModule],
616
- providers: [{ provide: nxtPickDatetime.OWL_DATE_TIME_FORMATS, useValue: OWL_MOMENT_DATE_TIME_FORMATS }]
617
- }]
618
- }] });
619
-
620
- /**
621
- * Generated bundle index. Do not edit.
622
- */
623
-
624
- exports.OwlMomentDateTimeModule = OwlMomentDateTimeModule;
625
-
626
- Object.defineProperty(exports, '__esModule', { value: true });
627
-
628
- })));
629
- //# sourceMappingURL=nxt-pick-datetime-moment-adapter.umd.js.map