@alfresco/adf-core 9.1.0-16489432578 → 9.1.0-16490774779
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/adf-core.mjs +43 -31
- package/fesm2022/adf-core.mjs.map +1 -1
- package/lib/form/components/form-base.component.d.ts +19 -7
- package/lib/form/components/widgets/amount/amount.widget.scss +0 -8
- package/lib/form/components/widgets/core/form-outcome.model.d.ts +3 -3
- package/lib/form/components/widgets/core/form.model.d.ts +4 -4
- package/package.json +3 -3
package/fesm2022/adf-core.mjs
CHANGED
|
@@ -21814,25 +21814,25 @@ class FormModel {
|
|
|
21814
21814
|
this.isValid = false;
|
|
21815
21815
|
}
|
|
21816
21816
|
parseOutcomes() {
|
|
21817
|
-
if (this.json.fields)
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
|
|
21822
|
-
|
|
21823
|
-
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
|
|
21817
|
+
if (!this.json.fields)
|
|
21818
|
+
return;
|
|
21819
|
+
const saveOutcome = new FormOutcomeModel(this, {
|
|
21820
|
+
id: FormModel.SAVE_OUTCOME,
|
|
21821
|
+
name: FormOutcomeModel.SAVE_ACTION,
|
|
21822
|
+
isSystem: true
|
|
21823
|
+
});
|
|
21824
|
+
const completeOutcome = new FormOutcomeModel(this, {
|
|
21825
|
+
id: FormModel.COMPLETE_OUTCOME,
|
|
21826
|
+
name: FormOutcomeModel.COMPLETE_ACTION,
|
|
21827
|
+
isSystem: true
|
|
21828
|
+
});
|
|
21829
|
+
const startProcessOutcome = new FormOutcomeModel(this, {
|
|
21830
|
+
id: FormModel.START_PROCESS_OUTCOME,
|
|
21831
|
+
name: FormOutcomeModel.START_PROCESS_ACTION,
|
|
21832
|
+
isSystem: true
|
|
21833
|
+
});
|
|
21834
|
+
const customOutcomes = (this.json.outcomes ?? []).map((formModel) => new FormOutcomeModel(this, formModel));
|
|
21835
|
+
this.outcomes = [saveOutcome].concat(customOutcomes.length > 0 ? customOutcomes : [completeOutcome, startProcessOutcome]);
|
|
21836
21836
|
}
|
|
21837
21837
|
addValuesNotPresent(valuesToSetIfNotPresent) {
|
|
21838
21838
|
this.fieldsCache.forEach((field) => {
|
|
@@ -21954,7 +21954,7 @@ class FormService {
|
|
|
21954
21954
|
if (!json.fields) {
|
|
21955
21955
|
form.outcomes = [
|
|
21956
21956
|
new FormOutcomeModel(form, {
|
|
21957
|
-
id:
|
|
21957
|
+
id: FormModel.SAVE_OUTCOME,
|
|
21958
21958
|
name: FormOutcomeModel.SAVE_ACTION,
|
|
21959
21959
|
isSystem: true
|
|
21960
21960
|
})
|
|
@@ -22863,7 +22863,7 @@ class AmountWidgetComponent extends WidgetComponent {
|
|
|
22863
22863
|
}
|
|
22864
22864
|
}
|
|
22865
22865
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: AmountWidgetComponent, deps: [{ token: FormService }, { token: ADF_AMOUNT_SETTINGS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22866
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: AmountWidgetComponent, isStandalone: true, selector: "amount-widget", host: { listeners: { "click": "event($event)", "blur": "event($event)", "change": "event($event)", "focus": "event($event)", "focusin": "event($event)", "focusout": "event($event)", "input": "event($event)", "invalid": "event($event)", "select": "event($event)" } }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"adf-amount-widget__container adf-amount-widget {{field.className}}\"\n [class.adf-invalid]=\"!field.isValid && isTouched()\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span></label\n >\n </div>\n <div class=\"adf-amount-widget-container\">\n <mat-form-field class=\"adf-amount-widget__input adf-form-field-input\" [floatLabel]=\"placeholder ? 'always' : null\">\n @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class=\"adf-label\" [attr.for]=\"field.id\">{{field.name | translate }}</mat-label> }\n <span matTextPrefix class=\"adf-amount-widget__prefix-spacing\">{{ currency }} </span>\n <input\n matInput\n [title]=\"field.tooltip\"\n class=\"adf-input\"\n type=\"text\"\n [id]=\"field.id\"\n [required]=\"field.required && field.isVisible\"\n [placeholder]=\"placeholder\"\n [value]=\"field.value\"\n [(ngModel)]=\"field.value\"\n (ngModelChange)=\"onFieldChanged(field)\"\n [disabled]=\"field.readOnly\"\n (blur)=\"markAsTouched()\"\n />\n </mat-form-field>\n <div class=\"adf-error-messages-container\">\n <error-widget [error]=\"field.validationSummary\" />\n <error-widget\n *ngIf=\"isInvalidFieldRequired() && isTouched()\"\n required=\"{{ 'FORM.FIELD.REQUIRED' | translate }}\"\n />\n </div>\n </div>\n</div>\n", styles: [".adf-amount-widget{width:100%}.adf-amount-widget .adf-left-label{line-height:36px}.adf-amount-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-amount-widget__input
|
|
22866
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: AmountWidgetComponent, isStandalone: true, selector: "amount-widget", host: { listeners: { "click": "event($event)", "blur": "event($event)", "change": "event($event)", "focus": "event($event)", "focusin": "event($event)", "focusout": "event($event)", "input": "event($event)", "invalid": "event($event)", "select": "event($event)" } }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"adf-amount-widget__container adf-amount-widget {{field.className}}\"\n [class.adf-invalid]=\"!field.isValid && isTouched()\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span></label\n >\n </div>\n <div class=\"adf-amount-widget-container\">\n <mat-form-field class=\"adf-amount-widget__input adf-form-field-input\" [floatLabel]=\"placeholder ? 'always' : null\">\n @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class=\"adf-label\" [attr.for]=\"field.id\">{{field.name | translate }}</mat-label> }\n <span matTextPrefix class=\"adf-amount-widget__prefix-spacing\">{{ currency }} </span>\n <input\n matInput\n [title]=\"field.tooltip\"\n class=\"adf-input\"\n type=\"text\"\n [id]=\"field.id\"\n [required]=\"field.required && field.isVisible\"\n [placeholder]=\"placeholder\"\n [value]=\"field.value\"\n [(ngModel)]=\"field.value\"\n (ngModelChange)=\"onFieldChanged(field)\"\n [disabled]=\"field.readOnly\"\n (blur)=\"markAsTouched()\"\n />\n </mat-form-field>\n <div class=\"adf-error-messages-container\">\n <error-widget [error]=\"field.validationSummary\" />\n <error-widget\n *ngIf=\"isInvalidFieldRequired() && isTouched()\"\n required=\"{{ 'FORM.FIELD.REQUIRED' | translate }}\"\n />\n </div>\n </div>\n</div>\n", styles: [".adf-amount-widget{width:100%}.adf-amount-widget .adf-left-label{line-height:36px}.adf-amount-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-amount-widget__input .mat-focused{transition:none}.adf-amount-widget__input .adf-input{margin-top:3px}.adf-amount-widget__input:not(.mat-focused):not(.mat-form-field-invalid) .adf-amount-widget__prefix-spacing{color:var(--adf-theme-foreground-secondary-text-color)}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$5.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ErrorWidgetComponent, selector: "error-widget", inputs: ["error", "required"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
22867
22867
|
}
|
|
22868
22868
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: AmountWidgetComponent, decorators: [{
|
|
22869
22869
|
type: Component,
|
|
@@ -22877,7 +22877,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
|
|
|
22877
22877
|
'(input)': 'event($event)',
|
|
22878
22878
|
'(invalid)': 'event($event)',
|
|
22879
22879
|
'(select)': 'event($event)'
|
|
22880
|
-
}, imports: [MatFormFieldModule, MatInputModule, FormsModule, ErrorWidgetComponent, TranslatePipe, NgIf], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"adf-amount-widget__container adf-amount-widget {{field.className}}\"\n [class.adf-invalid]=\"!field.isValid && isTouched()\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span></label\n >\n </div>\n <div class=\"adf-amount-widget-container\">\n <mat-form-field class=\"adf-amount-widget__input adf-form-field-input\" [floatLabel]=\"placeholder ? 'always' : null\">\n @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class=\"adf-label\" [attr.for]=\"field.id\">{{field.name | translate }}</mat-label> }\n <span matTextPrefix class=\"adf-amount-widget__prefix-spacing\">{{ currency }} </span>\n <input\n matInput\n [title]=\"field.tooltip\"\n class=\"adf-input\"\n type=\"text\"\n [id]=\"field.id\"\n [required]=\"field.required && field.isVisible\"\n [placeholder]=\"placeholder\"\n [value]=\"field.value\"\n [(ngModel)]=\"field.value\"\n (ngModelChange)=\"onFieldChanged(field)\"\n [disabled]=\"field.readOnly\"\n (blur)=\"markAsTouched()\"\n />\n </mat-form-field>\n <div class=\"adf-error-messages-container\">\n <error-widget [error]=\"field.validationSummary\" />\n <error-widget\n *ngIf=\"isInvalidFieldRequired() && isTouched()\"\n required=\"{{ 'FORM.FIELD.REQUIRED' | translate }}\"\n />\n </div>\n </div>\n</div>\n", styles: [".adf-amount-widget{width:100%}.adf-amount-widget .adf-left-label{line-height:36px}.adf-amount-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-amount-widget__input
|
|
22880
|
+
}, imports: [MatFormFieldModule, MatInputModule, FormsModule, ErrorWidgetComponent, TranslatePipe, NgIf], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"adf-amount-widget__container adf-amount-widget {{field.className}}\"\n [class.adf-invalid]=\"!field.isValid && isTouched()\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span></label\n >\n </div>\n <div class=\"adf-amount-widget-container\">\n <mat-form-field class=\"adf-amount-widget__input adf-form-field-input\" [floatLabel]=\"placeholder ? 'always' : null\">\n @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class=\"adf-label\" [attr.for]=\"field.id\">{{field.name | translate }}</mat-label> }\n <span matTextPrefix class=\"adf-amount-widget__prefix-spacing\">{{ currency }} </span>\n <input\n matInput\n [title]=\"field.tooltip\"\n class=\"adf-input\"\n type=\"text\"\n [id]=\"field.id\"\n [required]=\"field.required && field.isVisible\"\n [placeholder]=\"placeholder\"\n [value]=\"field.value\"\n [(ngModel)]=\"field.value\"\n (ngModelChange)=\"onFieldChanged(field)\"\n [disabled]=\"field.readOnly\"\n (blur)=\"markAsTouched()\"\n />\n </mat-form-field>\n <div class=\"adf-error-messages-container\">\n <error-widget [error]=\"field.validationSummary\" />\n <error-widget\n *ngIf=\"isInvalidFieldRequired() && isTouched()\"\n required=\"{{ 'FORM.FIELD.REQUIRED' | translate }}\"\n />\n </div>\n </div>\n</div>\n", styles: [".adf-amount-widget{width:100%}.adf-amount-widget .adf-left-label{line-height:36px}.adf-amount-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-amount-widget__input .mat-focused{transition:none}.adf-amount-widget__input .adf-input{margin-top:3px}.adf-amount-widget__input:not(.mat-focused):not(.mat-form-field-invalid) .adf-amount-widget__prefix-spacing{color:var(--adf-theme-foreground-secondary-text-color)}\n"] }]
|
|
22881
22881
|
}], ctorParameters: () => [{ type: FormService }, { type: undefined, decorators: [{
|
|
22882
22882
|
type: Inject,
|
|
22883
22883
|
args: [ADF_AMOUNT_SETTINGS]
|
|
@@ -24664,7 +24664,7 @@ class FormBaseComponent {
|
|
|
24664
24664
|
this.showTitle = true;
|
|
24665
24665
|
/** Toggle rendering of the `Complete` outcome button. */
|
|
24666
24666
|
this.showCompleteButton = true;
|
|
24667
|
-
/** If true then the `Complete` outcome button is shown but it will be disabled. */
|
|
24667
|
+
/** If true then the `Complete` outcome button is shown, but it will be disabled. */
|
|
24668
24668
|
this.disableCompleteButton = false;
|
|
24669
24669
|
/** If true then the `Save` outcome button is shown but will be disabled. */
|
|
24670
24670
|
this.disableSaveButton = false;
|
|
@@ -24694,12 +24694,24 @@ class FormBaseComponent {
|
|
|
24694
24694
|
*/
|
|
24695
24695
|
this.formStyle = '';
|
|
24696
24696
|
}
|
|
24697
|
-
|
|
24698
|
-
|
|
24699
|
-
|
|
24697
|
+
/**
|
|
24698
|
+
* @deprecated Use {@link FormModel.SAVE_OUTCOME} instead.
|
|
24699
|
+
*/
|
|
24700
|
+
static { this.SAVE_OUTCOME_ID = FormModel.SAVE_OUTCOME; }
|
|
24701
|
+
/**
|
|
24702
|
+
* @deprecated Use {@link FormModel.COMPLETE_OUTCOME} instead.
|
|
24703
|
+
*/
|
|
24704
|
+
static { this.COMPLETE_OUTCOME_ID = FormModel.COMPLETE_OUTCOME; }
|
|
24705
|
+
/**
|
|
24706
|
+
* @deprecated Use {@link FormModel.START_PROCESS_OUTCOME} instead.
|
|
24707
|
+
*/
|
|
24708
|
+
static { this.START_PROCESS_OUTCOME_ID = FormModel.START_PROCESS_OUTCOME; }
|
|
24700
24709
|
static { this.CUSTOM_OUTCOME_ID = '$custom'; }
|
|
24701
24710
|
static { this.COMPLETE_BUTTON_COLOR = 'primary'; }
|
|
24702
|
-
|
|
24711
|
+
/**
|
|
24712
|
+
* @deprecated Use {@link FormOutcomeModel.COMPLETE_ACTION} instead.
|
|
24713
|
+
*/
|
|
24714
|
+
static { this.COMPLETE_OUTCOME_NAME = FormOutcomeModel.COMPLETE_ACTION; }
|
|
24703
24715
|
get form() {
|
|
24704
24716
|
return this._form;
|
|
24705
24717
|
}
|
|
@@ -24728,7 +24740,7 @@ class FormBaseComponent {
|
|
|
24728
24740
|
return titleEnabled;
|
|
24729
24741
|
}
|
|
24730
24742
|
getColorForOutcome(outcomeName) {
|
|
24731
|
-
return outcomeName ===
|
|
24743
|
+
return outcomeName === FormOutcomeModel.COMPLETE_ACTION ? FormBaseComponent.COMPLETE_BUTTON_COLOR : null;
|
|
24732
24744
|
}
|
|
24733
24745
|
isOutcomeButtonEnabled(outcome) {
|
|
24734
24746
|
if (this.form.readOnly) {
|
|
@@ -24766,18 +24778,18 @@ class FormBaseComponent {
|
|
|
24766
24778
|
return false;
|
|
24767
24779
|
}
|
|
24768
24780
|
if (outcome.isSystem) {
|
|
24769
|
-
if (outcome.id ===
|
|
24781
|
+
if (outcome.id === FormModel.SAVE_OUTCOME) {
|
|
24770
24782
|
this.disableSaveButton = true;
|
|
24771
24783
|
this.saveTaskForm();
|
|
24772
24784
|
return true;
|
|
24773
24785
|
}
|
|
24774
|
-
if (outcome.id ===
|
|
24786
|
+
if (outcome.id === FormModel.COMPLETE_OUTCOME) {
|
|
24775
24787
|
this.disableSaveButton = true;
|
|
24776
24788
|
this.disableCompleteButton = true;
|
|
24777
24789
|
this.completeTaskForm();
|
|
24778
24790
|
return true;
|
|
24779
24791
|
}
|
|
24780
|
-
if (outcome.id ===
|
|
24792
|
+
if (outcome.id === FormModel.START_PROCESS_OUTCOME) {
|
|
24781
24793
|
this.completeTaskForm();
|
|
24782
24794
|
return true;
|
|
24783
24795
|
}
|