@seniorsistemas/angular-components 17.8.2 → 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 (44) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +1372 -1282
  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 -5
  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 +35 -16
  22. package/esm2015/components/profile-picture-picker/profile-picture-picker.module.js +6 -4
  23. package/esm2015/locale/fallback.js +6 -1
  24. package/esm2015/seniorsistemas-angular-components.js +61 -59
  25. package/esm5/components/dynamic-form/components/fields/profile-picture/profile-picture-field.component.js +20 -0
  26. package/esm5/components/dynamic-form/components/fields/profile-picture/profile-picture-field.module.js +25 -0
  27. package/esm5/components/dynamic-form/configurations/field-type.js +2 -1
  28. package/esm5/components/dynamic-form/configurations/fields/profile-picture.js +26 -0
  29. package/esm5/components/dynamic-form/configurations/form-field.js +4 -1
  30. package/esm5/components/dynamic-form/dynamic-form.js +4 -1
  31. package/esm5/components/dynamic-form/dynamic-form.module.js +3 -1
  32. package/esm5/components/profile-picture-picker/models/index.js +1 -1
  33. package/esm5/components/profile-picture-picker/models/profile-picture-picker-data.js +1 -0
  34. package/esm5/components/profile-picture-picker/profile-picture-picker.component.js +35 -15
  35. package/esm5/components/profile-picture-picker/profile-picture-picker.module.js +6 -4
  36. package/esm5/locale/fallback.js +6 -1
  37. package/esm5/seniorsistemas-angular-components.js +61 -59
  38. package/fesm2015/seniorsistemas-angular-components.js +3324 -3246
  39. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  40. package/fesm5/seniorsistemas-angular-components.js +1309 -1221
  41. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  42. package/package.json +1 -1
  43. package/seniorsistemas-angular-components.d.ts +60 -58
  44. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1,12 +1,12 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@angular/common/http'), require('@seniorsistemas/senior-platform-data'), require('moment'), require('ngx-cookie-service'), require('@seniorsistemas/ng2-currency-mask'), require('primeng/breadcrumb'), require('primeng/dom'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/calendar'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/language'), require('@lezer/generator'), require('@codemirror/highlight'), require('@codemirror/autocomplete'), require('@ngx-translate/core'), require('@codemirror/tooltip'), require('@codemirror/gutter'), require('ngx-mask'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('primeng/slider'), require('primeng/api'), require('primeng/progressbar'), require('@angular/platform-browser'), require('@angular/cdk/clipboard'), require('marked'), require('cropperjs'), require('@angular/cdk/drag-drop'), require('element-resize-detector'), require('primeng/confirmdialog'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar')) :
