@seniorsistemas/angular-components 17.8.3 → 17.8.4

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 (42) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +2268 -2187
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/dynamic-form/components/fields/profile-picture/profile-picture-field.component.d.ts +6 -0
  6. package/components/dynamic-form/components/fields/profile-picture/profile-picture-field.module.d.ts +2 -0
  7. package/components/dynamic-form/configurations/field-type.d.ts +2 -1
  8. package/components/dynamic-form/configurations/fields/profile-picture.d.ts +36 -0
  9. package/components/profile-picture-picker/models/index.d.ts +3 -2
  10. package/components/profile-picture-picker/models/profile-picture-picker-data.d.ts +4 -0
  11. package/components/profile-picture-picker/profile-picture-picker.component.d.ts +14 -7
  12. package/esm2015/components/dynamic-form/components/fields/profile-picture/profile-picture-field.component.js +17 -0
  13. package/esm2015/components/dynamic-form/components/fields/profile-picture/profile-picture-field.module.js +22 -0
  14. package/esm2015/components/dynamic-form/configurations/field-type.js +2 -1
  15. package/esm2015/components/dynamic-form/configurations/fields/profile-picture.js +21 -0
  16. package/esm2015/components/dynamic-form/configurations/form-field.js +4 -1
  17. package/esm2015/components/dynamic-form/dynamic-form.js +4 -1
  18. package/esm2015/components/dynamic-form/dynamic-form.module.js +3 -1
  19. package/esm2015/components/profile-picture-picker/models/index.js +1 -1
  20. package/esm2015/components/profile-picture-picker/models/profile-picture-picker-data.js +1 -0
  21. package/esm2015/components/profile-picture-picker/profile-picture-picker.component.js +27 -13
  22. package/esm2015/components/profile-picture-picker/profile-picture-picker.module.js +6 -4
  23. package/esm2015/seniorsistemas-angular-components.js +61 -59
  24. package/esm5/components/dynamic-form/components/fields/profile-picture/profile-picture-field.component.js +20 -0
  25. package/esm5/components/dynamic-form/components/fields/profile-picture/profile-picture-field.module.js +25 -0
  26. package/esm5/components/dynamic-form/configurations/field-type.js +2 -1
  27. package/esm5/components/dynamic-form/configurations/fields/profile-picture.js +26 -0
  28. package/esm5/components/dynamic-form/configurations/form-field.js +4 -1
  29. package/esm5/components/dynamic-form/dynamic-form.js +4 -1
  30. package/esm5/components/dynamic-form/dynamic-form.module.js +3 -1
  31. package/esm5/components/profile-picture-picker/models/index.js +1 -1
  32. package/esm5/components/profile-picture-picker/models/profile-picture-picker-data.js +1 -0
  33. package/esm5/components/profile-picture-picker/profile-picture-picker.component.js +27 -12
  34. package/esm5/components/profile-picture-picker/profile-picture-picker.module.js +6 -4
  35. package/esm5/seniorsistemas-angular-components.js +61 -59
  36. package/fesm2015/seniorsistemas-angular-components.js +3315 -3246
  37. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  38. package/fesm5/seniorsistemas-angular-components.js +2205 -2126
  39. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  40. package/package.json +1 -1
  41. package/seniorsistemas-angular-components.d.ts +60 -58
  42. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { __decorate, __assign, __extends, __spread, __awaiter, __generator, __param, __values, __rest, __read } from 'tslib';
2
- import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, KeyValueDiffers, HostBinding, Renderer2, TemplateRef, InjectionToken, Inject, ViewEncapsulation, ViewContainerRef, ChangeDetectorRef, Pipe, ɵɵinject, Optional, ContentChild, ViewChildren } from '@angular/core';
2
+ import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, KeyValueDiffers, HostBinding, Renderer2, TemplateRef, InjectionToken, Inject, ViewEncapsulation, ViewContainerRef, ChangeDetectorRef, Pipe, ɵɵinject, ContentChild, Optional, ViewChildren } from '@angular/core';
3
3
  import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
4
4
  import { Subject, of, from, ReplaySubject, throwError, forkJoin } from 'rxjs';
5
5
  import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
@@ -50,11 +50,11 @@ import { MessageService, ConfirmationService } from 'primeng/api';
50
50
  import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
51
51
  import { DomSanitizer } from '@angular/platform-browser';
52
52
  import { Clipboard } from '@angular/cdk/clipboard';
53
- import marked from 'marked';
53
+ import { ConfirmDialogModule } from 'primeng/confirmdialog';
54
54
  import Cropper from 'cropperjs';
55
+ import marked from 'marked';
55
56
  import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
56
57
  import * as elementResizeDetectorMaker_ from 'element-resize-detector';
57
- import { ConfirmDialogModule } from 'primeng/confirmdialog';
58
58
  import { FocusTrapFactory, A11yModule } from '@angular/cdk/a11y';
59
59
  import { ScrollPanelModule } from 'primeng/scrollpanel';
60
60
  import { Sidebar, SidebarModule as SidebarModule$1 } from 'primeng/sidebar';
@@ -4410,6 +4410,7 @@ var FieldType;
4410
4410
  FieldType["Text"] = "Text";
4411
4411
  FieldType["TextIA"] = "TextIA";
4412
4412
  FieldType["Time"] = "Time";
4413
+ FieldType["ProfilePicture"] = "ProfilePicture";
4413
4414
  })(FieldType || (FieldType = {}));
4414
4415
 
