ngx-mat-tui-calendar 0.0.11 → 0.0.15

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.
@@ -1,8 +1,10 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
3
- typeof define === 'function' && define.amd ? define('ngx-mat-tui-calendar', ['exports', '@angular/core'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ngx-mat-tui-calendar"] = {}, global.ng.core));
5
- })(this, (function (exports, i0) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('distinct-colors'), require('uuid'), require('@fortawesome/free-solid-svg-icons'), require('tui-calendar'), require('@angular/forms'), require('@angular/material/form-field'), require('@angular/material/radio'), require('@angular/material/datepicker'), require('@angular/material/divider'), require('@angular/material/button'), require('@angular/material/input'), require('@angular/common'), require('mat-timepicker'), require('@angular/material/toolbar'), require('@fortawesome/angular-fontawesome'), require('@angular/material/button-toggle'), require('@angular/platform-browser/animations'), require('@angular/platform-browser'), require('@angular/flex-layout'), require('@angular/common/http'), require('@angular/cdk/overlay'), require('@angular/material/card'), require('@angular/material/icon'), require('@angular/material/core'), require('@angular/material/slide-toggle')) :
3
+ typeof define === 'function' && define.amd ? define('ngx-mat-tui-calendar', ['exports', '@angular/core', '@angular/material/dialog', 'distinct-colors', 'uuid', '@fortawesome/free-solid-svg-icons', 'tui-calendar', '@angular/forms', '@angular/material/form-field', '@angular/material/radio', '@angular/material/datepicker', '@angular/material/divider', '@angular/material/button', '@angular/material/input', '@angular/common', 'mat-timepicker', '@angular/material/toolbar', '@fortawesome/angular-fontawesome', '@angular/material/button-toggle', '@angular/platform-browser/animations', '@angular/platform-browser', '@angular/flex-layout', '@angular/common/http', '@angular/cdk/overlay', '@angular/material/card', '@angular/material/icon', '@angular/material/core', '@angular/material/slide-toggle'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ngx-mat-tui-calendar"] = {}, global.ng.core, global.ng.material.dialog, global.distinctColors, global.uuid, global.freeSolidSvgIcons, global.Calendar, global.ng.forms, global.ng.material.formField, global.ng.material.radio, global.ng.material.datepicker, global.ng.material.divider, global.ng.material.button, global.ng.material.input, global.ng.common, global.i10, global.ng.material.toolbar, global.i4$1, global.ng.material.buttonToggle, global.ng.platformBrowser.animations, global.ng.platformBrowser, global.ng.flexLayout, global.ng.common.http, global.ng.cdk.overlay, global.ng.material.card, global.ng.material.icon, global.ng.material.core, global.ng.material.slideToggle));
5
+ })(this, (function (exports, i0, i1, distinctColors, uuid, freeSolidSvgIcons, Calendar, i7, i2, i3, i4, i5, i6, i8, i9, i10, i2$1, i4$1, i5$1, animations, platformBrowser, flexLayout, http, overlay, card, icon, core, slideToggle) { 'use strict';
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
8
 
7
9
  function _interopNamespace(e) {
8
10
  if (e && e.__esModule) return e;
@@ -23,6 +25,21 @@
23
25
  }
24
26
 
25
27
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29
+ var distinctColors__default = /*#__PURE__*/_interopDefaultLegacy(distinctColors);
30
+ var Calendar__default = /*#__PURE__*/_interopDefaultLegacy(Calendar);
31
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
32
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
33
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
34
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
35
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
36
+ var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
37
+ var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
38
+ var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
39
+ var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
40
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
41
+ var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
42
+ var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
26
43
 
27
44
  var NgxMatTuiCalendarService = /** @class */ (function () {
28
45
  function NgxMatTuiCalendarService() {
@@ -38,39 +55,1178 @@
38
55
  }]
39
56
  }], ctorParameters: function () { return []; } });
40
57
 
58
+ /*! *****************************************************************************
59
+ Copyright (c) Microsoft Corporation.
60
+
61
+ Permission to use, copy, modify, and/or distribute this software for any
62
+ purpose with or without fee is hereby granted.
63
+
64
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
65
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
66
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
67
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
68
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
69
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
70
+ PERFORMANCE OF THIS SOFTWARE.
71
+ ***************************************************************************** */
72
+ /* global Reflect, Promise */
73
+ var extendStatics = function (d, b) {
74
+ extendStatics = Object.setPrototypeOf ||
75
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
76
+ function (d, b) { for (var p in b)
77
+ if (Object.prototype.hasOwnProperty.call(b, p))
78
+ d[p] = b[p]; };
79
+ return extendStatics(d, b);
80
+ };
81
+ function __extends(d, b) {
82
+ if (typeof b !== "function" && b !== null)
83
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
84
+ extendStatics(d, b);
85
+ function __() { this.constructor = d; }
86
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
87
+ }
88
+ var __assign = function () {
89
+ __assign = Object.assign || function __assign(t) {
90
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
91
+ s = arguments[i];
92
+ for (var p in s)
93
+ if (Object.prototype.hasOwnProperty.call(s, p))
94
+ t[p] = s[p];
95
+ }
96
+ return t;
97
+ };
98
+ return __assign.apply(this, arguments);
99
+ };
100
+ function __rest(s, e) {
101
+ var t = {};
102
+ for (var p in s)
103
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
104
+ t[p] = s[p];
105
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
106
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
107
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
108
+ t[p[i]] = s[p[i]];
109
+ }
110
+ return t;
111
+ }
112
+ function __decorate(decorators, target, key, desc) {
113
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
114
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
115
+ r = Reflect.decorate(decorators, target, key, desc);
116
+ else
117
+ for (var i = decorators.length - 1; i >= 0; i--)
118
+ if (d = decorators[i])
119
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
120
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
121
+ }
122
+ function __param(paramIndex, decorator) {
123
+ return function (target, key) { decorator(target, key, paramIndex); };
124
+ }
125
+ function __metadata(metadataKey, metadataValue) {
126
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
127
+ return Reflect.metadata(metadataKey, metadataValue);
128
+ }
129
+ function __awaiter(thisArg, _arguments, P, generator) {
130
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
131
+ return new (P || (P = Promise))(function (resolve, reject) {
132
+ function fulfilled(value) { try {
133
+ step(generator.next(value));
134
+ }
135
+ catch (e) {
136
+ reject(e);
137
+ } }
138
+ function rejected(value) { try {
139
+ step(generator["throw"](value));
140
+ }
141
+ catch (e) {
142
+ reject(e);
143
+ } }
144
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
145
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
146
+ });
147
+ }
148
+ function __generator(thisArg, body) {
149
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
150
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
151
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
152
+ function verb(n) { return function (v) { return step([n, v]); }; }
153
+ function step(op) {
154
+ if (f)
155
+ throw new TypeError("Generator is already executing.");
156
+ while (_)
157
+ try {
158
+ 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)
159
+ return t;
160
+ if (y = 0, t)
161
+ op = [op[0] & 2, t.value];
162
+ switch (op[0]) {
163
+ case 0:
164
+ case 1:
165
+ t = op;
166
+ break;
167
+ case 4:
168
+ _.label++;
169
+ return { value: op[1], done: false };
170
+ case 5:
171
+ _.label++;
172
+ y = op[1];
173
+ op = [0];
174
+ continue;
175
+ case 7:
176
+ op = _.ops.pop();
177
+ _.trys.pop();
178
+ continue;
179
+ default:
180
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
181
+ _ = 0;
182
+ continue;
183
+ }
184
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
185
+ _.label = op[1];
186
+ break;
187
+ }
188
+ if (op[0] === 6 && _.label < t[1]) {
189
+ _.label = t[1];
190
+ t = op;
191
+ break;
192
+ }
193
+ if (t && _.label < t[2]) {
194
+ _.label = t[2];
195
+ _.ops.push(op);
196
+ break;
197
+ }
198
+ if (t[2])
199
+ _.ops.pop();
200
+ _.trys.pop();
201
+ continue;
202
+ }
203
+ op = body.call(thisArg, _);
204
+ }
205
+ catch (e) {
206
+ op = [6, e];
207
+ y = 0;
208
+ }
209
+ finally {
210
+ f = t = 0;
211
+ }
212
+ if (op[0] & 5)
213
+ throw op[1];
214
+ return { value: op[0] ? op[1] : void 0, done: true };
215
+ }
216
+ }
217
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
218
+ if (k2 === undefined)
219
+ k2 = k;
220
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
221
+ }) : (function (o, m, k, k2) {
222
+ if (k2 === undefined)
223
+ k2 = k;
224
+ o[k2] = m[k];
225
+ });
226
+ function __exportStar(m, o) {
227
+ for (var p in m)
228
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
229
+ __createBinding(o, m, p);
230
+ }
231
+ function __values(o) {
232
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
233
+ if (m)
234
+ return m.call(o);
235
+ if (o && typeof o.length === "number")
236
+ return {
237
+ next: function () {
238
+ if (o && i >= o.length)
239
+ o = void 0;
240
+ return { value: o && o[i++], done: !o };
241
+ }
242
+ };
243
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
244
+ }
245
+ function __read(o, n) {
246
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
247
+ if (!m)
248
+ return o;
249
+ var i = m.call(o), r, ar = [], e;
250
+ try {
251
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
252
+ ar.push(r.value);
253
+ }
254
+ catch (error) {
255
+ e = { error: error };
256
+ }
257
+ finally {
258
+ try {
259
+ if (r && !r.done && (m = i["return"]))
260
+ m.call(i);
261
+ }
262
+ finally {
263
+ if (e)
264
+ throw e.error;
265
+ }
266
+ }
267
+ return ar;
268
+ }
269
+ /** @deprecated */
270
+ function __spread() {
271
+ for (var ar = [], i = 0; i < arguments.length; i++)
272
+ ar = ar.concat(__read(arguments[i]));
273
+ return ar;
274
+ }
275
+ /** @deprecated */
276
+ function __spreadArrays() {
277
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
278
+ s += arguments[i].length;
279
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
280
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
281
+ r[k] = a[j];
282
+ return r;
283
+ }
284
+ function __spreadArray(to, from, pack) {
285
+ if (pack || arguments.length === 2)
286
+ for (var i = 0, l = from.length, ar; i < l; i++) {
287
+ if (ar || !(i in from)) {
288
+ if (!ar)
289
+ ar = Array.prototype.slice.call(from, 0, i);
290
+ ar[i] = from[i];
291
+ }
292
+ }
293
+ return to.concat(ar || Array.prototype.slice.call(from));
294
+ }
295
+ function __await(v) {
296
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
297
+ }
298
+ function __asyncGenerator(thisArg, _arguments, generator) {
299
+ if (!Symbol.asyncIterator)
300
+ throw new TypeError("Symbol.asyncIterator is not defined.");
301
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
302
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
303
+ function verb(n) { if (g[n])
304
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
305
+ function resume(n, v) { try {
306
+ step(g[n](v));
307
+ }
308
+ catch (e) {
309
+ settle(q[0][3], e);
310
+ } }
311
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
312
+ function fulfill(value) { resume("next", value); }
313
+ function reject(value) { resume("throw", value); }
314
+ function settle(f, v) { if (f(v), q.shift(), q.length)
315
+ resume(q[0][0], q[0][1]); }
316
+ }
317
+ function __asyncDelegator(o) {
318
+ var i, p;
319
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
320
+ 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; }
321
+ }
322
+ function __asyncValues(o) {
323
+ if (!Symbol.asyncIterator)
324
+ throw new TypeError("Symbol.asyncIterator is not defined.");
325
+ var m = o[Symbol.asyncIterator], i;
326
+ 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);
327
+ 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); }); }; }
328
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
329
+ }
330
+ function __makeTemplateObject(cooked, raw) {
331
+ if (Object.defineProperty) {
332
+ Object.defineProperty(cooked, "raw", { value: raw });
333
+ }
334
+ else {
335
+ cooked.raw = raw;
336
+ }
337
+ return cooked;
338
+ }
339
+ ;
340
+ var __setModuleDefault = Object.create ? (function (o, v) {
341
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
342
+ }) : function (o, v) {
343
+ o["default"] = v;
344
+ };
345
+ function __importStar(mod) {
346
+ if (mod && mod.__esModule)
347
+ return mod;
348
+ var result = {};
349
+ if (mod != null)
350
+ for (var k in mod)
351
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
352
+ __createBinding(result, mod, k);
353
+ __setModuleDefault(result, mod);
354
+ return result;
355
+ }
356
+ function __importDefault(mod) {
357
+ return (mod && mod.__esModule) ? mod : { default: mod };
358
+ }
359
+ function __classPrivateFieldGet(receiver, state, kind, f) {
360
+ if (kind === "a" && !f)
361
+ throw new TypeError("Private accessor was defined without a getter");
362
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
363
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
364
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
365
+ }
366
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
367
+ if (kind === "m")
368
+ throw new TypeError("Private method is not writable");
369
+ if (kind === "a" && !f)
370
+ throw new TypeError("Private accessor was defined without a setter");
371
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
372
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
373
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
374
+ }
375
+
376
+ // import { TZDate } from 'tui-calendar';
377
+ var LocalDate = /** @class */ (function () {
378
+ // month = 1 to 12
379
+ function LocalDate(args) {
380
+ var numbers;
381
+ if (typeof args == 'string') {
382
+ numbers = LocalDate.parse_YYYYMMDD(args);
383
+ }
384
+ else if (args instanceof LocalDate) {
385
+ numbers = args.get();
386
+ }
387
+ else if (args instanceof Date) {
388
+ numbers = LocalDate.convertDateToNumbers(args);
389
+ }
390
+ else if (typeof args.toDate === 'function') {
391
+ numbers = LocalDate.convertDateToNumbers(args.toDate());
392
+ }
393
+ else if (args['_date'] instanceof Date) {
394
+ numbers = LocalDate.convertDateToNumbers(args['_date']);
395
+ }
396
+ else if (args instanceof Object) {
397
+ numbers = args;
398
+ }
399
+ this.date = LocalDate.convertNumbersToDate(numbers);
400
+ }
401
+ LocalDate.convertToJsDate = function (args) {
402
+ return (new LocalDate(args)).toDate();
403
+ };
404
+ // return new LocalDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
405
+ LocalDate.parse_YYYYMMDD = function (str) {
406
+ // yyyy-mm-dd
407
+ var regexp = /^(\d\d\d\d)-(\d\d)-(\d\d)/g;
408
+ var matches = Array.from(str.matchAll(regexp), function (m) { return ({
409
+ year: Number(m[1]),
410
+ month: Number(m[2]),
411
+ day: Number(m[3])
412
+ }); });
413
+ if (matches.length != 1) {
414
+ console.error("dateIn: unknown date format: " + str);
415
+ return null;
416
+ }
417
+ return matches[0];
418
+ };
419
+ LocalDate.convertNumbersToDate = function (_a) {
420
+ var year = _a.year, month = _a.month, day = _a.day, hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds, milliseconds = _a.milliseconds;
421
+ // month = 1 to 12
422
+ // start with today's *local* date. this si really important
423
+ var date = new Date();
424
+ date.setFullYear(year);
425
+ date.setMonth((month == null) ? 0 : month - 1);
426
+ date.setDate((day == null) ? 1 : day);
427
+ date.setHours((hours == null) ? 0 : hours);
428
+ date.setMinutes((minutes == null) ? 0 : minutes);
429
+ date.setSeconds((seconds == null) ? 0 : seconds);
430
+ date.setMilliseconds((milliseconds == null) ? 1 : milliseconds);
431
+ return date;
432
+ };
433
+ LocalDate.convertDateToNumbers = function (date) {
434
+ // month = 1 to 12
435
+ return {
436
+ year: date.getFullYear(),
437
+ month: date.getMonth() + 1,
438
+ day: date.getDate(),
439
+ hours: date.getHours(),
440
+ minutes: date.getMinutes(),
441
+ seconds: date.getSeconds(),
442
+ milliseconds: date.getMilliseconds(),
443
+ };
444
+ };
445
+ LocalDate.prototype.get = function () {
446
+ return LocalDate.convertDateToNumbers(this.date);
447
+ };
448
+ LocalDate.prototype.toMsgFormat = function () {
449
+ return this.toYYYYMMDD();
450
+ };
451
+ LocalDate.prototype.toYYYYMMDD = function () {
452
+ // yyyy-mm-dd
453
+ var yyyy = this.date.getFullYear();
454
+ var mm = (this.date.getMonth() + 1).toString().padStart(2, '0');
455
+ var dd = (this.date.getDate()).toString().padStart(2, '0');
456
+ var str = yyyy + "-" + mm + "-" + dd;
457
+ // console.warn(`date=${str}=${this.toDisplayFormat()}`);
458
+ return str;
459
+ };
460
+ LocalDate.prototype.toDisplayDateFormat = function () {
461
+ return this.date.toLocaleDateString("en-US", {
462
+ weekday: 'short',
463
+ year: 'numeric',
464
+ month: 'short',
465
+ day: 'numeric',
466
+ });
467
+ };
468
+ LocalDate.prototype.toDisplayFormat = function () {
469
+ return this.date.toString();
470
+ };
471
+ LocalDate.prototype.toDate = function () {
472
+ return this.date;
473
+ };
474
+ LocalDate.prototype.clearTime = function () {
475
+ this.date.setHours(0, 0, 0, 1);
476
+ };
477
+ return LocalDate;
478
+ }());
479
+
480
+ var NgxMatTuiCalendarEditorDialogComponent = /** @class */ (function () {
481
+ function NgxMatTuiCalendarEditorDialogComponent(data, dialogRef) {
482
+ // console.log('NgxMatTuiCalendarEditorDialogComponent.constructor: schedule:', schedule);
483
+ this.data = data;
484
+ this.dialogRef = dialogRef;
485
+ this.titleStr = '';
486
+ this.locationStr = '';
487
+ this.closed = false;
488
+ this.isAllDay = false;
489
+ this.themeClass = '';
490
+ console.log('NgxMatTuiCalendarEditorDialogComponent.constructor: data:', data);
491
+ this.color = data.darkMode ? 'accent' : 'primary';
492
+ var schedule = data.schedule;
493
+ if (schedule == null) {
494
+ this.id = null;
495
+ }
496
+ else {
497
+ if (schedule.id) {
498
+ this.id = schedule.id.toString();
499
+ }
500
+ }
501
+ this.titleStr = (schedule.title) ? schedule.title.toString() : '';
502
+ this.locationStr = (schedule.location) ? schedule.location.toString() : '';
503
+ this.isAllDay = (schedule.isAllDay == true);
504
+ this.startDate = LocalDate.convertToJsDate(schedule.start);
505
+ this.endDate = LocalDate.convertToJsDate(schedule.end);
506
+ this.startTime = new Date(this.startDate);
507
+ this.endTime = new Date(this.endDate);
508
+ this.startDate.setHours(0, 0, 0, 1);
509
+ this.endDate.setHours(0, 0, 0, 1);
510
+ this.eventForm = new i7.FormGroup({
511
+ title: new i7.FormControl(this.titleStr),
512
+ location: new i7.FormControl(this.locationStr),
513
+ scheduleType: new i7.FormControl((schedule.isAllDay == true) ? "all-day" : "time-slot"),
514
+ start: new i7.FormControl(this.startDate),
515
+ end: new i7.FormControl(this.endDate),
516
+ date: new i7.FormControl(this.startDate),
517
+ time1: new i7.FormControl(this.startTime),
518
+ time2: new i7.FormControl(this.endTime, [i7.Validators.required]),
519
+ }, this.getDateValidator());
520
+ }
521
+ NgxMatTuiCalendarEditorDialogComponent.prototype.getDateValidator = function () {
522
+ var validator = function (group) {
523
+ var scheduleType = group.get("scheduleType").value;
524
+ if (group.get("scheduleType").value == "time-slot") {
525
+ var time1 = group.get("time1").value;
526
+ var time2 = group.get("time2").value;
527
+ if (time1 >= time2) {
528
+ return {
529
+ dates: "End time must be later than the start time"
530
+ };
531
+ }
532
+ }
533
+ return {};
534
+ };
535
+ return validator;
536
+ };
537
+ NgxMatTuiCalendarEditorDialogComponent.prototype.ngOnInit = function () {
538
+ // console.dir(`Dialog config: ${this.dialogConfig}`);
539
+ // let start: Date = (LocalDate.convertToJsDate(this.schedule.start)).toDate();
540
+ // let end: Date = (LocalDate.convertToJsDate(this.schedule.end)).toDate();
541
+ // this.eventForm.get("date").setValue(start);
542
+ // this.eventForm.get("start").setValue(start);
543
+ // this.eventForm.get("end").setValue(end);
544
+ };
545
+ NgxMatTuiCalendarEditorDialogComponent.prototype.onSave = function (form) {
546
+ // console.log(`onSave form.invalid=${form.invalid}; this.closed=${this.closed} this.titleStr=${this.titleStr}`);
547
+ if (form.invalid || this.closed)
548
+ return;
549
+ var schedule = this.data.schedule;
550
+ schedule.title = this.eventForm.get("title").value;
551
+ schedule.location = this.eventForm.get("location").value;
552
+ schedule.isAllDay = this.isAllDay;
553
+ schedule.category = this.isAllDay ? 'allday' : 'time'; // CATEGORY MUST BE DEFINED: 'milestone', 'task', allday', 'time'
554
+ if (this.isAllDay) {
555
+ schedule.start = LocalDate.convertToJsDate(this.eventForm.get("start").value);
556
+ schedule.start.setHours(0, 0, 0, 1);
557
+ schedule.end = LocalDate.convertToJsDate(this.eventForm.get("end").value);
558
+ schedule.end.setHours(0, 0, 0, 1);
559
+ }
560
+ else {
561
+ this.startTime = LocalDate.convertToJsDate(this.eventForm.get("time1").value);
562
+ schedule.start = LocalDate.convertToJsDate(this.eventForm.get("date").value);
563
+ schedule.start.setHours(this.startTime.getHours(), this.startTime.getMinutes(), this.startTime.getSeconds(), this.startTime.getMilliseconds());
564
+ this.endTime = LocalDate.convertToJsDate(this.eventForm.get("time2").value);
565
+ schedule.end = LocalDate.convertToJsDate(this.eventForm.get("date").value);
566
+ schedule.end.setHours(this.endTime.getHours(), this.endTime.getMinutes(), this.endTime.getSeconds(), this.endTime.getMilliseconds());
567
+ }
568
+ // console.log(`pop-up-event-editor.component.ts: user clicked SAVE event=${schedule}`);
569
+ // this.eventOutput.emit(schedule);
570
+ form.resetForm();
571
+ this.closeMe(schedule);
572
+ };
573
+ NgxMatTuiCalendarEditorDialogComponent.prototype.onCancel = function () {
574
+ // this.cancelled.emit();
575
+ // console.log('openPopupScheduleEditor: user clicked CANCEL');
576
+ this.closeMe(null);
577
+ };
578
+ NgxMatTuiCalendarEditorDialogComponent.prototype.onDelete = function () {
579
+ // this.cancelled.emit();
580
+ // console.log('openPopupScheduleEditor: user clicked DELETE');
581
+ this.closeMe(this.data.schedule, true);
582
+ };
583
+ NgxMatTuiCalendarEditorDialogComponent.prototype.closeMe = function (schedule, performDelete) {
584
+ // console.log('closeMe: The dialog is closing', schedule);
585
+ this.closed = true;
586
+ this.dialogRef.close({ schedule: schedule, performDelete: (performDelete == true) });
587
+ };
588
+ NgxMatTuiCalendarEditorDialogComponent.prototype.log = function (str) {
589
+ console.warn(str);
590
+ };
591
+ NgxMatTuiCalendarEditorDialogComponent.prototype.onUseAllDay = function () {
592
+ this.isAllDay = true;
593
+ };
594
+ NgxMatTuiCalendarEditorDialogComponent.prototype.onUseTimeSlot = function () {
595
+ this.isAllDay = false;
596
+ };
597
+ return NgxMatTuiCalendarEditorDialogComponent;
598
+ }());
599
+ NgxMatTuiCalendarEditorDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarEditorDialogComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: i1__namespace.MatDialogRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
600
+ NgxMatTuiCalendarEditorDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: NgxMatTuiCalendarEditorDialogComponent, selector: "ngx-mat-tui-calendar-editor-dialog", ngImport: i0__namespace, template: "<div [className]=\"data.themeClass + ' ' + 'event-editor'\">\n <form id=\"my-form\" [formGroup]=\"eventForm\" class=\"event-editor-form\" (submit)=\"onSave(postForm);\" #postForm=\"ngForm\">\n <div class=\"grid-wrapper\">\n <div class=\"grid-title\">\n <mat-form-field [color]=\"color\" class=\"editor-title\">\n <input matInput type=\"text\" name=\"title\" formControlName=\"title\" placeholder=\"Title\">\n <!-- <mat-error style=\"height: fit-content;\" *ngIf=\"title.invalid\">Please enter a title (of 1 characters or more)\n for\n your event.</mat-error> -->\n </mat-form-field>\n </div>\n <div class=\"grid-location\">\n <mat-form-field [color]=\"color\" class=\"editor-location\">\n <input matInput type=\"location\" name=\"location\" formControlName=\"location\" placeholder=\"Location\">\n </mat-form-field>\n </div>\n <div class=\"grid-radios\" style=\"display: flex;\">\n <mat-radio-group [color]=\"color\" aria-label=\"Select an option\" style=\"margin-bottom: 1em;\" name=\"scheduleType\"\n formControlName=\"scheduleType\" required>\n <mat-radio-button value=\"all-day\" (change)=\"onUseAllDay()\" id=\"button-all-day\" [color]=\"color\" class=\"radio-button\">All Day\n </mat-radio-button>\n <mat-radio-button value=\"time-slot\" (change)=\"onUseTimeSlot()\" id=\"button-time-slot\" [color]=\"color\" class=\"radio-button\">Time Slot\n </mat-radio-button>\n </mat-radio-group>\n </div>\n <div class=\"grid-date\">\n <mat-form-field *ngIf=\"isAllDay\" [color]=\"color\" class=\"date-range-form-field\" appearance=\"fill\">\n <mat-label [color]=\"color\">Pick a Date Range</mat-label>\n <mat-date-range-input [color]=\"color\" [panelClass]=\"data.themeClass\" [rangePicker]=\"rangePicker\" #dateRangeInput>\n <input matStartDate placeholder=\"Start date\" formControlName=\"start\" name=\"start\">\n <input matEndDate placeholder=\"End date\" formControlName=\"end\" name=\"end\">\n </mat-date-range-input>\n <mat-datepicker-toggle [color]=\"color\" [panelClass]=\"data.themeClass\" matSuffix [for]=\"rangePicker\"></mat-datepicker-toggle>\n <mat-date-range-picker [color]=\"color\" class=\"picker\" #rangePicker></mat-date-range-picker>\n </mat-form-field>\n <mat-form-field [color]=\"color\" *ngIf=\"!isAllDay\" class=\"date-form-field\" appearance=\"fill\">\n <mat-label>Choose a date</mat-label>\n <input matInput [matDatepicker]=\"dpicker\" formControlName=\"date\" name=\"date\">\n <mat-datepicker-toggle [color]=\"color\" matSuffix [for]=\"dpicker\"></mat-datepicker-toggle>\n <mat-datepicker [color]=\"color\" #dpicker></mat-datepicker>\n </mat-form-field>\n </div>\n <div *ngIf=\"!isAllDay\" class=\"grid-time time-slot\">\n <mat-form-field [color]=\"color\" class=\"form-field-time\" appearance=\"fill\">\n <mat-label>Start</mat-label>\n <input matTimepicker [color]=\"color\" [strict]=\"false\" id=\"timepicker-start\" mode=\"12h\" formControlName=\"time1\" name=\"time1\"\n placeholder=\"Please select time...\">\n </mat-form-field>\n <mat-form-field [color]=\"color\" class=\"form-field-time\" appearance=\"fill\">\n <mat-label>End</mat-label>\n <input matTimepicker [color]=\"color\" [strict]=\"false\" id=\"timepicker-end\" mode=\"12h\" formControlName=\"time2\" name=\"time2\"\n placeholder=\"Please select time...\">\n </mat-form-field>\n </div>\n <div *ngIf=\"!isAllDay\" class=\"grid-error\">\n <label *ngIf=\"eventForm.invalid\">{{ eventForm.errors?.dates }}</label>\n </div>\n </div>\n <mat-divider></mat-divider>\n <div class=\"editor-footer\">\n <button mat-raised-button [color]=\"color\" id=\"editor-submit-button\" type=\"submit\" style=\"margin-right: 4px;\">SAVE</button>\n <button mat-raised-button id=\"editor-delete-button\" type=\"button\" (click)=\"onDelete()\" *ngIf=\"(data.schedule.id!=null)\">DELETE</button>\n <button mat-raised-button id=\"editor-cancel-button\" type=\"button\" (click)=\"onCancel()\">CANCEL</button>\n </div>\n </form>\n </div>", styles: [".event-editor{padding:.25rem;margin-top:.25rem;max-width:425px}.grid-wrapper{display:grid;grid-template-columns:110px 290px;grid-template-rows:50px 50px 70px 70px 20px;grid-gap:2px;gap:2px}.grid-title{grid-column:1/3;grid-row:1}.grid-location{grid-column:1/3;grid-row:2}.grid-radios{grid-column:1;grid-row:3}.grid-date{grid-column:2;grid-row:3}.grid-time{grid-column:2;grid-row:4}.grid-error{grid-column:1/3;grid-row:5}.editor-title{width:100%;margin-bottom:auto}.editor-location{width:100%;margin-bottom:auto}.editor-footer{justify-self:right;align-self:center;margin-top:.5rem;height:40px}#editor-cancel-button{float:right}.date-range-form-field{width:290px}.date-form-field{width:290px}.time-slot{display:flex;flex-direction:row}.form-field-time{width:140px;padding:0;margin-right:10px}.form-field-time-wrapper{width:140px;padding:0 8px;margin-right:10px}.radio-button{width:120px;margin-top:10px;margin-bottom:10px;display:flex;flex-direction:row}.grid-error{color:red;font-size:.8rem}\n"], components: [{ type: i2__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3__namespace.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i4__namespace.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["separator", "comparisonStart", "comparisonEnd", "rangePicker", "required", "dateFilter", "min", "max", "disabled"], exportAs: ["matDateRangeInput"] }, { type: i4__namespace.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["tabIndex", "disabled", "for", "aria-label", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i4__namespace.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { type: i4__namespace.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { type: i5__namespace.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i7__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i7__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i3__namespace.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { type: i7__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.MatLabel, selector: "mat-label" }, { type: i4__namespace.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { type: i4__namespace.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { type: i2__namespace.MatSuffix, selector: "[matSuffix]" }, { type: i4__namespace.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i10__namespace.MatTimepickerDirective, selector: "input[matTimepicker]", inputs: ["okButtonTemplate", "cancelButtonTemplate", "okLabel", "cancelLabel", "anteMeridiemAbbreviation", "postMeridiemAbbreviation", "mode", "color", "disableDialogOpenOnClick", "strict", "value", "id", "errorStateMatcher", "disabled", "readonly", "required", "placeholder", "minDate", "maxDate"], outputs: ["timeChange", "invalidInput"], exportAs: ["matTimepicker"] }] });
601
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarEditorDialogComponent, decorators: [{
602
+ type: i0.Component,
603
+ args: [{
604
+ selector: 'ngx-mat-tui-calendar-editor-dialog',
605
+ templateUrl: './ngx-mat-tui-calendar-editor-dialog.component.html',
606
+ styleUrls: ['./ngx-mat-tui-calendar-editor-dialog.component.scss']
607
+ }]
608
+ }], ctorParameters: function () {
609
+ return [{ type: undefined, decorators: [{
610
+ type: i0.Inject,
611
+ args: [i1.MAT_DIALOG_DATA]
612
+ }] }, { type: i1__namespace.MatDialogRef }];
613
+ } });
614
+
615
+ var NgxMatTuiCalendarWrapperComponent = /** @class */ (function () {
616
+ function NgxMatTuiCalendarWrapperComponent() {
617
+ }
618
+ NgxMatTuiCalendarWrapperComponent.prototype.ngOnInit = function () {
619
+ };
620
+ return NgxMatTuiCalendarWrapperComponent;
621
+ }());
622
+ NgxMatTuiCalendarWrapperComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarWrapperComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
623
+ NgxMatTuiCalendarWrapperComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: NgxMatTuiCalendarWrapperComponent, selector: "ngx-mat-tui-calendar-wrapper", ngImport: i0__namespace, template: "<div id=\"calendar\"></div> <!-- TUI Calendar gets instatited here -->\n", styles: [".tui-full-calendar-week-container{min-height:auto}\n"], encapsulation: i0__namespace.ViewEncapsulation.None });
624
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarWrapperComponent, decorators: [{
625
+ type: i0.Component,
626
+ args: [{
627
+ selector: 'ngx-mat-tui-calendar-wrapper',
628
+ templateUrl: './ngx-mat-tui-calendar-wrapper.component.html',
629
+ styleUrls: ['./ngx-mat-tui-calendar-wrapper.component.scss'],
630
+ encapsulation: i0.ViewEncapsulation.None, // this is needed so that our css rules override those in tui-calendar package
631
+ }]
632
+ }], ctorParameters: function () { return []; } });
633
+
41
634
  var NgxMatTuiCalendarComponent = /** @class */ (function () {
42
- function NgxMatTuiCalendarComponent() {
635
+ function NgxMatTuiCalendarComponent(dialog) {
636
+ this.dialog = dialog;
637
+ this.iconToday = freeSolidSvgIcons.faCalendarCheck;
638
+ // iconPrev = faCaretSquareLeft;
639
+ // iconNext = faCaretSquareRight;
640
+ this.iconPrev = freeSolidSvgIcons.faCaretLeft;
641
+ this.iconNext = freeSolidSvgIcons.faCaretRight;
642
+ this.iconLongPrev = freeSolidSvgIcons.faBackward;
643
+ this.iconLongNext = freeSolidSvgIcons.faForward;
644
+ this.iconByMonth = freeSolidSvgIcons.faTable;
645
+ this.iconByWeek = freeSolidSvgIcons.faColumns;
646
+ this.iconByDay = freeSolidSvgIcons.faListAlt;
647
+ this.userCreatedSchedule = new i0.EventEmitter();
648
+ this.userUpdatedSchedule = new i0.EventEmitter();
649
+ this.userDeletedSchedule = new i0.EventEmitter();
650
+ // we slice off the first color since it is gray
651
+ this.colors = distinctColors__default["default"]({ lightMin: 70, count: 15 }).slice(1);
652
+ this.colorIndex = 0;
653
+ this.calendarId = uuid.v4();
43
654
  }
44
655
  NgxMatTuiCalendarComponent.prototype.ngOnInit = function () {
656
+ this.createTUICalendar(null);
657
+ this.bindCallbacks();
658
+ };
659
+ NgxMatTuiCalendarComponent.prototype.ngOnChanges = function (changes) {
660
+ console.warn(changes);
661
+ if (this.calendar) {
662
+ if (changes.options) {
663
+ console.warn("change.option:", changes.options);
664
+ var options = changes.options.currentValue;
665
+ if (!options.theme) {
666
+ options.theme = this.getDefaultTheme();
667
+ }
668
+ console.warn("TUI theme:", options.theme);
669
+ this.calendar.setOptions(options.ioptions);
670
+ this.calendar.setTheme(options.theme);
671
+ this.calendar.render(true);
672
+ }
673
+ }
674
+ };
675
+ NgxMatTuiCalendarComponent.prototype.ngOnDestroy = function () {
676
+ this.calendar.destroy();
677
+ };
678
+ NgxMatTuiCalendarComponent.prototype.onCalendarLongPrev = function () {
679
+ var date = this.calendar.getDate().toDate();
680
+ var days = 0;
681
+ var months = 0;
682
+ var years = 0;
683
+ switch (this.calendar.getViewName()) {
684
+ case 'day':
685
+ days = -7;
686
+ break;
687
+ case 'week':
688
+ days = -28;
689
+ break;
690
+ case 'month':
691
+ years = -1;
692
+ break;
693
+ }
694
+ date.setFullYear(date.getFullYear() + years);
695
+ date.setMonth(date.getMonth() + months); // date class does the modular arithmetic
696
+ date.setDate(date.getDate() + days); // date class does the modular arithmetic
697
+ this.calendar.setDate(date);
698
+ };
699
+ NgxMatTuiCalendarComponent.prototype.onCalendarPrev = function () {
700
+ this.calendar.prev();
701
+ };
702
+ NgxMatTuiCalendarComponent.prototype.onCalendarToday = function () {
703
+ this.calendar.today();
704
+ };
705
+ NgxMatTuiCalendarComponent.prototype.onCalendarNext = function () {
706
+ this.calendar.next();
707
+ };
708
+ NgxMatTuiCalendarComponent.prototype.onCalendarLongNext = function () {
709
+ var date = this.calendar.getDate().toDate();
710
+ var days = 0;
711
+ var months = 0;
712
+ var years = 0;
713
+ switch (this.calendar.getViewName()) {
714
+ case 'day':
715
+ days = 7;
716
+ break;
717
+ case 'week':
718
+ days = 28;
719
+ break;
720
+ case 'month':
721
+ years = 1;
722
+ break;
723
+ }
724
+ date.setFullYear(date.getFullYear() + years);
725
+ date.setMonth(date.getMonth() + months); // date class does the modular arithmetic
726
+ date.setDate(date.getDate() + days); // date class does the modular arithmetic
727
+ this.calendar.setDate(date);
728
+ };
729
+ NgxMatTuiCalendarComponent.prototype.onMonthView = function () {
730
+ this.calendar.changeView('month');
731
+ };
732
+ NgxMatTuiCalendarComponent.prototype.onWeekView = function () {
733
+ this.calendar.changeView('week');
734
+ };
735
+ NgxMatTuiCalendarComponent.prototype.onDayView = function () {
736
+ this.calendar.changeView('day');
737
+ };
738
+ NgxMatTuiCalendarComponent.prototype.getDate = function () {
739
+ var date = this.calendar.getDate();
740
+ var str = date.toDate().toLocaleDateString("en-US", {
741
+ year: 'numeric',
742
+ month: 'short',
743
+ });
744
+ return str;
745
+ };
746
+ NgxMatTuiCalendarComponent.prototype.createTUICalendar = function (options) {
747
+ this.calendar = new Calendar__default["default"]('#calendar', this.prerocessOptions(options));
748
+ };
749
+ NgxMatTuiCalendarComponent.prototype.bindCallbacks = function () {
750
+ this.bindAfterRenderSchedule();
751
+ this.bindClickTimezonesCollapseBtn();
752
+ this.bindClickDayname();
753
+ this.bindClickMore();
754
+ this.bindClickSchedule();
755
+ this.bindBeforeCreateSchedule();
756
+ this.bindBeforeUpdateSchedule();
757
+ this.bindBeforeDeleteSchedule();
758
+ };
759
+ NgxMatTuiCalendarComponent.prototype.bindAfterRenderSchedule = function () {
760
+ var that = this;
761
+ this.calendar.on('afterRenderSchedule', function (event) {
762
+ // console.warn(`afterRenderSchedule`, event);
763
+ });
764
+ };
765
+ NgxMatTuiCalendarComponent.prototype.bindClickTimezonesCollapseBtn = function () {
766
+ var that = this;
767
+ this.calendar.on('clickTimezonesCollapseBtn', function (timezonesCollapsed) {
768
+ // console.warn(`clickTimezonesCollapseBtn`, timezonesCollapsed);
769
+ });
770
+ };
771
+ NgxMatTuiCalendarComponent.prototype.bindClickDayname = function () {
772
+ var that = this;
773
+ this.calendar.on('clickDayname', function (event) {
774
+ // console.warn(`clickDayname`, event);
775
+ });
776
+ };
777
+ NgxMatTuiCalendarComponent.prototype.bindClickMore = function () {
778
+ var that = this;
779
+ this.calendar.on('clickMore', function (event) {
780
+ // console.warn(`clickMore`, event);
781
+ });
782
+ };
783
+ NgxMatTuiCalendarComponent.prototype.bindClickSchedule = function () {
784
+ // only works if useDetailPopup: false,
785
+ var that = this;
786
+ this.calendar.on('clickSchedule', function (event) {
787
+ // console.warn(`clickSchedule`, event);
788
+ var schedule = Object.assign({}, event.schedule);
789
+ schedule.start = (new LocalDate(schedule.start)).toDate();
790
+ schedule.end = (new LocalDate(schedule.end)).toDate();
791
+ that.openPopupScheduleEditor(schedule);
792
+ });
793
+ };
794
+ NgxMatTuiCalendarComponent.prototype.bindBeforeCreateSchedule = function () {
795
+ var that = this;
796
+ this.calendar.on('beforeCreateSchedule', function (event) {
797
+ // console.log(`beforeCreateSchedule`, event);
798
+ var start = (new LocalDate(event.start)).toDate();
799
+ start.setHours(9);
800
+ var end = (new LocalDate(event.end)).toDate();
801
+ end.setHours(10);
802
+ that.openPopupScheduleEditor({
803
+ title: '',
804
+ start: start,
805
+ end: end,
806
+ id: null,
807
+ });
808
+ });
809
+ };
810
+ NgxMatTuiCalendarComponent.prototype.bindBeforeUpdateSchedule = function () {
811
+ var that = this;
812
+ this.calendar.on('beforeUpdateSchedule', function (event) {
813
+ // console.log(`beforeUpdateSchedule`, event);
814
+ that.updateScheduleAndNotifyParent(event);
815
+ });
816
+ };
817
+ NgxMatTuiCalendarComponent.prototype.bindBeforeDeleteSchedule = function () {
818
+ var that = this;
819
+ this.calendar.on('beforeDeleteSchedule', function (event) {
820
+ // console.log(`beforeDeleteSchedule`, event.schedule);
821
+ // console.log(`beforeDeleteSchedule`, event.schedule);
822
+ that.deleteScheduleAndNotifyParent({ id: event.schedule.id, calendarId: event.schedule.calendarId });
823
+ });
824
+ };
825
+ NgxMatTuiCalendarComponent.prototype.nextColor = function () {
826
+ var color = this.colors[this.colorIndex++].hex();
827
+ if (this.colorIndex >= this.colors.length)
828
+ this.colorIndex = 0;
829
+ return color;
830
+ };
831
+ NgxMatTuiCalendarComponent.prototype.createScheduleAndNotifyParent = function (args) {
832
+ var schedule = this.createSchedule(args);
833
+ this.userCreatedSchedule.emit(schedule);
834
+ return schedule;
835
+ };
836
+ NgxMatTuiCalendarComponent.prototype.createSchedules = function (schedules) {
837
+ var e_1, _a;
838
+ var newSchedules = [];
839
+ try {
840
+ for (var schedules_1 = __values(schedules), schedules_1_1 = schedules_1.next(); !schedules_1_1.done; schedules_1_1 = schedules_1.next()) {
841
+ var schedule = schedules_1_1.value;
842
+ newSchedules.push(this.createSchedule(schedule));
843
+ }
844
+ }
845
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
846
+ finally {
847
+ try {
848
+ if (schedules_1_1 && !schedules_1_1.done && (_a = schedules_1.return)) _a.call(schedules_1);
849
+ }
850
+ finally { if (e_1) throw e_1.error; }
851
+ }
852
+ return newSchedules;
853
+ };
854
+ NgxMatTuiCalendarComponent.prototype.createSchedule = function (args) {
855
+ // if (form.invalid) return;
856
+ // create a color
857
+ var color = this.nextColor();
858
+ // console.log(color);
859
+ // create an id
860
+ var id = (args.id == null) ? '' : args.id.toString();
861
+ if (id.length === 0) {
862
+ id = uuid.v4();
863
+ }
864
+ var start = LocalDate.convertToJsDate(args.start);
865
+ var end = LocalDate.convertToJsDate(args.end);
866
+ var schedule = {
867
+ id: id,
868
+ calendarId: (args.calendarId == null) ? this.calendarId : args.calendarId,
869
+ title: args.title,
870
+ start: start,
871
+ end: end,
872
+ category: args.category,
873
+ isAllDay: args.isAllDay,
874
+ dueDateClass: '',
875
+ bgColor: color,
876
+ };
877
+ // console.log(`event-calendar.component.ts: createEvent:`, schedule);
878
+ this.calendar.createSchedules([schedule]);
879
+ return this.calendar.getSchedule(schedule.id, schedule.calendarId);
880
+ };
881
+ NgxMatTuiCalendarComponent.prototype.updateScheduleAndNotifyParent = function (args) {
882
+ var schedule = this.updateSchedule(args);
883
+ this.userUpdatedSchedule.emit(schedule);
884
+ return schedule;
885
+ };
886
+ NgxMatTuiCalendarComponent.prototype.updateSchedule = function (schedule) {
887
+ // console.log(`event-calendar.component.ts: updateSchedule:`, schedule);
888
+ var calendarId = (schedule.calendarId == null) ? this.calendarId : schedule.calendarId;
889
+ this.calendar.updateSchedule(schedule.id, calendarId, schedule, false);
890
+ return this.calendar.getSchedule(schedule.id, calendarId);
891
+ };
892
+ NgxMatTuiCalendarComponent.prototype.getSchedule = function (args) {
893
+ // console.log(`event-calendar.component.ts: getSchedule:`, schedule);
894
+ var calendarId = (args.calendarId == null) ? this.calendarId : args.calendarId;
895
+ return this.calendar.getSchedule(args.id, calendarId);
896
+ };
897
+ NgxMatTuiCalendarComponent.prototype.deleteScheduleAndNotifyParent = function (args) {
898
+ this.deleteSchedule(args);
899
+ var calendarId = (args.calendarId == null) ? this.calendarId : args.calendarId;
900
+ this.userDeletedSchedule.emit({ id: args.id, calendarId: calendarId });
901
+ };
902
+ NgxMatTuiCalendarComponent.prototype.deleteSchedule = function (args) {
903
+ // console.log(`event-calendar.component.ts: deleteSchedule:`, schedule);
904
+ var calendarId = (args.calendarId == null) ? this.calendarId : args.calendarId;
905
+ this.calendar.deleteSchedule(args.id, calendarId, false);
906
+ };
907
+ NgxMatTuiCalendarComponent.prototype.deleteAllSchedules = function () {
908
+ this.calendar.clear();
909
+ };
910
+ NgxMatTuiCalendarComponent.prototype.openPopupScheduleEditor = function (schedule) {
911
+ var _this = this;
912
+ // console.log('openPopupScheduleEditor: calevent:', schedule);
913
+ var dialogConfig = new i1.MatDialogConfig();
914
+ dialogConfig.panelClass = this.options.themeClass;
915
+ console.warn("options: ", this.options);
916
+ dialogConfig.data = { schedule: schedule, darkMode: this.options.darkMode, themeClass: this.options.themeClass };
917
+ dialogConfig.autoFocus = true;
918
+ var dialogRef = this.dialog.open(NgxMatTuiCalendarEditorDialogComponent, dialogConfig);
919
+ // const dialogRef = this.dialog.open(NgxMatTuiCalendarScheduleEditorDialogComponent, {
920
+ // data: schedule,
921
+ // });
922
+ dialogRef.afterClosed().subscribe(function (result) {
923
+ // console.log('openPopupScheduleEditor: The dialog was closed', result);
924
+ _this.calendar.render(true); // <-- so that selection is cleared
925
+ if (result && result.schedule) {
926
+ var schedule_1 = result.schedule;
927
+ if (result.performDelete == true) {
928
+ // delete
929
+ // console.log(`openPopupScheduleEditor:afterCLosed: deleteSchedule`);
930
+ _this.deleteScheduleAndNotifyParent({ id: schedule_1.id, calendarId: schedule_1.calendarId });
931
+ }
932
+ else if (schedule_1.id == null) {
933
+ // console.log(`openPopupScheduleEditor:afterCLosed: addSchedule`);
934
+ _this.createScheduleAndNotifyParent(schedule_1);
935
+ }
936
+ else {
937
+ // console.log(`openPopupScheduleEditor:afterCLosed: updateSchedule`);
938
+ _this.updateScheduleAndNotifyParent(schedule_1);
939
+ }
940
+ }
941
+ });
942
+ };
943
+ NgxMatTuiCalendarComponent.prototype.setOptions = function (options) {
944
+ this.calendar.setOptions(this.prerocessOptions(options));
945
+ };
946
+ NgxMatTuiCalendarComponent.prototype.prerocessOptions = function (options) {
947
+ var defs = this.getDefaultOptions();
948
+ if (options == null) {
949
+ options = defs;
950
+ }
951
+ else {
952
+ options = Object.assign(Object.assign({}, defs), options);
953
+ }
954
+ options.useCreationPopup = false;
955
+ options.useDetailPopup = false;
956
+ return options;
957
+ };
958
+ NgxMatTuiCalendarComponent.prototype.getDefaultOptions = function () {
959
+ return {
960
+ defaultView: 'month',
961
+ taskView: true,
962
+ useCreationPopup: false,
963
+ useDetailPopup: false,
964
+ theme: this.getDefaultTheme(),
965
+ template: {
966
+ monthDayname: function (dayname) {
967
+ return '<span class="calendar-week-dayname-name">' + dayname.label + '</span>';
968
+ }
969
+ },
970
+ week: {
971
+ // startDayOfWeek: undefined,
972
+ // daynames: undefined,
973
+ narrowWeekend: false,
974
+ // workweek: true,
975
+ showTimezoneCollapseButton: true,
976
+ timezonesCollapsed: true,
977
+ hourStart: 7,
978
+ hourEnd: 20,
979
+ },
980
+ };
981
+ };
982
+ NgxMatTuiCalendarComponent.prototype.getColor = function (name) {
983
+ var el = document.getElementById("theme-" + name);
984
+ if (el) {
985
+ var style = window.getComputedStyle(el, null);
986
+ console.warn("color:", style.color);
987
+ return style.color;
988
+ }
989
+ return '';
990
+ };
991
+ NgxMatTuiCalendarComponent.prototype.getDefaultTheme = function () {
992
+ function adjustHexOpacity(color, opacity) {
993
+ var r = parseInt(color.slice(1, 3), 16);
994
+ var g = parseInt(color.slice(3, 5), 16);
995
+ var b = parseInt(color.slice(5, 7), 16);
996
+ return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + opacity + ')';
997
+ }
998
+ // default keys and styles
999
+ // TODO: apply Material Design Theme
1000
+ var background = this.getColor("background");
1001
+ var border = this.getColor("divider");
1002
+ var borderLight = this.getColor("divider-light");
1003
+ var shadow = this.getColor("divider");
1004
+ var highlight = this.getColor("highlight");
1005
+ var primary = this.getColor("primary");
1006
+ var warn = this.getColor("warn");
1007
+ var text = this.getColor("foreground");
1008
+ var primaryShaded = this.getColor("primary-shaded");
1009
+ // tui-full-calendar-weekday-schedule-title
1010
+ //calendar-week-dayname-name
1011
+ return {
1012
+ 'common.border': "1px solid " + border,
1013
+ 'common.backgroundColor': background,
1014
+ 'common.holiday.color': warn,
1015
+ 'common.saturday.color': text,
1016
+ 'common.dayname.color': text,
1017
+ 'common.today.color': '#0f0',
1018
+ // creation guide style
1019
+ 'common.creationGuide.backgroundColor': primaryShaded,
1020
+ 'common.creationGuide.border': "1px solid " + highlight,
1021
+ // month header 'dayname'
1022
+ 'month.dayname.height': '31px',
1023
+ 'month.dayname.borderLeft': "1px solid " + border,
1024
+ 'month.dayname.paddingLeft': '10px',
1025
+ 'month.dayname.paddingRight': '10px',
1026
+ 'month.dayname.backgroundColor': 'inherit',
1027
+ 'month.dayname.fontSize': '12px',
1028
+ 'month.dayname.fontWeight': 'normal',
1029
+ 'month.dayname.textAlign': 'left',
1030
+ // month day grid cell 'day'
1031
+ 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)',
1032
+ 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)',
1033
+ 'month.weekend.backgroundColor': 'inherit',
1034
+ 'month.day.fontSize': '14px',
1035
+ 'month.schedule.color': highlight,
1036
+ // month schedule style
1037
+ 'month.schedule.borderRadius': '2px',
1038
+ 'month.schedule.height': '24px',
1039
+ 'month.schedule.marginTop': '2px',
1040
+ 'month.schedule.marginLeft': '8px',
1041
+ 'month.schedule.marginRight': '8px',
1042
+ // month more view
1043
+ 'month.moreView.border': "1px solid " + border,
1044
+ 'month.moreView.boxShadow': "0 2px 6px 0 " + shadow,
1045
+ 'month.moreView.backgroundColor': background,
1046
+ 'month.moreView.paddingBottom': '17px',
1047
+ 'month.moreViewTitle.height': '44px',
1048
+ 'month.moreViewTitle.marginBottom': '12px',
1049
+ 'month.moreViewTitle.backgroundColor': 'inherit',
1050
+ 'month.moreViewTitle.borderBottom': 'none',
1051
+ 'month.moreViewTitle.padding': '12px 17px 0 17px',
1052
+ 'month.moreViewList.padding': '0 17px',
1053
+ // week header 'dayname'
1054
+ 'week.dayname.height': '42px',
1055
+ 'week.dayname.borderTop': "1px solid " + border,
1056
+ 'week.dayname.borderBottom': "1px solid " + border,
1057
+ 'week.dayname.borderLeft': 'inherit',
1058
+ 'week.dayname.paddingLeft': '0',
1059
+ 'week.dayname.backgroundColor': 'inherit',
1060
+ 'week.dayname.textAlign': 'left',
1061
+ 'week.today.color': text,
1062
+ 'week.pastDay.color': borderLight,
1063
+ // week vertical panel 'vpanel'
1064
+ 'week.vpanelSplitter.border': "1px solid " + border,
1065
+ 'week.vpanelSplitter.height': '3px',
1066
+ // week daygrid 'daygrid'
1067
+ 'week.daygrid.borderRight': "1px solid " + border,
1068
+ 'week.daygrid.backgroundColor': background,
1069
+ 'week.daygridLeft.width': '72px',
1070
+ 'week.daygridLeft.backgroundColor': background,
1071
+ 'week.daygridLeft.paddingRight': '8px',
1072
+ 'week.daygridLeft.borderRight': "1px solid " + border,
1073
+ 'week.today.backgroundColor': primaryShaded,
1074
+ 'week.weekend.backgroundColor': 'inherit',
1075
+ // week timegrid 'timegrid'
1076
+ 'week.timegridLeft.width': '72px',
1077
+ 'week.timegridLeft.backgroundColor': 'inherit',
1078
+ 'week.timegridLeft.borderRight': "1px solid " + border,
1079
+ 'week.timegridLeft.fontSize': '11px',
1080
+ 'week.timegridLeftTimezoneLabel.height': '40px',
1081
+ 'week.timegridLeftAdditionalTimezone.backgroundColor': background,
1082
+ 'week.timegridOneHour.height': '52px',
1083
+ 'week.timegridHalfHour.height': '26px',
1084
+ 'week.timegridHalfHour.borderBottom': 'none',
1085
+ 'week.timegridHorizontalLine.borderBottom': "1px solid " + border,
1086
+ 'week.timegrid.paddingRight': '8px',
1087
+ 'week.timegrid.borderRight': "1px solid " + border,
1088
+ 'week.timegridSchedule.borderRadius': '2px',
1089
+ 'week.timegridSchedule.paddingLeft': '2px',
1090
+ // #515ce6 is a slate blue
1091
+ 'week.currentTime.color': highlight,
1092
+ 'week.currentTime.fontSize': '11px',
1093
+ 'week.currentTime.fontWeight': 'normal',
1094
+ 'week.pastTime.color': borderLight,
1095
+ 'week.pastTime.fontWeight': 'normal',
1096
+ 'week.futureTime.color': border,
1097
+ 'week.futureTime.fontWeight': 'normal',
1098
+ 'week.currentTimeLinePast.border': "1px dashed " + highlight,
1099
+ 'week.currentTimeLineBullet.backgroundColor': highlight,
1100
+ 'week.currentTimeLineToday.border': "1px solid " + highlight,
1101
+ 'week.currentTimeLineFuture.border': 'none',
1102
+ // week creation guide style
1103
+ 'week.creationGuide.color': highlight,
1104
+ 'week.creationGuide.fontSize': '11px',
1105
+ 'week.creationGuide.fontWeight': 'bold',
1106
+ // week daygrid schedule style
1107
+ 'week.dayGridSchedule.borderRadius': '2px',
1108
+ 'week.dayGridSchedule.height': '24px',
1109
+ 'week.dayGridSchedule.marginTop': '2px',
1110
+ 'week.dayGridSchedule.marginLeft': '8px',
1111
+ 'week.dayGridSchedule.marginRight': '8px'
1112
+ };
45
1113
  };
46
1114
  return NgxMatTuiCalendarComponent;
47
1115
  }());