3
- typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/animations', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/router', '@angular/common/http', '@seniorsistemas/senior-platform-data', 'moment', 'ngx-cookie-service', '@seniorsistemas/ng2-currency-mask', 'primeng/breadcrumb', 'primeng/dom', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/calendar', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/language', '@lezer/generator', '@codemirror/highlight', '@codemirror/autocomplete', '@ngx-translate/core', '@codemirror/tooltip', '@codemirror/gutter', 'ngx-mask', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', 'primeng/slider', 'primeng/api', 'primeng/progressbar', '@angular/platform-browser', '@angular/cdk/clipboard', 'marked', 'cropperjs', '@angular/cdk/drag-drop', 'element-resize-detector', 'primeng/confirmdialog', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar'], factory) :
4
- (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.animations, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.router, global.ng.common.http, global.seniorPlatformData, global.moment_, global.ngxCookieService, global.ng2CurrencyMask, global.breadcrumb, global.dom, global.tieredmenu, global.tooltip, global.calendar, global.view, global.state, global.lint, global.language, global.generator, global.highlight, global.autocomplete$1, global.core$1, global.tooltip$1, global.gutter, global.ngxMask, global.angular2Hotkeys, global.BigNumber, global.autocomplete$2, global.dialog, global.table, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.slider, global.api, global.progressbar, global.ng.platformBrowser, global.ng.cdk.clipboard, global.marked, global.Cropper, global.ng.cdk['drag-drop'], global.elementResizeDetectorMaker_, global.confirmdialog, global.ng.cdk.a11y, global.scrollpanel, global.sidebar));
5
- }(this, (function (exports, core, animations, rxjs, operators, common, forms, router, http, seniorPlatformData, moment_, ngxCookieService, ng2CurrencyMask, breadcrumb, dom, tieredmenu, tooltip, calendar, view, state, lint, language, generator, highlight, autocomplete$1, core$1, tooltip$1, gutter, ngxMask, angular2Hotkeys, BigNumber, autocomplete$2, dialog, table, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, slider, api, progressbar, platformBrowser, clipboard, marked, Cropper, dragDrop, elementResizeDetectorMaker_, confirmdialog, a11y, scrollpanel, sidebar) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@angular/common/http'), require('@seniorsistemas/senior-platform-data'), require('moment'), require('ngx-cookie-service'), require('@seniorsistemas/ng2-currency-mask'), require('primeng/breadcrumb'), require('primeng/dom'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/calendar'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/language'), require('@lezer/generator'), require('@codemirror/highlight'), require('@codemirror/autocomplete'), require('@ngx-translate/core'), require('@codemirror/tooltip'), require('@codemirror/gutter'), require('ngx-mask'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('primeng/slider'), require('primeng/api'), require('primeng/progressbar'), require('@angular/platform-browser'), require('@angular/cdk/clipboard'), require('primeng/confirmdialog'), require('cropperjs'), require('marked'), require('@angular/cdk/drag-drop'), require('element-resize-detector'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar')) :
3
+ typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/animations', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/router', '@angular/common/http', '@seniorsistemas/senior-platform-data', 'moment', 'ngx-cookie-service', '@seniorsistemas/ng2-currency-mask', 'primeng/breadcrumb', 'primeng/dom', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/calendar', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/language', '@lezer/generator', '@codemirror/highlight', '@codemirror/autocomplete', '@ngx-translate/core', '@codemirror/tooltip', '@codemirror/gutter', 'ngx-mask', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', 'primeng/slider', 'primeng/api', 'primeng/progressbar', '@angular/platform-browser', '@angular/cdk/clipboard', 'primeng/confirmdialog', 'cropperjs', 'marked', '@angular/cdk/drag-drop', 'element-resize-detector', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar'], factory) :
4
+ (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.animations, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.router, global.ng.common.http, global.seniorPlatformData, global.moment_, global.ngxCookieService, global.ng2CurrencyMask, global.breadcrumb, global.dom, global.tieredmenu, global.tooltip, global.calendar, global.view, global.state, global.lint, global.language, global.generator, global.highlight, global.autocomplete$1, global.core$1, global.tooltip$1, global.gutter, global.ngxMask, global.angular2Hotkeys, global.BigNumber, global.autocomplete$2, global.dialog, global.table, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.slider, global.api, global.progressbar, global.ng.platformBrowser, global.ng.cdk.clipboard, global.confirmdialog, global.Cropper, global.marked, global.ng.cdk['drag-drop'], global.elementResizeDetectorMaker_, global.ng.cdk.a11y, global.scrollpanel, global.sidebar));
5
+ }(this, (function (exports, core, animations, rxjs, operators, common, forms, router, http, seniorPlatformData, moment_, ngxCookieService, ng2CurrencyMask, breadcrumb, dom, tieredmenu, tooltip, calendar, view, state, lint, language, generator, highlight, autocomplete$1, core$1, tooltip$1, gutter, ngxMask, angular2Hotkeys, BigNumber, autocomplete$2, dialog, table, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, slider, api, progressbar, platformBrowser, clipboard, confirmdialog, Cropper, marked, dragDrop, elementResizeDetectorMaker_, a11y, scrollpanel, sidebar) { 'use strict';
6
6
 
7
7
  var BigNumber__default = 'default' in BigNumber ? BigNumber['default'] : BigNumber;
8
- marked = marked && marked.hasOwnProperty('default') ? marked['default'] : marked;
9
8
  Cropper = Cropper && Cropper.hasOwnProperty('default') ? Cropper['default'] : Cropper;
9
+ marked = marked && marked.hasOwnProperty('default') ? marked['default'] : marked;
10
10
 
11
11
  /*! *****************************************************************************
12
12
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4556,6 +4556,7 @@
4556
4556
  FieldType["Text"] = "Text";
4557
4557
  FieldType["TextIA"] = "TextIA";
4558
4558
  FieldType["Time"] = "Time";
4559
+ FieldType["ProfilePicture"] = "ProfilePicture";
4559
4560
  })(exports.FieldType || (exports.FieldType = {}));
4560
4561
 
4561
4562
  var FieldSize = /** @class */ (function () {
@@ -5162,6 +5163,29 @@
5162
5163
  return CountryPhonePickerField;
5163
5164
  }(Field));
5164
5165
 
5166
+ var ProfilePictureField = /** @class */ (function (_super) {
5167
+ __extends(ProfilePictureField, _super);
5168
+ function ProfilePictureField(config) {
5169
+ var _this = _super.call(this, config) || this;
5170
+ _this.simpleTitle = config.simpleTitle;
5171
+ _this.actionTitle = config.actionTitle;
5172
+ _this.subtitle = config.subtitle;
5173
+ _this.aspectRatio = config.aspectRatio;
5174
+ _this.cropperLabelsConfig = config.cropperLabelsConfig;
5175
+ _this.removeButtonLabel = config.removeButtonLabel;
5176
+ _this.changeButtonLabel = config.changeButtonLabel;
5177
+ _this.confirmationTexts = config.confirmationTexts;
5178
+ _this.maxFileSize = config.maxFileSize;
5179
+ _this.accept = config.accept;
5180
+ _this.supportedExtensions = config.supportedExtensions;
5181
+ _this.onChangeImage = config.onChangeImage;
5182
+ _this.onRemovedImage = config.onRemovedImage;
5183
+ _this.onInvalidFile = config.onInvalidFile;
5184
+ return _this;
5185
+ }
5186
+ return ProfilePictureField;
5187
+ }(Field));
5188
+
5165
5189
  var FormField = /** @class */ (function () {
5166
5190
  function FormField(config) {
5167
5191
  switch (config.type) {
@@ -5205,6 +5229,8 @@
5205
5229
  return new BlobField(config);
5206
5230
  case exports.FieldType.Slider:
5207
5231
  return new SliderField(config);
5232
+ case exports.FieldType.ProfilePicture:
5233
+ return new ProfilePictureField(config);
5208
5234
  case exports.FieldType.Custom:
5209
5235
  var CustomFieldClass = config.CustomFieldClass, otherConfigs = __rest(config, ["CustomFieldClass"]);
5210
5236
  return new CustomFieldClass(otherConfigs);
@@ -9958,6 +9984,23 @@
9958
9984
  return TextFieldComponent;
9959
9985
  }(BaseFieldComponent));
9960
9986
 
9987
+ var ProfilePictureFieldComponent = /** @class */ (function () {
9988
+ function ProfilePictureFieldComponent() {
9989
+ }
9990
+ __decorate([
9991
+ core.Input()
9992
+ ], ProfilePictureFieldComponent.prototype, "field", void 0);
9993
+ __decorate([
9994
+ core.Input()
9995
+ ], ProfilePictureFieldComponent.prototype, "formControl", void 0);
9996
+ ProfilePictureFieldComponent = __decorate([
9997
+ core.Component({
9998
+ 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>"
9999
+ })
10000
+ ], ProfilePictureFieldComponent);
10001
+ return ProfilePictureFieldComponent;
10002
+ }());
10003
+
9961
10004
  var DynamicForm = /** @class */ (function () {
9962
10005
  function DynamicForm(_a) {
9963
10006
  var group = _a.group, errorMessages = _a.errorMessages;
@@ -10040,6 +10083,8 @@
10040
10083
  return FileUploadComponent$1;
10041
10084
  case exports.FieldType.Slider:
10042
10085
  return SliderFieldComponent;
10086
+ case exports.FieldType.ProfilePicture:
10087
+ return ProfilePictureFieldComponent;
10043
10088
  case exports.FieldType.Custom:
10044
10089
  return this.field.CustomFieldComponentClass;
10045
10090
  default:
@@ -10393,157 +10438,898 @@
10393
10438
  return NumberFieldModule;
10394
10439
  }());
10395
10440
 
10396
- var DynamicFormModule = /** @class */ (function () {
10397
- function DynamicFormModule() {
10441
+ var HeaderComponent = /** @class */ (function () {
10442
+ function HeaderComponent() {
10398
10443
  }
10399
- DynamicFormModule = __decorate([
10444
+ HeaderComponent = __decorate([
10445
+ core.Component({
10446
+ selector: "s-header",
10447
+ template: "<ng-content></ng-content>"
10448
+ })
10449
+ ], HeaderComponent);
10450
+ return HeaderComponent;
10451
+ }());
10452
+
10453
+ var FooterComponent = /** @class */ (function () {
10454
+ function FooterComponent() {
10455
+ }
10456
+ FooterComponent = __decorate([
10457
+ core.Component({
10458
+ selector: "s-footer",
10459
+ template: "<ng-content></ng-content>"
10460
+ })
10461
+ ], FooterComponent);
10462
+ return FooterComponent;
10463
+ }());
10464
+
10465
+ var StructureModule = /** @class */ (function () {
10466
+ function StructureModule() {
10467
+ }
10468
+ StructureModule = __decorate([
10400
10469
  core.NgModule({
10401
- imports: [
10402
- autocomplete$2.AutoCompleteModule,
10403
- BignumberInputModule,
10404
- ButtonModule,
10405
- CalendarMaskModule,
10406
- calendar.CalendarModule,
10407
- checkbox.CheckboxModule,
10408
- chips.ChipsModule,
10409
- common.CommonModule,
10410
- ControlErrorsModule,
10411
- CountryPhonePickerModule,
10412
- dialog.DialogModule,
10413
- dropdown.DropdownModule,
10414
- EmptyStateModule,
10415
- forms.FormsModule,
10416
- angular2Hotkeys.HotkeyModule,
10417
- inputmask.InputMaskModule,
10418
- inputtextarea.InputTextareaModule,
10419
- inputtext.InputTextModule,
10420
- keyfilter.KeyFilterModule,
10421
- LoadingStateModule,
10422
- LocaleModule,
10423
- LocalizedNumberInputModule,
10424
- panel.PanelModule,
10425
- button.ButtonModule,
10426
- table.TableModule,
10427
- multiselect.MultiSelectModule,
10428
- NumberInputModule,
10429
- radiobutton.RadioButtonModule,
10430
- forms.ReactiveFormsModule,
10431
- TooltipModule,
10432
- fieldset.FieldsetModule,
10433
- TableHeaderCheckboxModule,
10434
- FileUploadModule,
10435
- TableModule,
10436
- InfoSignModule,
10437
- MaskFormatterModule,
10438
- angular2Hotkeys.HotkeyModule.forRoot(),
10439
- MouseEventsModule,
10440
- SwitchModule,
10441
- PasswordStrengthModule,
10442
- slider.SliderModule,
10443
- core$1.TranslateModule.forChild(),
10444
- PasswordFieldModule,
10445
- TextFieldModule,
10446
- NumberFieldModule,
10447
- CurrencyFieldModule,
10448
- NumberFieldModule$1,
10449
- ],
10450
- declarations: [
10451
- AutocompleteFieldComponent,
10452
- BooleanFieldComponent,
10453
- BooleanSwitchFieldComponent,
10454
- CalendarFieldComponent,
10455
- ChipsFieldComponent,
10456
- CountryPhonePickerFieldComponent,
10457
- DynamicFieldComponent,
10458
- DynamicFormComponent,
10459
- DynamicFormDirective,
10460
- FieldsetComponent,
10461
- FileUploadComponent$1,
10462
- LookupComponent,
10463
- LookupFieldComponent,
10464
- RadioButtonComponent,
10465
- RowComponent,
10466
- SectionComponent,
10467
- SelectFieldComponent,
10468
- SliderFieldComponent,
10469
- TextAreaFieldComponent,
10470
- TextAreaIAFieldComponent,
10471
- ],
10472
- exports: [DynamicFormComponent, LookupComponent],
10473
- entryComponents: [
10474
- AutocompleteFieldComponent,
10475
- BooleanFieldComponent,
10476
- BooleanSwitchFieldComponent,
10477
- CalendarFieldComponent,
10478
- ChipsFieldComponent,
10479
- CountryPhonePickerFieldComponent,
10480
- FieldsetComponent,
10481
- FileUploadComponent$1,
10482
- LookupFieldComponent,
10483
- RadioButtonComponent,
10484
- RowComponent,
10485
- SectionComponent,
10486
- SelectFieldComponent,
10487
- SliderFieldComponent,
10488
- TextAreaFieldComponent,
10489
- TextAreaIAFieldComponent,
10490
- ],
10491
- providers: [
10492
- angular2Hotkeys.HotkeysService,
10493
- IAssistService,
10494
- ]
10470
+ imports: [common.CommonModule],
10471
+ declarations: [HeaderComponent, FooterComponent],
10472
+ exports: [HeaderComponent, FooterComponent],
10495
10473
  })
10496
- ], DynamicFormModule);
10497
- return DynamicFormModule;
10474
+ ], StructureModule);
10475
+ return StructureModule;
10498
10476
  }());
10499
10477
 
10500
- var CustomFieldsService = /** @class */ (function () {
10501
- function CustomFieldsService(http) {
10502
- this.http = http;
10478
+ var ImageCropperComponent = /** @class */ (function () {
10479
+ function ImageCropperComponent() {
10480
+ this.id = "s-image-cropper-" + ImageCropperComponent_1.nextId++;
10481
+ this.visible = false;
10482
+ this.header = "Recortar imagem";
10483
+ this.cropLabel = "Recortar";
10484
+ this.selectAnotherLabel = "Trocar";
10485
+ this.removeLabel = "Remover";
10486
+ this.cancelLabel = "Cancelar";
10487
+ this.emptyStateTitle = "Selecione uma foto, em seguida você poderá ajustá-la";
10488
+ this.emptyStateActionLabel = "Escolher imagem";
10489
+ this.emptyStateIconClass = "fa fa-picture-o";
10490
+ this.aspectRatio = NaN;
10491
+ this.rounded = false;
10492
+ this.allowSelectAnother = true;
10493
+ this.allowRemove = true;
10494
+ this.allowCancel = true;
10495
+ this.visibleChange = new core.EventEmitter();
10496
+ this.changeImage = new core.EventEmitter();
10497
+ this.croppedImage = new core.EventEmitter();
10498
+ this.croppedCanvas = new core.EventEmitter();
10499
+ this.removedImage = new core.EventEmitter();
10500
+ this.cancel = new core.EventEmitter();
10503
10501
  }
10504
- CustomFieldsService.prototype.getCustomFields = function (domain, service, entity, endpoint) {
10505
- var entityDto = { entityId: { domain_: domain, service_: service, id: entity } };
10506
- return this.http.post(endpoint, entityDto);
10502
+ ImageCropperComponent_1 = ImageCropperComponent;
10503
+ ImageCropperComponent.prototype.ngOnInit = function () {
10504
+ if (this.imageSource)
10505
+ this.initCropper();
10507
10506
  };
10508
- CustomFieldsService.prototype.getFileLocationUrl = function (dto, endpoint) {
10509
- return this.http.post(endpoint, dto);
10507
+ ImageCropperComponent.prototype.ngOnChanges = function (changes) {
10508
+ if (changes.imageSource && changes.imageSource.currentValue) {
10509
+ this.initCropper();
10510
+ }
10510
10511
  };
10511
- CustomFieldsService.prototype.uploadTempFile = function (location, file) {
10512
- return this.http.put(location, file, {
10513
- reportProgress: true,
10514
- observe: "events",
10515
- headers: { "Content-Type": file.type }
10512
+ ImageCropperComponent.prototype.initCropper = function () {
10513
+ if (this.cropper) {
10514
+ this.cropper.destroy();
10515
+ }
10516
+ this.image.nativeElement.src = this.imageSource;
10517
+ this.cropper = new Cropper(this.image.nativeElement, {
10518
+ aspectRatio: this.rounded ? 1 : this.aspectRatio,
10519
+ guides: false,
10520
+ dragMode: "move",
10521
+ minCropBoxHeight: 2,
10522
+ minCropBoxWidth: 2,
10523
+ toggleDragModeOnDblclick: false,
10516
10524
  });
10517
10525
  };
10518
- CustomFieldsService.prototype.requestAccess = function (objectId, endpoint) {
10519
- return this.http.post(endpoint, { objectId: objectId });
10526
+ ImageCropperComponent.prototype.getRoundedCanvas = function (sourceCanvas) {
10527
+ var canvas = document.createElement("canvas");
10528
+ var context = canvas.getContext("2d");
10529
+ var width = sourceCanvas.width;
10530
+ var height = sourceCanvas.height;
10531
+ canvas.width = width;
10532
+ canvas.height = height;
10533
+ context.imageSmoothingEnabled = true;
10534
+ context.drawImage(sourceCanvas, 0, 0, width, height);
10535
+ context.globalCompositeOperation = "destination-in";
10536
+ context.beginPath();
10537
+ context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true);
10538
+ context.fill();
10539
+ return canvas;
10520
10540
  };
10521
- CustomFieldsService.prototype.getFile = function (permanentUrl) {
10522
- return this.http.get(permanentUrl, { responseType: "blob" });
10541
+ ImageCropperComponent.prototype.onCropImage = function () {
10542
+ if (!this.imageSource) {
10543
+ this.croppedImage.emit();
10544
+ this.croppedCanvas.emit();
10545
+ }
10546
+ else {
10547
+ var _croppedCanvas = this.rounded ? this.getRoundedCanvas(this.cropper.getCroppedCanvas()) : this.cropper.getCroppedCanvas();
10548
+ this.croppedCanvas.emit(_croppedCanvas);
10549
+ this.croppedImage.emit(_croppedCanvas.toDataURL());
10550
+ }
10551
+ this.visibleChange.emit(false);
10523
10552
  };
10524
- CustomFieldsService.ctorParameters = function () { return [
10525
- { type: http.HttpClient }
10526
- ]; };
10527
- CustomFieldsService = __decorate([
10528
- core.Injectable()
10529
- ], CustomFieldsService);
10530
- return CustomFieldsService;
10531
- }());
10532
-
10533
- var CustomFieldType;
10534
- (function (CustomFieldType) {
10535
- CustomFieldType["String"] = "String";
10536
- CustomFieldType["Boolean"] = "Boolean";
10537
- CustomFieldType["Integer"] = "Integer";
10538
- CustomFieldType["Double"] = "Double";
10539
- CustomFieldType["Date"] = "Date";
10540
- CustomFieldType["DateTime"] = "DateTime";
10541
- CustomFieldType["LocalDateTime"] = "LocalDateTime";
10542
- CustomFieldType["Time"] = "Time";
10543
- CustomFieldType["Money"] = "Money";
10544
- CustomFieldType["Blob"] = "Blob";
10545
- CustomFieldType["Binary"] = "Binary";
10546
- CustomFieldType["Any"] = "Any";
10553
+ ImageCropperComponent.prototype.onChangeImage = function () {
10554
+ this.changeImage.emit();
10555
+ };
10556
+ ImageCropperComponent.prototype.onRemoveImage = function () {
10557
+ this.imageSource = undefined;
10558
+ this.removedImage.emit();
10559
+ };
10560
+ ImageCropperComponent.prototype.onCancel = function () {
10561
+ this.visibleChange.emit(false);
10562
+ this.cancel.emit();
10563
+ };
10564
+ ImageCropperComponent.prototype.onModalVisibleChange = function (visible) {
10565
+ if (!visible)
10566
+ this.onCancel();
10567
+ this.visibleChange.emit(visible);
10568
+ };
10569
+ var ImageCropperComponent_1;
10570
+ ImageCropperComponent.nextId = 0;
10571
+ __decorate([
10572
+ core.Input()
10573
+ ], ImageCropperComponent.prototype, "id", void 0);
10574
+ __decorate([
10575
+ core.Input()
10576
+ ], ImageCropperComponent.prototype, "visible", void 0);
10577
+ __decorate([
10578
+ core.Input()
10579
+ ], ImageCropperComponent.prototype, "header", void 0);
10580
+ __decorate([
10581
+ core.Input()
10582
+ ], ImageCropperComponent.prototype, "cropLabel", void 0);
10583
+ __decorate([
10584
+ core.Input()
10585
+ ], ImageCropperComponent.prototype, "selectAnotherLabel", void 0);
10586
+ __decorate([
10587
+ core.Input()
10588
+ ], ImageCropperComponent.prototype, "removeLabel", void 0);
10589
+ __decorate([
10590
+ core.Input()
10591
+ ], ImageCropperComponent.prototype, "cancelLabel", void 0);
10592
+ __decorate([
10593
+ core.Input()
10594
+ ], ImageCropperComponent.prototype, "emptyStateTitle", void 0);
10595
+ __decorate([
10596
+ core.Input()
10597
+ ], ImageCropperComponent.prototype, "emptyStateActionLabel", void 0);
10598
+ __decorate([
10599
+ core.Input()
10600
+ ], ImageCropperComponent.prototype, "emptyStateIconClass", void 0);
10601
+ __decorate([
10602
+ core.Input()
10603
+ ], ImageCropperComponent.prototype, "aspectRatio", void 0);
10604
+ __decorate([
10605
+ core.Input()
10606
+ ], ImageCropperComponent.prototype, "rounded", void 0);
10607
+ __decorate([
10608
+ core.Input()
10609
+ ], ImageCropperComponent.prototype, "allowSelectAnother", void 0);
10610
+ __decorate([
10611
+ core.Input()
10612
+ ], ImageCropperComponent.prototype, "allowRemove", void 0);
10613
+ __decorate([
10614
+ core.Input()
10615
+ ], ImageCropperComponent.prototype, "allowCancel", void 0);
10616
+ __decorate([
10617
+ core.Input()
10618
+ ], ImageCropperComponent.prototype, "imageSource", void 0);
10619
+ __decorate([
10620
+ core.Output()
10621
+ ], ImageCropperComponent.prototype, "visibleChange", void 0);
10622
+ __decorate([
10623
+ core.Output()
10624
+ ], ImageCropperComponent.prototype, "changeImage", void 0);
10625
+ __decorate([
10626
+ core.Output()
10627
+ ], ImageCropperComponent.prototype, "croppedImage", void 0);
10628
+ __decorate([
10629
+ core.Output()
10630
+ ], ImageCropperComponent.prototype, "croppedCanvas", void 0);
10631
+ __decorate([
10632
+ core.Output()
10633
+ ], ImageCropperComponent.prototype, "removedImage", void 0);
10634
+ __decorate([
10635
+ core.Output()
10636
+ ], ImageCropperComponent.prototype, "cancel", void 0);
10637
+ __decorate([
10638
+ core.ViewChild("image", { static: true })
10639
+ ], ImageCropperComponent.prototype, "image", void 0);
10640
+ __decorate([
10641
+ core.ContentChild(HeaderComponent, { static: true })
10642
+ ], ImageCropperComponent.prototype, "headerSection", void 0);
10643
+ __decorate([
10644
+ core.ContentChild(FooterComponent, { static: true })
10645
+ ], ImageCropperComponent.prototype, "footerSection", void 0);
10646
+ ImageCropperComponent = ImageCropperComponent_1 = __decorate([
10647
+ core.Component({
10648
+ selector: "s-image-cropper",
10649
+ 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>",
10650
+ encapsulation: core.ViewEncapsulation.None,
10651
+ 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}}"]
10652
+ })
10653
+ ], ImageCropperComponent);
10654
+ return ImageCropperComponent;
10655
+ }());
10656
+
10657
+ var ImageCropperModule = /** @class */ (function () {
10658
+ function ImageCropperModule() {
10659
+ }
10660
+ ImageCropperModule = __decorate([
10661
+ core.NgModule({
10662
+ imports: [common.CommonModule, dialog.DialogModule, ButtonModule, EmptyStateModule, StructureModule],
10663
+ declarations: [ImageCropperComponent],
10664
+ exports: [ImageCropperComponent, StructureModule],
10665
+ entryComponents: [ImageCropperComponent],
10666
+ })
10667
+ ], ImageCropperModule);
10668
+ return ImageCropperModule;
10669
+ }());
10670
+
10671
+ var ImageCropperService = /** @class */ (function () {
10672
+ function ImageCropperService(componentFactoryResolver, appRef, injector) {
10673
+ this.componentFactoryResolver = componentFactoryResolver;
10674
+ this.appRef = appRef;
10675
+ this.injector = injector;
10676
+ }
10677
+ ImageCropperService.prototype.show = function (config) {
10678
+ var _this = this;
10679
+ if (this.activeCropper)
10680
+ this.destroy(this.activeCropper);
10681
+ var activeCropper = {
10682
+ componentRef: this.componentFactoryResolver.resolveComponentFactory(ImageCropperComponent).create(this.injector),
10683
+ ngUnsubscribe: new rxjs.Subject(),
10684
+ };
10685
+ this.activeCropper = activeCropper;
10686
+ this.appRef.attachView(activeCropper.componentRef.hostView);
10687
+ var domElem = activeCropper.componentRef.hostView.rootNodes[0];
10688
+ document.body.appendChild(domElem);
10689
+ this.configureInstance(activeCropper, config);
10690
+ activeCropper.componentRef.instance.visible = true;
10691
+ activeCropper.componentRef.instance.visibleChange
10692
+ .pipe(operators.takeUntil(this.activeCropper.ngUnsubscribe), operators.delay(1000))
10693
+ .subscribe(function (visible) {
10694
+ if (!visible)
10695
+ _this.destroy(activeCropper);
10696
+ });
10697
+ };
10698
+ ImageCropperService.prototype.configureInstance = function (activeCropper, config) {
10699
+ var instance = activeCropper.componentRef.instance;
10700
+ if (config) {
10701
+ Object.keys(config).forEach(function (key) {
10702
+ var value = config[key];
10703
+ if (typeof value !== "function")
10704
+ instance[key] = value;
10705
+ else if (typeof value === "function") {
10706
+ instance[key].pipe(operators.takeUntil(activeCropper.ngUnsubscribe)).subscribe(function () {
10707
+ var param = [];
10708
+ for (var _i = 0; _i < arguments.length; _i++) {
10709
+ param[_i] = arguments[_i];
10710
+ }
10711
+ return config[key].apply(config, __spread(param));
10712
+ });
10713
+ }
10714
+ });
10715
+ }
10716
+ instance.visibleChange.pipe(operators.takeUntil(activeCropper.ngUnsubscribe)).subscribe(function (visible) { return (instance.visible = visible); });
10717
+ };
10718
+ ImageCropperService.prototype.destroy = function (activeCropper) {
10719
+ activeCropper.ngUnsubscribe.next();
10720
+ activeCropper.ngUnsubscribe.complete();
10721
+ this.appRef.detachView(activeCropper.componentRef.hostView);
10722
+ activeCropper.componentRef.destroy();
10723
+ };
10724
+ ImageCropperService.ctorParameters = function () { return [
10725
+ { type: core.ComponentFactoryResolver },
10726
+ { type: core.ApplicationRef },
10727
+ { type: core.Injector }
10728
+ ]; };
10729
+ ImageCropperService = __decorate([
10730
+ core.Injectable()
10731
+ ], ImageCropperService);
10732
+ return ImageCropperService;
10733
+ }());
10734
+
10735
+
10736
+ (function (ThumbnailSize) {
10737
+ ThumbnailSize["Small"] = "small";
10738
+ ThumbnailSize["Medium"] = "medium";
10739
+ ThumbnailSize["Large"] = "large";
10740
+ })(exports.ThumbnailSize || (exports.ThumbnailSize = {}));
10741
+
10742
+ var ThumbnailService = /** @class */ (function () {
10743
+ function ThumbnailService() {
10744
+ }
10745
+ ThumbnailService.prototype.getBinaryFile = function (img) {
10746
+ var _this = this;
10747
+ return new Promise(function (resolve) {
10748
+ var getOrientation = _this.getOrientation.bind(_this);
10749
+ var http = new XMLHttpRequest();
10750
+ http.addEventListener("load", function () {
10751
+ if (http.readyState === 4 && (http.status == 200 || http.status === 0)) {
10752
+ var orientation_1 = getOrientation(http.response);
10753
+ http = null;
10754
+ resolve(orientation_1);
10755
+ }
10756
+ });
10757
+ http.addEventListener("error", function () {
10758
+ http = null;
10759
+ throw new Error("Não foi possível carregar a imagem");
10760
+ });
10761
+ http.open("GET", img.src, true);
10762
+ http.responseType = "arraybuffer";
10763
+ http.send(null);
10764
+ });
10765
+ };
10766
+ /**
10767
+ * 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.
10768
+ */
10769
+ ThumbnailService.prototype.getOrientation = function (file) {
10770
+ var view = new DataView(file);
10771
+ if (view.getUint16(0, false) != 0xffd8)
10772
+ return -2; // not jpeg
10773
+ var length = view.byteLength;
10774
+ var offset = 2;
10775
+ while (offset < length) {
10776
+ var marker = view.getUint16(offset, false);
10777
+ offset += 2;
10778
+ if (marker == 0xffe1) {
10779
+ if (view.getUint32((offset += 2), false) != 0x45786966) {
10780
+ return -1; // not defined
10781
+ }
10782
+ var little = view.getUint16((offset += 6), false) == 0x4949;
10783
+ offset += view.getUint32(offset + 4, little);
10784
+ var tags = view.getUint16(offset, little);
10785
+ offset += 2;
10786
+ for (var i = 0; i < tags; i++)
10787
+ if (view.getUint16(offset + i * 12, little) == 0x0112)
10788
+ return view.getUint16(offset + i * 12 + 8, little);
10789
+ // tslint:disable-next-line: no-bitwise
10790
+ }
10791
+ else if ((marker & 0xff00) != 0xff00)
10792
+ break;
10793
+ else
10794
+ offset += view.getUint16(offset, false);
10795
+ }
10796
+ return -1; // not defined
10797
+ };
10798
+ ThumbnailService = __decorate([
10799
+ core.Injectable()
10800
+ ], ThumbnailService);
10801
+ return ThumbnailService;
10802
+ }());
10803
+
10804
+ var ThumbnailComponent = /** @class */ (function () {
10805
+ function ThumbnailComponent(thumbnailService) {
10806
+ this.thumbnailService = thumbnailService;
10807
+ this.fallback = false;
10808
+ this.id = "s-thumbnail-" + ThumbnailComponent_1.nextId++;
10809
+ this.size = exports.ThumbnailSize.Medium;
10810
+ this.iconClass = "far fa-image";
10811
+ this.hasAction = false;
10812
+ this.actionIconClass = "fas fa-camera";
10813
+ this.isTile = false;
10814
+ this.isBrand = false;
10815
+ this.ngUnsubscribe = new rxjs.Subject();
10816
+ }
10817
+ ThumbnailComponent_1 = ThumbnailComponent;
10818
+ ThumbnailComponent.prototype.ngOnDestroy = function () {
10819
+ this.ngUnsubscribe.next();
10820
+ this.ngUnsubscribe.complete();
10821
+ };
10822
+ ThumbnailComponent.prototype.ngAfterViewInit = function () {
10823
+ var _this = this;
10824
+ if (this.imgEl) {
10825
+ this.imgEl.nativeElement.addEventListener("load", function () {
10826
+ rxjs.from(_this.thumbnailService.getBinaryFile(_this.imgEl.nativeElement))
10827
+ .pipe(operators.takeUntil(_this.ngUnsubscribe))
10828
+ .subscribe(function (orientation) { return (_this.orientation = orientation); });
10829
+ });
10830
+ }
10831
+ };
10832
+ var ThumbnailComponent_1;
10833
+ ThumbnailComponent.nextId = 0;
10834
+ ThumbnailComponent.ctorParameters = function () { return [
10835
+ { type: ThumbnailService }
10836
+ ]; };
10837
+ __decorate([
10838
+ core.ViewChild("img", { static: false })
10839
+ ], ThumbnailComponent.prototype, "imgEl", void 0);
10840
+ __decorate([
10841
+ core.Input()
10842
+ ], ThumbnailComponent.prototype, "id", void 0);
10843
+ __decorate([
10844
+ core.Input()
10845
+ ], ThumbnailComponent.prototype, "size", void 0);
10846
+ __decorate([
10847
+ core.Input()
10848
+ ], ThumbnailComponent.prototype, "imageSource", void 0);
10849
+ __decorate([
10850
+ core.Input()
10851
+ ], ThumbnailComponent.prototype, "imageFallback", void 0);
10852
+ __decorate([
10853
+ core.Input()
10854
+ ], ThumbnailComponent.prototype, "imageAlt", void 0);
10855
+ __decorate([
10856
+ core.Input()
10857
+ ], ThumbnailComponent.prototype, "iconClass", void 0);
10858
+ __decorate([
10859
+ core.Input()
10860
+ ], ThumbnailComponent.prototype, "hasAction", void 0);
10861
+ __decorate([
10862
+ core.Input()
10863
+ ], ThumbnailComponent.prototype, "actionIconClass", void 0);
10864
+ __decorate([
10865
+ core.Input()
10866
+ ], ThumbnailComponent.prototype, "isTile", void 0);
10867
+ __decorate([
10868
+ core.Input()
10869
+ ], ThumbnailComponent.prototype, "isBrand", void 0);
10870
+ ThumbnailComponent = ThumbnailComponent_1 = __decorate([
10871
+ core.Component({
10872
+ selector: "s-thumbnail",
10873
+ 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",
10874
+ 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}"]
10875
+ })
10876
+ ], ThumbnailComponent);
10877
+ return ThumbnailComponent;
10878
+ }());
10879
+
10880
+ var ThumbnailModule = /** @class */ (function () {
10881
+ function ThumbnailModule() {
10882
+ }
10883
+ ThumbnailModule = __decorate([
10884
+ core.NgModule({
10885
+ imports: [common.CommonModule],
10886
+ declarations: [ThumbnailComponent],
10887
+ exports: [ThumbnailComponent],
10888
+ providers: [ThumbnailService],
10889
+ })
10890
+ ], ThumbnailModule);
10891
+ return ThumbnailModule;
10892
+ }());
10893
+
10894
+
10895
+ (function (FileValidation) {
10896
+ FileValidation["MaxFileSize"] = "maxFileSize";
10897
+ FileValidation["MaxFileLimit"] = "maxFileLimit";
10898
+ FileValidation["TypeInvalid"] = "typeInvalid";
10899
+ FileValidation["UnsupportedExtension"] = "unsupportedExtension";
10900
+ })(exports.FileValidation || (exports.FileValidation = {}));
10901
+
10902
+ var ProfilePicturePickerComponent = /** @class */ (function () {
10903
+ function ProfilePicturePickerComponent(imageCropperService, confirmationService, translateService) {
10904
+ this.imageCropperService = imageCropperService;
10905
+ this.confirmationService = confirmationService;
10906
+ this.translateService = translateService;
10907
+ this.aspectRatio = 1;
10908
+ this.confirmationTexts = {
10909
+ removalHeader: this.translateService.instant("platform.angular_components.remove_image"),
10910
+ removalMessage: this.translateService.instant("platform.angular_components.confirmation_remove_image"),
10911
+ removalAcceptLabel: this.translateService.instant("platform.angular_components.remove"),
10912
+ removalRejectLabel: this.translateService.instant("platform.angular_components.cancel"),
10913
+ };
10914
+ this.supportedExtensions = [];
10915
+ this.changedImage = new core.EventEmitter();
10916
+ this.removedImage = new core.EventEmitter();
10917
+ this.invalidFile = new core.EventEmitter();
10918
+ }
10919
+ ProfilePicturePickerComponent_1 = ProfilePicturePickerComponent;
10920
+ ProfilePicturePickerComponent.prototype.writeValue = function (value) {
10921
+ this._value = value;
10922
+ };
10923
+ ProfilePicturePickerComponent.prototype.registerOnChange = function (onChange) {
10924
+ this._onChange = onChange;
10925
+ };
10926
+ ProfilePicturePickerComponent.prototype.registerOnTouched = function (onTouched) {
10927
+ this._onTouched = onTouched;
10928
+ };
10929
+ ProfilePicturePickerComponent.prototype.ngOnInit = function () {
10930
+ this._normalizeSuportedExtensions();
10931
+ };
10932
+ ProfilePicturePickerComponent.prototype.onDragOver = function (event) {
10933
+ event.preventDefault();
10934
+ event.stopPropagation();
10935
+ };
10936
+ ProfilePicturePickerComponent.prototype.onDragLeave = function (event) {
10937
+ event.preventDefault();
10938
+ event.stopPropagation();
10939
+ };
10940
+ ProfilePicturePickerComponent.prototype.onDrop = function (event) {
10941
+ event.preventDefault();
10942
+ event.stopPropagation();
10943
+ var files = [];
10944
+ var dataTransferFiles = event.dataTransfer.files;
10945
+ for (var i = 0; i < dataTransferFiles.length; i++) {
10946
+ files.push(dataTransferFiles.item(i));
10947
+ }
10948
+ this._showImageCropper(files);
10949
+ };
10950
+ // Verificando o redimensionamento para ajustar o design para ficar responsivo.
10951
+ ProfilePicturePickerComponent.prototype.onResize = function () {
10952
+ if (this.uploadPicture && this.info && this.thumbnail) {
10953
+ var uploadPictureWidth = this._getWidthElement(this.uploadPicture);
10954
+ var infoWidth = this._getWidthElement(this.info);
10955
+ var thumbnailWidth = this._getWidthElement(this.thumbnail);
10956
+ if (thumbnailWidth + infoWidth > uploadPictureWidth) {
10957
+ this.uploadPicture.nativeElement.classList.add("upload-picture--small");
10958
+ }
10959
+ else {
10960
+ this.uploadPicture.nativeElement.classList.remove("upload-picture--small");
10961
+ }
10962
+ }
10963
+ };
10964
+ ProfilePicturePickerComponent.prototype.selectPhoto = function () {
10965
+ var fileInputElement = this.fileInput.nativeElement;
10966
+ fileInputElement.value = "";
10967
+ fileInputElement.click();
10968
+ };
10969
+ ProfilePicturePickerComponent.prototype.removePhoto = function () {
10970
+ var _this = this;
10971
+ this.confirmationService.confirm({
10972
+ message: this.confirmationTexts.removalMessage,
10973
+ acceptLabel: this.confirmationTexts.removalAcceptLabel,
10974
+ rejectLabel: this.confirmationTexts.removalRejectLabel,
10975
+ header: this.confirmationTexts.removalHeader,
10976
+ accept: function () {
10977
+ var fileInputElement = _this.fileInput.nativeElement;
10978
+ fileInputElement.value = "";
10979
+ _this.image = "";
10980
+ _this.removedImage.emit();
10981
+ },
10982
+ });
10983
+ };
10984
+ ProfilePicturePickerComponent.prototype.photoSelected = function (event) {
10985
+ this._showImageCropper(event.srcElement.files);
10986
+ };
10987
+ ProfilePicturePickerComponent.prototype._showImageCropper = function (files) {
10988
+ var _this = this;
10989
+ if (!this._validateData(files)) {
10990
+ return;
10991
+ }
10992
+ var file = files[0];
10993
+ var fileReader = new FileReader();
10994
+ fileReader.readAsDataURL(file);
10995
+ fileReader.onloadend = function (fileEvent) {
10996
+ _this.imageCropperService.show(__assign({ imageSource: fileEvent.target.result, croppedImage: function (image) {
10997
+ _this.image = image;
10998
+ _this.changedImage.emit(image);
10999
+ _this._value = { sourceFile: file, base64: image };
11000
+ _this._onChange(_this._value);
11001
+ }, changeImage: function () { return _this.selectPhoto(); }, allowSelectAnother: false, aspectRatio: _this.aspectRatio }, _this.cropperLabelsConfig));
11002
+ };
11003
+ };
11004
+ ProfilePicturePickerComponent.prototype._normalizeSuportedExtensions = function () {
11005
+ var _a;
11006
+ this.supportedExtensions = (_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.map(function (extension) { return extension.replace(".", "").toLocaleLowerCase(); });
11007
+ };
11008
+ ProfilePicturePickerComponent.prototype._validateData = function (files) {
11009
+ if (!files.length) {
11010
+ return false;
11011
+ }
11012
+ if (files.length > 1) {
11013
+ this.invalidFile.emit({ file: null, validation: exports.FileValidation.MaxFileLimit });
11014
+ return false;
11015
+ }
11016
+ var file = files[0];
11017
+ if (!file.type.includes("image")) {
11018
+ this.invalidFile.emit({ file: file, validation: exports.FileValidation.TypeInvalid });
11019
+ return false;
11020
+ }
11021
+ if (!this._validateFileExtension(file)) {
11022
+ this.invalidFile.emit({ file: file, validation: exports.FileValidation.UnsupportedExtension });
11023
+ return false;
11024
+ }
11025
+ if (!this._validateFileSize(file)) {
11026
+ this.invalidFile.emit({ file: file, validation: exports.FileValidation.MaxFileSize });
11027
+ return false;
11028
+ }
11029
+ return true;
11030
+ };
11031
+ ProfilePicturePickerComponent.prototype._validateFileExtension = function (file) {
11032
+ var _a;
11033
+ if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
11034
+ var extension = file.name.split(".").pop().toLowerCase();
11035
+ return this.supportedExtensions.includes(extension);
11036
+ }
11037
+ return true;
11038
+ };
11039
+ ProfilePicturePickerComponent.prototype._validateFileSize = function (file) {
11040
+ if (this.maxFileSize) {
11041
+ return file.size > this.maxFileSize;
11042
+ }
11043
+ return true;
11044
+ };
11045
+ ProfilePicturePickerComponent.prototype._getWidthElement = function (element) {
11046
+ var _a = element.nativeElement.getBoundingClientRect(), left = _a.left, right = _a.right;
11047
+ return right - left;
11048
+ };
11049
+ var ProfilePicturePickerComponent_1;
11050
+ ProfilePicturePickerComponent.ctorParameters = function () { return [
11051
+ { type: ImageCropperService },
11052
+ { type: api.ConfirmationService },
11053
+ { type: core$1.TranslateService }
11054
+ ]; };
11055
+ __decorate([
11056
+ core.Input()
11057
+ ], ProfilePicturePickerComponent.prototype, "simpleTitle", void 0);
11058
+ __decorate([
11059
+ core.Input()
11060
+ ], ProfilePicturePickerComponent.prototype, "actionTitle", void 0);
11061
+ __decorate([
11062
+ core.Input()
11063
+ ], ProfilePicturePickerComponent.prototype, "subtitle", void 0);
11064
+ __decorate([
11065
+ core.Input()
11066
+ ], ProfilePicturePickerComponent.prototype, "aspectRatio", void 0);
11067
+ __decorate([
11068
+ core.Input()
11069
+ ], ProfilePicturePickerComponent.prototype, "cropperLabelsConfig", void 0);
11070
+ __decorate([
11071
+ core.Input()
11072
+ ], ProfilePicturePickerComponent.prototype, "removeButtonLabel", void 0);
11073
+ __decorate([
11074
+ core.Input()
11075
+ ], ProfilePicturePickerComponent.prototype, "changeButtonLabel", void 0);
11076
+ __decorate([
11077
+ core.Input()
11078
+ ], ProfilePicturePickerComponent.prototype, "confirmationTexts", void 0);
11079
+ __decorate([
11080
+ core.Input()
11081
+ ], ProfilePicturePickerComponent.prototype, "maxFileSize", void 0);
11082
+ __decorate([
11083
+ core.Input()
11084
+ ], ProfilePicturePickerComponent.prototype, "accept", void 0);
11085
+ __decorate([
11086
+ core.Input()
11087
+ ], ProfilePicturePickerComponent.prototype, "supportedExtensions", void 0);
11088
+ __decorate([
11089
+ core.Input()
11090
+ ], ProfilePicturePickerComponent.prototype, "image", void 0);
11091
+ __decorate([
11092
+ core.ViewChild("uploadPicture")
11093
+ ], ProfilePicturePickerComponent.prototype, "uploadPicture", void 0);
11094
+ __decorate([
11095
+ core.ViewChild("info")
11096
+ ], ProfilePicturePickerComponent.prototype, "info", void 0);
11097
+ __decorate([
11098
+ core.ViewChild("thumbnail", { read: core.ElementRef })
11099
+ ], ProfilePicturePickerComponent.prototype, "thumbnail", void 0);
11100
+ __decorate([
11101
+ core.ViewChild("fileInput", { read: core.ElementRef })
11102
+ ], ProfilePicturePickerComponent.prototype, "fileInput", void 0);
11103
+ __decorate([
11104
+ core.Output()
11105
+ ], ProfilePicturePickerComponent.prototype, "changedImage", void 0);
11106
+ __decorate([
11107
+ core.Output()
11108
+ ], ProfilePicturePickerComponent.prototype, "removedImage", void 0);
11109
+ __decorate([
11110
+ core.Output()
11111
+ ], ProfilePicturePickerComponent.prototype, "invalidFile", void 0);
11112
+ __decorate([
11113
+ core.HostListener("dragover", ["$event"])
11114
+ ], ProfilePicturePickerComponent.prototype, "onDragOver", null);
11115
+ __decorate([
11116
+ core.HostListener("dragleave", ["$event"])
11117
+ ], ProfilePicturePickerComponent.prototype, "onDragLeave", null);
11118
+ __decorate([
11119
+ core.HostListener("drop", ["$event"])
11120
+ ], ProfilePicturePickerComponent.prototype, "onDrop", null);
11121
+ __decorate([
11122
+ core.HostListener("window:resize")
11123
+ ], ProfilePicturePickerComponent.prototype, "onResize", null);
11124
+ ProfilePicturePickerComponent = ProfilePicturePickerComponent_1 = __decorate([
11125
+ core.Component({
11126
+ selector: "s-profile-picture-picker",
11127
+ 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>",
11128
+ providers: [{
11129
+ provide: forms.NG_VALUE_ACCESSOR,
11130
+ useExisting: core.forwardRef(function () { return ProfilePicturePickerComponent_1; }),
11131
+ multi: true,
11132
+ }],
11133
+ 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}"]
11134
+ })
11135
+ ], ProfilePicturePickerComponent);
11136
+ return ProfilePicturePickerComponent;
11137
+ }());
11138
+
11139
+ var ProfilePicturePickerModule = /** @class */ (function () {
11140
+ function ProfilePicturePickerModule() {
11141
+ }
11142
+ ProfilePicturePickerModule = __decorate([
11143
+ core.NgModule({
11144
+ imports: [
11145
+ common.CommonModule,
11146
+ core$1.TranslateModule,
11147
+ ButtonModule,
11148
+ ThumbnailModule,
11149
+ ImageCropperModule,
11150
+ confirmdialog.ConfirmDialogModule,
11151
+ ],
11152
+ declarations: [ProfilePicturePickerComponent],
11153
+ exports: [ProfilePicturePickerComponent],
11154
+ providers: [
11155
+ ImageCropperService,
11156
+ api.ConfirmationService,
11157
+ ],
11158
+ })
11159
+ ], ProfilePicturePickerModule);
11160
+ return ProfilePicturePickerModule;
11161
+ }());
11162
+
11163
+ var ProfilePictureModule = /** @class */ (function () {
11164
+ function ProfilePictureModule() {
11165
+ }
11166
+ ProfilePictureModule = __decorate([
11167
+ core.NgModule({
11168
+ imports: [
11169
+ common.CommonModule,
11170
+ forms.FormsModule,
11171
+ forms.ReactiveFormsModule,
11172
+ ProfilePicturePickerModule,
11173
+ ],
11174
+ declarations: [ProfilePictureFieldComponent],
11175
+ exports: [ProfilePictureFieldComponent],
11176
+ })
11177
+ ], ProfilePictureModule);
11178
+ return ProfilePictureModule;
11179
+ }());
11180
+
11181
+ var DynamicFormModule = /** @class */ (function () {
11182
+ function DynamicFormModule() {
11183
+ }
11184
+ DynamicFormModule = __decorate([
11185
+ core.NgModule({
11186
+ imports: [
11187
+ autocomplete$2.AutoCompleteModule,
11188
+ BignumberInputModule,
11189
+ ButtonModule,
11190
+ CalendarMaskModule,
11191
+ calendar.CalendarModule,
11192
+ checkbox.CheckboxModule,
11193
+ chips.ChipsModule,
11194
+ common.CommonModule,
11195
+ ControlErrorsModule,
11196
+ CountryPhonePickerModule,
11197
+ dialog.DialogModule,
11198
+ dropdown.DropdownModule,
11199
+ EmptyStateModule,
11200
+ forms.FormsModule,
11201
+ angular2Hotkeys.HotkeyModule,
11202
+ inputmask.InputMaskModule,
11203
+ inputtextarea.InputTextareaModule,
11204
+ inputtext.InputTextModule,
11205
+ keyfilter.KeyFilterModule,
11206
+ LoadingStateModule,
11207
+ LocaleModule,
11208
+ LocalizedNumberInputModule,
11209
+ panel.PanelModule,
11210
+ button.ButtonModule,
11211
+ table.TableModule,
11212
+ multiselect.MultiSelectModule,
11213
+ NumberInputModule,
11214
+ radiobutton.RadioButtonModule,
11215
+ forms.ReactiveFormsModule,
11216
+ TooltipModule,
11217
+ fieldset.FieldsetModule,
11218
+ TableHeaderCheckboxModule,
11219
+ FileUploadModule,
11220
+ TableModule,
11221
+ InfoSignModule,
11222
+ MaskFormatterModule,
11223
+ angular2Hotkeys.HotkeyModule.forRoot(),
11224
+ MouseEventsModule,
11225
+ SwitchModule,
11226
+ PasswordStrengthModule,
11227
+ slider.SliderModule,
11228
+ core$1.TranslateModule.forChild(),
11229
+ PasswordFieldModule,
11230
+ TextFieldModule,
11231
+ NumberFieldModule,
11232
+ CurrencyFieldModule,
11233
+ NumberFieldModule$1,
11234
+ ProfilePictureModule,
11235
+ ],
11236
+ declarations: [
11237
+ AutocompleteFieldComponent,
11238
+ BooleanFieldComponent,
11239
+ BooleanSwitchFieldComponent,
11240
+ CalendarFieldComponent,
11241
+ ChipsFieldComponent,
11242
+ CountryPhonePickerFieldComponent,
11243
+ DynamicFieldComponent,
11244
+ DynamicFormComponent,
11245
+ DynamicFormDirective,
11246
+ FieldsetComponent,
11247
+ FileUploadComponent$1,
11248
+ LookupComponent,
11249
+ LookupFieldComponent,
11250
+ RadioButtonComponent,
11251
+ RowComponent,
11252
+ SectionComponent,
11253
+ SelectFieldComponent,
11254
+ SliderFieldComponent,
11255
+ TextAreaFieldComponent,
11256
+ TextAreaIAFieldComponent,
11257
+ ],
11258
+ exports: [DynamicFormComponent, LookupComponent],
11259
+ entryComponents: [
11260
+ AutocompleteFieldComponent,
11261
+ BooleanFieldComponent,
11262
+ BooleanSwitchFieldComponent,
11263
+ CalendarFieldComponent,
11264
+ ChipsFieldComponent,
11265
+ CountryPhonePickerFieldComponent,
11266
+ FieldsetComponent,
11267
+ FileUploadComponent$1,
11268
+ LookupFieldComponent,
11269
+ RadioButtonComponent,
11270
+ RowComponent,
11271
+ SectionComponent,
11272
+ SelectFieldComponent,
11273
+ SliderFieldComponent,
11274
+ TextAreaFieldComponent,
11275
+ TextAreaIAFieldComponent,
11276
+ ],
11277
+ providers: [
11278
+ angular2Hotkeys.HotkeysService,
11279
+ IAssistService,
11280
+ ]
11281
+ })
11282
+ ], DynamicFormModule);
11283
+ return DynamicFormModule;
11284
+ }());
11285
+
11286
+ var CustomFieldsService = /** @class */ (function () {
11287
+ function CustomFieldsService(http) {
11288
+ this.http = http;
11289
+ }
11290
+ CustomFieldsService.prototype.getCustomFields = function (domain, service, entity, endpoint) {
11291
+ var entityDto = { entityId: { domain_: domain, service_: service, id: entity } };
11292
+ return this.http.post(endpoint, entityDto);
11293
+ };
11294
+ CustomFieldsService.prototype.getFileLocationUrl = function (dto, endpoint) {
11295
+ return this.http.post(endpoint, dto);
11296
+ };
11297
+ CustomFieldsService.prototype.uploadTempFile = function (location, file) {
11298
+ return this.http.put(location, file, {
11299
+ reportProgress: true,
11300
+ observe: "events",
11301
+ headers: { "Content-Type": file.type }
11302
+ });
11303
+ };
11304
+ CustomFieldsService.prototype.requestAccess = function (objectId, endpoint) {
11305
+ return this.http.post(endpoint, { objectId: objectId });
11306
+ };
11307
+ CustomFieldsService.prototype.getFile = function (permanentUrl) {
11308
+ return this.http.get(permanentUrl, { responseType: "blob" });
11309
+ };
11310
+ CustomFieldsService.ctorParameters = function () { return [
11311
+ { type: http.HttpClient }
11312
+ ]; };
11313
+ CustomFieldsService = __decorate([
11314
+ core.Injectable()
11315
+ ], CustomFieldsService);
11316
+ return CustomFieldsService;
11317
+ }());
11318
+
11319
+ var CustomFieldType;
11320
+ (function (CustomFieldType) {
11321
+ CustomFieldType["String"] = "String";
11322
+ CustomFieldType["Boolean"] = "Boolean";
11323
+ CustomFieldType["Integer"] = "Integer";
11324
+ CustomFieldType["Double"] = "Double";
11325
+ CustomFieldType["Date"] = "Date";
11326
+ CustomFieldType["DateTime"] = "DateTime";
11327
+ CustomFieldType["LocalDateTime"] = "LocalDateTime";
11328
+ CustomFieldType["Time"] = "Time";
11329
+ CustomFieldType["Money"] = "Money";
11330
+ CustomFieldType["Blob"] = "Blob";
11331
+ CustomFieldType["Binary"] = "Binary";
11332
+ CustomFieldType["Any"] = "Any";
10547
11333
  CustomFieldType["Enum"] = "Enum";
10548
11334
  })(CustomFieldType || (CustomFieldType = {}));
10549
11335
  var moment$5 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
@@ -13053,175 +13839,30 @@
13053
13839
  __decorate([
13054
13840
  core.Input()
13055
13841
  ], SideTableComponent.prototype, "multipleTaskPerLine", void 0);
13056
- SideTableComponent = __decorate([
13057
- core.Component({
13058
- selector: 'gantt-side-table',
13059
- 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",
13060
- 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}"]
13061
- })
13062
- ], SideTableComponent);
13063
- return SideTableComponent;
13064
- }());
13065
-
13066
- var GanttModule = /** @class */ (function () {
13067
- function GanttModule() {
13068
- }
13069
- GanttModule = __decorate([
13070
- core.NgModule({
13071
- imports: [common.CommonModule, TooltipModule],
13072
- declarations: [
13073
- GanttComponent,
13074
- SideTableComponent,
13075
- ],
13076
- exports: [GanttComponent],
13077
- })
13078
- ], GanttModule);
13079
- return GanttModule;
13080
- }());
13081
-
13082
-
13083
- (function (ThumbnailSize) {
13084
- ThumbnailSize["Small"] = "small";
13085
- ThumbnailSize["Medium"] = "medium";
13086
- ThumbnailSize["Large"] = "large";
13087
- })(exports.ThumbnailSize || (exports.ThumbnailSize = {}));
13088
-
13089
- var ThumbnailService = /** @class */ (function () {
13090
- function ThumbnailService() {
13091
- }
13092
- ThumbnailService.prototype.getBinaryFile = function (img) {
13093
- var _this = this;
13094
- return new Promise(function (resolve) {
13095
- var getOrientation = _this.getOrientation.bind(_this);
13096
- var http = new XMLHttpRequest();
13097
- http.addEventListener("load", function () {
13098
- if (http.readyState === 4 && (http.status == 200 || http.status === 0)) {
13099
- var orientation_1 = getOrientation(http.response);
13100
- http = null;
13101
- resolve(orientation_1);
13102
- }
13103
- });
13104
- http.addEventListener("error", function () {
13105
- http = null;
13106
- throw new Error("Não foi possível carregar a imagem");
13107
- });
13108
- http.open("GET", img.src, true);
13109
- http.responseType = "arraybuffer";
13110
- http.send(null);
13111
- });
13112
- };
13113
- /**
13114
- * 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.
13115
- */
13116
- ThumbnailService.prototype.getOrientation = function (file) {
13117
- var view = new DataView(file);
13118
- if (view.getUint16(0, false) != 0xffd8)
13119
- return -2; // not jpeg
13120
- var length = view.byteLength;
13121
- var offset = 2;
13122
- while (offset < length) {
13123
- var marker = view.getUint16(offset, false);
13124
- offset += 2;
13125
- if (marker == 0xffe1) {
13126
- if (view.getUint32((offset += 2), false) != 0x45786966) {
13127
- return -1; // not defined
13128
- }
13129
- var little = view.getUint16((offset += 6), false) == 0x4949;
13130
- offset += view.getUint32(offset + 4, little);
13131
- var tags = view.getUint16(offset, little);
13132
- offset += 2;
13133
- for (var i = 0; i < tags; i++)
13134
- if (view.getUint16(offset + i * 12, little) == 0x0112)
13135
- return view.getUint16(offset + i * 12 + 8, little);
13136
- // tslint:disable-next-line: no-bitwise
13137
- }
13138
- else if ((marker & 0xff00) != 0xff00)
13139
- break;
13140
- else
13141
- offset += view.getUint16(offset, false);
13142
- }
13143
- return -1; // not defined
13144
- };
13145
- ThumbnailService = __decorate([
13146
- core.Injectable()
13147
- ], ThumbnailService);
13148
- return ThumbnailService;
13149
- }());
13150
-
13151
- var ThumbnailComponent = /** @class */ (function () {
13152
- function ThumbnailComponent(thumbnailService) {
13153
- this.thumbnailService = thumbnailService;
13154
- this.fallback = false;
13155
- this.id = "s-thumbnail-" + ThumbnailComponent_1.nextId++;
13156
- this.size = exports.ThumbnailSize.Medium;
13157
- this.iconClass = "far fa-image";
13158
- this.hasAction = false;
13159
- this.actionIconClass = "fas fa-camera";
13160
- this.isTile = false;
13161
- this.isBrand = false;
13162
- this.ngUnsubscribe = new rxjs.Subject();
13163
- }
13164
- ThumbnailComponent_1 = ThumbnailComponent;
13165
- ThumbnailComponent.prototype.ngOnDestroy = function () {
13166
- this.ngUnsubscribe.next();
13167
- this.ngUnsubscribe.complete();
13168
- };
13169
- ThumbnailComponent.prototype.ngAfterViewInit = function () {
13170
- var _this = this;
13171
- if (this.imgEl) {
13172
- this.imgEl.nativeElement.addEventListener("load", function () {
13173
- rxjs.from(_this.thumbnailService.getBinaryFile(_this.imgEl.nativeElement))
13174
- .pipe(operators.takeUntil(_this.ngUnsubscribe))
13175
- .subscribe(function (orientation) { return (_this.orientation = orientation); });
13176
- });
13177
- }
13178
- };
13179
- var ThumbnailComponent_1;
13180
- ThumbnailComponent.nextId = 0;
13181
- ThumbnailComponent.ctorParameters = function () { return [
13182
- { type: ThumbnailService }
13183
- ]; };
13184
- __decorate([
13185
- core.ViewChild("img", { static: false })
13186
- ], ThumbnailComponent.prototype, "imgEl", void 0);
13187
- __decorate([
13188
- core.Input()
13189
- ], ThumbnailComponent.prototype, "id", void 0);
13190
- __decorate([
13191
- core.Input()
13192
- ], ThumbnailComponent.prototype, "size", void 0);
13193
- __decorate([
13194
- core.Input()
13195
- ], ThumbnailComponent.prototype, "imageSource", void 0);
13196
- __decorate([
13197
- core.Input()
13198
- ], ThumbnailComponent.prototype, "imageFallback", void 0);
13199
- __decorate([
13200
- core.Input()
13201
- ], ThumbnailComponent.prototype, "imageAlt", void 0);
13202
- __decorate([
13203
- core.Input()
13204
- ], ThumbnailComponent.prototype, "iconClass", void 0);
13205
- __decorate([
13206
- core.Input()
13207
- ], ThumbnailComponent.prototype, "hasAction", void 0);
13208
- __decorate([
13209
- core.Input()
13210
- ], ThumbnailComponent.prototype, "actionIconClass", void 0);
13211
- __decorate([
13212
- core.Input()
13213
- ], ThumbnailComponent.prototype, "isTile", void 0);
13214
- __decorate([
13215
- core.Input()
13216
- ], ThumbnailComponent.prototype, "isBrand", void 0);
13217
- ThumbnailComponent = ThumbnailComponent_1 = __decorate([
13218
- core.Component({
13219
- selector: "s-thumbnail",
13220
- 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",
13221
- 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}"]
13842
+ SideTableComponent = __decorate([
13843
+ core.Component({
13844
+ selector: 'gantt-side-table',
13845
+ 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",
13846
+ 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}"]
13222
13847
  })
13223
- ], ThumbnailComponent);
13224
- return ThumbnailComponent;
13848
+ ], SideTableComponent);
13849
+ return SideTableComponent;
13850
+ }());
13851
+
13852
+ var GanttModule = /** @class */ (function () {
13853
+ function GanttModule() {
13854
+ }
13855
+ GanttModule = __decorate([
13856
+ core.NgModule({
13857
+ imports: [common.CommonModule, TooltipModule],
13858
+ declarations: [
13859
+ GanttComponent,
13860
+ SideTableComponent,
13861
+ ],
13862
+ exports: [GanttComponent],
13863
+ })
13864
+ ], GanttModule);
13865
+ return GanttModule;
13225
13866
  }());
13226
13867
 
13227
13868
 
@@ -13298,770 +13939,462 @@
13298
13939
  core.Component({
13299
13940
  selector: "s-global-search-dropdown-item",
13300
13941
  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",
13301
- 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}"]
13302
- })
13303
- ], GlobalSearchDropdownItemComponent);
13304
- return GlobalSearchDropdownItemComponent;
13305
- }());
13306
-
13307
- var GlobalSearchComponent = /** @class */ (function () {
13308
- function GlobalSearchComponent(cdr) {
13309
- this.cdr = cdr;
13310
- this.id = "s-global-search-" + GlobalSearchDropdownItemComponent.nextId++;
13311
- this.delay = 500;
13312
- this.isLoading = false;
13313
- this.showFooter = true;
13314
- this.onSearch = new core.EventEmitter();
13315
- this.onFocus = new core.EventEmitter();
13316
- this.onShowMore = new core.EventEmitter();
13317
- this.wasSearched = false;
13318
- this.isModalLoading = false;
13319
- this.expanded = true;
13320
- }
13321
- GlobalSearchComponent.prototype.onChange = function () {
13322
- var _this = this;
13323
- var search = this.search;
13324
- setTimeout(function () {
13325
- if (_this.search === search) {
13326
- _this.canShowGlobalSearchActive();
13327
- _this.onSearch.emit(_this.search);
13328
- }
13329
- }, this.delay);
13330
- };
13331
- GlobalSearchComponent.prototype.focusIn = function () {
13332
- this.onFocus.emit(true);
13333
- };
13334
- GlobalSearchComponent.prototype.focusOut = function () {
13335
- this.onFocus.emit(false);
13336
- };
13337
- GlobalSearchComponent.prototype.showMore = function () {
13338
- this.onShowMore.emit();
13339
- };
13340
- GlobalSearchComponent.prototype.removeActiveClassByGlobalSearch = function () {
13341
- ExportUtils.removeClass(this.globalSearch, "global-search__input-active");
13342
- };
13343
- GlobalSearchComponent.prototype.close = function () {
13344
- this.search = null;
13345
- this.wasSearched = false;
13346
- this.dropdownItens = null;
13347
- this.isModalLoading = false;
13348
- this.removeActiveClassByGlobalSearch();
13349
- };
13350
- GlobalSearchComponent.prototype.canShowGlobalSearchActive = function () {
13351
- this.wasSearched = !!this.search;
13352
- if (this.search) {
13353
- ExportUtils.addClass(this.globalSearch, "global-search__input-active");
13354
- }
13355
- else {
13356
- this.removeActiveClassByGlobalSearch();
13357
- this.close();
13358
- }
13359
- this.cdr.detectChanges();
13360
- };
13361
- GlobalSearchComponent.nextId = 0;
13362
- GlobalSearchComponent.ctorParameters = function () { return [
13363
- { type: core.ChangeDetectorRef }
13364
- ]; };
13365
- __decorate([
13366
- core.ViewChild("globalSearch", { static: false })
13367
- ], GlobalSearchComponent.prototype, "globalSearch", void 0);
13368
- __decorate([
13369
- core.Input()
13370
- ], GlobalSearchComponent.prototype, "id", void 0);
13371
- __decorate([
13372
- core.Input()
13373
- ], GlobalSearchComponent.prototype, "delay", void 0);
13374
- __decorate([
13375
- core.Input()
13376
- ], GlobalSearchComponent.prototype, "totalItensLabel", void 0);
13377
- __decorate([
13378
- core.Input()
13379
- ], GlobalSearchComponent.prototype, "showMoreLabel", void 0);
13380
- __decorate([
13381
- core.Input()
13382
- ], GlobalSearchComponent.prototype, "placeholder", void 0);
13383
- __decorate([
13384
- core.Input()
13385
- ], GlobalSearchComponent.prototype, "isLoading", void 0);
13386
- __decorate([
13387
- core.Input()
13388
- ], GlobalSearchComponent.prototype, "totalElements", void 0);
13389
- __decorate([
13390
- core.Input()
13391
- ], GlobalSearchComponent.prototype, "emptyTitle", void 0);
13392
- __decorate([
13393
- core.Input()
13394
- ], GlobalSearchComponent.prototype, "emptyDescription", void 0);
13395
- __decorate([
13396
- core.Input()
13397
- ], GlobalSearchComponent.prototype, "emptyIcon", void 0);
13398
- __decorate([
13399
- core.Input()
13400
- ], GlobalSearchComponent.prototype, "showFooter", void 0);
13401
- __decorate([
13402
- core.ContentChildren(GlobalSearchDropdownItemComponent)
13403
- ], GlobalSearchComponent.prototype, "dropdownItens", void 0);
13404
- __decorate([
13405
- core.Output()
13406
- ], GlobalSearchComponent.prototype, "onSearch", void 0);
13407
- __decorate([
13408
- core.Output()
13409
- ], GlobalSearchComponent.prototype, "onFocus", void 0);
13410
- __decorate([
13411
- core.Output()
13412
- ], GlobalSearchComponent.prototype, "onShowMore", void 0);
13413
- GlobalSearchComponent = __decorate([
13414
- core.Component({
13415
- selector: "s-global-search",
13416
- 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",
13417
- animations: [
13418
- animations.trigger("expandableContent", [
13419
- animations.state("*", animations.style({
13420
- height: "0",
13421
- })),
13422
- animations.state("false", animations.style({
13423
- height: "0",
13424
- })),
13425
- animations.state("true", animations.style({
13426
- height: "*",
13427
- })),
13428
- animations.transition("* => true", animations.animate("200ms ease-out")),
13429
- animations.transition("false <=> true", animations.animate("200ms ease-out")),
13430
- ]),
13431
- ],
13432
- 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%}}"]
13433
- })
13434
- ], GlobalSearchComponent);
13435
- return GlobalSearchComponent;
13436
- }());
13437
-
13438
- var ThumbnailModule = /** @class */ (function () {
13439
- function ThumbnailModule() {
13440
- }
13441
- ThumbnailModule = __decorate([
13442
- core.NgModule({
13443
- imports: [common.CommonModule],
13444
- declarations: [ThumbnailComponent],
13445
- exports: [ThumbnailComponent],
13446
- providers: [ThumbnailService],
13447
- })
13448
- ], ThumbnailModule);
13449
- return ThumbnailModule;
13450
- }());
13451
-
13452
- var InfiniteScrollDirective = /** @class */ (function () {
13453
- function InfiniteScrollDirective(el) {
13454
- this.el = el;
13455
- this.onScroll = new core.EventEmitter();
13456
- }
13457
- InfiniteScrollDirective.prototype.scroll = function () {
13458
- if (this.el.nativeElement.scrollTop > (this.el.nativeElement.scrollHeight - this.el.nativeElement.offsetHeight - 2)) {
13459
- this.onScroll.emit();
13460
- }
13461
- };
13462
- InfiniteScrollDirective.ctorParameters = function () { return [
13463
- { type: core.ElementRef }
13464
- ]; };
13465
- __decorate([
13466
- core.Output()
13467
- ], InfiniteScrollDirective.prototype, "onScroll", void 0);
13468
- __decorate([
13469
- core.HostListener("scroll")
13470
- ], InfiniteScrollDirective.prototype, "scroll", null);
13471
- InfiniteScrollDirective = __decorate([
13472
- core.Directive({
13473
- selector: "[sInfiniteScroll]"
13474
- })
13475
- ], InfiniteScrollDirective);
13476
- return InfiniteScrollDirective;
13477
- }());
13478
-
13479
- var InfiniteScrollModule = /** @class */ (function () {
13480
- function InfiniteScrollModule() {
13481
- }
13482
- InfiniteScrollModule = __decorate([
13483
- core.NgModule({
13484
- declarations: [
13485
- InfiniteScrollDirective
13486
- ],
13487
- imports: [
13488
- common.CommonModule
13489
- ],
13490
- exports: [
13491
- InfiniteScrollDirective
13492
- ]
13493
- })
13494
- ], InfiniteScrollModule);
13495
- return InfiniteScrollModule;
13496
- }());
13497
-
13498
- var GlobalSearchModule = /** @class */ (function () {
13499
- function GlobalSearchModule() {
13500
- }
13501
- GlobalSearchModule = __decorate([
13502
- core.NgModule({
13503
- declarations: [
13504
- GlobalSearchComponent,
13505
- GlobalSearchDropdownItemComponent
13506
- ],
13507
- imports: [
13508
- common.CommonModule,
13509
- inputtext.InputTextModule,
13510
- forms.FormsModule,
13511
- forms.ReactiveFormsModule,
13512
- tooltip.TooltipModule,
13513
- ThumbnailModule,
13514
- ButtonModule,
13515
- LoadingStateModule,
13516
- InfiniteScrollModule,
13517
- EmptyStateModule
13518
- ],
13519
- exports: [
13520
- GlobalSearchComponent,
13521
- GlobalSearchDropdownItemComponent,
13522
- tooltip.TooltipModule,
13523
- ThumbnailModule,
13524
- ButtonModule,
13525
- LoadingStateModule,
13526
- EmptyStateModule
13527
- ],
13528
- entryComponents: [
13529
- GlobalSearchComponent,
13530
- GlobalSearchDropdownItemComponent
13531
- ]
13942
+ 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}"]
13532
13943
  })
13533
- ], GlobalSearchModule);
13534
- return GlobalSearchModule;
13944
+ ], GlobalSearchDropdownItemComponent);
13945
+ return GlobalSearchDropdownItemComponent;
13535
13946
  }());
13536
13947
 
13537
- var IAInsightCardComponent = /** @class */ (function () {
13538
- function IAInsightCardComponent(clipboard, messageService, translateService) {
13539
- this.clipboard = clipboard;
13540
- this.messageService = messageService;
13541
- this.translateService = translateService;
13542
- this.open = false;
13948
+ var GlobalSearchComponent = /** @class */ (function () {
13949
+ function GlobalSearchComponent(cdr) {
13950
+ this.cdr = cdr;
13951
+ this.id = "s-global-search-" + GlobalSearchDropdownItemComponent.nextId++;
13952
+ this.delay = 500;
13543
13953
  this.isLoading = false;
13544
- this.likeSelected = false;
13545
- this.dislikeSelected = false;
13954
+ this.showFooter = true;
13955
+ this.onSearch = new core.EventEmitter();
13956
+ this.onFocus = new core.EventEmitter();
13957
+ this.onShowMore = new core.EventEmitter();
13958
+ this.wasSearched = false;
13959
+ this.isModalLoading = false;
13960
+ this.expanded = true;
13546
13961
  }
13547
- IAInsightCardComponent.prototype.toggle = function () {
13548
- this.open = !this.open;
13549
- this._requestInsight();
13962
+ GlobalSearchComponent.prototype.onChange = function () {
13963
+ var _this = this;
13964
+ var search = this.search;
13965
+ setTimeout(function () {
13966
+ if (_this.search === search) {
13967
+ _this.canShowGlobalSearchActive();
13968
+ _this.onSearch.emit(_this.search);
13969
+ }
13970
+ }, this.delay);
13550
13971
  };
13551
- IAInsightCardComponent.prototype.onLikeSelected = function () {
13552
- var _a, _b;
13553
- if (this.likeSelected) {
13554
- this.likeSelected = false;
13555
- }
13556
- else {
13557
- this.likeSelected = true;
13558
- this.dislikeSelected = false;
13559
- (_b = (_a = this.insight).onLikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13560
- }
13972
+ GlobalSearchComponent.prototype.focusIn = function () {
13973
+ this.onFocus.emit(true);
13561
13974
  };
13562
- IAInsightCardComponent.prototype.onDislikeSelected = function () {
13563
- var _a, _b;
13564
- if (this.dislikeSelected) {
13565
- this.dislikeSelected = false;
13566
- }
13567
- else {
13568
- this.dislikeSelected = true;
13569
- this.likeSelected = false;
13570
- (_b = (_a = this.insight).onDislikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13571
- }
13975
+ GlobalSearchComponent.prototype.focusOut = function () {
13976
+ this.onFocus.emit(false);
13572
13977
  };
13573
- IAInsightCardComponent.prototype.copyContent = function () {
13574
- var _a, _b;
13575
- (_b = (_a = this.insight).onCopy) === null || _b === void 0 ? void 0 : _b.call(_a, this.content);
13576
- if (this.clipboard.copy(this.content)) {
13577
- this.messageService.add({
13578
- severity: "info",
13579
- summary: this.translateService.instant("platform.angular_components.copied_to_clipboard"),
13580
- });
13581
- }
13978
+ GlobalSearchComponent.prototype.showMore = function () {
13979
+ this.onShowMore.emit();
13582
13980
  };
13583
- IAInsightCardComponent.prototype.reloadContent = function () {
13584
- this._requestInsight();
13981
+ GlobalSearchComponent.prototype.removeActiveClassByGlobalSearch = function () {
13982
+ ExportUtils.removeClass(this.globalSearch, "global-search__input-active");
13585
13983
  };
13586
- IAInsightCardComponent.prototype._requestInsight = function () {
13587
- var _this = this;
13588
- this.isLoading = true;
13589
- this.insight.request$
13590
- .pipe(operators.first(), operators.finalize(function () { return (_this.isLoading = false); }))
13591
- .subscribe(function (content) {
13592
- _this.content = marked.marked(content);
13593
- });
13984
+ GlobalSearchComponent.prototype.close = function () {
13985
+ this.search = null;
13986
+ this.wasSearched = false;
13987
+ this.dropdownItens = null;
13988
+ this.isModalLoading = false;
13989
+ this.removeActiveClassByGlobalSearch();
13594
13990
  };
13595
- IAInsightCardComponent.ctorParameters = function () { return [
13596
- { type: clipboard.Clipboard },
13597
- { type: api.MessageService },
13598
- { type: core$1.TranslateService }
13991
+ GlobalSearchComponent.prototype.canShowGlobalSearchActive = function () {
13992
+ this.wasSearched = !!this.search;
13993
+ if (this.search) {
13994
+ ExportUtils.addClass(this.globalSearch, "global-search__input-active");
13995
+ }
13996
+ else {
13997
+ this.removeActiveClassByGlobalSearch();
13998
+ this.close();
13999
+ }
14000
+ this.cdr.detectChanges();
14001
+ };
14002
+ GlobalSearchComponent.nextId = 0;
14003
+ GlobalSearchComponent.ctorParameters = function () { return [
14004
+ { type: core.ChangeDetectorRef }
13599
14005
  ]; };
14006
+ __decorate([
14007
+ core.ViewChild("globalSearch", { static: false })
14008
+ ], GlobalSearchComponent.prototype, "globalSearch", void 0);
13600
14009
  __decorate([
13601
14010
  core.Input()
13602
- ], IAInsightCardComponent.prototype, "insight", void 0);
13603
- IAInsightCardComponent = __decorate([
13604
- core.Component({
13605
- selector: "s-ia-insight-card",
13606
- 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",
13607
- 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}"]
13608
- })
13609
- ], IAInsightCardComponent);
13610
- return IAInsightCardComponent;
13611
- }());
13612
-
13613
- var IAInsightSidebarComponent = /** @class */ (function () {
13614
- function IAInsightSidebarComponent() {
13615
- this.insights = [];
13616
- this.opened = false;
13617
- }
13618
- IAInsightSidebarComponent.prototype.toggle = function () {
13619
- this.opened = !this.opened;
13620
- };
13621
- IAInsightSidebarComponent.prototype.open = function () {
13622
- this.opened = true;
13623
- };
13624
- IAInsightSidebarComponent.prototype.close = function () {
13625
- this.opened = false;
13626
- };
14011
+ ], GlobalSearchComponent.prototype, "id", void 0);
13627
14012
  __decorate([
13628
14013
  core.Input()
13629
- ], IAInsightSidebarComponent.prototype, "insights", void 0);
14014
+ ], GlobalSearchComponent.prototype, "delay", void 0);
13630
14015
  __decorate([
13631
14016
  core.Input()
13632
- ], IAInsightSidebarComponent.prototype, "hasPermission", void 0);
14017
+ ], GlobalSearchComponent.prototype, "totalItensLabel", void 0);
13633
14018
  __decorate([
13634
14019
  core.Input()
13635
- ], IAInsightSidebarComponent.prototype, "introText", void 0);
14020
+ ], GlobalSearchComponent.prototype, "showMoreLabel", void 0);
13636
14021
  __decorate([
13637
14022
  core.Input()
13638
- ], IAInsightSidebarComponent.prototype, "introTemplate", void 0);
14023
+ ], GlobalSearchComponent.prototype, "placeholder", void 0);
13639
14024
  __decorate([
13640
14025
  core.Input()
13641
- ], IAInsightSidebarComponent.prototype, "emptyText", void 0);
14026
+ ], GlobalSearchComponent.prototype, "isLoading", void 0);
13642
14027
  __decorate([
13643
14028
  core.Input()
13644
- ], IAInsightSidebarComponent.prototype, "emptyTemplate", void 0);
14029
+ ], GlobalSearchComponent.prototype, "totalElements", void 0);
13645
14030
  __decorate([
13646
14031
  core.Input()
13647
- ], IAInsightSidebarComponent.prototype, "noPermissionText", void 0);
14032
+ ], GlobalSearchComponent.prototype, "emptyTitle", void 0);
13648
14033
  __decorate([
13649
14034
  core.Input()
13650
- ], IAInsightSidebarComponent.prototype, "noPermissionTemplate", void 0);
13651
- IAInsightSidebarComponent = __decorate([
13652
- core.Component({
13653
- selector: "s-ia-insight-sidebar",
13654
- 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",
13655
- 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%}}"]
13656
- })
13657
- ], IAInsightSidebarComponent);
13658
- return IAInsightSidebarComponent;
13659
- }());
13660
-
13661
- var IAInsightCardLoaderComponent = /** @class */ (function () {
13662
- function IAInsightCardLoaderComponent() {
13663
- }
13664
- IAInsightCardLoaderComponent = __decorate([
14035
+ ], GlobalSearchComponent.prototype, "emptyDescription", void 0);
14036
+ __decorate([
14037
+ core.Input()
14038
+ ], GlobalSearchComponent.prototype, "emptyIcon", void 0);
14039
+ __decorate([
14040
+ core.Input()
14041
+ ], GlobalSearchComponent.prototype, "showFooter", void 0);
14042
+ __decorate([
14043
+ core.ContentChildren(GlobalSearchDropdownItemComponent)
14044
+ ], GlobalSearchComponent.prototype, "dropdownItens", void 0);
14045
+ __decorate([
14046
+ core.Output()
14047
+ ], GlobalSearchComponent.prototype, "onSearch", void 0);
14048
+ __decorate([
14049
+ core.Output()
14050
+ ], GlobalSearchComponent.prototype, "onFocus", void 0);
14051
+ __decorate([
14052
+ core.Output()
14053
+ ], GlobalSearchComponent.prototype, "onShowMore", void 0);
14054
+ GlobalSearchComponent = __decorate([
13665
14055
  core.Component({
13666
- selector: "s-ia-insight-card-loader",
13667
- 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",
13668
- 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)}}"]
14056
+ selector: "s-global-search",
14057
+ 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",
14058
+ animations: [
14059
+ animations.trigger("expandableContent", [
14060
+ animations.state("*", animations.style({
14061
+ height: "0",
14062
+ })),
14063
+ animations.state("false", animations.style({
14064
+ height: "0",
14065
+ })),
14066
+ animations.state("true", animations.style({
14067
+ height: "*",
14068
+ })),
14069
+ animations.transition("* => true", animations.animate("200ms ease-out")),
14070
+ animations.transition("false <=> true", animations.animate("200ms ease-out")),
14071
+ ]),
14072
+ ],
14073
+ 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%}}"]
13669
14074
  })