4415
4416
  var FieldSize = /** @class */ (function () {
@@ -5016,6 +5017,29 @@ var CountryPhonePickerField = /** @class */ (function (_super) {
5016
5017
  return CountryPhonePickerField;
5017
5018
  }(Field));
5018
5019
 
5020
+ var ProfilePictureField = /** @class */ (function (_super) {
5021
+ __extends(ProfilePictureField, _super);
5022
+ function ProfilePictureField(config) {
5023
+ var _this = _super.call(this, config) || this;
5024
+ _this.simpleTitle = config.simpleTitle;
5025
+ _this.actionTitle = config.actionTitle;
5026
+ _this.subtitle = config.subtitle;
5027
+ _this.aspectRatio = config.aspectRatio;
5028
+ _this.cropperLabelsConfig = config.cropperLabelsConfig;
5029
+ _this.removeButtonLabel = config.removeButtonLabel;
5030
+ _this.changeButtonLabel = config.changeButtonLabel;
5031
+ _this.confirmationTexts = config.confirmationTexts;
5032
+ _this.maxFileSize = config.maxFileSize;
5033
+ _this.accept = config.accept;
5034
+ _this.supportedExtensions = config.supportedExtensions;
5035
+ _this.onChangeImage = config.onChangeImage;
5036
+ _this.onRemovedImage = config.onRemovedImage;
5037
+ _this.onInvalidFile = config.onInvalidFile;
5038
+ return _this;
5039
+ }
5040
+ return ProfilePictureField;
5041
+ }(Field));
5042
+
5019
5043
  var FormField = /** @class */ (function () {
5020
5044
  function FormField(config) {
5021
5045
  switch (config.type) {
@@ -5059,6 +5083,8 @@ var FormField = /** @class */ (function () {
5059
5083
  return new BlobField(config);
5060
5084
  case FieldType.Slider:
5061
5085
  return new SliderField(config);
5086
+ case FieldType.ProfilePicture:
5087
+ return new ProfilePictureField(config);
5062
5088
  case FieldType.Custom:
5063
5089
  var CustomFieldClass = config.CustomFieldClass, otherConfigs = __rest(config, ["CustomFieldClass"]);
5064
5090
  return new CustomFieldClass(otherConfigs);
@@ -9812,6 +9838,23 @@ var TextFieldComponent = /** @class */ (function (_super) {
9812
9838
  return TextFieldComponent;
9813
9839
  }(BaseFieldComponent));
9814
9840
 
9841
+ var ProfilePictureFieldComponent = /** @class */ (function () {
9842
+ function ProfilePictureFieldComponent() {
9843
+ }
9844
+ __decorate([
9845
+ Input()
9846
+ ], ProfilePictureFieldComponent.prototype, "field", void 0);
9847
+ __decorate([
9848
+ Input()
9849
+ ], ProfilePictureFieldComponent.prototype, "formControl", void 0);
9850
+ ProfilePictureFieldComponent = __decorate([
9851
+ Component({
9852
+ template: "<s-profile-picture-picker\n [formControl]=\"formControl\"\n [simpleTitle]=\"field.simpleTitle\"\n [actionTitle]=\"field.actionTitle\"\n [subtitle]=\"field.subtitle\"\n [aspectRatio]=\"field.aspectRatio\"\n [cropperLabelsConfig]=\"field.cropperLabelsConfig\"\n [removeButtonLabel]=\"field.removeButtonLabel\"\n [changeButtonLabel]=\"field.changeButtonLabel\"\n [confirmationTexts]=\"field.confirmationTexts\"\n [maxFileSize]=\"field.maxFileSize\"\n [accept]=\"field\"\n [supportedExtensions]=\"field.supportedExtensions\"\n (changedImage)=\"field.onChangeImage ? field.onChangeImage($event) : null\"\n (removedImage)=\"field.onRemovedImage ? field.onRemovedImage() : null\"\n (invalidFile)=\"field.onInvalidFile ? field.onInvalidFile($event) : null\">\n</s-profile-picture-picker>"
9853
+ })
9854
+ ], ProfilePictureFieldComponent);
9855
+ return ProfilePictureFieldComponent;
9856
+ }());
9857
+
9815
9858
  var DynamicForm = /** @class */ (function () {
9816
9859
  function DynamicForm(_a) {
9817
9860
  var group = _a.group, errorMessages = _a.errorMessages;
@@ -9894,6 +9937,8 @@ var DynamicField = /** @class */ (function (_super) {
9894
9937
  return FileUploadComponent$1;
9895
9938
  case FieldType.Slider:
9896
9939
  return SliderFieldComponent;
9940
+ case FieldType.ProfilePicture:
9941
+ return ProfilePictureFieldComponent;
9897
9942
  case FieldType.Custom:
9898
9943
  return this.field.CustomFieldComponentClass;
9899
9944
  default:
@@ -10247,155 +10292,896 @@ var NumberFieldModule$1 = /** @class */ (function () {
10247
10292
  return NumberFieldModule;
10248
10293
  }());
10249
10294
 
10250
- var DynamicFormModule = /** @class */ (function () {
10251
- function DynamicFormModule() {
10295
+ var HeaderComponent = /** @class */ (function () {
10296
+ function HeaderComponent() {
10252
10297
  }
10253
- DynamicFormModule = __decorate([
10298
+ HeaderComponent = __decorate([
10299
+ Component({
10300
+ selector: "s-header",
10301
+ template: "<ng-content></ng-content>"
10302
+ })
10303
+ ], HeaderComponent);
10304
+ return HeaderComponent;
10305
+ }());
10306
+
10307
+ var FooterComponent = /** @class */ (function () {
10308
+ function FooterComponent() {
10309
+ }
10310
+ FooterComponent = __decorate([
10311
+ Component({
10312
+ selector: "s-footer",
10313
+ template: "<ng-content></ng-content>"
10314
+ })
10315
+ ], FooterComponent);
10316
+ return FooterComponent;
10317
+ }());
10318
+
10319
+ var StructureModule = /** @class */ (function () {
10320
+ function StructureModule() {
10321
+ }
10322
+ StructureModule = __decorate([
10254
10323
  NgModule({
10255
- imports: [
10256
- AutoCompleteModule,
10257
- BignumberInputModule,
10258
- ButtonModule,
10259
- CalendarMaskModule,
10260
- CalendarModule,
10261
- CheckboxModule,
10262
- ChipsModule,
10263
- CommonModule,
10264
- ControlErrorsModule,
10265
- CountryPhonePickerModule,
10266
- DialogModule,
10267
- DropdownModule,
10268
- EmptyStateModule,
10269
- FormsModule,
10270
- HotkeyModule,
10271
- InputMaskModule,
10272
- InputTextareaModule,
10273
- InputTextModule,
10274
- KeyFilterModule,
10275
- LoadingStateModule,
10276
- LocaleModule,
10277
- LocalizedNumberInputModule,
10278
- PanelModule$1,
10279
- ButtonModule$1,
10280
- TableModule$1,
10281
- MultiSelectModule,
10282
- NumberInputModule,
10283
- RadioButtonModule,
10284
- ReactiveFormsModule,
10285
- TooltipModule,
10286
- FieldsetModule,
10287
- TableHeaderCheckboxModule,
10288
- FileUploadModule,
10289
- TableModule,
10290
- InfoSignModule,
10291
- MaskFormatterModule,
10292
- HotkeyModule.forRoot(),
10293
- MouseEventsModule,
10294
- SwitchModule,
10295
- PasswordStrengthModule,
10296
- SliderModule,
10297
- TranslateModule.forChild(),
10298
- PasswordFieldModule,
10299
- TextFieldModule,
10300
- NumberFieldModule,
10301
- CurrencyFieldModule,
10302
- NumberFieldModule$1,
10303
- ],
10304
- declarations: [
10305
- AutocompleteFieldComponent,
10306
- BooleanFieldComponent,
10307
- BooleanSwitchFieldComponent,
10308
- CalendarFieldComponent,
10309
- ChipsFieldComponent,
10310
- CountryPhonePickerFieldComponent,
10311
- DynamicFieldComponent,
10312
- DynamicFormComponent,
10313
- DynamicFormDirective,
10314
- FieldsetComponent,
10315
- FileUploadComponent$1,
10316
- LookupComponent,
10317
- LookupFieldComponent,
10318
- RadioButtonComponent,
10319
- RowComponent,
10320
- SectionComponent,
10321
- SelectFieldComponent,
10322
- SliderFieldComponent,
10323
- TextAreaFieldComponent,
10324
- TextAreaIAFieldComponent,
10325
- ],
10326
- exports: [DynamicFormComponent, LookupComponent],
10327
- entryComponents: [
10328
- AutocompleteFieldComponent,
10329
- BooleanFieldComponent,
10330
- BooleanSwitchFieldComponent,
10331
- CalendarFieldComponent,
10332
- ChipsFieldComponent,
10333
- CountryPhonePickerFieldComponent,
10334
- FieldsetComponent,
10335
- FileUploadComponent$1,
10336
- LookupFieldComponent,
10337
- RadioButtonComponent,
10338
- RowComponent,
10339
- SectionComponent,
10340
- SelectFieldComponent,
10341
- SliderFieldComponent,
10342
- TextAreaFieldComponent,
10343
- TextAreaIAFieldComponent,
10344
- ],
10345
- providers: [
10346
- HotkeysService,
10347
- IAssistService,
10348
- ]
10324
+ imports: [CommonModule],
10325
+ declarations: [HeaderComponent, FooterComponent],
10326
+ exports: [HeaderComponent, FooterComponent],
10349
10327
  })
10350
- ], DynamicFormModule);
10351
- return DynamicFormModule;
10328
+ ], StructureModule);
10329
+ return StructureModule;
10352
10330
  }());
10353
10331
 
10354
- var CustomFieldsService = /** @class */ (function () {
10355
- function CustomFieldsService(http) {
10356
- this.http = http;
10332
+ var ImageCropperComponent = /** @class */ (function () {
10333
+ function ImageCropperComponent() {
10334
+ this.id = "s-image-cropper-" + ImageCropperComponent_1.nextId++;
10335
+ this.visible = false;
10336
+ this.header = "Recortar imagem";
10337
+ this.cropLabel = "Recortar";
10338
+ this.selectAnotherLabel = "Trocar";
10339
+ this.removeLabel = "Remover";
10340
+ this.cancelLabel = "Cancelar";
10341
+ this.emptyStateTitle = "Selecione uma foto, em seguida você poderá ajustá-la";
10342
+ this.emptyStateActionLabel = "Escolher imagem";
10343
+ this.emptyStateIconClass = "fa fa-picture-o";
10344
+ this.aspectRatio = NaN;
10345
+ this.rounded = false;
10346
+ this.allowSelectAnother = true;
10347
+ this.allowRemove = true;
10348
+ this.allowCancel = true;
10349
+ this.visibleChange = new EventEmitter();
10350
+ this.changeImage = new EventEmitter();
10351
+ this.croppedImage = new EventEmitter();
10352
+ this.croppedCanvas = new EventEmitter();
10353
+ this.removedImage = new EventEmitter();
10354
+ this.cancel = new EventEmitter();
10357
10355
  }
10358
- CustomFieldsService.prototype.getCustomFields = function (domain, service, entity, endpoint) {
10359
- var entityDto = { entityId: { domain_: domain, service_: service, id: entity } };
10360
- return this.http.post(endpoint, entityDto);
10356
+ ImageCropperComponent_1 = ImageCropperComponent;
10357
+ ImageCropperComponent.prototype.ngOnInit = function () {
10358
+ if (this.imageSource)
10359
+ this.initCropper();
10361
10360
  };
10362
- CustomFieldsService.prototype.getFileLocationUrl = function (dto, endpoint) {
10363
- return this.http.post(endpoint, dto);
10361
+ ImageCropperComponent.prototype.ngOnChanges = function (changes) {
10362
+ if (changes.imageSource && changes.imageSource.currentValue) {
10363
+ this.initCropper();
10364
+ }
10364
10365
  };
10365
- CustomFieldsService.prototype.uploadTempFile = function (location, file) {
10366
- return this.http.put(location, file, {
10367
- reportProgress: true,
10368
- observe: "events",
10369
- headers: { "Content-Type": file.type }
10366
+ ImageCropperComponent.prototype.initCropper = function () {
10367
+ if (this.cropper) {
10368
+ this.cropper.destroy();
10369
+ }
10370
+ this.image.nativeElement.src = this.imageSource;
10371
+ this.cropper = new Cropper(this.image.nativeElement, {
10372
+ aspectRatio: this.rounded ? 1 : this.aspectRatio,
10373
+ guides: false,
10374
+ dragMode: "move",
10375
+ minCropBoxHeight: 2,
10376
+ minCropBoxWidth: 2,
10377
+ toggleDragModeOnDblclick: false,
10370
10378
  });
10371
10379
  };
10372
- CustomFieldsService.prototype.requestAccess = function (objectId, endpoint) {
10373
- return this.http.post(endpoint, { objectId: objectId });
10380
+ ImageCropperComponent.prototype.getRoundedCanvas = function (sourceCanvas) {
10381
+ var canvas = document.createElement("canvas");
10382
+ var context = canvas.getContext("2d");
10383
+ var width = sourceCanvas.width;
10384
+ var height = sourceCanvas.height;
10385
+ canvas.width = width;
10386
+ canvas.height = height;
10387
+ context.imageSmoothingEnabled = true;
10388
+ context.drawImage(sourceCanvas, 0, 0, width, height);
10389
+ context.globalCompositeOperation = "destination-in";
10390
+ context.beginPath();
10391
+ context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true);
10392
+ context.fill();
10393
+ return canvas;
10374
10394
  };
10375
- CustomFieldsService.prototype.getFile = function (permanentUrl) {
10376
- return this.http.get(permanentUrl, { responseType: "blob" });
10395
+ ImageCropperComponent.prototype.onCropImage = function () {
10396
+ if (!this.imageSource) {
10397
+ this.croppedImage.emit();
10398
+ this.croppedCanvas.emit();
10399
+ }
10400
+ else {
10401
+ var _croppedCanvas = this.rounded ? this.getRoundedCanvas(this.cropper.getCroppedCanvas()) : this.cropper.getCroppedCanvas();
10402
+ this.croppedCanvas.emit(_croppedCanvas);
10403
+ this.croppedImage.emit(_croppedCanvas.toDataURL());
10404
+ }
10405
+ this.visibleChange.emit(false);
10377
10406
  };
10378
- CustomFieldsService.ctorParameters = function () { return [
10379
- { type: HttpClient }
10380
- ]; };
10381
- CustomFieldsService = __decorate([
10382
- Injectable()
10383
- ], CustomFieldsService);
10384
- return CustomFieldsService;
10385
- }());
10386
-
10387
- var CustomFieldType;
10388
- (function (CustomFieldType) {
10389
- CustomFieldType["String"] = "String";
10390
- CustomFieldType["Boolean"] = "Boolean";
10391
- CustomFieldType["Integer"] = "Integer";
10392
- CustomFieldType["Double"] = "Double";
10393
- CustomFieldType["Date"] = "Date";
10394
- CustomFieldType["DateTime"] = "DateTime";
10395
- CustomFieldType["LocalDateTime"] = "LocalDateTime";
10396
- CustomFieldType["Time"] = "Time";
10397
- CustomFieldType["Money"] = "Money";
10398
- CustomFieldType["Blob"] = "Blob";
10407
+ ImageCropperComponent.prototype.onChangeImage = function () {
10408
+ this.changeImage.emit();
10409
+ };
10410
+ ImageCropperComponent.prototype.onRemoveImage = function () {
10411
+ this.imageSource = undefined;
10412
+ this.removedImage.emit();
10413
+ };
10414
+ ImageCropperComponent.prototype.onCancel = function () {
10415
+ this.visibleChange.emit(false);
10416
+ this.cancel.emit();
10417
+ };
10418
+ ImageCropperComponent.prototype.onModalVisibleChange = function (visible) {
10419
+ if (!visible)
10420
+ this.onCancel();
10421
+ this.visibleChange.emit(visible);
10422
+ };
10423
+ var ImageCropperComponent_1;
10424
+ ImageCropperComponent.nextId = 0;
10425
+ __decorate([
10426
+ Input()
10427
+ ], ImageCropperComponent.prototype, "id", void 0);
10428
+ __decorate([
10429
+ Input()
10430
+ ], ImageCropperComponent.prototype, "visible", void 0);
10431
+ __decorate([
10432
+ Input()
10433
+ ], ImageCropperComponent.prototype, "header", void 0);
10434
+ __decorate([
10435
+ Input()
10436
+ ], ImageCropperComponent.prototype, "cropLabel", void 0);
10437
+ __decorate([
10438
+ Input()
10439
+ ], ImageCropperComponent.prototype, "selectAnotherLabel", void 0);
10440
+ __decorate([
10441
+ Input()
10442
+ ], ImageCropperComponent.prototype, "removeLabel", void 0);
10443
+ __decorate([
10444
+ Input()
10445
+ ], ImageCropperComponent.prototype, "cancelLabel", void 0);
10446
+ __decorate([
10447
+ Input()
10448
+ ], ImageCropperComponent.prototype, "emptyStateTitle", void 0);
10449
+ __decorate([
10450
+ Input()
10451
+ ], ImageCropperComponent.prototype, "emptyStateActionLabel", void 0);
10452
+ __decorate([
10453
+ Input()
10454
+ ], ImageCropperComponent.prototype, "emptyStateIconClass", void 0);
10455
+ __decorate([
10456
+ Input()
10457
+ ], ImageCropperComponent.prototype, "aspectRatio", void 0);
10458
+ __decorate([
10459
+ Input()
10460
+ ], ImageCropperComponent.prototype, "rounded", void 0);
10461
+ __decorate([
10462
+ Input()
10463
+ ], ImageCropperComponent.prototype, "allowSelectAnother", void 0);
10464
+ __decorate([
10465
+ Input()
10466
+ ], ImageCropperComponent.prototype, "allowRemove", void 0);
10467
+ __decorate([
10468
+ Input()
10469
+ ], ImageCropperComponent.prototype, "allowCancel", void 0);
10470
+ __decorate([
10471
+ Input()
10472
+ ], ImageCropperComponent.prototype, "imageSource", void 0);
10473
+ __decorate([
10474
+ Output()
10475
+ ], ImageCropperComponent.prototype, "visibleChange", void 0);
10476
+ __decorate([
10477
+ Output()
10478
+ ], ImageCropperComponent.prototype, "changeImage", void 0);
10479
+ __decorate([
10480
+ Output()
10481
+ ], ImageCropperComponent.prototype, "croppedImage", void 0);
10482
+ __decorate([
10483
+ Output()
10484
+ ], ImageCropperComponent.prototype, "croppedCanvas", void 0);
10485
+ __decorate([
10486
+ Output()
10487
+ ], ImageCropperComponent.prototype, "removedImage", void 0);
10488
+ __decorate([
10489
+ Output()
10490
+ ], ImageCropperComponent.prototype, "cancel", void 0);
10491
+ __decorate([
10492
+ ViewChild("image", { static: true })
10493
+ ], ImageCropperComponent.prototype, "image", void 0);
10494
+ __decorate([
10495
+ ContentChild(HeaderComponent, { static: true })
10496
+ ], ImageCropperComponent.prototype, "headerSection", void 0);
10497
+ __decorate([
10498
+ ContentChild(FooterComponent, { static: true })
10499
+ ], ImageCropperComponent.prototype, "footerSection", void 0);
10500
+ ImageCropperComponent = ImageCropperComponent_1 = __decorate([
10501
+ Component({
10502
+ selector: "s-image-cropper",
10503
+ template: "<div [id]=\"id\">\n <p-dialog\n styleClass=\"s-image-cropper {{rounded ? 's-image-cropper--rounded' : ''}}\"\n [header]=\"headerSection ? '' : header\"\n [visible]=\"visible\"\n (visibleChange)=\"onModalVisibleChange($event)\"\n [modal]=\"true\"\n [blockScroll]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [closeOnEscape]=\"allowCancel\"\n [closable]=\"allowCancel\"\n appendTo=\"body\">\n\n <p-header *ngIf=\"headerSection\">\n <ng-content select=\"s-header\"></ng-content>\n </p-header>\n\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!imageSource\"\n [title]=\"emptyStateTitle\"\n [iconClass]=\"emptyStateIconClass\"\n [primaryActionLabel]=\"emptyStateActionLabel\"\n (primaryAction)=\"onChangeImage()\">\n </s-empty-state>\n\n <div [attr.data-hidden]=\"!imageSource\" class=\"image-container\">\n <img\n [id]=\"id + '-cropper'\"\n #image\n [src]=\"imageSource || ''\"\n alt=\"cropped image\"/>\n </div>\n\n <p-footer>\n <div class=\"ui-fluid\" *ngIf=\"!footerSection\">\n <div class=\"ui-g button-container\">\n\n <div *ngIf=\"allowCancel\" class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel\"\n (onClick)=\"onCancel()\">\n </s-button>\n </div>\n\n <div *ngIf=\"imageSource && allowRemove\" class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-remove-button'\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"removeLabel\"\n (onClick)=\"onRemoveImage()\">\n </s-button>\n </div>\n\n <div *ngIf=\"imageSource && allowSelectAnother\" class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-select-another-button'\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"selectAnotherLabel\"\n (onClick)=\"onChangeImage()\">\n </s-button>\n </div>\n\n <div class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-crop-button'\"\n type=\"button\"\n [label]=\"cropLabel\"\n (onClick)=\"onCropImage()\">\n </s-button>\n </div>\n </div>\n </div>\n\n <ng-content select=\"s-footer\" *ngIf=\"footerSection\"></ng-content>\n </p-footer>\n </p-dialog>\n</div>",
10504
+ encapsulation: ViewEncapsulation.None,
10505
+ styles: ["/*!\n * Cropper.js v1.6.2\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2024-04-21T07:43:02.731Z\n */.cropper-container{-webkit-touch-callout:none;direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:rgba(51,153,255,.75) solid 1px;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:\" \";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:\" \";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}", ".s-image-cropper{border-radius:0!important;height:80%!important;max-width:100%!important;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:column;flex-direction:column}.s-image-cropper .ui-dialog-content{overflow:hidden;height:auto!important;-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.s-image-cropper .ui-dialog-footer,.s-image-cropper .ui-dialog-header{-ms-flex-negative:0;flex-shrink:0;direction:ltr}.s-image-cropper .image-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%}.s-image-cropper img{max-width:100%;max-height:100%}.s-image-cropper .button-container{-ms-flex-flow:wrap-reverse;flex-flow:wrap-reverse;-ms-flex-pack:end;justify-content:flex-end}.s-image-cropper .cropper-view-box{outline:#fff dashed 2px}.s-image-cropper .cropper-line{opacity:0}.s-image-cropper .cropper-point{background-color:#fff;opacity:1;height:15px;width:15px;border-radius:50%}.s-image-cropper .cropper-point.point-e{right:-8.5px;top:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-n{top:-8.5px;left:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-w{left:-8.5px;top:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-s{bottom:-8.5px;left:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-ne{right:-8.5px;top:-8.5px}.s-image-cropper .cropper-point.point-nw{left:-8.5px;top:-8.5px}.s-image-cropper .cropper-point.point-sw{left:-8.5px;bottom:-8.5px}.s-image-cropper .cropper-point.point-se{right:-8.5px;bottom:-8.5px}.s-image-cropper--rounded .cropper-face,.s-image-cropper--rounded .cropper-view-box{border-radius:50%}.s-image-cropper--rounded .cropper-view-box{outline:rgba(255,255,255,.3) dashed 1px}.s-image-cropper--rounded .cropper-view-box:after{border:2px dashed #fff;border-radius:50%;content:\"\";height:100%;left:0;position:absolute;top:0;width:100%}@media (max-width:767px){.s-image-cropper{border:none!important;top:0!important;left:0!important;width:100%!important;height:100%!important}}@media (min-width:768px){.s-image-cropper{width:80%!important}}@media (min-width:1200px){.s-image-cropper{width:60%!important}}"]
10506
+ })
10507
+ ], ImageCropperComponent);
10508
+ return ImageCropperComponent;
10509
+ }());
10510
+
10511
+ var ImageCropperModule = /** @class */ (function () {
10512
+ function ImageCropperModule() {
10513
+ }
10514
+ ImageCropperModule = __decorate([
10515
+ NgModule({
10516
+ imports: [CommonModule, DialogModule, ButtonModule, EmptyStateModule, StructureModule],
10517
+ declarations: [ImageCropperComponent],
10518
+ exports: [ImageCropperComponent, StructureModule],
10519
+ entryComponents: [ImageCropperComponent],
10520
+ })
10521
+ ], ImageCropperModule);
10522
+ return ImageCropperModule;
10523
+ }());
10524
+
10525
+ var ImageCropperService = /** @class */ (function () {
10526
+ function ImageCropperService(componentFactoryResolver, appRef, injector) {
10527
+ this.componentFactoryResolver = componentFactoryResolver;
10528
+ this.appRef = appRef;
10529
+ this.injector = injector;
10530
+ }
10531
+ ImageCropperService.prototype.show = function (config) {
10532
+ var _this = this;
10533
+ if (this.activeCropper)
10534
+ this.destroy(this.activeCropper);
10535
+ var activeCropper = {
10536
+ componentRef: this.componentFactoryResolver.resolveComponentFactory(ImageCropperComponent).create(this.injector),
10537
+ ngUnsubscribe: new Subject(),
10538
+ };
10539
+ this.activeCropper = activeCropper;
10540
+ this.appRef.attachView(activeCropper.componentRef.hostView);
10541
+ var domElem = activeCropper.componentRef.hostView.rootNodes[0];
10542
+ document.body.appendChild(domElem);
10543
+ this.configureInstance(activeCropper, config);
10544
+ activeCropper.componentRef.instance.visible = true;
10545
+ activeCropper.componentRef.instance.visibleChange
10546
+ .pipe(takeUntil(this.activeCropper.ngUnsubscribe), delay(1000))
10547
+ .subscribe(function (visible) {
10548
+ if (!visible)
10549
+ _this.destroy(activeCropper);
10550
+ });
10551
+ };
10552
+ ImageCropperService.prototype.configureInstance = function (activeCropper, config) {
10553
+ var instance = activeCropper.componentRef.instance;
10554
+ if (config) {
10555
+ Object.keys(config).forEach(function (key) {
10556
+ var value = config[key];
10557
+ if (typeof value !== "function")
10558
+ instance[key] = value;
10559
+ else if (typeof value === "function") {
10560
+ instance[key].pipe(takeUntil(activeCropper.ngUnsubscribe)).subscribe(function () {
10561
+ var param = [];
10562
+ for (var _i = 0; _i < arguments.length; _i++) {
10563
+ param[_i] = arguments[_i];
10564
+ }
10565
+ return config[key].apply(config, __spread(param));
10566
+ });
10567
+ }
10568
+ });
10569
+ }
10570
+ instance.visibleChange.pipe(takeUntil(activeCropper.ngUnsubscribe)).subscribe(function (visible) { return (instance.visible = visible); });
10571
+ };
10572
+ ImageCropperService.prototype.destroy = function (activeCropper) {
10573
+ activeCropper.ngUnsubscribe.next();
10574
+ activeCropper.ngUnsubscribe.complete();
10575
+ this.appRef.detachView(activeCropper.componentRef.hostView);
10576
+ activeCropper.componentRef.destroy();
10577
+ };
10578
+ ImageCropperService.ctorParameters = function () { return [
10579
+ { type: ComponentFactoryResolver },
10580
+ { type: ApplicationRef },
10581
+ { type: Injector }
10582
+ ]; };
10583
+ ImageCropperService = __decorate([
10584
+ Injectable()
10585
+ ], ImageCropperService);
10586
+ return ImageCropperService;
10587
+ }());
10588
+
10589
+ var ThumbnailSize;
10590
+ (function (ThumbnailSize) {
10591
+ ThumbnailSize["Small"] = "small";
10592
+ ThumbnailSize["Medium"] = "medium";
10593
+ ThumbnailSize["Large"] = "large";
10594
+ })(ThumbnailSize || (ThumbnailSize = {}));
10595
+
10596
+ var ThumbnailService = /** @class */ (function () {
10597
+ function ThumbnailService() {
10598
+ }
10599
+ ThumbnailService.prototype.getBinaryFile = function (img) {
10600
+ var _this = this;
10601
+ return new Promise(function (resolve) {
10602
+ var getOrientation = _this.getOrientation.bind(_this);
10603
+ var http = new XMLHttpRequest();
10604
+ http.addEventListener("load", function () {
10605
+ if (http.readyState === 4 && (http.status == 200 || http.status === 0)) {
10606
+ var orientation_1 = getOrientation(http.response);
10607
+ http = null;
10608
+ resolve(orientation_1);
10609
+ }
10610
+ });
10611
+ http.addEventListener("error", function () {
10612
+ http = null;
10613
+ throw new Error("Não foi possível carregar a imagem");
10614
+ });
10615
+ http.open("GET", img.src, true);
10616
+ http.responseType = "arraybuffer";
10617
+ http.send(null);
10618
+ });
10619
+ };
10620
+ /**
10621
+ * Retorna a tag da orientação EXIF {-1} Não definido, {-2} Não é formato JPEG, {1, 2, 3, 4, 5, 6, 7, 8} valores da orientação.
10622
+ */
10623
+ ThumbnailService.prototype.getOrientation = function (file) {
10624
+ var view = new DataView(file);
10625
+ if (view.getUint16(0, false) != 0xffd8)
10626
+ return -2; // not jpeg
10627
+ var length = view.byteLength;
10628
+ var offset = 2;
10629
+ while (offset < length) {
10630
+ var marker = view.getUint16(offset, false);
10631
+ offset += 2;
10632
+ if (marker == 0xffe1) {
10633
+ if (view.getUint32((offset += 2), false) != 0x45786966) {
10634
+ return -1; // not defined
10635
+ }
10636
+ var little = view.getUint16((offset += 6), false) == 0x4949;
10637
+ offset += view.getUint32(offset + 4, little);
10638
+ var tags = view.getUint16(offset, little);
10639
+ offset += 2;
10640
+ for (var i = 0; i < tags; i++)
10641
+ if (view.getUint16(offset + i * 12, little) == 0x0112)
10642
+ return view.getUint16(offset + i * 12 + 8, little);
10643
+ // tslint:disable-next-line: no-bitwise
10644
+ }
10645
+ else if ((marker & 0xff00) != 0xff00)
10646
+ break;
10647
+ else
10648
+ offset += view.getUint16(offset, false);
10649
+ }
10650
+ return -1; // not defined
10651
+ };
10652
+ ThumbnailService = __decorate([
10653
+ Injectable()
10654
+ ], ThumbnailService);
10655
+ return ThumbnailService;
10656
+ }());
10657
+
10658
+ var ThumbnailComponent = /** @class */ (function () {
10659
+ function ThumbnailComponent(thumbnailService) {
10660
+ this.thumbnailService = thumbnailService;
10661
+ this.fallback = false;
10662
+ this.id = "s-thumbnail-" + ThumbnailComponent_1.nextId++;
10663
+ this.size = ThumbnailSize.Medium;
10664
+ this.iconClass = "far fa-image";
10665
+ this.hasAction = false;
10666
+ this.actionIconClass = "fas fa-camera";
10667
+ this.isTile = false;
10668
+ this.isBrand = false;
10669
+ this.ngUnsubscribe = new Subject();
10670
+ }
10671
+ ThumbnailComponent_1 = ThumbnailComponent;
10672
+ ThumbnailComponent.prototype.ngOnDestroy = function () {
10673
+ this.ngUnsubscribe.next();
10674
+ this.ngUnsubscribe.complete();
10675
+ };
10676
+ ThumbnailComponent.prototype.ngAfterViewInit = function () {
10677
+ var _this = this;
10678
+ if (this.imgEl) {
10679
+ this.imgEl.nativeElement.addEventListener("load", function () {
10680
+ from(_this.thumbnailService.getBinaryFile(_this.imgEl.nativeElement))
10681
+ .pipe(takeUntil(_this.ngUnsubscribe))
10682
+ .subscribe(function (orientation) { return (_this.orientation = orientation); });
10683
+ });
10684
+ }
10685
+ };
10686
+ var ThumbnailComponent_1;
10687
+ ThumbnailComponent.nextId = 0;
10688
+ ThumbnailComponent.ctorParameters = function () { return [
10689
+ { type: ThumbnailService }
10690
+ ]; };
10691
+ __decorate([
10692
+ ViewChild("img", { static: false })
10693
+ ], ThumbnailComponent.prototype, "imgEl", void 0);
10694
+ __decorate([
10695
+ Input()
10696
+ ], ThumbnailComponent.prototype, "id", void 0);
10697
+ __decorate([
10698
+ Input()
10699
+ ], ThumbnailComponent.prototype, "size", void 0);
10700
+ __decorate([
10701
+ Input()
10702
+ ], ThumbnailComponent.prototype, "imageSource", void 0);
10703
+ __decorate([
10704
+ Input()
10705
+ ], ThumbnailComponent.prototype, "imageFallback", void 0);
10706
+ __decorate([
10707
+ Input()
10708
+ ], ThumbnailComponent.prototype, "imageAlt", void 0);
10709
+ __decorate([
10710
+ Input()
10711
+ ], ThumbnailComponent.prototype, "iconClass", void 0);
10712
+ __decorate([
10713
+ Input()
10714
+ ], ThumbnailComponent.prototype, "hasAction", void 0);
10715
+ __decorate([
10716
+ Input()
10717
+ ], ThumbnailComponent.prototype, "actionIconClass", void 0);
10718
+ __decorate([
10719
+ Input()
10720
+ ], ThumbnailComponent.prototype, "isTile", void 0);
10721
+ __decorate([
10722
+ Input()
10723
+ ], ThumbnailComponent.prototype, "isBrand", void 0);
10724
+ ThumbnailComponent = ThumbnailComponent_1 = __decorate([
10725
+ Component({
10726
+ selector: "s-thumbnail",
10727
+ template: "<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{size}}\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand\n }\">\n <div\n [id]=\"id + '-image-container'\"\n *ngIf=\"imageSource || imageFallback\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand\n }\">\n <img\n #img\n [id]=\"id + '-image'\"\n (error)=\"fallback = true\"\n [src]=\"imageSource\"\n [alt]=\"imageAlt\"\n *ngIf=\"!fallback\"\n [ngClass]=\"{\n 'smallThumbnail': isTile,\n 'exif-orientation-2': orientation == 2,\n 'exif-orientation-3': orientation == 3,\n 'exif-orientation-4': orientation == 4,\n 'exif-orientation-5': orientation == 5,\n 'exif-orientation-6': orientation == 6,\n 'exif-orientation-7': orientation == 7,\n 'exif-orientation-8': orientation == 8\n }\"/>\n\n <img\n #img\n [id]=\"id + '-image-fallback'\"\n (error)=\"imageFallback = undefined\"\n [src]=\"imageFallback\"\n [alt]=\"imageAlt\"\n *ngIf=\"fallback && imageFallback\"\n [ngClass]=\"{\n 'smallThumbnail': isTile,\n 'exif-orientation-2': orientation == 2,\n 'exif-orientation-3': orientation == 3,\n 'exif-orientation-4': orientation == 4,\n 'exif-orientation-5': orientation == 5,\n 'exif-orientation-6': orientation == 6,\n 'exif-orientation-7': orientation == 7,\n 'exif-orientation-8': orientation == 8\n }\"/>\n\n <i\n *ngIf=\"fallback && !imageFallback\"\n ngClass=\"far fa-image\"\n class=\"fallback-img-color\">\n </i>\n </div>\n <div\n [id]=\"id + '-action-icon-container'\"\n *ngIf=\"hasAction\"\n class=\"action-icon-container action-icon-container--{{size}}\">\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\">\n </span>\n </div>\n <div\n [id]=\"id + '-icon-container'\"\n *ngIf=\"!imageSource && !imageFallback\"\n class=\"icon-container icon-container--{{size}}\"\n [ngClass]=\"{'image-container--rounded': !isBrand}\">\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\">\n </span>\n </div>\n\n <ng-content></ng-content>\n</div>\n",
10728
+ styles: [":host{display:inline-block}.thumbnail-container{color:#fff;position:relative;text-align:center}.thumbnail-container--large{font-size:50px;height:100px;width:100px}.thumbnail-container--large.thumbnail-container--brand{width:200px}.thumbnail-container--medium{font-size:40px;height:70px;width:70px}.thumbnail-container--medium.thumbnail-container--brand{width:140px}.thumbnail-container--small{font-size:22px;height:40px;width:40px}.thumbnail-container--small.thumbnail-container--brand{width:80px}.thumbnail-container--with-action{cursor:pointer}.action-icon-container{background-color:#428bca;border-radius:50%;bottom:0;position:absolute;right:0}.action-icon-container--large,.action-icon-container--medium{font-size:10pt;height:25px;padding:3px;width:25px}.action-icon-container--small{font-size:6pt;height:16px;padding:2px;width:16px}.icon-container,.image-container{-ms-flex-align:center;align-items:center;height:100%;overflow:hidden;width:100%}.icon-container--rounded,.image-container--rounded{border-radius:50%}.smallThumbnail{height:40px!important}.icon-container{background-color:#ccc;color:#fff}.icon-container--large{line-height:98px}.icon-container--medium{line-height:68px}.icon-container--small{line-height:38px}.image-container{-ms-flex-align:center;align-items:center;background-color:#ccc;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.image-container img{width:100%}.image-container img.exif-orientation-2{transform:rotateY(180deg)}.image-container img.exif-orientation-3{transform:rotate(180deg)}.image-container img.exif-orientation-4{transform:rotate(180deg) rotateY(180deg)}.image-container img.exif-orientation-5{transform:rotate(270deg) rotateY(180deg)}.image-container img.exif-orientation-6{transform:rotate(90deg)}.image-container img.exif-orientation-7{transform:rotate(90deg) rotateY(180deg)}.image-container img.exif-orientation-8{transform:rotate(270deg)}.fallback-img-color{color:#fff}"]
10729
+ })
10730
+ ], ThumbnailComponent);
10731
+ return ThumbnailComponent;
10732
+ }());
10733
+
10734
+ var ThumbnailModule = /** @class */ (function () {
10735
+ function ThumbnailModule() {
10736
+ }
10737
+ ThumbnailModule = __decorate([
10738
+ NgModule({
10739
+ imports: [CommonModule],
10740
+ declarations: [ThumbnailComponent],
10741
+ exports: [ThumbnailComponent],
10742
+ providers: [ThumbnailService],
10743
+ })
10744
+ ], ThumbnailModule);
10745
+ return ThumbnailModule;
10746
+ }());
10747
+
10748
+ var FileValidation;
10749
+ (function (FileValidation) {
10750
+ FileValidation["MaxFileSize"] = "maxFileSize";
10751
+ FileValidation["MaxFileLimit"] = "maxFileLimit";
10752
+ FileValidation["TypeInvalid"] = "typeInvalid";
10753
+ FileValidation["UnsupportedExtension"] = "unsupportedExtension";
10754
+ })(FileValidation || (FileValidation = {}));
10755
+
10756
+ var ProfilePicturePickerComponent = /** @class */ (function () {
10757
+ function ProfilePicturePickerComponent(imageCropperService, confirmationService, translateService) {
10758
+ this.imageCropperService = imageCropperService;
10759
+ this.confirmationService = confirmationService;
10760
+ this.translateService = translateService;
10761
+ this.aspectRatio = 1;
10762
+ this.confirmationTexts = {
10763
+ removalHeader: this.translateService.instant("platform.angular_components.remove_image"),
10764
+ removalMessage: this.translateService.instant("platform.angular_components.confirmation_remove_image"),
10765
+ removalAcceptLabel: this.translateService.instant("platform.angular_components.remove"),
10766
+ removalRejectLabel: this.translateService.instant("platform.angular_components.cancel"),
10767
+ };
10768
+ this.supportedExtensions = [];
10769
+ this.changedImage = new EventEmitter();
10770
+ this.removedImage = new EventEmitter();
10771
+ this.invalidFile = new EventEmitter();
10772
+ }
10773
+ ProfilePicturePickerComponent_1 = ProfilePicturePickerComponent;
10774
+ ProfilePicturePickerComponent.prototype.writeValue = function (value) {
10775
+ this._value = value;
10776
+ };
10777
+ ProfilePicturePickerComponent.prototype.registerOnChange = function (onChange) {
10778
+ this._onChange = onChange;
10779
+ };
10780
+ ProfilePicturePickerComponent.prototype.registerOnTouched = function (onTouched) {
10781
+ this._onTouched = onTouched;
10782
+ };
10783
+ ProfilePicturePickerComponent.prototype.ngOnInit = function () {
10784
+ this._normalizeSuportedExtensions();
10785
+ };
10786
+ ProfilePicturePickerComponent.prototype.onDragOver = function (event) {
10787
+ event.preventDefault();
10788
+ event.stopPropagation();
10789
+ };
10790
+ ProfilePicturePickerComponent.prototype.onDragLeave = function (event) {
10791
+ event.preventDefault();
10792
+ event.stopPropagation();
10793
+ };
10794
+ ProfilePicturePickerComponent.prototype.onDrop = function (event) {
10795
+ event.preventDefault();
10796
+ event.stopPropagation();
10797
+ var files = [];
10798
+ var dataTransferFiles = event.dataTransfer.files;
10799
+ for (var i = 0; i < dataTransferFiles.length; i++) {
10800
+ files.push(dataTransferFiles.item(i));
10801
+ }
10802
+ this._showImageCropper(files);
10803
+ };
10804
+ // Verificando o redimensionamento para ajustar o design para ficar responsivo.
10805
+ ProfilePicturePickerComponent.prototype.onResize = function () {
10806
+ if (this.uploadPicture && this.info && this.thumbnail) {
10807
+ var uploadPictureWidth = this._getWidthElement(this.uploadPicture);
10808
+ var infoWidth = this._getWidthElement(this.info);
10809
+ var thumbnailWidth = this._getWidthElement(this.thumbnail);
10810
+ if (thumbnailWidth + infoWidth > uploadPictureWidth) {
10811
+ this.uploadPicture.nativeElement.classList.add("upload-picture--small");
10812
+ }
10813
+ else {
10814
+ this.uploadPicture.nativeElement.classList.remove("upload-picture--small");
10815
+ }
10816
+ }
10817
+ };
10818
+ ProfilePicturePickerComponent.prototype.selectPhoto = function () {
10819
+ var fileInputElement = this.fileInput.nativeElement;
10820
+ fileInputElement.value = "";
10821
+ fileInputElement.click();
10822
+ };
10823
+ ProfilePicturePickerComponent.prototype.removePhoto = function () {
10824
+ var _this = this;
10825
+ this.confirmationService.confirm({
10826
+ message: this.confirmationTexts.removalMessage,
10827
+ acceptLabel: this.confirmationTexts.removalAcceptLabel,
10828
+ rejectLabel: this.confirmationTexts.removalRejectLabel,
10829
+ header: this.confirmationTexts.removalHeader,
10830
+ accept: function () {
10831
+ var fileInputElement = _this.fileInput.nativeElement;
10832
+ fileInputElement.value = "";
10833
+ _this.image = "";
10834
+ _this.removedImage.emit();
10835
+ },
10836
+ });
10837
+ };
10838
+ ProfilePicturePickerComponent.prototype.photoSelected = function (event) {
10839
+ this._showImageCropper(event.srcElement.files);
10840
+ };
10841
+ ProfilePicturePickerComponent.prototype._showImageCropper = function (files) {
10842
+ var _this = this;
10843
+ if (!this._validateData(files)) {
10844
+ return;
10845
+ }
10846
+ var file = files[0];
10847
+ var fileReader = new FileReader();
10848
+ fileReader.readAsDataURL(file);
10849
+ fileReader.onloadend = function (fileEvent) {
10850
+ _this.imageCropperService.show(__assign({ imageSource: fileEvent.target.result, croppedImage: function (image) {
10851
+ _this.image = image;
10852
+ _this.changedImage.emit(image);
10853
+ _this._value = { sourceFile: file, base64: image };
10854
+ _this._onChange(_this._value);
10855
+ }, changeImage: function () { return _this.selectPhoto(); }, allowSelectAnother: false, aspectRatio: _this.aspectRatio }, _this.cropperLabelsConfig));
10856
+ };
10857
+ };
10858
+ ProfilePicturePickerComponent.prototype._normalizeSuportedExtensions = function () {
10859
+ var _a;
10860
+ this.supportedExtensions = (_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.map(function (extension) { return extension.replace(".", "").toLocaleLowerCase(); });
10861
+ };
10862
+ ProfilePicturePickerComponent.prototype._validateData = function (files) {
10863
+ if (!files.length) {
10864
+ return false;
10865
+ }
10866
+ if (files.length > 1) {
10867
+ this.invalidFile.emit({ file: null, validation: FileValidation.MaxFileLimit });
10868
+ return false;
10869
+ }
10870
+ var file = files[0];
10871
+ if (!file.type.includes("image")) {
10872
+ this.invalidFile.emit({ file: file, validation: FileValidation.TypeInvalid });
10873
+ return false;
10874
+ }
10875
+ if (!this._validateFileExtension(file)) {
10876
+ this.invalidFile.emit({ file: file, validation: FileValidation.UnsupportedExtension });
10877
+ return false;
10878
+ }
10879
+ if (!this._validateFileSize(file)) {
10880
+ this.invalidFile.emit({ file: file, validation: FileValidation.MaxFileSize });
10881
+ return false;
10882
+ }
10883
+ return true;
10884
+ };
10885
+ ProfilePicturePickerComponent.prototype._validateFileExtension = function (file) {
10886
+ var _a;
10887
+ if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
10888
+ var extension = file.name.split(".").pop().toLowerCase();
10889
+ return this.supportedExtensions.includes(extension);
10890
+ }
10891
+ return true;
10892
+ };
10893
+ ProfilePicturePickerComponent.prototype._validateFileSize = function (file) {
10894
+ if (this.maxFileSize) {
10895
+ return file.size > this.maxFileSize;
10896
+ }
10897
+ return true;
10898
+ };
10899
+ ProfilePicturePickerComponent.prototype._getWidthElement = function (element) {
10900
+ var _a = element.nativeElement.getBoundingClientRect(), left = _a.left, right = _a.right;
10901
+ return right - left;
10902
+ };
10903
+ var ProfilePicturePickerComponent_1;
10904
+ ProfilePicturePickerComponent.ctorParameters = function () { return [
10905
+ { type: ImageCropperService },
10906
+ { type: ConfirmationService },
10907
+ { type: TranslateService }
10908
+ ]; };
10909
+ __decorate([
10910
+ Input()
10911
+ ], ProfilePicturePickerComponent.prototype, "simpleTitle", void 0);
10912
+ __decorate([
10913
+ Input()
10914
+ ], ProfilePicturePickerComponent.prototype, "actionTitle", void 0);
10915
+ __decorate([
10916
+ Input()
10917
+ ], ProfilePicturePickerComponent.prototype, "subtitle", void 0);
10918
+ __decorate([
10919
+ Input()
10920
+ ], ProfilePicturePickerComponent.prototype, "aspectRatio", void 0);
10921
+ __decorate([
10922
+ Input()
10923
+ ], ProfilePicturePickerComponent.prototype, "cropperLabelsConfig", void 0);
10924
+ __decorate([
10925
+ Input()
10926
+ ], ProfilePicturePickerComponent.prototype, "removeButtonLabel", void 0);
10927
+ __decorate([
10928
+ Input()
10929
+ ], ProfilePicturePickerComponent.prototype, "changeButtonLabel", void 0);
10930
+ __decorate([
10931
+ Input()
10932
+ ], ProfilePicturePickerComponent.prototype, "confirmationTexts", void 0);
10933
+ __decorate([
10934
+ Input()
10935
+ ], ProfilePicturePickerComponent.prototype, "maxFileSize", void 0);
10936
+ __decorate([
10937
+ Input()
10938
+ ], ProfilePicturePickerComponent.prototype, "accept", void 0);
10939
+ __decorate([
10940
+ Input()
10941
+ ], ProfilePicturePickerComponent.prototype, "supportedExtensions", void 0);
10942
+ __decorate([
10943
+ Input()
10944
+ ], ProfilePicturePickerComponent.prototype, "image", void 0);
10945
+ __decorate([
10946
+ ViewChild("uploadPicture")
10947
+ ], ProfilePicturePickerComponent.prototype, "uploadPicture", void 0);
10948
+ __decorate([
10949
+ ViewChild("info")
10950
+ ], ProfilePicturePickerComponent.prototype, "info", void 0);
10951
+ __decorate([
10952
+ ViewChild("thumbnail", { read: ElementRef })
10953
+ ], ProfilePicturePickerComponent.prototype, "thumbnail", void 0);
10954
+ __decorate([
10955
+ ViewChild("fileInput", { read: ElementRef })
10956
+ ], ProfilePicturePickerComponent.prototype, "fileInput", void 0);
10957
+ __decorate([
10958
+ Output()
10959
+ ], ProfilePicturePickerComponent.prototype, "changedImage", void 0);
10960
+ __decorate([
10961
+ Output()
10962
+ ], ProfilePicturePickerComponent.prototype, "removedImage", void 0);
10963
+ __decorate([
10964
+ Output()
10965
+ ], ProfilePicturePickerComponent.prototype, "invalidFile", void 0);
10966
+ __decorate([
10967
+ HostListener("dragover", ["$event"])
10968
+ ], ProfilePicturePickerComponent.prototype, "onDragOver", null);
10969
+ __decorate([
10970
+ HostListener("dragleave", ["$event"])
10971
+ ], ProfilePicturePickerComponent.prototype, "onDragLeave", null);
10972
+ __decorate([
10973
+ HostListener("drop", ["$event"])
10974
+ ], ProfilePicturePickerComponent.prototype, "onDrop", null);
10975
+ __decorate([
10976
+ HostListener("window:resize")
10977
+ ], ProfilePicturePickerComponent.prototype, "onResize", null);
10978
+ ProfilePicturePickerComponent = ProfilePicturePickerComponent_1 = __decorate([
10979
+ Component({
10980
+ selector: "s-profile-picture-picker",
10981
+ template: "<p-confirmDialog></p-confirmDialog>\n\n<input #fileInput [accept]=\"accept\" class=\"file-input\" type=\"file\" (change)=\"photoSelected($event)\">\n<div #uploadPicture class=\"upload-picture\">\n <s-thumbnail\n #thumbnail\n iconClass=\"far fa-user\"\n [imageSource]=\"image\"\n [hasAction]=\"!image\"\n (click)=\"selectPhoto()\">\n </s-thumbnail>\n <div #info class=\"info\">\n <ng-container *ngIf=\"image; then withImage; else noImage\"></ng-container>\n <p class=\"subtitle\">{{ subtitle }}</p>\n </div>\n</div>\n\n<ng-template #withImage>\n <div class=\"buttons\">\n <s-button\n [label]=\"changeButtonLabel || 'platform.angular_components.change_photo' | translate\"\n priority=\"primary\"\n (onClick)=\"selectPhoto()\">\n </s-button>\n <s-button\n [label]=\"removeButtonLabel || 'platform.angular_components.remove' | translate\"\n priority=\"secondary\"\n (onClick)=\"removePhoto()\">\n </s-button>\n </div>\n</ng-template>\n\n<ng-template #noImage>\n <p class=\"title\">\n {{ simpleTitle || 'platform.angular_components.drag_your_photo_or' | translate }}\n <span\n class=\"action-title\"\n (click)=\"selectPhoto()\">\n {{ actionTitle || 'platform.angular_components.select_a_file' | translate }}\n </span>\n </p>\n</ng-template>",
10982
+ providers: [{
10983
+ provide: NG_VALUE_ACCESSOR,
10984
+ useExisting: forwardRef(function () { return ProfilePicturePickerComponent_1; }),
10985
+ multi: true,
10986
+ }],
10987
+ styles: [".file-input{display:none}.upload-picture{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.upload-picture .info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:12px 20px;-ms-flex-align:start;align-items:flex-start}.upload-picture .info .title{font-family:\"Open Sans\",sans-serif;font-weight:700;font-size:.875rem;line-height:150%;color:#333}.upload-picture .info .title .action-title{cursor:pointer;color:#428bca}.upload-picture .info .buttons{display:-ms-flexbox;display:flex;gap:8px}.upload-picture .info .buttons s-button{margin:0}.upload-picture .info .subtitle{padding:6px 0;font-family:\"Open Sans\",sans-serif;font-weight:400;font-size:.75rem;line-height:150%;color:#697882;text-align:center}.upload-picture--small .info{-ms-flex-align:center;align-items:center}.upload-picture--small .info .subtitle,.upload-picture--small .info .title{text-align:center}.upload-picture--small .info .buttons{-ms-flex-pack:center;justify-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap}"]
10988
+ })
10989
+ ], ProfilePicturePickerComponent);
10990
+ return ProfilePicturePickerComponent;
10991
+ }());
10992
+
10993
+ var ProfilePicturePickerModule = /** @class */ (function () {
10994
+ function ProfilePicturePickerModule() {
10995
+ }
10996
+ ProfilePicturePickerModule = __decorate([
10997
+ NgModule({
10998
+ imports: [
10999
+ CommonModule,
11000
+ TranslateModule,
11001
+ ButtonModule,
11002
+ ThumbnailModule,
11003
+ ImageCropperModule,
11004
+ ConfirmDialogModule,
11005
+ ],
11006
+ declarations: [ProfilePicturePickerComponent],
11007
+ exports: [ProfilePicturePickerComponent],
11008
+ providers: [
11009
+ ImageCropperService,
11010
+ ConfirmationService,
11011
+ ],
11012
+ })
11013
+ ], ProfilePicturePickerModule);
11014
+ return ProfilePicturePickerModule;
11015
+ }());
11016
+
11017
+ var ProfilePictureModule = /** @class */ (function () {
11018
+ function ProfilePictureModule() {
11019
+ }
11020
+ ProfilePictureModule = __decorate([
11021
+ NgModule({
11022
+ imports: [
11023
+ CommonModule,
11024
+ FormsModule,
11025
+ ReactiveFormsModule,
11026
+ ProfilePicturePickerModule,
11027
+ ],
11028
+ declarations: [ProfilePictureFieldComponent],
11029
+ exports: [ProfilePictureFieldComponent],
11030
+ })
11031
+ ], ProfilePictureModule);
11032
+ return ProfilePictureModule;
11033
+ }());
11034
+
11035
+ var DynamicFormModule = /** @class */ (function () {
11036
+ function DynamicFormModule() {
11037
+ }
11038
+ DynamicFormModule = __decorate([
11039
+ NgModule({
11040
+ imports: [
11041
+ AutoCompleteModule,
11042
+ BignumberInputModule,
11043
+ ButtonModule,
11044
+ CalendarMaskModule,
11045
+ CalendarModule,
11046
+ CheckboxModule,
11047
+ ChipsModule,
11048
+ CommonModule,
11049
+ ControlErrorsModule,
11050
+ CountryPhonePickerModule,
11051
+ DialogModule,
11052
+ DropdownModule,
11053
+ EmptyStateModule,
11054
+ FormsModule,
11055
+ HotkeyModule,
11056
+ InputMaskModule,
11057
+ InputTextareaModule,
11058
+ InputTextModule,
11059
+ KeyFilterModule,
11060
+ LoadingStateModule,
11061
+ LocaleModule,
11062
+ LocalizedNumberInputModule,
11063
+ PanelModule$1,
11064
+ ButtonModule$1,
11065
+ TableModule$1,
11066
+ MultiSelectModule,
11067
+ NumberInputModule,
11068
+ RadioButtonModule,
11069
+ ReactiveFormsModule,
11070
+ TooltipModule,
11071
+ FieldsetModule,
11072
+ TableHeaderCheckboxModule,
11073
+ FileUploadModule,
11074
+ TableModule,
11075
+ InfoSignModule,
11076
+ MaskFormatterModule,
11077
+ HotkeyModule.forRoot(),
11078
+ MouseEventsModule,
11079
+ SwitchModule,
11080
+ PasswordStrengthModule,
11081
+ SliderModule,
11082
+ TranslateModule.forChild(),
11083
+ PasswordFieldModule,
11084
+ TextFieldModule,
11085
+ NumberFieldModule,
11086
+ CurrencyFieldModule,
11087
+ NumberFieldModule$1,
11088
+ ProfilePictureModule,
11089
+ ],
11090
+ declarations: [
11091
+ AutocompleteFieldComponent,
11092
+ BooleanFieldComponent,
11093
+ BooleanSwitchFieldComponent,
11094
+ CalendarFieldComponent,
11095
+ ChipsFieldComponent,
11096
+ CountryPhonePickerFieldComponent,
11097
+ DynamicFieldComponent,
11098
+ DynamicFormComponent,
11099
+ DynamicFormDirective,
11100
+ FieldsetComponent,
11101
+ FileUploadComponent$1,
11102
+ LookupComponent,
11103
+ LookupFieldComponent,
11104
+ RadioButtonComponent,
11105
+ RowComponent,
11106
+ SectionComponent,
11107
+ SelectFieldComponent,
11108
+ SliderFieldComponent,
11109
+ TextAreaFieldComponent,
11110
+ TextAreaIAFieldComponent,
11111
+ ],
11112
+ exports: [DynamicFormComponent, LookupComponent],
11113
+ entryComponents: [
11114
+ AutocompleteFieldComponent,
11115
+ BooleanFieldComponent,
11116
+ BooleanSwitchFieldComponent,
11117
+ CalendarFieldComponent,
11118
+ ChipsFieldComponent,
11119
+ CountryPhonePickerFieldComponent,
11120
+ FieldsetComponent,
11121
+ FileUploadComponent$1,
11122
+ LookupFieldComponent,
11123
+ RadioButtonComponent,
11124
+ RowComponent,
11125
+ SectionComponent,
11126
+ SelectFieldComponent,
11127
+ SliderFieldComponent,
11128
+ TextAreaFieldComponent,
11129
+ TextAreaIAFieldComponent,
11130
+ ],
11131
+ providers: [
11132
+ HotkeysService,
11133
+ IAssistService,
11134
+ ]
11135
+ })
11136
+ ], DynamicFormModule);
11137
+ return DynamicFormModule;
11138
+ }());
11139
+
11140
+ var CustomFieldsService = /** @class */ (function () {
11141
+ function CustomFieldsService(http) {
11142
+ this.http = http;
11143
+ }
11144
+ CustomFieldsService.prototype.getCustomFields = function (domain, service, entity, endpoint) {
11145
+ var entityDto = { entityId: { domain_: domain, service_: service, id: entity } };
11146
+ return this.http.post(endpoint, entityDto);
11147
+ };
11148
+ CustomFieldsService.prototype.getFileLocationUrl = function (dto, endpoint) {
11149
+ return this.http.post(endpoint, dto);
11150
+ };
11151
+ CustomFieldsService.prototype.uploadTempFile = function (location, file) {
11152
+ return this.http.put(location, file, {
11153
+ reportProgress: true,
11154
+ observe: "events",
11155
+ headers: { "Content-Type": file.type }
11156
+ });
11157
+ };
11158
+ CustomFieldsService.prototype.requestAccess = function (objectId, endpoint) {
11159
+ return this.http.post(endpoint, { objectId: objectId });
11160
+ };
11161
+ CustomFieldsService.prototype.getFile = function (permanentUrl) {
11162
+ return this.http.get(permanentUrl, { responseType: "blob" });
11163
+ };
11164
+ CustomFieldsService.ctorParameters = function () { return [
11165
+ { type: HttpClient }
11166
+ ]; };
11167
+ CustomFieldsService = __decorate([
11168
+ Injectable()
11169
+ ], CustomFieldsService);
11170
+ return CustomFieldsService;
11171
+ }());
11172
+
11173
+ var CustomFieldType;
11174
+ (function (CustomFieldType) {
11175
+ CustomFieldType["String"] = "String";
11176
+ CustomFieldType["Boolean"] = "Boolean";
11177
+ CustomFieldType["Integer"] = "Integer";
11178
+ CustomFieldType["Double"] = "Double";
11179
+ CustomFieldType["Date"] = "Date";
11180
+ CustomFieldType["DateTime"] = "DateTime";
11181
+ CustomFieldType["LocalDateTime"] = "LocalDateTime";
11182
+ CustomFieldType["Time"] = "Time";
11183
+ CustomFieldType["Money"] = "Money";
11184
+ CustomFieldType["Blob"] = "Blob";
10399
11185
  CustomFieldType["Binary"] = "Binary";
10400
11186
  CustomFieldType["Any"] = "Any";
10401
11187
  CustomFieldType["Enum"] = "Enum";
@@ -11937,1985 +12723,1532 @@ var Gantt = /** @class */ (function () {
11937
12723
  // uids
11938
12724
  if (!task.id) {
11939
12725
  task.id = generate_id(task);
11940
- }
11941
- return task;
11942
- });
11943
- this.setup_dependencies();
11944
- };
11945
- Gantt.prototype.setup_dependencies = function () {
11946
- var e_1, _a, e_2, _b;
11947
- this.dependency_map = {};
11948
- try {
11949
- for (var _c = __values(this.tasks), _d = _c.next(); !_d.done; _d = _c.next()) {
11950
- var t = _d.value;
11951
- try {
11952
- for (var _e = (e_2 = void 0, __values(t.dependencies)), _f = _e.next(); !_f.done; _f = _e.next()) {
11953
- var d = _f.value;
11954
- this.dependency_map[d] = this.dependency_map[d] || [];
11955
- this.dependency_map[d].push(t.id);
11956
- }
11957
- }
11958
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
11959
- finally {
11960
- try {
11961
- if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
11962
- }
11963
- finally { if (e_2) throw e_2.error; }
11964
- }
11965
- }
11966
- }
11967
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
11968
- finally {
11969
- try {
11970
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
11971
- }
11972
- finally { if (e_1) throw e_1.error; }
11973
- }
11974
- };
11975
- Gantt.prototype.refresh = function (tasks) {
11976
- this.setup_tasks(tasks);
11977
- this.change_view_mode();
11978
- };
11979
- Gantt.prototype.change_view_mode = function (mode) {
11980
- if (mode === void 0) { mode = this.options.viewMode; }
11981
- this.setup_gantt_dates();
11982
- this.update_view_scale(mode);
11983
- this.setup_dates();
11984
- this.render();
11985
- // fire viewmode_change event
11986
- this.trigger_event("onViewChange", [mode]);
11987
- };
11988
- Gantt.prototype.update_view_scale = function (view_mode) {
11989
- this.options.viewMode = view_mode;
11990
- // this.isHourView = false;
11991
- if (view_mode === ViewMode.QuarterHour) {
11992
- this.options.step = 24 / 24 / 4;
11993
- this.options.columnWidth = 50;
11994
- }
11995
- else if (view_mode === ViewMode.Hour) {
11996
- this.options.step = 24 / 24;
11997
- this.options.columnWidth = 50;
11998
- }
11999
- else if (view_mode === ViewMode.Day) {
12000
- this.options.step = 24;
12001
- this.options.columnWidth = 50;
12002
- }
12003
- else if (view_mode === ViewMode.HalfDay) {
12004
- this.options.step = 24 / 2;
12005
- this.options.columnWidth = 50;
12006
- }
12007
- else if (view_mode === ViewMode.QuarterDay) {
12008
- this.options.step = 24 / 4;
12009
- this.options.columnWidth = 50;
12010
- }
12011
- else if (view_mode === ViewMode.Week) {
12012
- this.options.step = 24 * 7;
12013
- this.options.columnWidth = 140;
12014
- }
12015
- else if (view_mode === ViewMode.Month) {
12016
- this.options.step = 24 * 30;
12017
- this.options.columnWidth = 120;
12018
- }
12019
- else if (view_mode === ViewMode.Year) {
12020
- this.options.step = 24 * 365;
12021
- this.options.columnWidth = 120;
12022
- }
12023
- };
12024
- Gantt.prototype.setup_dates = function () {
12025
- this.setup_date_values();
12026
- };
12027
- Gantt.prototype.setup_gantt_dates = function () {
12028
- var e_3, _a;
12029
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
12030
- this._minDate = null;
12031
- this._maxDate = null;
12032
- try {
12033
- for (var _t = __values(this.tasks), _u = _t.next(); !_u.done; _u = _t.next()) {
12034
- var task = _u.value;
12035
- // set global start and end date
12036
- if (!this.minDate || task.start < this.minDate) {
12037
- this._minDate = DateUtils.startOf(task.start, 'day');
12038
- }
12039
- if (!this.maxDate || task.end > this.maxDate) {
12040
- this._maxDate = task.end;
12041
- }
12042
- }
12043
- }
12044
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
12045
- finally {
12046
- try {
12047
- if (_u && !_u.done && (_a = _t.return)) _a.call(_t);
12048
- }
12049
- finally { if (e_3) throw e_3.error; }
12050
- }
12051
- switch (this.options.viewMode) {
12052
- case ViewMode.QuarterHour:
12053
- this._minDate = DateUtils.add(this.minDate, -((_b = this.options.marginBeforeStart) !== null && _b !== void 0 ? _b : 15), "minutes");
12054
- this._maxDate = DateUtils.add(this.maxDate, (_c = this.options.marginAfterEnd) !== null && _c !== void 0 ? _c : 15, "minutes");
12055
- case ViewMode.Hour:
12056
- this._minDate = DateUtils.add(this.minDate, -((_d = this.options.marginBeforeStart) !== null && _d !== void 0 ? _d : 1), "hour");
12057
- this._maxDate = DateUtils.add(this.maxDate, (_e = this.options.marginAfterEnd) !== null && _e !== void 0 ? _e : 1, "hour");
12058
- break;
12059
- case ViewMode.QuarterDay:
12060
- this._minDate = DateUtils.add(this.minDate, -((_f = this.options.marginBeforeStart) !== null && _f !== void 0 ? _f : 6), "hour");
12061
- this._maxDate = DateUtils.add(this.maxDate, (_g = this.options.marginAfterEnd) !== null && _g !== void 0 ? _g : 6, "hour");
12062
- break;
12063
- case ViewMode.HalfDay:
12064
- this._minDate = DateUtils.add(this.minDate, -((_h = this.options.marginBeforeStart) !== null && _h !== void 0 ? _h : 12), "hour");
12065
- this._maxDate = DateUtils.add(this.maxDate, (_j = this.options.marginAfterEnd) !== null && _j !== void 0 ? _j : 12, "hour");
12066
- break;
12067
- case ViewMode.Day:
12068
- this._minDate = DateUtils.add(this.minDate, -((_k = this.options.marginBeforeStart) !== null && _k !== void 0 ? _k : 1), "day");
12069
- this._maxDate = DateUtils.add(this.maxDate, (_l = this.options.marginAfterEnd) !== null && _l !== void 0 ? _l : 1, "day");
12070
- break;
12071
- case ViewMode.Week:
12072
- this._minDate = DateUtils.add(this.minDate, -((_m = this.options.marginBeforeStart) !== null && _m !== void 0 ? _m : 1), "week");
12073
- this._maxDate = DateUtils.add(this.maxDate, (_o = this.options.marginAfterEnd) !== null && _o !== void 0 ? _o : 1, "week");
12074
- break;
12075
- case ViewMode.Month:
12076
- this._minDate = DateUtils.add(this.minDate, -((_p = this.options.marginBeforeStart) !== null && _p !== void 0 ? _p : 1), "month");
12077
- this._maxDate = DateUtils.add(this.maxDate, (_q = this.options.marginAfterEnd) !== null && _q !== void 0 ? _q : 1, "month");
12078
- break;
12079
- case ViewMode.Year:
12080
- this._minDate = DateUtils.add(this.minDate, -((_r = this.options.marginBeforeStart) !== null && _r !== void 0 ? _r : 1), "year");
12081
- this._maxDate = DateUtils.add(this.maxDate, (_s = this.options.marginAfterEnd) !== null && _s !== void 0 ? _s : 1, "year");
12082
- break;
12083
- }
12084
- };
12085
- Gantt.prototype.setup_date_values = function () {
12086
- this.dates = [];
12087
- var cur_date = null;
12088
- while (cur_date === null || cur_date < this.maxDate) {
12089
- if (!cur_date) {
12090
- cur_date = DateUtils.clone(this.minDate);
12091
- }
12092
- else {
12093
- if (this.view_is(ViewMode.Year)) {
12094
- cur_date = DateUtils.add(cur_date, 1, "year");
12095
- }
12096
- else if (this.view_is(ViewMode.Month)) {
12097
- cur_date = DateUtils.add(cur_date, 1, "month");
12098
- }
12099
- else {
12100
- cur_date = DateUtils.add(cur_date, this.options.step, 'hour');
12101
- }
12102
- }
12103
- this.dates.push(cur_date);
12104
- }
12105
- if (this.options.containerWidth) {
12106
- var columnWidth = (this.options.containerWidth - 1) / this.dates.length;
12107
- this.options.columnWidth = columnWidth < 45 ? 45 : columnWidth;
12108
- }
12109
- };
12110
- Gantt.prototype.bind_events = function () {
12111
- this.bind_grid_click();
12112
- this.bind_bar_events();
12113
- };
12114
- Gantt.prototype.render = function () {
12115
- this.clear();
12116
- this.setup_layers();
12117
- this.make_grid();
12118
- this.make_dates();
12119
- this.make_bars();
12120
- this.make_arrows();
12121
- this.map_arrows_on_bars();
12122
- this.set_width();
12123
- this.set_scroll_position();
12726
+ }
12727
+ return task;
12728
+ });
12729
+ this.setup_dependencies();
12124
12730
  };
12125
- Gantt.prototype.setup_layers = function () {
12126
- var e_4, _a;
12127
- this.layers = {};
12128
- var layers = ["grid", "date", "arrow", "progress", "bar", "details"];
12731
+ Gantt.prototype.setup_dependencies = function () {
12732
+ var e_1, _a, e_2, _b;
12733
+ this.dependency_map = {};
12129
12734
  try {
12130
- // make group layers
12131
- for (var layers_1 = __values(layers), layers_1_1 = layers_1.next(); !layers_1_1.done; layers_1_1 = layers_1.next()) {
12132
- var layer = layers_1_1.value;
12133
- this.layers[layer] = createSVG('g', {
12134
- class: layer,
12135
- append_to: this.$svg,
12136
- });
12735
+ for (var _c = __values(this.tasks), _d = _c.next(); !_d.done; _d = _c.next()) {
12736
+ var t = _d.value;
12737
+ try {
12738
+ for (var _e = (e_2 = void 0, __values(t.dependencies)), _f = _e.next(); !_f.done; _f = _e.next()) {
12739
+ var d = _f.value;
12740
+ this.dependency_map[d] = this.dependency_map[d] || [];
12741
+ this.dependency_map[d].push(t.id);
12742
+ }
12743
+ }
12744
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
12745
+ finally {
12746
+ try {
12747
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
12748
+ }
12749
+ finally { if (e_2) throw e_2.error; }
12750
+ }
12137
12751
  }
12138
12752
  }
12139
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
12753
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
12140
12754
  finally {
12141
12755
  try {
12142
- if (layers_1_1 && !layers_1_1.done && (_a = layers_1.return)) _a.call(layers_1);
12756
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
12143
12757
  }
12144
- finally { if (e_4) throw e_4.error; }
12758
+ finally { if (e_1) throw e_1.error; }
12145
12759
  }
12146
12760
  };
12147
- Gantt.prototype.make_grid = function () {
12148
- this.make_grid_background();
12149
- this.make_grid_rows();
12150
- this.make_grid_header();
12151
- this.make_grid_highlights();
12152
- this.make_grid_ticks();
12761
+ Gantt.prototype.refresh = function (tasks) {
12762
+ this.setup_tasks(tasks);
12763
+ this.change_view_mode();
12153
12764
  };
12154
- Gantt.prototype.make_grid_background = function () {
12155
- var grid_width = this.dates.length * this.options.columnWidth;
12156
- if (this.options.containerWidth) {
12157
- grid_width = this.options.containerWidth;
12158
- }
12159
- var distinct_rows = __spread(new Set(this.tasks.map(function (x) { return x._row_id; })));
12160
- var grid_height = this.options.headerHeight +
12161
- this.options.padding / 2 +
12162
- (this.options.barHeight + this.options.padding) *
12163
- distinct_rows.length;
12164
- createSVG("rect", {
12165
- x: 0,
12166
- y: 0,
12167
- width: grid_width,
12168
- height: grid_height,
12169
- class: "grid-background",
12170
- append_to: this.layers.grid,
12171
- });
12172
- $.attr(this.$svg, {
12173
- height: grid_height,
12174
- width: "100%",
12175
- }, null);
12765
+ Gantt.prototype.change_view_mode = function (mode) {
12766
+ if (mode === void 0) { mode = this.options.viewMode; }
12767
+ this.setup_gantt_dates();
12768
+ this.update_view_scale(mode);
12769
+ this.setup_dates();
12770
+ this.render();
12771
+ // fire viewmode_change event
12772
+ this.trigger_event("onViewChange", [mode]);
12176
12773
  };
12177
- Gantt.prototype.make_grid_rows = function () {
12178
- var _this = this;
12179
- var rows_layer = createSVG("g", { append_to: this.layers.grid });
12180
- var lines_layer = createSVG("g", { append_to: this.layers.grid });
12181
- var row_width = this.dates.length * this.options.columnWidth;
12182
- var row_height = this.options.barHeight + this.options.padding;
12183
- //TODO: ajustar o posicionamento das linhas
12184
- var row_y = this.options.headerHeight + this.options.padding / 2;
12185
- this.tasks.forEach(function (_) {
12186
- createSVG("rect", {
12187
- x: 0,
12188
- y: row_y,
12189
- width: row_width,
12190
- height: row_height,
12191
- class: "grid-row",
12192
- append_to: rows_layer,
12193
- });
12194
- createSVG("line", {
12195
- x1: 0,
12196
- y1: row_y + row_height,
12197
- x2: row_width,
12198
- y2: row_y + row_height,
12199
- class: "row-line",
12200
- append_to: lines_layer,
12201
- });
12202
- row_y += _this.options.barHeight + _this.options.padding;
12203
- });
12774
+ Gantt.prototype.update_view_scale = function (view_mode) {
12775
+ this.options.viewMode = view_mode;
12776
+ // this.isHourView = false;
12777
+ if (view_mode === ViewMode.QuarterHour) {
12778
+ this.options.step = 24 / 24 / 4;
12779
+ this.options.columnWidth = 50;
12780
+ }
12781
+ else if (view_mode === ViewMode.Hour) {
12782
+ this.options.step = 24 / 24;
12783
+ this.options.columnWidth = 50;
12784
+ }
12785
+ else if (view_mode === ViewMode.Day) {
12786
+ this.options.step = 24;
12787
+ this.options.columnWidth = 50;
12788
+ }
12789
+ else if (view_mode === ViewMode.HalfDay) {
12790
+ this.options.step = 24 / 2;
12791
+ this.options.columnWidth = 50;
12792
+ }
12793
+ else if (view_mode === ViewMode.QuarterDay) {
12794
+ this.options.step = 24 / 4;
12795
+ this.options.columnWidth = 50;
12796
+ }
12797
+ else if (view_mode === ViewMode.Week) {
12798
+ this.options.step = 24 * 7;
12799
+ this.options.columnWidth = 140;
12800
+ }
12801
+ else if (view_mode === ViewMode.Month) {
12802
+ this.options.step = 24 * 30;
12803
+ this.options.columnWidth = 120;
12804
+ }
12805
+ else if (view_mode === ViewMode.Year) {
12806
+ this.options.step = 24 * 365;
12807
+ this.options.columnWidth = 120;
12808
+ }
12204
12809
  };
12205
- Gantt.prototype.make_grid_header = function () {
12206
- // const addIsHourView = this.isHourView ? 25 : 10
12207
- var header_width = this.dates.length * this.options.columnWidth;
12208
- var header_height = this.options.headerHeight + 10;
12209
- createSVG("rect", {
12210
- x: 0,
12211
- y: 0,
12212
- width: header_width,
12213
- height: header_height,
12214
- class: "grid-header",
12215
- append_to: this.layers.grid,
12216
- });
12810
+ Gantt.prototype.setup_dates = function () {
12811
+ this.setup_date_values();
12217
12812
  };
12218
- Gantt.prototype.make_grid_ticks = function () {
12219
- var e_5, _a;
12220
- var tick_x = 0;
12221
- var tick_y = this.options.headerHeight + this.options.padding / 2;
12222
- var tick_height = (this.options.barHeight + this.options.padding) *
12223
- this.tasks.length;
12813
+ Gantt.prototype.setup_gantt_dates = function () {
12814
+ var e_3, _a;
12815
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
12816
+ this._minDate = null;
12817
+ this._maxDate = null;
12224
12818
  try {
12225
- for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
12226
- var date = _c.value;
12227
- var tick_class = "tick";
12228
- if (this.view_is(ViewMode.QuarterHour) && date.getHours() === 0 && date.getMinutes() === 0) {
12229
- // thick tick for first hour of day.
12230
- tick_class += " thick";
12231
- }
12232
- else if (this.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay]) && date.getHours() === 0) {
12233
- // thick tick for first hour of day.
12234
- tick_class += " thick";
12235
- }
12236
- else if (this.view_is(ViewMode.Day) && date.getDate() === 1) {
12237
- // thick tick for monday
12238
- tick_class += " thick";
12239
- }
12240
- else if (this.view_is(ViewMode.Week) && date.getDate() >= 1 && date.getDate() < 8) {
12241
- // thick tick for first week
12242
- tick_class += " thick";
12243
- }
12244
- else if (this.view_is(ViewMode.Month) && date.getMonth() % 3 === 0) {
12245
- // thick ticks for quarters
12246
- tick_class += " thick";
12247
- }
12248
- createSVG("path", {
12249
- d: "M " + tick_x + " " + tick_y + " v " + tick_height,
12250
- class: tick_class,
12251
- append_to: this.layers.grid,
12252
- });
12253
- if (this.view_is(ViewMode.Month)) {
12254
- tick_x +=
12255
- (DateUtils.getDaysInMonth(date) *
12256
- this.options.columnWidth) /
12257
- 30;
12258
- }
12259
- else {
12260
- tick_x += this.options.columnWidth;
12819
+ for (var _t = __values(this.tasks), _u = _t.next(); !_u.done; _u = _t.next()) {
12820
+ var task = _u.value;
12821
+ // set global start and end date
12822
+ if (!this.minDate || task.start < this.minDate) {
12823
+ this._minDate = DateUtils.startOf(task.start, 'day');
12261
12824
  }
12262
- }
12263
- }
12264
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
12265
- finally {
12266
- try {
12267
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12268
- }
12269
- finally { if (e_5) throw e_5.error; }
12270
- }
12271
- };
12272
- Gantt.prototype.make_grid_highlights = function () {
12273
- var e_6, _a;
12274
- if (this.view_is(ViewMode.Day)) {
12275
- var width = this.options.columnWidth;
12276
- var height = (this.options.barHeight + this.options.padding) *
12277
- this.tasks.length +
12278
- this.options.headerHeight +
12279
- this.options.padding / 2;
12280
- var x = 0;
12281
- try {
12282
- for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
12283
- var date = _c.value;
12284
- var y = (this.options.headerHeight + this.options.padding) / 2;
12285
- var isToday = date == DateUtils.today();
12286
- var isWeekend = (date.getDay() == 0 || date.getDay() == 6);
12287
- var className = void 0;
12288
- if (isToday) {
12289
- className = "today-highlight";
12290
- y = (this.options.headerHeight + this.options.padding) / 2;
12291
- }
12292
- else if (isWeekend) {
12293
- className = "weekend-highlight";
12294
- }
12295
- var rx = 3;
12296
- var ry = 3;
12297
- if (isToday || isWeekend) {
12298
- createSVG("rect", {
12299
- x: x,
12300
- y: y,
12301
- rx: rx,
12302
- ry: ry,
12303
- width: width,
12304
- height: height,
12305
- class: className,
12306
- append_to: this.layers.grid
12307
- });
12308
- }
12309
- x += this.options.columnWidth;
12825
+ if (!this.maxDate || task.end > this.maxDate) {
12826
+ this._maxDate = task.end;
12310
12827
  }
12311
12828
  }
12312
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
12313
- finally {
12314
- try {
12315
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12316
- }
12317
- finally { if (e_6) throw e_6.error; }
12829
+ }
12830
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
12831
+ finally {
12832
+ try {
12833
+ if (_u && !_u.done && (_a = _t.return)) _a.call(_t);
12318
12834
  }
12835
+ finally { if (e_3) throw e_3.error; }
12836
+ }
12837
+ switch (this.options.viewMode) {
12838
+ case ViewMode.QuarterHour:
12839
+ this._minDate = DateUtils.add(this.minDate, -((_b = this.options.marginBeforeStart) !== null && _b !== void 0 ? _b : 15), "minutes");
12840
+ this._maxDate = DateUtils.add(this.maxDate, (_c = this.options.marginAfterEnd) !== null && _c !== void 0 ? _c : 15, "minutes");
12841
+ case ViewMode.Hour:
12842
+ this._minDate = DateUtils.add(this.minDate, -((_d = this.options.marginBeforeStart) !== null && _d !== void 0 ? _d : 1), "hour");
12843
+ this._maxDate = DateUtils.add(this.maxDate, (_e = this.options.marginAfterEnd) !== null && _e !== void 0 ? _e : 1, "hour");
12844
+ break;
12845
+ case ViewMode.QuarterDay:
12846
+ this._minDate = DateUtils.add(this.minDate, -((_f = this.options.marginBeforeStart) !== null && _f !== void 0 ? _f : 6), "hour");
12847
+ this._maxDate = DateUtils.add(this.maxDate, (_g = this.options.marginAfterEnd) !== null && _g !== void 0 ? _g : 6, "hour");
12848
+ break;
12849
+ case ViewMode.HalfDay:
12850
+ this._minDate = DateUtils.add(this.minDate, -((_h = this.options.marginBeforeStart) !== null && _h !== void 0 ? _h : 12), "hour");
12851
+ this._maxDate = DateUtils.add(this.maxDate, (_j = this.options.marginAfterEnd) !== null && _j !== void 0 ? _j : 12, "hour");
12852
+ break;
12853
+ case ViewMode.Day:
12854
+ this._minDate = DateUtils.add(this.minDate, -((_k = this.options.marginBeforeStart) !== null && _k !== void 0 ? _k : 1), "day");
12855
+ this._maxDate = DateUtils.add(this.maxDate, (_l = this.options.marginAfterEnd) !== null && _l !== void 0 ? _l : 1, "day");
12856
+ break;
12857
+ case ViewMode.Week:
12858
+ this._minDate = DateUtils.add(this.minDate, -((_m = this.options.marginBeforeStart) !== null && _m !== void 0 ? _m : 1), "week");
12859
+ this._maxDate = DateUtils.add(this.maxDate, (_o = this.options.marginAfterEnd) !== null && _o !== void 0 ? _o : 1, "week");
12860
+ break;
12861
+ case ViewMode.Month:
12862
+ this._minDate = DateUtils.add(this.minDate, -((_p = this.options.marginBeforeStart) !== null && _p !== void 0 ? _p : 1), "month");
12863
+ this._maxDate = DateUtils.add(this.maxDate, (_q = this.options.marginAfterEnd) !== null && _q !== void 0 ? _q : 1, "month");
12864
+ break;
12865
+ case ViewMode.Year:
12866
+ this._minDate = DateUtils.add(this.minDate, -((_r = this.options.marginBeforeStart) !== null && _r !== void 0 ? _r : 1), "year");
12867
+ this._maxDate = DateUtils.add(this.maxDate, (_s = this.options.marginAfterEnd) !== null && _s !== void 0 ? _s : 1, "year");
12868
+ break;
12319
12869
  }
12320
12870
  };
12321
- Gantt.prototype.make_dates = function () {
12322
- var dates = this.get_dates_to_draw();
12323
- for (var i = 0; i < dates.length; i++) {
12324
- var date = dates[i];
12325
- createSVG("text", {
12326
- x: date.lower_x,
12327
- y: date.lower_y + 20,
12328
- innerHTML: date.lower_text,
12329
- class: "title-2",
12330
- append_to: this.layers.date,
12331
- });
12332
- if (date.middle_text) {
12333
- createSVG("text", {
12334
- x: date.middle_x,
12335
- y: date.middle_y,
12336
- innerHTML: date.middle_text,
12337
- class: "middle-text",
12338
- append_to: this.layers.date,
12339
- });
12871
+ Gantt.prototype.setup_date_values = function () {
12872
+ this.dates = [];
12873
+ var cur_date = null;
12874
+ while (cur_date === null || cur_date < this.maxDate) {
12875
+ if (!cur_date) {
12876
+ cur_date = DateUtils.clone(this.minDate);
12340
12877
  }
12341
- if (date.upper_text) {
12342
- var $upper_text = createSVG("text", {
12343
- x: date.upper_x,
12344
- y: date.upper_y,
12345
- innerHTML: date.upper_text,
12346
- class: "upper-text",
12347
- append_to: this.layers.date,
12348
- });
12349
- // remove out-of-bound dates
12350
- if ($upper_text.getBBox().x2 > this.layers.grid.getBBox().width) {
12351
- $upper_text.remove();
12878
+ else {
12879
+ if (this.view_is(ViewMode.Year)) {
12880
+ cur_date = DateUtils.add(cur_date, 1, "year");
12881
+ }
12882
+ else if (this.view_is(ViewMode.Month)) {
12883
+ cur_date = DateUtils.add(cur_date, 1, "month");
12884
+ }
12885
+ else {
12886
+ cur_date = DateUtils.add(cur_date, this.options.step, 'hour');
12352
12887
  }
12353
12888
  }
12889
+ this.dates.push(cur_date);
12354
12890
  }
12355
- };
12356
- Gantt.prototype.get_dates_to_draw = function () {
12357
- var _this = this;
12358
- var last_date = null;
12359
- var dates = this.dates.map(function (date, i) {
12360
- var d = _this.get_date_info(date, last_date, i);
12361
- last_date = date;
12362
- return d;
12363
- });
12364
- return dates;
12365
- };
12366
- Gantt.prototype.get_date_info = function (date, last_date, i) {
12367
- if (!last_date) {
12368
- last_date = DateUtils.add(date, 1, "year");
12891
+ if (this.options.containerWidth) {
12892
+ var columnWidth = (this.options.containerWidth - 1) / this.dates.length;
12893
+ this.options.columnWidth = columnWidth < 45 ? 45 : columnWidth;
12369
12894
  }
12370
- var date_text = {
12371
- // quarter hour
12372
- quarterHourUpper: date.getDate() !== last_date.getDate()
12373
- ? DateUtils.format(date, "D MMM", this.options.language)
12374
- : "",
12375
- quarterHourLower: DateUtils.format(date, "HH:mm", this.options.language),
12376
- // hour
12377
- hourUpper: date.getDate() !== last_date.getDate()
12378
- ? DateUtils.format(date, "D MMM", this.options.language)
12379
- : "",
12380
- hourLower: DateUtils.format(date, "HH:mm", this.options.language),
12381
- // quarter day
12382
- quarterDayUpper: date.getDate() !== last_date.getDate()
12383
- ? DateUtils.format(date, "D MMM", this.options.language)
12384
- : "",
12385
- quarterDayLower: DateUtils.format(date, "HH:mm", this.options.language),
12386
- // half day
12387
- halfDayUpper: (date.getDate() !== last_date.getDate())
12388
- ? (((date.getMonth() !== last_date.getMonth()) || i < 2)
12389
- ? DateUtils.format(date, "D MMM", this.options.language)
12390
- : DateUtils.format(date, "D", this.options.language))
12391
- : "",
12392
- halfDayLower: DateUtils.format(date, "HH:mm", this.options.language),
12393
- // day
12394
- dayUpper: ((date.getMonth() !== last_date.getMonth()) || i === 0)
12395
- ? DateUtils.format(date, "MMMM", this.options.language)
12396
- : "",
12397
- dayMiddle: DateUtils.format(date, "ddd", this.options.language),
12398
- dayLower: DateUtils.format(date, "D", this.options.language),
12399
- // week
12400
- weekUpper: date.getMonth() !== last_date.getMonth()
12401
- ? DateUtils.format(date, "MMMM", this.options.language)
12402
- : "",
12403
- weekLower: date.getMonth() !== last_date.getMonth()
12404
- ? DateUtils.format(date, "D MMM", this.options.language)
12405
- : DateUtils.format(date, "D", this.options.language),
12406
- // month
12407
- monthUpper: date.getFullYear() !== last_date.getFullYear()
12408
- ? DateUtils.format(date, "YYYY", this.options.language)
12409
- : "",
12410
- monthLower: DateUtils.format(date, "MMMM", this.options.language),
12411
- // year
12412
- yearUpper: date.getFullYear() !== last_date.getFullYear()
12413
- ? DateUtils.format(date, "YYYY", this.options.language)
12414
- : "",
12415
- yearLower: DateUtils.format(date, "YYYY", this.options.language),
12416
- };
12417
- // Descontando 20 para adcionar uma segunda linha de informação no cabeçalho
12418
- var base_pos = {
12419
- x: i * this.options.columnWidth,
12420
- upper_y: this.options.headerHeight - 20 - 25,
12421
- middle_y: this.options.headerHeight - 20,
12422
- lower_y: this.options.headerHeight - 20,
12423
- };
12424
- var x_pos = {
12425
- quarterHourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
12426
- quarterHourMiddle: this.options.columnWidth / 2,
12427
- quarterHourLower: this.options.columnWidth / 2,
12428
- hourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
12429
- hourMiddle: this.options.columnWidth / 2,
12430
- hourLower: this.options.columnWidth / 2,
12431
- quarterDayUpper: this.options.columnWidth * 4 / 2,
12432
- quarterDayMiddle: this.options.columnWidth / 2,
12433
- quarterDayLower: this.options.columnWidth / 2,
12434
- halfDayUpper: this.options.columnWidth * 2 / 2,
12435
- halfDayMiddle: this.options.columnWidth / 2,
12436
- halfDayLower: this.options.columnWidth / 2,
12437
- dayUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 30) / 2),
12438
- dayMiddle: this.options.columnWidth / 2 - 12,
12439
- dayLower: this.options.columnWidth / 2,
12440
- weekUpper: (this.options.columnWidth * 4) / 2,
12441
- weekMiddle: 0,
12442
- weekLower: 0,
12443
- monthUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 12) / 2),
12444
- monthMiddle: 0,
12445
- monthLower: this.options.columnWidth / 2,
12446
- yearUpper: (this.options.columnWidth * 30) / 2,
12447
- yearMiddle: this.options.columnWidth / 2,
12448
- yearLower: this.options.columnWidth / 2,
12449
- };
12450
- return {
12451
- upper_text: date_text[this.options.viewMode + "Upper"],
12452
- middle_text: date_text[this.options.viewMode + "Middle"],
12453
- lower_text: date_text[this.options.viewMode + "Lower"],
12454
- upper_x: base_pos.x + x_pos[this.options.viewMode + "Upper"],
12455
- upper_y: base_pos.upper_y,
12456
- middle_x: base_pos.x + x_pos[this.options.viewMode + "Middle"],
12457
- middle_y: base_pos.middle_y,
12458
- lower_x: base_pos.x + x_pos[this.options.viewMode + "Lower"],
12459
- lower_y: base_pos.lower_y,
12460
- date: date,
12461
- };
12462
12895
  };
12463
- Gantt.prototype.make_bars = function () {
12464
- var _this = this;
12465
- this.bars = this.tasks.map(function (task) {
12466
- var bar = new Bar(_this, task);
12467
- _this.layers.bar.appendChild(bar.group);
12468
- return bar;
12469
- });
12896
+ Gantt.prototype.bind_events = function () {
12897
+ this.bind_grid_click();
12898
+ this.bind_bar_events();
12470
12899
  };
12471
- Gantt.prototype.make_arrows = function () {
12472
- var e_7, _a;
12473
- var _this = this;
12474
- this.arrows = [];
12475
- var _loop_1 = function (task) {
12476
- var arrows = [];
12477
- arrows = task.dependencies
12478
- .map(function (task_id) {
12479
- var dependency = _this.get_task(task_id);
12480
- if (!dependency)
12481
- return;
12482
- var arrow = new Arrow(_this, _this.bars[dependency._index], // from_task
12483
- _this.bars[task._index] // to_task
12484
- );
12485
- _this.layers.arrow.appendChild(arrow.element);
12486
- return arrow;
12487
- })
12488
- .filter(Boolean); // filter falsy values
12489
- this_1.arrows = this_1.arrows.concat(arrows);
12490
- };
12491
- var this_1 = this;
12900
+ Gantt.prototype.render = function () {
12901
+ this.clear();
12902
+ this.setup_layers();
12903
+ this.make_grid();
12904
+ this.make_dates();
12905
+ this.make_bars();
12906
+ this.make_arrows();
12907
+ this.map_arrows_on_bars();
12908
+ this.set_width();
12909
+ this.set_scroll_position();
12910
+ };
12911
+ Gantt.prototype.setup_layers = function () {
12912
+ var e_4, _a;
12913
+ this.layers = {};
12914
+ var layers = ["grid", "date", "arrow", "progress", "bar", "details"];
12492
12915
  try {
12493
- for (var _b = __values(this.tasks), _c = _b.next(); !_c.done; _c = _b.next()) {
12494
- var task = _c.value;
12495
- _loop_1(task);
12916
+ // make group layers
12917
+ for (var layers_1 = __values(layers), layers_1_1 = layers_1.next(); !layers_1_1.done; layers_1_1 = layers_1.next()) {
12918
+ var layer = layers_1_1.value;
12919
+ this.layers[layer] = createSVG('g', {
12920
+ class: layer,
12921
+ append_to: this.$svg,
12922
+ });
12496
12923
  }
12497
12924
  }
12498
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
12925
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
12499
12926
  finally {
12500
12927
  try {
12501
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12928
+ if (layers_1_1 && !layers_1_1.done && (_a = layers_1.return)) _a.call(layers_1);
12502
12929
  }
12503
- finally { if (e_7) throw e_7.error; }
12930
+ finally { if (e_4) throw e_4.error; }
12504
12931
  }
12505
12932
  };
12506
- Gantt.prototype.map_arrows_on_bars = function () {
12507
- var e_8, _a;
12508
- var _loop_2 = function (bar) {
12509
- bar.arrows = this_2.arrows.filter(function (arrow) {
12510
- return (arrow.fromTask.task.id === bar.task.id ||
12511
- arrow.toTask.task.id === bar.task.id);
12933
+ Gantt.prototype.make_grid = function () {
12934
+ this.make_grid_background();
12935
+ this.make_grid_rows();
12936
+ this.make_grid_header();
12937
+ this.make_grid_highlights();
12938
+ this.make_grid_ticks();
12939
+ };
12940
+ Gantt.prototype.make_grid_background = function () {
12941
+ var grid_width = this.dates.length * this.options.columnWidth;
12942
+ if (this.options.containerWidth) {
12943
+ grid_width = this.options.containerWidth;
12944
+ }
12945
+ var distinct_rows = __spread(new Set(this.tasks.map(function (x) { return x._row_id; })));
12946
+ var grid_height = this.options.headerHeight +
12947
+ this.options.padding / 2 +
12948
+ (this.options.barHeight + this.options.padding) *
12949
+ distinct_rows.length;
12950
+ createSVG("rect", {
12951
+ x: 0,
12952
+ y: 0,
12953
+ width: grid_width,
12954
+ height: grid_height,
12955
+ class: "grid-background",
12956
+ append_to: this.layers.grid,
12957
+ });
12958
+ $.attr(this.$svg, {
12959
+ height: grid_height,
12960
+ width: "100%",
12961
+ }, null);
12962
+ };
12963
+ Gantt.prototype.make_grid_rows = function () {
12964
+ var _this = this;
12965
+ var rows_layer = createSVG("g", { append_to: this.layers.grid });
12966
+ var lines_layer = createSVG("g", { append_to: this.layers.grid });
12967
+ var row_width = this.dates.length * this.options.columnWidth;
12968
+ var row_height = this.options.barHeight + this.options.padding;
12969
+ //TODO: ajustar o posicionamento das linhas
12970
+ var row_y = this.options.headerHeight + this.options.padding / 2;
12971
+ this.tasks.forEach(function (_) {
12972
+ createSVG("rect", {
12973
+ x: 0,
12974
+ y: row_y,
12975
+ width: row_width,
12976
+ height: row_height,
12977
+ class: "grid-row",
12978
+ append_to: rows_layer,
12512
12979
  });
12513
- };
12514
- var this_2 = this;
12980
+ createSVG("line", {
12981
+ x1: 0,
12982
+ y1: row_y + row_height,
12983
+ x2: row_width,
12984
+ y2: row_y + row_height,
12985
+ class: "row-line",
12986
+ append_to: lines_layer,
12987
+ });
12988
+ row_y += _this.options.barHeight + _this.options.padding;
12989
+ });
12990
+ };
12991
+ Gantt.prototype.make_grid_header = function () {
12992
+ // const addIsHourView = this.isHourView ? 25 : 10
12993
+ var header_width = this.dates.length * this.options.columnWidth;
12994
+ var header_height = this.options.headerHeight + 10;
12995
+ createSVG("rect", {
12996
+ x: 0,
12997
+ y: 0,
12998
+ width: header_width,
12999
+ height: header_height,
13000
+ class: "grid-header",
13001
+ append_to: this.layers.grid,
13002
+ });
13003
+ };
13004
+ Gantt.prototype.make_grid_ticks = function () {
13005
+ var e_5, _a;
13006
+ var tick_x = 0;
13007
+ var tick_y = this.options.headerHeight + this.options.padding / 2;
13008
+ var tick_height = (this.options.barHeight + this.options.padding) *
13009
+ this.tasks.length;
12515
13010
  try {
12516
- for (var _b = __values(this.bars), _c = _b.next(); !_c.done; _c = _b.next()) {
12517
- var bar = _c.value;
12518
- _loop_2(bar);
13011
+ for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
13012
+ var date = _c.value;
13013
+ var tick_class = "tick";
13014
+ if (this.view_is(ViewMode.QuarterHour) && date.getHours() === 0 && date.getMinutes() === 0) {
13015
+ // thick tick for first hour of day.
13016
+ tick_class += " thick";
13017
+ }
13018
+ else if (this.view_is([ViewMode.Hour, ViewMode.QuarterDay, ViewMode.HalfDay]) && date.getHours() === 0) {
13019
+ // thick tick for first hour of day.
13020
+ tick_class += " thick";
13021
+ }
13022
+ else if (this.view_is(ViewMode.Day) && date.getDate() === 1) {
13023
+ // thick tick for monday
13024
+ tick_class += " thick";
13025
+ }
13026
+ else if (this.view_is(ViewMode.Week) && date.getDate() >= 1 && date.getDate() < 8) {
13027
+ // thick tick for first week
13028
+ tick_class += " thick";
13029
+ }
13030
+ else if (this.view_is(ViewMode.Month) && date.getMonth() % 3 === 0) {
13031
+ // thick ticks for quarters
13032
+ tick_class += " thick";
13033
+ }
13034
+ createSVG("path", {
13035
+ d: "M " + tick_x + " " + tick_y + " v " + tick_height,
13036
+ class: tick_class,
13037
+ append_to: this.layers.grid,
13038
+ });
13039
+ if (this.view_is(ViewMode.Month)) {
13040
+ tick_x +=
13041
+ (DateUtils.getDaysInMonth(date) *
13042
+ this.options.columnWidth) /
13043
+ 30;
13044
+ }
13045
+ else {
13046
+ tick_x += this.options.columnWidth;
13047
+ }
12519
13048
  }
12520
13049
  }
12521
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
13050
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
12522
13051
  finally {
12523
13052
  try {
12524
13053
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12525
13054
  }
12526
- finally { if (e_8) throw e_8.error; }
12527
- }
12528
- };
12529
- Gantt.prototype.set_width = function () {
12530
- var cur_width = this.$svg.getBoundingClientRect().width;
12531
- var actual_width = this.$svg
12532
- .querySelector(".grid .grid-row")
12533
- .getAttribute("width");
12534
- if (cur_width < actual_width) {
12535
- this.$svg.setAttribute("width", actual_width);
13055
+ finally { if (e_5) throw e_5.error; }
12536
13056
  }
12537
13057
  };
12538
- Gantt.prototype.set_scroll_position = function () {
12539
- var parent_element = this.$svg.parentElement;
12540
- if (!parent_element)
12541
- return;
12542
- var hours_before_first_task = DateUtils.diff(this.get_oldest_starting_date(), this.minDate, "hour");
12543
- var scroll_pos = (hours_before_first_task / this.options.step) *
12544
- this.options.columnWidth -
12545
- this.options.columnWidth;
12546
- parent_element.scrollLeft = scroll_pos;
12547
- };
12548
- Gantt.prototype.bind_grid_click = function () {
12549
- var _this = this;
12550
- $.on(this.$svg, this.options.popupTrigger, ".grid-row, .grid-header", function () {
12551
- _this.unselect_all();
12552
- _this.hide_popup();
12553
- });
12554
- };
12555
- Gantt.prototype.bind_bar_events = function () {
12556
- var _this = this;
12557
- var is_dragging = false;
12558
- var x_on_start = 0;
12559
- var is_resizing_left = false;
12560
- var is_resizing_right = false;
12561
- var parent_bar_id = null;
12562
- var bars = [];
12563
- this.bar_being_dragged = null;
12564
- function action_in_progress() {
12565
- return is_dragging || is_resizing_left || is_resizing_right;
12566
- }
12567
- $.on(this.$svg, "mousedown", ".bar-wrapper, .handle", function (e, element) {
12568
- var bar_wrapper = $.closest(".bar-wrapper", element);
12569
- if (element.classList.contains("left")) {
12570
- is_resizing_left = true;
12571
- }
12572
- else if (element.classList.contains("right")) {
12573
- is_resizing_right = true;
12574
- }
12575
- else if (element.classList.contains("bar-wrapper") && _this.options.allowMovement) {
12576
- is_dragging = true;
12577
- }
12578
- bar_wrapper.classList.add("active");
12579
- x_on_start = e.offsetX;
12580
- parent_bar_id = bar_wrapper.getAttribute("data-id");
12581
- var ids = __spread([
12582
- parent_bar_id
12583
- ], _this.get_all_dependent_tasks(parent_bar_id));
12584
- bars = ids.map(function (id) { return _this.get_bar(id); });
12585
- _this.bar_being_dragged = parent_bar_id;
12586
- bars.forEach(function (bar) {
12587
- var $bar = bar.element;
12588
- $bar.ox = $bar.getX();
12589
- $bar.oy = $bar.getY();
12590
- $bar.owidth = $bar.getWidth();
12591
- $bar.finaldx = 0;
12592
- });
12593
- });
12594
- $.on(this.$svg, "mousemove", function (e) {
12595
- if (!action_in_progress()) {
12596
- return;
12597
- }
12598
- var dx = e.offsetX - x_on_start;
12599
- bars.forEach(function (bar) {
12600
- var $bar = bar.element;
12601
- $bar.finaldx = _this.get_snap_position(dx);
12602
- _this.hide_popup();
12603
- if (is_resizing_left) {
12604
- if (parent_bar_id === bar.task.id) {
12605
- bar.updateBarPosition({
12606
- x: $bar.ox + $bar.finaldx,
12607
- width: $bar.owidth - $bar.finaldx,
12608
- });
13058
+ Gantt.prototype.make_grid_highlights = function () {
13059
+ var e_6, _a;
13060
+ if (this.view_is(ViewMode.Day)) {
13061
+ var width = this.options.columnWidth;
13062
+ var height = (this.options.barHeight + this.options.padding) *
13063
+ this.tasks.length +
13064
+ this.options.headerHeight +
13065
+ this.options.padding / 2;
13066
+ var x = 0;
13067
+ try {
13068
+ for (var _b = __values(this.dates), _c = _b.next(); !_c.done; _c = _b.next()) {
13069
+ var date = _c.value;
13070
+ var y = (this.options.headerHeight + this.options.padding) / 2;
13071
+ var isToday = date == DateUtils.today();
13072
+ var isWeekend = (date.getDay() == 0 || date.getDay() == 6);
13073
+ var className = void 0;
13074
+ if (isToday) {
13075
+ className = "today-highlight";
13076
+ y = (this.options.headerHeight + this.options.padding) / 2;
12609
13077
  }
12610
- else {
12611
- bar.updateBarPosition({
12612
- x: $bar.ox + $bar.finaldx,
12613
- });
13078
+ else if (isWeekend) {
13079
+ className = "weekend-highlight";
12614
13080
  }
12615
- }
12616
- else if (is_resizing_right) {
12617
- if (parent_bar_id === bar.task.id) {
12618
- bar.updateBarPosition({
12619
- width: $bar.owidth + $bar.finaldx,
13081
+ var rx = 3;
13082
+ var ry = 3;
13083
+ if (isToday || isWeekend) {
13084
+ createSVG("rect", {
13085
+ x: x,
13086
+ y: y,
13087
+ rx: rx,
13088
+ ry: ry,
13089
+ width: width,
13090
+ height: height,
13091
+ class: className,
13092
+ append_to: this.layers.grid
12620
13093
  });
12621
13094
  }
13095
+ x += this.options.columnWidth;
12622
13096
  }
12623
- else if (is_dragging) {
12624
- bar.updateBarPosition({ x: $bar.ox + $bar.finaldx });
13097
+ }
13098
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
13099
+ finally {
13100
+ try {
13101
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
12625
13102
  }
12626
- });
12627
- }, null);
12628
- document.addEventListener("mouseup", function (e) {
12629
- if (is_dragging || is_resizing_left || is_resizing_right || !_this.options.allowMovement) {
12630
- bars.forEach(function (bar) { return bar.group.classList.remove("active"); });
13103
+ finally { if (e_6) throw e_6.error; }
12631
13104
  }
12632
- is_dragging = false;
12633
- is_resizing_left = false;
12634
- is_resizing_right = false;
12635
- });
12636
- $.on(this.$svg, "mouseup", function (e) {
12637
- _this.bar_being_dragged = null;
12638
- bars.forEach(function (bar) {
12639
- var $bar = bar.element;
12640
- if (!$bar.finaldx)
12641
- return;
12642
- bar.dateChanged();
12643
- bar.setActionCompleted();
12644
- });
12645
- }, null);
12646
- };
12647
- Gantt.prototype.get_all_dependent_tasks = function (task_id) {
12648
- var _this = this;
12649
- var out = [];
12650
- var to_process = [task_id];
12651
- while (to_process.length) {
12652
- var deps = to_process.reduce(function (acc, curr) {
12653
- acc = acc.concat(_this.dependency_map[curr]);
12654
- return acc;
12655
- }, []);
12656
- out = out.concat(deps);
12657
- to_process = deps.filter(function (d) { return !to_process.includes(d); });
12658
13105
  }
12659
- return out.filter(Boolean);
12660
13106
  };
12661
- Gantt.prototype.get_snap_position = function (dx) {
12662
- var odx = dx, rem, position;
12663
- if (this.view_is(ViewMode.Hour)) {
12664
- rem = dx % (this.options.columnWidth / 6);
12665
- position = odx - rem + (rem < this.options.columnWidth / 12 ? 0 : this.options.columnWidth / 6);
12666
- }
12667
- else if (this.view_is(ViewMode.Week)) {
12668
- rem = dx % (this.options.columnWidth / 7);
12669
- position = odx - rem + (rem < this.options.columnWidth / 14 ? 0 : this.options.columnWidth / 7);
12670
- }
12671
- else if (this.view_is(ViewMode.Month)) {
12672
- rem = dx % (this.options.columnWidth / 30);
12673
- position = odx - rem + (rem < this.options.columnWidth / 60 ? 0 : this.options.columnWidth / 30);
12674
- }
12675
- else {
12676
- rem = dx % this.options.columnWidth;
12677
- position = odx - rem + (rem < this.options.columnWidth / 2 ? 0 : this.options.columnWidth);
13107
+ Gantt.prototype.make_dates = function () {
13108
+ var dates = this.get_dates_to_draw();
13109
+ for (var i = 0; i < dates.length; i++) {
13110
+ var date = dates[i];
13111
+ createSVG("text", {
13112
+ x: date.lower_x,
13113
+ y: date.lower_y + 20,
13114
+ innerHTML: date.lower_text,
13115
+ class: "title-2",
13116
+ append_to: this.layers.date,
13117
+ });
13118
+ if (date.middle_text) {
13119
+ createSVG("text", {
13120
+ x: date.middle_x,
13121
+ y: date.middle_y,
13122
+ innerHTML: date.middle_text,
13123
+ class: "middle-text",
13124
+ append_to: this.layers.date,
13125
+ });
13126
+ }
13127
+ if (date.upper_text) {
13128
+ var $upper_text = createSVG("text", {
13129
+ x: date.upper_x,
13130
+ y: date.upper_y,
13131
+ innerHTML: date.upper_text,
13132
+ class: "upper-text",
13133
+ append_to: this.layers.date,
13134
+ });
13135
+ // remove out-of-bound dates
13136
+ if ($upper_text.getBBox().x2 > this.layers.grid.getBBox().width) {
13137
+ $upper_text.remove();
13138
+ }
13139
+ }
12678
13140
  }
12679
- return position;
12680
- };
12681
- Gantt.prototype.unselect_all = function () {
12682
- __spread(this.$svg.querySelectorAll(".bar-wrapper")).forEach(function (el) {
12683
- el.classList.remove("active");
12684
- });
12685
13141
  };
12686
- Gantt.prototype.view_is = function (modes) {
13142
+ Gantt.prototype.get_dates_to_draw = function () {
12687
13143
  var _this = this;
12688
- if (Array.isArray(modes)) {
12689
- return modes.some(function (mode) { return _this.options.viewMode === mode; });
12690
- }
12691
- return this.options.viewMode === modes;
12692
- };
12693
- Gantt.prototype.get_task = function (id) {
12694
- return this.tasks.find(function (task) {
12695
- return task.id === id;
12696
- });
12697
- };
12698
- Gantt.prototype.get_bar = function (id) {
12699
- return this.bars.find(function (bar) {
12700
- return bar.task.id === id;
13144
+ var last_date = null;
13145
+ var dates = this.dates.map(function (date, i) {
13146
+ var d = _this.get_date_info(date, last_date, i);
13147
+ last_date = date;
13148
+ return d;
12701
13149
  });
13150
+ return dates;
12702
13151
  };
12703
- Gantt.prototype.show_popup = function (options) {
12704
- if (!this.popup) {
12705
- this.popup = new Popup(this.popup_wrapper, this.options.customPopupHtml);
12706
- }
12707
- this.popup.show(options);
12708
- };
12709
- Gantt.prototype.hide_popup = function () {
12710
- this.popup && this.popup.hide();
12711
- };
12712
- Gantt.prototype.trigger_event = function (event, args) {
12713
- if (this.options[event]) {
12714
- this.options[event].apply(null, args);
13152
+ Gantt.prototype.get_date_info = function (date, last_date, i) {
13153
+ if (!last_date) {
13154
+ last_date = DateUtils.add(date, 1, "year");
12715
13155
  }
13156
+ var date_text = {
13157
+ // quarter hour
13158
+ quarterHourUpper: date.getDate() !== last_date.getDate()
13159
+ ? DateUtils.format(date, "D MMM", this.options.language)
13160
+ : "",
13161
+ quarterHourLower: DateUtils.format(date, "HH:mm", this.options.language),
13162
+ // hour
13163
+ hourUpper: date.getDate() !== last_date.getDate()
13164
+ ? DateUtils.format(date, "D MMM", this.options.language)
13165
+ : "",
13166
+ hourLower: DateUtils.format(date, "HH:mm", this.options.language),
13167
+ // quarter day
13168
+ quarterDayUpper: date.getDate() !== last_date.getDate()
13169
+ ? DateUtils.format(date, "D MMM", this.options.language)
13170
+ : "",
13171
+ quarterDayLower: DateUtils.format(date, "HH:mm", this.options.language),
13172
+ // half day
13173
+ halfDayUpper: (date.getDate() !== last_date.getDate())
13174
+ ? (((date.getMonth() !== last_date.getMonth()) || i < 2)
13175
+ ? DateUtils.format(date, "D MMM", this.options.language)
13176
+ : DateUtils.format(date, "D", this.options.language))
13177
+ : "",
13178
+ halfDayLower: DateUtils.format(date, "HH:mm", this.options.language),
13179
+ // day
13180
+ dayUpper: ((date.getMonth() !== last_date.getMonth()) || i === 0)
13181
+ ? DateUtils.format(date, "MMMM", this.options.language)
13182
+ : "",
13183
+ dayMiddle: DateUtils.format(date, "ddd", this.options.language),
13184
+ dayLower: DateUtils.format(date, "D", this.options.language),
13185
+ // week
13186
+ weekUpper: date.getMonth() !== last_date.getMonth()
13187
+ ? DateUtils.format(date, "MMMM", this.options.language)
13188
+ : "",
13189
+ weekLower: date.getMonth() !== last_date.getMonth()
13190
+ ? DateUtils.format(date, "D MMM", this.options.language)
13191
+ : DateUtils.format(date, "D", this.options.language),
13192
+ // month
13193
+ monthUpper: date.getFullYear() !== last_date.getFullYear()
13194
+ ? DateUtils.format(date, "YYYY", this.options.language)
13195
+ : "",
13196
+ monthLower: DateUtils.format(date, "MMMM", this.options.language),
13197
+ // year
13198
+ yearUpper: date.getFullYear() !== last_date.getFullYear()
13199
+ ? DateUtils.format(date, "YYYY", this.options.language)
13200
+ : "",
13201
+ yearLower: DateUtils.format(date, "YYYY", this.options.language),
13202
+ };
13203
+ // Descontando 20 para adcionar uma segunda linha de informação no cabeçalho
13204
+ var base_pos = {
13205
+ x: i * this.options.columnWidth,
13206
+ upper_y: this.options.headerHeight - 20 - 25,
13207
+ middle_y: this.options.headerHeight - 20,
13208
+ lower_y: this.options.headerHeight - 20,
13209
+ };
13210
+ var x_pos = {
13211
+ quarterHourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
13212
+ quarterHourMiddle: this.options.columnWidth / 2,
13213
+ quarterHourLower: this.options.columnWidth / 2,
13214
+ hourUpper: (this.dates.length < 14) ? (this.options.columnWidth) : (this.options.columnWidth * 24 / 2),
13215
+ hourMiddle: this.options.columnWidth / 2,
13216
+ hourLower: this.options.columnWidth / 2,
13217
+ quarterDayUpper: this.options.columnWidth * 4 / 2,
13218
+ quarterDayMiddle: this.options.columnWidth / 2,
13219
+ quarterDayLower: this.options.columnWidth / 2,
13220
+ halfDayUpper: this.options.columnWidth * 2 / 2,
13221
+ halfDayMiddle: this.options.columnWidth / 2,
13222
+ halfDayLower: this.options.columnWidth / 2,
13223
+ dayUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 30) / 2),
13224
+ dayMiddle: this.options.columnWidth / 2 - 12,
13225
+ dayLower: this.options.columnWidth / 2,
13226
+ weekUpper: (this.options.columnWidth * 4) / 2,
13227
+ weekMiddle: 0,
13228
+ weekLower: 0,
13229
+ monthUpper: (this.dates.length < 15) ? (this.options.columnWidth) : ((this.options.columnWidth * 12) / 2),
13230
+ monthMiddle: 0,
13231
+ monthLower: this.options.columnWidth / 2,
13232
+ yearUpper: (this.options.columnWidth * 30) / 2,
13233
+ yearMiddle: this.options.columnWidth / 2,
13234
+ yearLower: this.options.columnWidth / 2,
13235
+ };
13236
+ return {
13237
+ upper_text: date_text[this.options.viewMode + "Upper"],
13238
+ middle_text: date_text[this.options.viewMode + "Middle"],
13239
+ lower_text: date_text[this.options.viewMode + "Lower"],
13240
+ upper_x: base_pos.x + x_pos[this.options.viewMode + "Upper"],
13241
+ upper_y: base_pos.upper_y,
13242
+ middle_x: base_pos.x + x_pos[this.options.viewMode + "Middle"],
13243
+ middle_y: base_pos.middle_y,
13244
+ lower_x: base_pos.x + x_pos[this.options.viewMode + "Lower"],
13245
+ lower_y: base_pos.lower_y,
13246
+ date: date,
13247
+ };
12716
13248
  };
12717
- Gantt.prototype.get_oldest_starting_date = function () {
12718
- return this.tasks
12719
- .map(function (task) { return task._start; })
12720
- .reduce(function (prev_date, cur_date) {
12721
- return cur_date <= prev_date ? cur_date : prev_date;
12722
- });
12723
- };
12724
- Gantt.prototype.clear = function () {
12725
- this.$svg.innerHTML = '';
12726
- };
12727
- return Gantt;
12728
- }());
12729
- function generate_id(task) {
12730
- return task.name + "_" + Math.random().toString(36).slice(2, 12);
12731
- }
12732
-
12733
- var GanttComponent = /** @class */ (function () {
12734
- function GanttComponent() {
12735
- this.multipleTaskPerLine = false;
12736
- this.showSideTable = true;
12737
- this.viewMode = ViewMode.Day;
12738
- this.allowMovement = true;
12739
- this.hasPopup = true;
12740
- this.fullWidth = false;
12741
- this.showOnlyHours = false;
12742
- this.showOnlyDays = false;
12743
- this.taskClicked = new EventEmitter();
12744
- this.taskDateChanged = new EventEmitter();
12745
- this.viewChanged = new EventEmitter();
12746
- }
12747
- GanttComponent.prototype.ngOnInit = function () {
12748
- this._validateViewMode();
12749
- this._validateTasks();
12750
- };
12751
- GanttComponent.prototype.ngAfterViewInit = function () {
13249
+ Gantt.prototype.make_bars = function () {
12752
13250
  var _this = this;
12753
- if (this.fullWidth) {
12754
- this.containerWidth = this.outer.nativeElement.offsetWidth - this.side.nativeElement.offsetWidth;
12755
- }
12756
- this._gantt = new Gantt("#gantt", this._filterTask(this.tasks), {
12757
- viewMode: this.viewMode,
12758
- marginBeforeStart: this.marginBeforeStart,
12759
- marginAfterEnd: this.marginAfterEnd,
12760
- language: "pt-br",
12761
- allowMovement: this.allowMovement,
12762
- hasPopup: this.hasPopup,
12763
- containerWidth: this.containerWidth,
12764
- showOnlyHours: this.showOnlyHours,
12765
- showOnlyDays: this.showOnlyDays,
12766
- onClick: function (task) { return _this.taskClicked.emit(task); },
12767
- onDateChange: function (task, start, end) { return _this.taskDateChanged.emit({ task: task, start: start, end: end }); },
12768
- onViewChange: function (viewMode) { return _this.viewChanged.emit(viewMode); },
13251
+ this.bars = this.tasks.map(function (task) {
13252
+ var bar = new Bar(_this, task);
13253
+ _this.layers.bar.appendChild(bar.group);
13254
+ return bar;
12769
13255
  });
12770
13256
  };
12771
- GanttComponent.prototype.ngOnChanges = function (changes) {
12772
- if (!this._gantt) {
12773
- return;
12774
- }
12775
- if (changes.viewMode) {
12776
- this._gantt.options.viewMode = changes.viewMode.currentValue;
12777
- this._gantt.change_view_mode();
13257
+ Gantt.prototype.make_arrows = function () {
13258
+ var e_7, _a;
13259
+ var _this = this;
13260
+ this.arrows = [];
13261
+ var _loop_1 = function (task) {
13262
+ var arrows = [];
13263
+ arrows = task.dependencies
13264
+ .map(function (task_id) {
13265
+ var dependency = _this.get_task(task_id);
13266
+ if (!dependency)
13267
+ return;
13268
+ var arrow = new Arrow(_this, _this.bars[dependency._index], // from_task
13269
+ _this.bars[task._index] // to_task
13270
+ );
13271
+ _this.layers.arrow.appendChild(arrow.element);
13272
+ return arrow;
13273
+ })
13274
+ .filter(Boolean); // filter falsy values
13275
+ this_1.arrows = this_1.arrows.concat(arrows);
13276
+ };
13277
+ var this_1 = this;
13278
+ try {
13279
+ for (var _b = __values(this.tasks), _c = _b.next(); !_c.done; _c = _b.next()) {
13280
+ var task = _c.value;
13281
+ _loop_1(task);
13282
+ }
12778
13283
  }
12779
- if (changes.tasks) {
12780
- this._gantt.refresh(this._filterTask(changes.tasks.currentValue));
13284
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
13285
+ finally {
13286
+ try {
13287
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
13288
+ }
13289
+ finally { if (e_7) throw e_7.error; }
12781
13290
  }
12782
13291
  };
12783
- GanttComponent.prototype._filterTask = function (tasksGroups) {
12784
- var tasks = [];
12785
- if (this.multipleTaskPerLine) {
12786
- tasksGroups.forEach(function (group, index) {
12787
- tasks.push.apply(tasks, __spread(group.tasks.map(function (task) {
12788
- return __assign(__assign({}, task), { _row_id: index });
12789
- })));
12790
- }, []);
13292
+ Gantt.prototype.map_arrows_on_bars = function () {
13293
+ var e_8, _a;
13294
+ var _loop_2 = function (bar) {
13295
+ bar.arrows = this_2.arrows.filter(function (arrow) {
13296
+ return (arrow.fromTask.task.id === bar.task.id ||
13297
+ arrow.toTask.task.id === bar.task.id);
13298
+ });
13299
+ };
13300
+ var this_2 = this;
13301
+ try {
13302
+ for (var _b = __values(this.bars), _c = _b.next(); !_c.done; _c = _b.next()) {
13303
+ var bar = _c.value;
13304
+ _loop_2(bar);
13305
+ }
12791
13306
  }
12792
- else {
12793
- var i_1 = 0;
12794
- tasksGroups.forEach(function (group) {
12795
- tasks.push.apply(tasks, __spread(group.tasks.map(function (task) {
12796
- return __assign(__assign({}, task), { _row_id: i_1++ });
12797
- })));
12798
- }, []);
13307
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
13308
+ finally {
13309
+ try {
13310
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
13311
+ }
13312
+ finally { if (e_8) throw e_8.error; }
12799
13313
  }
12800
- return tasks;
12801
13314
  };
12802
- GanttComponent.prototype._validateViewMode = function () {
12803
- if (![
12804
- ViewMode.QuarterHour,
12805
- ViewMode.Hour,
12806
- ViewMode.QuarterDay,
12807
- ViewMode.HalfDay,
12808
- ViewMode.Day,
12809
- ViewMode.Week,
12810
- ViewMode.Month,
12811
- ViewMode.Year,
12812
- ].includes(this.viewMode)) {
12813
- throw new Error("Invalid gantt view mode");
13315
+ Gantt.prototype.set_width = function () {
13316
+ var cur_width = this.$svg.getBoundingClientRect().width;
13317
+ var actual_width = this.$svg
13318
+ .querySelector(".grid .grid-row")
13319
+ .getAttribute("width");
13320
+ if (cur_width < actual_width) {
13321
+ this.$svg.setAttribute("width", actual_width);
12814
13322
  }
12815
13323
  };
12816
- GanttComponent.prototype._validateTasks = function () {
12817
- this.tasks.forEach(function (group) {
12818
- group.tasks.forEach(function (task) {
12819
- if (task.start > task.end) {
12820
- throw new Error("invalid task. The start date must be less than the end date.");
12821
- }
12822
- });
12823
- });
12824
- };
12825
- __decorate([
12826
- Input()
12827
- ], GanttComponent.prototype, "columnTitle", void 0);
12828
- __decorate([
12829
- Input()
12830
- ], GanttComponent.prototype, "multipleTaskPerLine", void 0);
12831
- __decorate([
12832
- Input()
12833
- ], GanttComponent.prototype, "showSideTable", void 0);
12834
- __decorate([
12835
- Input()
12836
- ], GanttComponent.prototype, "viewMode", void 0);
12837
- __decorate([
12838
- Input()
12839
- ], GanttComponent.prototype, "tasks", void 0);
12840
- __decorate([
12841
- Input()
12842
- ], GanttComponent.prototype, "marginBeforeStart", void 0);
12843
- __decorate([
12844
- Input()
12845
- ], GanttComponent.prototype, "marginAfterEnd", void 0);
12846
- __decorate([
12847
- Input()
12848
- ], GanttComponent.prototype, "allowMovement", void 0);
12849
- __decorate([
12850
- Input()
12851
- ], GanttComponent.prototype, "hasPopup", void 0);
12852
- __decorate([
12853
- Input()
12854
- ], GanttComponent.prototype, "containerWidth", void 0);
12855
- __decorate([
12856
- Input()
12857
- ], GanttComponent.prototype, "fullWidth", void 0);
12858
- __decorate([
12859
- Input()
12860
- ], GanttComponent.prototype, "showOnlyHours", void 0);
12861
- __decorate([
12862
- Input()
12863
- ], GanttComponent.prototype, "showOnlyDays", void 0);
12864
- __decorate([
12865
- Output()
12866
- ], GanttComponent.prototype, "taskClicked", void 0);
12867
- __decorate([
12868
- Output()
12869
- ], GanttComponent.prototype, "taskDateChanged", void 0);
12870
- __decorate([
12871
- Output()
12872
- ], GanttComponent.prototype, "viewChanged", void 0);
12873
- __decorate([
12874
- ViewChild('outer')
12875
- ], GanttComponent.prototype, "outer", void 0);
12876
- __decorate([
12877
- ViewChild('side')
12878
- ], GanttComponent.prototype, "side", void 0);
12879
- GanttComponent = __decorate([
12880
- Component({
12881
- selector: "s-gantt",
12882
- template: "<div class=\"outer\" #outer>\n <div #side>\n <gantt-side-table\n *ngIf=\"showSideTable\"\n [tasks]=\"tasks\"\n [columnTitle]=\"columnTitle\"\n [multipleTaskPerLine]=\"multipleTaskPerLine\">\n </gantt-side-table>\n </div>\n <svg id=\"gantt\"></svg>\n</div>\n",
12883
- encapsulation: ViewEncapsulation.None,
12884
- styles: [".outer{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:center;align-content:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row}", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(even){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.4}.gantt .tick.thick{stroke:#428bca;stroke-width:2}.gantt .today-highlight{fill:#ffe979;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{opacity:.8;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-dasharray:5;stroke-width:1}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .bar-wrapper{cursor:pointer;outline:0}.gantt .bar-wrapper.active .bar,.gantt .bar-wrapper:hover .bar{opacity:1}.gantt .bar-wrapper.active .bar{stroke:#212533;stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{border-left:1px solid #e0e0e0;font-size:12px;overflow:auto;position:relative}.gantt-container .title-1{fill:#999;font-size:12px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .title-2{fill:#333;font-size:14px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .popup-wrapper{left:0;position:absolute;top:0}.gantt-container .popup-wrapper .popup{background:#0e1119;border-radius:2px;color:#fff;padding:8px;font-family:\"Open Sans\" sans-serif;line-height:150%;font-weight:400}.gantt-container .popup-wrapper .popup .wrp-title{border-bottom:1px solid #525966;padding-bottom:10px}.gantt-container .popup-wrapper .popup .wrp-title .title{font-size:14px}.gantt-container .popup-wrapper .popup .wrp-subtitle{color:#dfe2e5;padding-top:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.gantt-container .popup-wrapper .popup .wrp-subtitle .icon{margin-right:10px}.gantt-container .popup-wrapper .popup .wrp-subtitle .subtitle{font-size:12px}.gantt-container .popup-wrapper .popup .pointer{border:6px solid transparent;border-top-color:#0e1119;height:6px;margin-left:-4px;position:absolute}"]
12885
- })
12886
- ], GanttComponent);
12887
- return GanttComponent;
12888
- }());
12889
-
12890
- var SideTableComponent = /** @class */ (function () {
12891
- function SideTableComponent() {
12892
- this.ROW_HEIGHT = 44;
12893
- this.multipleTaskPerLine = false;
12894
- }
12895
- SideTableComponent.prototype.ngOnInit = function () {
12896
- this._removeEmptyTasks();
12897
- };
12898
- SideTableComponent.prototype._removeEmptyTasks = function () {
12899
- this.tasks = this.tasks.filter(function (task) { return task.tasks.length; });
12900
- };
12901
- __decorate([
12902
- Input()
12903
- ], SideTableComponent.prototype, "columnTitle", void 0);
12904
- __decorate([
12905
- Input()
12906
- ], SideTableComponent.prototype, "tasks", void 0);
12907
- __decorate([
12908
- Input()
12909
- ], SideTableComponent.prototype, "multipleTaskPerLine", void 0);
12910
- SideTableComponent = __decorate([
12911
- Component({
12912
- selector: 'gantt-side-table',
12913
- template: "<div class=\"side-table\">\n <div class=\"column-title\">\n <span>{{ columnTitle }}</span>\n </div>\n <div class=\"tasks\" >\n <div\n *ngFor=\"let task of tasks; let i = index\"\n class=\"task\"\n [ngStyle]=\"{'height.px': multipleTaskPerLine\n ? ROW_HEIGHT\n : ROW_HEIGHT * task.tasks.length}\"\n [sTooltip]=\"task.title.length > 20 || task.subtitle.length > 20 ? '<span><strong>' + task.title + ' </strong></br><span> ' + task.subtitle + ' </span></span>' : '' \"\n [escape]=\"false\">\n <div class=\"title\">\n {{ task.title }}\n </div>\n <div class=\"subtitle\">\n {{ task.subtitle }}\n </div>\n </div>\n </div>\n</div>\n",
12914
- styles: [".side-table{background:#fff;height:100%;min-width:175px}.side-table .column-title{height:106px;border:1px solid #e0e0e0;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center;padding:8px}.side-table .column-title span{font-family:\"Open Sans\" sans-serif;font-size:14px;font-weight:700;line-height:150%}.side-table .task{-ms-flex-align:center;align-items:center;background-color:#fff;border:1px solid #e0e0e0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:\"Open Sans\",sans-serif;font-weight:400;-ms-flex-pack:center;justify-content:center;line-height:150%;padding:0 5px}.side-table .task .title{color:#333;font-size:14px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.side-table .task .subtitle{color:#999;font-size:12px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]
12915
- })
12916
- ], SideTableComponent);
12917
- return SideTableComponent;
12918
- }());
12919
-
12920
- var GanttModule = /** @class */ (function () {
12921
- function GanttModule() {
12922
- }
12923
- GanttModule = __decorate([
12924
- NgModule({
12925
- imports: [CommonModule, TooltipModule],
12926
- declarations: [
12927
- GanttComponent,
12928
- SideTableComponent,
12929
- ],
12930
- exports: [GanttComponent],
12931
- })
12932
- ], GanttModule);
12933
- return GanttModule;
12934
- }());
12935
-
12936
- var ThumbnailSize;
12937
- (function (ThumbnailSize) {
12938
- ThumbnailSize["Small"] = "small";
12939
- ThumbnailSize["Medium"] = "medium";
12940
- ThumbnailSize["Large"] = "large";
12941
- })(ThumbnailSize || (ThumbnailSize = {}));
12942
-
12943
- var ThumbnailService = /** @class */ (function () {
12944
- function ThumbnailService() {
12945
- }
12946
- ThumbnailService.prototype.getBinaryFile = function (img) {
13324
+ Gantt.prototype.set_scroll_position = function () {
13325
+ var parent_element = this.$svg.parentElement;
13326
+ if (!parent_element)
13327
+ return;
13328
+ var hours_before_first_task = DateUtils.diff(this.get_oldest_starting_date(), this.minDate, "hour");
13329
+ var scroll_pos = (hours_before_first_task / this.options.step) *
13330
+ this.options.columnWidth -
13331
+ this.options.columnWidth;
13332
+ parent_element.scrollLeft = scroll_pos;
13333
+ };
13334
+ Gantt.prototype.bind_grid_click = function () {
12947
13335
  var _this = this;
12948
- return new Promise(function (resolve) {
12949
- var getOrientation = _this.getOrientation.bind(_this);
12950
- var http = new XMLHttpRequest();
12951
- http.addEventListener("load", function () {
12952
- if (http.readyState === 4 && (http.status == 200 || http.status === 0)) {
12953
- var orientation_1 = getOrientation(http.response);
12954
- http = null;
12955
- resolve(orientation_1);
12956
- }
12957
- });
12958
- http.addEventListener("error", function () {
12959
- http = null;
12960
- throw new Error("Não foi possível carregar a imagem");
12961
- });
12962
- http.open("GET", img.src, true);
12963
- http.responseType = "arraybuffer";
12964
- http.send(null);
13336
+ $.on(this.$svg, this.options.popupTrigger, ".grid-row, .grid-header", function () {
13337
+ _this.unselect_all();
13338
+ _this.hide_popup();
12965
13339
  });
12966
13340
  };
12967
- /**
12968
- * Retorna a tag da orientação EXIF {-1} Não definido, {-2} Não é formato JPEG, {1, 2, 3, 4, 5, 6, 7, 8} valores da orientação.
12969
- */
12970
- ThumbnailService.prototype.getOrientation = function (file) {
12971
- var view = new DataView(file);
12972
- if (view.getUint16(0, false) != 0xffd8)
12973
- return -2; // not jpeg
12974
- var length = view.byteLength;
12975
- var offset = 2;
12976
- while (offset < length) {
12977
- var marker = view.getUint16(offset, false);
12978
- offset += 2;
12979
- if (marker == 0xffe1) {
12980
- if (view.getUint32((offset += 2), false) != 0x45786966) {
12981
- return -1; // not defined
13341
+ Gantt.prototype.bind_bar_events = function () {
13342
+ var _this = this;
13343
+ var is_dragging = false;
13344
+ var x_on_start = 0;
13345
+ var is_resizing_left = false;
13346
+ var is_resizing_right = false;
13347
+ var parent_bar_id = null;
13348
+ var bars = [];
13349
+ this.bar_being_dragged = null;
13350
+ function action_in_progress() {
13351
+ return is_dragging || is_resizing_left || is_resizing_right;
13352
+ }
13353
+ $.on(this.$svg, "mousedown", ".bar-wrapper, .handle", function (e, element) {
13354
+ var bar_wrapper = $.closest(".bar-wrapper", element);
13355
+ if (element.classList.contains("left")) {
13356
+ is_resizing_left = true;
13357
+ }
13358
+ else if (element.classList.contains("right")) {
13359
+ is_resizing_right = true;
13360
+ }
13361
+ else if (element.classList.contains("bar-wrapper") && _this.options.allowMovement) {
13362
+ is_dragging = true;
13363
+ }
13364
+ bar_wrapper.classList.add("active");
13365
+ x_on_start = e.offsetX;
13366
+ parent_bar_id = bar_wrapper.getAttribute("data-id");
13367
+ var ids = __spread([
13368
+ parent_bar_id
13369
+ ], _this.get_all_dependent_tasks(parent_bar_id));
13370
+ bars = ids.map(function (id) { return _this.get_bar(id); });
13371
+ _this.bar_being_dragged = parent_bar_id;
13372
+ bars.forEach(function (bar) {
13373
+ var $bar = bar.element;
13374
+ $bar.ox = $bar.getX();
13375
+ $bar.oy = $bar.getY();
13376
+ $bar.owidth = $bar.getWidth();
13377
+ $bar.finaldx = 0;
13378
+ });
13379
+ });
13380
+ $.on(this.$svg, "mousemove", function (e) {
13381
+ if (!action_in_progress()) {
13382
+ return;
13383
+ }
13384
+ var dx = e.offsetX - x_on_start;
13385
+ bars.forEach(function (bar) {
13386
+ var $bar = bar.element;
13387
+ $bar.finaldx = _this.get_snap_position(dx);
13388
+ _this.hide_popup();
13389
+ if (is_resizing_left) {
13390
+ if (parent_bar_id === bar.task.id) {
13391
+ bar.updateBarPosition({
13392
+ x: $bar.ox + $bar.finaldx,
13393
+ width: $bar.owidth - $bar.finaldx,
13394
+ });
13395
+ }
13396
+ else {
13397
+ bar.updateBarPosition({
13398
+ x: $bar.ox + $bar.finaldx,
13399
+ });
13400
+ }
12982
13401
  }
12983
- var little = view.getUint16((offset += 6), false) == 0x4949;
12984
- offset += view.getUint32(offset + 4, little);
12985
- var tags = view.getUint16(offset, little);
12986
- offset += 2;
12987
- for (var i = 0; i < tags; i++)
12988
- if (view.getUint16(offset + i * 12, little) == 0x0112)
12989
- return view.getUint16(offset + i * 12 + 8, little);
12990
- // tslint:disable-next-line: no-bitwise
13402
+ else if (is_resizing_right) {
13403
+ if (parent_bar_id === bar.task.id) {
13404
+ bar.updateBarPosition({
13405
+ width: $bar.owidth + $bar.finaldx,
13406
+ });
13407
+ }
13408
+ }
13409
+ else if (is_dragging) {
13410
+ bar.updateBarPosition({ x: $bar.ox + $bar.finaldx });
13411
+ }
13412
+ });
13413
+ }, null);
13414
+ document.addEventListener("mouseup", function (e) {
13415
+ if (is_dragging || is_resizing_left || is_resizing_right || !_this.options.allowMovement) {
13416
+ bars.forEach(function (bar) { return bar.group.classList.remove("active"); });
12991
13417
  }
12992
- else if ((marker & 0xff00) != 0xff00)
12993
- break;
12994
- else
12995
- offset += view.getUint16(offset, false);
12996
- }
12997
- return -1; // not defined
12998
- };
12999
- ThumbnailService = __decorate([
13000
- Injectable()
13001
- ], ThumbnailService);
13002
- return ThumbnailService;
13003
- }());
13004
-
13005
- var ThumbnailComponent = /** @class */ (function () {
13006
- function ThumbnailComponent(thumbnailService) {
13007
- this.thumbnailService = thumbnailService;
13008
- this.fallback = false;
13009
- this.id = "s-thumbnail-" + ThumbnailComponent_1.nextId++;
13010
- this.size = ThumbnailSize.Medium;
13011
- this.iconClass = "far fa-image";
13012
- this.hasAction = false;
13013
- this.actionIconClass = "fas fa-camera";
13014
- this.isTile = false;
13015
- this.isBrand = false;
13016
- this.ngUnsubscribe = new Subject();
13017
- }
13018
- ThumbnailComponent_1 = ThumbnailComponent;
13019
- ThumbnailComponent.prototype.ngOnDestroy = function () {
13020
- this.ngUnsubscribe.next();
13021
- this.ngUnsubscribe.complete();
13418
+ is_dragging = false;
13419
+ is_resizing_left = false;
13420
+ is_resizing_right = false;
13421
+ });
13422
+ $.on(this.$svg, "mouseup", function (e) {
13423
+ _this.bar_being_dragged = null;
13424
+ bars.forEach(function (bar) {
13425
+ var $bar = bar.element;
13426
+ if (!$bar.finaldx)
13427
+ return;
13428
+ bar.dateChanged();
13429
+ bar.setActionCompleted();
13430
+ });
13431
+ }, null);
13022
13432
  };
13023
- ThumbnailComponent.prototype.ngAfterViewInit = function () {
13433
+ Gantt.prototype.get_all_dependent_tasks = function (task_id) {
13024
13434
  var _this = this;
13025
- if (this.imgEl) {
13026
- this.imgEl.nativeElement.addEventListener("load", function () {
13027
- from(_this.thumbnailService.getBinaryFile(_this.imgEl.nativeElement))
13028
- .pipe(takeUntil(_this.ngUnsubscribe))
13029
- .subscribe(function (orientation) { return (_this.orientation = orientation); });
13030
- });
13435
+ var out = [];
13436
+ var to_process = [task_id];
13437
+ while (to_process.length) {
13438
+ var deps = to_process.reduce(function (acc, curr) {
13439
+ acc = acc.concat(_this.dependency_map[curr]);
13440
+ return acc;
13441
+ }, []);
13442
+ out = out.concat(deps);
13443
+ to_process = deps.filter(function (d) { return !to_process.includes(d); });
13031
13444
  }
13445
+ return out.filter(Boolean);
13032
13446
  };
13033
- var ThumbnailComponent_1;
13034
- ThumbnailComponent.nextId = 0;
13035
- ThumbnailComponent.ctorParameters = function () { return [
13036
- { type: ThumbnailService }
13037
- ]; };
13038
- __decorate([
13039
- ViewChild("img", { static: false })
13040
- ], ThumbnailComponent.prototype, "imgEl", void 0);
13041
- __decorate([
13042
- Input()
13043
- ], ThumbnailComponent.prototype, "id", void 0);
13044
- __decorate([
13045
- Input()
13046
- ], ThumbnailComponent.prototype, "size", void 0);
13047
- __decorate([
13048
- Input()
13049
- ], ThumbnailComponent.prototype, "imageSource", void 0);
13050
- __decorate([
13051
- Input()
13052
- ], ThumbnailComponent.prototype, "imageFallback", void 0);
13053
- __decorate([
13054
- Input()
13055
- ], ThumbnailComponent.prototype, "imageAlt", void 0);
13056
- __decorate([
13057
- Input()
13058
- ], ThumbnailComponent.prototype, "iconClass", void 0);
13059
- __decorate([
13060
- Input()
13061
- ], ThumbnailComponent.prototype, "hasAction", void 0);
13062
- __decorate([
13063
- Input()
13064
- ], ThumbnailComponent.prototype, "actionIconClass", void 0);
13065
- __decorate([
13066
- Input()
13067
- ], ThumbnailComponent.prototype, "isTile", void 0);
13068
- __decorate([
13069
- Input()
13070
- ], ThumbnailComponent.prototype, "isBrand", void 0);
13071
- ThumbnailComponent = ThumbnailComponent_1 = __decorate([
13072
- Component({
13073
- selector: "s-thumbnail",
13074
- template: "<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{size}}\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand\n }\">\n <div\n [id]=\"id + '-image-container'\"\n *ngIf=\"imageSource || imageFallback\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand\n }\">\n <img\n #img\n [id]=\"id + '-image'\"\n (error)=\"fallback = true\"\n [src]=\"imageSource\"\n [alt]=\"imageAlt\"\n *ngIf=\"!fallback\"\n [ngClass]=\"{\n 'smallThumbnail': isTile,\n 'exif-orientation-2': orientation == 2,\n 'exif-orientation-3': orientation == 3,\n 'exif-orientation-4': orientation == 4,\n 'exif-orientation-5': orientation == 5,\n 'exif-orientation-6': orientation == 6,\n 'exif-orientation-7': orientation == 7,\n 'exif-orientation-8': orientation == 8\n }\"/>\n\n <img\n #img\n [id]=\"id + '-image-fallback'\"\n (error)=\"imageFallback = undefined\"\n [src]=\"imageFallback\"\n [alt]=\"imageAlt\"\n *ngIf=\"fallback && imageFallback\"\n [ngClass]=\"{\n 'smallThumbnail': isTile,\n 'exif-orientation-2': orientation == 2,\n 'exif-orientation-3': orientation == 3,\n 'exif-orientation-4': orientation == 4,\n 'exif-orientation-5': orientation == 5,\n 'exif-orientation-6': orientation == 6,\n 'exif-orientation-7': orientation == 7,\n 'exif-orientation-8': orientation == 8\n }\"/>\n\n <i\n *ngIf=\"fallback && !imageFallback\"\n ngClass=\"far fa-image\"\n class=\"fallback-img-color\">\n </i>\n </div>\n <div\n [id]=\"id + '-action-icon-container'\"\n *ngIf=\"hasAction\"\n class=\"action-icon-container action-icon-container--{{size}}\">\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\">\n </span>\n </div>\n <div\n [id]=\"id + '-icon-container'\"\n *ngIf=\"!imageSource && !imageFallback\"\n class=\"icon-container icon-container--{{size}}\"\n [ngClass]=\"{'image-container--rounded': !isBrand}\">\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\">\n </span>\n </div>\n\n <ng-content></ng-content>\n</div>\n",
13075
- styles: [":host{display:inline-block}.thumbnail-container{color:#fff;position:relative;text-align:center}.thumbnail-container--large{font-size:50px;height:100px;width:100px}.thumbnail-container--large.thumbnail-container--brand{width:200px}.thumbnail-container--medium{font-size:40px;height:70px;width:70px}.thumbnail-container--medium.thumbnail-container--brand{width:140px}.thumbnail-container--small{font-size:22px;height:40px;width:40px}.thumbnail-container--small.thumbnail-container--brand{width:80px}.thumbnail-container--with-action{cursor:pointer}.action-icon-container{background-color:#428bca;border-radius:50%;bottom:0;position:absolute;right:0}.action-icon-container--large,.action-icon-container--medium{font-size:10pt;height:25px;padding:3px;width:25px}.action-icon-container--small{font-size:6pt;height:16px;padding:2px;width:16px}.icon-container,.image-container{-ms-flex-align:center;align-items:center;height:100%;overflow:hidden;width:100%}.icon-container--rounded,.image-container--rounded{border-radius:50%}.smallThumbnail{height:40px!important}.icon-container{background-color:#ccc;color:#fff}.icon-container--large{line-height:98px}.icon-container--medium{line-height:68px}.icon-container--small{line-height:38px}.image-container{-ms-flex-align:center;align-items:center;background-color:#ccc;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.image-container img{width:100%}.image-container img.exif-orientation-2{transform:rotateY(180deg)}.image-container img.exif-orientation-3{transform:rotate(180deg)}.image-container img.exif-orientation-4{transform:rotate(180deg) rotateY(180deg)}.image-container img.exif-orientation-5{transform:rotate(270deg) rotateY(180deg)}.image-container img.exif-orientation-6{transform:rotate(90deg)}.image-container img.exif-orientation-7{transform:rotate(90deg) rotateY(180deg)}.image-container img.exif-orientation-8{transform:rotate(270deg)}.fallback-img-color{color:#fff}"]
13076
- })
13077
- ], ThumbnailComponent);
13078
- return ThumbnailComponent;
13079
- }());
13080
-
13081
- var GlobalSearchSizeEnum;
13082
- (function (GlobalSearchSizeEnum) {
13083
- GlobalSearchSizeEnum["STANDARD"] = "STANDARD";
13084
- GlobalSearchSizeEnum["MEDIUM"] = "MEDIUM";
13085
- GlobalSearchSizeEnum["SMALL"] = "SMALL";
13086
- })(GlobalSearchSizeEnum || (GlobalSearchSizeEnum = {}));
13087
-
13088
- var GlobalSearchDropdownItemComponent = /** @class */ (function () {
13089
- function GlobalSearchDropdownItemComponent() {
13090
- this.id = "s-global-search-dropdown-item-" + GlobalSearchDropdownItemComponent_1.nextId++;
13091
- this.size = GlobalSearchSizeEnum.STANDARD;
13092
- this.buttonClick = new EventEmitter();
13093
- }
13094
- GlobalSearchDropdownItemComponent_1 = GlobalSearchDropdownItemComponent;
13095
- GlobalSearchDropdownItemComponent.prototype.isStandardSize = function () {
13096
- return this.size === GlobalSearchSizeEnum.STANDARD;
13447
+ Gantt.prototype.get_snap_position = function (dx) {
13448
+ var odx = dx, rem, position;
13449
+ if (this.view_is(ViewMode.Hour)) {
13450
+ rem = dx % (this.options.columnWidth / 6);
13451
+ position = odx - rem + (rem < this.options.columnWidth / 12 ? 0 : this.options.columnWidth / 6);
13452
+ }
13453
+ else if (this.view_is(ViewMode.Week)) {
13454
+ rem = dx % (this.options.columnWidth / 7);
13455
+ position = odx - rem + (rem < this.options.columnWidth / 14 ? 0 : this.options.columnWidth / 7);
13456
+ }
13457
+ else if (this.view_is(ViewMode.Month)) {
13458
+ rem = dx % (this.options.columnWidth / 30);
13459
+ position = odx - rem + (rem < this.options.columnWidth / 60 ? 0 : this.options.columnWidth / 30);
13460
+ }
13461
+ else {
13462
+ rem = dx % this.options.columnWidth;
13463
+ position = odx - rem + (rem < this.options.columnWidth / 2 ? 0 : this.options.columnWidth);
13464
+ }
13465
+ return position;
13097
13466
  };
13098
- GlobalSearchDropdownItemComponent.prototype.isMediumSize = function () {
13099
- return this.size === GlobalSearchSizeEnum.MEDIUM;
13467
+ Gantt.prototype.unselect_all = function () {
13468
+ __spread(this.$svg.querySelectorAll(".bar-wrapper")).forEach(function (el) {
13469
+ el.classList.remove("active");
13470
+ });
13100
13471
  };
13101
- GlobalSearchDropdownItemComponent.prototype.isSmallSize = function () {
13102
- return this.size === GlobalSearchSizeEnum.SMALL;
13472
+ Gantt.prototype.view_is = function (modes) {
13473
+ var _this = this;
13474
+ if (Array.isArray(modes)) {
13475
+ return modes.some(function (mode) { return _this.options.viewMode === mode; });
13476
+ }
13477
+ return this.options.viewMode === modes;
13103
13478
  };
13104
- GlobalSearchDropdownItemComponent.prototype.getImageSize = function () {
13105
- return this.isStandardSize() ? "medium" : "small";
13479
+ Gantt.prototype.get_task = function (id) {
13480
+ return this.tasks.find(function (task) {
13481
+ return task.id === id;
13482
+ });
13106
13483
  };
13107
- var GlobalSearchDropdownItemComponent_1;
13108
- GlobalSearchDropdownItemComponent.nextId = 0;
13109
- __decorate([
13110
- Input()
13111
- ], GlobalSearchDropdownItemComponent.prototype, "id", void 0);
13112
- __decorate([
13113
- Input()
13114
- ], GlobalSearchDropdownItemComponent.prototype, "primaryLabel", void 0);
13115
- __decorate([
13116
- Input()
13117
- ], GlobalSearchDropdownItemComponent.prototype, "secondaryEmptyLabel", void 0);
13118
- __decorate([
13119
- Input()
13120
- ], GlobalSearchDropdownItemComponent.prototype, "tertiaryEmptyLabel", void 0);
13121
- __decorate([
13122
- Input()
13123
- ], GlobalSearchDropdownItemComponent.prototype, "imageSource", void 0);
13124
- __decorate([
13125
- Input()
13126
- ], GlobalSearchDropdownItemComponent.prototype, "imageAlt", void 0);
13127
- __decorate([
13128
- Input()
13129
- ], GlobalSearchDropdownItemComponent.prototype, "iconClass", void 0);
13130
- __decorate([
13131
- Input()
13132
- ], GlobalSearchDropdownItemComponent.prototype, "secondaryLabel", void 0);
13133
- __decorate([
13134
- Input()
13135
- ], GlobalSearchDropdownItemComponent.prototype, "tertiaryLabel", void 0);
13136
- __decorate([
13137
- Input()
13138
- ], GlobalSearchDropdownItemComponent.prototype, "size", void 0);
13139
- __decorate([
13140
- Input()
13141
- ], GlobalSearchDropdownItemComponent.prototype, "template", void 0);
13142
- __decorate([
13143
- Output()
13144
- ], GlobalSearchDropdownItemComponent.prototype, "buttonClick", void 0);
13145
- __decorate([
13146
- ContentChild(ThumbnailComponent, { static: true })
13147
- ], GlobalSearchDropdownItemComponent.prototype, "thumbnailComponent", void 0);
13148
- __decorate([
13149
- ViewChild(TemplateRef, { static: true })
13150
- ], GlobalSearchDropdownItemComponent.prototype, "content", void 0);
13151
- GlobalSearchDropdownItemComponent = GlobalSearchDropdownItemComponent_1 = __decorate([
13152
- Component({
13153
- selector: "s-global-search-dropdown-item",
13154
- template: "<ng-template>\n <div class=\"{{isSmallSize() ? 'ui-g container' : 'container'}}\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail [id]=\"id + '-thumbnail'\"\n *ngIf=\"!thumbnailComponent && (imageSource || iconClass) && !isSmallSize()\" [imageSource]=\"imageSource\"\n [imageAlt]=\"imageAlt || primaryLabel\" [iconClass]=\"iconClass\" [size]=\"getImageSize()\"></s-thumbnail>\n\n <div class=\"global-search-item__container {{!isSmallSize() ? 'global-search-item__container--width-60' : ''}}\">\n <div #titleTemplate>\n <ng-content select=\"[titleTemplate]\"></ng-content>\n </div>\n <s-button styleClass=\"no-padding\" class=\"{{isSmallSize() ? 'ui-g-6 no-padding' : ''}}\" [id]=\"id + '-title'\"\n *ngIf=\"!titleTemplate.children.length\" priority=\"link\" [pTooltip]=\"primaryLabel\" [label]=\"primaryLabel\"\n size=\"small\" (onClick)=\"buttonClick.emit($event)\">\n </s-button>\n\n <div #labelTemplate>\n <ng-content select=\"[labelTemplate]\"></ng-content>\n </div>\n <span [id]=\"id + '-label'\" [ngClass]=\"{'ui-g-6 global-search-item__text-align--right': isSmallSize(), 'global-search-item__italic' : !secondaryLabel}\"\n class=\"label\" *ngIf=\"!labelTemplate.children.length\"\n [pTooltip]=\"secondaryLabel\" tooltipPosition=\"top\" showDelay=\"500\">{{ secondaryLabel ? secondaryLabel : secondaryEmptyLabel }}</span>\n\n <div #descriptionTemplate>\n <ng-content select=\"[descriptionTemplate]\"></ng-content>\n </div>\n <span [id]=\"id + '-description'\" class=\"description\"\n [ngClass]=\"{'global-search-item__italic' : !secondaryLabel}\"\n *ngIf=\" !descriptionTemplate.children.length && !isMediumSize() && !isSmallSize()\"\n [pTooltip]=\"tertiaryLabel\" tooltipPosition=\"top\" showDelay=\"500\">{{ tertiaryLabel ? tertiaryLabel : tertiaryEmptyLabel }}</span>\n </div>\n <div class=\"global-search-item__container--width-40 global-search__dropdown--template\" *ngIf=\"!isSmallSize()\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n </div>\n </div>\n</ng-template>\n",
13155
- styles: [".container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;height:100%;border-bottom:1px solid #ccc;padding:15px 5px;margin:0 10px}::ng-deep .no-padding{padding:0!important;min-width:0!important}::ng-deep .s-button-with-text{min-width:0!important}.global-search-item__italic{font-style:italic}.global-search-item__container{margin-left:10px;width:100%}.global-search-item__container,.global-search-item__container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.global-search-item__container .label{color:#333;display:block}.global-search-item__container .description{color:#999;display:block}.global-search-item__container--width-60{width:60%}.global-search-item__container--width-40{width:40%}.global-search-item__text-align--right{text-align:right;padding:2px 0 0 15px}.global-search__dropdown--template{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;text-align:right!important}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.global-search-item__container{-ms-flex:1;flex:1}}@media (max-width:767px){.global-search-item__container,.global-search-item__container span{white-space:normal}}.global-search-item__container:only-child{margin-left:0}"]
13156
- })
13157
- ], GlobalSearchDropdownItemComponent);
13158
- return GlobalSearchDropdownItemComponent;
13159
- }());
13160
-
13161
- var GlobalSearchComponent = /** @class */ (function () {
13162
- function GlobalSearchComponent(cdr) {
13163
- this.cdr = cdr;
13164
- this.id = "s-global-search-" + GlobalSearchDropdownItemComponent.nextId++;
13165
- this.delay = 500;
13166
- this.isLoading = false;
13167
- this.showFooter = true;
13168
- this.onSearch = new EventEmitter();
13169
- this.onFocus = new EventEmitter();
13170
- this.onShowMore = new EventEmitter();
13171
- this.wasSearched = false;
13172
- this.isModalLoading = false;
13173
- this.expanded = true;
13174
- }
13175
- GlobalSearchComponent.prototype.onChange = function () {
13176
- var _this = this;
13177
- var search = this.search;
13178
- setTimeout(function () {
13179
- if (_this.search === search) {
13180
- _this.canShowGlobalSearchActive();
13181
- _this.onSearch.emit(_this.search);
13182
- }
13183
- }, this.delay);
13484
+ Gantt.prototype.get_bar = function (id) {
13485
+ return this.bars.find(function (bar) {
13486
+ return bar.task.id === id;
13487
+ });
13184
13488
  };
13185
- GlobalSearchComponent.prototype.focusIn = function () {
13186
- this.onFocus.emit(true);
13489
+ Gantt.prototype.show_popup = function (options) {
13490
+ if (!this.popup) {
13491
+ this.popup = new Popup(this.popup_wrapper, this.options.customPopupHtml);
13492
+ }
13493
+ this.popup.show(options);
13187
13494
  };
13188
- GlobalSearchComponent.prototype.focusOut = function () {
13189
- this.onFocus.emit(false);
13495
+ Gantt.prototype.hide_popup = function () {
13496
+ this.popup && this.popup.hide();
13190
13497
  };
13191
- GlobalSearchComponent.prototype.showMore = function () {
13192
- this.onShowMore.emit();
13498
+ Gantt.prototype.trigger_event = function (event, args) {
13499
+ if (this.options[event]) {
13500
+ this.options[event].apply(null, args);
13501
+ }
13193
13502
  };
13194
- GlobalSearchComponent.prototype.removeActiveClassByGlobalSearch = function () {
13195
- ExportUtils.removeClass(this.globalSearch, "global-search__input-active");
13503
+ Gantt.prototype.get_oldest_starting_date = function () {
13504
+ return this.tasks
13505
+ .map(function (task) { return task._start; })
13506
+ .reduce(function (prev_date, cur_date) {
13507
+ return cur_date <= prev_date ? cur_date : prev_date;
13508
+ });
13196
13509
  };
13197
- GlobalSearchComponent.prototype.close = function () {
13198
- this.search = null;
13199
- this.wasSearched = false;
13200
- this.dropdownItens = null;
13201
- this.isModalLoading = false;
13202
- this.removeActiveClassByGlobalSearch();
13510
+ Gantt.prototype.clear = function () {
13511
+ this.$svg.innerHTML = '';
13203
13512
  };
13204
- GlobalSearchComponent.prototype.canShowGlobalSearchActive = function () {
13205
- this.wasSearched = !!this.search;
13206
- if (this.search) {
13207
- ExportUtils.addClass(this.globalSearch, "global-search__input-active");
13513
+ return Gantt;
13514
+ }());
13515
+ function generate_id(task) {
13516
+ return task.name + "_" + Math.random().toString(36).slice(2, 12);
13517
+ }
13518
+
13519
+ var GanttComponent = /** @class */ (function () {
13520
+ function GanttComponent() {
13521
+ this.multipleTaskPerLine = false;
13522
+ this.showSideTable = true;
13523
+ this.viewMode = ViewMode.Day;
13524
+ this.allowMovement = true;
13525
+ this.hasPopup = true;
13526
+ this.fullWidth = false;
13527
+ this.showOnlyHours = false;
13528
+ this.showOnlyDays = false;
13529
+ this.taskClicked = new EventEmitter();
13530
+ this.taskDateChanged = new EventEmitter();
13531
+ this.viewChanged = new EventEmitter();
13532
+ }
13533
+ GanttComponent.prototype.ngOnInit = function () {
13534
+ this._validateViewMode();
13535
+ this._validateTasks();
13536
+ };
13537
+ GanttComponent.prototype.ngAfterViewInit = function () {
13538
+ var _this = this;
13539
+ if (this.fullWidth) {
13540
+ this.containerWidth = this.outer.nativeElement.offsetWidth - this.side.nativeElement.offsetWidth;
13541
+ }
13542
+ this._gantt = new Gantt("#gantt", this._filterTask(this.tasks), {
13543
+ viewMode: this.viewMode,
13544
+ marginBeforeStart: this.marginBeforeStart,
13545
+ marginAfterEnd: this.marginAfterEnd,
13546
+ language: "pt-br",
13547
+ allowMovement: this.allowMovement,
13548
+ hasPopup: this.hasPopup,
13549
+ containerWidth: this.containerWidth,
13550
+ showOnlyHours: this.showOnlyHours,
13551
+ showOnlyDays: this.showOnlyDays,
13552
+ onClick: function (task) { return _this.taskClicked.emit(task); },
13553
+ onDateChange: function (task, start, end) { return _this.taskDateChanged.emit({ task: task, start: start, end: end }); },
13554
+ onViewChange: function (viewMode) { return _this.viewChanged.emit(viewMode); },
13555
+ });
13556
+ };
13557
+ GanttComponent.prototype.ngOnChanges = function (changes) {
13558
+ if (!this._gantt) {
13559
+ return;
13560
+ }
13561
+ if (changes.viewMode) {
13562
+ this._gantt.options.viewMode = changes.viewMode.currentValue;
13563
+ this._gantt.change_view_mode();
13564
+ }
13565
+ if (changes.tasks) {
13566
+ this._gantt.refresh(this._filterTask(changes.tasks.currentValue));
13567
+ }
13568
+ };
13569
+ GanttComponent.prototype._filterTask = function (tasksGroups) {
13570
+ var tasks = [];
13571
+ if (this.multipleTaskPerLine) {
13572
+ tasksGroups.forEach(function (group, index) {
13573
+ tasks.push.apply(tasks, __spread(group.tasks.map(function (task) {
13574
+ return __assign(__assign({}, task), { _row_id: index });
13575
+ })));
13576
+ }, []);
13208
13577
  }
13209
13578
  else {
13210
- this.removeActiveClassByGlobalSearch();
13211
- this.close();
13579
+ var i_1 = 0;
13580
+ tasksGroups.forEach(function (group) {
13581
+ tasks.push.apply(tasks, __spread(group.tasks.map(function (task) {
13582
+ return __assign(__assign({}, task), { _row_id: i_1++ });
13583
+ })));
13584
+ }, []);
13212
13585
  }
13213
- this.cdr.detectChanges();
13586
+ return tasks;
13587
+ };
13588
+ GanttComponent.prototype._validateViewMode = function () {
13589
+ if (![
13590
+ ViewMode.QuarterHour,
13591
+ ViewMode.Hour,
13592
+ ViewMode.QuarterDay,
13593
+ ViewMode.HalfDay,
13594
+ ViewMode.Day,
13595
+ ViewMode.Week,
13596
+ ViewMode.Month,
13597
+ ViewMode.Year,
13598
+ ].includes(this.viewMode)) {
13599
+ throw new Error("Invalid gantt view mode");
13600
+ }
13601
+ };
13602
+ GanttComponent.prototype._validateTasks = function () {
13603
+ this.tasks.forEach(function (group) {
13604
+ group.tasks.forEach(function (task) {
13605
+ if (task.start > task.end) {
13606
+ throw new Error("invalid task. The start date must be less than the end date.");
13607
+ }
13608
+ });
13609
+ });
13214
13610
  };
13215
- GlobalSearchComponent.nextId = 0;
13216
- GlobalSearchComponent.ctorParameters = function () { return [
13217
- { type: ChangeDetectorRef }
13218
- ]; };
13219
13611
  __decorate([
13220
- ViewChild("globalSearch", { static: false })
13221
- ], GlobalSearchComponent.prototype, "globalSearch", void 0);
13612
+ Input()
13613
+ ], GanttComponent.prototype, "columnTitle", void 0);
13222
13614
  __decorate([
13223
13615
  Input()
13224
- ], GlobalSearchComponent.prototype, "id", void 0);
13616
+ ], GanttComponent.prototype, "multipleTaskPerLine", void 0);
13225
13617
  __decorate([
13226
13618
  Input()
13227
- ], GlobalSearchComponent.prototype, "delay", void 0);
13619
+ ], GanttComponent.prototype, "showSideTable", void 0);
13228
13620
  __decorate([
13229
13621
  Input()
13230
- ], GlobalSearchComponent.prototype, "totalItensLabel", void 0);
13622
+ ], GanttComponent.prototype, "viewMode", void 0);
13231
13623
  __decorate([
13232
13624
  Input()
13233
- ], GlobalSearchComponent.prototype, "showMoreLabel", void 0);
13625
+ ], GanttComponent.prototype, "tasks", void 0);
13234
13626
  __decorate([
13235
13627
  Input()
13236
- ], GlobalSearchComponent.prototype, "placeholder", void 0);
13628
+ ], GanttComponent.prototype, "marginBeforeStart", void 0);
13237
13629
  __decorate([
13238
13630
  Input()
13239
- ], GlobalSearchComponent.prototype, "isLoading", void 0);
13631
+ ], GanttComponent.prototype, "marginAfterEnd", void 0);
13240
13632
  __decorate([
13241
13633
  Input()
13242
- ], GlobalSearchComponent.prototype, "totalElements", void 0);
13634
+ ], GanttComponent.prototype, "allowMovement", void 0);
13243
13635
  __decorate([
13244
13636
  Input()
13245
- ], GlobalSearchComponent.prototype, "emptyTitle", void 0);
13637
+ ], GanttComponent.prototype, "hasPopup", void 0);
13246
13638
  __decorate([
13247
13639
  Input()
13248
- ], GlobalSearchComponent.prototype, "emptyDescription", void 0);
13640
+ ], GanttComponent.prototype, "containerWidth", void 0);
13249
13641
  __decorate([
13250
13642
  Input()
13251
- ], GlobalSearchComponent.prototype, "emptyIcon", void 0);
13643
+ ], GanttComponent.prototype, "fullWidth", void 0);
13252
13644
  __decorate([
13253
13645
  Input()
13254
- ], GlobalSearchComponent.prototype, "showFooter", void 0);
13646
+ ], GanttComponent.prototype, "showOnlyHours", void 0);
13255
13647
  __decorate([
13256
- ContentChildren(GlobalSearchDropdownItemComponent)
13257
- ], GlobalSearchComponent.prototype, "dropdownItens", void 0);
13648
+ Input()
13649
+ ], GanttComponent.prototype, "showOnlyDays", void 0);
13258
13650
  __decorate([
13259
13651
  Output()
13260
- ], GlobalSearchComponent.prototype, "onSearch", void 0);
13652
+ ], GanttComponent.prototype, "taskClicked", void 0);
13261
13653
  __decorate([
13262
13654
  Output()
13263
- ], GlobalSearchComponent.prototype, "onFocus", void 0);
13655
+ ], GanttComponent.prototype, "taskDateChanged", void 0);
13264
13656
  __decorate([
13265
13657
  Output()
13266
- ], GlobalSearchComponent.prototype, "onShowMore", void 0);
13267
- GlobalSearchComponent = __decorate([
13658
+ ], GanttComponent.prototype, "viewChanged", void 0);
13659
+ __decorate([
13660
+ ViewChild('outer')
13661
+ ], GanttComponent.prototype, "outer", void 0);
13662
+ __decorate([
13663
+ ViewChild('side')
13664
+ ], GanttComponent.prototype, "side", void 0);
13665
+ GanttComponent = __decorate([
13268
13666
  Component({
13269
- selector: "s-global-search",
13270
- template: "<div class=\"ui-inputgroup\">\n <input #globalSearch class=\"global-search__input\" [(ngModel)]=\"search\" (ngModelChange)=\"onChange()\" pInputText\n [placeholder]=\"placeholder\" (focus)=\"focusIn()\" (blur)=\"focusOut()\">\n <span class=\"ui-inputgroup-addon global-search__span\"><em class=\"fas fa-search\"></em></span>\n <div class=\"global-search__modal\" *ngIf=\"wasSearched\">\n <div *sLoadingState=\"isLoading && !isModalLoading\" class=\"global-search__loader\">\n <div class=\"global-search__container\" *ngIf=\"dropdownItens && dropdownItens.length > 0 || isLoading\">\n <div *ngIf=\"dropdownItens && dropdownItens.length > 0\">\n <div class=\"global-search__modal--total-itens-title\">\n <span class=\"ui-g-11 no-space\">{{totalItensLabel}}</span>\n <span class=\"ui-g-1 no-space global-search__modal--total-itens-title-icon\" (click)=\"close()\"><em\n class=\"fas fa-times\"></em></span>\n </div>\n <div class=\"no-space global-search__dropdown--itens\"\n [@expandableContent]=\"expanded\">\n <ng-container *ngFor=\"let item of dropdownItens\">\n <div class=\"s-object-card-field no-space global-search__dropdown--itens-container\">\n <ng-container *ngTemplateOutlet=\"item.content\"></ng-container>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"showFooter\" class=\"ui-g-12 global-search__modal--footer\">\n <s-button class=\"global-search__show-more\" (click)=\"showMore()\" priority=\"link\">\n {{showMoreLabel}}\n </s-button>\n </div>\n </div>\n </div>\n <s-empty-state *ngIf=\"(!dropdownItens || dropdownItens.length==0) && !isLoading\" [title]=\"emptyTitle\"\n [description]=\"emptyDescription\" ngClass=\"global-search__empty-state--icon\"\n [iconClass]=\"(emptyIcon ? emptyIcon : 'fas fa-search')\">\n </s-empty-state>\n </div>\n </div>\n <div *ngIf=\"wasSearched\" class=\"global-search__background\" (click)=\"close()\"></div>\n</div>\n",
13271
- animations: [
13272
- trigger("expandableContent", [
13273
- state("*", style$7({
13274
- height: "0",
13275
- })),
13276
- state("false", style$7({
13277
- height: "0",
13278
- })),
13279
- state("true", style$7({
13280
- height: "*",
13281
- })),
13282
- transition("* => true", animate("200ms ease-out")),
13283
- transition("false <=> true", animate("200ms ease-out")),
13284
- ]),
13285
- ],
13286
- styles: [".global-search__input{border-radius:20px 0 0 20px;width:136px;cursor:pointer;padding:0 0 0 15px;transition:.3s}.ui-inputtext{min-height:25px!important;height:25px!important}.global-search__span{transition:.3s;background:0 0!important;border-left:none;border-radius:0 20px 20px 0!important;padding:1px 15px 0 0!important;height:25px!important}.global-search__input:active,.global-search__input:focus{width:466px;cursor:default;transition:.3s;border-top:1px solid #428bca;border-left:1px solid #428bca;border-bottom:1px solid #428bca}.global-search__input:active,.global-search__input:focus+.global-search__span{transition:.3s;border-left:none;border-top:1px solid #428bca!important;border-right:1px solid #428bca!important;border-bottom:1px solid #428bca!important}.global-search__input-active{width:466px;cursor:default;transition:.3s}.global-search__modal{box-shadow:0 2px 8px 0 rgba(0,0,0,.4);border-radius:5px;width:500px;background:#fff;position:absolute;margin-top:60px;z-index:6;min-height:50px}::ng-deep .global-search__loader{border-radius:5px!important;width:100%}.global-search__container{min-height:50px;width:100%}.global-search__modal--total-itens-title{padding:15px;color:#333;border-bottom:1px solid #ccc;font-weight:600;height:50px}.global-search__modal--footer{height:50px;border-top:1px solid #ccc}.global-search__dropdown--itens{max-height:510px;overflow:auto}.global-search__dropdown--itens-container:hover{background:#dbe0e4}.global-search__modal--total-itens-title-icon{text-align:right;cursor:pointer}.global-search__background{background:rgba(0,0,0,.4);width:100%;height:calc(100vh - 70px);position:absolute;left:0;margin-top:50px;z-index:5;cursor:pointer}.no-space{padding:0;margin:0}.global-search__show-more{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}body .global-search__show-more--button{color:#428bca!important}.modal{position:absolute;left:1%;width:98%;height:calc(100vh - 90px)}.global-search__empty-state--icon{margin:42px 134px}::ng-deep .global-search__empty-state--icon .container .icon{font-size:40px}::ng-deep .s-button-priority-link{color:#428bca}@media all and (max-width:900px){.global-search__modal{top:20px;width:98%;left:1%}.global-search__input-active,.global-search__input:active,.global-search__input:focus{position:absolute;width:calc(100% - 70px);left:2%}body .global-search__dropdown--itens{max-height:100%;overflow:auto}}@media all and (max-width:767px){.global-search__modal{top:15px}.global-search__input-active,.global-search__input:active,.global-search__input:focus{width:calc(100% - 55px)}}@media all and (max-width:600px){.global-search__modal--itens{height:calc(100vh - 100px);background:#fff}.global-search__input-active,.global-search__input:active,.global-search__input:focus{position:absolute;width:calc(100% - 53px);left:2%}body .global-search__dropdown--itens{max-height:100%;overflow:auto}.global-search__dropdown--itens{max-height:100%;background:#fff}.global-search__modal--footer{background:#fff;height:50px}.global-search__modal{top:17px;border-radius:0;margin-top:55px;box-shadow:none;left:0;width:100%}}"]
13287
- })
13288
- ], GlobalSearchComponent);
13289
- return GlobalSearchComponent;
13290
- }());
13291
-
13292
- var ThumbnailModule = /** @class */ (function () {
13293
- function ThumbnailModule() {
13294
- }
13295
- ThumbnailModule = __decorate([
13296
- NgModule({
13297
- imports: [CommonModule],
13298
- declarations: [ThumbnailComponent],
13299
- exports: [ThumbnailComponent],
13300
- providers: [ThumbnailService],
13667
+ selector: "s-gantt",
13668
+ template: "<div class=\"outer\" #outer>\n <div #side>\n <gantt-side-table\n *ngIf=\"showSideTable\"\n [tasks]=\"tasks\"\n [columnTitle]=\"columnTitle\"\n [multipleTaskPerLine]=\"multipleTaskPerLine\">\n </gantt-side-table>\n </div>\n <svg id=\"gantt\"></svg>\n</div>\n",
13669
+ encapsulation: ViewEncapsulation.None,
13670
+ styles: [".outer{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:center;align-content:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row}", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(even){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.4}.gantt .tick.thick{stroke:#428bca;stroke-width:2}.gantt .today-highlight{fill:#ffe979;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{opacity:.8;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s;-webkit-user-select:none;-ms-user-select:none;user-select:none}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-dasharray:5;stroke-width:1}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .bar-wrapper{cursor:pointer;outline:0}.gantt .bar-wrapper.active .bar,.gantt .bar-wrapper:hover .bar{opacity:1}.gantt .bar-wrapper.active .bar{stroke:#212533;stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{border-left:1px solid #e0e0e0;font-size:12px;overflow:auto;position:relative}.gantt-container .title-1{fill:#999;font-size:12px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .title-2{fill:#333;font-size:14px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .popup-wrapper{left:0;position:absolute;top:0}.gantt-container .popup-wrapper .popup{background:#0e1119;border-radius:2px;color:#fff;padding:8px;font-family:\"Open Sans\" sans-serif;line-height:150%;font-weight:400}.gantt-container .popup-wrapper .popup .wrp-title{border-bottom:1px solid #525966;padding-bottom:10px}.gantt-container .popup-wrapper .popup .wrp-title .title{font-size:14px}.gantt-container .popup-wrapper .popup .wrp-subtitle{color:#dfe2e5;padding-top:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.gantt-container .popup-wrapper .popup .wrp-subtitle .icon{margin-right:10px}.gantt-container .popup-wrapper .popup .wrp-subtitle .subtitle{font-size:12px}.gantt-container .popup-wrapper .popup .pointer{border:6px solid transparent;border-top-color:#0e1119;height:6px;margin-left:-4px;position:absolute}"]
13301
13671
  })
13302
- ], ThumbnailModule);
13303
- return ThumbnailModule;
13672
+ ], GanttComponent);
13673
+ return GanttComponent;
13304
13674
  }());
13305
13675
 
13306
- var InfiniteScrollDirective = /** @class */ (function () {
13307
- function InfiniteScrollDirective(el) {
13308
- this.el = el;
13309
- this.onScroll = new EventEmitter();
13676
+ var SideTableComponent = /** @class */ (function () {
13677
+ function SideTableComponent() {
13678
+ this.ROW_HEIGHT = 44;
13679
+ this.multipleTaskPerLine = false;
13310
13680
  }
13311
- InfiniteScrollDirective.prototype.scroll = function () {
13312
- if (this.el.nativeElement.scrollTop > (this.el.nativeElement.scrollHeight - this.el.nativeElement.offsetHeight - 2)) {
13313
- this.onScroll.emit();
13314
- }
13681
+ SideTableComponent.prototype.ngOnInit = function () {
13682
+ this._removeEmptyTasks();
13683
+ };
13684
+ SideTableComponent.prototype._removeEmptyTasks = function () {
13685
+ this.tasks = this.tasks.filter(function (task) { return task.tasks.length; });
13315
13686
  };
13316
- InfiniteScrollDirective.ctorParameters = function () { return [
13317
- { type: ElementRef }
13318
- ]; };
13319
13687
  __decorate([
13320
- Output()
13321
- ], InfiniteScrollDirective.prototype, "onScroll", void 0);
13688
+ Input()
13689
+ ], SideTableComponent.prototype, "columnTitle", void 0);
13322
13690
  __decorate([
13323
- HostListener("scroll")
13324
- ], InfiniteScrollDirective.prototype, "scroll", null);
13325
- InfiniteScrollDirective = __decorate([
13326
- Directive({
13327
- selector: "[sInfiniteScroll]"
13328
- })
13329
- ], InfiniteScrollDirective);
13330
- return InfiniteScrollDirective;
13331
- }());
13332
-
13333
- var InfiniteScrollModule = /** @class */ (function () {
13334
- function InfiniteScrollModule() {
13335
- }
13336
- InfiniteScrollModule = __decorate([
13337
- NgModule({
13338
- declarations: [
13339
- InfiniteScrollDirective
13340
- ],
13341
- imports: [
13342
- CommonModule
13343
- ],
13344
- exports: [
13345
- InfiniteScrollDirective
13346
- ]
13691
+ Input()
13692
+ ], SideTableComponent.prototype, "tasks", void 0);
13693
+ __decorate([
13694
+ Input()
13695
+ ], SideTableComponent.prototype, "multipleTaskPerLine", void 0);
13696
+ SideTableComponent = __decorate([
13697
+ Component({
13698
+ selector: 'gantt-side-table',
13699
+ template: "<div class=\"side-table\">\n <div class=\"column-title\">\n <span>{{ columnTitle }}</span>\n </div>\n <div class=\"tasks\" >\n <div\n *ngFor=\"let task of tasks; let i = index\"\n class=\"task\"\n [ngStyle]=\"{'height.px': multipleTaskPerLine\n ? ROW_HEIGHT\n : ROW_HEIGHT * task.tasks.length}\"\n [sTooltip]=\"task.title.length > 20 || task.subtitle.length > 20 ? '<span><strong>' + task.title + ' </strong></br><span> ' + task.subtitle + ' </span></span>' : '' \"\n [escape]=\"false\">\n <div class=\"title\">\n {{ task.title }}\n </div>\n <div class=\"subtitle\">\n {{ task.subtitle }}\n </div>\n </div>\n </div>\n</div>\n",
13700
+ styles: [".side-table{background:#fff;height:100%;min-width:175px}.side-table .column-title{height:106px;border:1px solid #e0e0e0;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center;padding:8px}.side-table .column-title span{font-family:\"Open Sans\" sans-serif;font-size:14px;font-weight:700;line-height:150%}.side-table .task{-ms-flex-align:center;align-items:center;background-color:#fff;border:1px solid #e0e0e0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:\"Open Sans\",sans-serif;font-weight:400;-ms-flex-pack:center;justify-content:center;line-height:150%;padding:0 5px}.side-table .task .title{color:#333;font-size:14px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.side-table .task .subtitle{color:#999;font-size:12px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]
13347
13701
  })
13348
- ], InfiniteScrollModule);
13349
- return InfiniteScrollModule;
13702
+ ], SideTableComponent);
13703
+ return SideTableComponent;
13350
13704
  }());
13351
13705
 
13352
- var GlobalSearchModule = /** @class */ (function () {
13353
- function GlobalSearchModule() {
13706
+ var GanttModule = /** @class */ (function () {
13707
+ function GanttModule() {
13354
13708
  }
13355
- GlobalSearchModule = __decorate([
13709
+ GanttModule = __decorate([
13356
13710
  NgModule({
13357
- declarations: [
13358
- GlobalSearchComponent,
13359
- GlobalSearchDropdownItemComponent
13360
- ],
13361
- imports: [
13362
- CommonModule,
13363
- InputTextModule,
13364
- FormsModule,
13365
- ReactiveFormsModule,
13366
- TooltipModule$1,
13367
- ThumbnailModule,
13368
- ButtonModule,
13369
- LoadingStateModule,
13370
- InfiniteScrollModule,
13371
- EmptyStateModule
13372
- ],
13373
- exports: [
13374
- GlobalSearchComponent,
13375
- GlobalSearchDropdownItemComponent,
13376
- TooltipModule$1,
13377
- ThumbnailModule,
13378
- ButtonModule,
13379
- LoadingStateModule,
13380
- EmptyStateModule
13381
- ],
13382
- entryComponents: [
13383
- GlobalSearchComponent,
13384
- GlobalSearchDropdownItemComponent
13385
- ]
13386
- })
13387
- ], GlobalSearchModule);
13388
- return GlobalSearchModule;
13389
- }());
13390
-
13391
- var IAInsightCardComponent = /** @class */ (function () {
13392
- function IAInsightCardComponent(clipboard, messageService, translateService) {
13393
- this.clipboard = clipboard;
13394
- this.messageService = messageService;
13395
- this.translateService = translateService;
13396
- this.open = false;
13397
- this.isLoading = false;
13398
- this.likeSelected = false;
13399
- this.dislikeSelected = false;
13400
- }
13401
- IAInsightCardComponent.prototype.toggle = function () {
13402
- this.open = !this.open;
13403
- this._requestInsight();
13404
- };
13405
- IAInsightCardComponent.prototype.onLikeSelected = function () {
13406
- var _a, _b;
13407
- if (this.likeSelected) {
13408
- this.likeSelected = false;
13409
- }
13410
- else {
13411
- this.likeSelected = true;
13412
- this.dislikeSelected = false;
13413
- (_b = (_a = this.insight).onLikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13414
- }
13415
- };
13416
- IAInsightCardComponent.prototype.onDislikeSelected = function () {
13417
- var _a, _b;
13418
- if (this.dislikeSelected) {
13419
- this.dislikeSelected = false;
13420
- }
13421
- else {
13422
- this.dislikeSelected = true;
13423
- this.likeSelected = false;
13424
- (_b = (_a = this.insight).onDislikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13425
- }
13426
- };
13427
- IAInsightCardComponent.prototype.copyContent = function () {
13428
- var _a, _b;
13429
- (_b = (_a = this.insight).onCopy) === null || _b === void 0 ? void 0 : _b.call(_a, this.content);
13430
- if (this.clipboard.copy(this.content)) {
13431
- this.messageService.add({
13432
- severity: "info",
13433
- summary: this.translateService.instant("platform.angular_components.copied_to_clipboard"),
13434
- });
13435
- }
13436
- };
13437
- IAInsightCardComponent.prototype.reloadContent = function () {
13438
- this._requestInsight();
13439
- };
13440
- IAInsightCardComponent.prototype._requestInsight = function () {
13441
- var _this = this;
13442
- this.isLoading = true;
13443
- this.insight.request$
13444
- .pipe(first(), finalize(function () { return (_this.isLoading = false); }))
13445
- .subscribe(function (content) {
13446
- _this.content = marked.marked(content);
13447
- });
13448
- };
13449
- IAInsightCardComponent.ctorParameters = function () { return [
13450
- { type: Clipboard },
13451
- { type: MessageService },
13452
- { type: TranslateService }
13453
- ]; };
13454
- __decorate([
13455
- Input()
13456
- ], IAInsightCardComponent.prototype, "insight", void 0);
13457
- IAInsightCardComponent = __decorate([
13458
- Component({
13459
- selector: "s-ia-insight-card",
13460
- template: "<div class=\"ia-insight-card\" [ngClass]=\"{ 'ia-insight-card--close': !open }\">\n <div class=\"header\" (click)=\"toggle()\">\n <s-badge text=\"Insight\" iconClass=\"fal fa-lightbulb\"></s-badge>\n <span class=\"insight-title\">{{ insight.title }}</span>\n <span\n class=\"toggle-icon fas\"\n [ngClass]=\"{\n 'fa-angle-down': !open,\n 'fa-angle-up': open\n }\"\n >\n </span>\n </div>\n <div class=\"content\">\n <ng-container *ngIf=\"isLoading; then loadingBlock; else contentBlock\"></ng-container>\n <ng-template #loadingBlock>\n <s-ia-insight-card-loader></s-ia-insight-card-loader>\n </ng-template>\n <ng-template #contentBlock>\n <ng-container *ngIf=\"content; then successBlock; else errorBlock\"></ng-container>\n\n <ng-template #successBlock>\n <span class=\"text\" [innerHTML]=\"content\"></span>\n </ng-template>\n <ng-template #errorBlock>\n <span class=\"text text--error\">{{ \"platform.angular_components.error_loading_insight_alt\" | translate }}</span>\n </ng-template>\n\n <div class=\"options\">\n <button [disabled]=\"!content\" (click)=\"copyContent()\" class=\"option fal fa-copy\"></button>\n <button (click)=\"reloadContent()\" class=\"option fal fa-redo\"></button>\n <button\n *ngIf=\"insight.onLikeSelected\"\n [disabled]=\"!content\"\n (click)=\"onLikeSelected()\"\n class=\"option\"\n [ngClass]=\"{\n 'fal': !likeSelected,\n 'fas': likeSelected,\n 'fa-thumbs-up': true\n }\">\n </button>\n <button\n *ngIf=\"insight.onDislikeSelected\"\n [disabled]=\"!content\"\n (click)=\"onDislikeSelected()\"\n class=\"option\"\n [ngClass]=\"{\n 'fal': !dislikeSelected,\n 'fas': dislikeSelected,\n 'fa-thumbs-down': true\n }\">\n </button>\n </div>\n </ng-template>\n </div>\n</div>\n",
13461
- styles: [".ia-insight-card{background-color:#fff;border:1px solid #9ecad4;border-radius:4px;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.ia-insight-card .header{-ms-flex-align:center;align-items:center;background-color:#f1f7f8;border-bottom:1px solid #9ecad4;display:-ms-flexbox;display:flex;gap:8px;min-height:60px;padding:8px 16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ia-insight-card .header .insight-title{color:#428bca;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;line-height:150%}.ia-insight-card .header .toggle-icon{color:#888b99;font-size:20px}.ia-insight-card .content{-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;cursor:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px;min-height:160px;padding:24px}.ia-insight-card .content .text{color:#212533;font-family:\"Open Sans\",sans-serif;font-size:14px;width:100%}.ia-insight-card .content .text--error{text-align:center}.ia-insight-card .content .options{display:-ms-flexbox;display:flex;gap:8px}.ia-insight-card .content .options .option{background-color:transparent;border:none;color:#428bca;cursor:pointer;font-size:12px}.ia-insight-card .content .options .option:disabled{color:#c1c1cc;cursor:auto}.ia-insight-card--close{border-color:#dedce5}.ia-insight-card--close .header{background-color:#fbfafc;border:#dedce5}.ia-insight-card--close .header .insight-title{color:#888b99}.ia-insight-card--close .content{display:none}"]
13711
+ imports: [CommonModule, TooltipModule],
13712
+ declarations: [
13713
+ GanttComponent,
13714
+ SideTableComponent,
13715
+ ],
13716
+ exports: [GanttComponent],
13462
13717
  })
13463
- ], IAInsightCardComponent);
13464
- return IAInsightCardComponent;
13718
+ ], GanttModule);
13719
+ return GanttModule;
13465
13720
  }());
13466
13721
 
13467
- var IAInsightSidebarComponent = /** @class */ (function () {
13468
- function IAInsightSidebarComponent() {
13469
- this.insights = [];
13470
- this.opened = false;
13722
+ var GlobalSearchSizeEnum;
13723
+ (function (GlobalSearchSizeEnum) {
13724
+ GlobalSearchSizeEnum["STANDARD"] = "STANDARD";
13725
+ GlobalSearchSizeEnum["MEDIUM"] = "MEDIUM";
13726
+ GlobalSearchSizeEnum["SMALL"] = "SMALL";
13727
+ })(GlobalSearchSizeEnum || (GlobalSearchSizeEnum = {}));
13728
+
13729
+ var GlobalSearchDropdownItemComponent = /** @class */ (function () {
13730
+ function GlobalSearchDropdownItemComponent() {
13731
+ this.id = "s-global-search-dropdown-item-" + GlobalSearchDropdownItemComponent_1.nextId++;
13732
+ this.size = GlobalSearchSizeEnum.STANDARD;
13733
+ this.buttonClick = new EventEmitter();
13471
13734
  }
13472
- IAInsightSidebarComponent.prototype.toggle = function () {
13473
- this.opened = !this.opened;
13735
+ GlobalSearchDropdownItemComponent_1 = GlobalSearchDropdownItemComponent;
13736
+ GlobalSearchDropdownItemComponent.prototype.isStandardSize = function () {
13737
+ return this.size === GlobalSearchSizeEnum.STANDARD;
13474
13738
  };
13475
- IAInsightSidebarComponent.prototype.open = function () {
13476
- this.opened = true;
13739
+ GlobalSearchDropdownItemComponent.prototype.isMediumSize = function () {
13740
+ return this.size === GlobalSearchSizeEnum.MEDIUM;
13477
13741
  };
13478
- IAInsightSidebarComponent.prototype.close = function () {
13479
- this.opened = false;
13742
+ GlobalSearchDropdownItemComponent.prototype.isSmallSize = function () {
13743
+ return this.size === GlobalSearchSizeEnum.SMALL;
13744
+ };
13745
+ GlobalSearchDropdownItemComponent.prototype.getImageSize = function () {
13746
+ return this.isStandardSize() ? "medium" : "small";
13480
13747
  };
13748
+ var GlobalSearchDropdownItemComponent_1;
13749
+ GlobalSearchDropdownItemComponent.nextId = 0;
13481
13750
  __decorate([
13482
13751
  Input()
13483
- ], IAInsightSidebarComponent.prototype, "insights", void 0);
13752
+ ], GlobalSearchDropdownItemComponent.prototype, "id", void 0);
13484
13753
  __decorate([
13485
13754
  Input()
13486
- ], IAInsightSidebarComponent.prototype, "hasPermission", void 0);
13755
+ ], GlobalSearchDropdownItemComponent.prototype, "primaryLabel", void 0);
13487
13756
  __decorate([
13488
13757
  Input()
13489
- ], IAInsightSidebarComponent.prototype, "introText", void 0);
13758
+ ], GlobalSearchDropdownItemComponent.prototype, "secondaryEmptyLabel", void 0);
13490
13759
  __decorate([
13491
13760
  Input()
13492
- ], IAInsightSidebarComponent.prototype, "introTemplate", void 0);
13761
+ ], GlobalSearchDropdownItemComponent.prototype, "tertiaryEmptyLabel", void 0);
13493
13762
  __decorate([
13494
13763
  Input()
13495
- ], IAInsightSidebarComponent.prototype, "emptyText", void 0);
13764
+ ], GlobalSearchDropdownItemComponent.prototype, "imageSource", void 0);
13496
13765
  __decorate([
13497
13766
  Input()
13498
- ], IAInsightSidebarComponent.prototype, "emptyTemplate", void 0);
13767
+ ], GlobalSearchDropdownItemComponent.prototype, "imageAlt", void 0);
13499
13768
  __decorate([
13500
13769
  Input()
13501
- ], IAInsightSidebarComponent.prototype, "noPermissionText", void 0);
13770
+ ], GlobalSearchDropdownItemComponent.prototype, "iconClass", void 0);
13502
13771
  __decorate([
13503
13772
  Input()
13504
- ], IAInsightSidebarComponent.prototype, "noPermissionTemplate", void 0);
13505
- IAInsightSidebarComponent = __decorate([
13506
- Component({
13507
- selector: "s-ia-insight-sidebar",
13508
- template: "<div\n class=\"sidebar\"\n [class.opened]=\"opened\">\n <div class=\"header\">\n <button (click)=\"close()\" class=\"option\">\n <span class=\"far fa-chevron-double-right\"></span>\n </button>\n <div class=\"title\">\n <span><ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container></span>\n <span>Insight</span>\n </div>\n </div>\n <div class=\"intro\">\n <ng-container *ngIf=\"hasPermission; then permissionBlock; else noPermissionBlock\"></ng-container>\n\n <ng-template #permissionBlock>\n <ng-container *ngIf=\"insights?.length; then introBlock; else emptyBlock\"></ng-container>\n \n <ng-template #introBlock>\n <ng-container *ngIf=\"introTemplate; then introCustomBlock; else introTextBlock\"></ng-container>\n\n <ng-template #introCustomBlock>\n <ng-container *ngTemplateOutlet=\"introTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #introTextBlock>\n <span class=\"text\">{{ introText || \"platform.angular_components.insight_intro\" | translate }}</span>\n </ng-template>\n </ng-template>\n \n <ng-template #emptyBlock>\n <ng-container *ngIf=\"emptyTemplate; then emptyCustomBlock; else emptyTextBlock\"></ng-container>\n\n <ng-template #emptyCustomBlock>\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #emptyTextBlock>\n <span class=\"text\">{{ emptyText || \"platform.angular_components.insight_empty\" | translate }}</span>\n </ng-template>\n </ng-template>\n </ng-template>\n \n <ng-template #noPermissionBlock>\n <ng-container *ngIf=\"noPermissionTemplate; then noPermissionCustomBlock; else noPermissionTextBlock\"></ng-container>\n\n <ng-template #noPermissionCustomBlock>\n <ng-container *ngTemplateOutlet=\"noPermissionTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #noPermissionTextBlock>\n <span>{{ noPermissionText || \"platform.angular_components.insight_no_permission\" | translate }}</span>\n </ng-template>\n </ng-template>\n </div>\n <div class=\"insights\">\n <ng-container *ngIf=\"insights?.length\">\n <s-ia-insight-card\n *ngFor=\"let insight of insights\"\n [insight]=\"insight\">\n </s-ia-insight-card>\n </ng-container>\n </div>\n</div>\n\n<ng-template #iassistIcon>\n <div style=\"width: 28px; height: 28px;\">\n <span *sSVGFactory=\"'iassist'\"></span>\n </div>\n</ng-template>\n",
13509
- styles: [".sidebar{background-color:#fff;border-left:1px solid #dedce5;height:100%;overflow-x:hidden;position:fixed;right:-25%;transition:.5s;top:0;width:25%;z-index:1002}.sidebar .header{border-bottom:1px solid #dedce5;display:-ms-flexbox;display:flex;gap:16px;padding:12px 20px}.sidebar .header .option{background-color:transparent;border:none;color:#428bca;cursor:pointer;font-size:16px;padding:12px}.sidebar .header .title{-ms-flex-align:center;align-items:center;color:#212533;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:16px;gap:16px;line-height:1;-webkit-user-select:none;-ms-user-select:none;user-select:none}.sidebar .intro{margin:8px 40px}.sidebar .intro .text{color:#212533;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;-ms-flex-pack:center;justify-content:center;line-height:1.5;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none}.sidebar.opened{right:0}.sidebar.opened .insights{padding:12px}.insights{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:12px}@media (max-width:1366px){.sidebar{right:-50%;width:50%}}@media (max-width:768px){.sidebar{right:-75%;width:75%}}@media (max-width:600px){.sidebar{right:-100%;width:100%}}"]
13510
- })
13511
- ], IAInsightSidebarComponent);
13512
- return IAInsightSidebarComponent;
13513
- }());
13514
-
13515
- var IAInsightCardLoaderComponent = /** @class */ (function () {
13516
- function IAInsightCardLoaderComponent() {
13517
- }
13518
- IAInsightCardLoaderComponent = __decorate([
13773
+ ], GlobalSearchDropdownItemComponent.prototype, "secondaryLabel", void 0);
13774
+ __decorate([
13775
+ Input()
13776
+ ], GlobalSearchDropdownItemComponent.prototype, "tertiaryLabel", void 0);
13777
+ __decorate([
13778
+ Input()
13779
+ ], GlobalSearchDropdownItemComponent.prototype, "size", void 0);
13780
+ __decorate([
13781
+ Input()
13782
+ ], GlobalSearchDropdownItemComponent.prototype, "template", void 0);
13783
+ __decorate([
13784
+ Output()
13785
+ ], GlobalSearchDropdownItemComponent.prototype, "buttonClick", void 0);
13786
+ __decorate([
13787
+ ContentChild(ThumbnailComponent, { static: true })
13788
+ ], GlobalSearchDropdownItemComponent.prototype, "thumbnailComponent", void 0);
13789
+ __decorate([
13790
+ ViewChild(TemplateRef, { static: true })
13791
+ ], GlobalSearchDropdownItemComponent.prototype, "content", void 0);
13792
+ GlobalSearchDropdownItemComponent = GlobalSearchDropdownItemComponent_1 = __decorate([
13519
13793
  Component({
13520
- selector: "s-ia-insight-card-loader",
13521
- template: "<div class=\"ia-insight-card-loader\">\n <div class=\"loader\">\n <div class=\"loader-icon\">\n <div *sSVGFactory=\"'iassist'\"></div>\n </div>\n </div>\n \n <span class=\"loader-label\">{{ \"platform.angular_components.loading_insight\" | translate }}</span>\n</div>\n",
13522
- styles: [".ia-insight-card-loader{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.ia-insight-card-loader .loader{-ms-flex-align:center;align-items:center;animation:2s linear infinite spin;border:2px solid #f1f7f8;border-top:2px solid #0fa389;border-radius:50%;display:-ms-flexbox;display:flex;height:48px;-ms-flex-pack:center;justify-content:center;width:48px}.ia-insight-card-loader .loader .loader-icon{animation:2s linear infinite reverse spin;height:32px;transform:translate(-50%,-50%)}.ia-insight-card-loader .loader-label{color:#888b99;font-family:\"Open Sans\",sans-serif;font-size:16px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
13794
+ selector: "s-global-search-dropdown-item",
13795
+ template: "<ng-template>\n <div class=\"{{isSmallSize() ? 'ui-g container' : 'container'}}\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail [id]=\"id + '-thumbnail'\"\n *ngIf=\"!thumbnailComponent && (imageSource || iconClass) && !isSmallSize()\" [imageSource]=\"imageSource\"\n [imageAlt]=\"imageAlt || primaryLabel\" [iconClass]=\"iconClass\" [size]=\"getImageSize()\"></s-thumbnail>\n\n <div class=\"global-search-item__container {{!isSmallSize() ? 'global-search-item__container--width-60' : ''}}\">\n <div #titleTemplate>\n <ng-content select=\"[titleTemplate]\"></ng-content>\n </div>\n <s-button styleClass=\"no-padding\" class=\"{{isSmallSize() ? 'ui-g-6 no-padding' : ''}}\" [id]=\"id + '-title'\"\n *ngIf=\"!titleTemplate.children.length\" priority=\"link\" [pTooltip]=\"primaryLabel\" [label]=\"primaryLabel\"\n size=\"small\" (onClick)=\"buttonClick.emit($event)\">\n </s-button>\n\n <div #labelTemplate>\n <ng-content select=\"[labelTemplate]\"></ng-content>\n </div>\n <span [id]=\"id + '-label'\" [ngClass]=\"{'ui-g-6 global-search-item__text-align--right': isSmallSize(), 'global-search-item__italic' : !secondaryLabel}\"\n class=\"label\" *ngIf=\"!labelTemplate.children.length\"\n [pTooltip]=\"secondaryLabel\" tooltipPosition=\"top\" showDelay=\"500\">{{ secondaryLabel ? secondaryLabel : secondaryEmptyLabel }}</span>\n\n <div #descriptionTemplate>\n <ng-content select=\"[descriptionTemplate]\"></ng-content>\n </div>\n <span [id]=\"id + '-description'\" class=\"description\"\n [ngClass]=\"{'global-search-item__italic' : !secondaryLabel}\"\n *ngIf=\" !descriptionTemplate.children.length && !isMediumSize() && !isSmallSize()\"\n [pTooltip]=\"tertiaryLabel\" tooltipPosition=\"top\" showDelay=\"500\">{{ tertiaryLabel ? tertiaryLabel : tertiaryEmptyLabel }}</span>\n </div>\n <div class=\"global-search-item__container--width-40 global-search__dropdown--template\" *ngIf=\"!isSmallSize()\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n </div>\n </div>\n</ng-template>\n",
13796
+ styles: [".container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;height:100%;border-bottom:1px solid #ccc;padding:15px 5px;margin:0 10px}::ng-deep .no-padding{padding:0!important;min-width:0!important}::ng-deep .s-button-with-text{min-width:0!important}.global-search-item__italic{font-style:italic}.global-search-item__container{margin-left:10px;width:100%}.global-search-item__container,.global-search-item__container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.global-search-item__container .label{color:#333;display:block}.global-search-item__container .description{color:#999;display:block}.global-search-item__container--width-60{width:60%}.global-search-item__container--width-40{width:40%}.global-search-item__text-align--right{text-align:right;padding:2px 0 0 15px}.global-search__dropdown--template{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;text-align:right!important}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.global-search-item__container{-ms-flex:1;flex:1}}@media (max-width:767px){.global-search-item__container,.global-search-item__container span{white-space:normal}}.global-search-item__container:only-child{margin-left:0}"]
13523
13797
  })
13524
- ], IAInsightCardLoaderComponent);
13525
- return IAInsightCardLoaderComponent;
13798
+ ], GlobalSearchDropdownItemComponent);
13799
+ return GlobalSearchDropdownItemComponent;
13526
13800
  }());
13527
13801
 
13528
- var IAInsightTemplateTypes;
13529
- (function (IAInsightTemplateTypes) {
13530
- IAInsightTemplateTypes["Empty"] = "empty";
13531
- IAInsightTemplateTypes["Intro"] = "intro";
13532
- IAInsightTemplateTypes["NoPermission"] = "noPermission";
13533
- })(IAInsightTemplateTypes || (IAInsightTemplateTypes = {}));
13534
-
13535
- var IAInsightComponent = /** @class */ (function () {
13536
- function IAInsightComponent() {
13537
- this.insights = [];
13538
- this.hasPermission = true;
13802
+ var GlobalSearchComponent = /** @class */ (function () {
13803
+ function GlobalSearchComponent(cdr) {
13804
+ this.cdr = cdr;
13805
+ this.id = "s-global-search-" + GlobalSearchDropdownItemComponent.nextId++;
13806
+ this.delay = 500;
13807
+ this.isLoading = false;
13808
+ this.showFooter = true;
13809
+ this.onSearch = new EventEmitter();
13810
+ this.onFocus = new EventEmitter();
13811
+ this.onShowMore = new EventEmitter();
13812
+ this.wasSearched = false;
13813
+ this.isModalLoading = false;
13814
+ this.expanded = true;
13539
13815
  }
13540
- IAInsightComponent.prototype.ngAfterContentInit = function () {
13541
- this._getTemplates();
13542
- };
13543
- IAInsightComponent.prototype.open = function () {
13544
- this.sidebar.open();
13816
+ GlobalSearchComponent.prototype.onChange = function () {
13817
+ var _this = this;
13818
+ var search = this.search;
13819
+ setTimeout(function () {
13820
+ if (_this.search === search) {
13821
+ _this.canShowGlobalSearchActive();
13822
+ _this.onSearch.emit(_this.search);
13823
+ }
13824
+ }, this.delay);
13545
13825
  };
13546
- IAInsightComponent.prototype.close = function () {
13547
- this.sidebar.close();
13826
+ GlobalSearchComponent.prototype.focusIn = function () {
13827
+ this.onFocus.emit(true);
13548
13828
  };
13549
- IAInsightComponent.prototype.getIntroTemplate = function () {
13550
- return this._getCustomTemplate(IAInsightTemplateTypes.Intro);
13829
+ GlobalSearchComponent.prototype.focusOut = function () {
13830
+ this.onFocus.emit(false);
13551
13831
  };
13552
- IAInsightComponent.prototype.getNoPermissionTemplate = function () {
13553
- return this._getCustomTemplate(IAInsightTemplateTypes.NoPermission);
13832
+ GlobalSearchComponent.prototype.showMore = function () {
13833
+ this.onShowMore.emit();
13554
13834
  };
13555
- IAInsightComponent.prototype.getEmptyTemplate = function () {
13556
- return this._getCustomTemplate(IAInsightTemplateTypes.Empty);
13835
+ GlobalSearchComponent.prototype.removeActiveClassByGlobalSearch = function () {
13836
+ ExportUtils.removeClass(this.globalSearch, "global-search__input-active");
13557
13837
  };
13558
- IAInsightComponent.prototype._getCustomTemplate = function (type) {
13559
- var _a;
13560
- return (_a = this.templates.find(function (template) { return template.type === type; })) === null || _a === void 0 ? void 0 : _a.template;
13838
+ GlobalSearchComponent.prototype.close = function () {
13839
+ this.search = null;
13840
+ this.wasSearched = false;
13841
+ this.dropdownItens = null;
13842
+ this.isModalLoading = false;
13843
+ this.removeActiveClassByGlobalSearch();
13561
13844
  };
13562
- IAInsightComponent.prototype._getTemplates = function () {
13563
- this.introTemplate = this.getIntroTemplate();
13564
- this.emptyTemplate = this.getEmptyTemplate();
13565
- this.noPermissionTemplate = this.getNoPermissionTemplate();
13845
+ GlobalSearchComponent.prototype.canShowGlobalSearchActive = function () {
13846
+ this.wasSearched = !!this.search;
13847
+ if (this.search) {
13848
+ ExportUtils.addClass(this.globalSearch, "global-search__input-active");
13849
+ }
13850
+ else {
13851
+ this.removeActiveClassByGlobalSearch();
13852
+ this.close();
13853
+ }
13854
+ this.cdr.detectChanges();
13566
13855
  };
13856
+ GlobalSearchComponent.nextId = 0;
13857
+ GlobalSearchComponent.ctorParameters = function () { return [
13858
+ { type: ChangeDetectorRef }
13859
+ ]; };
13860
+ __decorate([
13861
+ ViewChild("globalSearch", { static: false })
13862
+ ], GlobalSearchComponent.prototype, "globalSearch", void 0);
13567
13863
  __decorate([
13568
13864
  Input()
13569
- ], IAInsightComponent.prototype, "insights", void 0);
13865
+ ], GlobalSearchComponent.prototype, "id", void 0);
13570
13866
  __decorate([
13571
13867
  Input()
13572
- ], IAInsightComponent.prototype, "hasPermission", void 0);
13868
+ ], GlobalSearchComponent.prototype, "delay", void 0);
13573
13869
  __decorate([
13574
13870
  Input()
13575
- ], IAInsightComponent.prototype, "introText", void 0);
13871
+ ], GlobalSearchComponent.prototype, "totalItensLabel", void 0);
13576
13872
  __decorate([
13577
13873
  Input()
13578
- ], IAInsightComponent.prototype, "emptyText", void 0);
13874
+ ], GlobalSearchComponent.prototype, "showMoreLabel", void 0);
13579
13875
  __decorate([
13580
13876
  Input()
13581
- ], IAInsightComponent.prototype, "noPermissionText", void 0);
13877
+ ], GlobalSearchComponent.prototype, "placeholder", void 0);
13878
+ __decorate([
13879
+ Input()
13880
+ ], GlobalSearchComponent.prototype, "isLoading", void 0);
13881
+ __decorate([
13882
+ Input()
13883
+ ], GlobalSearchComponent.prototype, "totalElements", void 0);
13884
+ __decorate([
13885
+ Input()
13886
+ ], GlobalSearchComponent.prototype, "emptyTitle", void 0);
13887
+ __decorate([
13888
+ Input()
13889
+ ], GlobalSearchComponent.prototype, "emptyDescription", void 0);
13890
+ __decorate([
13891
+ Input()
13892
+ ], GlobalSearchComponent.prototype, "emptyIcon", void 0);
13893
+ __decorate([
13894
+ Input()
13895
+ ], GlobalSearchComponent.prototype, "showFooter", void 0);
13896
+ __decorate([
13897
+ ContentChildren(GlobalSearchDropdownItemComponent)
13898
+ ], GlobalSearchComponent.prototype, "dropdownItens", void 0);
13899
+ __decorate([
13900
+ Output()
13901
+ ], GlobalSearchComponent.prototype, "onSearch", void 0);
13902
+ __decorate([
13903
+ Output()
13904
+ ], GlobalSearchComponent.prototype, "onFocus", void 0);
13905
+ __decorate([
13906
+ Output()
13907
+ ], GlobalSearchComponent.prototype, "onShowMore", void 0);
13908
+ GlobalSearchComponent = __decorate([
13909
+ Component({
13910
+ selector: "s-global-search",
13911
+ template: "<div class=\"ui-inputgroup\">\n <input #globalSearch class=\"global-search__input\" [(ngModel)]=\"search\" (ngModelChange)=\"onChange()\" pInputText\n [placeholder]=\"placeholder\" (focus)=\"focusIn()\" (blur)=\"focusOut()\">\n <span class=\"ui-inputgroup-addon global-search__span\"><em class=\"fas fa-search\"></em></span>\n <div class=\"global-search__modal\" *ngIf=\"wasSearched\">\n <div *sLoadingState=\"isLoading && !isModalLoading\" class=\"global-search__loader\">\n <div class=\"global-search__container\" *ngIf=\"dropdownItens && dropdownItens.length > 0 || isLoading\">\n <div *ngIf=\"dropdownItens && dropdownItens.length > 0\">\n <div class=\"global-search__modal--total-itens-title\">\n <span class=\"ui-g-11 no-space\">{{totalItensLabel}}</span>\n <span class=\"ui-g-1 no-space global-search__modal--total-itens-title-icon\" (click)=\"close()\"><em\n class=\"fas fa-times\"></em></span>\n </div>\n <div class=\"no-space global-search__dropdown--itens\"\n [@expandableContent]=\"expanded\">\n <ng-container *ngFor=\"let item of dropdownItens\">\n <div class=\"s-object-card-field no-space global-search__dropdown--itens-container\">\n <ng-container *ngTemplateOutlet=\"item.content\"></ng-container>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"showFooter\" class=\"ui-g-12 global-search__modal--footer\">\n <s-button class=\"global-search__show-more\" (click)=\"showMore()\" priority=\"link\">\n {{showMoreLabel}}\n </s-button>\n </div>\n </div>\n </div>\n <s-empty-state *ngIf=\"(!dropdownItens || dropdownItens.length==0) && !isLoading\" [title]=\"emptyTitle\"\n [description]=\"emptyDescription\" ngClass=\"global-search__empty-state--icon\"\n [iconClass]=\"(emptyIcon ? emptyIcon : 'fas fa-search')\">\n </s-empty-state>\n </div>\n </div>\n <div *ngIf=\"wasSearched\" class=\"global-search__background\" (click)=\"close()\"></div>\n</div>\n",
13912
+ animations: [
13913
+ trigger("expandableContent", [
13914
+ state("*", style$7({
13915
+ height: "0",
13916
+ })),
13917
+ state("false", style$7({
13918
+ height: "0",
13919
+ })),
13920
+ state("true", style$7({
13921
+ height: "*",
13922
+ })),
13923
+ transition("* => true", animate("200ms ease-out")),
13924
+ transition("false <=> true", animate("200ms ease-out")),
13925
+ ]),
13926
+ ],
13927
+ styles: [".global-search__input{border-radius:20px 0 0 20px;width:136px;cursor:pointer;padding:0 0 0 15px;transition:.3s}.ui-inputtext{min-height:25px!important;height:25px!important}.global-search__span{transition:.3s;background:0 0!important;border-left:none;border-radius:0 20px 20px 0!important;padding:1px 15px 0 0!important;height:25px!important}.global-search__input:active,.global-search__input:focus{width:466px;cursor:default;transition:.3s;border-top:1px solid #428bca;border-left:1px solid #428bca;border-bottom:1px solid #428bca}.global-search__input:active,.global-search__input:focus+.global-search__span{transition:.3s;border-left:none;border-top:1px solid #428bca!important;border-right:1px solid #428bca!important;border-bottom:1px solid #428bca!important}.global-search__input-active{width:466px;cursor:default;transition:.3s}.global-search__modal{box-shadow:0 2px 8px 0 rgba(0,0,0,.4);border-radius:5px;width:500px;background:#fff;position:absolute;margin-top:60px;z-index:6;min-height:50px}::ng-deep .global-search__loader{border-radius:5px!important;width:100%}.global-search__container{min-height:50px;width:100%}.global-search__modal--total-itens-title{padding:15px;color:#333;border-bottom:1px solid #ccc;font-weight:600;height:50px}.global-search__modal--footer{height:50px;border-top:1px solid #ccc}.global-search__dropdown--itens{max-height:510px;overflow:auto}.global-search__dropdown--itens-container:hover{background:#dbe0e4}.global-search__modal--total-itens-title-icon{text-align:right;cursor:pointer}.global-search__background{background:rgba(0,0,0,.4);width:100%;height:calc(100vh - 70px);position:absolute;left:0;margin-top:50px;z-index:5;cursor:pointer}.no-space{padding:0;margin:0}.global-search__show-more{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}body .global-search__show-more--button{color:#428bca!important}.modal{position:absolute;left:1%;width:98%;height:calc(100vh - 90px)}.global-search__empty-state--icon{margin:42px 134px}::ng-deep .global-search__empty-state--icon .container .icon{font-size:40px}::ng-deep .s-button-priority-link{color:#428bca}@media all and (max-width:900px){.global-search__modal{top:20px;width:98%;left:1%}.global-search__input-active,.global-search__input:active,.global-search__input:focus{position:absolute;width:calc(100% - 70px);left:2%}body .global-search__dropdown--itens{max-height:100%;overflow:auto}}@media all and (max-width:767px){.global-search__modal{top:15px}.global-search__input-active,.global-search__input:active,.global-search__input:focus{width:calc(100% - 55px)}}@media all and (max-width:600px){.global-search__modal--itens{height:calc(100vh - 100px);background:#fff}.global-search__input-active,.global-search__input:active,.global-search__input:focus{position:absolute;width:calc(100% - 53px);left:2%}body .global-search__dropdown--itens{max-height:100%;overflow:auto}.global-search__dropdown--itens{max-height:100%;background:#fff}.global-search__modal--footer{background:#fff;height:50px}.global-search__modal{top:17px;border-radius:0;margin-top:55px;box-shadow:none;left:0;width:100%}}"]
13928
+ })
13929
+ ], GlobalSearchComponent);
13930
+ return GlobalSearchComponent;
13931
+ }());
13932
+
13933
+ var InfiniteScrollDirective = /** @class */ (function () {
13934
+ function InfiniteScrollDirective(el) {
13935
+ this.el = el;
13936
+ this.onScroll = new EventEmitter();
13937
+ }
13938
+ InfiniteScrollDirective.prototype.scroll = function () {
13939
+ if (this.el.nativeElement.scrollTop > (this.el.nativeElement.scrollHeight - this.el.nativeElement.offsetHeight - 2)) {
13940
+ this.onScroll.emit();
13941
+ }
13942
+ };
13943
+ InfiniteScrollDirective.ctorParameters = function () { return [
13944
+ { type: ElementRef }
13945
+ ]; };
13582
13946
  __decorate([
13583
- ViewChild(IAInsightSidebarComponent)
13584
- ], IAInsightComponent.prototype, "sidebar", void 0);
13947
+ Output()
13948
+ ], InfiniteScrollDirective.prototype, "onScroll", void 0);
13585
13949
  __decorate([
13586
- ContentChildren(TemplateDirective)
13587
- ], IAInsightComponent.prototype, "templates", void 0);
13588
- IAInsightComponent = __decorate([
13589
- Component({
13590
- selector: "s-ia-insight",
13591
- template: "<s-ia-insight-sidebar\n #sidebar\n [insights]=\"insights\"\n [hasPermission]=\"hasPermission\"\n [introText]=\"introText\"\n [introTemplate]=\"introTemplate\"\n [emptyText]=\"emptyText\"\n [emptyTemplate]=\"emptyTemplate\"\n [noPermissionText]=\"noPermissionText\"\n [noPermissionTemplate]=\"noPermissionTemplate\">\n</s-ia-insight-sidebar>",
13592
- styles: [""]
13950
+ HostListener("scroll")
13951
+ ], InfiniteScrollDirective.prototype, "scroll", null);
13952
+ InfiniteScrollDirective = __decorate([
13953
+ Directive({
13954
+ selector: "[sInfiniteScroll]"
13593
13955
  })
13594
- ], IAInsightComponent);
13595
- return IAInsightComponent;
13956
+ ], InfiniteScrollDirective);
13957
+ return InfiniteScrollDirective;
13596
13958
  }());
13597
13959
 
13598
- var IAInsightModule = /** @class */ (function () {
13599
- function IAInsightModule() {
13960
+ var InfiniteScrollModule = /** @class */ (function () {
13961
+ function InfiniteScrollModule() {
13600
13962
  }
13601
- IAInsightModule = __decorate([
13963
+ InfiniteScrollModule = __decorate([
13602
13964
  NgModule({
13603
- imports: [
13604
- CommonModule,
13605
- TranslateModule,
13606
- BadgeModule,
13607
- ButtonModule,
13608
- TooltipModule,
13609
- TemplateModule,
13610
- SVGFactoryModule,
13611
- ],
13612
13965
  declarations: [
13613
- IAInsightComponent,
13614
- IAInsightCardComponent,
13615
- IAInsightSidebarComponent,
13616
- IAInsightCardLoaderComponent,
13966
+ InfiniteScrollDirective
13617
13967
  ],
13618
- exports: [
13619
- IAInsightComponent,
13620
- TemplateModule,
13968
+ imports: [
13969
+ CommonModule
13621
13970
  ],
13971
+ exports: [
13972
+ InfiniteScrollDirective
13973
+ ]
13622
13974
  })
13623
- ], IAInsightModule);
13624
- return IAInsightModule;
13625
- }());
13626
-
13627
- var HeaderComponent = /** @class */ (function () {
13628
- function HeaderComponent() {
13629
- }
13630
- HeaderComponent = __decorate([
13631
- Component({
13632
- selector: "s-header",
13633
- template: "<ng-content></ng-content>"
13634
- })
13635
- ], HeaderComponent);
13636
- return HeaderComponent;
13637
- }());
13638
-
13639
- var FooterComponent = /** @class */ (function () {
13640
- function FooterComponent() {
13641
- }
13642
- FooterComponent = __decorate([
13643
- Component({
13644
- selector: "s-footer",
13645
- template: "<ng-content></ng-content>"
13646
- })
13647
- ], FooterComponent);
13648
- return FooterComponent;
13975
+ ], InfiniteScrollModule);
13976
+ return InfiniteScrollModule;
13649
13977
  }());
13650
13978
 
13651
- var StructureModule = /** @class */ (function () {
13652
- function StructureModule() {
13979
+ var GlobalSearchModule = /** @class */ (function () {
13980
+ function GlobalSearchModule() {
13653
13981
  }
13654
- StructureModule = __decorate([
13982
+ GlobalSearchModule = __decorate([
13655
13983
  NgModule({
13656
- imports: [CommonModule],
13657
- declarations: [HeaderComponent, FooterComponent],
13658
- exports: [HeaderComponent, FooterComponent],
13984
+ declarations: [
13985
+ GlobalSearchComponent,
13986
+ GlobalSearchDropdownItemComponent
13987
+ ],
13988
+ imports: [
13989
+ CommonModule,
13990
+ InputTextModule,
13991
+ FormsModule,
13992
+ ReactiveFormsModule,
13993
+ TooltipModule$1,
13994
+ ThumbnailModule,
13995
+ ButtonModule,
13996
+ LoadingStateModule,
13997
+ InfiniteScrollModule,
13998
+ EmptyStateModule
13999
+ ],
14000
+ exports: [
14001
+ GlobalSearchComponent,
14002
+ GlobalSearchDropdownItemComponent,
14003
+ TooltipModule$1,
14004
+ ThumbnailModule,
14005
+ ButtonModule,
14006
+ LoadingStateModule,
14007
+ EmptyStateModule
14008
+ ],
14009
+ entryComponents: [
14010
+ GlobalSearchComponent,
14011
+ GlobalSearchDropdownItemComponent
14012
+ ]
13659
14013
  })
13660
- ], StructureModule);
13661
- return StructureModule;
14014
+ ], GlobalSearchModule);
14015
+ return GlobalSearchModule;
13662
14016
  }());
13663
14017
 
13664
- var ImageCropperComponent = /** @class */ (function () {
13665
- function ImageCropperComponent() {
13666
- this.id = "s-image-cropper-" + ImageCropperComponent_1.nextId++;
13667
- this.visible = false;
13668
- this.header = "Recortar imagem";
13669
- this.cropLabel = "Recortar";
13670
- this.selectAnotherLabel = "Trocar";
13671
- this.removeLabel = "Remover";
13672
- this.cancelLabel = "Cancelar";
13673
- this.emptyStateTitle = "Selecione uma foto, em seguida você poderá ajustá-la";
13674
- this.emptyStateActionLabel = "Escolher imagem";
13675
- this.emptyStateIconClass = "fa fa-picture-o";
13676
- this.aspectRatio = NaN;
13677
- this.rounded = false;
13678
- this.allowSelectAnother = true;
13679
- this.allowRemove = true;
13680
- this.allowCancel = true;
13681
- this.visibleChange = new EventEmitter();
13682
- this.changeImage = new EventEmitter();
13683
- this.croppedImage = new EventEmitter();
13684
- this.croppedCanvas = new EventEmitter();
13685
- this.removedImage = new EventEmitter();
13686
- this.cancel = new EventEmitter();
14018
+ var IAInsightCardComponent = /** @class */ (function () {
14019
+ function IAInsightCardComponent(clipboard, messageService, translateService) {
14020
+ this.clipboard = clipboard;
14021
+ this.messageService = messageService;
14022
+ this.translateService = translateService;
14023
+ this.open = false;
14024
+ this.isLoading = false;
14025
+ this.likeSelected = false;
14026
+ this.dislikeSelected = false;
13687
14027
  }
13688
- ImageCropperComponent_1 = ImageCropperComponent;
13689
- ImageCropperComponent.prototype.ngOnInit = function () {
13690
- if (this.imageSource)
13691
- this.initCropper();
14028
+ IAInsightCardComponent.prototype.toggle = function () {
14029
+ this.open = !this.open;
14030
+ this._requestInsight();
13692
14031
  };
13693
- ImageCropperComponent.prototype.ngOnChanges = function (changes) {
13694
- if (changes.imageSource && changes.imageSource.currentValue) {
13695
- this.initCropper();
14032
+ IAInsightCardComponent.prototype.onLikeSelected = function () {
14033
+ var _a, _b;
14034
+ if (this.likeSelected) {
14035
+ this.likeSelected = false;
13696
14036
  }
13697
- };
13698
- ImageCropperComponent.prototype.initCropper = function () {
13699
- if (this.cropper) {
13700
- this.cropper.destroy();
14037
+ else {
14038
+ this.likeSelected = true;
14039
+ this.dislikeSelected = false;
14040
+ (_b = (_a = this.insight).onLikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13701
14041
  }
13702
- this.image.nativeElement.src = this.imageSource;
13703
- this.cropper = new Cropper(this.image.nativeElement, {
13704
- aspectRatio: this.rounded ? 1 : this.aspectRatio,
13705
- guides: false,
13706
- dragMode: "move",
13707
- minCropBoxHeight: 2,
13708
- minCropBoxWidth: 2,
13709
- toggleDragModeOnDblclick: false,
13710
- });
13711
- };
13712
- ImageCropperComponent.prototype.getRoundedCanvas = function (sourceCanvas) {
13713
- var canvas = document.createElement("canvas");
13714
- var context = canvas.getContext("2d");
13715
- var width = sourceCanvas.width;
13716
- var height = sourceCanvas.height;
13717
- canvas.width = width;
13718
- canvas.height = height;
13719
- context.imageSmoothingEnabled = true;
13720
- context.drawImage(sourceCanvas, 0, 0, width, height);
13721
- context.globalCompositeOperation = "destination-in";
13722
- context.beginPath();
13723
- context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true);
13724
- context.fill();
13725
- return canvas;
13726
14042
  };
13727
- ImageCropperComponent.prototype.onCropImage = function () {
13728
- if (!this.imageSource) {
13729
- this.croppedImage.emit();
13730
- this.croppedCanvas.emit();
14043
+ IAInsightCardComponent.prototype.onDislikeSelected = function () {
14044
+ var _a, _b;
14045
+ if (this.dislikeSelected) {
14046
+ this.dislikeSelected = false;
13731
14047
  }
13732
14048
  else {
13733
- var _croppedCanvas = this.rounded ? this.getRoundedCanvas(this.cropper.getCroppedCanvas()) : this.cropper.getCroppedCanvas();
13734
- this.croppedCanvas.emit(_croppedCanvas);
13735
- this.croppedImage.emit(_croppedCanvas.toDataURL());
14049
+ this.dislikeSelected = true;
14050
+ this.likeSelected = false;
14051
+ (_b = (_a = this.insight).onDislikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13736
14052
  }
13737
- this.visibleChange.emit(false);
13738
14053
  };
13739
- ImageCropperComponent.prototype.onChangeImage = function () {
13740
- this.changeImage.emit();
14054
+ IAInsightCardComponent.prototype.copyContent = function () {
14055
+ var _a, _b;
14056
+ (_b = (_a = this.insight).onCopy) === null || _b === void 0 ? void 0 : _b.call(_a, this.content);
14057
+ if (this.clipboard.copy(this.content)) {
14058
+ this.messageService.add({
14059
+ severity: "info",
14060
+ summary: this.translateService.instant("platform.angular_components.copied_to_clipboard"),
14061
+ });
14062
+ }
13741
14063
  };
13742
- ImageCropperComponent.prototype.onRemoveImage = function () {
13743
- this.imageSource = undefined;
13744
- this.removedImage.emit();
14064
+ IAInsightCardComponent.prototype.reloadContent = function () {
14065
+ this._requestInsight();
14066
+ };
14067
+ IAInsightCardComponent.prototype._requestInsight = function () {
14068
+ var _this = this;
14069
+ this.isLoading = true;
14070
+ this.insight.request$
14071
+ .pipe(first(), finalize(function () { return (_this.isLoading = false); }))
14072
+ .subscribe(function (content) {
14073
+ _this.content = marked.marked(content);
14074
+ });
14075
+ };
14076
+ IAInsightCardComponent.ctorParameters = function () { return [
14077
+ { type: Clipboard },
14078
+ { type: MessageService },
14079
+ { type: TranslateService }
14080
+ ]; };
14081
+ __decorate([
14082
+ Input()
14083
+ ], IAInsightCardComponent.prototype, "insight", void 0);
14084
+ IAInsightCardComponent = __decorate([
14085
+ Component({
14086
+ selector: "s-ia-insight-card",
14087
+ template: "<div class=\"ia-insight-card\" [ngClass]=\"{ 'ia-insight-card--close': !open }\">\n <div class=\"header\" (click)=\"toggle()\">\n <s-badge text=\"Insight\" iconClass=\"fal fa-lightbulb\"></s-badge>\n <span class=\"insight-title\">{{ insight.title }}</span>\n <span\n class=\"toggle-icon fas\"\n [ngClass]=\"{\n 'fa-angle-down': !open,\n 'fa-angle-up': open\n }\"\n >\n </span>\n </div>\n <div class=\"content\">\n <ng-container *ngIf=\"isLoading; then loadingBlock; else contentBlock\"></ng-container>\n <ng-template #loadingBlock>\n <s-ia-insight-card-loader></s-ia-insight-card-loader>\n </ng-template>\n <ng-template #contentBlock>\n <ng-container *ngIf=\"content; then successBlock; else errorBlock\"></ng-container>\n\n <ng-template #successBlock>\n <span class=\"text\" [innerHTML]=\"content\"></span>\n </ng-template>\n <ng-template #errorBlock>\n <span class=\"text text--error\">{{ \"platform.angular_components.error_loading_insight_alt\" | translate }}</span>\n </ng-template>\n\n <div class=\"options\">\n <button [disabled]=\"!content\" (click)=\"copyContent()\" class=\"option fal fa-copy\"></button>\n <button (click)=\"reloadContent()\" class=\"option fal fa-redo\"></button>\n <button\n *ngIf=\"insight.onLikeSelected\"\n [disabled]=\"!content\"\n (click)=\"onLikeSelected()\"\n class=\"option\"\n [ngClass]=\"{\n 'fal': !likeSelected,\n 'fas': likeSelected,\n 'fa-thumbs-up': true\n }\">\n </button>\n <button\n *ngIf=\"insight.onDislikeSelected\"\n [disabled]=\"!content\"\n (click)=\"onDislikeSelected()\"\n class=\"option\"\n [ngClass]=\"{\n 'fal': !dislikeSelected,\n 'fas': dislikeSelected,\n 'fa-thumbs-down': true\n }\">\n </button>\n </div>\n </ng-template>\n </div>\n</div>\n",
14088
+ styles: [".ia-insight-card{background-color:#fff;border:1px solid #9ecad4;border-radius:4px;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.ia-insight-card .header{-ms-flex-align:center;align-items:center;background-color:#f1f7f8;border-bottom:1px solid #9ecad4;display:-ms-flexbox;display:flex;gap:8px;min-height:60px;padding:8px 16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ia-insight-card .header .insight-title{color:#428bca;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;line-height:150%}.ia-insight-card .header .toggle-icon{color:#888b99;font-size:20px}.ia-insight-card .content{-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;cursor:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px;min-height:160px;padding:24px}.ia-insight-card .content .text{color:#212533;font-family:\"Open Sans\",sans-serif;font-size:14px;width:100%}.ia-insight-card .content .text--error{text-align:center}.ia-insight-card .content .options{display:-ms-flexbox;display:flex;gap:8px}.ia-insight-card .content .options .option{background-color:transparent;border:none;color:#428bca;cursor:pointer;font-size:12px}.ia-insight-card .content .options .option:disabled{color:#c1c1cc;cursor:auto}.ia-insight-card--close{border-color:#dedce5}.ia-insight-card--close .header{background-color:#fbfafc;border:#dedce5}.ia-insight-card--close .header .insight-title{color:#888b99}.ia-insight-card--close .content{display:none}"]
14089
+ })
14090
+ ], IAInsightCardComponent);
14091
+ return IAInsightCardComponent;
14092
+ }());
14093
+
14094
+ var IAInsightSidebarComponent = /** @class */ (function () {
14095
+ function IAInsightSidebarComponent() {
14096
+ this.insights = [];
14097
+ this.opened = false;
14098
+ }
14099
+ IAInsightSidebarComponent.prototype.toggle = function () {
14100
+ this.opened = !this.opened;
13745
14101
  };
13746
- ImageCropperComponent.prototype.onCancel = function () {
13747
- this.visibleChange.emit(false);
13748
- this.cancel.emit();
14102
+ IAInsightSidebarComponent.prototype.open = function () {
14103
+ this.opened = true;
13749
14104
  };
13750
- ImageCropperComponent.prototype.onModalVisibleChange = function (visible) {
13751
- if (!visible)
13752
- this.onCancel();
13753
- this.visibleChange.emit(visible);
14105
+ IAInsightSidebarComponent.prototype.close = function () {
14106
+ this.opened = false;
13754
14107
  };
13755
- var ImageCropperComponent_1;
13756
- ImageCropperComponent.nextId = 0;
13757
- __decorate([
13758
- Input()
13759
- ], ImageCropperComponent.prototype, "id", void 0);
13760
- __decorate([
13761
- Input()
13762
- ], ImageCropperComponent.prototype, "visible", void 0);
13763
- __decorate([
13764
- Input()
13765
- ], ImageCropperComponent.prototype, "header", void 0);
13766
14108
  __decorate([
13767
14109
  Input()
13768
- ], ImageCropperComponent.prototype, "cropLabel", void 0);
14110
+ ], IAInsightSidebarComponent.prototype, "insights", void 0);
13769
14111
  __decorate([
13770
14112
  Input()
13771
- ], ImageCropperComponent.prototype, "selectAnotherLabel", void 0);
14113
+ ], IAInsightSidebarComponent.prototype, "hasPermission", void 0);
13772
14114
  __decorate([
13773
14115
  Input()
13774
- ], ImageCropperComponent.prototype, "removeLabel", void 0);
14116
+ ], IAInsightSidebarComponent.prototype, "introText", void 0);
13775
14117
  __decorate([
13776
14118
  Input()
13777
- ], ImageCropperComponent.prototype, "cancelLabel", void 0);
14119
+ ], IAInsightSidebarComponent.prototype, "introTemplate", void 0);
13778
14120
  __decorate([
13779
14121
  Input()
13780
- ], ImageCropperComponent.prototype, "emptyStateTitle", void 0);
14122
+ ], IAInsightSidebarComponent.prototype, "emptyText", void 0);
13781
14123
  __decorate([
13782
14124
  Input()
13783
- ], ImageCropperComponent.prototype, "emptyStateActionLabel", void 0);
14125
+ ], IAInsightSidebarComponent.prototype, "emptyTemplate", void 0);
13784
14126
  __decorate([
13785
14127
  Input()
13786
- ], ImageCropperComponent.prototype, "emptyStateIconClass", void 0);
14128
+ ], IAInsightSidebarComponent.prototype, "noPermissionText", void 0);
13787
14129
  __decorate([
13788
14130
  Input()
13789
- ], ImageCropperComponent.prototype, "aspectRatio", void 0);
14131
+ ], IAInsightSidebarComponent.prototype, "noPermissionTemplate", void 0);
14132
+ IAInsightSidebarComponent = __decorate([
14133
+ Component({
14134
+ selector: "s-ia-insight-sidebar",
14135
+ template: "<div\n class=\"sidebar\"\n [class.opened]=\"opened\">\n <div class=\"header\">\n <button (click)=\"close()\" class=\"option\">\n <span class=\"far fa-chevron-double-right\"></span>\n </button>\n <div class=\"title\">\n <span><ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container></span>\n <span>Insight</span>\n </div>\n </div>\n <div class=\"intro\">\n <ng-container *ngIf=\"hasPermission; then permissionBlock; else noPermissionBlock\"></ng-container>\n\n <ng-template #permissionBlock>\n <ng-container *ngIf=\"insights?.length; then introBlock; else emptyBlock\"></ng-container>\n \n <ng-template #introBlock>\n <ng-container *ngIf=\"introTemplate; then introCustomBlock; else introTextBlock\"></ng-container>\n\n <ng-template #introCustomBlock>\n <ng-container *ngTemplateOutlet=\"introTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #introTextBlock>\n <span class=\"text\">{{ introText || \"platform.angular_components.insight_intro\" | translate }}</span>\n </ng-template>\n </ng-template>\n \n <ng-template #emptyBlock>\n <ng-container *ngIf=\"emptyTemplate; then emptyCustomBlock; else emptyTextBlock\"></ng-container>\n\n <ng-template #emptyCustomBlock>\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #emptyTextBlock>\n <span class=\"text\">{{ emptyText || \"platform.angular_components.insight_empty\" | translate }}</span>\n </ng-template>\n </ng-template>\n </ng-template>\n \n <ng-template #noPermissionBlock>\n <ng-container *ngIf=\"noPermissionTemplate; then noPermissionCustomBlock; else noPermissionTextBlock\"></ng-container>\n\n <ng-template #noPermissionCustomBlock>\n <ng-container *ngTemplateOutlet=\"noPermissionTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #noPermissionTextBlock>\n <span>{{ noPermissionText || \"platform.angular_components.insight_no_permission\" | translate }}</span>\n </ng-template>\n </ng-template>\n </div>\n <div class=\"insights\">\n <ng-container *ngIf=\"insights?.length\">\n <s-ia-insight-card\n *ngFor=\"let insight of insights\"\n [insight]=\"insight\">\n </s-ia-insight-card>\n </ng-container>\n </div>\n</div>\n\n<ng-template #iassistIcon>\n <div style=\"width: 28px; height: 28px;\">\n <span *sSVGFactory=\"'iassist'\"></span>\n </div>\n</ng-template>\n",
14136
+ styles: [".sidebar{background-color:#fff;border-left:1px solid #dedce5;height:100%;overflow-x:hidden;position:fixed;right:-25%;transition:.5s;top:0;width:25%;z-index:1002}.sidebar .header{border-bottom:1px solid #dedce5;display:-ms-flexbox;display:flex;gap:16px;padding:12px 20px}.sidebar .header .option{background-color:transparent;border:none;color:#428bca;cursor:pointer;font-size:16px;padding:12px}.sidebar .header .title{-ms-flex-align:center;align-items:center;color:#212533;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:16px;gap:16px;line-height:1;-webkit-user-select:none;-ms-user-select:none;user-select:none}.sidebar .intro{margin:8px 40px}.sidebar .intro .text{color:#212533;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;-ms-flex-pack:center;justify-content:center;line-height:1.5;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none}.sidebar.opened{right:0}.sidebar.opened .insights{padding:12px}.insights{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:12px}@media (max-width:1366px){.sidebar{right:-50%;width:50%}}@media (max-width:768px){.sidebar{right:-75%;width:75%}}@media (max-width:600px){.sidebar{right:-100%;width:100%}}"]
14137
+ })
14138
+ ], IAInsightSidebarComponent);
14139
+ return IAInsightSidebarComponent;
14140
+ }());
14141
+
14142
+ var IAInsightCardLoaderComponent = /** @class */ (function () {
14143
+ function IAInsightCardLoaderComponent() {
14144
+ }
14145
+ IAInsightCardLoaderComponent = __decorate([
14146
+ Component({
14147
+ selector: "s-ia-insight-card-loader",
14148
+ template: "<div class=\"ia-insight-card-loader\">\n <div class=\"loader\">\n <div class=\"loader-icon\">\n <div *sSVGFactory=\"'iassist'\"></div>\n </div>\n </div>\n \n <span class=\"loader-label\">{{ \"platform.angular_components.loading_insight\" | translate }}</span>\n</div>\n",
14149
+ styles: [".ia-insight-card-loader{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.ia-insight-card-loader .loader{-ms-flex-align:center;align-items:center;animation:2s linear infinite spin;border:2px solid #f1f7f8;border-top:2px solid #0fa389;border-radius:50%;display:-ms-flexbox;display:flex;height:48px;-ms-flex-pack:center;justify-content:center;width:48px}.ia-insight-card-loader .loader .loader-icon{animation:2s linear infinite reverse spin;height:32px;transform:translate(-50%,-50%)}.ia-insight-card-loader .loader-label{color:#888b99;font-family:\"Open Sans\",sans-serif;font-size:16px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]
14150
+ })
14151
+ ], IAInsightCardLoaderComponent);
14152
+ return IAInsightCardLoaderComponent;
14153
+ }());
14154
+
14155
+ var IAInsightTemplateTypes;
14156
+ (function (IAInsightTemplateTypes) {
14157
+ IAInsightTemplateTypes["Empty"] = "empty";
14158
+ IAInsightTemplateTypes["Intro"] = "intro";
14159
+ IAInsightTemplateTypes["NoPermission"] = "noPermission";
14160
+ })(IAInsightTemplateTypes || (IAInsightTemplateTypes = {}));
14161
+
14162
+ var IAInsightComponent = /** @class */ (function () {
14163
+ function IAInsightComponent() {
14164
+ this.insights = [];
14165
+ this.hasPermission = true;
14166
+ }
14167
+ IAInsightComponent.prototype.ngAfterContentInit = function () {
14168
+ this._getTemplates();
14169
+ };
14170
+ IAInsightComponent.prototype.open = function () {
14171
+ this.sidebar.open();
14172
+ };
14173
+ IAInsightComponent.prototype.close = function () {
14174
+ this.sidebar.close();
14175
+ };
14176
+ IAInsightComponent.prototype.getIntroTemplate = function () {
14177
+ return this._getCustomTemplate(IAInsightTemplateTypes.Intro);
14178
+ };
14179
+ IAInsightComponent.prototype.getNoPermissionTemplate = function () {
14180
+ return this._getCustomTemplate(IAInsightTemplateTypes.NoPermission);
14181
+ };
14182
+ IAInsightComponent.prototype.getEmptyTemplate = function () {
14183
+ return this._getCustomTemplate(IAInsightTemplateTypes.Empty);
14184
+ };
14185
+ IAInsightComponent.prototype._getCustomTemplate = function (type) {
14186
+ var _a;
14187
+ return (_a = this.templates.find(function (template) { return template.type === type; })) === null || _a === void 0 ? void 0 : _a.template;
14188
+ };
14189
+ IAInsightComponent.prototype._getTemplates = function () {
14190
+ this.introTemplate = this.getIntroTemplate();
14191
+ this.emptyTemplate = this.getEmptyTemplate();
14192
+ this.noPermissionTemplate = this.getNoPermissionTemplate();
14193
+ };
13790
14194
  __decorate([
13791
14195
  Input()
13792
- ], ImageCropperComponent.prototype, "rounded", void 0);
14196
+ ], IAInsightComponent.prototype, "insights", void 0);
13793
14197
  __decorate([
13794
14198
  Input()
13795
- ], ImageCropperComponent.prototype, "allowSelectAnother", void 0);
14199
+ ], IAInsightComponent.prototype, "hasPermission", void 0);
13796
14200
  __decorate([
13797
14201
  Input()
13798
- ], ImageCropperComponent.prototype, "allowRemove", void 0);
14202
+ ], IAInsightComponent.prototype, "introText", void 0);
13799
14203
  __decorate([
13800
14204
  Input()
13801
- ], ImageCropperComponent.prototype, "allowCancel", void 0);
14205
+ ], IAInsightComponent.prototype, "emptyText", void 0);
13802
14206
  __decorate([
13803
14207
  Input()
13804
- ], ImageCropperComponent.prototype, "imageSource", void 0);
13805
- __decorate([
13806
- Output()
13807
- ], ImageCropperComponent.prototype, "visibleChange", void 0);
13808
- __decorate([
13809
- Output()
13810
- ], ImageCropperComponent.prototype, "changeImage", void 0);
13811
- __decorate([
13812
- Output()
13813
- ], ImageCropperComponent.prototype, "croppedImage", void 0);
13814
- __decorate([
13815
- Output()
13816
- ], ImageCropperComponent.prototype, "croppedCanvas", void 0);
13817
- __decorate([
13818
- Output()
13819
- ], ImageCropperComponent.prototype, "removedImage", void 0);
13820
- __decorate([
13821
- Output()
13822
- ], ImageCropperComponent.prototype, "cancel", void 0);
13823
- __decorate([
13824
- ViewChild("image", { static: true })
13825
- ], ImageCropperComponent.prototype, "image", void 0);
14208
+ ], IAInsightComponent.prototype, "noPermissionText", void 0);
13826
14209
  __decorate([
13827
- ContentChild(HeaderComponent, { static: true })
13828
- ], ImageCropperComponent.prototype, "headerSection", void 0);
14210
+ ViewChild(IAInsightSidebarComponent)
14211
+ ], IAInsightComponent.prototype, "sidebar", void 0);
13829
14212
  __decorate([
13830
- ContentChild(FooterComponent, { static: true })
13831
- ], ImageCropperComponent.prototype, "footerSection", void 0);
13832
- ImageCropperComponent = ImageCropperComponent_1 = __decorate([
14213
+ ContentChildren(TemplateDirective)
14214
+ ], IAInsightComponent.prototype, "templates", void 0);
14215
+ IAInsightComponent = __decorate([
13833
14216
  Component({
13834
- selector: "s-image-cropper",
13835
- template: "<div [id]=\"id\">\n <p-dialog\n styleClass=\"s-image-cropper {{rounded ? 's-image-cropper--rounded' : ''}}\"\n [header]=\"headerSection ? '' : header\"\n [visible]=\"visible\"\n (visibleChange)=\"onModalVisibleChange($event)\"\n [modal]=\"true\"\n [blockScroll]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [closeOnEscape]=\"allowCancel\"\n [closable]=\"allowCancel\"\n appendTo=\"body\">\n\n <p-header *ngIf=\"headerSection\">\n <ng-content select=\"s-header\"></ng-content>\n </p-header>\n\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!imageSource\"\n [title]=\"emptyStateTitle\"\n [iconClass]=\"emptyStateIconClass\"\n [primaryActionLabel]=\"emptyStateActionLabel\"\n (primaryAction)=\"onChangeImage()\">\n </s-empty-state>\n\n <div [attr.data-hidden]=\"!imageSource\" class=\"image-container\">\n <img\n [id]=\"id + '-cropper'\"\n #image\n [src]=\"imageSource || ''\"\n alt=\"cropped image\"/>\n </div>\n\n <p-footer>\n <div class=\"ui-fluid\" *ngIf=\"!footerSection\">\n <div class=\"ui-g button-container\">\n\n <div *ngIf=\"allowCancel\" class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel\"\n (onClick)=\"onCancel()\">\n </s-button>\n </div>\n\n <div *ngIf=\"imageSource && allowRemove\" class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-remove-button'\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"removeLabel\"\n (onClick)=\"onRemoveImage()\">\n </s-button>\n </div>\n\n <div *ngIf=\"imageSource && allowSelectAnother\" class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-select-another-button'\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"selectAnotherLabel\"\n (onClick)=\"onChangeImage()\">\n </s-button>\n </div>\n\n <div class=\"ui-sm-12 ui-md-3 ui-lg-2 ui-xl-2\">\n <s-button\n [id]=\"id + '-crop-button'\"\n type=\"button\"\n [label]=\"cropLabel\"\n (onClick)=\"onCropImage()\">\n </s-button>\n </div>\n </div>\n </div>\n\n <ng-content select=\"s-footer\" *ngIf=\"footerSection\"></ng-content>\n </p-footer>\n </p-dialog>\n</div>",
13836
- encapsulation: ViewEncapsulation.None,
13837
- styles: ["/*!\n * Cropper.js v1.6.2\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2024-04-21T07:43:02.731Z\n */.cropper-container{-webkit-touch-callout:none;direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:rgba(51,153,255,.75) solid 1px;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:\" \";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:\" \";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}", ".s-image-cropper{border-radius:0!important;height:80%!important;max-width:100%!important;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:column;flex-direction:column}.s-image-cropper .ui-dialog-content{overflow:hidden;height:auto!important;-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.s-image-cropper .ui-dialog-footer,.s-image-cropper .ui-dialog-header{-ms-flex-negative:0;flex-shrink:0;direction:ltr}.s-image-cropper .image-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%}.s-image-cropper img{max-width:100%;max-height:100%}.s-image-cropper .button-container{-ms-flex-flow:wrap-reverse;flex-flow:wrap-reverse;-ms-flex-pack:end;justify-content:flex-end}.s-image-cropper .cropper-view-box{outline:#fff dashed 2px}.s-image-cropper .cropper-line{opacity:0}.s-image-cropper .cropper-point{background-color:#fff;opacity:1;height:15px;width:15px;border-radius:50%}.s-image-cropper .cropper-point.point-e{right:-8.5px;top:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-n{top:-8.5px;left:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-w{left:-8.5px;top:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-s{bottom:-8.5px;left:calc(50% - 4.5px)}.s-image-cropper .cropper-point.point-ne{right:-8.5px;top:-8.5px}.s-image-cropper .cropper-point.point-nw{left:-8.5px;top:-8.5px}.s-image-cropper .cropper-point.point-sw{left:-8.5px;bottom:-8.5px}.s-image-cropper .cropper-point.point-se{right:-8.5px;bottom:-8.5px}.s-image-cropper--rounded .cropper-face,.s-image-cropper--rounded .cropper-view-box{border-radius:50%}.s-image-cropper--rounded .cropper-view-box{outline:rgba(255,255,255,.3) dashed 1px}.s-image-cropper--rounded .cropper-view-box:after{border:2px dashed #fff;border-radius:50%;content:\"\";height:100%;left:0;position:absolute;top:0;width:100%}@media (max-width:767px){.s-image-cropper{border:none!important;top:0!important;left:0!important;width:100%!important;height:100%!important}}@media (min-width:768px){.s-image-cropper{width:80%!important}}@media (min-width:1200px){.s-image-cropper{width:60%!important}}"]
14217
+ selector: "s-ia-insight",
14218
+ template: "<s-ia-insight-sidebar\n #sidebar\n [insights]=\"insights\"\n [hasPermission]=\"hasPermission\"\n [introText]=\"introText\"\n [introTemplate]=\"introTemplate\"\n [emptyText]=\"emptyText\"\n [emptyTemplate]=\"emptyTemplate\"\n [noPermissionText]=\"noPermissionText\"\n [noPermissionTemplate]=\"noPermissionTemplate\">\n</s-ia-insight-sidebar>",
14219
+ styles: [""]
13838
14220
  })
13839
- ], ImageCropperComponent);
13840
- return ImageCropperComponent;
14221
+ ], IAInsightComponent);
14222
+ return IAInsightComponent;
13841
14223
  }());
13842
14224
 
13843
- var ImageCropperModule = /** @class */ (function () {
13844
- function ImageCropperModule() {
14225
+ var IAInsightModule = /** @class */ (function () {
14226
+ function IAInsightModule() {
13845
14227
  }
13846
- ImageCropperModule = __decorate([
14228
+ IAInsightModule = __decorate([
13847
14229
  NgModule({
13848
- imports: [CommonModule, DialogModule, ButtonModule, EmptyStateModule, StructureModule],
13849
- declarations: [ImageCropperComponent],
13850
- exports: [ImageCropperComponent, StructureModule],
13851
- entryComponents: [ImageCropperComponent],
13852
- })
13853
- ], ImageCropperModule);
13854
- return ImageCropperModule;
13855
- }());
13856
-
13857
- var ImageCropperService = /** @class */ (function () {
13858
- function ImageCropperService(componentFactoryResolver, appRef, injector) {
13859
- this.componentFactoryResolver = componentFactoryResolver;
13860
- this.appRef = appRef;
13861
- this.injector = injector;
13862
- }
13863
- ImageCropperService.prototype.show = function (config) {
13864
- var _this = this;
13865
- if (this.activeCropper)
13866
- this.destroy(this.activeCropper);
13867
- var activeCropper = {
13868
- componentRef: this.componentFactoryResolver.resolveComponentFactory(ImageCropperComponent).create(this.injector),
13869
- ngUnsubscribe: new Subject(),
13870
- };
13871
- this.activeCropper = activeCropper;
13872
- this.appRef.attachView(activeCropper.componentRef.hostView);
13873
- var domElem = activeCropper.componentRef.hostView.rootNodes[0];
13874
- document.body.appendChild(domElem);
13875
- this.configureInstance(activeCropper, config);
13876
- activeCropper.componentRef.instance.visible = true;
13877
- activeCropper.componentRef.instance.visibleChange
13878
- .pipe(takeUntil(this.activeCropper.ngUnsubscribe), delay(1000))
13879
- .subscribe(function (visible) {
13880
- if (!visible)
13881
- _this.destroy(activeCropper);
13882
- });
13883
- };
13884
- ImageCropperService.prototype.configureInstance = function (activeCropper, config) {
13885
- var instance = activeCropper.componentRef.instance;
13886
- if (config) {
13887
- Object.keys(config).forEach(function (key) {
13888
- var value = config[key];
13889
- if (typeof value !== "function")
13890
- instance[key] = value;
13891
- else if (typeof value === "function") {
13892
- instance[key].pipe(takeUntil(activeCropper.ngUnsubscribe)).subscribe(function () {
13893
- var param = [];
13894
- for (var _i = 0; _i < arguments.length; _i++) {
13895
- param[_i] = arguments[_i];
13896
- }
13897
- return config[key].apply(config, __spread(param));
13898
- });
13899
- }
13900
- });
13901
- }
13902
- instance.visibleChange.pipe(takeUntil(activeCropper.ngUnsubscribe)).subscribe(function (visible) { return (instance.visible = visible); });
13903
- };
13904
- ImageCropperService.prototype.destroy = function (activeCropper) {
13905
- activeCropper.ngUnsubscribe.next();
13906
- activeCropper.ngUnsubscribe.complete();
13907
- this.appRef.detachView(activeCropper.componentRef.hostView);
13908
- activeCropper.componentRef.destroy();
13909
- };
13910
- ImageCropperService.ctorParameters = function () { return [
13911
- { type: ComponentFactoryResolver },
13912
- { type: ApplicationRef },
13913
- { type: Injector }
13914
- ]; };
13915
- ImageCropperService = __decorate([
13916
- Injectable()
13917
- ], ImageCropperService);
13918
- return ImageCropperService;
14230
+ imports: [
14231
+ CommonModule,
14232
+ TranslateModule,
14233
+ BadgeModule,
14234
+ ButtonModule,
14235
+ TooltipModule,
14236
+ TemplateModule,
14237
+ SVGFactoryModule,
14238
+ ],
14239
+ declarations: [
14240
+ IAInsightComponent,
14241
+ IAInsightCardComponent,
14242
+ IAInsightSidebarComponent,
14243
+ IAInsightCardLoaderComponent,
14244
+ ],
14245
+ exports: [
14246
+ IAInsightComponent,
14247
+ TemplateModule,
14248
+ ],
14249
+ })
14250
+ ], IAInsightModule);
14251
+ return IAInsightModule;
13919
14252
  }());
13920
14253
 
13921
14254
  var KanbanEventService = /** @class */ (function () {
@@ -14736,260 +15069,6 @@ var ProductHeaderModule = /** @class */ (function () {
14736
15069
  return ProductHeaderModule;
14737
15070
  }());
14738
15071
 
14739
- var FileValidation;
14740
- (function (FileValidation) {
14741
- FileValidation["MaxFileSize"] = "maxFileSize";
14742
- FileValidation["MaxFileLimit"] = "maxFileLimit";
14743
- FileValidation["TypeInvalid"] = "typeInvalid";
14744
- FileValidation["UnsupportedExtension"] = "unsupportedExtension";
14745
- })(FileValidation || (FileValidation = {}));
14746
-
14747
- var ProfilePicturePickerComponent = /** @class */ (function () {
14748
- function ProfilePicturePickerComponent(imageCropperService, confirmationService, translateService) {
14749
- this.imageCropperService = imageCropperService;
14750
- this.confirmationService = confirmationService;
14751
- this.translateService = translateService;
14752
- this.simpleTitle = this.translateService.instant("platform.angular_components.drag_your_photo_or"); // Arraste sua foto ou
14753
- this.actionTitle = this.translateService.instant("platform.angular_components.select_a_file"); // Selecione um arquivo
14754
- this.aspectRatio = 1;
14755
- this.removeButtonLabel = this.translateService.instant("platform.angular_components.remover");
14756
- this.changeButtonLabel = this.translateService.instant("platform.angular_components.change_photo"); // Alterar foto
14757
- this.confirmationTexts = {
14758
- removalHeader: this.translateService.instant("platform.angular_components.remove_image"),
14759
- removalMessage: this.translateService.instant("platform.angular_components.confirmation_remove_image"),
14760
- removalAcceptLabel: this.translateService.instant("platform.angular_components.remove"),
14761
- removalRejectLabel: this.translateService.instant("platform.angular_components.cancel"),
14762
- };
14763
- this.supportedExtensions = [];
14764
- this.changedImage = new EventEmitter();
14765
- this.removedImage = new EventEmitter();
14766
- this.invalidFile = new EventEmitter();
14767
- }
14768
- ProfilePicturePickerComponent.prototype.ngOnInit = function () {
14769
- this._normalizeSuportedExtensions();
14770
- };
14771
- ProfilePicturePickerComponent.prototype.onDragOver = function (event) {
14772
- event.preventDefault();
14773
- event.stopPropagation();
14774
- };
14775
- ProfilePicturePickerComponent.prototype.onDragLeave = function (event) {
14776
- event.preventDefault();
14777
- event.stopPropagation();
14778
- };
14779
- ProfilePicturePickerComponent.prototype.onDrop = function (event) {
14780
- event.preventDefault();
14781
- event.stopPropagation();
14782
- var files = [];
14783
- var dataTransferFiles = event.dataTransfer.files;
14784
- for (var i = 0; i < dataTransferFiles.length; i++) {
14785
- files.push(dataTransferFiles.item(i));
14786
- }
14787
- this._showImageCropper(files);
14788
- };
14789
- // Verificando o redimensionamento para ajustar o design para ficar responsivo.
14790
- ProfilePicturePickerComponent.prototype.onResize = function () {
14791
- if (this.uploadPicture && this.info && this.thumbnail) {
14792
- var uploadPictureWidth = this._getWidthElement(this.uploadPicture);
14793
- var infoWidth = this._getWidthElement(this.info);
14794
- var thumbnailWidth = this._getWidthElement(this.thumbnail);
14795
- if (thumbnailWidth + infoWidth > uploadPictureWidth) {
14796
- this.uploadPicture.nativeElement.classList.add("upload-picture--small");
14797
- }
14798
- else {
14799
- this.uploadPicture.nativeElement.classList.remove("upload-picture--small");
14800
- }
14801
- }
14802
- };
14803
- ProfilePicturePickerComponent.prototype.selectPhoto = function () {
14804
- var fileInputElement = this.fileInput.nativeElement;
14805
- fileInputElement.value = "";
14806
- fileInputElement.click();
14807
- };
14808
- ProfilePicturePickerComponent.prototype.removePhoto = function () {
14809
- var _this = this;
14810
- this.confirmationService.confirm({
14811
- message: this.confirmationTexts.removalMessage,
14812
- acceptLabel: this.confirmationTexts.removalAcceptLabel,
14813
- rejectLabel: this.confirmationTexts.removalRejectLabel,
14814
- header: this.confirmationTexts.removalHeader,
14815
- accept: function () {
14816
- var fileInputElement = _this.fileInput.nativeElement;
14817
- fileInputElement.value = "";
14818
- _this.image = "";
14819
- _this.removedImage.emit();
14820
- },
14821
- });
14822
- };
14823
- ProfilePicturePickerComponent.prototype.photoSelected = function (event) {
14824
- this._showImageCropper(event.srcElement.files);
14825
- };
14826
- ProfilePicturePickerComponent.prototype._showImageCropper = function (files) {
14827
- var _this = this;
14828
- if (!this._validateData(files)) {
14829
- return;
14830
- }
14831
- var file = files[0];
14832
- var fileReader = new FileReader();
14833
- fileReader.readAsDataURL(file);
14834
- fileReader.onloadend = function (fileEvent) {
14835
- _this.imageCropperService.show(__assign({ imageSource: fileEvent.target.result, croppedImage: function (image) {
14836
- _this.image = image;
14837
- _this.changedImage.emit(image);
14838
- }, changeImage: function () { return _this.selectPhoto(); }, allowSelectAnother: false, aspectRatio: _this.aspectRatio }, _this.cropperLabelsConfig));
14839
- };
14840
- };
14841
- ProfilePicturePickerComponent.prototype._normalizeSuportedExtensions = function () {
14842
- this.supportedExtensions = this.supportedExtensions
14843
- .map(function (extension) { return extension.replace(".", "").toLocaleLowerCase(); });
14844
- };
14845
- ProfilePicturePickerComponent.prototype._validateData = function (files) {
14846
- if (!files.length) {
14847
- return false;
14848
- }
14849
- if (files.length > 1) {
14850
- this.invalidFile.emit({ file: null, validation: FileValidation.MaxFileLimit });
14851
- return false;
14852
- }
14853
- var file = files[0];
14854
- if (!file.type.includes("image")) {
14855
- this.invalidFile.emit({ file: file, validation: FileValidation.TypeInvalid });
14856
- return false;
14857
- }
14858
- if (!this._validateFileExtension(file)) {
14859
- this.invalidFile.emit({ file: file, validation: FileValidation.UnsupportedExtension });
14860
- return false;
14861
- }
14862
- if (!this._validateFileSize(file)) {
14863
- this.invalidFile.emit({ file: file, validation: FileValidation.MaxFileSize });
14864
- return false;
14865
- }
14866
- return true;
14867
- };
14868
- ProfilePicturePickerComponent.prototype._validateFileExtension = function (file) {
14869
- var _a;
14870
- if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
14871
- var extension = file.name.split(".").pop().toLowerCase();
14872
- return this.supportedExtensions.includes(extension);
14873
- }
14874
- return true;
14875
- };
14876
- ProfilePicturePickerComponent.prototype._validateFileSize = function (file) {
14877
- if (this.maxFileSize) {
14878
- return file.size > this.maxFileSize;
14879
- }
14880
- return true;
14881
- };
14882
- ProfilePicturePickerComponent.prototype._getWidthElement = function (element) {
14883
- var _a = element.nativeElement.getBoundingClientRect(), left = _a.left, right = _a.right;
14884
- return right - left;
14885
- };
14886
- ProfilePicturePickerComponent.ctorParameters = function () { return [
14887
- { type: ImageCropperService },
14888
- { type: ConfirmationService },
14889
- { type: TranslateService }
14890
- ]; };
14891
- __decorate([
14892
- Input()
14893
- ], ProfilePicturePickerComponent.prototype, "simpleTitle", void 0);
14894
- __decorate([
14895
- Input()
14896
- ], ProfilePicturePickerComponent.prototype, "actionTitle", void 0);
14897
- __decorate([
14898
- Input()
14899
- ], ProfilePicturePickerComponent.prototype, "subtitle", void 0);
14900
- __decorate([
14901
- Input()
14902
- ], ProfilePicturePickerComponent.prototype, "aspectRatio", void 0);
14903
- __decorate([
14904
- Input()
14905
- ], ProfilePicturePickerComponent.prototype, "cropperLabelsConfig", void 0);
14906
- __decorate([
14907
- Input()
14908
- ], ProfilePicturePickerComponent.prototype, "removeButtonLabel", void 0);
14909
- __decorate([
14910
- Input()
14911
- ], ProfilePicturePickerComponent.prototype, "changeButtonLabel", void 0);
14912
- __decorate([
14913
- Input()
14914
- ], ProfilePicturePickerComponent.prototype, "confirmationTexts", void 0);
14915
- __decorate([
14916
- Input()
14917
- ], ProfilePicturePickerComponent.prototype, "maxFileSize", void 0);
14918
- __decorate([
14919
- Input()
14920
- ], ProfilePicturePickerComponent.prototype, "accept", void 0);
14921
- __decorate([
14922
- Input()
14923
- ], ProfilePicturePickerComponent.prototype, "supportedExtensions", void 0);
14924
- __decorate([
14925
- Input()
14926
- ], ProfilePicturePickerComponent.prototype, "image", void 0);
14927
- __decorate([
14928
- ViewChild("uploadPicture")
14929
- ], ProfilePicturePickerComponent.prototype, "uploadPicture", void 0);
14930
- __decorate([
14931
- ViewChild("info")
14932
- ], ProfilePicturePickerComponent.prototype, "info", void 0);
14933
- __decorate([
14934
- ViewChild("thumbnail", { read: ElementRef })
14935
- ], ProfilePicturePickerComponent.prototype, "thumbnail", void 0);
14936
- __decorate([
14937
- ViewChild("fileInput", { read: ElementRef })
14938
- ], ProfilePicturePickerComponent.prototype, "fileInput", void 0);
14939
- __decorate([
14940
- Output()
14941
- ], ProfilePicturePickerComponent.prototype, "changedImage", void 0);
14942
- __decorate([
14943
- Output()
14944
- ], ProfilePicturePickerComponent.prototype, "removedImage", void 0);
14945
- __decorate([
14946
- Output()
14947
- ], ProfilePicturePickerComponent.prototype, "invalidFile", void 0);
14948
- __decorate([
14949
- HostListener("dragover", ["$event"])
14950
- ], ProfilePicturePickerComponent.prototype, "onDragOver", null);
14951
- __decorate([
14952
- HostListener("dragleave", ["$event"])
14953
- ], ProfilePicturePickerComponent.prototype, "onDragLeave", null);
14954
- __decorate([
14955
- HostListener("drop", ["$event"])
14956
- ], ProfilePicturePickerComponent.prototype, "onDrop", null);
14957
- __decorate([
14958
- HostListener("window:resize")
14959
- ], ProfilePicturePickerComponent.prototype, "onResize", null);
14960
- ProfilePicturePickerComponent = __decorate([
14961
- Component({
14962
- selector: "s-profile-picture-picker",
14963
- template: "<p-confirmDialog></p-confirmDialog>\n\n<input #fileInput [accept]=\"accept\" class=\"file-input\" type=\"file\" (change)=\"photoSelected($event)\">\n<div #uploadPicture class=\"upload-picture\">\n <s-thumbnail\n #thumbnail\n iconClass=\"far fa-user\"\n [imageSource]=\"image\"\n [hasAction]=\"!image\"\n (click)=\"selectPhoto()\">\n </s-thumbnail>\n <div #info class=\"info\">\n <ng-container *ngIf=\"image; then withImage; else noImage\"></ng-container>\n <p class=\"subtitle\">{{ subtitle }}</p>\n </div>\n</div>\n\n<ng-template #withImage>\n <div class=\"buttons\">\n <s-button\n [label]=\"changeButtonLabel\"\n priority=\"primary\"\n (onClick)=\"selectPhoto()\">\n </s-button>\n <s-button\n [label]=\"removeButtonLabel\"\n priority=\"secondary\"\n (onClick)=\"removePhoto()\">\n </s-button>\n </div>\n</ng-template>\n\n<ng-template #noImage>\n <p class=\"title\">\n {{ simpleTitle }}\n <span\n class=\"action-title\"\n (click)=\"selectPhoto()\">\n {{ actionTitle }}\n </span>\n </p>\n</ng-template>",
14964
- styles: [".file-input{display:none}.upload-picture{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.upload-picture .info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:12px 20px;-ms-flex-align:start;align-items:flex-start}.upload-picture .info .title{font-family:\"Open Sans\",sans-serif;font-weight:700;font-size:.875rem;line-height:150%;color:#333}.upload-picture .info .title .action-title{cursor:pointer;color:#428bca}.upload-picture .info .buttons{display:-ms-flexbox;display:flex;gap:8px}.upload-picture .info .buttons s-button{margin:0}.upload-picture .info .subtitle{padding:6px 0;font-family:\"Open Sans\",sans-serif;font-weight:400;font-size:.75rem;line-height:150%;color:#697882;text-align:center}.upload-picture--small .info{-ms-flex-align:center;align-items:center}.upload-picture--small .info .subtitle,.upload-picture--small .info .title{text-align:center}.upload-picture--small .info .buttons{-ms-flex-pack:center;justify-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap}"]
14965
- })
14966
- ], ProfilePicturePickerComponent);
14967
- return ProfilePicturePickerComponent;
14968
- }());
14969
-
14970
- var ProfilePicturePickerModule = /** @class */ (function () {
14971
- function ProfilePicturePickerModule() {
14972
- }
14973
- ProfilePicturePickerModule = __decorate([
14974
- NgModule({
14975
- imports: [
14976
- CommonModule,
14977
- ButtonModule,
14978
- ThumbnailModule,
14979
- ImageCropperModule,
14980
- ConfirmDialogModule,
14981
- ],
14982
- declarations: [ProfilePicturePickerComponent],
14983
- exports: [ProfilePicturePickerComponent],
14984
- providers: [
14985
- ImageCropperService,
14986
- ConfirmationService,
14987
- ],
14988
- })
14989
- ], ProfilePicturePickerModule);
14990
- return ProfilePicturePickerModule;
14991
- }());
14992
-
14993
15072
  var ProgressBarColors;
14994
15073
  (function (ProgressBarColors) {
14995
15074
  ProgressBarColors["Blue"] = "blue";
@@ -17862,5 +17941,5 @@ var fallback = {
17862
17941
  * Generated bundle index. Do not edit.
17863
17942
  */
17864
17943
 
17865
- export { AccordionComponent, AccordionModule, AccordionPanelComponent, AlertComponent, AlertModule, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, TextFieldComponent as ɵba, NumberFieldModule as ɵbb, LocalizedNumberInputModule as ɵbc, NumberInputModule as ɵbd, NumberFieldComponent as ɵbe, CurrencyFieldModule as ɵbf, CurrencyFieldComponent as ɵbg, NumberFieldModule$1 as ɵbh, BignumberInputModule as ɵbi, BignumberFieldComponent as ɵbj, AutocompleteFieldComponent as ɵbk, BooleanFieldComponent as ɵbl, BooleanSwitchFieldComponent as ɵbm, CalendarFieldComponent as ɵbn, ChipsFieldComponent as ɵbo, CountryPhonePickerFieldComponent as ɵbp, DynamicFieldComponent as ɵbq, DynamicFormDirective as ɵbr, FieldsetComponent as ɵbs, FileUploadComponent$1 as ɵbt, LookupFieldComponent as ɵbu, RadioButtonComponent as ɵbv, RowComponent as ɵbw, SectionComponent as ɵbx, SelectFieldComponent as ɵby, SliderFieldComponent as ɵbz, TemplateDirective as ɵc, TextAreaFieldComponent as ɵca, TextAreaIAFieldComponent as ɵcb, IAssistService as ɵcc, DecimalField as ɵce, SideTableComponent as ɵcf, ThumbnailService as ɵcg, InfiniteScrollModule as ɵch, InfiniteScrollDirective as ɵci, IAInsightSidebarComponent as ɵcj, IAInsightCardComponent as ɵck, IAInsightCardLoaderComponent as ɵcl, StructureModule as ɵcm, HeaderComponent as ɵcn, FooterComponent as ɵco, KanbanEventService as ɵcp, KanbanItemComponent as ɵcq, KanbanColumnComponent as ɵcr, KanbanItemDraggingComponent as ɵcs, NumberLocaleOptions as ɵct, BorderButtonModule as ɵcu, BorderButtonComponent as ɵcv, ProgressBarDeterminateComponent as ɵcw, ProgressBarIndeterminateComponent as ɵcx, SelectButtonItemComponent as ɵcy, SlidePanelService as ɵcz, TemplateModule as ɵd, TieredMenuEventService as ɵda, TieredMenuService as ɵdb, TieredMenuGlobalService as ɵdc, TieredMenuComponent as ɵdd, TieredMenuNestedComponent as ɵde, TieredMenuItemComponent as ɵdf, TieredMenuDividerComponent as ɵdg, TimelineItemModule as ɵdh, TimelineIconItemComponent as ɵdi, HorizontalTimelineModule as ɵdj, HorizontalTimelineComponent as ɵdk, VerticalTimelineModule as ɵdl, VerticalTimelineComponent as ɵdm, RangeLineComponent as ɵdn, CollapseOptionComponent as ɵdo, CollapsedItemsComponent as ɵdp, VerticalItemsComponent as ɵdq, CustomTranslationsModule as ɵe, CodeEditorComponent as ɵf, CoreFacade as ɵg, CodeMirror6Core as ɵh, CountryPhonePickerService as ɵi, LocalizedCurrencyImpurePipe as ɵj, LocalizedBignumberPipe as ɵk, LocalizedBignumberImpurePipe as ɵl, NumericPipe as ɵm, NumericService as ɵn, EmptyStateGoBackComponent as ɵo, IAssistIconComponent as ɵp, SeniorIconComponent as ɵq, DotsIndicatorComponent as ɵr, LoadingIndicatorComponent as ɵs, FileUploadService as ɵt, InfoSignComponent as ɵu, TableColumnsComponent as ɵv, TablePagingComponent as ɵw, PasswordFieldModule as ɵx, PasswordFieldComponent as ɵy, TextFieldModule as ɵz };
17944
+ export { AccordionComponent, AccordionModule, AccordionPanelComponent, AlertComponent, AlertModule, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, TextFieldComponent as ɵba, NumberFieldModule as ɵbb, LocalizedNumberInputModule as ɵbc, NumberInputModule as ɵbd, NumberFieldComponent as ɵbe, CurrencyFieldModule as ɵbf, CurrencyFieldComponent as ɵbg, NumberFieldModule$1 as ɵbh, BignumberInputModule as ɵbi, BignumberFieldComponent as ɵbj, ProfilePictureModule as ɵbk, ThumbnailService as ɵbl, StructureModule as ɵbm, HeaderComponent as ɵbn, FooterComponent as ɵbo, ProfilePictureFieldComponent as ɵbp, AutocompleteFieldComponent as ɵbq, BooleanFieldComponent as ɵbr, BooleanSwitchFieldComponent as ɵbs, CalendarFieldComponent as ɵbt, ChipsFieldComponent as ɵbu, CountryPhonePickerFieldComponent as ɵbv, DynamicFieldComponent as ɵbw, DynamicFormDirective as ɵbx, FieldsetComponent as ɵby, FileUploadComponent$1 as ɵbz, TemplateDirective as ɵc, LookupFieldComponent as ɵca, RadioButtonComponent as ɵcb, RowComponent as ɵcc, SectionComponent as ɵcd, SelectFieldComponent as ɵce, SliderFieldComponent as ɵcf, TextAreaFieldComponent as ɵcg, TextAreaIAFieldComponent as ɵch, IAssistService as ɵci, DecimalField as ɵck, SideTableComponent as ɵcl, InfiniteScrollModule as ɵcm, InfiniteScrollDirective as ɵcn, IAInsightSidebarComponent as ɵco, IAInsightCardComponent as ɵcp, IAInsightCardLoaderComponent as ɵcq, KanbanEventService as ɵcr, KanbanItemComponent as ɵcs, KanbanColumnComponent as ɵct, KanbanItemDraggingComponent as ɵcu, NumberLocaleOptions as ɵcv, BorderButtonModule as ɵcw, BorderButtonComponent as ɵcx, ProgressBarDeterminateComponent as ɵcy, ProgressBarIndeterminateComponent as ɵcz, TemplateModule as ɵd, SelectButtonItemComponent as ɵda, SlidePanelService as ɵdb, TieredMenuEventService as ɵdc, TieredMenuService as ɵdd, TieredMenuGlobalService as ɵde, TieredMenuComponent as ɵdf, TieredMenuNestedComponent as ɵdg, TieredMenuItemComponent as ɵdh, TieredMenuDividerComponent as ɵdi, TimelineItemModule as ɵdj, TimelineIconItemComponent as ɵdk, HorizontalTimelineModule as ɵdl, HorizontalTimelineComponent as ɵdm, VerticalTimelineModule as ɵdn, VerticalTimelineComponent as ɵdo, RangeLineComponent as ɵdp, CollapseOptionComponent as ɵdq, CollapsedItemsComponent as ɵdr, VerticalItemsComponent as ɵds, CustomTranslationsModule as ɵe, CodeEditorComponent as ɵf, CoreFacade as ɵg, CodeMirror6Core as ɵh, CountryPhonePickerService as ɵi, LocalizedCurrencyImpurePipe as ɵj, LocalizedBignumberPipe as ɵk, LocalizedBignumberImpurePipe as ɵl, NumericPipe as ɵm, NumericService as ɵn, EmptyStateGoBackComponent as ɵo, IAssistIconComponent as ɵp, SeniorIconComponent as ɵq, DotsIndicatorComponent as ɵr, LoadingIndicatorComponent as ɵs, FileUploadService as ɵt, InfoSignComponent as ɵu, TableColumnsComponent as ɵv, TablePagingComponent as ɵw, PasswordFieldModule as ɵx, PasswordFieldComponent as ɵy, TextFieldModule as ɵz };
17866
17945
  //# sourceMappingURL=seniorsistemas-angular-components.js.map