@flusys/ng-email 3.0.0 → 4.0.0-rc

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.
@@ -1,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, computed, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, computed, signal, effect, Component } from '@angular/core';
3
3
  import { toSignal } from '@angular/core/rxjs-interop';
4
4
  import * as i2 from '@angular/router';
5
5
  import { ActivatedRoute, Router } from '@angular/router';
6
- import { APP_CONFIG, DEFAULT_APP_NAME } from '@flusys/ng-core';
6
+ import { APP_CONFIG, TRANSLATE_ADAPTER, DEFAULT_APP_NAME } from '@flusys/ng-core';
7
7
  import { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';
8
- import { AngularModule, PrimeModule } from '@flusys/ng-shared';
8
+ import { AngularModule, PrimeModule, TranslatePipe } from '@flusys/ng-shared';
9
9
  import { MessageService } from 'primeng/api';
10
10
  import { EmailConfigApiService, EmailProviderEnum } from './flusys-ng-email.mjs';
11
11
  import * as i1 from '@angular/forms';
@@ -27,6 +27,7 @@ class EmailConfigFormComponent {
27
27
  messageService = inject(MessageService);
28
28
  appConfig = inject(APP_CONFIG);
29
29
  companyContext = inject(LAYOUT_AUTH_STATE, { optional: true });
30
+ translateAdapter = inject(TRANSLATE_ADAPTER, { optional: true });
30
31
  // Route params as signal
31
32
  routeParams = toSignal(this.route.paramMap);
32
33
  providerEnum = EmailProviderEnum;
@@ -35,15 +36,15 @@ class EmailConfigFormComponent {
35
36
  isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
36
37
  existingConfig = signal(null, ...(ngDevMode ? [{ debugName: "existingConfig" }] : []));
37
38
  isEditMode = computed(() => !!this.existingConfig(), ...(ngDevMode ? [{ debugName: "isEditMode" }] : []));
38
- providerOptions = [
39
- { label: 'SMTP', value: EmailProviderEnum.SMTP },
40
- { label: 'SendGrid', value: EmailProviderEnum.SENDGRID },
41
- { label: 'Mailgun', value: EmailProviderEnum.MAILGUN },
42
- ];
43
- regionOptions = [
44
- { label: 'US', value: 'us' },
45
- { label: 'EU', value: 'eu' },
46
- ];
39
+ providerOptions = computed(() => [
40
+ { label: this.translate('email.provider.smtp'), value: EmailProviderEnum.SMTP },
41
+ { label: this.translate('email.provider.sendgrid'), value: EmailProviderEnum.SENDGRID },
42
+ { label: this.translate('email.provider.mailgun'), value: EmailProviderEnum.MAILGUN },
43
+ ], ...(ngDevMode ? [{ debugName: "providerOptions" }] : []));
44
+ regionOptions = computed(() => [
45
+ { label: this.translate('email.region.us'), value: 'us' },
46
+ { label: this.translate('email.region.eu'), value: 'eu' },
47
+ ], ...(ngDevMode ? [{ debugName: "regionOptions" }] : []));
47
48
  /** Form model as signal for zoneless change detection */
48
49
  _formModel = signal({
49
50
  id: '',
@@ -96,6 +97,9 @@ class EmailConfigFormComponent {
96
97
  this._formModel.set(this.mapConfigToFormModel(emailConfig));
97
98
  }
98
99
  }
100
+ catch {
101
+ // Error toast handled by global interceptor
102
+ }
99
103
  finally {
100
104
  this.isLoading.set(false);
101
105
  }
@@ -157,8 +161,8 @@ class EmailConfigFormComponent {
157
161
  if (!this.formModel.name || !this.formModel.provider) {
158
162
  this.messageService.add({
159
163
  severity: 'warn',
160
- summary: 'Validation',
161
- detail: 'Please fill in all required fields.',
164
+ summary: this.translate('common.validation'),
165
+ detail: this.translate('common.fill.required.fields'),
162
166
  });
163
167
  return;
164
168
  }
@@ -173,8 +177,8 @@ class EmailConfigFormComponent {
173
177
  }
174
178
  this.messageService.add({
175
179
  severity: 'success',
176
- summary: 'Success',
177
- detail: `Configuration ${this.isEditMode() ? 'updated' : 'created'} successfully.`,
180
+ summary: this.translate('common.success'),
181
+ detail: this.translate(this.isEditMode() ? 'email.config.updated' : 'email.config.created'),
178
182
  });
179
183
  this.router.navigate(['../'], { relativeTo: this.route });
180
184
  }
@@ -185,6 +189,9 @@ class EmailConfigFormComponent {
185
189
  this.isLoading.set(false);
186
190
  }
187
191
  }
192
+ translate(key, variables) {
193
+ return this.translateAdapter?.translate(key, variables) ?? key;
194
+ }
188
195
  buildSaveDto() {
189
196
  return {
190
197
  name: this.formModel.name,
@@ -203,11 +210,11 @@ class EmailConfigFormComponent {
203
210
  <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4">
204
211
  <div>
205
212
  <h3 class="text-lg sm:text-xl font-semibold m-0">
206
- {{ isEditMode() ? 'Edit Configuration' : 'New Configuration' }}
213
+ {{ (isEditMode() ? 'email.config.edit.title' : 'email.config.new.title') | translate }}
207
214
  </h3>
208
215
  @if (showCompanyInfo()) {
209
216
  <p class="text-sm text-muted-color mt-1">
210
- Company: {{ currentCompanyName() }}
217
+ {{ 'common.company' | translate }}: {{ currentCompanyName() }}
211
218
  </p>
212
219
  }
213
220
  </div>
@@ -218,7 +225,7 @@ class EmailConfigFormComponent {
218
225
  <!-- Common Fields -->
219
226
  <div class="field">
220
227
  <label for="name" class="block font-medium mb-2"
221
- >Configuration Name *</label
228
+ >{{ 'email.config.name' | translate }} *</label
222
229
  >
223
230
  <input
224
231
  pInputText
@@ -226,29 +233,29 @@ class EmailConfigFormComponent {
226
233
  [ngModel]="formModel.name"
227
234
  (ngModelChange)="updateFormModel('name', $event)"
228
235
  class="w-full"
229
- placeholder="e.g., Production SMTP"
236
+ [placeholder]="'email.config.name.example' | translate"
230
237
  />
231
238
  </div>
232
239
 
233
240
  <div class="field">
234
241
  <label for="provider" class="block font-medium mb-2"
235
- >Email Provider *</label
242
+ >{{ 'email.config.provider' | translate }} *</label
236
243
  >
237
244
  <p-select
238
245
  id="provider"
239
- [options]="providerOptions"
246
+ [options]="providerOptions()"
240
247
  [ngModel]="formModel.provider"
241
248
  (ngModelChange)="updateFormModel('provider', $event)"
242
249
  optionLabel="label"
243
250
  optionValue="value"
244
- placeholder="Select provider"
251
+ [placeholder]="'email.config.select.provider' | translate"
245
252
  class="w-full"
246
253
  />
247
254
  </div>
248
255
 
249
256
  <div class="field">
250
257
  <label for="fromEmail" class="block font-medium mb-2"
251
- >From Email</label
258
+ >{{ 'email.config.from.email' | translate }}</label
252
259
  >
253
260
  <input
254
261
  pInputText
@@ -256,13 +263,13 @@ class EmailConfigFormComponent {
256
263
  [ngModel]="formModel.fromEmail"
257
264
  (ngModelChange)="updateFormModel('fromEmail', $event)"
258
265
  class="w-full"
259
- placeholder="noreply@example.com"
266
+ [placeholder]="'email.config.from.email.example' | translate"
260
267
  />
261
268
  </div>
262
269
 
263
270
  <div class="field">
264
271
  <label for="fromName" class="block font-medium mb-2"
265
- >From Name</label
272
+ >{{ 'email.config.from.name' | translate }}</label
266
273
  >
267
274
  <input
268
275
  pInputText
@@ -270,29 +277,29 @@ class EmailConfigFormComponent {
270
277
  [ngModel]="formModel.fromName"
271
278
  (ngModelChange)="updateFormModel('fromName', $event)"
272
279
  class="w-full"
273
- placeholder="FLUSYS"
280
+ [placeholder]="'email.config.from.name.example' | translate"
274
281
  />
275
282
  </div>
276
283
 
277
284
  <div class="field flex items-center gap-2">
278
285
  <p-toggleswitch [ngModel]="formModel.isActive" (ngModelChange)="updateFormModel('isActive', $event)" />
279
- <label>Active</label>
286
+ <label>{{ 'common.active' | translate }}</label>
280
287
  </div>
281
288
 
282
289
  <div class="field flex items-center gap-2">
283
290
  <p-toggleswitch [ngModel]="formModel.isDefault" (ngModelChange)="updateFormModel('isDefault', $event)" />
284
- <label>Set as Default</label>
291
+ <label>{{ 'email.config.set.as.default' | translate }}</label>
285
292
  </div>
286
293
  </div>
287
294
 
288
295
  <!-- SMTP Fields -->
289
296
  @if (formModel.provider === providerEnum.SMTP) {
290
297
  <div class="border-t border-surface mt-4 pt-4">
291
- <h3 class="font-semibold mb-4">SMTP Settings</h3>
298
+ <h3 class="font-semibold mb-4">{{ 'email.config.smtp.settings' | translate }}</h3>
292
299
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
293
300
  <div class="field">
294
301
  <label for="smtpHost" class="block font-medium mb-2"
295
- >SMTP Host *</label
302
+ >{{ 'email.config.smtp.host' | translate }} *</label
296
303
  >
297
304
  <input
298
305
  pInputText
@@ -300,12 +307,12 @@ class EmailConfigFormComponent {
300
307
  [ngModel]="formModel.smtpHost"
301
308
  (ngModelChange)="updateFormModel('smtpHost', $event)"
302
309
  class="w-full"
303
- placeholder="smtp.gmail.com"
310
+ [placeholder]="'email.config.smtp.host.example' | translate"
304
311
  />
305
312
  </div>
306
313
  <div class="field">
307
314
  <label for="smtpPort" class="block font-medium mb-2"
308
- >Port *</label
315
+ >{{ 'email.config.port' | translate }} *</label
309
316
  >
310
317
  <p-inputNumber
311
318
  id="smtpPort"
@@ -313,12 +320,12 @@ class EmailConfigFormComponent {
313
320
  (ngModelChange)="updateFormModel('smtpPort', $event)"
314
321
  [useGrouping]="false"
315
322
  class="w-full"
316
- placeholder="587"
323
+ [placeholder]="'email.config.smtp.port.example' | translate"
317
324
  />
318
325
  </div>
319
326
  <div class="field">
320
327
  <label for="smtpUser" class="block font-medium mb-2"
321
- >Username *</label
328
+ >{{ 'email.config.username' | translate }} *</label
322
329
  >
323
330
  <input
324
331
  pInputText
@@ -326,12 +333,12 @@ class EmailConfigFormComponent {
326
333
  [ngModel]="formModel.smtpUser"
327
334
  (ngModelChange)="updateFormModel('smtpUser', $event)"
328
335
  class="w-full"
329
- placeholder="user@gmail.com"
336
+ [placeholder]="'email.config.smtp.user.example' | translate"
330
337
  />
331
338
  </div>
332
339
  <div class="field">
333
340
  <label for="smtpPass" class="block font-medium mb-2"
334
- >Password *</label
341
+ >{{ 'email.config.password' | translate }} *</label
335
342
  >
336
343
  <p-password
337
344
  id="smtpPass"
@@ -341,12 +348,12 @@ class EmailConfigFormComponent {
341
348
  [toggleMask]="true"
342
349
  styleClass="w-full"
343
350
  inputStyleClass="w-full"
344
- placeholder="App password"
351
+ [placeholder]="'email.config.smtp.password.example' | translate"
345
352
  />
346
353
  </div>
347
354
  <div class="field flex items-center gap-2">
348
355
  <p-toggleswitch [ngModel]="formModel.smtpSecure" (ngModelChange)="updateFormModel('smtpSecure', $event)" />
349
- <label>Use SSL/TLS (Port 465)</label>
356
+ <label>{{ 'email.config.use.ssl.tls' | translate }}</label>
350
357
  </div>
351
358
  </div>
352
359
  </div>
@@ -355,11 +362,11 @@ class EmailConfigFormComponent {
355
362
  <!-- SendGrid Fields -->
356
363
  @if (formModel.provider === providerEnum.SENDGRID) {
357
364
  <div class="border-t border-surface mt-4 pt-4">
358
- <h3 class="font-semibold mb-4">SendGrid Settings</h3>
365
+ <h3 class="font-semibold mb-4">{{ 'email.config.sendgrid.settings' | translate }}</h3>
359
366
  <div class="grid grid-cols-1 gap-4">
360
367
  <div class="field">
361
368
  <label for="sendgridApiKey" class="block font-medium mb-2"
362
- >API Key *</label
369
+ >{{ 'email.config.api.key' | translate }} *</label
363
370
  >
364
371
  <p-password
365
372
  id="sendgridApiKey"
@@ -369,7 +376,7 @@ class EmailConfigFormComponent {
369
376
  [toggleMask]="true"
370
377
  styleClass="w-full"
371
378
  inputStyleClass="w-full"
372
- placeholder="SG.xxxx..."
379
+ [placeholder]="'email.config.sendgrid.api.key.example' | translate"
373
380
  />
374
381
  </div>
375
382
  </div>
@@ -379,11 +386,11 @@ class EmailConfigFormComponent {
379
386
  <!-- Mailgun Fields -->
380
387
  @if (formModel.provider === providerEnum.MAILGUN) {
381
388
  <div class="border-t border-surface mt-4 pt-4">
382
- <h3 class="font-semibold mb-4">Mailgun Settings</h3>
389
+ <h3 class="font-semibold mb-4">{{ 'email.config.mailgun.settings' | translate }}</h3>
383
390
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
384
391
  <div class="field">
385
392
  <label for="mailgunApiKey" class="block font-medium mb-2"
386
- >API Key *</label
393
+ >{{ 'email.config.api.key' | translate }} *</label
387
394
  >
388
395
  <p-password
389
396
  id="mailgunApiKey"
@@ -393,12 +400,12 @@ class EmailConfigFormComponent {
393
400
  [toggleMask]="true"
394
401
  styleClass="w-full"
395
402
  inputStyleClass="w-full"
396
- placeholder="key-xxxx..."
403
+ [placeholder]="'email.config.mailgun.api.key.example' | translate"
397
404
  />
398
405
  </div>
399
406
  <div class="field">
400
407
  <label for="mailgunDomain" class="block font-medium mb-2"
401
- >Domain *</label
408
+ >{{ 'email.config.domain' | translate }} *</label
402
409
  >
403
410
  <input
404
411
  pInputText
@@ -406,21 +413,21 @@ class EmailConfigFormComponent {
406
413
  [ngModel]="formModel.mailgunDomain"
407
414
  (ngModelChange)="updateFormModel('mailgunDomain', $event)"
408
415
  class="w-full"
409
- placeholder="mg.example.com"
416
+ [placeholder]="'email.config.mailgun.domain.example' | translate"
410
417
  />
411
418
  </div>
412
419
  <div class="field">
413
420
  <label for="mailgunRegion" class="block font-medium mb-2"
414
- >Region</label
421
+ >{{ 'email.config.region' | translate }}</label
415
422
  >
416
423
  <p-select
417
424
  id="mailgunRegion"
418
- [options]="regionOptions"
425
+ [options]="regionOptions()"
419
426
  [ngModel]="formModel.mailgunRegion"
420
427
  (ngModelChange)="updateFormModel('mailgunRegion', $event)"
421
428
  optionLabel="label"
422
429
  optionValue="value"
423
- placeholder="Select region"
430
+ [placeholder]="'email.config.select.region' | translate"
424
431
  class="w-full"
425
432
  />
426
433
  </div>
@@ -431,13 +438,13 @@ class EmailConfigFormComponent {
431
438
  <!-- Form Actions -->
432
439
  <div class="flex justify-end gap-2 mt-6 pt-4 border-t border-surface">
433
440
  <p-button
434
- label="Cancel"
441
+ [label]="'common.cancel' | translate"
435
442
  severity="secondary"
436
443
  [outlined]="true"
437
444
  routerLink="../"
438
445
  />
439
446
  <p-button
440
- [label]="isEditMode() ? 'Update' : 'Create'"
447
+ [label]="(isEditMode() ? 'common.update' : 'common.create') | translate"
441
448
  icon="pi pi-save"
442
449
  [loading]="isLoading()"
443
450
  (onClick)="onSave()"
@@ -446,14 +453,13 @@ class EmailConfigFormComponent {
446
453
  </div>
447
454
 
448
455
  <p-toast />
449
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i6.Password, selector: "p-password", inputs: ["ariaLabel", "ariaLabelledBy", "label", "promptLabel", "mediumRegex", "strongRegex", "weakLabel", "mediumLabel", "maxLength", "strongLabel", "inputId", "feedback", "toggleMask", "inputStyleClass", "styleClass", "inputStyle", "showTransitionOptions", "hideTransitionOptions", "autocomplete", "placeholder", "showClear", "autofocus", "tabindex", "appendTo", "motionOptions", "overlayOptions"], outputs: ["onFocus", "onBlur", "onClear"] }, { kind: "component", type: i6$1.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i8.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i8$1.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
456
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i2$1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i6.Password, selector: "p-password", inputs: ["ariaLabel", "ariaLabelledBy", "label", "promptLabel", "mediumRegex", "strongRegex", "weakLabel", "mediumLabel", "maxLength", "strongLabel", "inputId", "feedback", "toggleMask", "inputStyleClass", "styleClass", "inputStyle", "showTransitionOptions", "hideTransitionOptions", "autocomplete", "placeholder", "showClear", "autofocus", "tabindex", "appendTo", "motionOptions", "overlayOptions"], outputs: ["onFocus", "onBlur", "onClear"] }, { kind: "component", type: i6$1.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i8.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "motionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i8$1.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
450
457
  }
451
458
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: EmailConfigFormComponent, decorators: [{
452
459
  type: Component,
453
460
  args: [{
454
461
  selector: 'lib-email-config-form',
455
- changeDetection: ChangeDetectionStrategy.OnPush,
456
- imports: [AngularModule, PrimeModule],
462
+ imports: [AngularModule, PrimeModule, TranslatePipe],
457
463
  providers: [MessageService],
458
464
  template: `
459
465
  <div class="card">
@@ -461,11 +467,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
461
467
  <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4">
462
468
  <div>
463
469
  <h3 class="text-lg sm:text-xl font-semibold m-0">
464
- {{ isEditMode() ? 'Edit Configuration' : 'New Configuration' }}
470
+ {{ (isEditMode() ? 'email.config.edit.title' : 'email.config.new.title') | translate }}
465
471
  </h3>
466
472
  @if (showCompanyInfo()) {
467
473
  <p class="text-sm text-muted-color mt-1">
468
- Company: {{ currentCompanyName() }}
474
+ {{ 'common.company' | translate }}: {{ currentCompanyName() }}
469
475
  </p>
470
476
  }
471
477
  </div>
@@ -476,7 +482,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
476
482
  <!-- Common Fields -->
477
483
  <div class="field">
478
484
  <label for="name" class="block font-medium mb-2"
479
- >Configuration Name *</label
485
+ >{{ 'email.config.name' | translate }} *</label
480
486
  >
481
487
  <input
482
488
  pInputText
@@ -484,29 +490,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
484
490
  [ngModel]="formModel.name"
485
491
  (ngModelChange)="updateFormModel('name', $event)"
486
492
  class="w-full"
487
- placeholder="e.g., Production SMTP"
493
+ [placeholder]="'email.config.name.example' | translate"
488
494
  />
489
495
  </div>
490
496
 
491
497
  <div class="field">
492
498
  <label for="provider" class="block font-medium mb-2"
493
- >Email Provider *</label
499
+ >{{ 'email.config.provider' | translate }} *</label
494
500
  >
495
501
  <p-select
496
502
  id="provider"
497
- [options]="providerOptions"
503
+ [options]="providerOptions()"
498
504
  [ngModel]="formModel.provider"
499
505
  (ngModelChange)="updateFormModel('provider', $event)"
500
506
  optionLabel="label"
501
507
  optionValue="value"
502
- placeholder="Select provider"
508
+ [placeholder]="'email.config.select.provider' | translate"
503
509
  class="w-full"
504
510
  />
505
511
  </div>
506
512
 
507
513
  <div class="field">
508
514
  <label for="fromEmail" class="block font-medium mb-2"
509
- >From Email</label
515
+ >{{ 'email.config.from.email' | translate }}</label
510
516
  >
511
517
  <input
512
518
  pInputText
@@ -514,13 +520,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
514
520
  [ngModel]="formModel.fromEmail"
515
521
  (ngModelChange)="updateFormModel('fromEmail', $event)"
516
522
  class="w-full"
517
- placeholder="noreply@example.com"
523
+ [placeholder]="'email.config.from.email.example' | translate"
518
524
  />
519
525
  </div>
520
526
 
521
527
  <div class="field">
522
528
  <label for="fromName" class="block font-medium mb-2"
523
- >From Name</label
529
+ >{{ 'email.config.from.name' | translate }}</label
524
530
  >
525
531
  <input
526
532
  pInputText
@@ -528,29 +534,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
528
534
  [ngModel]="formModel.fromName"
529
535
  (ngModelChange)="updateFormModel('fromName', $event)"
530
536
  class="w-full"
531
- placeholder="FLUSYS"
537
+ [placeholder]="'email.config.from.name.example' | translate"
532
538
  />
533
539
  </div>
534
540
 
535
541
  <div class="field flex items-center gap-2">
536
542
  <p-toggleswitch [ngModel]="formModel.isActive" (ngModelChange)="updateFormModel('isActive', $event)" />
537
- <label>Active</label>
543
+ <label>{{ 'common.active' | translate }}</label>
538
544
  </div>
539
545
 
540
546
  <div class="field flex items-center gap-2">
541
547
  <p-toggleswitch [ngModel]="formModel.isDefault" (ngModelChange)="updateFormModel('isDefault', $event)" />
542
- <label>Set as Default</label>
548
+ <label>{{ 'email.config.set.as.default' | translate }}</label>
543
549
  </div>
544
550
  </div>
545
551
 
546
552
  <!-- SMTP Fields -->
547
553
  @if (formModel.provider === providerEnum.SMTP) {
548
554
  <div class="border-t border-surface mt-4 pt-4">
549
- <h3 class="font-semibold mb-4">SMTP Settings</h3>
555
+ <h3 class="font-semibold mb-4">{{ 'email.config.smtp.settings' | translate }}</h3>
550
556
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
551
557
  <div class="field">
552
558
  <label for="smtpHost" class="block font-medium mb-2"
553
- >SMTP Host *</label
559
+ >{{ 'email.config.smtp.host' | translate }} *</label
554
560
  >
555
561
  <input
556
562
  pInputText
@@ -558,12 +564,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
558
564
  [ngModel]="formModel.smtpHost"
559
565
  (ngModelChange)="updateFormModel('smtpHost', $event)"
560
566
  class="w-full"
561
- placeholder="smtp.gmail.com"
567
+ [placeholder]="'email.config.smtp.host.example' | translate"
562
568
  />
563
569
  </div>
564
570
  <div class="field">
565
571
  <label for="smtpPort" class="block font-medium mb-2"
566
- >Port *</label
572
+ >{{ 'email.config.port' | translate }} *</label
567
573
  >
568
574
  <p-inputNumber
569
575
  id="smtpPort"
@@ -571,12 +577,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
571
577
  (ngModelChange)="updateFormModel('smtpPort', $event)"
572
578
  [useGrouping]="false"
573
579
  class="w-full"
574
- placeholder="587"
580
+ [placeholder]="'email.config.smtp.port.example' | translate"
575
581
  />
576
582
  </div>
577
583
  <div class="field">
578
584
  <label for="smtpUser" class="block font-medium mb-2"
579
- >Username *</label
585
+ >{{ 'email.config.username' | translate }} *</label
580
586
  >
581
587
  <input
582
588
  pInputText
@@ -584,12 +590,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
584
590
  [ngModel]="formModel.smtpUser"
585
591
  (ngModelChange)="updateFormModel('smtpUser', $event)"
586
592
  class="w-full"
587
- placeholder="user@gmail.com"
593
+ [placeholder]="'email.config.smtp.user.example' | translate"
588
594
  />
589
595
  </div>
590
596
  <div class="field">
591
597
  <label for="smtpPass" class="block font-medium mb-2"
592
- >Password *</label
598
+ >{{ 'email.config.password' | translate }} *</label
593
599
  >
594
600
  <p-password
595
601
  id="smtpPass"
@@ -599,12 +605,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
599
605
  [toggleMask]="true"
600
606
  styleClass="w-full"
601
607
  inputStyleClass="w-full"
602
- placeholder="App password"
608
+ [placeholder]="'email.config.smtp.password.example' | translate"
603
609
  />
604
610
  </div>
605
611
  <div class="field flex items-center gap-2">
606
612
  <p-toggleswitch [ngModel]="formModel.smtpSecure" (ngModelChange)="updateFormModel('smtpSecure', $event)" />
607
- <label>Use SSL/TLS (Port 465)</label>
613
+ <label>{{ 'email.config.use.ssl.tls' | translate }}</label>
608
614
  </div>
609
615
  </div>
610
616
  </div>
@@ -613,11 +619,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
613
619
  <!-- SendGrid Fields -->
614
620
  @if (formModel.provider === providerEnum.SENDGRID) {
615
621
  <div class="border-t border-surface mt-4 pt-4">
616
- <h3 class="font-semibold mb-4">SendGrid Settings</h3>
622
+ <h3 class="font-semibold mb-4">{{ 'email.config.sendgrid.settings' | translate }}</h3>
617
623
  <div class="grid grid-cols-1 gap-4">
618
624
  <div class="field">
619
625
  <label for="sendgridApiKey" class="block font-medium mb-2"
620
- >API Key *</label
626
+ >{{ 'email.config.api.key' | translate }} *</label
621
627
  >
622
628
  <p-password
623
629
  id="sendgridApiKey"
@@ -627,7 +633,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
627
633
  [toggleMask]="true"
628
634
  styleClass="w-full"
629
635
  inputStyleClass="w-full"
630
- placeholder="SG.xxxx..."
636
+ [placeholder]="'email.config.sendgrid.api.key.example' | translate"
631
637
  />
632
638
  </div>
633
639
  </div>
@@ -637,11 +643,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
637
643
  <!-- Mailgun Fields -->
638
644
  @if (formModel.provider === providerEnum.MAILGUN) {
639
645
  <div class="border-t border-surface mt-4 pt-4">
640
- <h3 class="font-semibold mb-4">Mailgun Settings</h3>
646
+ <h3 class="font-semibold mb-4">{{ 'email.config.mailgun.settings' | translate }}</h3>
641
647
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
642
648
  <div class="field">
643
649
  <label for="mailgunApiKey" class="block font-medium mb-2"
644
- >API Key *</label
650
+ >{{ 'email.config.api.key' | translate }} *</label
645
651
  >
646
652
  <p-password
647
653
  id="mailgunApiKey"
@@ -651,12 +657,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
651
657
  [toggleMask]="true"
652
658
  styleClass="w-full"
653
659
  inputStyleClass="w-full"
654
- placeholder="key-xxxx..."
660
+ [placeholder]="'email.config.mailgun.api.key.example' | translate"
655
661
  />
656
662
  </div>
657
663
  <div class="field">
658
664
  <label for="mailgunDomain" class="block font-medium mb-2"
659
- >Domain *</label
665
+ >{{ 'email.config.domain' | translate }} *</label
660
666
  >
661
667
  <input
662
668
  pInputText
@@ -664,21 +670,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
664
670
  [ngModel]="formModel.mailgunDomain"
665
671
  (ngModelChange)="updateFormModel('mailgunDomain', $event)"
666
672
  class="w-full"
667
- placeholder="mg.example.com"
673
+ [placeholder]="'email.config.mailgun.domain.example' | translate"
668
674
  />
669
675
  </div>
670
676
  <div class="field">
671
677
  <label for="mailgunRegion" class="block font-medium mb-2"
672
- >Region</label
678
+ >{{ 'email.config.region' | translate }}</label
673
679
  >
674
680
  <p-select
675
681
  id="mailgunRegion"
676
- [options]="regionOptions"
682
+ [options]="regionOptions()"
677
683
  [ngModel]="formModel.mailgunRegion"
678
684
  (ngModelChange)="updateFormModel('mailgunRegion', $event)"
679
685
  optionLabel="label"
680
686
  optionValue="value"
681
- placeholder="Select region"
687
+ [placeholder]="'email.config.select.region' | translate"
682
688
  class="w-full"
683
689
  />
684
690
  </div>
@@ -689,13 +695,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
689
695
  <!-- Form Actions -->
690
696
  <div class="flex justify-end gap-2 mt-6 pt-4 border-t border-surface">
691
697
  <p-button
692
- label="Cancel"
698
+ [label]="'common.cancel' | translate"
693
699
  severity="secondary"
694
700
  [outlined]="true"
695
701
  routerLink="../"
696
702
  />
697
703
  <p-button
698
- [label]="isEditMode() ? 'Update' : 'Create'"
704
+ [label]="(isEditMode() ? 'common.update' : 'common.create') | translate"
699
705
  icon="pi pi-save"
700
706
  [loading]="isLoading()"
701
707
  (onClick)="onSave()"
@@ -709,4 +715,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
709
715
  }], ctorParameters: () => [] });
710
716
 
711
717
  export { EmailConfigFormComponent };
712
- //# sourceMappingURL=flusys-ng-email-email-config-form.component-tg4pKP7G.mjs.map
718
+ //# sourceMappingURL=flusys-ng-email-email-config-form.component-Cj2U6Tgf.mjs.map