13670
- ], IAInsightCardLoaderComponent);
13671
- return IAInsightCardLoaderComponent;
14075
+ ], GlobalSearchComponent);
14076
+ return GlobalSearchComponent;
13672
14077
  }());
13673
14078
 
13674
-
13675
- (function (IAInsightTemplateTypes) {
13676
- IAInsightTemplateTypes["Empty"] = "empty";
13677
- IAInsightTemplateTypes["Intro"] = "intro";
13678
- IAInsightTemplateTypes["NoPermission"] = "noPermission";
13679
- })(exports.IAInsightTemplateTypes || (exports.IAInsightTemplateTypes = {}));
13680
-
13681
- var IAInsightComponent = /** @class */ (function () {
13682
- function IAInsightComponent() {
13683
- this.insights = [];
13684
- this.hasPermission = true;
14079
+ var InfiniteScrollDirective = /** @class */ (function () {
14080
+ function InfiniteScrollDirective(el) {
14081
+ this.el = el;
14082
+ this.onScroll = new core.EventEmitter();
13685
14083
  }
13686
- IAInsightComponent.prototype.ngAfterContentInit = function () {
13687
- this._getTemplates();
13688
- };
13689
- IAInsightComponent.prototype.open = function () {
13690
- this.sidebar.open();
13691
- };
13692
- IAInsightComponent.prototype.close = function () {
13693
- this.sidebar.close();
13694
- };
13695
- IAInsightComponent.prototype.getIntroTemplate = function () {
13696
- return this._getCustomTemplate(exports.IAInsightTemplateTypes.Intro);
13697
- };
13698
- IAInsightComponent.prototype.getNoPermissionTemplate = function () {
13699
- return this._getCustomTemplate(exports.IAInsightTemplateTypes.NoPermission);
13700
- };
13701
- IAInsightComponent.prototype.getEmptyTemplate = function () {
13702
- return this._getCustomTemplate(exports.IAInsightTemplateTypes.Empty);
13703
- };
13704
- IAInsightComponent.prototype._getCustomTemplate = function (type) {
13705
- var _a;
13706
- return (_a = this.templates.find(function (template) { return template.type === type; })) === null || _a === void 0 ? void 0 : _a.template;
13707
- };
13708
- IAInsightComponent.prototype._getTemplates = function () {
13709
- this.introTemplate = this.getIntroTemplate();
13710
- this.emptyTemplate = this.getEmptyTemplate();
13711
- this.noPermissionTemplate = this.getNoPermissionTemplate();
14084
+ InfiniteScrollDirective.prototype.scroll = function () {
14085
+ if (this.el.nativeElement.scrollTop > (this.el.nativeElement.scrollHeight - this.el.nativeElement.offsetHeight - 2)) {
14086
+ this.onScroll.emit();
14087
+ }
13712
14088
  };
14089
+ InfiniteScrollDirective.ctorParameters = function () { return [
14090
+ { type: core.ElementRef }
14091
+ ]; };
13713
14092
  __decorate([
13714
- core.Input()
13715
- ], IAInsightComponent.prototype, "insights", void 0);
13716
- __decorate([
13717
- core.Input()
13718
- ], IAInsightComponent.prototype, "hasPermission", void 0);
13719
- __decorate([
13720
- core.Input()
13721
- ], IAInsightComponent.prototype, "introText", void 0);
13722
- __decorate([
13723
- core.Input()
13724
- ], IAInsightComponent.prototype, "emptyText", void 0);
13725
- __decorate([
13726
- core.Input()
13727
- ], IAInsightComponent.prototype, "noPermissionText", void 0);
13728
- __decorate([
13729
- core.ViewChild(IAInsightSidebarComponent)
13730
- ], IAInsightComponent.prototype, "sidebar", void 0);
14093
+ core.Output()
14094
+ ], InfiniteScrollDirective.prototype, "onScroll", void 0);
13731
14095
  __decorate([
13732
- core.ContentChildren(TemplateDirective)
13733
- ], IAInsightComponent.prototype, "templates", void 0);
13734
- IAInsightComponent = __decorate([
13735
- core.Component({
13736
- selector: "s-ia-insight",
13737
- 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>",
13738
- styles: [""]
14096
+ core.HostListener("scroll")
14097
+ ], InfiniteScrollDirective.prototype, "scroll", null);
14098
+ InfiniteScrollDirective = __decorate([
14099
+ core.Directive({
14100
+ selector: "[sInfiniteScroll]"
13739
14101
  })
13740
- ], IAInsightComponent);
13741
- return IAInsightComponent;
14102
+ ], InfiniteScrollDirective);
14103
+ return InfiniteScrollDirective;
13742
14104
  }());
13743
14105
 
13744
- var IAInsightModule = /** @class */ (function () {
13745
- function IAInsightModule() {
14106
+ var InfiniteScrollModule = /** @class */ (function () {
14107
+ function InfiniteScrollModule() {
13746
14108
  }
13747
- IAInsightModule = __decorate([
14109
+ InfiniteScrollModule = __decorate([
13748
14110
  core.NgModule({
13749
- imports: [
13750
- common.CommonModule,
13751
- core$1.TranslateModule,
13752
- BadgeModule,
13753
- ButtonModule,
13754
- TooltipModule,
13755
- TemplateModule,
13756
- SVGFactoryModule,
13757
- ],
13758
14111
  declarations: [
13759
- IAInsightComponent,
13760
- IAInsightCardComponent,
13761
- IAInsightSidebarComponent,
13762
- IAInsightCardLoaderComponent,
14112
+ InfiniteScrollDirective
13763
14113
  ],
13764
- exports: [
13765
- IAInsightComponent,
13766
- TemplateModule,
14114
+ imports: [
14115
+ common.CommonModule
13767
14116
  ],
14117
+ exports: [
14118
+ InfiniteScrollDirective
14119
+ ]
13768
14120
  })
13769
- ], IAInsightModule);
13770
- return IAInsightModule;
13771
- }());
13772
-
13773
- var HeaderComponent = /** @class */ (function () {
13774
- function HeaderComponent() {
13775
- }
13776
- HeaderComponent = __decorate([
13777
- core.Component({
13778
- selector: "s-header",
13779
- template: "<ng-content></ng-content>"
13780
- })
13781
- ], HeaderComponent);
13782
- return HeaderComponent;
13783
- }());
13784
-
13785
- var FooterComponent = /** @class */ (function () {
13786
- function FooterComponent() {
13787
- }
13788
- FooterComponent = __decorate([
13789
- core.Component({
13790
- selector: "s-footer",
13791
- template: "<ng-content></ng-content>"
13792
- })
13793
- ], FooterComponent);
13794
- return FooterComponent;
14121
+ ], InfiniteScrollModule);
14122
+ return InfiniteScrollModule;
13795
14123
  }());
13796
14124
 
13797
- var StructureModule = /** @class */ (function () {
13798
- function StructureModule() {
14125
+ var GlobalSearchModule = /** @class */ (function () {
14126
+ function GlobalSearchModule() {
13799
14127
  }
13800
- StructureModule = __decorate([
14128
+ GlobalSearchModule = __decorate([
13801
14129
  core.NgModule({
13802
- imports: [common.CommonModule],
13803
- declarations: [HeaderComponent, FooterComponent],
13804
- exports: [HeaderComponent, FooterComponent],
14130
+ declarations: [
14131
+ GlobalSearchComponent,
14132
+ GlobalSearchDropdownItemComponent
14133
+ ],
14134
+ imports: [
14135
+ common.CommonModule,
14136
+ inputtext.InputTextModule,
14137
+ forms.FormsModule,
14138
+ forms.ReactiveFormsModule,
14139
+ tooltip.TooltipModule,
14140
+ ThumbnailModule,
14141
+ ButtonModule,
14142
+ LoadingStateModule,
14143
+ InfiniteScrollModule,
14144
+ EmptyStateModule
14145
+ ],
14146
+ exports: [
14147
+ GlobalSearchComponent,
14148
+ GlobalSearchDropdownItemComponent,
14149
+ tooltip.TooltipModule,
14150
+ ThumbnailModule,
14151
+ ButtonModule,
14152
+ LoadingStateModule,
14153
+ EmptyStateModule
14154
+ ],
14155
+ entryComponents: [
14156
+ GlobalSearchComponent,
14157
+ GlobalSearchDropdownItemComponent
14158
+ ]
13805
14159
  })
13806
- ], StructureModule);
13807
- return StructureModule;
14160
+ ], GlobalSearchModule);
14161
+ return GlobalSearchModule;
13808
14162
  }());
13809
14163
 
13810
- var ImageCropperComponent = /** @class */ (function () {
13811
- function ImageCropperComponent() {
13812
- this.id = "s-image-cropper-" + ImageCropperComponent_1.nextId++;
13813
- this.visible = false;
13814
- this.header = "Recortar imagem";
13815
- this.cropLabel = "Recortar";
13816
- this.selectAnotherLabel = "Trocar";
13817
- this.removeLabel = "Remover";
13818
- this.cancelLabel = "Cancelar";
13819
- this.emptyStateTitle = "Selecione uma foto, em seguida você poderá ajustá-la";
13820
- this.emptyStateActionLabel = "Escolher imagem";
13821
- this.emptyStateIconClass = "fa fa-picture-o";
13822
- this.aspectRatio = NaN;
13823
- this.rounded = false;
13824
- this.allowSelectAnother = true;
13825
- this.allowRemove = true;
13826
- this.allowCancel = true;
13827
- this.visibleChange = new core.EventEmitter();
13828
- this.changeImage = new core.EventEmitter();
13829
- this.croppedImage = new core.EventEmitter();
13830
- this.croppedCanvas = new core.EventEmitter();
13831
- this.removedImage = new core.EventEmitter();
13832
- this.cancel = new core.EventEmitter();
14164
+ var IAInsightCardComponent = /** @class */ (function () {
14165
+ function IAInsightCardComponent(clipboard, messageService, translateService) {
14166
+ this.clipboard = clipboard;
14167
+ this.messageService = messageService;
14168
+ this.translateService = translateService;
14169
+ this.open = false;
14170
+ this.isLoading = false;
14171
+ this.likeSelected = false;
14172
+ this.dislikeSelected = false;
13833
14173
  }
13834
- ImageCropperComponent_1 = ImageCropperComponent;
13835
- ImageCropperComponent.prototype.ngOnInit = function () {
13836
- if (this.imageSource)
13837
- this.initCropper();
14174
+ IAInsightCardComponent.prototype.toggle = function () {
14175
+ this.open = !this.open;
14176
+ this._requestInsight();
13838
14177
  };
13839
- ImageCropperComponent.prototype.ngOnChanges = function (changes) {
13840
- if (changes.imageSource && changes.imageSource.currentValue) {
13841
- this.initCropper();
14178
+ IAInsightCardComponent.prototype.onLikeSelected = function () {
14179
+ var _a, _b;
14180
+ if (this.likeSelected) {
14181
+ this.likeSelected = false;
13842
14182
  }
13843
- };
13844
- ImageCropperComponent.prototype.initCropper = function () {
13845
- if (this.cropper) {
13846
- this.cropper.destroy();
14183
+ else {
14184
+ this.likeSelected = true;
14185
+ this.dislikeSelected = false;
14186
+ (_b = (_a = this.insight).onLikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13847
14187
  }
13848
- this.image.nativeElement.src = this.imageSource;
13849
- this.cropper = new Cropper(this.image.nativeElement, {
13850
- aspectRatio: this.rounded ? 1 : this.aspectRatio,
13851
- guides: false,
13852
- dragMode: "move",
13853
- minCropBoxHeight: 2,
13854
- minCropBoxWidth: 2,
13855
- toggleDragModeOnDblclick: false,
13856
- });
13857
- };
13858
- ImageCropperComponent.prototype.getRoundedCanvas = function (sourceCanvas) {
13859
- var canvas = document.createElement("canvas");
13860
- var context = canvas.getContext("2d");
13861
- var width = sourceCanvas.width;
13862
- var height = sourceCanvas.height;
13863
- canvas.width = width;
13864
- canvas.height = height;
13865
- context.imageSmoothingEnabled = true;
13866
- context.drawImage(sourceCanvas, 0, 0, width, height);
13867
- context.globalCompositeOperation = "destination-in";
13868
- context.beginPath();
13869
- context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true);
13870
- context.fill();
13871
- return canvas;
13872
14188
  };
13873
- ImageCropperComponent.prototype.onCropImage = function () {
13874
- if (!this.imageSource) {
13875
- this.croppedImage.emit();
13876
- this.croppedCanvas.emit();
14189
+ IAInsightCardComponent.prototype.onDislikeSelected = function () {
14190
+ var _a, _b;
14191
+ if (this.dislikeSelected) {
14192
+ this.dislikeSelected = false;
13877
14193
  }
13878
14194
  else {
13879
- var _croppedCanvas = this.rounded ? this.getRoundedCanvas(this.cropper.getCroppedCanvas()) : this.cropper.getCroppedCanvas();
13880
- this.croppedCanvas.emit(_croppedCanvas);
13881
- this.croppedImage.emit(_croppedCanvas.toDataURL());
14195
+ this.dislikeSelected = true;
14196
+ this.likeSelected = false;
14197
+ (_b = (_a = this.insight).onDislikeSelected) === null || _b === void 0 ? void 0 : _b.call(_a);
13882
14198
  }
13883
- this.visibleChange.emit(false);
13884
- };
13885
- ImageCropperComponent.prototype.onChangeImage = function () {
13886
- this.changeImage.emit();
13887
14199
  };
13888
- ImageCropperComponent.prototype.onRemoveImage = function () {
13889
- this.imageSource = undefined;
13890
- this.removedImage.emit();
14200
+ IAInsightCardComponent.prototype.copyContent = function () {
14201
+ var _a, _b;
14202
+ (_b = (_a = this.insight).onCopy) === null || _b === void 0 ? void 0 : _b.call(_a, this.content);
14203
+ if (this.clipboard.copy(this.content)) {
14204
+ this.messageService.add({
14205
+ severity: "info",
14206
+ summary: this.translateService.instant("platform.angular_components.copied_to_clipboard"),
14207
+ });
14208
+ }
13891
14209
  };
13892
- ImageCropperComponent.prototype.onCancel = function () {
13893
- this.visibleChange.emit(false);
13894
- this.cancel.emit();
14210
+ IAInsightCardComponent.prototype.reloadContent = function () {
14211
+ this._requestInsight();
13895
14212
  };
13896
- ImageCropperComponent.prototype.onModalVisibleChange = function (visible) {
13897
- if (!visible)
13898
- this.onCancel();
13899
- this.visibleChange.emit(visible);
14213
+ IAInsightCardComponent.prototype._requestInsight = function () {
14214
+ var _this = this;
14215
+ this.isLoading = true;
14216
+ this.insight.request$
14217
+ .pipe(operators.first(), operators.finalize(function () { return (_this.isLoading = false); }))
14218
+ .subscribe(function (content) {
14219
+ _this.content = marked.marked(content);
14220
+ });
13900
14221
  };
13901
- var ImageCropperComponent_1;
13902
- ImageCropperComponent.nextId = 0;
13903
- __decorate([
13904
- core.Input()
13905
- ], ImageCropperComponent.prototype, "id", void 0);
13906
- __decorate([
13907
- core.Input()
13908
- ], ImageCropperComponent.prototype, "visible", void 0);
14222
+ IAInsightCardComponent.ctorParameters = function () { return [
14223
+ { type: clipboard.Clipboard },
14224
+ { type: api.MessageService },
14225
+ { type: core$1.TranslateService }
14226
+ ]; };
13909
14227
  __decorate([
13910
14228
  core.Input()
13911
- ], ImageCropperComponent.prototype, "header", void 0);
14229
+ ], IAInsightCardComponent.prototype, "insight", void 0);
14230
+ IAInsightCardComponent = __decorate([
14231
+ core.Component({
14232
+ selector: "s-ia-insight-card",
14233
+ 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",
14234
+ 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}"]
14235
+ })
14236
+ ], IAInsightCardComponent);
14237
+ return IAInsightCardComponent;
14238
+ }());
14239
+
14240
+ var IAInsightSidebarComponent = /** @class */ (function () {
14241
+ function IAInsightSidebarComponent() {
14242
+ this.insights = [];
14243
+ this.opened = false;
14244
+ }
14245
+ IAInsightSidebarComponent.prototype.toggle = function () {
14246
+ this.opened = !this.opened;
14247
+ };
14248
+ IAInsightSidebarComponent.prototype.open = function () {
14249
+ this.opened = true;
14250
+ };
14251
+ IAInsightSidebarComponent.prototype.close = function () {
14252
+ this.opened = false;
14253
+ };
13912
14254
  __decorate([
13913
14255
  core.Input()
13914
- ], ImageCropperComponent.prototype, "cropLabel", void 0);
14256
+ ], IAInsightSidebarComponent.prototype, "insights", void 0);
13915
14257
  __decorate([
13916
14258
  core.Input()
13917
- ], ImageCropperComponent.prototype, "selectAnotherLabel", void 0);
14259
+ ], IAInsightSidebarComponent.prototype, "hasPermission", void 0);
13918
14260
  __decorate([
13919
14261
  core.Input()
13920
- ], ImageCropperComponent.prototype, "removeLabel", void 0);
14262
+ ], IAInsightSidebarComponent.prototype, "introText", void 0);
13921
14263
  __decorate([
13922
14264
  core.Input()
13923
- ], ImageCropperComponent.prototype, "cancelLabel", void 0);
14265
+ ], IAInsightSidebarComponent.prototype, "introTemplate", void 0);
13924
14266
  __decorate([
13925
14267
  core.Input()
13926
- ], ImageCropperComponent.prototype, "emptyStateTitle", void 0);
14268
+ ], IAInsightSidebarComponent.prototype, "emptyText", void 0);
13927
14269
  __decorate([
13928
14270
  core.Input()
13929
- ], ImageCropperComponent.prototype, "emptyStateActionLabel", void 0);
14271
+ ], IAInsightSidebarComponent.prototype, "emptyTemplate", void 0);
13930
14272
  __decorate([
13931
14273
  core.Input()
13932
- ], ImageCropperComponent.prototype, "emptyStateIconClass", void 0);
14274
+ ], IAInsightSidebarComponent.prototype, "noPermissionText", void 0);
13933
14275
  __decorate([
13934
14276
  core.Input()
13935
- ], ImageCropperComponent.prototype, "aspectRatio", void 0);
14277
+ ], IAInsightSidebarComponent.prototype, "noPermissionTemplate", void 0);
14278
+ IAInsightSidebarComponent = __decorate([
14279
+ core.Component({
14280
+ selector: "s-ia-insight-sidebar",
14281
+ 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",
14282
+ 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%}}"]
14283
+ })
14284
+ ], IAInsightSidebarComponent);
14285
+ return IAInsightSidebarComponent;
14286
+ }());
14287
+
14288
+ var IAInsightCardLoaderComponent = /** @class */ (function () {
14289
+ function IAInsightCardLoaderComponent() {
14290
+ }
14291
+ IAInsightCardLoaderComponent = __decorate([
14292
+ core.Component({
14293
+ selector: "s-ia-insight-card-loader",
14294
+ 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",
14295
+ 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)}}"]
14296
+ })
14297
+ ], IAInsightCardLoaderComponent);
14298
+ return IAInsightCardLoaderComponent;
14299
+ }());
14300
+
14301
+
14302
+ (function (IAInsightTemplateTypes) {
14303
+ IAInsightTemplateTypes["Empty"] = "empty";
14304
+ IAInsightTemplateTypes["Intro"] = "intro";
14305
+ IAInsightTemplateTypes["NoPermission"] = "noPermission";
14306
+ })(exports.IAInsightTemplateTypes || (exports.IAInsightTemplateTypes = {}));
14307
+
14308
+ var IAInsightComponent = /** @class */ (function () {
14309
+ function IAInsightComponent() {
14310
+ this.insights = [];
14311
+ this.hasPermission = true;
14312
+ }
14313
+ IAInsightComponent.prototype.ngAfterContentInit = function () {
14314
+ this._getTemplates();
14315
+ };
14316
+ IAInsightComponent.prototype.open = function () {
14317
+ this.sidebar.open();
14318
+ };
14319
+ IAInsightComponent.prototype.close = function () {
14320
+ this.sidebar.close();
14321
+ };
14322
+ IAInsightComponent.prototype.getIntroTemplate = function () {
14323
+ return this._getCustomTemplate(exports.IAInsightTemplateTypes.Intro);
14324
+ };
14325
+ IAInsightComponent.prototype.getNoPermissionTemplate = function () {
14326
+ return this._getCustomTemplate(exports.IAInsightTemplateTypes.NoPermission);
14327
+ };
14328
+ IAInsightComponent.prototype.getEmptyTemplate = function () {
14329
+ return this._getCustomTemplate(exports.IAInsightTemplateTypes.Empty);
14330
+ };
14331
+ IAInsightComponent.prototype._getCustomTemplate = function (type) {
14332
+ var _a;
14333
+ return (_a = this.templates.find(function (template) { return template.type === type; })) === null || _a === void 0 ? void 0 : _a.template;
14334
+ };
14335
+ IAInsightComponent.prototype._getTemplates = function () {
14336
+ this.introTemplate = this.getIntroTemplate();
14337
+ this.emptyTemplate = this.getEmptyTemplate();
14338
+ this.noPermissionTemplate = this.getNoPermissionTemplate();
14339
+ };
13936
14340
  __decorate([
13937
14341
  core.Input()
13938
- ], ImageCropperComponent.prototype, "rounded", void 0);
14342
+ ], IAInsightComponent.prototype, "insights", void 0);
13939
14343
  __decorate([
13940
14344
  core.Input()
13941
- ], ImageCropperComponent.prototype, "allowSelectAnother", void 0);
14345
+ ], IAInsightComponent.prototype, "hasPermission", void 0);
13942
14346
  __decorate([
13943
14347
  core.Input()
13944
- ], ImageCropperComponent.prototype, "allowRemove", void 0);
14348
+ ], IAInsightComponent.prototype, "introText", void 0);
13945
14349
  __decorate([
13946
14350
  core.Input()
13947
- ], ImageCropperComponent.prototype, "allowCancel", void 0);
14351
+ ], IAInsightComponent.prototype, "emptyText", void 0);
13948
14352
  __decorate([
13949
14353
  core.Input()
13950
- ], ImageCropperComponent.prototype, "imageSource", void 0);
13951
- __decorate([
13952
- core.Output()
13953
- ], ImageCropperComponent.prototype, "visibleChange", void 0);
13954
- __decorate([
13955
- core.Output()
13956
- ], ImageCropperComponent.prototype, "changeImage", void 0);
13957
- __decorate([
13958
- core.Output()
13959
- ], ImageCropperComponent.prototype, "croppedImage", void 0);
13960
- __decorate([
13961
- core.Output()
13962
- ], ImageCropperComponent.prototype, "croppedCanvas", void 0);
13963
- __decorate([
13964
- core.Output()
13965
- ], ImageCropperComponent.prototype, "removedImage", void 0);
13966
- __decorate([
13967
- core.Output()
13968
- ], ImageCropperComponent.prototype, "cancel", void 0);
13969
- __decorate([
13970
- core.ViewChild("image", { static: true })
13971
- ], ImageCropperComponent.prototype, "image", void 0);
14354
+ ], IAInsightComponent.prototype, "noPermissionText", void 0);
13972
14355
  __decorate([
13973
- core.ContentChild(HeaderComponent, { static: true })
13974
- ], ImageCropperComponent.prototype, "headerSection", void 0);
14356
+ core.ViewChild(IAInsightSidebarComponent)
14357
+ ], IAInsightComponent.prototype, "sidebar", void 0);
13975
14358
  __decorate([
13976
- core.ContentChild(FooterComponent, { static: true })
13977
- ], ImageCropperComponent.prototype, "footerSection", void 0);
13978
- ImageCropperComponent = ImageCropperComponent_1 = __decorate([
14359
+ core.ContentChildren(TemplateDirective)
14360
+ ], IAInsightComponent.prototype, "templates", void 0);
14361
+ IAInsightComponent = __decorate([
13979
14362
  core.Component({
13980
- selector: "s-image-cropper",
13981
- 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>",
13982
- encapsulation: core.ViewEncapsulation.None,
13983
- 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}}"]
14363
+ selector: "s-ia-insight",
14364
+ 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>",
14365
+ styles: [""]
13984
14366
  })
