ui-core-abv 0.6.71 → 0.6.72
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/fesm2022/ui-core-abv.mjs +345 -12
- package/fesm2022/ui-core-abv.mjs.map +1 -1
- package/lib/components/dynamic-form/form-wrapper/form-wrapper.component.d.ts +27 -2
- package/lib/components/dynamic-form/form.models.d.ts +16 -0
- package/lib/components/user-formbuilder/user-formbuilder.component.d.ts +1 -0
- package/lib/translate/dictionary.en.d.ts +12 -0
- package/lib/translate/dictionary.es.d.ts +12 -0
- package/package.json +1 -1
package/fesm2022/ui-core-abv.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
|
|
|
4
4
|
import { Input, Component, EventEmitter, Output, Directive, forwardRef, InjectionToken, Optional, Inject, Injectable, inject, ChangeDetectorRef, Pipe, ViewContainerRef, ElementRef, ViewChild, createComponent, HostListener, ViewChildren, Host, DestroyRef, signal, computed, effect, TemplateRef, ContentChild, Injector, EnvironmentInjector, HostBinding, input, output } from '@angular/core';
|
|
5
5
|
import * as i1$1 from '@angular/forms';
|
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
|
|
7
|
-
import { BehaviorSubject, Subject, debounceTime, distinctUntilChanged, tap, switchMap, of, finalize, Subscription } from 'rxjs';
|
|
7
|
+
import { BehaviorSubject, Subject, debounceTime, distinctUntilChanged, tap, switchMap, of, finalize, isObservable, from, Subscription } from 'rxjs';
|
|
8
8
|
import { HttpClient } from '@angular/common/http';
|
|
9
9
|
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
|
10
10
|
import * as i1$2 from '@angular/cdk/portal';
|
|
@@ -470,6 +470,18 @@ const DICTIONARY_EN = {
|
|
|
470
470
|
iaValidationPrompt: 'IA Validation Prompt',
|
|
471
471
|
searchApi: 'Search API',
|
|
472
472
|
searchApi_tip: 'URL to fetch search options',
|
|
473
|
+
optionsSourceKey: 'Options source',
|
|
474
|
+
optionsSourceKey_tip: 'Logical key registered by the consuming application',
|
|
475
|
+
optionsSourceIdField: 'Option ID field',
|
|
476
|
+
optionsSourceIdField_tip: 'Path used as the option id. Example: id',
|
|
477
|
+
optionsSourceTextField: 'Option text field',
|
|
478
|
+
optionsSourceTextField_tip: 'Path used as the option text. Example: name',
|
|
479
|
+
optionsSourceTextTemplate: 'Text template',
|
|
480
|
+
optionsSourceTextTemplate_tip: 'Example: {{name}} ({{id}})',
|
|
481
|
+
optionsSourceDependsOn: 'Depends on',
|
|
482
|
+
optionsSourceDependsOn_tip: 'Parent field identifier that triggers reloads',
|
|
483
|
+
optionsSourceParamName: 'Parameter name',
|
|
484
|
+
optionsSourceParamName_tip: 'Name used to send the dependent value',
|
|
473
485
|
selectNullable_tip: 'Allows selecting an empty option',
|
|
474
486
|
selectSearchEnabled_tip: 'Enables search among options',
|
|
475
487
|
selectNullable: 'Allow empty option',
|
|
@@ -761,6 +773,18 @@ const DICTIONARY_ES = {
|
|
|
761
773
|
iaValidation: 'Validación IA',
|
|
762
774
|
iaValidationPrompt: 'Prompt de validación IA',
|
|
763
775
|
searchApi_tip: 'URL para obtener opciones de búsqueda',
|
|
776
|
+
optionsSourceKey: 'Fuente de opciones',
|
|
777
|
+
optionsSourceKey_tip: 'Clave lógica registrada por la aplicación consumidora',
|
|
778
|
+
optionsSourceIdField: 'Campo ID de opción',
|
|
779
|
+
optionsSourceIdField_tip: 'Ruta del valor usado como id. Ejemplo: id',
|
|
780
|
+
optionsSourceTextField: 'Campo texto de opción',
|
|
781
|
+
optionsSourceTextField_tip: 'Ruta del valor usado como texto. Ejemplo: name',
|
|
782
|
+
optionsSourceTextTemplate: 'Plantilla de texto',
|
|
783
|
+
optionsSourceTextTemplate_tip: 'Ejemplo: {{name}} ({{id}})',
|
|
784
|
+
optionsSourceDependsOn: 'Depende de',
|
|
785
|
+
optionsSourceDependsOn_tip: 'Identificador del campo padre que dispara la recarga',
|
|
786
|
+
optionsSourceParamName: 'Nombre del parámetro',
|
|
787
|
+
optionsSourceParamName_tip: 'Nombre con el que se envía el valor dependiente',
|
|
764
788
|
selectNullable_tip: 'Permite seleccionar una opción vacía',
|
|
765
789
|
selectSearchEnabled_tip: 'Habilita búsqueda entre opciones',
|
|
766
790
|
selectNullable: 'Permitir opción vacía',
|
|
@@ -4295,6 +4319,7 @@ class UicFormWrapperComponent {
|
|
|
4295
4319
|
fields = [];
|
|
4296
4320
|
cols = 2;
|
|
4297
4321
|
externalData = {};
|
|
4322
|
+
selectOptionsResolver;
|
|
4298
4323
|
loading = false;
|
|
4299
4324
|
disabled = false;
|
|
4300
4325
|
showButtons = false;
|
|
@@ -4305,12 +4330,16 @@ class UicFormWrapperComponent {
|
|
|
4305
4330
|
fileUidResolverFn;
|
|
4306
4331
|
formSubmit = new EventEmitter();
|
|
4307
4332
|
formChange = new EventEmitter();
|
|
4333
|
+
optionsSourceError = new EventEmitter();
|
|
4308
4334
|
formValueSub = null;
|
|
4335
|
+
optionSourceSubs = new Map();
|
|
4336
|
+
optionSourceDependencyValueByField = new Map();
|
|
4309
4337
|
hasFocusedCurrentTrigger = false;
|
|
4310
4338
|
ngOnInit() {
|
|
4311
4339
|
this.syncEffectiveSchema();
|
|
4312
4340
|
this.buildForm();
|
|
4313
4341
|
this.updateExtenalData();
|
|
4342
|
+
this.updateOptionsSources();
|
|
4314
4343
|
}
|
|
4315
4344
|
ngOnChanges(changes) {
|
|
4316
4345
|
const sourceChanged = (changes['schema'] && !changes['schema'].firstChange) ||
|
|
@@ -4325,13 +4354,18 @@ class UicFormWrapperComponent {
|
|
|
4325
4354
|
if (sourceChanged) {
|
|
4326
4355
|
this.buildForm();
|
|
4327
4356
|
this.updateExtenalData();
|
|
4357
|
+
this.updateOptionsSources();
|
|
4328
4358
|
}
|
|
4329
4359
|
if (changes['externalData']) {
|
|
4330
4360
|
this.updateExtenalData();
|
|
4331
4361
|
}
|
|
4362
|
+
if (changes['selectOptionsResolver'] && !changes['selectOptionsResolver'].firstChange) {
|
|
4363
|
+
this.updateOptionsSources(true);
|
|
4364
|
+
}
|
|
4332
4365
|
if (changes['initialValues'] && !changes['initialValues'].firstChange) {
|
|
4333
4366
|
this.buildForm();
|
|
4334
4367
|
this.updateExtenalData();
|
|
4368
|
+
this.updateOptionsSources();
|
|
4335
4369
|
}
|
|
4336
4370
|
const focusRequestChanged = (changes['focusFieldName'] && !changes['focusFieldName'].firstChange) ||
|
|
4337
4371
|
(changes['focusFieldTrigger'] && !changes['focusFieldTrigger'].firstChange);
|
|
@@ -4343,6 +4377,7 @@ class UicFormWrapperComponent {
|
|
|
4343
4377
|
ngOnDestroy() {
|
|
4344
4378
|
this.formValueSub?.unsubscribe();
|
|
4345
4379
|
this.formValueSub = null;
|
|
4380
|
+
this.clearOptionSourceSubscriptions();
|
|
4346
4381
|
}
|
|
4347
4382
|
buildForm() {
|
|
4348
4383
|
this.formValueSub?.unsubscribe();
|
|
@@ -4362,8 +4397,10 @@ class UicFormWrapperComponent {
|
|
|
4362
4397
|
this.formValueSub = newForm.valueChanges.subscribe(() => {
|
|
4363
4398
|
this.normalizeNumericControls(newForm, numericFields);
|
|
4364
4399
|
this.handleFormChange();
|
|
4400
|
+
this.updateDependentOptionsSources();
|
|
4365
4401
|
});
|
|
4366
4402
|
this.form = newForm;
|
|
4403
|
+
this.optionSourceDependencyValueByField.clear();
|
|
4367
4404
|
this.updateDisabledState();
|
|
4368
4405
|
this.focusConfiguredField();
|
|
4369
4406
|
}
|
|
@@ -4444,12 +4481,210 @@ class UicFormWrapperComponent {
|
|
|
4444
4481
|
updateFieldOptions(block) {
|
|
4445
4482
|
return block.fields.map(field => {
|
|
4446
4483
|
if (field.type === 'select' || field.type === 'pool' || field.type === 'multyselect') {
|
|
4484
|
+
if (this.hasUsableOptionsSource(field)) {
|
|
4485
|
+
return field;
|
|
4486
|
+
}
|
|
4447
4487
|
const externalOptions = this.externalData?.[field.name];
|
|
4448
4488
|
return { ...field, options: Array.isArray(externalOptions) ? externalOptions : (field.options ?? []) };
|
|
4449
4489
|
}
|
|
4450
4490
|
return field;
|
|
4451
4491
|
});
|
|
4452
4492
|
}
|
|
4493
|
+
updateOptionsSources(force = false) {
|
|
4494
|
+
const fields = this.collectAllFields().filter(field => this.hasUsableOptionsSource(field));
|
|
4495
|
+
const fieldNames = new Set(fields.map(field => field.name));
|
|
4496
|
+
for (const fieldName of this.optionSourceSubs.keys()) {
|
|
4497
|
+
if (!fieldNames.has(fieldName)) {
|
|
4498
|
+
this.optionSourceSubs.get(fieldName)?.unsubscribe();
|
|
4499
|
+
this.optionSourceSubs.delete(fieldName);
|
|
4500
|
+
this.optionSourceDependencyValueByField.delete(fieldName);
|
|
4501
|
+
}
|
|
4502
|
+
}
|
|
4503
|
+
fields.forEach(field => this.resolveOptionsSourceField(field, force));
|
|
4504
|
+
}
|
|
4505
|
+
updateDependentOptionsSources() {
|
|
4506
|
+
const fields = this.collectAllFields().filter(field => {
|
|
4507
|
+
const source = field.optionsSource;
|
|
4508
|
+
return this.hasUsableOptionsSource(field) && !!source?.dependsOn;
|
|
4509
|
+
});
|
|
4510
|
+
fields.forEach(field => this.resolveOptionsSourceField(field));
|
|
4511
|
+
}
|
|
4512
|
+
resolveOptionsSourceField(field, force = false) {
|
|
4513
|
+
const source = field.optionsSource;
|
|
4514
|
+
if (!source?.key)
|
|
4515
|
+
return;
|
|
4516
|
+
if (!this.selectOptionsResolver) {
|
|
4517
|
+
this.updateFieldOptionsState(field.name, {
|
|
4518
|
+
options: field.options ?? [],
|
|
4519
|
+
loading: false
|
|
4520
|
+
});
|
|
4521
|
+
return;
|
|
4522
|
+
}
|
|
4523
|
+
const values = this.toNestedValues(this.form?.getRawValue?.() ?? {});
|
|
4524
|
+
const dependencyValue = source.dependsOn ? this.getValueByPath(values, source.dependsOn) : undefined;
|
|
4525
|
+
const dependencyKey = source.dependsOn ? `${source.dependsOn}:${this.safeStringify(dependencyValue ?? null)}` : '__init__';
|
|
4526
|
+
const previousDependencyKey = this.optionSourceDependencyValueByField.get(field.name);
|
|
4527
|
+
if (!force && previousDependencyKey === dependencyKey) {
|
|
4528
|
+
return;
|
|
4529
|
+
}
|
|
4530
|
+
this.optionSourceDependencyValueByField.set(field.name, dependencyKey);
|
|
4531
|
+
if (source.dependsOn && (dependencyValue === null || dependencyValue === undefined || dependencyValue === '')) {
|
|
4532
|
+
this.optionSourceSubs.get(field.name)?.unsubscribe();
|
|
4533
|
+
this.optionSourceSubs.delete(field.name);
|
|
4534
|
+
this.clearFieldValue(field);
|
|
4535
|
+
this.updateFieldOptionsState(field.name, { options: [], loading: false });
|
|
4536
|
+
return;
|
|
4537
|
+
}
|
|
4538
|
+
this.optionSourceSubs.get(field.name)?.unsubscribe();
|
|
4539
|
+
this.updateFieldOptionsState(field.name, { loading: true });
|
|
4540
|
+
let optionsResult;
|
|
4541
|
+
try {
|
|
4542
|
+
optionsResult = this.selectOptionsResolver(source, {
|
|
4543
|
+
field,
|
|
4544
|
+
values,
|
|
4545
|
+
dependencyValue
|
|
4546
|
+
});
|
|
4547
|
+
}
|
|
4548
|
+
catch (error) {
|
|
4549
|
+
this.handleOptionsSourceError(field, source, error);
|
|
4550
|
+
return;
|
|
4551
|
+
}
|
|
4552
|
+
const sub = this.toObservable(optionsResult).subscribe({
|
|
4553
|
+
next: items => {
|
|
4554
|
+
const options = this.mapOptionsSourceItems(items, source);
|
|
4555
|
+
this.updateFieldOptionsState(field.name, { options, loading: false });
|
|
4556
|
+
this.clearInvalidFieldValue(field.name, options);
|
|
4557
|
+
},
|
|
4558
|
+
error: error => this.handleOptionsSourceError(field, source, error),
|
|
4559
|
+
complete: () => this.updateFieldOptionsState(field.name, { loading: false })
|
|
4560
|
+
});
|
|
4561
|
+
this.optionSourceSubs.set(field.name, sub);
|
|
4562
|
+
}
|
|
4563
|
+
handleOptionsSourceError(field, source, error) {
|
|
4564
|
+
this.updateFieldOptionsState(field.name, { options: [], loading: false });
|
|
4565
|
+
this.optionsSourceError.emit({ field, source, error });
|
|
4566
|
+
}
|
|
4567
|
+
toObservable(value) {
|
|
4568
|
+
if (isObservable(value)) {
|
|
4569
|
+
return value;
|
|
4570
|
+
}
|
|
4571
|
+
if (value instanceof Promise) {
|
|
4572
|
+
return from(value);
|
|
4573
|
+
}
|
|
4574
|
+
return of(value ?? []);
|
|
4575
|
+
}
|
|
4576
|
+
mapOptionsSourceItems(items, source) {
|
|
4577
|
+
if (!Array.isArray(items))
|
|
4578
|
+
return [];
|
|
4579
|
+
return items.map(item => this.mapOptionsSourceItem(item, source));
|
|
4580
|
+
}
|
|
4581
|
+
mapOptionsSourceItem(item, source) {
|
|
4582
|
+
if (item && typeof item === 'object') {
|
|
4583
|
+
const record = item;
|
|
4584
|
+
const id = this.getValueByPath(record, source.idField?.trim() || 'id');
|
|
4585
|
+
const fallbackText = this.getValueByPath(record, source.textField?.trim() || 'text');
|
|
4586
|
+
const optionId = this.isValidOptionId(id)
|
|
4587
|
+
? id
|
|
4588
|
+
: this.isValidOptionId(fallbackText)
|
|
4589
|
+
? fallbackText
|
|
4590
|
+
: String(fallbackText ?? '');
|
|
4591
|
+
return {
|
|
4592
|
+
detail: typeof record['detail'] === 'string' ? record['detail'] : undefined,
|
|
4593
|
+
icon: typeof record['icon'] === 'string' ? record['icon'] : undefined,
|
|
4594
|
+
iconColor: typeof record['iconColor'] === 'string' ? record['iconColor'] : undefined,
|
|
4595
|
+
id: optionId,
|
|
4596
|
+
text: source.textTemplate
|
|
4597
|
+
? this.renderOptionsSourceTemplate(source.textTemplate, record)
|
|
4598
|
+
: String(fallbackText ?? id ?? '')
|
|
4599
|
+
};
|
|
4600
|
+
}
|
|
4601
|
+
return {
|
|
4602
|
+
id: String(item ?? ''),
|
|
4603
|
+
text: String(item ?? '')
|
|
4604
|
+
};
|
|
4605
|
+
}
|
|
4606
|
+
renderOptionsSourceTemplate(template, item) {
|
|
4607
|
+
return template.replace(/\{\{\s*([\w.]+)\s*\}\}/g, (_match, path) => {
|
|
4608
|
+
const value = this.getValueByPath(item, path);
|
|
4609
|
+
return value === null || value === undefined ? '' : String(value);
|
|
4610
|
+
});
|
|
4611
|
+
}
|
|
4612
|
+
updateFieldOptionsState(fieldName, values) {
|
|
4613
|
+
if (!this.effectiveSchema?.blocks?.length)
|
|
4614
|
+
return;
|
|
4615
|
+
for (const block of this.effectiveSchema.blocks) {
|
|
4616
|
+
const index = block.fields.findIndex(field => field.name === fieldName);
|
|
4617
|
+
if (index === -1)
|
|
4618
|
+
continue;
|
|
4619
|
+
const field = block.fields[index];
|
|
4620
|
+
block.fields[index] = {
|
|
4621
|
+
...field,
|
|
4622
|
+
...(values.options !== undefined ? { options: values.options } : {}),
|
|
4623
|
+
...(values.loading !== undefined ? { loading: values.loading } : {})
|
|
4624
|
+
};
|
|
4625
|
+
block.fields = [...block.fields];
|
|
4626
|
+
this.effectiveSchema.blocks = [...this.effectiveSchema.blocks];
|
|
4627
|
+
return;
|
|
4628
|
+
}
|
|
4629
|
+
}
|
|
4630
|
+
clearInvalidFieldValue(fieldName, options) {
|
|
4631
|
+
const control = this.getFieldControl(fieldName);
|
|
4632
|
+
if (!control)
|
|
4633
|
+
return;
|
|
4634
|
+
const currentValue = control.value;
|
|
4635
|
+
if (currentValue === null || currentValue === undefined || currentValue === '')
|
|
4636
|
+
return;
|
|
4637
|
+
if (Array.isArray(currentValue)) {
|
|
4638
|
+
const validIds = new Set(options.map(option => option.id));
|
|
4639
|
+
const filteredValue = currentValue.filter(value => validIds.has(value));
|
|
4640
|
+
if (filteredValue.length !== currentValue.length) {
|
|
4641
|
+
control.setValue(filteredValue, { emitEvent: false });
|
|
4642
|
+
this.handleFormChange();
|
|
4643
|
+
}
|
|
4644
|
+
return;
|
|
4645
|
+
}
|
|
4646
|
+
if (!options.some(option => option.id === currentValue)) {
|
|
4647
|
+
control.setValue(null, { emitEvent: false });
|
|
4648
|
+
this.handleFormChange();
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
clearFieldValue(field) {
|
|
4652
|
+
const control = this.getFieldControl(field.name);
|
|
4653
|
+
if (!control)
|
|
4654
|
+
return;
|
|
4655
|
+
const blankValue = this.blankValue(field);
|
|
4656
|
+
if (control.value !== blankValue) {
|
|
4657
|
+
control.setValue(blankValue, { emitEvent: false });
|
|
4658
|
+
this.handleFormChange();
|
|
4659
|
+
}
|
|
4660
|
+
}
|
|
4661
|
+
hasUsableOptionsSource(field) {
|
|
4662
|
+
return this.supportsOptions(field) && !!field.optionsSource?.key?.trim();
|
|
4663
|
+
}
|
|
4664
|
+
supportsOptions(field) {
|
|
4665
|
+
return field.type === 'select' || field.type === 'pool' || field.type === 'multyselect' || field.type === 'radio';
|
|
4666
|
+
}
|
|
4667
|
+
isValidOptionId(value) {
|
|
4668
|
+
return typeof value === 'string' || typeof value === 'number' || value === null;
|
|
4669
|
+
}
|
|
4670
|
+
getValueByPath(source, path) {
|
|
4671
|
+
if (!path)
|
|
4672
|
+
return undefined;
|
|
4673
|
+
return path.split('.').reduce((current, key) => current?.[key], source);
|
|
4674
|
+
}
|
|
4675
|
+
safeStringify(value) {
|
|
4676
|
+
try {
|
|
4677
|
+
return JSON.stringify(value);
|
|
4678
|
+
}
|
|
4679
|
+
catch {
|
|
4680
|
+
return String(value);
|
|
4681
|
+
}
|
|
4682
|
+
}
|
|
4683
|
+
clearOptionSourceSubscriptions() {
|
|
4684
|
+
this.optionSourceSubs.forEach(sub => sub.unsubscribe());
|
|
4685
|
+
this.optionSourceSubs.clear();
|
|
4686
|
+
this.optionSourceDependencyValueByField.clear();
|
|
4687
|
+
}
|
|
4453
4688
|
collectAllFields() {
|
|
4454
4689
|
return (this.effectiveSchema?.blocks ?? []).flatMap(block => block.fields ?? []);
|
|
4455
4690
|
}
|
|
@@ -4705,7 +4940,7 @@ class UicFormWrapperComponent {
|
|
|
4705
4940
|
};
|
|
4706
4941
|
}
|
|
4707
4942
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4708
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFormWrapperComponent, isStandalone: true, selector: "ui-form-wrapper", inputs: { schema: "schema", fields: "fields", cols: "cols", externalData: "externalData", loading: "loading", disabled: "disabled", showButtons: "showButtons", fillSelects: "fillSelects", initialValues: "initialValues", focusFieldName: "focusFieldName", focusFieldTrigger: "focusFieldTrigger", fileUidResolverFn: "fileUidResolverFn" }, outputs: { formSubmit: "formSubmit", formChange: "formChange" }, providers: [UicFormStateService], usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n @for (block of effectiveSchema.blocks; track $index) {\r\n \r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n }\r\n @if (block.subtitle){\r\n <div class=\"block-subtitle\">{{ block.subtitle }}</div>\r\n }\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"effectiveSchema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\n [cols]=\"effectiveSchema.cols\"\n [disabled]=\"disabled\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [fields]=\"block.fields\"\n [form]=\"form\">\n </ui-dynamic-form>\n }\r\n </section>\r\n }\r\n @if ( showButtons ) {\r\n\r\n <div class=\"form-buttons\">\r\n <ui-button color=\"black\" type=\"bordered\" (click)=\"clean()\">{{'common.clear' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" (click)=\"submit()\">{{'common.save' | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block;padding:.25rem 0}.block-title{font-size:1.625rem;font-weight:600;line-height:calc(1.625rem + 4px);margin:1rem 0;color:var(--grey-950)}.block-subtitle{font-size:1.25rem;font-weight:600;line-height:calc(1.25rem + 4px);margin:.75rem 0;color:var(--grey-950)}.form-buttons{display:flex;gap:10px;width:100%}\n"], dependencies: [{ kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "form", "disabled", "voiceToTextSilenceMs", "cols", "fileUidResolverFn"] }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
4943
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicFormWrapperComponent, isStandalone: true, selector: "ui-form-wrapper", inputs: { schema: "schema", fields: "fields", cols: "cols", externalData: "externalData", selectOptionsResolver: "selectOptionsResolver", loading: "loading", disabled: "disabled", showButtons: "showButtons", fillSelects: "fillSelects", initialValues: "initialValues", focusFieldName: "focusFieldName", focusFieldTrigger: "focusFieldTrigger", fileUidResolverFn: "fileUidResolverFn" }, outputs: { formSubmit: "formSubmit", formChange: "formChange", optionsSourceError: "optionsSourceError" }, providers: [UicFormStateService], usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n @for (block of effectiveSchema.blocks; track $index) {\r\n \r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n }\r\n @if (block.subtitle){\r\n <div class=\"block-subtitle\">{{ block.subtitle }}</div>\r\n }\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"effectiveSchema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <ui-dynamic-form\n [cols]=\"effectiveSchema.cols\"\n [disabled]=\"disabled\"\n [fileUidResolverFn]=\"fileUidResolverFn\"\n [fields]=\"block.fields\"\n [form]=\"form\">\n </ui-dynamic-form>\n }\r\n </section>\r\n }\r\n @if ( showButtons ) {\r\n\r\n <div class=\"form-buttons\">\r\n <ui-button color=\"black\" type=\"bordered\" (click)=\"clean()\">{{'common.clear' | uicTranslate}}</ui-button>\r\n <ui-button color=\"black\" (click)=\"submit()\">{{'common.save' | uicTranslate}}</ui-button>\r\n </div>\r\n }\r\n</form>\r\n", styles: [":host{display:block;padding:.25rem 0}.block-title{font-size:1.625rem;font-weight:600;line-height:calc(1.625rem + 4px);margin:1rem 0;color:var(--grey-950)}.block-subtitle{font-size:1.25rem;font-weight:600;line-height:calc(1.25rem + 4px);margin:.75rem 0;color:var(--grey-950)}.form-buttons{display:flex;gap:10px;width:100%}\n"], dependencies: [{ kind: "component", type: UicDynamicFormComponent, selector: "ui-dynamic-form", inputs: ["fields", "form", "disabled", "voiceToTextSilenceMs", "cols", "fileUidResolverFn"] }, { kind: "component", type: UicSkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
4709
4944
|
}
|
|
4710
4945
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicFormWrapperComponent, decorators: [{
|
|
4711
4946
|
type: Component,
|
|
@@ -4724,6 +4959,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4724
4959
|
type: Input
|
|
4725
4960
|
}], externalData: [{
|
|
4726
4961
|
type: Input
|
|
4962
|
+
}], selectOptionsResolver: [{
|
|
4963
|
+
type: Input
|
|
4727
4964
|
}], loading: [{
|
|
4728
4965
|
type: Input
|
|
4729
4966
|
}], disabled: [{
|
|
@@ -4744,6 +4981,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4744
4981
|
type: Output
|
|
4745
4982
|
}], formChange: [{
|
|
4746
4983
|
type: Output
|
|
4984
|
+
}], optionsSourceError: [{
|
|
4985
|
+
type: Output
|
|
4747
4986
|
}] } });
|
|
4748
4987
|
|
|
4749
4988
|
class UicStepTabsComponent {
|
|
@@ -4855,7 +5094,7 @@ class UicStepsFormComponent {
|
|
|
4855
5094
|
return this.currentIdx === this.steps.length - 1;
|
|
4856
5095
|
}
|
|
4857
5096
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicStepsFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4858
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicStepsFormComponent, isStandalone: true, selector: "ui-steps-form", inputs: { steps: "steps", navigationEnabled: "navigationEnabled", showStepTitle: "showStepTitle", showButtons: "showButtons", buttonsColor: "buttonsColor" }, outputs: { formSubmit: "formSubmit" }, viewQueries: [{ propertyName: "allForms", predicate: UicFormWrapperComponent, descendants: true }], ngImport: i0, template: "<ui-step-tabs \r\n [(currentTab)]=\"currentTabTitle\" \r\n [navigationEnabled]=\"navigationEnabled\"\r\n [showStepTitle]=\"showStepTitle\"\r\n [tabs]=\"tabs\"></ui-step-tabs>\r\n\r\n\r\n<!-- formulario -->\r\n@for (step of steps; track $index) {\r\n <div [class.hidden-form]=\"step.title!==currentTabTitle\" >\r\n <ui-form-wrapper [schema]=\"step.form\" \r\n [externalData]=\"externalData\"\r\n [disabled]=\"formDisabled\"\r\n [loading]=\"loading\"></ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (showButtons) {\r\n <div style=\"display: flex; gap: 10px;\">\r\n <ui-button [color]=\"buttonsColor\" type=\"bordered\" [disabled]=\"isFirst\" (click)=\"back()\" >{{'step_form.back' | uicTranslate}}</ui-button>\r\n <ui-button [color]=\"buttonsColor\" (click)=\"next()\">{{isLast?('step_form.submit' | uicTranslate):('step_form.next' | uicTranslate)}}</ui-button>\r\n </div>\r\n}\r\n", styles: [".hidden-form{display:none}\n"], dependencies: [{ kind: "component", type: UicStepTabsComponent, selector: "ui-step-tabs", inputs: ["tabs", "currentTab", "navigationEnabled", "showStepTitle"], outputs: ["currentTabChange"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
5097
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicStepsFormComponent, isStandalone: true, selector: "ui-steps-form", inputs: { steps: "steps", navigationEnabled: "navigationEnabled", showStepTitle: "showStepTitle", showButtons: "showButtons", buttonsColor: "buttonsColor" }, outputs: { formSubmit: "formSubmit" }, viewQueries: [{ propertyName: "allForms", predicate: UicFormWrapperComponent, descendants: true }], ngImport: i0, template: "<ui-step-tabs \r\n [(currentTab)]=\"currentTabTitle\" \r\n [navigationEnabled]=\"navigationEnabled\"\r\n [showStepTitle]=\"showStepTitle\"\r\n [tabs]=\"tabs\"></ui-step-tabs>\r\n\r\n\r\n<!-- formulario -->\r\n@for (step of steps; track $index) {\r\n <div [class.hidden-form]=\"step.title!==currentTabTitle\" >\r\n <ui-form-wrapper [schema]=\"step.form\" \r\n [externalData]=\"externalData\"\r\n [disabled]=\"formDisabled\"\r\n [loading]=\"loading\"></ui-form-wrapper>\r\n </div>\r\n}\r\n\r\n@if (showButtons) {\r\n <div style=\"display: flex; gap: 10px;\">\r\n <ui-button [color]=\"buttonsColor\" type=\"bordered\" [disabled]=\"isFirst\" (click)=\"back()\" >{{'step_form.back' | uicTranslate}}</ui-button>\r\n <ui-button [color]=\"buttonsColor\" (click)=\"next()\">{{isLast?('step_form.submit' | uicTranslate):('step_form.next' | uicTranslate)}}</ui-button>\r\n </div>\r\n}\r\n", styles: [".hidden-form{display:none}\n"], dependencies: [{ kind: "component", type: UicStepTabsComponent, selector: "ui-step-tabs", inputs: ["tabs", "currentTab", "navigationEnabled", "showStepTitle"], outputs: ["currentTabChange"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
4859
5098
|
}
|
|
4860
5099
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicStepsFormComponent, decorators: [{
|
|
4861
5100
|
type: Component,
|
|
@@ -8141,14 +8380,14 @@ const FIELDS_CONFIG = [
|
|
|
8141
8380
|
{ value: 'textarea', icon: 'ri-file-text-line', detail: 'Texto multilinea con ajuste de altura', label: 'Area de texto', properties: ['placeholder', 'minLength', 'maxLength', 'showCounter', 'voiceToTextEnabled', 'textareaResize', 'resizeMinRows', 'resizeMaxRows'] },
|
|
8142
8381
|
{ value: 'number', icon: 'ri-hashtag', detail: 'Campo numerico con control de paso', label: 'Numero', properties: ['placeholder', 'step', 'min', 'max'] },
|
|
8143
8382
|
{ value: 'phone', icon: 'ri-phone-line', detail: 'Telefono con pais y codigo', label: 'Telefono', properties: ['placeholder'] },
|
|
8144
|
-
{ value: 'select', icon: 'ri-list-unordered', detail: 'Seleccion simple desde opciones', label: 'Selector', properties: ['options', 'selectSearchEnabled', 'selectNullable'] },
|
|
8145
|
-
{ value: 'multyselect', icon: 'ri-list-check-2', detail: 'Seleccion multiple desde opciones', label: 'Selector multiple', properties: ['options'] },
|
|
8383
|
+
{ value: 'select', icon: 'ri-list-unordered', detail: 'Seleccion simple desde opciones', label: 'Selector', properties: ['options', 'optionsSource.key', 'optionsSource.idField', 'optionsSource.textField', 'optionsSource.textTemplate', 'optionsSource.dependsOn', 'optionsSource.paramName', 'selectSearchEnabled', 'selectNullable'] },
|
|
8384
|
+
{ value: 'multyselect', icon: 'ri-list-check-2', detail: 'Seleccion multiple desde opciones', label: 'Selector multiple', properties: ['options', 'optionsSource.key', 'optionsSource.idField', 'optionsSource.textField', 'optionsSource.textTemplate', 'optionsSource.dependsOn', 'optionsSource.paramName'] },
|
|
8146
8385
|
{ value: 'date', icon: 'ri-calendar-2-line', detail: 'Selector de fecha o mes', label: 'Fecha', properties: ['monthMode', 'monthDay', 'minDate', 'maxDate'] },
|
|
8147
8386
|
{ value: 'time', icon: 'ri-timer-2-line', detail: 'Selector de hora', label: 'Hora', properties: ['timeInterval'] },
|
|
8148
|
-
{ value: 'radio', icon: 'ri-radio-button-line', detail: 'Seleccion unica entre opciones', label: 'Radio', properties: ['options'] },
|
|
8387
|
+
{ value: 'radio', icon: 'ri-radio-button-line', detail: 'Seleccion unica entre opciones', label: 'Radio', properties: ['options', 'optionsSource.key', 'optionsSource.idField', 'optionsSource.textField', 'optionsSource.textTemplate', 'optionsSource.dependsOn', 'optionsSource.paramName'] },
|
|
8149
8388
|
{ value: 'checkbox', icon: 'ri-checkbox-line', detail: 'Campo booleano tipo check', label: 'Checkbox', properties: ['placeholder'] },
|
|
8150
8389
|
{ value: 'switch', icon: 'ri-toggle-line', detail: 'Campo booleano tipo switch', label: 'Switch', properties: ['placeholder'] },
|
|
8151
|
-
{ value: 'pool', icon: 'ri-list-indefinite', detail: 'Seleccion con lista y detalle por item', label: 'Multiopciones', properties: ['options', 'multyEnabled', 'poolEnabledListView', 'poolTitle'] },
|
|
8390
|
+
{ value: 'pool', icon: 'ri-list-indefinite', detail: 'Seleccion con lista y detalle por item', label: 'Multiopciones', properties: ['options', 'optionsSource.key', 'optionsSource.idField', 'optionsSource.textField', 'optionsSource.textTemplate', 'optionsSource.dependsOn', 'optionsSource.paramName', 'multyEnabled', 'poolEnabledListView', 'poolTitle'] },
|
|
8152
8391
|
{ value: 'file', icon: 'ri-attachment-line', detail: 'Carga de archivos', label: 'Archivo', properties: ['multyEnabled', 'fileTypes', 'iaValidation', 'iaValidationPrompt'] },
|
|
8153
8392
|
{ value: 'searcher', icon: 'ri-seo-line', detail: 'Buscador con fuente de datos externa', label: 'Buscador', properties: ['placeholder', 'searchApi'] },
|
|
8154
8393
|
{ value: 'slider', icon: 'ri-equalizer-2-line', detail: 'Control deslizante continuo', label: 'Deslizador', properties: ['min', 'max', 'sliderInterval', 'sliderMarks'] }
|
|
@@ -8263,6 +8502,83 @@ const EXTRA_FORM_FIELDS = [
|
|
|
8263
8502
|
tip: 'form_builder.extra.searchApi_tip',
|
|
8264
8503
|
type: 'text'
|
|
8265
8504
|
},
|
|
8505
|
+
{
|
|
8506
|
+
name: 'optionsSource.key',
|
|
8507
|
+
label: 'form_builder.extra.optionsSourceKey',
|
|
8508
|
+
internalIcon: 'ri-database-2-line',
|
|
8509
|
+
tip: 'form_builder.extra.optionsSourceKey_tip',
|
|
8510
|
+
type: 'text'
|
|
8511
|
+
},
|
|
8512
|
+
{
|
|
8513
|
+
name: 'optionsSource.idField',
|
|
8514
|
+
label: 'form_builder.extra.optionsSourceIdField',
|
|
8515
|
+
internalIcon: 'ri-key-line',
|
|
8516
|
+
tip: 'form_builder.extra.optionsSourceIdField_tip',
|
|
8517
|
+
type: 'text',
|
|
8518
|
+
visibilityRules: [
|
|
8519
|
+
{
|
|
8520
|
+
fieldName: 'optionsSource.key',
|
|
8521
|
+
operator: 'notEquals',
|
|
8522
|
+
value: ''
|
|
8523
|
+
}
|
|
8524
|
+
]
|
|
8525
|
+
},
|
|
8526
|
+
{
|
|
8527
|
+
name: 'optionsSource.textField',
|
|
8528
|
+
label: 'form_builder.extra.optionsSourceTextField',
|
|
8529
|
+
internalIcon: 'ri-text',
|
|
8530
|
+
tip: 'form_builder.extra.optionsSourceTextField_tip',
|
|
8531
|
+
type: 'text',
|
|
8532
|
+
visibilityRules: [
|
|
8533
|
+
{
|
|
8534
|
+
fieldName: 'optionsSource.key',
|
|
8535
|
+
operator: 'notEquals',
|
|
8536
|
+
value: ''
|
|
8537
|
+
}
|
|
8538
|
+
]
|
|
8539
|
+
},
|
|
8540
|
+
{
|
|
8541
|
+
name: 'optionsSource.textTemplate',
|
|
8542
|
+
label: 'form_builder.extra.optionsSourceTextTemplate',
|
|
8543
|
+
internalIcon: 'ri-braces-line',
|
|
8544
|
+
tip: 'form_builder.extra.optionsSourceTextTemplate_tip',
|
|
8545
|
+
type: 'text',
|
|
8546
|
+
visibilityRules: [
|
|
8547
|
+
{
|
|
8548
|
+
fieldName: 'optionsSource.key',
|
|
8549
|
+
operator: 'notEquals',
|
|
8550
|
+
value: ''
|
|
8551
|
+
}
|
|
8552
|
+
]
|
|
8553
|
+
},
|
|
8554
|
+
{
|
|
8555
|
+
name: 'optionsSource.dependsOn',
|
|
8556
|
+
label: 'form_builder.extra.optionsSourceDependsOn',
|
|
8557
|
+
internalIcon: 'ri-git-branch-line',
|
|
8558
|
+
tip: 'form_builder.extra.optionsSourceDependsOn_tip',
|
|
8559
|
+
type: 'text',
|
|
8560
|
+
visibilityRules: [
|
|
8561
|
+
{
|
|
8562
|
+
fieldName: 'optionsSource.key',
|
|
8563
|
+
operator: 'notEquals',
|
|
8564
|
+
value: ''
|
|
8565
|
+
}
|
|
8566
|
+
]
|
|
8567
|
+
},
|
|
8568
|
+
{
|
|
8569
|
+
name: 'optionsSource.paramName',
|
|
8570
|
+
label: 'form_builder.extra.optionsSourceParamName',
|
|
8571
|
+
internalIcon: 'ri-code-line',
|
|
8572
|
+
tip: 'form_builder.extra.optionsSourceParamName_tip',
|
|
8573
|
+
type: 'text',
|
|
8574
|
+
visibilityRules: [
|
|
8575
|
+
{
|
|
8576
|
+
fieldName: 'optionsSource.key',
|
|
8577
|
+
operator: 'notEquals',
|
|
8578
|
+
value: ''
|
|
8579
|
+
}
|
|
8580
|
+
]
|
|
8581
|
+
},
|
|
8266
8582
|
{
|
|
8267
8583
|
name: 'iaValidation',
|
|
8268
8584
|
label: 'form_builder.extra.iaValidation',
|
|
@@ -8528,7 +8844,7 @@ class FormPreviewComponent {
|
|
|
8528
8844
|
console.log(fr.form);
|
|
8529
8845
|
}
|
|
8530
8846
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormPreviewComponent, deps: [{ token: MODAL_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
8531
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FormPreviewComponent, isStandalone: true, selector: "lib-form-preview", ngImport: i0, template: "<ui-form-wrapper \r\n [schema]=\"schema\" \r\n [showButtons]=\"true\"\r\n (formSubmit)=\"save($event)\">\r\n</ui-form-wrapper>\r\n", styles: [""], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange"] }] });
|
|
8847
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FormPreviewComponent, isStandalone: true, selector: "lib-form-preview", ngImport: i0, template: "<ui-form-wrapper \r\n [schema]=\"schema\" \r\n [showButtons]=\"true\"\r\n (formSubmit)=\"save($event)\">\r\n</ui-form-wrapper>\r\n", styles: [""], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }] });
|
|
8532
8848
|
}
|
|
8533
8849
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormPreviewComponent, decorators: [{
|
|
8534
8850
|
type: Component,
|
|
@@ -8743,7 +9059,7 @@ class FieldEditorComponent {
|
|
|
8743
9059
|
}));
|
|
8744
9060
|
}
|
|
8745
9061
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8746
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FieldEditorComponent, isStandalone: true, selector: "lib-field-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, focusRequiredField: { classPropertyName: "focusRequiredField", publicName: "focusRequiredField", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fieldChange: "fieldChange" }, ngImport: i0, template: "<div class=\"props-title\">{{'form_builder.field_editor.basic' | uicTranslate}} <i (click)=\"toggleSection('basic')\" class=\"{{hiddenSections().includes('basic') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('basic')\">\n <ui-form-wrapper\n [fields]=\"requiredFields\" \n [initialValues]=\"initialValues()\"\n [focusFieldName]=\"focusRequiredField() ? 'label' : null\"\n [focusFieldTrigger]=\"focusRequiredField() ? config().code : null\"\n [cols]=\"1\" \n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n @if (hasOptions()) {\n <ui-field-options-editor [options]=\"localField().options ?? []\" (optionsChange)=\"updateOptions($event)\"></ui-field-options-editor>\n }\n</div>\n\n<div class=\"props-title\">{{'form_builder.field_editor.advanced' | uicTranslate}} <i (click)=\"toggleSection('advanced')\" class=\"{{hiddenSections().includes('advanced') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('advanced')\">\n <ui-form-wrapper\n [fields]=\"advancedFields()\" \n [initialValues]=\"initialValues()\"\n [cols]=\"1\" \n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n</div>\n\n<div class=\"props-title\">{{'form_builder.field_editor.style' | uicTranslate}} <i (click)=\"toggleSection('style')\" class=\"{{hiddenSections().includes('style') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('style')\">\n <ui-form-wrapper\n [fields]=\"styleFields()\" \n [initialValues]=\"initialValues()\"\n [cols]=\"1\" \n (formChange)=\"updateFieldValues($event)\"> \n </ui-form-wrapper>\n</div>\n\n<div class=\"props-title\">{{'form_builder.field_editor.dependency_title' | uicTranslate}} <i (click)=\"toggleSection('dependency')\" class=\"{{hiddenSections().includes('dependency') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('dependency')\">\n @if (localField().visibilityRules ) {\n <p>{{'form_builder.field_editor.dependency_description' | uicTranslate}}</p>\n <ui-form-wrapper\n [fields]=\"branchFields\" \n [initialValues]=\"branchInitialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\" \n (formChange)=\"updateRuleValue($event)\">\n </ui-form-wrapper>\n <ui-button color=\"black\" size=\"s\" (click)=\"removeRule()\">{{'form_builder.field_editor.remove_relation' | uicTranslate}}</ui-button>\n }@else {\n <ui-button color=\"black\" size=\"s\" (click)=\"addRule()\">{{'form_builder.field_editor.add_relation' | uicTranslate}}</ui-button>\n }\n</div>\n", styles: [".hidden{display:none}.props-title{font-size:14px;font-weight:600;margin-bottom:8px;background:var(--grey-200);padding:5px;border-radius:5px;display:flex;justify-content:space-between}.props-title i{cursor:pointer}.props-inputs{padding-left:20px;margin-bottom:10px}p{font-size:14px;margin:10px 0;color:var(--yellow-800)}\n"], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicFieldOptionsEditorComponent, selector: "ui-field-options-editor", inputs: ["options"], outputs: ["optionsChange"] }] });
|
|
9062
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FieldEditorComponent, isStandalone: true, selector: "lib-field-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, focusRequiredField: { classPropertyName: "focusRequiredField", publicName: "focusRequiredField", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fieldChange: "fieldChange" }, ngImport: i0, template: "<div class=\"props-title\">{{'form_builder.field_editor.basic' | uicTranslate}} <i (click)=\"toggleSection('basic')\" class=\"{{hiddenSections().includes('basic') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('basic')\">\n <ui-form-wrapper\n [fields]=\"requiredFields\" \n [initialValues]=\"initialValues()\"\n [focusFieldName]=\"focusRequiredField() ? 'label' : null\"\n [focusFieldTrigger]=\"focusRequiredField() ? config().code : null\"\n [cols]=\"1\" \n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n @if (hasOptions()) {\n <ui-field-options-editor [options]=\"localField().options ?? []\" (optionsChange)=\"updateOptions($event)\"></ui-field-options-editor>\n }\n</div>\n\n<div class=\"props-title\">{{'form_builder.field_editor.advanced' | uicTranslate}} <i (click)=\"toggleSection('advanced')\" class=\"{{hiddenSections().includes('advanced') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('advanced')\">\n <ui-form-wrapper\n [fields]=\"advancedFields()\" \n [initialValues]=\"initialValues()\"\n [cols]=\"1\" \n (formChange)=\"updateFieldValues($event)\">\n </ui-form-wrapper>\n</div>\n\n<div class=\"props-title\">{{'form_builder.field_editor.style' | uicTranslate}} <i (click)=\"toggleSection('style')\" class=\"{{hiddenSections().includes('style') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('style')\">\n <ui-form-wrapper\n [fields]=\"styleFields()\" \n [initialValues]=\"initialValues()\"\n [cols]=\"1\" \n (formChange)=\"updateFieldValues($event)\"> \n </ui-form-wrapper>\n</div>\n\n<div class=\"props-title\">{{'form_builder.field_editor.dependency_title' | uicTranslate}} <i (click)=\"toggleSection('dependency')\" class=\"{{hiddenSections().includes('dependency') ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'}}\"></i> </div>\n<div class=\"props-inputs\" [class.hidden]=\"hiddenSections().includes('dependency')\">\n @if (localField().visibilityRules ) {\n <p>{{'form_builder.field_editor.dependency_description' | uicTranslate}}</p>\n <ui-form-wrapper\n [fields]=\"branchFields\" \n [initialValues]=\"branchInitialValues()\"\n [externalData]=\"options()\"\n [cols]=\"1\" \n (formChange)=\"updateRuleValue($event)\">\n </ui-form-wrapper>\n <ui-button color=\"black\" size=\"s\" (click)=\"removeRule()\">{{'form_builder.field_editor.remove_relation' | uicTranslate}}</ui-button>\n }@else {\n <ui-button color=\"black\" size=\"s\" (click)=\"addRule()\">{{'form_builder.field_editor.add_relation' | uicTranslate}}</ui-button>\n }\n</div>\n", styles: [".hidden{display:none}.props-title{font-size:14px;font-weight:600;margin-bottom:8px;background:var(--grey-200);padding:5px;border-radius:5px;display:flex;justify-content:space-between}.props-title i{cursor:pointer}.props-inputs{padding-left:20px;margin-bottom:10px}p{font-size:14px;margin:10px 0;color:var(--yellow-800)}\n"], dependencies: [{ kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: UicFieldOptionsEditorComponent, selector: "ui-field-options-editor", inputs: ["options"], outputs: ["optionsChange"] }] });
|
|
8747
9063
|
}
|
|
8748
9064
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FieldEditorComponent, decorators: [{
|
|
8749
9065
|
type: Component,
|
|
@@ -8972,7 +9288,7 @@ class UicUserFormbuilderComponent {
|
|
|
8972
9288
|
fields: block.fields.map((field, index) => ({
|
|
8973
9289
|
...field,
|
|
8974
9290
|
order: index + 1,
|
|
8975
|
-
fieldData: this.
|
|
9291
|
+
fieldData: this.prepareFieldDataForSubmit(field.fieldData)
|
|
8976
9292
|
}))
|
|
8977
9293
|
}));
|
|
8978
9294
|
this.editableBlocks.set(blocksWithOrderedFields);
|
|
@@ -9129,6 +9445,23 @@ class UicUserFormbuilderComponent {
|
|
|
9129
9445
|
}
|
|
9130
9446
|
return value;
|
|
9131
9447
|
}
|
|
9448
|
+
prepareFieldDataForSubmit(fieldData) {
|
|
9449
|
+
const cleanFieldData = this.removeNullProperties(fieldData);
|
|
9450
|
+
const optionsSource = cleanFieldData.optionsSource;
|
|
9451
|
+
if (!optionsSource) {
|
|
9452
|
+
return cleanFieldData;
|
|
9453
|
+
}
|
|
9454
|
+
const cleanOptionsSource = Object.fromEntries(Object.entries(optionsSource)
|
|
9455
|
+
.filter(([, value]) => value !== null && value !== undefined && value !== ''));
|
|
9456
|
+
if (!cleanOptionsSource['key']) {
|
|
9457
|
+
const { optionsSource: _optionsSource, ...restFieldData } = cleanFieldData;
|
|
9458
|
+
return restFieldData;
|
|
9459
|
+
}
|
|
9460
|
+
return {
|
|
9461
|
+
...cleanFieldData,
|
|
9462
|
+
optionsSource: cleanOptionsSource
|
|
9463
|
+
};
|
|
9464
|
+
}
|
|
9132
9465
|
deepClone(value) {
|
|
9133
9466
|
if (Array.isArray(value)) {
|
|
9134
9467
|
return value.map(item => this.deepClone(item));
|
|
@@ -9139,7 +9472,7 @@ class UicUserFormbuilderComponent {
|
|
|
9139
9472
|
return value;
|
|
9140
9473
|
}
|
|
9141
9474
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9142
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicUserFormbuilderComponent, isStandalone: true, selector: "ui-user-formbuilder", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, formTitle: { classPropertyName: "formTitle", publicName: "formTitle", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, editableFormInput: { classPropertyName: "editableFormInput", publicName: "editableForm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitFormRequest: "submitFormRequest" }, host: { listeners: { "document:mousemove": "onPropertiesResize($event)", "document:mouseup": "stopPropertiesResize()" } }, ngImport: i0, template: "<div class=\"formeditor\" [class.focused]=\"!isReadOnly()\">\r\n <div class=\"formeditor-header\">\r\n <div style=\"flex: 1 1;\">\r\n {{formTitle}} \r\n \r\n <div class=\"cols-selector\"> \r\n @if (isReadOnly()) {\r\n {{editableCols()}}\r\n }@else {\r\n <ui-select [options]=\"[{id: 1, text: '1'}, {id: 2, text: '2'}, {id: 3, text: '3'}, {id: 4, text: '4'}]\" [ngModel]=\"editableCols()\" (ngModelChange)=\"editableCols.set($event)\"></ui-select> \r\n }\r\n col(s)</div>\r\n </div>\r\n @if (isReadOnly()) {\r\n @if (!disabled) {\r\n <ui-button color=\"black\" icon=\"ri-edit-line\" text=\"Editar\" (click)=\"enableEditMode()\"></ui-button>\r\n }\r\n } @else {\r\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\r\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-close-line\" text=\"Descartar cambios\" (click)=\"discardChanges()\"></ui-button>\r\n <ui-button color=\"black\" icon=\"ri-check-line\" [text]=\"'form_builder.submit_form' | uicTranslate\" (click)=\"submitForm()\"></ui-button>\r\n }\r\n </div>\r\n @if (!isReadOnly()) {\r\n <div class=\"formeditor-body\">\r\n \r\n <!-- BLOCKS -->\r\n <div class=\"formeditor-overflow\">\r\n <div class=\"formeditor-workarea\">\r\n @for (block of editableBlocks(); track block.code; let i = $index) {\r\n <lib-block-editor \r\n [block]=\"block\"\r\n [selectedFieldId]=\"selectedField()?.code ?? null\"\n (blockChange)=\"onBlockChange(i, $event)\"\n (addFieldRequest)=\"addField(block.code, $event)\"\n (notifySelectedField)=\"selectField($event)\"\n (deleteBlock)=\"deleteBlock($event)\">\n </lib-block-editor>\n }\r\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\r\n </div>\r\n </div>\r\n <!-- PROPERTIES -->\r\n <div class=\"formeditor-properties\" [style.width.px]=\"propertiesWidth()\">\n <div\n class=\"formeditor-properties-resize\"\n (mousedown)=\"startPropertiesResize($event)\">\n </div>\n <h3>Propiedades</h3>\n <div class=\"formeditor-properties-form\">\n @if (selectedField() ) {\r\n <lib-field-editor \n [config]=\"selectedField()!\"\n [focusRequiredField]=\"focusNewFieldCode() === selectedField()?.code\"\n [options]=\"dependencyOptions()\"\n (fieldChange)=\"onFieldChange($event)\">\n </lib-field-editor>\n }@else{\r\n <div class=\"no-selected-field\">\r\n <i class=\"ri-edit-box-line\"></i>\r\n <p>{{'form_builder.select_field_to_edit' | uicTranslate}}</p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }@else {\r\n <div class=\"form-preview\">\r\n <ui-form-wrapper \r\n [schema]=\"previewSchema()\"\r\n [showButtons]=\"false\">\r\n </ui-form-wrapper>\r\n </div>\r\n }\r\n </div>\r\n\r\n", styles: [".formeditor{display:flex;flex-direction:column;overflow:hidden;background-color:var(--grey-100);border:solid 1px var(--grey-300);border-radius:5px;max-height:500px}.formeditor-header{background-color:#fff;padding:5px 10px;align-items:center;display:flex;gap:10px;border-bottom:solid 1px var(--grey-300)}.formeditor-body{display:flex;gap:10px;overflow:hidden;padding:10px;min-height:0}.formeditor-overflow{padding:5px;flex:1 1;overflow:auto;min-width:0}.formeditor-workarea{display:flex;flex-direction:column;gap:15px;height:fit-content}.formeditor-properties{width:250px;flex:0 0 auto;display:flex;flex-direction:column;position:relative;background-color:#fff;border:solid 1px var(--grey-300);border-radius:5px;min-height:0;min-width:250px;max-width:600px}.formeditor-properties-resize{position:absolute;top:0;bottom:0;left:-6px;width:10px;cursor:col-resize;z-index:1}.formeditor-properties>h3{padding:10px;border-bottom:solid 1px var(--grey-300)}.formeditor-properties-form{padding:10px;overflow:auto;flex:1 1 auto;min-height:0}.form-preview{padding:20px;overflow:auto;background-color:#fff}.focused{border:solid 1px var(--primary-400);border-radius:10px;box-shadow:0 0 0 3px var(--secondary-alpha)}.no-selected-field{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 0;font-size:13px;gap:15px;text-align:center;color:var(--grey-400)}.no-selected-field i{font-size:24px}.cols-selector{margin-left:8px;padding-left:8px;border-left:solid 1px var(--grey-400);display:inline-flex;align-items:center;gap:5px}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: FieldEditorComponent, selector: "lib-field-editor", inputs: ["config", "focusRequiredField", "options"], outputs: ["fieldChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: BlockEditorComponent, selector: "lib-block-editor", inputs: ["block", "selectedFieldId"], outputs: ["blockChange", "addFieldRequest", "deleteBlock", "notifySelectedField"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }] });
|
|
9475
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: UicUserFormbuilderComponent, isStandalone: true, selector: "ui-user-formbuilder", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, formTitle: { classPropertyName: "formTitle", publicName: "formTitle", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, editableFormInput: { classPropertyName: "editableFormInput", publicName: "editableForm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitFormRequest: "submitFormRequest" }, host: { listeners: { "document:mousemove": "onPropertiesResize($event)", "document:mouseup": "stopPropertiesResize()" } }, ngImport: i0, template: "<div class=\"formeditor\" [class.focused]=\"!isReadOnly()\">\r\n <div class=\"formeditor-header\">\r\n <div style=\"flex: 1 1;\">\r\n {{formTitle}} \r\n \r\n <div class=\"cols-selector\"> \r\n @if (isReadOnly()) {\r\n {{editableCols()}}\r\n }@else {\r\n <ui-select [options]=\"[{id: 1, text: '1'}, {id: 2, text: '2'}, {id: 3, text: '3'}, {id: 4, text: '4'}]\" [ngModel]=\"editableCols()\" (ngModelChange)=\"editableCols.set($event)\"></ui-select> \r\n }\r\n col(s)</div>\r\n </div>\r\n @if (isReadOnly()) {\r\n @if (!disabled) {\r\n <ui-button color=\"black\" icon=\"ri-edit-line\" text=\"Editar\" (click)=\"enableEditMode()\"></ui-button>\r\n }\r\n } @else {\r\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-eye-line\" [text]=\"'form_builder.preview_form' | uicTranslate\" (click)=\"printForm()\"></ui-button>\r\n <ui-button color=\"black\" type=\"bordered\" icon=\"ri-close-line\" text=\"Descartar cambios\" (click)=\"discardChanges()\"></ui-button>\r\n <ui-button color=\"black\" icon=\"ri-check-line\" [text]=\"'form_builder.submit_form' | uicTranslate\" (click)=\"submitForm()\"></ui-button>\r\n }\r\n </div>\r\n @if (!isReadOnly()) {\r\n <div class=\"formeditor-body\">\r\n \r\n <!-- BLOCKS -->\r\n <div class=\"formeditor-overflow\">\r\n <div class=\"formeditor-workarea\">\r\n @for (block of editableBlocks(); track block.code; let i = $index) {\r\n <lib-block-editor \r\n [block]=\"block\"\r\n [selectedFieldId]=\"selectedField()?.code ?? null\"\n (blockChange)=\"onBlockChange(i, $event)\"\n (addFieldRequest)=\"addField(block.code, $event)\"\n (notifySelectedField)=\"selectField($event)\"\n (deleteBlock)=\"deleteBlock($event)\">\n </lib-block-editor>\n }\r\n <ui-button type=\"bordered\" icon=\"ri-add-line\" color=\"black\" [text]=\"'form_builder.add_block' | uicTranslate\" (click)=\"addBlock()\"></ui-button>\r\n </div>\r\n </div>\r\n <!-- PROPERTIES -->\r\n <div class=\"formeditor-properties\" [style.width.px]=\"propertiesWidth()\">\n <div\n class=\"formeditor-properties-resize\"\n (mousedown)=\"startPropertiesResize($event)\">\n </div>\n <h3>Propiedades</h3>\n <div class=\"formeditor-properties-form\">\n @if (selectedField() ) {\r\n <lib-field-editor \n [config]=\"selectedField()!\"\n [focusRequiredField]=\"focusNewFieldCode() === selectedField()?.code\"\n [options]=\"dependencyOptions()\"\n (fieldChange)=\"onFieldChange($event)\">\n </lib-field-editor>\n }@else{\r\n <div class=\"no-selected-field\">\r\n <i class=\"ri-edit-box-line\"></i>\r\n <p>{{'form_builder.select_field_to_edit' | uicTranslate}}</p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }@else {\r\n <div class=\"form-preview\">\r\n <ui-form-wrapper \r\n [schema]=\"previewSchema()\"\r\n [showButtons]=\"false\">\r\n </ui-form-wrapper>\r\n </div>\r\n }\r\n </div>\r\n\r\n", styles: [".formeditor{display:flex;flex-direction:column;overflow:hidden;background-color:var(--grey-100);border:solid 1px var(--grey-300);border-radius:5px;max-height:500px}.formeditor-header{background-color:#fff;padding:5px 10px;align-items:center;display:flex;gap:10px;border-bottom:solid 1px var(--grey-300)}.formeditor-body{display:flex;gap:10px;overflow:hidden;padding:10px;min-height:0}.formeditor-overflow{padding:5px;flex:1 1;overflow:auto;min-width:0}.formeditor-workarea{display:flex;flex-direction:column;gap:15px;height:fit-content}.formeditor-properties{width:250px;flex:0 0 auto;display:flex;flex-direction:column;position:relative;background-color:#fff;border:solid 1px var(--grey-300);border-radius:5px;min-height:0;min-width:250px;max-width:600px}.formeditor-properties-resize{position:absolute;top:0;bottom:0;left:-6px;width:10px;cursor:col-resize;z-index:1}.formeditor-properties>h3{padding:10px;border-bottom:solid 1px var(--grey-300)}.formeditor-properties-form{padding:10px;overflow:auto;flex:1 1 auto;min-height:0}.form-preview{padding:20px;overflow:auto;background-color:#fff}.focused{border:solid 1px var(--primary-400);border-radius:10px;box-shadow:0 0 0 3px var(--secondary-alpha)}.no-selected-field{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 0;font-size:13px;gap:15px;text-align:center;color:var(--grey-400)}.no-selected-field i{font-size:24px}.cols-selector{margin-left:8px;padding-left:8px;border-left:solid 1px var(--grey-400);display:inline-flex;align-items:center;gap:5px}\n"], dependencies: [{ kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }, { kind: "component", type: FieldEditorComponent, selector: "lib-field-editor", inputs: ["config", "focusRequiredField", "options"], outputs: ["fieldChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: BlockEditorComponent, selector: "lib-block-editor", inputs: ["block", "selectedFieldId"], outputs: ["blockChange", "addFieldRequest", "deleteBlock", "notifySelectedField"] }, { kind: "component", type: UicSelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "showSubtitle", "disabled", "nonSelectedText", "noneText", "emptyText", "searcherEnabled", "loading", "nullable", "options"] }] });
|
|
9143
9476
|
}
|
|
9144
9477
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UicUserFormbuilderComponent, decorators: [{
|
|
9145
9478
|
type: Component,
|
|
@@ -9347,7 +9680,7 @@ class RuleDefinirionComponent {
|
|
|
9347
9680
|
return condition.id === 0 ? (condition.temporalId ?? '') : condition.id;
|
|
9348
9681
|
}
|
|
9349
9682
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RuleDefinirionComponent, deps: [{ token: MODAL_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
9350
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: RuleDefinirionComponent, isStandalone: true, selector: "lib-rule-definirion", ngImport: i0, template: "\n@if (newRule) {\n <ui-form-wrapper #formWrapper \n (formChange)=\"updateFormNewRule($event)\"\n (formSubmit)=\"createAndSelectRule($event)\" \n [initialValues]=\"initialValues\"\n [fields]=\"fields\" \n [cols]=\"2\"></ui-form-wrapper>\n <div class=\"condition-btns\">\n <ui-button icon=\"ri-arrow-left-line\" (click)=\"newRule = false\" color=\"black\" type=\"bordered\">{{ 'rule_builder.definition.cancel_and_back' | uicTranslate }}</ui-button>\n <ui-button (click)=\"formWrapper.submit()\" icon=\"ri-check-line\" color=\"black\">{{ 'rule_builder.definition.create_and_select' | uicTranslate }}</ui-button>\n </div>\n} @else {\n <div class=\"condition-searcher\">\n <ui-input>\n <input [(ngModel)]=\"searchTerm\" (ngModelChange)=\"onSearchTermChange()\" [placeholder]=\"'rule_builder.definition.search_placeholder' | uicTranslate\" type=\"text\">\n </ui-input>\n <ui-button (click)=\"newRule = true\" color=\"black\">{{ 'rule_builder.definition.new_rule' | uicTranslate }}</ui-button>\n </div>\n\n @if (paginatedConditions.length > 0) {\n @for (condition of paginatedConditions; track $index) {\n <div class=\"condition\" [class.condition-selected]=\"isSelected(condition)\">\n <i class=\"ri-align-item-horizontal-center-line\"></i>\n <div style=\"flex: 1 1;\">\n <div class=\"condition-title\"><span [innerHTML]=\"highlightSearch(condition.description)\"></span></div>\n @if (customNamesEnabled) {\n <div class=\"condition-body\">\n <span class=\"condition-field\" [innerHTML]=\"highlightSearch(condition.fieldName)\"></span>\n <span class=\"condition-operator\" [innerHTML]=\"highlightSearch(condition.operatorName)\"></span>\n <span class=\"condition-value\" [innerHTML]=\"highlightSearch(condition.value)\"></span>\n </div>\n }\n </div>\n @if (!isSelected(condition)) {\n <ui-button (click)=\"select(condition)\" color=\"primary\" size=\"s\" type=\"bordered\">{{ 'common.select' | uicTranslate }}</ui-button>\n }\n </div>\n }\n } @else {\n <div class=\"condition\">\n <div class=\"condition-emptytext\">\n {{ 'rule_builder.definition.no_results' | uicTranslate }}\n </div>\n </div>\n }\n\n <div class=\"condition-pagination\">\n <ui-button [disabled]=\"!canGoToPreviousPage\" (click)=\"goToPreviousPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.previous' | uicTranslate }}</ui-button>\n <div><b>{{ currentPage }}</b> / {{ totalPages }}</div>\n <ui-button [disabled]=\"!canGoToNextPage\" (click)=\"goToNextPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.next' | uicTranslate }}</ui-button>\n </div>\n}\n", styles: [".condition{border:solid 1px var(--grey-300);border-radius:10px;background-color:var(--grey-50);padding:6px;margin-bottom:4px;display:flex;align-items:center;gap:10px}.condition-emptytext{font-size:12px;text-align:center;color:var(--grey-400);padding:10px;width:100%}.condition i{color:var(--blue-600)}.condition-selected{border-color:var(--blue-500);background:linear-gradient(135deg,var(--blue-50) 0%,#eef6ff 100%);box-shadow:inset 0 0 0 1px #2563eb1f}.condition-selected .condition-title{color:var(--blue-800)}.condition-selected .condition-body,.condition-selected i{color:var(--blue-700)}.condition-title{font-size:14px;font-weight:500;line-height:16px}.condition-body{color:var(--grey-500);display:flex;gap:5px;font-size:12px}.condition-searcher{display:flex;gap:25px;margin-bottom:10px}.condition-pagination{margin-top:15px;display:flex;font-size:14px;align-items:center;justify-content:space-between}.condition-btns{padding-top:10px;border-top:solid 1px var(--grey-200);display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"], outputs: ["clickButton"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
9683
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: RuleDefinirionComponent, isStandalone: true, selector: "lib-rule-definirion", ngImport: i0, template: "\n@if (newRule) {\n <ui-form-wrapper #formWrapper \n (formChange)=\"updateFormNewRule($event)\"\n (formSubmit)=\"createAndSelectRule($event)\" \n [initialValues]=\"initialValues\"\n [fields]=\"fields\" \n [cols]=\"2\"></ui-form-wrapper>\n <div class=\"condition-btns\">\n <ui-button icon=\"ri-arrow-left-line\" (click)=\"newRule = false\" color=\"black\" type=\"bordered\">{{ 'rule_builder.definition.cancel_and_back' | uicTranslate }}</ui-button>\n <ui-button (click)=\"formWrapper.submit()\" icon=\"ri-check-line\" color=\"black\">{{ 'rule_builder.definition.create_and_select' | uicTranslate }}</ui-button>\n </div>\n} @else {\n <div class=\"condition-searcher\">\n <ui-input>\n <input [(ngModel)]=\"searchTerm\" (ngModelChange)=\"onSearchTermChange()\" [placeholder]=\"'rule_builder.definition.search_placeholder' | uicTranslate\" type=\"text\">\n </ui-input>\n <ui-button (click)=\"newRule = true\" color=\"black\">{{ 'rule_builder.definition.new_rule' | uicTranslate }}</ui-button>\n </div>\n\n @if (paginatedConditions.length > 0) {\n @for (condition of paginatedConditions; track $index) {\n <div class=\"condition\" [class.condition-selected]=\"isSelected(condition)\">\n <i class=\"ri-align-item-horizontal-center-line\"></i>\n <div style=\"flex: 1 1;\">\n <div class=\"condition-title\"><span [innerHTML]=\"highlightSearch(condition.description)\"></span></div>\n @if (customNamesEnabled) {\n <div class=\"condition-body\">\n <span class=\"condition-field\" [innerHTML]=\"highlightSearch(condition.fieldName)\"></span>\n <span class=\"condition-operator\" [innerHTML]=\"highlightSearch(condition.operatorName)\"></span>\n <span class=\"condition-value\" [innerHTML]=\"highlightSearch(condition.value)\"></span>\n </div>\n }\n </div>\n @if (!isSelected(condition)) {\n <ui-button (click)=\"select(condition)\" color=\"primary\" size=\"s\" type=\"bordered\">{{ 'common.select' | uicTranslate }}</ui-button>\n }\n </div>\n }\n } @else {\n <div class=\"condition\">\n <div class=\"condition-emptytext\">\n {{ 'rule_builder.definition.no_results' | uicTranslate }}\n </div>\n </div>\n }\n\n <div class=\"condition-pagination\">\n <ui-button [disabled]=\"!canGoToPreviousPage\" (click)=\"goToPreviousPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.previous' | uicTranslate }}</ui-button>\n <div><b>{{ currentPage }}</b> / {{ totalPages }}</div>\n <ui-button [disabled]=\"!canGoToNextPage\" (click)=\"goToNextPage()\" color=\"black\" size=\"s\" type=\"bordered\">{{ 'rule_builder.definition.next' | uicTranslate }}</ui-button>\n </div>\n}\n", styles: [".condition{border:solid 1px var(--grey-300);border-radius:10px;background-color:var(--grey-50);padding:6px;margin-bottom:4px;display:flex;align-items:center;gap:10px}.condition-emptytext{font-size:12px;text-align:center;color:var(--grey-400);padding:10px;width:100%}.condition i{color:var(--blue-600)}.condition-selected{border-color:var(--blue-500);background:linear-gradient(135deg,var(--blue-50) 0%,#eef6ff 100%);box-shadow:inset 0 0 0 1px #2563eb1f}.condition-selected .condition-title{color:var(--blue-800)}.condition-selected .condition-body,.condition-selected i{color:var(--blue-700)}.condition-title{font-size:14px;font-weight:500;line-height:16px}.condition-body{color:var(--grey-500);display:flex;gap:5px;font-size:12px}.condition-searcher{display:flex;gap:25px;margin-bottom:10px}.condition-pagination{margin-top:15px;display:flex;font-size:14px;align-items:center;justify-content:space-between}.condition-btns{padding-top:10px;border-top:solid 1px var(--grey-200);display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UicFormWrapperComponent, selector: "ui-form-wrapper", inputs: ["schema", "fields", "cols", "externalData", "selectOptionsResolver", "loading", "disabled", "showButtons", "fillSelects", "initialValues", "focusFieldName", "focusFieldTrigger", "fileUidResolverFn"], outputs: ["formSubmit", "formChange", "optionsSourceError"] }, { kind: "component", type: UicInputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "internalIconColor", "size", "label", "error", "tip", "disabled", "loading"], outputs: ["clickButton"] }, { kind: "component", type: UicButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "pipe", type: UicTranslatePipe, name: "uicTranslate" }] });
|
|
9351
9684
|
}
|
|
9352
9685
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RuleDefinirionComponent, decorators: [{
|
|
9353
9686
|
type: Component,
|