48
- NgxMatTuiCalendarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
49
- NgxMatTuiCalendarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: NgxMatTuiCalendarComponent, selector: "ngx-mat-tui-calendar", ngImport: i0__namespace, template: "\n <p>\n ngx-mat-tui-calendar v0.0.11 works!\n </p>\n ", isInline: true });
1116
+ NgxMatTuiCalendarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarComponent, deps: [{ token: i1__namespace.MatDialog }], target: i0__namespace.ɵɵFactoryTarget.Component });
1117
+ NgxMatTuiCalendarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: NgxMatTuiCalendarComponent, selector: "ngx-mat-tui-calendar", inputs: { options: "options" }, outputs: { userCreatedSchedule: "userCreatedSchedule", userUpdatedSchedule: "userUpdatedSchedule", userDeletedSchedule: "userDeletedSchedule" }, usesOnChanges: true, ngImport: i0__namespace, template: "<p>\r\n ngx-mat-tui-calendar v0.0.15 works!!!\r\n</p>\r\n<section class=\"content-container\">\r\n <!-- These divs are here so that we can read the theme colors for the tui theme -->\r\n <div id=\"theme-primary\"></div>\r\n <div id=\"theme-primary-shaded\"></div>\r\n <div id=\"theme-highlight\"></div>\r\n <div id=\"theme-accent\"></div>\r\n <div id=\"theme-warn\"></div>\r\n <div id=\"theme-foreground\"></div>\r\n <div id=\"theme-divider\"></div>\r\n <div id=\"theme-background\"></div>\r\n \r\n <div class=\"calendar-container\">\r\n <!-- calendar titlebar -->\r\n <mat-toolbar class=\"menu-bar\" color=\"primary\">\r\n <!-- <div style=\"align-self: center;display: flex;\r\n align-items: center;\r\n justify-content: flex-start;\"> -->\r\n <div style=\"display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n width: 100%; \">\r\n <div class=\"left-div\">\r\n <!-- LEFT -->\r\n <button mat-button \r\n class=\"navigation-button\"\r\n style=\"margin-left: 0px; margin-right: 0px; font-size: 1.5rem !important;\" \r\n (click)=\"onCalendarLongPrev()\">\r\n <fa-icon [icon]=\"iconLongPrev\"></fa-icon>\r\n </button>\r\n <button mat-button \r\n class=\"navigation-button\" \r\n style=\"margin-left: 0px; margin-right: 0px; font-size: 2rem !important;\" \r\n (click)=\"onCalendarPrev()\">\r\n <fa-icon [icon]=\"iconPrev\"></fa-icon>\r\n </button>\r\n <button mat-button \r\n class=\"navigation-button\"\r\n style=\"margin-left: 0px; margin-right: 0px; font-size: 1.7rem !important;\" \r\n (click)=\"onCalendarToday()\">\r\n <fa-icon [icon]=\"iconToday\"></fa-icon>\r\n </button>\r\n <button mat-button \r\n class=\"navigation-button\" \r\n style=\"margin-left: 0px; margin-right: 0px; font-size: 2rem !important;\" \r\n (click)=\"onCalendarNext()\">\r\n <fa-icon [icon]=\"iconNext\"></fa-icon>\r\n </button>\r\n <button mat-button \r\n class=\"navigation-button\"\r\n style=\"margin-left: 0px; margin-right: 0px; font-size: 1.5rem !important;\" \r\n (click)=\"onCalendarLongNext()\">\r\n <fa-icon [icon]=\"iconLongNext\"></fa-icon>\r\n </button>\r\n </div>\r\n <div class=\"center-div\">\r\n <!-- CENTER -->\r\n <span class=\"event-calendar-title\">{{ getDate() }}</span>\r\n </div>\r\n <div class=\"right-div\">\r\n \r\n <!-- RIGHT -->\r\n <mat-button-toggle-group class=\"view-button\" value=\"month\" id=\"@+id/toggleButton\" layout_width=\"wrap_content\"\r\n layout_height=\"wrap_content\">\r\n <mat-button-toggle mat-button value=\"month\" class=\"view-button\" (click)=\"onMonthView()\">\r\n <fa-icon [icon]=\"iconByMonth\"></fa-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle mat-button value=\"week\" class=\"view-button\" (click)=\"onWeekView()\">\r\n <fa-icon [icon]=\"iconByWeek\"></fa-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle mat-button value=\"day\" class=\"view-button\" (click)=\"onDayView()\">\r\n <fa-icon [icon]=\"iconByDay\"></fa-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n </div>\r\n </mat-toolbar>\r\n <ngx-mat-tui-calendar-wrapper></ngx-mat-tui-calendar-wrapper>\r\n </div>\r\n \r\n </section>", styles: [".calendar-container{transform-origin:top left}.menu-bar{display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:2rem!important}.mat-button{font-size:1.1rem!important}.mat-button.navigation-button{padding:0;min-width:32px}.left-div{width:33%;float:left;display:flex;white-space:nowrap;vertical-align:middle}.center-div{width:33%;float:right;text-align:center;white-space:nowrap;vertical-align:middle}.event-calendar-title{font-size:2rem;vertical-align:middle}.right-div{width:33%;display:flex;white-space:nowrap;vertical-align:middle;flex-flow:row-reverse}@media screen and (max-width: 599px){.left-div{transform:scale(.75);transform-origin:center left}.center-div{transform:scale(.5)}.right-div{transform:scale(1);transform-origin:center right}.right-div .mat-button-toggle-group.view-button{font-size:1.1rem!important}.right-div ::ng-deep .mat-button-toggle-label-content{padding:0 8px!important}}.mat-button-toggle-group.view-button{height:36px;font-size:1.25rem!important}.view-button{align-items:center}::ng-deep .mat-button-toggle-label-content{padding:0 10px!important}\n"], components: [{ type: i2__namespace$1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { type: i6__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4__namespace$1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { type: i5__namespace$1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: NgxMatTuiCalendarWrapperComponent, selector: "ngx-mat-tui-calendar-wrapper" }], directives: [{ type: i5__namespace$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }] });
50
1118
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarComponent, decorators: [{
51
1119
  type: i0.Component,
52
1120
  args: [{
53
1121
  selector: 'ngx-mat-tui-calendar',
54
- template: "\n <p>\n ngx-mat-tui-calendar v0.0.11 works!\n </p>\n ",
55
- styles: []
1122
+ templateUrl: './ngx-mat-tui-calendar.component.html',
1123
+ styleUrls: [
1124
+ './ngx-mat-tui-calendar.component.scss'
1125
+ ],
56
1126
  }]
57
- }], ctorParameters: function () { return []; } });
1127
+ }], ctorParameters: function () { return [{ type: i1__namespace.MatDialog }]; }, propDecorators: { userCreatedSchedule: [{
1128
+ type: i0.Output
1129
+ }], userUpdatedSchedule: [{
1130
+ type: i0.Output
1131
+ }], userDeletedSchedule: [{
1132
+ type: i0.Output
1133
+ }], options: [{
1134
+ type: i0.Input
1135
+ }] } });
58
1136
 