13985
- ], ImageCropperComponent);
13986
- return ImageCropperComponent;
14367
+ ], IAInsightComponent);
14368
+ return IAInsightComponent;
13987
14369
  }());
13988
14370
 
13989
- var ImageCropperModule = /** @class */ (function () {
13990
- function ImageCropperModule() {
14371
+ var IAInsightModule = /** @class */ (function () {
14372
+ function IAInsightModule() {
13991
14373
  }
13992
- ImageCropperModule = __decorate([
14374
+ IAInsightModule = __decorate([
13993
14375
  core.NgModule({
13994
- imports: [common.CommonModule, dialog.DialogModule, ButtonModule, EmptyStateModule, StructureModule],
13995
- declarations: [ImageCropperComponent],
13996
- exports: [ImageCropperComponent, StructureModule],
13997
- entryComponents: [ImageCropperComponent],
13998
- })
13999
- ], ImageCropperModule);
14000
- return ImageCropperModule;
14001
- }());
14002
-
14003
- var ImageCropperService = /** @class */ (function () {
14004
- function ImageCropperService(componentFactoryResolver, appRef, injector) {
14005
- this.componentFactoryResolver = componentFactoryResolver;
14006
- this.appRef = appRef;
14007
- this.injector = injector;
14008
- }
14009
- ImageCropperService.prototype.show = function (config) {
14010
- var _this = this;
14011
- if (this.activeCropper)
14012
- this.destroy(this.activeCropper);
14013
- var activeCropper = {
14014
- componentRef: this.componentFactoryResolver.resolveComponentFactory(ImageCropperComponent).create(this.injector),
14015
- ngUnsubscribe: new rxjs.Subject(),
14016
- };
14017
- this.activeCropper = activeCropper;
14018
- this.appRef.attachView(activeCropper.componentRef.hostView);
14019
- var domElem = activeCropper.componentRef.hostView.rootNodes[0];
14020
- document.body.appendChild(domElem);
14021
- this.configureInstance(activeCropper, config);
14022
- activeCropper.componentRef.instance.visible = true;
14023
- activeCropper.componentRef.instance.visibleChange
14024
- .pipe(operators.takeUntil(this.activeCropper.ngUnsubscribe), operators.delay(1000))
14025
- .subscribe(function (visible) {
14026
- if (!visible)
14027
- _this.destroy(activeCropper);
14028
- });
14029
- };
14030
- ImageCropperService.prototype.configureInstance = function (activeCropper, config) {
14031
- var instance = activeCropper.componentRef.instance;
14032
- if (config) {
14033
- Object.keys(config).forEach(function (key) {
14034
- var value = config[key];
14035
- if (typeof value !== "function")
14036
- instance[key] = value;
14037
- else if (typeof value === "function") {
14038
- instance[key].pipe(operators.takeUntil(activeCropper.ngUnsubscribe)).subscribe(function () {
14039
- var param = [];
14040
- for (var _i = 0; _i < arguments.length; _i++) {
14041
- param[_i] = arguments[_i];
14042
- }
14043
- return config[key].apply(config, __spread(param));
14044
- });
14045
- }
14046
- });
14047
- }
14048
- instance.visibleChange.pipe(operators.takeUntil(activeCropper.ngUnsubscribe)).subscribe(function (visible) { return (instance.visible = visible); });
14049
- };
14050
- ImageCropperService.prototype.destroy = function (activeCropper) {
14051
- activeCropper.ngUnsubscribe.next();
14052
- activeCropper.ngUnsubscribe.complete();
14053
- this.appRef.detachView(activeCropper.componentRef.hostView);
14054
- activeCropper.componentRef.destroy();
14055
- };
14056
- ImageCropperService.ctorParameters = function () { return [
14057
- { type: core.ComponentFactoryResolver },
14058
- { type: core.ApplicationRef },
14059
- { type: core.Injector }
14060
- ]; };
14061
- ImageCropperService = __decorate([
14062
- core.Injectable()
14063
- ], ImageCropperService);
14064
- return ImageCropperService;
14376
+ imports: [
14377
+ common.CommonModule,
14378
+ core$1.TranslateModule,
14379
+ BadgeModule,
14380
+ ButtonModule,
14381
+ TooltipModule,
14382
+ TemplateModule,
14383
+ SVGFactoryModule,
14384
+ ],
14385
+ declarations: [
14386
+ IAInsightComponent,
14387
+ IAInsightCardComponent,
14388
+ IAInsightSidebarComponent,
14389
+ IAInsightCardLoaderComponent,
14390
+ ],
14391
+ exports: [
14392
+ IAInsightComponent,
14393
+ TemplateModule,
14394
+ ],
14395
+ })
14396
+ ], IAInsightModule);
14397
+ return IAInsightModule;
14065
14398
  }());
14066
14399
 
14067
14400
  var KanbanEventService = /** @class */ (function () {
@@ -14883,256 +15216,6 @@
14883
15216
  }());
14884
15217
 
14885
15218
 
14886
- (function (FileValidation) {
14887
- FileValidation["MaxFileSize"] = "maxFileSize";
14888
- FileValidation["MaxFileLimit"] = "maxFileLimit";
14889
- FileValidation["TypeInvalid"] = "typeInvalid";
14890
- FileValidation["UnsupportedExtension"] = "unsupportedExtension";
14891
- })(exports.FileValidation || (exports.FileValidation = {}));
14892
-
14893
- var ProfilePicturePickerComponent = /** @class */ (function () {
14894
- function ProfilePicturePickerComponent(imageCropperService, confirmationService) {
14895
- this.imageCropperService = imageCropperService;
14896
- this.confirmationService = confirmationService;
14897
- this.aspectRatio = 1;
14898
- this.removeButtonLabel = "Remover";
14899
- this.changeButtonLabel = "Alterar foto";
14900
- this.confirmationTexts = {
14901
- removalHeader: "Remover foto de perfil",
14902
- removalMessage: "Deseja remover sua foto de perfil? Não pode ser revertida.",
14903
- removalAcceptLabel: "Remover",
14904
- removalRejectLabel: "Cancelar",
14905
- };
14906
- this.supportedExtensions = [];
14907
- this.changedImage = new core.EventEmitter();
14908
- this.removedImage = new core.EventEmitter();
14909
- this.invalidFile = new core.EventEmitter();
14910
- }
14911
- ProfilePicturePickerComponent.prototype.ngOnInit = function () {
14912
- this._normalizeSuportedExtensions();
14913
- };
14914
- ProfilePicturePickerComponent.prototype.onDragOver = function (event) {
14915
- event.preventDefault();
14916
- event.stopPropagation();
14917
- };
14918
- ProfilePicturePickerComponent.prototype.onDragLeave = function (event) {
14919
- event.preventDefault();
14920
- event.stopPropagation();
14921
- };
14922
- ProfilePicturePickerComponent.prototype.onDrop = function (event) {
14923
- event.preventDefault();
14924
- event.stopPropagation();
14925
- var files = [];
14926
- var dataTransferFiles = event.dataTransfer.files;
14927
- for (var i = 0; i < dataTransferFiles.length; i++) {
14928
- files.push(dataTransferFiles.item(i));
14929
- }
14930
- this._showImageCropper(files);
14931
- };
14932
- // Verificando o redimensionamento para ajustar o design para ficar responsivo.
14933
- ProfilePicturePickerComponent.prototype.onResize = function () {
14934
- if (this.uploadPicture && this.info && this.thumbnail) {
14935
- var uploadPictureWidth = this._getWidthElement(this.uploadPicture);
14936
- var infoWidth = this._getWidthElement(this.info);
14937
- var thumbnailWidth = this._getWidthElement(this.thumbnail);
14938
- if (thumbnailWidth + infoWidth > uploadPictureWidth) {
14939
- this.uploadPicture.nativeElement.classList.add("upload-picture--small");
14940
- }
14941
- else {
14942
- this.uploadPicture.nativeElement.classList.remove("upload-picture--small");
14943
- }
14944
- }
14945
- };
14946
- ProfilePicturePickerComponent.prototype.selectPhoto = function () {
14947
- var fileInputElement = this.fileInput.nativeElement;
14948
- fileInputElement.value = "";
14949
- fileInputElement.click();
14950
- };
14951
- ProfilePicturePickerComponent.prototype.removePhoto = function () {
14952
- var _this = this;
14953
- this.confirmationService.confirm({
14954
- message: this.confirmationTexts.removalMessage,
14955
- acceptLabel: this.confirmationTexts.removalAcceptLabel,
14956
- rejectLabel: this.confirmationTexts.removalRejectLabel,
14957
- header: this.confirmationTexts.removalHeader,
14958
- accept: function () {
14959
- var fileInputElement = _this.fileInput.nativeElement;
14960
- fileInputElement.value = "";
14961
- _this.image = "";
14962
- _this.removedImage.emit();
14963
- },
14964
- });
14965
- };
14966
- ProfilePicturePickerComponent.prototype.photoSelected = function (event) {
14967
- this._showImageCropper(event.srcElement.files);
14968
- };
14969
- ProfilePicturePickerComponent.prototype._showImageCropper = function (files) {
14970
- var _this = this;
14971
- if (!this._validateData(files)) {
14972
- return;
14973
- }
14974
- var file = files[0];
14975
- var fileReader = new FileReader();
14976
- fileReader.readAsDataURL(file);
14977
- fileReader.onloadend = function (fileEvent) {
14978
- _this.imageCropperService.show(__assign({ imageSource: fileEvent.target.result, croppedImage: function (image) {
14979
- _this.image = image;
14980
- _this.changedImage.emit(image);
14981
- }, changeImage: function () { return _this.selectPhoto(); }, allowSelectAnother: false, aspectRatio: _this.aspectRatio }, _this.cropperLabelsConfig));
14982
- };
14983
- };
14984
- ProfilePicturePickerComponent.prototype._normalizeSuportedExtensions = function () {
14985
- this.supportedExtensions = this.supportedExtensions
14986
- .map(function (extension) { return extension.replace(".", "").toLocaleLowerCase(); });
14987
- };
14988
- ProfilePicturePickerComponent.prototype._validateData = function (files) {
14989
- if (!files.length) {
14990
- return false;
14991
- }
14992
- if (files.length > 1) {
14993
- this.invalidFile.emit({ file: null, validation: exports.FileValidation.MaxFileLimit });
14994
- return false;
14995
- }
14996
- var file = files[0];
14997
- if (!file.type.includes("image")) {
14998
- this.invalidFile.emit({ file: file, validation: exports.FileValidation.TypeInvalid });
14999
- return false;
15000
- }
15001
- if (!this._validateFileExtension(file)) {
15002
- this.invalidFile.emit({ file: file, validation: exports.FileValidation.UnsupportedExtension });
15003
- return false;
15004
- }
15005
- if (!this._validateFileSize(file)) {
15006
- this.invalidFile.emit({ file: file, validation: exports.FileValidation.MaxFileSize });
15007
- return false;
15008
- }
15009
- return true;
15010
- };
15011
- ProfilePicturePickerComponent.prototype._validateFileExtension = function (file) {
15012
- var _a;
15013
- if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
15014
- var extension = file.name.split(".").pop().toLowerCase();
15015
- return this.supportedExtensions.includes(extension);
15016
- }
15017
- return true;
15018
- };
15019
- ProfilePicturePickerComponent.prototype._validateFileSize = function (file) {
15020
- if (this.maxFileSize) {
15021
- return file.size > this.maxFileSize;
15022
- }
15023
- return true;
15024
- };
15025
- ProfilePicturePickerComponent.prototype._getWidthElement = function (element) {
15026
- var _a = element.nativeElement.getBoundingClientRect(), left = _a.left, right = _a.right;
15027
- return right - left;
15028
- };
15029
- ProfilePicturePickerComponent.ctorParameters = function () { return [
15030
- { type: ImageCropperService },
15031
- { type: api.ConfirmationService }
15032
- ]; };
15033
- __decorate([
15034
- core.Input()
15035
- ], ProfilePicturePickerComponent.prototype, "simpleTitle", void 0);
15036
- __decorate([
15037
- core.Input()
15038
- ], ProfilePicturePickerComponent.prototype, "actionTitle", void 0);
15039
- __decorate([
15040
- core.Input()
15041
- ], ProfilePicturePickerComponent.prototype, "subtitle", void 0);
15042
- __decorate([
15043
- core.Input()
15044
- ], ProfilePicturePickerComponent.prototype, "aspectRatio", void 0);
15045
- __decorate([
15046
- core.Input()
15047
- ], ProfilePicturePickerComponent.prototype, "cropperLabelsConfig", void 0);
15048
- __decorate([
15049
- core.Input()
15050
- ], ProfilePicturePickerComponent.prototype, "removeButtonLabel", void 0);
15051
- __decorate([
15052
- core.Input()
15053
- ], ProfilePicturePickerComponent.prototype, "changeButtonLabel", void 0);
15054
- __decorate([
15055
- core.Input()
15056
- ], ProfilePicturePickerComponent.prototype, "confirmationTexts", void 0);
15057
- __decorate([
15058
- core.Input()
15059
- ], ProfilePicturePickerComponent.prototype, "maxFileSize", void 0);
15060
- __decorate([
15061
- core.Input()
15062
- ], ProfilePicturePickerComponent.prototype, "accept", void 0);
15063
- __decorate([
15064
- core.Input()
15065
- ], ProfilePicturePickerComponent.prototype, "supportedExtensions", void 0);
15066
- __decorate([
15067
- core.Input()
15068
- ], ProfilePicturePickerComponent.prototype, "image", void 0);
15069
- __decorate([
15070
- core.ViewChild("uploadPicture")
15071
- ], ProfilePicturePickerComponent.prototype, "uploadPicture", void 0);
15072
- __decorate([
15073
- core.ViewChild("info")
15074
- ], ProfilePicturePickerComponent.prototype, "info", void 0);
15075
- __decorate([
15076
- core.ViewChild("thumbnail", { read: core.ElementRef })
15077
- ], ProfilePicturePickerComponent.prototype, "thumbnail", void 0);
15078
- __decorate([
15079
- core.ViewChild("fileInput", { read: core.ElementRef })
15080
- ], ProfilePicturePickerComponent.prototype, "fileInput", void 0);
15081
- __decorate([
15082
- core.Output()
15083
- ], ProfilePicturePickerComponent.prototype, "changedImage", void 0);
15084
- __decorate([
15085
- core.Output()
15086
- ], ProfilePicturePickerComponent.prototype, "removedImage", void 0);
15087
- __decorate([
15088
- core.Output()
15089
- ], ProfilePicturePickerComponent.prototype, "invalidFile", void 0);
15090
- __decorate([
15091
- core.HostListener("dragover", ["$event"])
15092
- ], ProfilePicturePickerComponent.prototype, "onDragOver", null);
15093
- __decorate([
15094
- core.HostListener("dragleave", ["$event"])
15095
- ], ProfilePicturePickerComponent.prototype, "onDragLeave", null);
15096
- __decorate([
15097
- core.HostListener("drop", ["$event"])
15098
- ], ProfilePicturePickerComponent.prototype, "onDrop", null);
15099
- __decorate([
15100
- core.HostListener("window:resize")
15101
- ], ProfilePicturePickerComponent.prototype, "onResize", null);
15102
- ProfilePicturePickerComponent = __decorate([
15103
- core.Component({
15104
- selector: "s-profile-picture-picker",
15105
- 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>",
15106
- 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}"]
15107
- })
15108
- ], ProfilePicturePickerComponent);
15109
- return ProfilePicturePickerComponent;
15110
- }());
15111
-
15112
- var ProfilePicturePickerModule = /** @class */ (function () {
15113
- function ProfilePicturePickerModule() {
15114
- }
15115
- ProfilePicturePickerModule = __decorate([
15116
- core.NgModule({
15117
- imports: [
15118
- common.CommonModule,
15119
- ButtonModule,
15120
- ThumbnailModule,
15121
- ImageCropperModule,
15122
- confirmdialog.ConfirmDialogModule,
15123
- ],
15124
- declarations: [ProfilePicturePickerComponent],
15125
- exports: [ProfilePicturePickerComponent],
15126
- providers: [
15127
- ImageCropperService,
15128
- api.ConfirmationService,
15129
- ],
15130
- })
15131
- ], ProfilePicturePickerModule);
15132
- return ProfilePicturePickerModule;
15133
- }());
15134
-
15135
-
15136
15219
  (function (ProgressBarColors) {
15137
15220
  ProgressBarColors["Blue"] = "blue";
15138
15221
  ProgressBarColors["Green"] = "green";
@@ -17686,6 +17769,11 @@
17686
17769
  }());
