@agorapulse/ui-components 0.0.1 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/agorapulse-ui-components-2.5.1.tgz +0 -0
  2. package/agorapulse-ui-components.d.ts +4 -3
  3. package/agorapulse-ui-components.metadata.json +1 -1
  4. package/assets/{lib-ui/icons → icons}/facebook-icon.png +0 -0
  5. package/assets/{lib-ui/icons → icons}/google-icon.png +0 -0
  6. package/assets/{lib-ui/icons → icons}/instagram-icon.png +0 -0
  7. package/assets/{lib-ui/icons → icons}/linkedin-icon.png +0 -0
  8. package/assets/{lib-ui/icons → icons}/pinterest-icon.png +0 -0
  9. package/assets/{lib-ui/icons → icons}/twitter-icon.png +0 -0
  10. package/assets/{lib-ui/icons → icons}/youtube-icon.png +0 -0
  11. package/assets/{lib-ui/img → img}/default-avatar-organization.png +0 -0
  12. package/assets/{lib-ui/img → img}/default-avatar-user.png +0 -0
  13. package/assets/{lib-ui/img → img}/default-avatar.png +0 -0
  14. package/assets/{lib-ui/img → img}/spinner_animation.gif +0 -0
  15. package/bundles/agorapulse-ui-components.umd.js +386 -9
  16. package/bundles/agorapulse-ui-components.umd.js.map +1 -1
  17. package/esm2015/agorapulse-ui-components.js +5 -4
  18. package/esm2015/src/lib/agorapulse-ui-components.module.js +7 -1
  19. package/esm2015/src/lib/directives/default-image.directive.js +2 -2
  20. package/esm2015/src/lib/edit-tag-modal/edit-tags-modal.component.js +2 -2
  21. package/esm2015/src/lib/neo-timepicker/neo-timepicker.component.js +371 -0
  22. package/fesm2015/agorapulse-ui-components.js +375 -4
  23. package/fesm2015/agorapulse-ui-components.js.map +1 -1
  24. package/package.json +8 -6
  25. package/src/lib/neo-timepicker/neo-timepicker.component.d.ts +129 -0
  26. package/agorapulse-ui-components-0.0.1.tgz +0 -0
@@ -33,13 +33,17 @@ import { NgSelectModule } from '@ng-select/ng-select';
33
33
  import { NgxDaterangepickerMd } from 'ngx-daterangepicker-material';
34
34
  import moment from 'moment';
35
35
  import { trigger, transition, style, animate, AnimationBuilder } from '@angular/animations';
36
- import { Subject, of, BehaviorSubject, merge, fromEvent } from 'rxjs';
36
+ import { Subject, of, fromEvent, BehaviorSubject, merge } from 'rxjs';
37
37
  import { takeUntil, debounceTime, distinctUntilChanged, tap, switchMap, catchError, map, delay } from 'rxjs/operators';
38
38
  import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
39
+ import format from 'date-fns/format';
40
+ import parse from 'date-fns/parse';
41
+ import IMask from 'imask';
39
42
  import * as i1 from '@angular/platform-browser';
40
43
  import { DomSanitizer } from '@angular/platform-browser';
41
44
  import { ComponentPortal, PortalInjector } from '@angular/cdk/portal';
42
45
  import { AgorapulseUiSymbolModule } from '@agorapulse/ui-symbol';
46
+ import { IMaskModule } from 'angular-imask';
43
47
 
