@seniorsistemas/angular-components 17.2.6 → 17.2.7
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 +35 -7
- 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/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/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/locale/fallback.js +3 -1
- 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/locale/fallback.js +3 -1
- package/fesm2015/seniorsistemas-angular-components.js +32 -2
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +32 -3
- 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';
|
|
@@ -2785,12 +2786,16 @@ class CalendarField extends Field {
|
|
|
2785
2786
|
class ChipsField extends Field {
|
|
2786
2787
|
constructor(config) {
|
|
2787
2788
|
super(config);
|
|
2789
|
+
this.showCopyButton = false;
|
|
2788
2790
|
this.keyFilter = config.keyFilter;
|
|
2791
|
+
this.showCopyButton = config.showCopyButton;
|
|
2792
|
+
this.separator = config.separator;
|
|
2789
2793
|
this.onAdd = config.onAdd;
|
|
2790
2794
|
this.onRemove = config.onRemove;
|
|
2791
2795
|
this.onChipClick = config.onChipClick;
|
|
2792
2796
|
this.onFocus = config.onFocus;
|
|
2793
2797
|
this.onBlur = config.onBlur;
|
|
2798
|
+
this.onCopy = config.onCopy;
|
|
2794
2799
|
}
|
|
2795
2800
|
}
|
|
2796
2801
|
|
|
@@ -6094,7 +6099,30 @@ CalendarFieldComponent = __decorate([
|
|
|
6094
6099
|
], CalendarFieldComponent);
|
|
6095
6100
|
|
|
6096
6101
|
let ChipsFieldComponent = class ChipsFieldComponent {
|
|
6102
|
+
constructor(clipboard) {
|
|
6103
|
+
this.clipboard = clipboard;
|
|
6104
|
+
this.feedbackMessageVisible = false;
|
|
6105
|
+
this.copyButtonVisible = true;
|
|
6106
|
+
}
|
|
6107
|
+
onCopyFieldContent() {
|
|
6108
|
+
if (this.formControl.value) {
|
|
6109
|
+
this.copyButtonVisible = false;
|
|
6110
|
+
this.feedbackMessageVisible = true;
|
|
6111
|
+
setTimeout(() => {
|
|
6112
|
+
this.feedbackMessageVisible = false;
|
|
6113
|
+
this.copyButtonVisible = true;
|
|
6114
|
+
}, 3000);
|
|
6115
|
+
const content = this.formControl.value.join(this.field.separator || "\n");
|
|
6116
|
+
this.clipboard.copy(content);
|
|
6117
|
+
if (this.field.onCopy) {
|
|
6118
|
+
this.field.onCopy(content);
|
|
6119
|
+
}
|
|
6120
|
+
}
|
|
6121
|
+
}
|
|
6097
6122
|
};
|
|
6123
|
+
ChipsFieldComponent.ctorParameters = () => [
|
|
6124
|
+
{ type: Clipboard }
|
|
6125
|
+
];
|
|
6098
6126
|
__decorate([
|
|
6099
6127
|
Input()
|
|
6100
6128
|
], ChipsFieldComponent.prototype, "field", void 0);
|
|
@@ -6103,8 +6131,8 @@ __decorate([
|
|
|
6103
6131
|
], ChipsFieldComponent.prototype, "formControl", void 0);
|
|
6104
6132
|
ChipsFieldComponent = __decorate([
|
|
6105
6133
|
Component({
|
|
6106
|
-
template: "<p-chips\n
|
|
6107
|
-
styles: [".chip-content{display:block;overflow:hidden;padding-right:1rem;text-overflow:ellipsis}"]
|
|
6134
|
+
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",
|
|
6135
|
+
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}"]
|
|
6108
6136
|
})
|
|
6109
6137
|
], ChipsFieldComponent);
|
|
6110
6138
|
|
|
@@ -14439,6 +14467,8 @@ PanelModule = __decorate([
|
|
|
14439
14467
|
], PanelModule);
|
|
14440
14468
|
|
|
14441
14469
|
const fallback = {
|
|
14470
|
+
"platform.angular_components.copied_to_clipboard": "Copiado para área de transferência",
|
|
14471
|
+
"platform.angular_components.copy_field_content": "Copiar conteúdo preenchido",
|
|
14442
14472
|
"platform.angular_components.ia_text_generator": "Gerador de texto por IA",
|
|
14443
14473
|
"platform.angular_components.generate_text": "Gerar texto",
|
|
14444
14474
|
"platform.angular_components.context": "Contexto",
|