@seniorsistemas/angular-components 17.2.6 → 17.2.8
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.
- package/bundles/seniorsistemas-angular-components.umd.js +54 -12
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/accordion/components/accordion-panel/accordion-panel.component.d.ts +9 -5
- package/components/dynamic-form/components/fields/chips/chips-field.component.d.ts +6 -0
- package/components/dynamic-form/configurations/fields/chips-field.d.ts +6 -0
- package/esm2015/components/accordion/accordion.module.js +3 -2
- package/esm2015/components/accordion/components/accordion-panel/accordion-panel.component.js +16 -6
- package/esm2015/components/dynamic-form/components/fields/chips/chips-field.component.js +27 -3
- package/esm2015/components/dynamic-form/configurations/fields/chips-field.js +5 -1
- package/esm2015/components/switch/switch.component.js +4 -1
- package/esm2015/locale/fallback.js +3 -1
- package/esm5/components/accordion/accordion.module.js +3 -2
- package/esm5/components/accordion/components/accordion-panel/accordion-panel.component.js +16 -6
- package/esm5/components/dynamic-form/components/fields/chips/chips-field.component.js +27 -4
- package/esm5/components/dynamic-form/configurations/fields/chips-field.js +5 -1
- package/esm5/components/switch/switch.component.js +4 -1
- package/esm5/locale/fallback.js +3 -1
- package/fesm2015/seniorsistemas-angular-components.js +51 -7
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +51 -8
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -39,6 +39,7 @@ import { RadioButtonModule } from 'primeng/radiobutton';
|
|
|
39
39
|
import { SliderModule } from 'primeng/slider';
|
|
40
40
|
import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
|
|
41
41
|
import { DomSanitizer, BrowserModule } from '@angular/platform-browser';
|
|
42
|
+
import { Clipboard } from '@angular/cdk/clipboard';
|
|
42
43
|
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
43
44
|
import Cropper from 'cropperjs';
|
|
44
45
|
import * as elementResizeDetectorMaker_ from 'element-resize-detector';
|
|
@@ -62,9 +63,9 @@ var AccordionPanelComponent = /** @class */ (function () {
|
|
|
62
63
|
this.cache = false;
|
|
63
64
|
this.panelOpened = new EventEmitter();
|
|
64
65
|
this.panelClosed = new EventEmitter();
|
|
65
|
-
this._isOpen = false;
|
|
66
66
|
this.isAnimating = false;
|
|
67
67
|
this.isContentAnimationDisabled = true;
|
|
68
|
+
this._isOpen = false;
|
|
68
69
|
}
|
|
69
70
|
Object.defineProperty(AccordionPanelComponent.prototype, "isOpen", {
|
|
70
71
|
get: function () {
|
|
@@ -76,9 +77,16 @@ var AccordionPanelComponent = /** @class */ (function () {
|
|
|
76
77
|
enumerable: true,
|
|
77
78
|
configurable: true
|
|
78
79
|
});
|
|
79
|
-
AccordionPanelComponent.prototype.
|
|
80
|
-
if (
|
|
81
|
-
this.
|
|
80
|
+
AccordionPanelComponent.prototype.ngOnChanges = function (changes) {
|
|
81
|
+
if ("disabled" in changes) {
|
|
82
|
+
if (this.switchControl) {
|
|
83
|
+
changes["disabled"].currentValue
|
|
84
|
+
? this.switchControl.disable({ emitEvent: false })
|
|
85
|
+
: this.switchControl.enable({ emitEvent: false });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if ("switch" in changes && "switchControl" in changes) {
|
|
89
|
+
throw new Error("You can't set switch and switchControl together.");
|
|
82
90
|
}
|
|
83
91
|
};
|
|
84
92
|
AccordionPanelComponent.prototype.ngAfterViewInit = function () {
|
|
@@ -125,6 +133,9 @@ var AccordionPanelComponent = /** @class */ (function () {
|
|
|
125
133
|
__decorate([
|
|
126
134
|
Input()
|
|
127
135
|
], AccordionPanelComponent.prototype, "switch", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
Input()
|
|
138
|
+
], AccordionPanelComponent.prototype, "switchControl", void 0);
|
|
128
139
|
__decorate([
|
|
129
140
|
Input()
|
|
130
141
|
], AccordionPanelComponent.prototype, "validationMessage", void 0);
|
|
@@ -140,7 +151,7 @@ var AccordionPanelComponent = /** @class */ (function () {
|
|
|
140
151
|
AccordionPanelComponent = __decorate([
|
|
141
152
|
Component({
|
|
142
153
|
selector: "s-accordion-panel",
|
|
143
|
-
template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <s-switch\n *ngIf=\"switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"
|
|
154
|
+
template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <s-switch\n *ngIf=\"switchControl\"\n class=\"switch\"\n [formControl]=\"switchControl\"\n (click)=\"$event.stopPropagation()\">\n </s-switch>\n <s-switch\n *ngIf=\"!switchControl && switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"switch.state\"\n (click)=\"$event.stopPropagation()\"\n (valueChanged)=\"switch.onChange($event)\">\n </s-switch>\n </div>\n </div>\n <ng-container *ngIf=\"cache; then cacheTemplate else cachelessTemplate\"></ng-container>\n</div>\n\n<ng-template #cacheTemplate>\n <div\n class=\"content\"\n [@cacheAnimation]=\"isOpen\"\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cacheAnimation.start)=\"onContentAnimationStart()\"\n (@cacheAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #cachelessTemplate>\n <div\n *ngIf=\"isOpen\"\n class=\"content\"\n @cachelessAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cachelessAnimation.start)=\"onContentAnimationStart()\"\n (@cachelessAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #panelContent>\n <ng-content></ng-content>\n</ng-template>",
|
|
144
155
|
animations: [
|
|
145
156
|
trigger("cachelessAnimation", [
|
|
146
157
|
transition(":enter", [style$7({ height: "0" }), animate("200ms linear", style$7({ height: "*" }))]),
|
|
@@ -281,6 +292,9 @@ var SwitchComponent = /** @class */ (function () {
|
|
|
281
292
|
if (this._onChange) {
|
|
282
293
|
this._onChange(this.value);
|
|
283
294
|
}
|
|
295
|
+
if (this._onTouched) {
|
|
296
|
+
this._onTouched(this.value);
|
|
297
|
+
}
|
|
284
298
|
};
|
|
285
299
|
var SwitchComponent_1;
|
|
286
300
|
__decorate([
|
|
@@ -749,6 +763,7 @@ var AccordionModule = /** @class */ (function () {
|
|
|
749
763
|
imports: [
|
|
750
764
|
CommonModule,
|
|
751
765
|
FormsModule,
|
|
766
|
+
ReactiveFormsModule,
|
|
752
767
|
TooltipModule,
|
|
753
768
|
SwitchModule,
|
|
754
769
|
],
|
|
@@ -2970,12 +2985,16 @@ var ChipsField = /** @class */ (function (_super) {
|
|
|
2970
2985
|
__extends(ChipsField, _super);
|
|
2971
2986
|
function ChipsField(config) {
|
|
2972
2987
|
var _this = _super.call(this, config) || this;
|
|
2988
|
+
_this.showCopyButton = false;
|
|
2973
2989
|
_this.keyFilter = config.keyFilter;
|
|
2990
|
+
_this.showCopyButton = config.showCopyButton;
|
|
2991
|
+
_this.separator = config.separator;
|
|
2974
2992
|
_this.onAdd = config.onAdd;
|
|
2975
2993
|
_this.onRemove = config.onRemove;
|
|
2976
2994
|
_this.onChipClick = config.onChipClick;
|
|
2977
2995
|
_this.onFocus = config.onFocus;
|
|
2978
2996
|
_this.onBlur = config.onBlur;
|
|
2997
|
+
_this.onCopy = config.onCopy;
|
|
2979
2998
|
return _this;
|
|
2980
2999
|
}
|
|
2981
3000
|
return ChipsField;
|
|
@@ -6611,8 +6630,30 @@ var CalendarFieldComponent = /** @class */ (function () {
|
|
|
6611
6630
|
}());
|
|
6612
6631
|
|
|
6613
6632
|
var ChipsFieldComponent = /** @class */ (function () {
|
|
6614
|
-
function ChipsFieldComponent() {
|
|
6633
|
+
function ChipsFieldComponent(clipboard) {
|
|
6634
|
+
this.clipboard = clipboard;
|
|
6635
|
+
this.feedbackMessageVisible = false;
|
|
6636
|
+
this.copyButtonVisible = true;
|
|
6615
6637
|
}
|
|
6638
|
+
ChipsFieldComponent.prototype.onCopyFieldContent = function () {
|
|
6639
|
+
var _this = this;
|
|
6640
|
+
if (this.formControl.value) {
|
|
6641
|
+
this.copyButtonVisible = false;
|
|
6642
|
+
this.feedbackMessageVisible = true;
|
|
6643
|
+
setTimeout(function () {
|
|
6644
|
+
_this.feedbackMessageVisible = false;
|
|
6645
|
+
_this.copyButtonVisible = true;
|
|
6646
|
+
}, 3000);
|
|
6647
|
+
var content = this.formControl.value.join(this.field.separator || "\n");
|
|
6648
|
+
this.clipboard.copy(content);
|
|
6649
|
+
if (this.field.onCopy) {
|
|
6650
|
+
this.field.onCopy(content);
|
|
6651
|
+
}
|
|
6652
|
+
}
|
|
6653
|
+
};
|
|
6654
|
+
ChipsFieldComponent.ctorParameters = function () { return [
|
|
6655
|
+
{ type: Clipboard }
|
|
6656
|
+
]; };
|
|
6616
6657
|
__decorate([
|
|
6617
6658
|
Input()
|
|
6618
6659
|
], ChipsFieldComponent.prototype, "field", void 0);
|
|
@@ -6621,8 +6662,8 @@ var ChipsFieldComponent = /** @class */ (function () {
|
|
|
6621
6662
|
], ChipsFieldComponent.prototype, "formControl", void 0);
|
|
6622
6663
|
ChipsFieldComponent = __decorate([
|
|
6623
6664
|
Component({
|
|
6624
|
-
template: "<p-chips\n
|
|
6625
|
-
styles: [".chip-content{display:block;overflow:hidden;padding-right:1rem;text-overflow:ellipsis}"]
|
|
6665
|
+
template: "<div class=\"chips-field-wrapper\">\n <div style=\"width: 100%;\">\n <p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n \n <p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n </p-chips>\n </div>\n \n <button\n *ngIf=\"field.showCopyButton && formControl.value?.length > 0 && copyButtonVisible\"\n class=\"copy-content-button\"\n (click)=\"onCopyFieldContent()\">\n {{ \"platform.angular_components.copy_field_content\" | translate }}\n </button>\n \n <span\n *ngIf=\"feedbackMessageVisible\"\n class=\"feedback-message\">\n {{ \"platform.angular_components.copied_to_clipboard\" | translate }}\n </span>\n</div>\n",
|
|
6666
|
+
styles: [".chips-field-wrapper{-ms-flex-align:start;align-items:flex-start;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.chips-field-wrapper .chip-content{display:block;overflow:hidden;padding-right:1rem;text-overflow:ellipsis}.chips-field-wrapper .copy-content-button{background-color:transparent;border:none;color:#2a6496;cursor:pointer;margin-top:8px}.chips-field-wrapper .feedback-message{color:#0c9348;display:block;margin-top:8px;-webkit-user-select:none;-ms-user-select:none;user-select:none}"]
|
|
6626
6667
|
})
|
|
6627
6668
|
], ChipsFieldComponent);
|
|
6628
6669
|
return ChipsFieldComponent;
|
|
@@ -15451,6 +15492,8 @@ var PanelModule = /** @class */ (function () {
|
|
|
15451
15492
|
}());
|
|
15452
15493
|
|
|
15453
15494
|
var fallback = {
|
|
15495
|
+
"platform.angular_components.copied_to_clipboard": "Copiado para área de transferência",
|
|
15496
|
+
"platform.angular_components.copy_field_content": "Copiar conteúdo preenchido",
|
|
15454
15497
|
"platform.angular_components.ia_text_generator": "Gerador de texto por IA",
|
|
15455
15498
|
"platform.angular_components.generate_text": "Gerar texto",
|
|
15456
15499
|
"platform.angular_components.context": "Contexto",
|