44
48
  class AddCommentComponent {
45
49
  constructor() {
@@ -659,7 +663,7 @@ class EditTagsModalComponent {
659
663
  }
660
664
  EditTagsModalComponent.decorators = [
661
665
  { type: Component, args: [{
662
- template: "<ng-template #headerTemplate>\n <h2 class=\"title\">\n {{ data.translatedString.title }}\n </h2>\n <p class=\"large\">{{ data.translatedString.subtitle }}</p>\n</ng-template>\n<ng-template #mainTemplate>\n <div class=\"main-container\">\n <div class=\"search\">\n <div class=\"input-group\">\n <input type=\"text\"\n placeholder=\"{{ data.translatedString.searchPlaceholder }}\"\n (keyup)=\"onSearch($event.target.value)\">\n <ap-symbol class=\"input-group-append\"\n [symbolId]=\"'search-alternate'\"\n [size]=\"'micro'\">\n </ap-symbol>\n </div>\n </div>\n <div class=\"tags-content\" *ngIf=\"filteredTags\">\n <div class=\"tag-row\" *ngFor=\"let tag of filteredTags;let i=index\"\n [@tagRemoved]=\"deletedTags.includes(filteredTags[i]) ? 'deleted' : 'valid'\">\n <span *ngIf=\"tagEditedIndex !== i\" [class.disabled]=\"tagEditedIndex !== null\"> {{tag}} </span>\n <input type=\"text\" *ngIf=\"tagEditedIndex === i\" [value]=\"filteredTags[i]\"\n (keyup)=\"onValidateEnter($event, i)\" #tagInput/>\n <div class=\"button-container\">\n <img alt=\"spinner-loading\" width=\"20\" height=\"20\" src=\"assets/lib-ui-components/img/spinner_animation.gif\"\n *ngIf=\"updateStatusByTags?.get(filteredTags[i]) || updateStatusByTags?.get(tag)\"/>\n <div class=\"edit-label saved-label\"\n *ngIf=\"updateStatusByTags?.get(filteredTags[i]) === false && tagEditedIndex != i && savingTags.includes(filteredTags[i])\"\n [@tagSaved]>\n <ap-symbol [symbolId]=\"'check-1'\" [size]=\"'pico'\"></ap-symbol>\n {{ data.translatedString.savedLabel }}\n </div>\n <div class=\"edit-label deleted-label\"\n *ngIf=\"updateStatusByTags?.get(filteredTags[i]) === false && updatedTags && updatedTags.has(tag) && updatedTags.get(tag) === null\">\n <ap-symbol [symbolId]=\"'delete-2-alternate'\" [size]=\"'pico'\"></ap-symbol>\n {{ data.translatedString.deletedLabel }}\n </div>\n <button mat-flat-button *ngIf=\"tagEditedIndex !== i\"\n class=\"circle edit-button\"\n (click)=\"onEdit(i)\">\n <ap-symbol [symbolId]=\"'pencil-2'\"></ap-symbol>\n </button>\n <div *ngIf=\"tagEditedIndex === i\">\n <button mat-flat-button\n class=\"circle button-action button-validate\"\n [apTooltipNeo]=\"{content: data.translatedString.validateTooltip}\"\n [color]=\"'#858fa1'\"\n (click)=\"onValidateInput(i)\">\n <ap-symbol symbolId=\"check-2\"></ap-symbol>\n </button>\n <button mat-flat-button\n class=\"circle button-action button-cancel\"\n [apTooltipNeo]=\"{content: data.translatedString.cancelTooltip}\"\n [color]=\"'#858fa1'\"\n (click)=\"cancelEdit()\">\n <ap-symbol symbolId=\"delete-2-alternate\"></ap-symbol>\n </button>\n <button mat-flat-button\n class=\"circle button-action button-remove\"\n [apTooltipNeo]=\"{content: data.translatedString.deleteTooltip}\"\n [color]=\"'#858fa1'\"\n (click)=\"onRemove(tag)\">\n <ap-symbol symbolId=\"bin-2\"></ap-symbol>\n </button>\n </div>\n </div>\n </div>\n\n </div>\n <div class=\"loader\">\n <img alt=\"spinner-loading\" src=\"assets/lib-ui-components/img/spinner_animation.gif\"\n *ngIf=\"!filteredTags\"/>\n </div>\n </div>\n</ng-template>\n<ng-template #footerTemplate>\n <div class=\"footer\">\n <div>\n <button mat-flat-button class=\"done-button\" (click)=\"onDone()\" color=\"primary\">\n {{data.translatedString.doneLabel}}\n </button>\n </div>\n </div>\n\n</ng-template>\n\n<ap-modal class=\"design-system\"\n closable=\"true\"\n [headerTemplate]=\"headerTemplate\"\n [mainTemplate]=\"mainTemplate\"\n [footerTemplate]=\"footerTemplate\"></ap-modal>\n",
666
+ template: "<ng-template #headerTemplate>\n <h2 class=\"title\">\n {{ data.translatedString.title }}\n </h2>\n <p class=\"large\">{{ data.translatedString.subtitle }}</p>\n</ng-template>\n<ng-template #mainTemplate>\n <div class=\"main-container\">\n <div class=\"search\">\n <div class=\"input-group\">\n <input type=\"text\"\n placeholder=\"{{ data.translatedString.searchPlaceholder }}\"\n (keyup)=\"onSearch($event.target.value)\">\n <ap-symbol class=\"input-group-append\"\n [symbolId]=\"'search-alternate'\"\n [size]=\"'micro'\">\n </ap-symbol>\n </div>\n </div>\n <div class=\"tags-content\" *ngIf=\"filteredTags\">\n <div class=\"tag-row\" *ngFor=\"let tag of filteredTags;let i=index\"\n [@tagRemoved]=\"deletedTags.includes(filteredTags[i]) ? 'deleted' : 'valid'\">\n <span *ngIf=\"tagEditedIndex !== i\" [class.disabled]=\"tagEditedIndex !== null\"> {{tag}} </span>\n <input type=\"text\" *ngIf=\"tagEditedIndex === i\" [value]=\"filteredTags[i]\"\n (keyup)=\"onValidateEnter($event, i)\" #tagInput/>\n <div class=\"button-container\">\n <img alt=\"spinner-loading\" width=\"20\" height=\"20\" src=\"../../assets/img/spinner_animation.gif\"\n *ngIf=\"updateStatusByTags?.get(filteredTags[i]) || updateStatusByTags?.get(tag)\"/>\n <div class=\"edit-label saved-label\"\n *ngIf=\"updateStatusByTags?.get(filteredTags[i]) === false && tagEditedIndex != i && savingTags.includes(filteredTags[i])\"\n [@tagSaved]>\n <ap-symbol [symbolId]=\"'check-1'\" [size]=\"'pico'\"></ap-symbol>\n {{ data.translatedString.savedLabel }}\n </div>\n <div class=\"edit-label deleted-label\"\n *ngIf=\"updateStatusByTags?.get(filteredTags[i]) === false && updatedTags && updatedTags.has(tag) && updatedTags.get(tag) === null\">\n <ap-symbol [symbolId]=\"'delete-2-alternate'\" [size]=\"'pico'\"></ap-symbol>\n {{ data.translatedString.deletedLabel }}\n </div>\n <button mat-flat-button *ngIf=\"tagEditedIndex !== i\"\n class=\"circle edit-button\"\n (click)=\"onEdit(i)\">\n <ap-symbol [symbolId]=\"'pencil-2'\"></ap-symbol>\n </button>\n <div *ngIf=\"tagEditedIndex === i\">\n <button mat-flat-button\n class=\"circle button-action button-validate\"\n [apTooltipNeo]=\"{content: data.translatedString.validateTooltip}\"\n [color]=\"'#858fa1'\"\n (click)=\"onValidateInput(i)\">\n <ap-symbol symbolId=\"check-2\"></ap-symbol>\n </button>\n <button mat-flat-button\n class=\"circle button-action button-cancel\"\n [apTooltipNeo]=\"{content: data.translatedString.cancelTooltip}\"\n [color]=\"'#858fa1'\"\n (click)=\"cancelEdit()\">\n <ap-symbol symbolId=\"delete-2-alternate\"></ap-symbol>\n </button>\n <button mat-flat-button\n class=\"circle button-action button-remove\"\n [apTooltipNeo]=\"{content: data.translatedString.deleteTooltip}\"\n [color]=\"'#858fa1'\"\n (click)=\"onRemove(tag)\">\n <ap-symbol symbolId=\"bin-2\"></ap-symbol>\n </button>\n </div>\n </div>\n </div>\n\n </div>\n <div class=\"loader\">\n <img alt=\"spinner-loading\" src=\"../../assets/img/spinner_animation.gif\"\n *ngIf=\"!filteredTags\"/>\n </div>\n </div>\n</ng-template>\n<ng-template #footerTemplate>\n <div class=\"footer\">\n <div>\n <button mat-flat-button class=\"done-button\" (click)=\"onDone()\" color=\"primary\">\n {{data.translatedString.doneLabel}}\n </button>\n </div>\n </div>\n\n</ng-template>\n\n<ap-modal class=\"design-system\"\n closable=\"true\"\n [headerTemplate]=\"headerTemplate\"\n [mainTemplate]=\"mainTemplate\"\n [footerTemplate]=\"footerTemplate\"></ap-modal>\n",
663
667
  animations: [
664
668
  trigger('tagSaved', [
665
669
  transition('void => *', [
@@ -2193,6 +2197,369 @@ TimepickerComponent.propDecorators = {
2193
2197
  timeModelChange: [{ type: Output }]
2194
2198
  };
2195
2199
 
2200
+ class NeoTimepickerComponent {
2201
+ constructor(changeDetectorRef) {
2202
+ this.changeDetectorRef = changeDetectorRef;
2203
+ this.i18n = {
2204
+ hourLabel: 'Hour',
2205
+ minuteLabel: 'Minute',
2206
+ meridianLabel: 'AM/PM',
2207
+ doneLabel: 'Done',
2208
+ cancelLabel: 'Cancel',
2209
+ };
2210
+ this.disabled = false;
2211
+ this.format = TimeFormat.Default;
2212
+ this.invalid = false;
2213
+ this.placement = 'bottom';
2214
+ this.timeModelChange = new EventEmitter();
2215
+ this.meridians = ['AM', 'PM'];
2216
+ this.imaskDefault = {
2217
+ mask: 'HH:MM',
2218
+ blocks: {
2219
+ HH: {
2220
+ mask: IMask.MaskedRange,
2221
+ from: 0,
2222
+ to: 23,
2223
+ autofix: 'pad',
2224
+ },
2225
+ MM: {
2226
+ mask: IMask.MaskedRange,
2227
+ from: 0,
2228
+ to: 59,
2229
+ autofix: 'pad',
2230
+ },
2231
+ },
2232
+ };
2233
+ this.imaskMeridian = {
2234
+ mask: 'HH:MM AMPM',
2235
+ blocks: {
2236
+ HH: {
2237
+ mask: IMask.MaskedRange,
2238
+ from: 1,
2239
+ to: 12,
2240
+ autofix: 'pad',
2241
+ },
2242
+ MM: {
2243
+ mask: IMask.MaskedRange,
2244
+ from: 0,
2245
+ to: 59,
2246
+ autofix: 'pad',
2247
+ },
2248
+ AMPM: {
2249
+ mask: IMask.MaskedEnum,
2250
+ enum: ['AM', 'PM']
2251
+ }
2252
+ },
2253
+ lazy: false,
2254
+ prepare: function (str) {
2255
+ return str.toUpperCase();
2256
+ },
2257
+ };
2258
+ this.ENTER_KEY = 'Enter';
2259
+ this.ESCAPE_KEY = 'Escape';
2260
+ this.FIX_NUMBER = 10;
2261
+ this.HOURS_MAX = 24;
2262
+ this.HOURS_MERIDIAN_MAX = 12;
2263
+ this.MARGIN = 8;
2264
+ this.MINUTES_MAX = 60;
2265
+ this.TIME_OPTION_HEIGHT = 387;
2266
+ this.TIME_PICKER_DEFAULT_WIDTH = 96;
2267
+ this.TIME_PICKER_MERIDIAN_WIDTH = 152;
2268
+ this.ROW_HEIGHT = 36;
2269
+ this.hours = [];
2270
+ this.minutes = [];
2271
+ this.position = null;
2272
+ this.TimeFormat = TimeFormat;
2273
+ }
2274
+ onKeypress(event) {
2275
+ if (this.timepickerOpened) {
2276
+ if (event.code === this.ENTER_KEY) {
2277
+ this.onSaveSelection();
2278
+ }
2279
+ if (event.code === this.ESCAPE_KEY) {
2280
+ this.onCancelSelection();
2281
+ }
2282
+ }
2283
+ }
2284
+ ngOnInit() {
2285
+ this.generateTimeSlots();
2286
+ this.onTimeModelChange();
2287
+ }
2288
+ ngOnChanges(changes) {
2289
+ var _a, _b, _c;
2290
+ this.generateTimeSlots();
2291
+ if ((_a = changes.format) === null || _a === void 0 ? void 0 : _a.currentValue) {
2292
+ this.timeFormat = this.format === TimeFormat.Default ? 'HH:mm' : 'hh:mm a';
2293
+ if (this.format === TimeFormat.Default && this.meridians.some(meridian => { var _a; return (_a = this.timeModel) === null || _a === void 0 ? void 0 : _a.endsWith(meridian); })) {
2294
+ this.timeModel = NeoTimepickerComponent.convert12To24(this.timeModel);
2295
+ }
2296
+ else if (this.format === TimeFormat.Meridian && this.meridians.every(meridian => { var _a; return !((_a = this.timeModel) === null || _a === void 0 ? void 0 : _a.endsWith(meridian)); })) {
2297
+ this.timeModel = NeoTimepickerComponent.convert24To12(this.timeModel);
2298
+ }
2299
+ setTimeout(() => this.changeDetectorRef.markForCheck());
2300
+ }
2301
+ if ((_b = changes.placement) === null || _b === void 0 ? void 0 : _b.currentValue) {
2302
+ this.updateTimePickerPosition();
2303
+ }
2304
+ if ((_c = changes.format) === null || _c === void 0 ? void 0 : _c.currentValue) {
2305
+ this.updateTimePickerPosition();
2306
+ }
2307
+ }
2308
+ onOpenTimepicker() {
2309
+ this.destroy$ = new Subject();
2310
+ this.previousValue = this.timeModel;
2311
+ this.timepickerOpened = true;
2312
+ this.timepickerClosed = false;
2313
+ this.updateTimePickerPosition();
2314
+ setTimeout(() => {
2315
+ this.updateElementPosition('minute', this.selectedMinute, 'auto');
2316
+ this.updateElementPosition('hour', this.selectedHour, 'auto');
2317
+ this.updateElementPosition('meridian', this.selectedMeridian, 'auto');
2318
+ this.inputBox.nativeElement.focus();
2319
+ this.inputBox.nativeElement.select();
2320
+ }, 1);
2321
+ this.changeDetectorRef.markForCheck();
2322
+ }
2323
+ onTimepickerOpened() {
2324
+ this.hoursScrollObserver$ = this.onObserveElementScroll(this.hourOptions.nativeElement);
2325
+ this.minutesScrollObserver$ = this.onObserveElementScroll(this.minutesOptions.nativeElement);
2326
+ this.hoursScrollObserver$.subscribe((indexToScroll) => {
2327
+ this.updateTimeModel(this.hours[indexToScroll], this.selectedMinute, this.selectedMeridian);
2328
+ });
2329
+ this.minutesScrollObserver$.subscribe((indexToScroll) => {
2330
+ this.updateTimeModel(this.selectedHour, this.minutes[indexToScroll], this.selectedMeridian);
2331
+ });
2332
+ if (this.format === TimeFormat.Meridian) {
2333
+ this.meridiansScrollObserver$ = this.onObserveElementScroll(this.meridiansOptions.nativeElement);
2334
+ this.meridiansScrollObserver$.subscribe((indexToScroll) => {
2335
+ this.updateTimeModel(this.selectedHour, this.selectedMinute, this.meridians[indexToScroll]);
2336
+ });
2337
+ }
2338
+ }
2339
+ onObserveElementScroll(element) {
2340
+ return fromEvent(element, 'scroll').pipe(debounceTime(150), distinctUntilChanged(), takeUntil(this.destroy$), map(() => {
2341
+ return Math.round(element.scrollTop / this.ROW_HEIGHT);
2342
+ }));
2343
+ }
2344
+ onTimePickerClosed() {
2345
+ this.onCancelSelection();
2346
+ this.destroy$.next();
2347
+ this.destroy$.complete();
2348
+ }
2349
+ onTimeModelChange() {
2350
+ let date = new Date();
2351
+ if (this.timeModel) {
2352
+ date = parse(this.timeModel, this.timeFormat, new Date());
2353
+ }
2354
+ this.timeModel = format(date, this.timeFormat);
2355
+ if (!this.previousValue) {
2356
+ this.previousValue = this.timeModel;
2357
+ }
2358
+ let jsHour = date.getHours();
2359
+ if (this.format === TimeFormat.Meridian) {
2360
+ if (jsHour > 12) {
2361
+ jsHour = jsHour - 12;
2362
+ }
2363
+ // JS doesn't handle well AM/PM hour so 12:53 PM will be 00:53 ...
2364
+ if (jsHour == 0) {
2365
+ jsHour = 12;
2366
+ }
2367
+ }
2368
+ const hour = NeoTimepickerComponent.toFixed(jsHour.toString(), 10);
2369
+ if (hour != this.selectedHour) {
2370
+ this.selectedHour = hour;
2371
+ this.updateElementPosition('hour', this.selectedHour, 'auto');
2372
+ }
2373
+ const minute = NeoTimepickerComponent.toFixed(date.getMinutes().toString(), 10);
2374
+ if (minute != this.selectedMinute) {
2375
+ this.selectedMinute = minute;
2376
+ this.updateElementPosition('minute', this.selectedMinute, 'auto');
2377
+ }
2378
+ if (this.format === TimeFormat.Meridian && this.selectedMeridian !== this.timeModel.split(' ')[1]) {
2379
+ this.selectedMeridian = this.timeModel.split(' ')[1];
2380
+ this.updateElementPosition('meridian', this.selectedMeridian, 'auto');
2381
+ }
2382
+ this.changeDetectorRef.markForCheck();
2383
+ }
2384
+ onSelectHour(hour) {
2385
+ this.updateTimeModel(hour, this.selectedMinute, this.selectedMeridian);
2386
+ }
2387
+ onSelectMinute(minute) {
2388
+ this.updateTimeModel(this.selectedHour, minute, this.selectedMeridian);
2389
+ }
2390
+ onSelectMeridian(meridian) {
2391
+ this.updateTimeModel(this.selectedHour, this.selectedMinute, meridian);
2392
+ }
2393
+ onSaveSelection() {
2394
+ this.previousValue = this.timeModel;
2395
+ this.timepickerClosed = true;
2396
+ this.timepickerOpened = false;
2397
+ const timeModelValue = parse(this.timeModel, this.timeFormat, new Date());
2398
+ this.timeModelChange.emit({
2399
+ hours: timeModelValue.getHours(),
2400
+ minutes: timeModelValue.getMinutes(),
2401
+ });
2402
+ this.changeDetectorRef.markForCheck();
2403
+ }
2404
+ onCancelSelection() {
2405
+ this.timepickerClosed = true;
2406
+ this.timepickerOpened = false;
2407
+ this.timeModel = this.previousValue;
2408
+ this.changeDetectorRef.markForCheck();
2409
+ }
2410
+ onMaskValidateComplete(value) {
2411
+ if (this.timeModel !== value) {
2412
+ this.timeModel = value;
2413
+ }
2414
+ this.onTimeModelChange();
2415
+ }
2416
+ updateTimeModel(hour, minute, meridian) {
2417
+ if (this.format === TimeFormat.Meridian) {
2418
+ this.timeModel = `${hour}:${minute} ${meridian}`;
2419
+ }
2420
+ else {
2421
+ this.timeModel = `${hour}:${minute}`;
2422
+ }
2423
+ this.changeDetectorRef.markForCheck();
2424
+ }
2425
+ updateElementPosition(elementType, id, scrollBehavior) {
2426
+ const element = document.getElementById(`${elementType}-${id}`);
2427
+ this.scrollToElement(element, scrollBehavior);
2428
+ }
2429
+ scrollToElement(element, behavior = 'auto') {
2430
+ if (element) {
2431
+ setTimeout(() => {
2432
+ element.scrollIntoView({
2433
+ behavior,
2434
+ block: 'center',
2435
+ inline: 'center'
2436
+ });
2437
+ }, 1);
2438
+ }
2439
+ }
2440
+ /**
2441
+ * Fullfill minutes and hours arrays like [0, 1, 2 ... 12] and [0, 1, 2, ... 59]
2442
+ */
2443
+ generateTimeSlots() {
2444
+ this.hours = [];
2445
+ this.minutes = [NeoTimepickerComponent.toFixed(0, this.FIX_NUMBER)];
2446
+ for (let i = 1; i <= this.HOURS_MERIDIAN_MAX; i++) {
2447
+ const indexToAdd = NeoTimepickerComponent.toFixed(i, this.FIX_NUMBER);
2448
+ this.hours.push(indexToAdd);
2449
+ this.minutes.push(indexToAdd);
2450
+ }
2451
+ if (this.format === TimeFormat.Default) {
2452
+ this.hours = [NeoTimepickerComponent.toFixed(0, this.FIX_NUMBER), ...this.hours];
2453
+ for (let i = 13; i < this.HOURS_MAX; i++) {
2454
+ this.hours.push(NeoTimepickerComponent.toFixed(i, this.FIX_NUMBER));
2455
+ }
2456
+ }
2457
+ for (let i = 13; i < this.MINUTES_MAX; i++) {
2458
+ this.minutes.push(NeoTimepickerComponent.toFixed(i, this.FIX_NUMBER));
2459
+ }
2460
+ this.changeDetectorRef.markForCheck();
2461
+ }
2462
+ updateTimePickerPosition() {
2463
+ var _a;
2464
+ if ((_a = this.inputBox) === null || _a === void 0 ? void 0 : _a.nativeElement) {
2465
+ const inputBoxBounds = this.inputBox.nativeElement.getBoundingClientRect();
2466
+ const topPosition = inputBoxBounds.top - this.TIME_OPTION_HEIGHT - this.MARGIN;
2467
+ const bottomPosition = inputBoxBounds.top + inputBoxBounds.height;
2468
+ const timePickerWidth = this.format === TimeFormat.Meridian ? this.TIME_PICKER_MERIDIAN_WIDTH : this.TIME_PICKER_DEFAULT_WIDTH;
2469
+ const shift = (timePickerWidth - inputBoxBounds.width) / 2;
2470
+ if (this.placement === 'top') {
2471
+ this.position = {
2472
+ top: topPosition < 0 ? bottomPosition : topPosition,
2473
+ left: inputBoxBounds.left - shift,
2474
+ };
2475
+ }
2476
+ else {
2477
+ this.position = {
2478
+ top: bottomPosition + this.TIME_OPTION_HEIGHT + this.MARGIN > window.innerHeight ? topPosition : bottomPosition,
2479
+ left: inputBoxBounds.left - shift,
2480
+ };
2481
+ }
2482
+ this.changeDetectorRef.markForCheck();
2483
+ }
2484
+ }
2485
+ static convert12To24(time) {
2486
+ const terms = time.split(':');
2487
+ const minutes = terms[1].substring(0, 2);
2488
+ const meridian = terms[1].trim().slice(-2).toUpperCase();
2489
+ let hour = parseInt(terms[0]);
2490
+ if (!isNaN(parseInt(terms[0]))) {
2491
+ if (meridian === 'PM' && hour < 12) {
2492
+ hour = hour + 12;
2493
+ }
2494
+ if (meridian === 'AM' && hour === 12) {
2495
+ hour = 0;
2496
+ }
2497
+ }
2498
+ return `${hour}:${minutes}`;
2499
+ }
2500
+ static convert24To12(time) {
2501
+ const terms = time.split(':');
2502
+ let meridian = 'AM';
2503
+ let hour = parseInt(terms[0]);
2504
+ let minute = parseInt(terms[1]);
2505
+ if (!isNaN(parseInt(terms[0]))) {
2506
+ if (hour >= 12) {
2507
+ meridian = 'PM';
2508
+ if (hour > 12) {
2509
+ hour = hour - 12;
2510
+ }
2511
+ }
2512
+ if (hour === 0) {
2513
+ hour = 12;
2514
+ }
2515
+ }
2516
+ const hourStr = NeoTimepickerComponent.toFixed(hour, 10);
2517
+ const minuteStr = NeoTimepickerComponent.toFixed(minute, 10);
2518
+ return `${hourStr}:${minuteStr} ${meridian}`;
2519
+ }
2520
+ /**
2521
+ * Return 08 for 8, 06 for 6
2522
+ * @param num
2523
+ * @param fix
2524
+ * @private
2525
+ */
2526
+ static toFixed(num, fix) {
2527
+ let fixedNum = num.toString();
2528
+ if (num < fix) {
2529
+ fixedNum = `0${fixedNum}`;
2530
+ }
2531
+ return fixedNum;
2532
+ }
2533
+ }
2534
+ NeoTimepickerComponent.decorators = [
2535
+ { type: Component, args: [{
2536
+ changeDetection: ChangeDetectionStrategy.OnPush,
2537
+ selector: 'ap-neo-timepicker',
2538
+ template: "<div class=\"time-picker-container\">\n <ng-template #timeOptionsTemplate>\n <div class=\"time-picker-options\"\n [class.meridian]=\"format === TimeFormat.Meridian\"\n *ngIf=\"timepickerOpened\"\n #timepicker\n >\n <div class=\"header\">\n <span> {{ i18n.hourLabel }} </span>\n <span> {{ i18n.minuteLabel }} </span>\n <span *ngIf=\"format === TimeFormat.Meridian\"> {{ i18n.meridianLabel }} </span>\n </div>\n <div class=\"content\">\n <div class=\"selector\">\n <span>:</span>\n <span *ngIf=\"format === TimeFormat.Meridian\"></span>\n </div>\n <div class=\"options\"\n #hourOptions>\n <div class=\"invisible-block\"></div>\n <div *ngFor=\"let hour of hours;\"\n class=\"option\"\n [id]=\"'hour-' + hour\"\n [class.selected]=\"hour === selectedHour\"\n (click)=\"onSelectHour(hour)\">\n {{ hour }}\n </div>\n <div class=\"invisible-block\"></div>\n </div>\n <div class=\"divider\"></div>\n <div class=\"options\"\n #minutesOptions>\n <div class=\"invisible-block\"></div>\n <div *ngFor=\"let minute of minutes;\"\n class=\"option\"\n [id]=\"'minute-' + minute\"\n [class.selected]=\"minute === selectedMinute\"\n (click)=\"onSelectMinute(minute)\">\n {{ minute }}\n </div>\n <div class=\"invisible-block\"></div>\n </div>\n <div *ngIf=\"format === TimeFormat.Meridian\"\n class=\"divider\"></div>\n <div *ngIf=\"format === TimeFormat.Meridian\"\n class=\"options\"\n #meridiansOptions>\n <div class=\"invisible-block\"></div>\n <div *ngFor=\"let meridian of meridians;\"\n class=\"option\"\n [id]=\"'meridian-' + meridian\"\n [class.selected]=\"selectedMeridian === meridian\"\n (click)=\"onSelectMeridian(meridian)\">\n {{ meridian }}\n </div>\n <div class=\"invisible-block\"></div>\n </div>\n </div>\n <div class=\"buttons\">\n <button mat-flat-button\n class=\"full-width\"\n color=\"primary\"\n (click)=\"onSaveSelection()\">\n {{ i18n.doneLabel }}\n </button>\n <button mat-flat-button\n class=\"full-width\"\n (click)=\"onCancelSelection()\">\n {{ i18n.cancelLabel }}\n </button>\n </div>\n </div>\n </ng-template>\n <input #inputBox\n class=\"time-input\"\n placement=\"bottom right\"\n color=\"secondary\"\n [class.active]=\"timepickerOpened\"\n [class.invalid]=\"invalid\"\n [apPopmenu]=\"timeOptionsTemplate\"\n [apPopmenuBackground]=\"false\"\n [apPopmenuBorder]=\"false\"\n [apPopmenuDisabled]=\"timepickerOpened\"\n [apTooltipNeo]=\"{content: invalidationMessage, display: invalidationMessage && invalid}\"\n [close]=\"timepickerClosed\"\n [disabled]=\"disabled\"\n [imask]=\"format === TimeFormat.Meridian ? imaskMeridian : imaskDefault\"\n [(ngModel)]=\"timeModel\"\n [pointer]=\"true\"\n [position]=\"position\"\n [rounded]=\"true\"\n [shadow]=\"false\"\n (click)=\"onOpenTimepicker()\"\n (complete)=\"onMaskValidateComplete($event)\"\n (menuClosed)=\"onTimePickerClosed()\"\n (menuOpened)=\"onTimepickerOpened()\">\n</div>\n",
2539
+ styles: ["[color=facebook]{color:#1877f2}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#1877f2}[border=facebook]{border:1px solid #1877f2}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid red}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #fff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:#0000}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:initial}[border=transparent]{border:1px solid #0000}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}.time-picker-container{display:flex}.time-input{width:80px;max-width:80px;text-align:center;padding:0;margin:0;height:36px;line-height:24px}.time-input.active{border-color:#178dfe}.time-picker-options{display:flex;flex-direction:column;width:96px;margin-top:8px;max-width:96px;height:379px;background:#fff;border-radius:4px;overflow:hidden;box-shadow:0 3px 10px #00000014}.time-picker-options.meridian{width:152px;max-width:152px}.time-picker-options .header{display:flex;align-items:center;min-height:29px;border-bottom:1px solid #eaecef;color:#344563;font-size:12px;line-height:18px}.time-picker-options .header>span{flex:1;text-align:center}.time-picker-options .content{display:flex;position:relative;min-height:252px;overflow:hidden}.time-picker-options .content .selector{display:flex;justify-content:space-evenly;align-items:center;background-color:#f9f9fa;border-top:1px solid #eaecef;border-bottom:1px solid #eaecef;width:100%;height:34px;position:absolute;top:50%;transform:translateY(-50%);z-index:4;box-sizing:border-box}.time-picker-options .content .divider{height:100%;width:1px;background:#eaecef}.time-picker-options .content .options{flex:1;height:100%;overflow-y:scroll;z-index:5;scroll-snap-type:y mandatory;-ms-overflow-style:none;scrollbar-width:none}.time-picker-options .content .options::-webkit-scrollbar{display:none}.time-picker-options .content .options .invisible-block{min-height:109px;max-height:109px;width:100%}.time-picker-options .content .options .option{min-height:34px;display:flex;z-index:5;justify-content:center;align-items:center;font-size:14px;line-height:17px;color:#aeb5c1;scroll-snap-align:center;padding-block:1px}.time-picker-options .content .options .option:hover{color:#178dfe;cursor:pointer}.time-picker-options .content .options .option.selected{color:#344563!important}.time-picker-options .content .meridian{flex:1;display:flex;flex-direction:column;justify-content:center}.time-picker-options .content .meridian>div{min-height:34px;display:flex;justify-content:center;align-items:center;font-size:14px;line-height:17px;color:#aeb5c1;scroll-snap-align:center}.time-picker-options .buttons{display:flex;flex-direction:column;padding:8px;min-height:96px;border-top:1px solid #eaecef;grid-gap:8px;gap:8px}.time-picker-options .buttons button{font-weight:700;min-width:80px}"]
2540
+ },] }
2541
+ ];
2542
+ /** @nocollapse */
2543
+ NeoTimepickerComponent.ctorParameters = () => [
2544
+ { type: ChangeDetectorRef }
2545
+ ];
2546
+ NeoTimepickerComponent.propDecorators = {
2547
+ inputBox: [{ type: ViewChild, args: ['inputBox',] }],
2548
+ hourOptions: [{ type: ViewChild, args: ['hourOptions',] }],
2549
+ minutesOptions: [{ type: ViewChild, args: ['minutesOptions',] }],
2550
+ meridiansOptions: [{ type: ViewChild, args: ['meridiansOptions',] }],
2551
+ timepicker: [{ type: ViewChild, args: ['timepicker',] }],
2552
+ i18n: [{ type: Input }],
2553
+ disabled: [{ type: Input }],
2554
+ format: [{ type: Input }],
2555
+ invalid: [{ type: Input }],
2556
+ invalidationMessage: [{ type: Input }],
2557
+ placement: [{ type: Input }],
2558
+ timeModel: [{ type: Input }],
2559
+ timeModelChange: [{ type: Output }],
2560
+ onKeypress: [{ type: HostListener, args: ['window:keydown', ['$event'],] }]
2561
+ };
2562
+
2196
2563
  class NotificationComponent {
2197
2564
  constructor() {
2198
2565
  this.type = 'info';
@@ -2815,7 +3182,7 @@ class DefaultImageDirective {
2815
3182
  this.src = this.default;
2816
3183
  }
2817
3184
  else {
2818
- this.src = 'assets/lib-ui/img/default-avatar.png';
3185
+ this.src = 'assets/lib-ui-components/img/default-avatar.png';
2819
3186
  }
2820
3187
  }
2821
3188
  }
@@ -3531,6 +3898,7 @@ AgorapulseUiComponentsModule.decorators = [
3531
3898
  TagListComponent,
3532
3899
  TagsSelectorComponent,
3533
3900
  TimepickerComponent,
3901
+ NeoTimepickerComponent,
3534
3902
  TryPopupComponent,
3535
3903
  NotificationComponent,
3536
3904
  PaginatorComponent,
@@ -3591,6 +3959,8 @@ AgorapulseUiComponentsModule.decorators = [
3591
3959
  MatSnackBarModule,
3592
3960
  // Table
3593
3961
  MatTableModule,
3962
+ // Mask
3963
+ IMaskModule
3594
3964
  ],
3595
3965
  exports: [
3596
3966
  FormsModule,
@@ -3624,6 +3994,7 @@ AgorapulseUiComponentsModule.decorators = [
3624
3994
  TagListComponent,
3625
3995
  TagsSelectorComponent,
3626
3996
  TimepickerComponent,
3997
+ NeoTimepickerComponent,
3627
3998
  TryPopupComponent,
3628
3999
  NotificationComponent,
3629
4000
  PaginatorComponent,
@@ -3801,5 +4172,5 @@ function generateCodeStatus(text, type) {
3801
4172
  * Generated bundle index. Do not edit.
3802
4173
  */
3803
4174
 
3804
- export { AddCommentComponent, AgorapulseUiComponentsModule, AutosizeTextareaDirective, AvatarComponent, ConfirmModalComponent, DatepickerComponent, DatepickerMode, DefaultImageDirective, DotsStepperComponent, EditTagsModalComponent, EllipsisDirective, EqualValidatorDirective, FeatureOnboardingComponent, FrozenGifDirective, ImageCarouselComponent, InstagramCarouselItemType, LeadModalComponent, MediaDisplayOverlayDialogComponent, ModalComponent, MultiStyleTextDirective, NotificationComponent, OverlayDialogComponent, OverlayDialogService, OverlayInDivComponent, PaginatorButtonComponent, PaginatorComponent, PasswordInputComponent, PasswordStrengthBarComponent, PasswordStrengthDisplayBarComponent, PhoneNumberInputComponent, PlaceComponent, PlaceListComponent, PopmenuComponent, PopmenuDirective, PopmenuModule, SlideToggleComponent, SnackBarComponent, SnackbarsThreadComponent, SnackbarsThreadService, SplashscreenComponent, StarRatingComponent, StepperComponent, TagComponent, TagListComponent, TagsSelectorComponent, TimeFormat, TimepickerComponent, TooltipNeoDirective, TruncateTooltipDirective, TryPopupComponent, generateCodeStatus, OverlayDialogRef as ɵa, OVERLAY_DATA as ɵb, PASSWORD_CONTROL_VALUE_ACCESSOR as ɵc, TooltipNeoComponent as ɵd, TooltipNeoService as ɵe, PopmenuOptionsService as ɵf };
4175
+ export { AddCommentComponent, AgorapulseUiComponentsModule, AutosizeTextareaDirective, AvatarComponent, ConfirmModalComponent, DatepickerComponent, DatepickerMode, DefaultImageDirective, DotsStepperComponent, EditTagsModalComponent, EllipsisDirective, EqualValidatorDirective, FeatureOnboardingComponent, FrozenGifDirective, ImageCarouselComponent, InstagramCarouselItemType, LeadModalComponent, MediaDisplayOverlayDialogComponent, ModalComponent, MultiStyleTextDirective, NotificationComponent, OverlayDialogComponent, OverlayDialogService, OverlayInDivComponent, PaginatorButtonComponent, PaginatorComponent, PasswordInputComponent, PasswordStrengthBarComponent, PasswordStrengthDisplayBarComponent, PhoneNumberInputComponent, PlaceComponent, PlaceListComponent, PopmenuComponent, PopmenuDirective, PopmenuModule, SlideToggleComponent, SnackBarComponent, SnackbarsThreadComponent, SnackbarsThreadService, SplashscreenComponent, StarRatingComponent, StepperComponent, TagComponent, TagListComponent, TagsSelectorComponent, TimeFormat, TimepickerComponent, TooltipNeoDirective, TruncateTooltipDirective, TryPopupComponent, generateCodeStatus, OverlayDialogRef as ɵa, OVERLAY_DATA as ɵb, PASSWORD_CONTROL_VALUE_ACCESSOR as ɵc, NeoTimepickerComponent as ɵd, TooltipNeoComponent as ɵe, TooltipNeoService as ɵf, PopmenuOptionsService as ɵg };
3805
4176
  //# sourceMappingURL=agorapulse-ui-components.js.map