@seniorsistemas/angular-components 17.26.5 → 17.26.6
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 +142 -69
- 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/bignumber-input/{number-input.directive.d.ts → bignumber-input.directive.d.ts} +3 -1
- package/components/bignumber-input/index.d.ts +2 -2
- package/components/card/card.component.d.ts +5 -2
- package/components/dynamic-form/components/fields/text-area-ia/text-area-ia-field.component.d.ts +4 -5
- package/components/dynamic-form/configurations/fields/text-area-ia-field.d.ts +4 -6
- package/components/number-input/number-input.directive.d.ts +11 -9
- package/components/speech-recognition/speech-recognition/speech-recognition.component.d.ts +2 -8
- package/components/speech-recognition/text-to-speech.service.d.ts +1 -0
- package/components/text-area/text-area/text-area.component.d.ts +6 -2
- package/components/text-area-ia/text-area-ia.component.d.ts +1 -0
- package/esm2015/components/bignumber-input/bignumber-input.directive.js +150 -0
- package/esm2015/components/bignumber-input/bignumber-input.module.js +15 -0
- package/esm2015/components/bignumber-input/index.js +3 -3
- package/esm2015/components/card/card.component.js +22 -7
- package/esm2015/components/dynamic-form/components/fields/bignumber/bignumber-field.module.js +2 -2
- package/esm2015/components/dynamic-form/components/fields/text-area/text-area-field.component.js +2 -2
- package/esm2015/components/dynamic-form/components/fields/text-area-ia/text-area-ia-field.component.js +10 -11
- package/esm2015/components/dynamic-form/configurations/fields/text-area-ia-field.js +7 -2
- package/esm2015/components/dynamic-form/dynamic-form.module.js +2 -2
- package/esm2015/components/inline-edit/inline-edit.module.js +2 -2
- package/esm2015/components/number-input/number-input.directive.js +41 -21
- package/esm2015/components/speech-recognition/speech-recognition/speech-recognition.component.js +3 -25
- package/esm2015/components/speech-recognition/speech-recognition.service.js +4 -2
- package/esm2015/components/speech-recognition/text-to-speech.service.js +13 -4
- package/esm2015/components/text-area/text-area/text-area.component.js +18 -4
- package/esm2015/components/text-area-ia/text-area-ia.component.js +8 -3
- package/esm2015/components/text-area-ia/text-area-ia.module.js +3 -3
- package/esm2015/locale/fallback.js +4 -4
- package/esm5/components/bignumber-input/bignumber-input.directive.js +155 -0
- package/esm5/components/bignumber-input/bignumber-input.module.js +18 -0
- package/esm5/components/bignumber-input/index.js +3 -3
- package/esm5/components/card/card.component.js +26 -7
- package/esm5/components/dynamic-form/components/fields/bignumber/bignumber-field.module.js +2 -2
- package/esm5/components/dynamic-form/components/fields/text-area/text-area-field.component.js +2 -2
- package/esm5/components/dynamic-form/components/fields/text-area-ia/text-area-ia-field.component.js +10 -11
- package/esm5/components/dynamic-form/configurations/fields/text-area-ia-field.js +8 -3
- package/esm5/components/dynamic-form/dynamic-form.module.js +2 -2
- package/esm5/components/inline-edit/inline-edit.module.js +2 -2
- package/esm5/components/number-input/number-input.directive.js +42 -22
- package/esm5/components/speech-recognition/speech-recognition/speech-recognition.component.js +3 -26
- package/esm5/components/speech-recognition/speech-recognition.service.js +5 -2
- package/esm5/components/speech-recognition/text-to-speech.service.js +13 -4
- package/esm5/components/text-area/text-area/text-area.component.js +23 -5
- package/esm5/components/text-area-ia/text-area-ia.component.js +8 -3
- package/esm5/components/text-area-ia/text-area-ia.module.js +3 -3
- package/esm5/locale/fallback.js +4 -4
- package/fesm2015/seniorsistemas-angular-components.js +133 -68
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +143 -70
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
- package/esm2015/components/bignumber-input/number-input.directive.js +0 -132
- package/esm2015/components/bignumber-input/number-input.module.js +0 -15
- package/esm5/components/bignumber-input/number-input.directive.js +0 -137
- package/esm5/components/bignumber-input/number-input.module.js +0 -18
- /package/components/bignumber-input/{number-input.module.d.ts → bignumber-input.module.d.ts} +0 -0
|
@@ -1215,6 +1215,7 @@ let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDi
|
|
|
1215
1215
|
this.scale = 0;
|
|
1216
1216
|
this.alignTo = AlignmentOptions.LEFT;
|
|
1217
1217
|
this.allowNegative = true;
|
|
1218
|
+
this.pasteRejected = new EventEmitter();
|
|
1218
1219
|
this.onLocaleService();
|
|
1219
1220
|
}
|
|
1220
1221
|
ngOnInit() {
|
|
@@ -1235,6 +1236,17 @@ let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDi
|
|
|
1235
1236
|
this.updateVariables();
|
|
1236
1237
|
}
|
|
1237
1238
|
}
|
|
1239
|
+
onPaste(event) {
|
|
1240
|
+
var _a, _b;
|
|
1241
|
+
const pastedText = (_b = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData("text")) !== null && _b !== void 0 ? _b : "";
|
|
1242
|
+
const numericText = pastedText.replace(new RegExp(`\\${this.thousandsSeparator}`, "g"), "").replace(this.decimalSeparator, ".");
|
|
1243
|
+
const [intPart, decimalPart = ""] = numericText.split(".");
|
|
1244
|
+
const totalDigits = intPart.replace(/\D/g, "").length + decimalPart.slice(0, this.scale).length;
|
|
1245
|
+
if (totalDigits > this.precision) {
|
|
1246
|
+
event.preventDefault();
|
|
1247
|
+
this.pasteRejected.emit(pastedText);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1238
1250
|
onKeypress(event) {
|
|
1239
1251
|
const code = event.code;
|
|
1240
1252
|
if (code === "Minus" || code === "NumpadSubtract") {
|
|
@@ -1315,6 +1327,12 @@ __decorate([
|
|
|
1315
1327
|
__decorate([
|
|
1316
1328
|
HostBinding("attr.maxLength")
|
|
1317
1329
|
], BignumberInputDirective.prototype, "maxLength", void 0);
|
|
1330
|
+
__decorate([
|
|
1331
|
+
Output()
|
|
1332
|
+
], BignumberInputDirective.prototype, "pasteRejected", void 0);
|
|
1333
|
+
__decorate([
|
|
1334
|
+
HostListener("paste", ["$event"])
|
|
1335
|
+
], BignumberInputDirective.prototype, "onPaste", null);
|
|
1318
1336
|
__decorate([
|
|
1319
1337
|
HostListener("keypress", ["$event"])
|
|
1320
1338
|
], BignumberInputDirective.prototype, "onKeypress", null);
|
|
@@ -3032,12 +3050,19 @@ var CardTemplateTypes;
|
|
|
3032
3050
|
let CardComponent = class CardComponent {
|
|
3033
3051
|
constructor() {
|
|
3034
3052
|
this.fullWidth = false;
|
|
3053
|
+
this.title = '';
|
|
3054
|
+
this.subtitle = '';
|
|
3055
|
+
this.icon = '';
|
|
3035
3056
|
this.showBanner = false;
|
|
3036
|
-
this.hasCustomTemplates = false;
|
|
3037
3057
|
}
|
|
3038
3058
|
ngAfterContentInit() {
|
|
3039
3059
|
this._getTemplates();
|
|
3040
|
-
this.
|
|
3060
|
+
this._loadImage();
|
|
3061
|
+
}
|
|
3062
|
+
get hasHeader() {
|
|
3063
|
+
const headerTemplate = !!this.headerTemplate;
|
|
3064
|
+
const hasHeaderAttributes = this.title || this.subtitle || this.icon;
|
|
3065
|
+
return headerTemplate || hasHeaderAttributes;
|
|
3041
3066
|
}
|
|
3042
3067
|
_getHeaderTemplate() {
|
|
3043
3068
|
return this._getCustomTemplate(CardTemplateTypes.Header);
|
|
@@ -3056,9 +3081,8 @@ let CardComponent = class CardComponent {
|
|
|
3056
3081
|
this.headerTemplate = this._getHeaderTemplate();
|
|
3057
3082
|
this.bodyTemplate = this._getBodyTemplate();
|
|
3058
3083
|
this.footerTemplate = this._getFooterTemplate();
|
|
3059
|
-
this.hasCustomTemplates = !!(this.headerTemplate || this.bodyTemplate || this.footerTemplate);
|
|
3060
3084
|
}
|
|
3061
|
-
|
|
3085
|
+
_loadImage() {
|
|
3062
3086
|
const img = new Image();
|
|
3063
3087
|
img.src = this.bannerImage;
|
|
3064
3088
|
img.onload = () => (this.showBanner = true);
|
|
@@ -3071,14 +3095,23 @@ __decorate([
|
|
|
3071
3095
|
__decorate([
|
|
3072
3096
|
Input()
|
|
3073
3097
|
], CardComponent.prototype, "fullWidth", void 0);
|
|
3098
|
+
__decorate([
|
|
3099
|
+
Input()
|
|
3100
|
+
], CardComponent.prototype, "title", void 0);
|
|
3101
|
+
__decorate([
|
|
3102
|
+
Input()
|
|
3103
|
+
], CardComponent.prototype, "subtitle", void 0);
|
|
3104
|
+
__decorate([
|
|
3105
|
+
Input()
|
|
3106
|
+
], CardComponent.prototype, "icon", void 0);
|
|
3074
3107
|
__decorate([
|
|
3075
3108
|
ContentChildren(TemplateDirective)
|
|
3076
3109
|
], CardComponent.prototype, "templates", void 0);
|
|
3077
3110
|
CardComponent = __decorate([
|
|
3078
3111
|
Component({
|
|
3079
3112
|
selector: "s-card",
|
|
3080
|
-
template: "<div class=\"card\" [ngClass]=\"{ 'card--full-width': fullWidth }\">\n <div\n *ngIf=\"showBanner\"\n class=\"banner\"\n [ngStyle]=\"{'background-image': 'url(' + bannerImage + ')'}\">\n </div>\n\n <ng-container *ngIf=\"
|
|
3081
|
-
styles: [".card{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;background-color:#fff;border-radius:4px;box-shadow:0 1px 5px 0 #00000040;overflow:hidden}.card--full-width{width:100%}.card .banner{background-repeat:no-repeat;background-size:cover;height:150px;width:100%}.card .header{padding:16px 12px}.card .body,.card .footer{padding:16px}.card .body+.footer,.card .header+.body{border-top:1px solid #c1c1cc}"]
|
|
3113
|
+
template: "<div class=\"card\" [ngClass]=\"{ 'card--full-width': fullWidth }\">\n <div\n *ngIf=\"showBanner\"\n class=\"banner\"\n [ngStyle]=\"{'background-image': 'url(' + bannerImage + ')'}\">\n </div>\n\n <ng-container *ngIf=\"hasHeader\">\n <div class=\"header\">\n <ng-container *ngIf=\"headerTemplate\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"!headerTemplate\">\n <div class=\"header-content\">\n <div class=\"header-icon\" *ngIf=\"icon\">\n <i [class]=\"icon\"></i>\n </div>\n <div>\n <div class=\"header-title\" *ngIf=\"title\">\n {{ title }}\n </div>\n <div class=\"header-subtitle\" *ngIf=\"subtitle\">\n {{ subtitle }}\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <div *ngIf=\"bodyTemplate\" class=\"body\">\n <ng-container *ngTemplateOutlet=\"bodyTemplate\"></ng-container>\n </div>\n <ng-container *ngIf=\"!bodyTemplate\">\n <div class=\"body\">\n <ng-content></ng-content>\n </div>\n </ng-container>\n <div *ngIf=\"footerTemplate\" class=\"footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n </div>\n</div>\n",
|
|
3114
|
+
styles: [".card{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;background-color:#fff;border-radius:4px;box-shadow:0 1px 5px 0 #00000040;overflow:hidden}.card--full-width{width:100%}.card .banner{background-repeat:no-repeat;background-size:cover;height:150px;width:100%}.card .header{padding:16px 12px}.card .header-content{display:-ms-flexbox;display:flex;gap:12px}.card .header-title{color:#212533;font-size:14px;font-style:normal;font-weight:700}.card .header-subtitle{color:#6e7280;font-size:14px;font-style:normal;font-weight:400}.card .header-icon{border-radius:50%;background-color:#dedce5;width:3em;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-height:3em}.card .body,.card .footer{padding:16px}.card .body+.footer,.card .header+.body{border-top:1px solid #c1c1cc}"]
|
|
3082
3115
|
})
|
|
3083
3116
|
], CardComponent);
|
|
3084
3117
|
|
|
@@ -6290,19 +6323,24 @@ var NumberAlignmentOption;
|
|
|
6290
6323
|
* @deprecated Should use BigNumberInput directive instead
|
|
6291
6324
|
*/
|
|
6292
6325
|
let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective extends CurrencyMaskDirective$1 {
|
|
6293
|
-
constructor(
|
|
6326
|
+
constructor(_keyValueDiffers, _elementRef, localeService) {
|
|
6294
6327
|
super(null, _elementRef, _keyValueDiffers);
|
|
6328
|
+
this._elementRef = _elementRef;
|
|
6295
6329
|
this.localeService = localeService;
|
|
6296
6330
|
this.precision = 15;
|
|
6297
6331
|
this.scale = 0;
|
|
6298
6332
|
this.alignTo = NumberAlignmentOption.LEFT;
|
|
6299
6333
|
this.allowNegative = true;
|
|
6300
|
-
this.
|
|
6334
|
+
this.pasteRejected = new EventEmitter();
|
|
6301
6335
|
this.onLocaleService();
|
|
6302
6336
|
}
|
|
6303
6337
|
ngOnInit() {
|
|
6304
6338
|
this.updateVariables();
|
|
6305
6339
|
super.ngOnInit();
|
|
6340
|
+
this.pasteListener = this._onPaste.bind(this);
|
|
6341
|
+
this._elementRef.nativeElement.addEventListener("paste", this.pasteListener);
|
|
6342
|
+
this.keypressListener = this._onKeypress.bind(this);
|
|
6343
|
+
this._elementRef.nativeElement.addEventListener("keypress", this.keypressListener);
|
|
6306
6344
|
}
|
|
6307
6345
|
ngOnChanges(changes) {
|
|
6308
6346
|
const placeholderChange = changes.placeholder && changes.placeholder.currentValue;
|
|
@@ -6317,6 +6355,33 @@ let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective e
|
|
|
6317
6355
|
this.updateVariables();
|
|
6318
6356
|
}
|
|
6319
6357
|
}
|
|
6358
|
+
ngOnDestroy() {
|
|
6359
|
+
this._elementRef.nativeElement.removeEventListener("paste", this.pasteListener);
|
|
6360
|
+
this._elementRef.nativeElement.removeEventListener("keypress", this.keypressListener);
|
|
6361
|
+
}
|
|
6362
|
+
_onPaste(event) {
|
|
6363
|
+
var _a, _b;
|
|
6364
|
+
const pastedText = (_b = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData("text")) !== null && _b !== void 0 ? _b : "";
|
|
6365
|
+
const numericText = pastedText.replace(new RegExp(`\\${this.thousandsSeparator}`, "g"), "").replace(this.decimalSeparator, ".");
|
|
6366
|
+
const [intPart, decimalPart = ""] = numericText.split(".");
|
|
6367
|
+
const totalDigits = intPart.replace(/\D/g, "").length + decimalPart.slice(0, this.scale).length;
|
|
6368
|
+
if (totalDigits > this.precision) {
|
|
6369
|
+
event.preventDefault();
|
|
6370
|
+
event.stopPropagation();
|
|
6371
|
+
this.pasteRejected.emit(pastedText);
|
|
6372
|
+
}
|
|
6373
|
+
}
|
|
6374
|
+
_onKeypress(event) {
|
|
6375
|
+
const code = event.code;
|
|
6376
|
+
if (code === "Minus" || code === "NumpadSubtract") {
|
|
6377
|
+
if (this.allowNegative) {
|
|
6378
|
+
this.maxLength = this._maxLength + 1;
|
|
6379
|
+
}
|
|
6380
|
+
}
|
|
6381
|
+
else if (code === "Equal" || code === "NumpadAdd") {
|
|
6382
|
+
this.maxLength = this._maxLength;
|
|
6383
|
+
}
|
|
6384
|
+
}
|
|
6320
6385
|
/**
|
|
6321
6386
|
* Update the options values according to the directive input values.
|
|
6322
6387
|
*/
|
|
@@ -6340,24 +6405,9 @@ let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective e
|
|
|
6340
6405
|
const thoSepLength = this.thousandsSeparator.length;
|
|
6341
6406
|
let maxLength = this.precision + (this.scale ? decSepLength : 0);
|
|
6342
6407
|
maxLength += Math.ceil((this.precision - (this.scale ? this.scale : 0)) / 3 - 1) * thoSepLength;
|
|
6408
|
+
this._maxLength = maxLength;
|
|
6343
6409
|
this.maxLength = maxLength;
|
|
6344
6410
|
}
|
|
6345
|
-
/**
|
|
6346
|
-
* Prevents the default CurrencyMask behavior when typed a incorrect value.
|
|
6347
|
-
* By default the CurrencyMask inputs the mask value to the component value when typed a incorrect value.
|
|
6348
|
-
*/
|
|
6349
|
-
handleKeypress(event) {
|
|
6350
|
-
const negativeOperator = "-";
|
|
6351
|
-
const { key } = event;
|
|
6352
|
-
if (this.thousandsSeparator.includes(key) ||
|
|
6353
|
-
this.decimalSeparator.includes(key) ||
|
|
6354
|
-
negativeOperator.includes(key) ||
|
|
6355
|
-
this.regex.test(key) ||
|
|
6356
|
-
"Enter".toUpperCase() === key.toUpperCase())
|
|
6357
|
-
super.handleKeypress(event);
|
|
6358
|
-
else
|
|
6359
|
-
event.preventDefault();
|
|
6360
|
-
}
|
|
6361
6411
|
onLocaleService() {
|
|
6362
6412
|
this.localeService
|
|
6363
6413
|
.getLocale()
|
|
@@ -6370,8 +6420,8 @@ let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective e
|
|
|
6370
6420
|
}
|
|
6371
6421
|
};
|
|
6372
6422
|
NumberInputDirective.ctorParameters = () => [
|
|
6373
|
-
{ type: ElementRef },
|
|
6374
6423
|
{ type: KeyValueDiffers },
|
|
6424
|
+
{ type: ElementRef },
|
|
6375
6425
|
{ type: LocaleService }
|
|
6376
6426
|
];
|
|
6377
6427
|
__decorate([
|
|
@@ -6399,6 +6449,9 @@ __decorate([
|
|
|
6399
6449
|
__decorate([
|
|
6400
6450
|
HostBinding("attr.maxLength")
|
|
6401
6451
|
], NumberInputDirective.prototype, "maxLength", void 0);
|
|
6452
|
+
__decorate([
|
|
6453
|
+
Output()
|
|
6454
|
+
], NumberInputDirective.prototype, "pasteRejected", void 0);
|
|
6402
6455
|
NumberInputDirective = NumberInputDirective_1 = __decorate([
|
|
6403
6456
|
Directive({
|
|
6404
6457
|
selector: "input[sNumberInput]",
|
|
@@ -6596,13 +6649,18 @@ class TextAreaField extends Field {
|
|
|
6596
6649
|
|
|
6597
6650
|
class TextAreaIAField extends Field {
|
|
6598
6651
|
constructor(config) {
|
|
6652
|
+
var _a;
|
|
6599
6653
|
super(config);
|
|
6654
|
+
this.style = {
|
|
6655
|
+
resize: 'vertical'
|
|
6656
|
+
};
|
|
6600
6657
|
this.cols = config.cols;
|
|
6601
6658
|
this.rows = config.rows;
|
|
6602
6659
|
this.keyFilter = config.keyFilter;
|
|
6603
|
-
this.style = config.style;
|
|
6660
|
+
this.style = Object.assign(Object.assign({}, config.style), this.style);
|
|
6604
6661
|
this.prompt = config.prompt;
|
|
6605
6662
|
this.readonly = config.readonly;
|
|
6663
|
+
this.speechRecognition = (_a = config.speechRecognition) !== null && _a !== void 0 ? _a : false;
|
|
6606
6664
|
}
|
|
6607
6665
|
}
|
|
6608
6666
|
|
|
@@ -10592,12 +10650,14 @@ let TextAreaIAFieldComponent = class TextAreaIAFieldComponent {
|
|
|
10592
10650
|
this.hideDialog();
|
|
10593
10651
|
}
|
|
10594
10652
|
_createDialogFields() {
|
|
10653
|
+
var _a;
|
|
10595
10654
|
this.fields = [
|
|
10596
10655
|
new FormField({
|
|
10597
10656
|
name: "context",
|
|
10598
10657
|
type: FieldType.Text,
|
|
10599
10658
|
label: this._translateService.instant("platform.angular_components.context"),
|
|
10600
10659
|
size: { sm: 12, md: 12, lg: 12, xl: 12 },
|
|
10660
|
+
speechRecognition: (_a = this.field.speechRecognition) !== null && _a !== void 0 ? _a : false
|
|
10601
10661
|
}),
|
|
10602
10662
|
];
|
|
10603
10663
|
}
|
|
@@ -10618,13 +10678,10 @@ __decorate([
|
|
|
10618
10678
|
__decorate([
|
|
10619
10679
|
Input()
|
|
10620
10680
|
], TextAreaIAFieldComponent.prototype, "formControl", void 0);
|
|
10621
|
-
__decorate([
|
|
10622
|
-
ViewChild('inputRef')
|
|
10623
|
-
], TextAreaIAFieldComponent.prototype, "inputRef", void 0);
|
|
10624
10681
|
TextAreaIAFieldComponent = __decorate([
|
|
10625
10682
|
Component({
|
|
10626
|
-
template: "<s-field-label [field]=\"field\"\n [fieldContainerRef]=\"
|
|
10627
|
-
styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}"]
|
|
10683
|
+
template: "<s-field-label [field]=\"field\"\n *ngIf=\"textArea.renderTextArea\"\n [fieldContainerRef]=\"textArea.textAreaElement?.nativeElement\"></s-field-label>\n\n<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\">\n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n IAssist - Content Generator\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <s-textarea\n #textArea\n [inputId]=\"(field.id || field.name)\"\n [rows]=\"field.rows\"\n [formControl]=\"formControl\"\n [inputStyle]=\"field.style\"\n [readOnly]=\"field.readonly ? field.readonly() : false\"\n [speechRecognition]=\"field.speechRecognition\"\n ></s-textarea>\n <button\n class=\"iassist-button\"\n [class.speech-recognition]=\"field.speechRecognition\"\n (click)=\"showDialog()\"\n sTooltip=\"IAssist - Content Generator\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>\n",
|
|
10684
|
+
styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.textarea-ia s-textarea{width:100%}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}.speech-recognition{margin-bottom:12.5px}"]
|
|
10628
10685
|
})
|
|
10629
10686
|
], TextAreaIAFieldComponent);
|
|
10630
10687
|
|
|
@@ -10650,7 +10707,7 @@ __decorate([
|
|
|
10650
10707
|
], TextAreaFieldComponent.prototype, "inputRef", void 0);
|
|
10651
10708
|
TextAreaFieldComponent = __decorate([
|
|
10652
10709
|
Component({
|
|
10653
|
-
template: "<s-field-label *ngIf=\"textArea\" [field]=\"field\"\n [fieldContainerRef]=\"textArea.textAreaElement?.nativeElement\"></s-field-label>\n\n<s-textarea\n #textArea\n [inputId]=\"(field.id || field.name)\"\n [rows]=\"field.rows\"\n [formControl]=\"formControl\"\n
|
|
10710
|
+
template: "<s-field-label *ngIf=\"textArea\" [field]=\"field\"\n [fieldContainerRef]=\"textArea.textAreaElement?.nativeElement\"></s-field-label>\n\n<s-textarea\n #textArea\n [inputId]=\"(field.id || field.name)\"\n [rows]=\"field.rows\"\n [formControl]=\"formControl\"\n [inputStyle]=\"field.style\"\n [readOnly]=\"field.readonly ? field.readonly() : false\"\n [keyFilter]=\"field.keyFilter\"\n [speechRecognition]=\"field.speechRecognition\">\n</s-textarea>\n"
|
|
10654
10711
|
})
|
|
10655
10712
|
], TextAreaFieldComponent);
|
|
10656
10713
|
|
|
@@ -12428,7 +12485,8 @@ TextFieldModule = __decorate([
|
|
|
12428
12485
|
|
|
12429
12486
|
var TextAreaComponent_1;
|
|
12430
12487
|
let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent {
|
|
12431
|
-
constructor() {
|
|
12488
|
+
constructor(cdr) {
|
|
12489
|
+
this.cdr = cdr;
|
|
12432
12490
|
this.onChange = () => { };
|
|
12433
12491
|
this.onTouched = () => { };
|
|
12434
12492
|
this.disabled = false;
|
|
@@ -12436,6 +12494,9 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent {
|
|
|
12436
12494
|
this.inputId = `textarea-${Math.random()}`;
|
|
12437
12495
|
this.rows = 5;
|
|
12438
12496
|
this.speechRecognition = false;
|
|
12497
|
+
this._inputStyle = {
|
|
12498
|
+
resize: 'vertical'
|
|
12499
|
+
};
|
|
12439
12500
|
this.readOnly = false;
|
|
12440
12501
|
this.renderTextArea = false;
|
|
12441
12502
|
}
|
|
@@ -12446,8 +12507,15 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent {
|
|
|
12446
12507
|
this._textAreaElement = value;
|
|
12447
12508
|
setTimeout(() => {
|
|
12448
12509
|
this.renderTextArea = true;
|
|
12510
|
+
this.cdr.detectChanges();
|
|
12449
12511
|
});
|
|
12450
12512
|
}
|
|
12513
|
+
get inputStyle() {
|
|
12514
|
+
return this._inputStyle;
|
|
12515
|
+
}
|
|
12516
|
+
set inputStyle(value) {
|
|
12517
|
+
this._inputStyle = Object.assign(Object.assign({}, value), this._inputStyle);
|
|
12518
|
+
}
|
|
12451
12519
|
writeValue(obj) {
|
|
12452
12520
|
this.value = obj;
|
|
12453
12521
|
}
|
|
@@ -12473,6 +12541,9 @@ let TextAreaComponent = TextAreaComponent_1 = class TextAreaComponent {
|
|
|
12473
12541
|
this.setValue(recognizedText);
|
|
12474
12542
|
}
|
|
12475
12543
|
};
|
|
12544
|
+
TextAreaComponent.ctorParameters = () => [
|
|
12545
|
+
{ type: ChangeDetectorRef }
|
|
12546
|
+
];
|
|
12476
12547
|
__decorate([
|
|
12477
12548
|
ViewChild('textArea', { read: ElementRef })
|
|
12478
12549
|
], TextAreaComponent.prototype, "textAreaElement", null);
|
|
@@ -12490,7 +12561,7 @@ __decorate([
|
|
|
12490
12561
|
], TextAreaComponent.prototype, "keyFilter", void 0);
|
|
12491
12562
|
__decorate([
|
|
12492
12563
|
Input()
|
|
12493
|
-
], TextAreaComponent.prototype, "inputStyle",
|
|
12564
|
+
], TextAreaComponent.prototype, "inputStyle", null);
|
|
12494
12565
|
__decorate([
|
|
12495
12566
|
Input()
|
|
12496
12567
|
], TextAreaComponent.prototype, "readOnly", void 0);
|
|
@@ -12583,14 +12654,16 @@ let SpeechRecognitionService = class SpeechRecognitionService {
|
|
|
12583
12654
|
this.recognition.stop();
|
|
12584
12655
|
}
|
|
12585
12656
|
setRecognition() {
|
|
12657
|
+
var _a;
|
|
12586
12658
|
const SpeechRecognitionConstructor = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
12587
12659
|
if (!SpeechRecognitionConstructor) {
|
|
12588
12660
|
throw new Error('Speech recognition is not supported in this browser.');
|
|
12589
12661
|
}
|
|
12590
12662
|
this.recognition = new SpeechRecognitionConstructor();
|
|
12591
|
-
this.recognition.lang = this.localeService.getLocaleOptions().locale || 'pt-BR';
|
|
12663
|
+
this.recognition.lang = ((_a = this.localeService.getLocaleOptions()) === null || _a === void 0 ? void 0 : _a.locale) || 'pt-BR';
|
|
12592
12664
|
this.recognition.interimResults = false;
|
|
12593
12665
|
this.recognition.maxAlternatives = 1;
|
|
12666
|
+
this.localeService.getLocale().subscribe(locale => this.recognition.lang = locale);
|
|
12594
12667
|
}
|
|
12595
12668
|
};
|
|
12596
12669
|
SpeechRecognitionService.ctorParameters = () => [
|
|
@@ -12617,10 +12690,13 @@ let TextToSpeechService = class TextToSpeechService {
|
|
|
12617
12690
|
if (!_voices.length) {
|
|
12618
12691
|
speechSynthesis.onvoiceschanged = () => {
|
|
12619
12692
|
this.ngZone.run(() => {
|
|
12693
|
+
var _a;
|
|
12620
12694
|
_voices = speechSynthesis.getVoices();
|
|
12621
|
-
const currentLang = this.locale.getLocaleOptions().locale || 'pt-BR';
|
|
12622
|
-
this.
|
|
12623
|
-
this.
|
|
12695
|
+
const currentLang = ((_a = this.locale.getLocaleOptions()) === null || _a === void 0 ? void 0 : _a.locale) || 'pt-BR';
|
|
12696
|
+
this.setActiveVoice(_voices, currentLang);
|
|
12697
|
+
this.locale.getLocale().subscribe((locale) => {
|
|
12698
|
+
this.setActiveVoice(_voices, locale);
|
|
12699
|
+
});
|
|
12624
12700
|
});
|
|
12625
12701
|
};
|
|
12626
12702
|
}
|
|
@@ -12661,6 +12737,12 @@ let TextToSpeechService = class TextToSpeechService {
|
|
|
12661
12737
|
get hasVoice() {
|
|
12662
12738
|
return !!this.activeVoice;
|
|
12663
12739
|
}
|
|
12740
|
+
setActiveVoice(voices, lang) {
|
|
12741
|
+
const _voice = voices.find((voice) => voice.lang === lang);
|
|
12742
|
+
if (_voice) {
|
|
12743
|
+
this.activeVoice = _voice;
|
|
12744
|
+
}
|
|
12745
|
+
}
|
|
12664
12746
|
};
|
|
12665
12747
|
TextToSpeechService.ctorParameters = () => [
|
|
12666
12748
|
{ type: LocaleService },
|
|
@@ -12683,19 +12765,11 @@ let SpeechRecognitionComponent = class SpeechRecognitionComponent {
|
|
|
12683
12765
|
this.isDoneSpeaking = false;
|
|
12684
12766
|
this.onDestroy$ = new Subject();
|
|
12685
12767
|
this.VOICE_SPEEDS = [0.5, 1, 1.5, 2];
|
|
12686
|
-
this.SPEECH_RECOGNITION_MARGIN_OFFSET = 13;
|
|
12687
12768
|
this.keydownEventListener = (event) => {
|
|
12688
12769
|
if (this.disabled) {
|
|
12689
12770
|
event.preventDefault();
|
|
12690
12771
|
}
|
|
12691
12772
|
};
|
|
12692
|
-
this.TEXT_AREA_ELEMENT_MUTATION_OBSERVER = new MutationObserver(() => {
|
|
12693
|
-
this.SPEECH_CONTAINER_WIDTH_CALLBACK();
|
|
12694
|
-
});
|
|
12695
|
-
this.SPEECH_CONTAINER_WIDTH_CALLBACK = () => {
|
|
12696
|
-
this.setSpeechContainerWidth();
|
|
12697
|
-
};
|
|
12698
|
-
this.speechRecognitionContainerWidth = 0;
|
|
12699
12773
|
this.disabled = false;
|
|
12700
12774
|
this.isSpeaking = false;
|
|
12701
12775
|
this.voiceSpeed = 1;
|
|
@@ -12715,14 +12789,6 @@ let SpeechRecognitionComponent = class SpeechRecognitionComponent {
|
|
|
12715
12789
|
}
|
|
12716
12790
|
this.textAreaElement.placeholder = this.translateService.instant("platform.angular_components.text_area_speech_recognition_placeholder");
|
|
12717
12791
|
this.textAreaElement.addEventListener('keydown', this.keydownEventListener);
|
|
12718
|
-
const config = { attributes: true, childList: true, subtree: true };
|
|
12719
|
-
this.TEXT_AREA_ELEMENT_MUTATION_OBSERVER.observe(this.textAreaElement, config);
|
|
12720
|
-
window.addEventListener('resize', this.SPEECH_CONTAINER_WIDTH_CALLBACK);
|
|
12721
|
-
}
|
|
12722
|
-
ngAfterViewInit() {
|
|
12723
|
-
setTimeout(() => {
|
|
12724
|
-
this.setSpeechContainerWidth();
|
|
12725
|
-
});
|
|
12726
12792
|
}
|
|
12727
12793
|
onListen() {
|
|
12728
12794
|
if (this.isDisabledMicrophone || this.isListening) {
|
|
@@ -12794,9 +12860,6 @@ let SpeechRecognitionComponent = class SpeechRecognitionComponent {
|
|
|
12794
12860
|
ngOnDestroy() {
|
|
12795
12861
|
this.onDestroy$.next();
|
|
12796
12862
|
this.onDestroy$.complete();
|
|
12797
|
-
this.textAreaElement.removeEventListener('keydown', this.keydownEventListener);
|
|
12798
|
-
window.removeEventListener('resize', this.SPEECH_CONTAINER_WIDTH_CALLBACK);
|
|
12799
|
-
this.TEXT_AREA_ELEMENT_MUTATION_OBSERVER.disconnect();
|
|
12800
12863
|
}
|
|
12801
12864
|
toggleTextToSpeech() {
|
|
12802
12865
|
if (this.isPlayingTextToSpeech) {
|
|
@@ -12844,9 +12907,6 @@ let SpeechRecognitionComponent = class SpeechRecognitionComponent {
|
|
|
12844
12907
|
this.isDoneSpeaking = true;
|
|
12845
12908
|
});
|
|
12846
12909
|
}
|
|
12847
|
-
setSpeechContainerWidth() {
|
|
12848
|
-
this.speechRecognitionContainerWidth = this.textAreaElement.getBoundingClientRect().width - this.SPEECH_RECOGNITION_MARGIN_OFFSET;
|
|
12849
|
-
}
|
|
12850
12910
|
};
|
|
12851
12911
|
SpeechRecognitionComponent.ctorParameters = () => [
|
|
12852
12912
|
{ type: SpeechRecognitionService },
|
|
@@ -12862,8 +12922,8 @@ __decorate([
|
|
|
12862
12922
|
SpeechRecognitionComponent = __decorate([
|
|
12863
12923
|
Component({
|
|
12864
12924
|
selector: 's-speech-recognition',
|
|
12865
|
-
template: "<section class=\"speech-recognition\"
|
|
12866
|
-
styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-item-toolbar span{height:25px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
|
|
12925
|
+
template: "<section class=\"speech-recognition\">\n <div class=\"speech-recognition-text\">\n <ng-container *ngIf=\"canRenderMicrophone\">\n {{ 'platform.angular_components.text_area_before_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"isSpeaking\">\n {{ 'platform.angular_components.text_area_while_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"canRenderAprove && canRenderDiscard\">\n {{ 'platform.angular_components.text_area_end_speech' | translate }}\n </ng-container>\n </div>\n <div class=\"speech-recognition-buttons\">\n <span\n *ngIf=\"canRenderListeningText\"\n (click)=\"stopListening()\"\n class=\"speech-recognition-item speech-recognition-item-regular\">\n <i class=\"far fa-ellipsis-h\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderMicrophone\"\n (click)=\"onListen()\"\n class=\"speech-recognition-item speech-recognition-item-microphone\"\n [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n <i class=\"fas fa-microphone\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderAprove\"\n (click)=\"onAprove()\"\n class=\"speech-recognition-item speech-recognition-item-aprove\">\n <i class=\"fas fa-check\"></i>\n </span>\n\n <span *ngIf=\"canRenderDiscard\"\n (click)=\"onDiscard()\"\n class=\"speech-recognition-item speech-recognition-item-discard\">\n <i class=\"fas fa-times\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeech\"\n (click)=\"onOpenToolbar()\"\n class=\"speech-recognition-item speech-recognition-item-regular\"\n [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n <i class=\"fas fa-volume-down\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeechToolbar\"\n class=\"speech-recognition-item-toolbar\">\n <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n (click)=\"toggleTextToSpeech()\"></i>\n <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n <span (click)=\"updateVoiceSpeed()\">\n {{ voiceSpeed }}x\n </span>\n <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n </span>\n </div>\n</section>\n",
|
|
12926
|
+
styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between;width:100%}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-item-toolbar span{height:25px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
|
|
12867
12927
|
})
|
|
12868
12928
|
], SpeechRecognitionComponent);
|
|
12869
12929
|
|
|
@@ -16496,6 +16556,7 @@ let TextAreaIAComponent = TextAreaIAComponent_1 = class TextAreaIAComponent {
|
|
|
16496
16556
|
this._iassistService = _iassistService;
|
|
16497
16557
|
this._formBuilder = _formBuilder;
|
|
16498
16558
|
this._translateService = _translateService;
|
|
16559
|
+
this.speechRecognition = false;
|
|
16499
16560
|
this.isVisible = false;
|
|
16500
16561
|
this.isLoading = false;
|
|
16501
16562
|
}
|
|
@@ -16558,6 +16619,7 @@ let TextAreaIAComponent = TextAreaIAComponent_1 = class TextAreaIAComponent {
|
|
|
16558
16619
|
type: FieldType.Text,
|
|
16559
16620
|
label: this._translateService.instant("platform.angular_components.context"),
|
|
16560
16621
|
size: { sm: 12, md: 12, lg: 12, xl: 12 },
|
|
16622
|
+
speechRecognition: this.speechRecognition
|
|
16561
16623
|
}),
|
|
16562
16624
|
];
|
|
16563
16625
|
}
|
|
@@ -16593,10 +16655,13 @@ __decorate([
|
|
|
16593
16655
|
__decorate([
|
|
16594
16656
|
Input()
|
|
16595
16657
|
], TextAreaIAComponent.prototype, "cols", void 0);
|
|
16658
|
+
__decorate([
|
|
16659
|
+
Input()
|
|
16660
|
+
], TextAreaIAComponent.prototype, "speechRecognition", void 0);
|
|
16596
16661
|
TextAreaIAComponent = TextAreaIAComponent_1 = __decorate([
|
|
16597
16662
|
Component({
|
|
16598
16663
|
selector: "s-text-area-ia",
|
|
16599
|
-
template: "<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\"
|
|
16664
|
+
template: "<s-loading-state\n [loading]=\"isLoading\"\n [blockWindow]=\"true\">\n</s-loading-state>\n\n<p-dialog\n [(visible)]=\"isVisible\"\n [modal]=\"true\"\n [style]=\"{ width: '50vw' }\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n (onHide)=\"onHideDialog()\">\n <p-header>\n <div class=\"dialog-header\">\n <span class=\"iassist-icon\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </span>\n IAssist - Content Generator\n </div>\n </p-header>\n <s-dynamic-form\n [fields]=\"fields\"\n [form]=\"formGroup\">\n </s-dynamic-form>\n <p-footer>\n <div class=\"footer-content\">\n <s-button\n id=\"-submit-button\"\n type=\"button\"\n [label]=\"'platform.angular_components.generate_text' | translate\"\n (onClick)=\"submitContext()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\">\n </s-button>\n <s-button\n id=\"-cancel-button\"\n type=\"button\"\n priority=\"link\"\n [label]=\"'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\">\n </s-button>\n </div>\n </p-footer>\n</p-dialog>\n\n<div class=\"textarea-ia\">\n <s-textarea\n [inputId]=\"id\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n [readOnly]=\"readonly\"\n [speechRecognition]=\"speechRecognition\"\n ></s-textarea>\n <button\n class=\"iassist-button\"\n [class.speech-recognition]=\"speechRecognition\"\n (click)=\"showDialog()\"\n sTooltip=\"IAssist - Content Generator\">\n <ng-container [ngTemplateOutlet]=\"iassistIcon\"></ng-container>\n </button>\n</div>\n\n<ng-template #iassistIcon>\n <svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n </svg>\n</ng-template>\n",
|
|
16600
16665
|
providers: [
|
|
16601
16666
|
{
|
|
16602
16667
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -16604,7 +16669,7 @@ TextAreaIAComponent = TextAreaIAComponent_1 = __decorate([
|
|
|
16604
16669
|
multi: true,
|
|
16605
16670
|
},
|
|
16606
16671
|
],
|
|
16607
|
-
styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.textarea-ia
|
|
16672
|
+
styles: [".footer-content{display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0}.textarea-ia{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;gap:8px}.textarea-ia s-textarea{width:100%}.iassist-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:none;border-radius:50%;box-shadow:none;cursor:pointer;height:32px;width:32px}.dialog-header{display:-ms-flexbox;display:flex;gap:12px}.dialog-header .iassist-icon{display:block;height:24px;width:24px}.speech-recognition{margin-bottom:12.5px}"]
|
|
16608
16673
|
})
|
|
16609
16674
|
], TextAreaIAComponent);
|
|
16610
16675
|
|
|
@@ -16618,10 +16683,10 @@ TextAreaIAModule = __decorate([
|
|
|
16618
16683
|
ReactiveFormsModule,
|
|
16619
16684
|
TranslateModule,
|
|
16620
16685
|
DialogModule,
|
|
16621
|
-
InputTextareaModule,
|
|
16622
16686
|
ButtonModule,
|
|
16623
16687
|
DynamicFormModule,
|
|
16624
16688
|
LoadingStateModule,
|
|
16689
|
+
TextAreaModule
|
|
16625
16690
|
],
|
|
16626
16691
|
declarations: [TextAreaIAComponent],
|
|
16627
16692
|
exports: [TextAreaIAComponent],
|
|
@@ -21453,9 +21518,9 @@ const fallback = {
|
|
|
21453
21518
|
"platform.angular_components.remove_all": "Remover todos",
|
|
21454
21519
|
"platform.angular_components.country_name_gb": "Reino Unido",
|
|
21455
21520
|
"platform.angular_components.insight_footer": "Conteúdo gerado por inteligência artificial. Sujeito a imprecisões.",
|
|
21456
|
-
"platform.angular_components.text_area_speech_recognition_placeholder": "Preencha o campo
|
|
21457
|
-
"platform.angular_components.text_area_before_speech": "Grave ou ouça o texto clicando nos
|
|
21458
|
-
"platform.angular_components.text_area_while_speech": "Clique novamente no
|
|
21521
|
+
"platform.angular_components.text_area_speech_recognition_placeholder": "Preencha o campo com, pelo menos, uma frase",
|
|
21522
|
+
"platform.angular_components.text_area_before_speech": "Grave ou ouça o texto clicando nos ícones",
|
|
21523
|
+
"platform.angular_components.text_area_while_speech": "Clique novamente no ícone para finalizar",
|
|
21459
21524
|
"platform.angular_components.text_area_end_speech": "Gravação finalizada"
|
|
21460
21525
|
};
|
|
21461
21526
|
|