1137
+ // Angular modules
59
1138
  var NgxMatTuiCalendarModule = /** @class */ (function () {
60
1139
  function NgxMatTuiCalendarModule() {
61
1140
  }
62
1141
  return NgxMatTuiCalendarModule;
63
1142
  }());
64
1143
  NgxMatTuiCalendarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
65
- NgxMatTuiCalendarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarModule, declarations: [NgxMatTuiCalendarComponent], exports: [NgxMatTuiCalendarComponent] });
66
- NgxMatTuiCalendarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarModule, imports: [[]] });
1144
+ NgxMatTuiCalendarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarModule, declarations: [NgxMatTuiCalendarComponent,
1145
+ NgxMatTuiCalendarWrapperComponent,
1146
+ NgxMatTuiCalendarEditorDialogComponent], imports: [animations.BrowserAnimationsModule,
1147
+ platformBrowser.BrowserModule,
1148
+ flexLayout.FlexLayoutModule,
1149
+ flexLayout.FlexModule,
1150
+ i7.FormsModule,
1151
+ http.HttpClientModule,
1152
+ overlay.OverlayModule,
1153
+ i7.ReactiveFormsModule,
1154
+ i6.MatButtonModule,
1155
+ i5$1.MatButtonToggleModule,
1156
+ card.MatCardModule,
1157
+ i4.MatDatepickerModule,
1158
+ i1.MatDialogModule,
1159
+ i5.MatDividerModule,
1160
+ i2.MatFormFieldModule,
1161
+ icon.MatIconModule,
1162
+ i8.MatInputModule,
1163
+ core.MatNativeDateModule,
1164
+ i3.MatRadioModule,
1165
+ core.MatRippleModule,
1166
+ slideToggle.MatSlideToggleModule,
1167
+ i2$1.MatToolbarModule,
1168
+ i4$1.FontAwesomeModule,
1169
+ i10.MatTimepickerModule], exports: [NgxMatTuiCalendarComponent] });
1170
+ NgxMatTuiCalendarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarModule, imports: [[
1171
+ animations.BrowserAnimationsModule,
1172
+ platformBrowser.BrowserModule,
1173
+ flexLayout.FlexLayoutModule,
1174
+ flexLayout.FlexModule,
1175
+ i7.FormsModule,
1176
+ http.HttpClientModule,
1177
+ overlay.OverlayModule,
1178
+ i7.ReactiveFormsModule,
1179
+ i6.MatButtonModule,
1180
+ i5$1.MatButtonToggleModule,
1181
+ card.MatCardModule,
1182
+ i4.MatDatepickerModule,
1183
+ i1.MatDialogModule,
1184
+ i5.MatDividerModule,
1185
+ i2.MatFormFieldModule,
1186
+ icon.MatIconModule,
1187
+ i8.MatInputModule,
1188
+ core.MatNativeDateModule,
1189
+ i3.MatRadioModule,
1190
+ core.MatRippleModule,
1191
+ slideToggle.MatSlideToggleModule,
1192
+ i2$1.MatToolbarModule,
1193
+ i4$1.FontAwesomeModule,
1194
+ i10.MatTimepickerModule,
1195
+ ]] });
67
1196
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: NgxMatTuiCalendarModule, decorators: [{
68
1197
  type: i0.NgModule,
69
1198
  args: [{
70
1199
  declarations: [
71
1200
  NgxMatTuiCalendarComponent,
1201
+ NgxMatTuiCalendarWrapperComponent,
1202
+ NgxMatTuiCalendarEditorDialogComponent,
1203
+ ],
1204
+ imports: [
1205
+ animations.BrowserAnimationsModule,
1206
+ platformBrowser.BrowserModule,
1207
+ flexLayout.FlexLayoutModule,
1208
+ flexLayout.FlexModule,
1209
+ i7.FormsModule,
1210
+ http.HttpClientModule,
1211
+ overlay.OverlayModule,
1212
+ i7.ReactiveFormsModule,
1213
+ i6.MatButtonModule,
1214
+ i5$1.MatButtonToggleModule,
1215
+ card.MatCardModule,
1216
+ i4.MatDatepickerModule,
1217
+ i1.MatDialogModule,
1218
+ i5.MatDividerModule,
1219
+ i2.MatFormFieldModule,
1220
+ icon.MatIconModule,
1221
+ i8.MatInputModule,
1222
+ core.MatNativeDateModule,
1223
+ i3.MatRadioModule,
1224
+ core.MatRippleModule,
1225
+ slideToggle.MatSlideToggleModule,
1226
+ i2$1.MatToolbarModule,
1227
+ i4$1.FontAwesomeModule,
1228
+ i10.MatTimepickerModule,
72
1229
  ],
73
- imports: [],
74
1230
  exports: [
75
1231
  NgxMatTuiCalendarComponent,
76
1232
  ],
@@ -88,6 +1244,7 @@
88
1244
  * Generated bundle index. Do not edit.
89
1245
  */
90
1246
 
1247
+ exports.LocalDate = LocalDate;
91
1248
  exports.NgxMatTuiCalendarComponent = NgxMatTuiCalendarComponent;
92
1249
  exports.NgxMatTuiCalendarModule = NgxMatTuiCalendarModule;
93
1250
  exports.NgxMatTuiCalendarService = NgxMatTuiCalendarService;