17687
17770
 
17688
17771
  var fallback = {
17772
+ "platform.angular_components.drag_your_photo_or": "Arraste sua foto ou",
17773
+ "platform.angular_components.select_a_file": "selecione um arquivo",
17774
+ "platform.angular_components.change_photo": "Alterar foto",
17775
+ "platform.angular_components.remove_image": "Remover imagem",
17776
+ "platform.angular_components.confirmation_remove_image": "Deseja remover a imagem? Não pode ser revertida.",
17689
17777
  "platform.angular_components.strong": "Forte",
17690
17778
  "platform.angular_components.medium": "Média",
17691
17779
  "platform.angular_components.weak": "Fraca",
@@ -18169,66 +18257,68 @@
18169
18257
  exports.ɵbh = NumberFieldModule$1;
18170
18258
  exports.ɵbi = BignumberInputModule;
18171
18259
  exports.ɵbj = BignumberFieldComponent;
18172
- exports.ɵbk = AutocompleteFieldComponent;
18173
- exports.ɵbl = BooleanFieldComponent;
18174
- exports.ɵbm = BooleanSwitchFieldComponent;
18175
- exports.ɵbn = CalendarFieldComponent;
18176
- exports.ɵbo = ChipsFieldComponent;
18177
- exports.ɵbp = CountryPhonePickerFieldComponent;
18178
- exports.ɵbq = DynamicFieldComponent;
18179
- exports.ɵbr = DynamicFormDirective;
18180
- exports.ɵbs = FieldsetComponent;
18181
- exports.ɵbt = FileUploadComponent$1;
18182
- exports.ɵbu = LookupFieldComponent;
18183
- exports.ɵbv = RadioButtonComponent;
18184
- exports.ɵbw = RowComponent;
18185
- exports.ɵbx = SectionComponent;
18186
- exports.ɵby = SelectFieldComponent;
18187
- exports.ɵbz = SliderFieldComponent;
18260
+ exports.ɵbk = ProfilePictureModule;
18261
+ exports.ɵbl = ThumbnailService;
18262
+ exports.ɵbm = StructureModule;
18263
+ exports.ɵbn = HeaderComponent;
18264
+ exports.ɵbo = FooterComponent;
18265
+ exports.ɵbp = ProfilePictureFieldComponent;
18266
+ exports.ɵbq = AutocompleteFieldComponent;
18267
+ exports.ɵbr = BooleanFieldComponent;
18268
+ exports.ɵbs = BooleanSwitchFieldComponent;
18269
+ exports.ɵbt = CalendarFieldComponent;
18270
+ exports.ɵbu = ChipsFieldComponent;
18271
+ exports.ɵbv = CountryPhonePickerFieldComponent;
18272
+ exports.ɵbw = DynamicFieldComponent;
18273
+ exports.ɵbx = DynamicFormDirective;
18274
+ exports.ɵby = FieldsetComponent;
18275
+ exports.ɵbz = FileUploadComponent$1;
18188
18276
  exports.ɵc = TemplateDirective;
18189
- exports.ɵca = TextAreaFieldComponent;
18190
- exports.ɵcb = TextAreaIAFieldComponent;
18191
- exports.ɵcc = IAssistService;
18192
- exports.ɵce = DecimalField;
18193
- exports.ɵcf = SideTableComponent;
18194
- exports.ɵcg = ThumbnailService;
18195
- exports.ɵch = InfiniteScrollModule;
18196
- exports.ɵci = InfiniteScrollDirective;
18197
- exports.ɵcj = IAInsightSidebarComponent;
18198
- exports.ɵck = IAInsightCardComponent;
18199
- exports.ɵcl = IAInsightCardLoaderComponent;
18200
- exports.ɵcm = StructureModule;
18201
- exports.ɵcn = HeaderComponent;
18202
- exports.ɵco = FooterComponent;
18203
- exports.ɵcp = KanbanEventService;
18204
- exports.ɵcq = KanbanItemComponent;
18205
- exports.ɵcr = KanbanColumnComponent;
18206
- exports.ɵcs = KanbanItemDraggingComponent;
18207
- exports.ɵct = NumberLocaleOptions;
18208
- exports.ɵcu = BorderButtonModule;
18209
- exports.ɵcv = BorderButtonComponent;
18210
- exports.ɵcw = ProgressBarDeterminateComponent;
18211
- exports.ɵcx = ProgressBarIndeterminateComponent;
18212
- exports.ɵcy = SelectButtonItemComponent;
18213
- exports.ɵcz = SlidePanelService;
18277
+ exports.ɵca = LookupFieldComponent;
18278
+ exports.ɵcb = RadioButtonComponent;
18279
+ exports.ɵcc = RowComponent;
18280
+ exports.ɵcd = SectionComponent;
18281
+ exports.ɵce = SelectFieldComponent;
18282
+ exports.ɵcf = SliderFieldComponent;
18283
+ exports.ɵcg = TextAreaFieldComponent;
18284
+ exports.ɵch = TextAreaIAFieldComponent;
18285
+ exports.ɵci = IAssistService;
18286
+ exports.ɵck = DecimalField;
18287
+ exports.ɵcl = SideTableComponent;
18288
+ exports.ɵcm = InfiniteScrollModule;
18289
+ exports.ɵcn = InfiniteScrollDirective;
18290
+ exports.ɵco = IAInsightSidebarComponent;
18291
+ exports.ɵcp = IAInsightCardComponent;
18292
+ exports.ɵcq = IAInsightCardLoaderComponent;
18293
+ exports.ɵcr = KanbanEventService;
18294
+ exports.ɵcs = KanbanItemComponent;
18295
+ exports.ɵct = KanbanColumnComponent;
18296
+ exports.ɵcu = KanbanItemDraggingComponent;
18297
+ exports.ɵcv = NumberLocaleOptions;
18298
+ exports.ɵcw = BorderButtonModule;
18299
+ exports.ɵcx = BorderButtonComponent;
18300
+ exports.ɵcy = ProgressBarDeterminateComponent;
18301
+ exports.ɵcz = ProgressBarIndeterminateComponent;
18214
18302
  exports.ɵd = TemplateModule;
18215
- exports.ɵda = TieredMenuEventService;
18216
- exports.ɵdb = TieredMenuService;
18217
- exports.ɵdc = TieredMenuGlobalService;
18218
- exports.ɵdd = TieredMenuComponent;
18219
- exports.ɵde = TieredMenuNestedComponent;
18220
- exports.ɵdf = TieredMenuItemComponent;
18221
- exports.ɵdg = TieredMenuDividerComponent;
18222
- exports.ɵdh = TimelineItemModule;
18223
- exports.ɵdi = TimelineIconItemComponent;
18224
- exports.ɵdj = HorizontalTimelineModule;
18225
- exports.ɵdk = HorizontalTimelineComponent;
18226
- exports.ɵdl = VerticalTimelineModule;
18227
- exports.ɵdm = VerticalTimelineComponent;
18228
- exports.ɵdn = RangeLineComponent;
18229
- exports.ɵdo = CollapseOptionComponent;
18230
- exports.ɵdp = CollapsedItemsComponent;
18231
- exports.ɵdq = VerticalItemsComponent;
18303
+ exports.ɵda = SelectButtonItemComponent;
18304
+ exports.ɵdb = SlidePanelService;
18305
+ exports.ɵdc = TieredMenuEventService;
18306
+ exports.ɵdd = TieredMenuService;
18307
+ exports.ɵde = TieredMenuGlobalService;
18308
+ exports.ɵdf = TieredMenuComponent;
18309
+ exports.ɵdg = TieredMenuNestedComponent;
18310
+ exports.ɵdh = TieredMenuItemComponent;
18311
+ exports.ɵdi = TieredMenuDividerComponent;
18312
+ exports.ɵdj = TimelineItemModule;
18313
+ exports.ɵdk = TimelineIconItemComponent;
18314
+ exports.ɵdl = HorizontalTimelineModule;
18315
+ exports.ɵdm = HorizontalTimelineComponent;
18316
+ exports.ɵdn = VerticalTimelineModule;
18317
+ exports.ɵdo = VerticalTimelineComponent;
18318
+ exports.ɵdp = RangeLineComponent;
18319
+ exports.ɵdq = CollapseOptionComponent;
18320
+ exports.ɵdr = CollapsedItemsComponent;
18321
+ exports.ɵds = VerticalItemsComponent;
18232
18322
  exports.ɵe = CustomTranslationsModule;
18233
18323
  exports.ɵf = CodeEditorComponent;
18234
18324
  exports.ɵg = CoreFacade;