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