tuain-ng-forms-lib 15.0.14 → 15.0.17
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/esm2020/lib/classes/forms/element.mjs +1 -2
- package/esm2020/lib/classes/forms/field.mjs +3 -4
- package/esm2020/lib/classes/forms/piece-propagate.mjs +1 -3
- package/esm2020/lib/components/elements/field.component.mjs +3 -12
- package/esm2020/lib/components/forms/basic-form.mjs +4 -1
- package/fesm2015/tuain-ng-forms-lib.mjs +18 -31
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +7 -17
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/field.d.ts +1 -0
- package/package.json +1 -1
|
@@ -154,8 +154,6 @@ class FieldComponent extends ElementComponent {
|
|
|
154
154
|
// Subscripción a cambios en atributos
|
|
155
155
|
this.field?.attributeChange.subscribe(event => {
|
|
156
156
|
const { name: componentAttr, value } = event;
|
|
157
|
-
console.log('El llamado defaultProcessAttributeChange es pos suscripción...');
|
|
158
|
-
console.log(event);
|
|
159
157
|
this.defaultProcessAttributeChange(componentAttr, value);
|
|
160
158
|
this.customProcessAttributeChange(componentAttr, value);
|
|
161
159
|
});
|
|
@@ -163,7 +161,6 @@ class FieldComponent extends ElementComponent {
|
|
|
163
161
|
}
|
|
164
162
|
defaultProcessAttributeChange(attribute, value) {
|
|
165
163
|
if (attribute === VALUE) {
|
|
166
|
-
console.log(`Llegó un update value de ${this.field?.fieldCode} por defaultProcessAttributeChange`);
|
|
167
164
|
this.updateValue();
|
|
168
165
|
}
|
|
169
166
|
else if (attribute === FOCUS) {
|
|
@@ -174,18 +171,12 @@ class FieldComponent extends ElementComponent {
|
|
|
174
171
|
}
|
|
175
172
|
return true;
|
|
176
173
|
}
|
|
177
|
-
updateValue() {
|
|
178
|
-
console.log(`Update value de ${this.field?.fieldCode}`);
|
|
179
|
-
this.value = this.field?.value;
|
|
180
|
-
}
|
|
174
|
+
updateValue() { this.value = this.field?.value; }
|
|
181
175
|
onInputChange() { setTimeout(() => this.field?.notifyEditionPartial(), 50); }
|
|
182
176
|
onChangeContent() { setTimeout(() => this.field?.notifyEditionFinish(), 50); }
|
|
183
177
|
onShowInfo(detail = null) { setTimeout(() => this.field?.notifyEditionDetailRequest(detail), 50); }
|
|
184
178
|
focus() { }
|
|
185
|
-
updateObject(widgetUpdate = true) {
|
|
186
|
-
console.log(`updateObject ${this.field?.fieldCode} update ${widgetUpdate}`);
|
|
187
|
-
this.field?.setValue(this.value, widgetUpdate);
|
|
188
|
-
}
|
|
179
|
+
updateObject(widgetUpdate = true) { this.field?.setValue(this.value, widgetUpdate); }
|
|
189
180
|
inputChanged() {
|
|
190
181
|
this.field?.setValue(this.value);
|
|
191
182
|
this.onChangeContent();
|
|
@@ -652,14 +643,12 @@ class FormPiecePropagate extends FormPiece {
|
|
|
652
643
|
}
|
|
653
644
|
get attributeChange() { return this._attributeChange; }
|
|
654
645
|
propagateAttribute(name, value) {
|
|
655
|
-
console.log('propagateAttribute...');
|
|
656
646
|
this._attributeChange?.next({ name, value });
|
|
657
647
|
}
|
|
658
648
|
setCustomAttribute(name, value) {
|
|
659
649
|
super.setCustomAttribute(name, value);
|
|
660
650
|
if (this.propagationCustomAttributes?.includes(name)) {
|
|
661
651
|
const fullName = `customAttributes.${name}`;
|
|
662
|
-
console.log(`La propagación se origina en setCustomAttribute ${name} ${value}`);
|
|
663
652
|
this.propagateAttribute(fullName, value);
|
|
664
653
|
}
|
|
665
654
|
}
|
|
@@ -689,7 +678,6 @@ class FormElement extends FormPiecePropagate {
|
|
|
689
678
|
setAttr(attr, value) {
|
|
690
679
|
const { name: attrName, propagate: name } = attr;
|
|
691
680
|
this[attrName] = value;
|
|
692
|
-
console.log(`La propagacioón se origina en setAttr ${attrName} ${value} (propaga ${name})`);
|
|
693
681
|
name && this.propagateAttribute(name, value);
|
|
694
682
|
}
|
|
695
683
|
isField() { return this.elementType === elementTypes.field; }
|
|
@@ -835,6 +823,7 @@ class FieldDescriptor extends FormElement {
|
|
|
835
823
|
this._hasChanged = false;
|
|
836
824
|
this._outputOnly = false;
|
|
837
825
|
this._tooltipText = '';
|
|
826
|
+
this.placeholder = '';
|
|
838
827
|
this.fieldCode = '';
|
|
839
828
|
this.fieldOptions = null;
|
|
840
829
|
this.propagationCustomAttributes = this._formConfig?.propagationCustomAttributes?.fields ?? [];
|
|
@@ -842,6 +831,7 @@ class FieldDescriptor extends FormElement {
|
|
|
842
831
|
const fld = (inputFieldReceived) ? inputFieldReceived : {};
|
|
843
832
|
this.setAttr(attrs$1.fieldCode, fld.fieldCode);
|
|
844
833
|
this.title = fld.fieldTitle ?? this.fieldCode;
|
|
834
|
+
this.placeholder = fld.placeholder ?? this.title;
|
|
845
835
|
this.type = fld.fieldTypeCode;
|
|
846
836
|
this.captureType = fld.captureType ?? DEFAULT_CAPTURE_TYPE;
|
|
847
837
|
const defaultValue = fld.defaultValue ?? null;
|
|
@@ -975,7 +965,6 @@ class FieldDescriptor extends FormElement {
|
|
|
975
965
|
if (this._value) {
|
|
976
966
|
if (this._fieldType === this._formConfig.fieldTypes.array && Array.isArray(this._value)) {
|
|
977
967
|
const fieldValue = this._value?.filter(item => this.fieldOptions?.find(opt => opt.fieldOptionId === item));
|
|
978
|
-
console.log('SetAttr de valor....');
|
|
979
968
|
this.setAttr(attrs$1._value, fieldValue);
|
|
980
969
|
}
|
|
981
970
|
else {
|
|
@@ -1189,11 +1178,9 @@ class FieldDescriptor extends FormElement {
|
|
|
1189
1178
|
if (this._value !== newFinalValue) {
|
|
1190
1179
|
this.hasChanged = true;
|
|
1191
1180
|
if (widgetUpdate) {
|
|
1192
|
-
console.log(`SetValue ${this.fieldCode} CON update`);
|
|
1193
1181
|
this.setAttr(attrs$1._value, newFinalValue);
|
|
1194
1182
|
}
|
|
1195
1183
|
else {
|
|
1196
|
-
console.log(`SetValue ${this.fieldCode} sin update`);
|
|
1197
1184
|
this._value = newFinalValue;
|
|
1198
1185
|
}
|
|
1199
1186
|
}
|
|
@@ -3202,6 +3189,9 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3202
3189
|
async startServerAction(actionInput) {
|
|
3203
3190
|
const action = (typeof actionInput === 'string')
|
|
3204
3191
|
? this.getAction(actionInput) : actionInput;
|
|
3192
|
+
if (!action) {
|
|
3193
|
+
return;
|
|
3194
|
+
}
|
|
3205
3195
|
let serverError = false;
|
|
3206
3196
|
let actionResult = null;
|
|
3207
3197
|
if (action.backend) {
|