verben-workflow-ui 0.5.98 → 0.6.0

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.
@@ -44,12 +44,21 @@ class FormControlComponent {
44
44
  }
45
45
  onFileSelect(data, property) {
46
46
  const files = data;
47
+ const isRemoval = files.every((x) => !x.size);
48
+ if (isRemoval) {
49
+ this.updateProperty(files, property);
50
+ return;
51
+ }
47
52
  if (!files || files.length === 0)
48
53
  return;
49
54
  const fileArray = [];
50
55
  const readers = [];
51
56
  for (let i = 0; i < files.length; i++) {
52
57
  const file = files[i];
58
+ // console.log({ File: file });
59
+ if (!file.size) {
60
+ continue;
61
+ }
53
62
  const reader = new FileReader();
54
63
  const promise = new Promise((resolve, reject) => {
55
64
  reader.onload = () => {
@@ -100,6 +109,12 @@ class FormControlComponent {
100
109
  const parts = fileUrl.split('.');
101
110
  return parts[parts.length - 1].toLowerCase();
102
111
  }
112
+ updateProperty(files, property) {
113
+ const values = files.map((x) => x.name);
114
+ const joinedResult = values.join(',');
115
+ property.Value = joinedResult;
116
+ this.cdr.detectChanges();
117
+ }
103
118
  async uploadFile(files, property) {
104
119
  this.utilService.sendBI(true);
105
120
  const res = await this.server.post(`SaveFiles`, files, this.envSvc.environment.FILE_BASE_URL);
@@ -110,7 +125,13 @@ class FormControlComponent {
110
125
  else {
111
126
  var result = res;
112
127
  const joinedResult = result.join(',');
113
- property.Value = joinedResult;
128
+ const updatedState = property.Value && property.Value.trim().length > 0
129
+ ? [property.Value, joinedResult]
130
+ : [joinedResult];
131
+ property.Value =
132
+ joinedResult.trim().length > 0
133
+ ? updatedState.join(',')
134
+ : property.Value;
114
135
  this.cdr.detectChanges();
115
136
  return result;
116
137
  }
@@ -124,13 +145,17 @@ class FormControlComponent {
124
145
  property.Options?.split(',').map((option) => option.trim());
125
146
  return property.Options?.split(',').map((option) => option.trim());
126
147
  }
127
- onSelectedFileChange(files) {
128
- }
148
+ onSelectedFileChange(files) { }
129
149
  getSelectedFilesIfAny(property) {
130
- var fileMock = {
131
- name: property.Value,
132
- };
133
- return property.Value.trim().length > 0 ? [fileMock] : [];
150
+ const fullList = property.Value.split(',').map((x) => {
151
+ return {
152
+ name: x,
153
+ };
154
+ });
155
+ // var fileMock: any = {
156
+ // name: property.Value,
157
+ // };
158
+ return property.Value.trim().length > 0 ? fullList : [];
134
159
  }
135
160
  selectedFilesMap = new Map();
136
161
  getFiles(property) {
@@ -140,11 +165,11 @@ class FormControlComponent {
140
165
  return this.selectedFilesMap.get(property);
141
166
  }
142
167
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormControlComponent, deps: [{ token: i1.HttpWebRequestService }, { token: i1.UtilService }, { token: i0.ChangeDetectorRef }, { token: i1.EnvironmentService }], target: i0.ɵɵFactoryTarget.Component });
143
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: FormControlComponent, selector: "form-control", inputs: { dataType: "dataType", value: "value", boolInputType: "boolInputType", formProperties: "formProperties", disabled: "disabled" }, ngImport: i0, template: "<div class=\"flex flex-col gap-6 w-full\">\n <div *ngFor=\"let property of formProperties\">\n <ng-container [ngSwitch]=\"property.DataType\">\n <!-- Text, URL, and Color -->\n <verbena-input\n *ngSwitchCase=\"'Text'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'MailAddress'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'email'\"\n [placeHolder]=\"'Enter email'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'URL'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'url'\"\n [placeHolder]=\"'https://example.com'\"\n ></verbena-input>\n <div *ngSwitchCase=\"'Colour'\">\n <label [htmlFor]=\"property.id\">\n {{ formatLabel(property) }}\n <span class=\"flex items-center gap-1\">\n <input\n [id]=\"property.id\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n class=\"block mt-2 w-[100px]\"\n [type]=\"'color'\"\n />\n <span\n *ngIf=\"property.Value !== ''\"\n class=\"font-semibold\"\n [style.color]=\"property.Value\"\n >:{{ property.Value }}</span\n >\n </span>\n </label>\n </div>\n <verbena-textarea\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'MultilineText'\"\n [label]=\"formatLabel(property)\"\n ></verbena-textarea>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'PhoneNumber'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n\n <!-- Numeric inputs -->\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Number'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'number'\"\n [placeHolder]=\"'Enter an integer'\"\n [max]=\"property.MaxValue\"\n [min]=\"property.MinValue\"\n ></verbena-input>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Decimal'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter decimal value'\"\n ></verbena-input>\n\n <!-- Boolean input -->\n <ng-container *ngSwitchCase=\"'YesNo'\">\n <label [htmlFor]=\"property.id\" class=\"block mb-2\">{{\n formatLabel(property)\n }}</label>\n <verbena-switch\n [disabled]=\"disabled || property.IsReadOnly\"\n [ngModel]=\"property.Value == 'true' || property.Value == 'True'\"\n (ngModelChange)=\"property.Value = $event.toString()\"\n [onText]=\"''\"\n [offText]=\"''\"\n [onColor]=\"'var(--vbn-color-text)'\"\n [label]=\"formatLabel(property)\"\n ></verbena-switch>\n </ng-container>\n\n <div *ngSwitchCase=\"'Video'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'video/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <video\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-full h-[100px] mt-3 rounded-md shadow\"\n ></video>\n </div>\n <div *ngSwitchCase=\"'Image'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'image/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <img\n class=\"w-[100px] mx-auto\"\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n />\n </div>\n <div *ngSwitchCase=\"'Audio'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'audio/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <audio\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"mt-3 w-full\"\n ></audio>\n </div>\n\n <div *ngSwitchCase=\"'SingleSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [placeholder]=\"property.Name\"\n [filter]=\"true\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'MultiSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [multiselect]=\"true\"\n [placeholder]=\"property.Name\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'SingleFileSelection'\">\n <file-upload\n [multiple]=\"false\"\n [selectedFiles]=\"getFiles(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [label]=\"formatLabel(property)\"\n ></file-upload>\n <ng-container [ngSwitch]=\"getFileExtension(property.Value)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'MultiFileSelection'\">\n <file-upload\n [disabled]=\"disabled || property.IsReadOnly\"\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [multiple]=\"true\"\n [label]=\"formatLabel(property)\"\n >\n </file-upload>\n\n <div *ngIf=\"property.Value !== ''\" class=\"flex flex-wrap gap-3 mt-3\">\n <div *ngFor=\"let file of getFileArray(property.Value)\">\n <ng-container [ngSwitch]=\"getFileExtension(file)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(file)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(file)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- Fallback for unsupported types -->\n <div *ngSwitchDefault>Unsupported data type: {{ property.DataType }}</div>\n </ng-container>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.DropDownComponent, selector: "verben-drop-down", inputs: ["options", "width", "overlayWidth", "showHorizontalLine", "horizontalLineColor", "optionLabel", "optionSubLabel", "optionValue", "placeholder", "invalidMessage", "errorPosition", "loadMoreCaption", "display", "showClear", "lazyLoad", "selectKey", "styleClass", "group", "multiselect", "filter", "avoidDuplication", "filterBy", "debounceTime", "minChar", "refPageSize", "disabled", "required", "load", "asyncLabel", "search"], outputs: ["optionsChange", "onChange", "onClick", "onClear"] }, { kind: "component", type: i4.VerbenaSwitchComponent, selector: "verbena-switch", inputs: ["label", "checked", "disabled", "offColor", "onColor", "onText", "offText", "width", "height", "customStyles"], outputs: ["change"] }, { kind: "component", type: i4.VerbenaInputComponent, selector: "verbena-input", inputs: ["disabled", "label", "placeHolder", "required", "svgPosition", "minLength", "maxLength", "type", "bgColor", "border", "borderRadius", "textColor", "value", "labelPosition", "labelColor", "disable", "readOnly", "min", "max", "showBorder", "showErrorMessage", "errorMessageColor", "errorBorderColor", "errorPosition", "svg", "fontSize", "svgWidth", "svgHeight", "svgColor", "capitalization", "inputContainerClass", "inputFieldClass", "passLength", "inputWrapperClass", "passwordToggle", "customErrorMessages", "icon", "textPass"], outputs: ["valueChange"] }, { kind: "component", type: i5.FileUploadComponent, selector: "file-upload", inputs: ["multiple", "label", "accept", "selectedFiles", "disabled"], outputs: ["selectedFilesChange"] }, { kind: "component", type: i4.VerbenaTextareaComponent, selector: "verbena-textarea", inputs: ["disabled", "label", "required", "rows", "cols", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "value", "errorMessageColor"], outputs: ["valueChange"] }] });
168
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: FormControlComponent, selector: "form-control", inputs: { dataType: "dataType", value: "value", boolInputType: "boolInputType", formProperties: "formProperties", disabled: "disabled" }, ngImport: i0, template: "<div class=\"flex flex-col gap-6 w-full\">\n <div *ngFor=\"let property of formProperties\">\n <ng-container [ngSwitch]=\"property.DataType\">\n <!-- Text, URL, and Color -->\n <verbena-input\n *ngSwitchCase=\"'Text'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'MailAddress'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'email'\"\n [placeHolder]=\"'Enter email'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'URL'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'url'\"\n [placeHolder]=\"'https://example.com'\"\n ></verbena-input>\n <div *ngSwitchCase=\"'Colour'\">\n <label [htmlFor]=\"property.id\">\n {{ formatLabel(property) }}\n <span class=\"flex items-center gap-1\">\n <input\n [id]=\"property.id\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n class=\"block mt-2 w-[100px]\"\n [type]=\"'color'\"\n />\n <span\n *ngIf=\"property.Value !== ''\"\n class=\"font-semibold\"\n [style.color]=\"property.Value\"\n >:{{ property.Value }}</span\n >\n </span>\n </label>\n </div>\n <verbena-textarea\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'MultilineText'\"\n [label]=\"formatLabel(property)\"\n ></verbena-textarea>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'PhoneNumber'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n\n <!-- Numeric inputs -->\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Number'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'number'\"\n [placeHolder]=\"'Enter an integer'\"\n [max]=\"property.MaxValue\"\n [min]=\"property.MinValue\"\n ></verbena-input>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Decimal'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter decimal value'\"\n ></verbena-input>\n\n <!-- Boolean input -->\n <ng-container *ngSwitchCase=\"'YesNo'\">\n <label [htmlFor]=\"property.id\" class=\"block mb-2\">{{\n formatLabel(property)\n }}</label>\n <verbena-switch\n [disabled]=\"disabled || property.IsReadOnly\"\n [ngModel]=\"property.Value == 'true' || property.Value == 'True'\"\n (ngModelChange)=\"property.Value = $event.toString()\"\n [onText]=\"''\"\n [offText]=\"''\"\n [onColor]=\"'var(--vbn-color-text)'\"\n [label]=\"formatLabel(property)\"\n ></verbena-switch>\n </ng-container>\n\n <div *ngSwitchCase=\"'Video'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'video/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <video\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-full h-[100px] mt-3 rounded-md shadow\"\n ></video>\n </div>\n <div *ngSwitchCase=\"'Image'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'image/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <img\n class=\"w-[100px] mx-auto\"\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n />\n </div>\n <div *ngSwitchCase=\"'Audio'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'audio/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <audio\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"mt-3 w-full\"\n ></audio>\n </div>\n\n <div *ngSwitchCase=\"'SingleSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [placeholder]=\"property.Name\"\n [filter]=\"true\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'MultiSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [multiselect]=\"true\"\n [placeholder]=\"property.Name\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'SingleFileSelection'\">\n <file-upload\n [multiple]=\"false\"\n [selectedFiles]=\"getFiles(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [label]=\"formatLabel(property)\"\n ></file-upload>\n <ng-container [ngSwitch]=\"getFileExtension(property.Value)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'MultiFileSelection'\">\n <file-upload\n [disabled]=\"disabled || property.IsReadOnly\"\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [multiple]=\"true\"\n [label]=\"formatLabel(property)\"\n >\n </file-upload>\n\n <div *ngIf=\"property.Value !== ''\" class=\"flex flex-wrap gap-3 mt-3\">\n <div *ngFor=\"let file of getFileArray(property.Value)\">\n <ng-container [ngSwitch]=\"getFileExtension(file)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'jpeg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(file)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(file)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- Fallback for unsupported types -->\n <div *ngSwitchDefault>Unsupported data type: {{ property.DataType }}</div>\n </ng-container>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.DropDownComponent, selector: "verben-drop-down", inputs: ["options", "width", "overlayWidth", "showHorizontalLine", "horizontalLineColor", "optionLabel", "optionSubLabel", "optionValue", "placeholder", "invalidMessage", "errorPosition", "loadMoreCaption", "display", "showClear", "lazyLoad", "selectKey", "styleClass", "group", "multiselect", "filter", "avoidDuplication", "filterBy", "debounceTime", "minChar", "refPageSize", "disabled", "required", "load", "asyncLabel", "search"], outputs: ["optionsChange", "onChange", "onClick", "onClear"] }, { kind: "component", type: i4.VerbenaSwitchComponent, selector: "verbena-switch", inputs: ["label", "checked", "disabled", "offColor", "onColor", "onText", "offText", "width", "height", "customStyles"], outputs: ["change"] }, { kind: "component", type: i4.VerbenaInputComponent, selector: "verbena-input", inputs: ["disabled", "label", "placeHolder", "required", "svgPosition", "minLength", "maxLength", "type", "bgColor", "border", "borderRadius", "textColor", "value", "labelPosition", "labelColor", "disable", "readOnly", "min", "max", "showBorder", "showErrorMessage", "errorMessageColor", "errorBorderColor", "errorPosition", "svg", "fontSize", "svgWidth", "svgHeight", "svgColor", "capitalization", "inputContainerClass", "inputFieldClass", "passLength", "inputWrapperClass", "passwordToggle", "customErrorMessages", "icon", "textPass"], outputs: ["valueChange"] }, { kind: "component", type: i5.FileUploadComponent, selector: "file-upload", inputs: ["multiple", "label", "accept", "selectedFiles", "disabled"], outputs: ["selectedFilesChange"] }, { kind: "component", type: i4.VerbenaTextareaComponent, selector: "verbena-textarea", inputs: ["disabled", "label", "required", "rows", "cols", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "value", "errorMessageColor"], outputs: ["valueChange"] }] });
144
169
  }
145
170
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormControlComponent, decorators: [{
146
171
  type: Component,
147
- args: [{ selector: 'form-control', template: "<div class=\"flex flex-col gap-6 w-full\">\n <div *ngFor=\"let property of formProperties\">\n <ng-container [ngSwitch]=\"property.DataType\">\n <!-- Text, URL, and Color -->\n <verbena-input\n *ngSwitchCase=\"'Text'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'MailAddress'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'email'\"\n [placeHolder]=\"'Enter email'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'URL'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'url'\"\n [placeHolder]=\"'https://example.com'\"\n ></verbena-input>\n <div *ngSwitchCase=\"'Colour'\">\n <label [htmlFor]=\"property.id\">\n {{ formatLabel(property) }}\n <span class=\"flex items-center gap-1\">\n <input\n [id]=\"property.id\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n class=\"block mt-2 w-[100px]\"\n [type]=\"'color'\"\n />\n <span\n *ngIf=\"property.Value !== ''\"\n class=\"font-semibold\"\n [style.color]=\"property.Value\"\n >:{{ property.Value }}</span\n >\n </span>\n </label>\n </div>\n <verbena-textarea\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'MultilineText'\"\n [label]=\"formatLabel(property)\"\n ></verbena-textarea>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'PhoneNumber'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n\n <!-- Numeric inputs -->\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Number'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'number'\"\n [placeHolder]=\"'Enter an integer'\"\n [max]=\"property.MaxValue\"\n [min]=\"property.MinValue\"\n ></verbena-input>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Decimal'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter decimal value'\"\n ></verbena-input>\n\n <!-- Boolean input -->\n <ng-container *ngSwitchCase=\"'YesNo'\">\n <label [htmlFor]=\"property.id\" class=\"block mb-2\">{{\n formatLabel(property)\n }}</label>\n <verbena-switch\n [disabled]=\"disabled || property.IsReadOnly\"\n [ngModel]=\"property.Value == 'true' || property.Value == 'True'\"\n (ngModelChange)=\"property.Value = $event.toString()\"\n [onText]=\"''\"\n [offText]=\"''\"\n [onColor]=\"'var(--vbn-color-text)'\"\n [label]=\"formatLabel(property)\"\n ></verbena-switch>\n </ng-container>\n\n <div *ngSwitchCase=\"'Video'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'video/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <video\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-full h-[100px] mt-3 rounded-md shadow\"\n ></video>\n </div>\n <div *ngSwitchCase=\"'Image'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'image/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <img\n class=\"w-[100px] mx-auto\"\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n />\n </div>\n <div *ngSwitchCase=\"'Audio'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'audio/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <audio\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"mt-3 w-full\"\n ></audio>\n </div>\n\n <div *ngSwitchCase=\"'SingleSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [placeholder]=\"property.Name\"\n [filter]=\"true\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'MultiSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [multiselect]=\"true\"\n [placeholder]=\"property.Name\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'SingleFileSelection'\">\n <file-upload\n [multiple]=\"false\"\n [selectedFiles]=\"getFiles(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [label]=\"formatLabel(property)\"\n ></file-upload>\n <ng-container [ngSwitch]=\"getFileExtension(property.Value)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'MultiFileSelection'\">\n <file-upload\n [disabled]=\"disabled || property.IsReadOnly\"\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [multiple]=\"true\"\n [label]=\"formatLabel(property)\"\n >\n </file-upload>\n\n <div *ngIf=\"property.Value !== ''\" class=\"flex flex-wrap gap-3 mt-3\">\n <div *ngFor=\"let file of getFileArray(property.Value)\">\n <ng-container [ngSwitch]=\"getFileExtension(file)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(file)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(file)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- Fallback for unsupported types -->\n <div *ngSwitchDefault>Unsupported data type: {{ property.DataType }}</div>\n </ng-container>\n </div>\n</div>\n" }]
172
+ args: [{ selector: 'form-control', template: "<div class=\"flex flex-col gap-6 w-full\">\n <div *ngFor=\"let property of formProperties\">\n <ng-container [ngSwitch]=\"property.DataType\">\n <!-- Text, URL, and Color -->\n <verbena-input\n *ngSwitchCase=\"'Text'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'MailAddress'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'email'\"\n [placeHolder]=\"'Enter email'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'URL'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'url'\"\n [placeHolder]=\"'https://example.com'\"\n ></verbena-input>\n <div *ngSwitchCase=\"'Colour'\">\n <label [htmlFor]=\"property.id\">\n {{ formatLabel(property) }}\n <span class=\"flex items-center gap-1\">\n <input\n [id]=\"property.id\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n class=\"block mt-2 w-[100px]\"\n [type]=\"'color'\"\n />\n <span\n *ngIf=\"property.Value !== ''\"\n class=\"font-semibold\"\n [style.color]=\"property.Value\"\n >:{{ property.Value }}</span\n >\n </span>\n </label>\n </div>\n <verbena-textarea\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'MultilineText'\"\n [label]=\"formatLabel(property)\"\n ></verbena-textarea>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'PhoneNumber'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n\n <!-- Numeric inputs -->\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Number'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'number'\"\n [placeHolder]=\"'Enter an integer'\"\n [max]=\"property.MaxValue\"\n [min]=\"property.MinValue\"\n ></verbena-input>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Decimal'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter decimal value'\"\n ></verbena-input>\n\n <!-- Boolean input -->\n <ng-container *ngSwitchCase=\"'YesNo'\">\n <label [htmlFor]=\"property.id\" class=\"block mb-2\">{{\n formatLabel(property)\n }}</label>\n <verbena-switch\n [disabled]=\"disabled || property.IsReadOnly\"\n [ngModel]=\"property.Value == 'true' || property.Value == 'True'\"\n (ngModelChange)=\"property.Value = $event.toString()\"\n [onText]=\"''\"\n [offText]=\"''\"\n [onColor]=\"'var(--vbn-color-text)'\"\n [label]=\"formatLabel(property)\"\n ></verbena-switch>\n </ng-container>\n\n <div *ngSwitchCase=\"'Video'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'video/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <video\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-full h-[100px] mt-3 rounded-md shadow\"\n ></video>\n </div>\n <div *ngSwitchCase=\"'Image'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'image/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <img\n class=\"w-[100px] mx-auto\"\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n />\n </div>\n <div *ngSwitchCase=\"'Audio'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'audio/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <audio\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"mt-3 w-full\"\n ></audio>\n </div>\n\n <div *ngSwitchCase=\"'SingleSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [placeholder]=\"property.Name\"\n [filter]=\"true\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'MultiSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [multiselect]=\"true\"\n [placeholder]=\"property.Name\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'SingleFileSelection'\">\n <file-upload\n [multiple]=\"false\"\n [selectedFiles]=\"getFiles(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [label]=\"formatLabel(property)\"\n ></file-upload>\n <ng-container [ngSwitch]=\"getFileExtension(property.Value)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'MultiFileSelection'\">\n <file-upload\n [disabled]=\"disabled || property.IsReadOnly\"\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [multiple]=\"true\"\n [label]=\"formatLabel(property)\"\n >\n </file-upload>\n\n <div *ngIf=\"property.Value !== ''\" class=\"flex flex-wrap gap-3 mt-3\">\n <div *ngFor=\"let file of getFileArray(property.Value)\">\n <ng-container [ngSwitch]=\"getFileExtension(file)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'jpeg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(file)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(file)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- Fallback for unsupported types -->\n <div *ngSwitchDefault>Unsupported data type: {{ property.DataType }}</div>\n </ng-container>\n </div>\n</div>\n" }]
148
173
  }], ctorParameters: () => [{ type: i1.HttpWebRequestService }, { type: i1.UtilService }, { type: i0.ChangeDetectorRef }, { type: i1.EnvironmentService }], propDecorators: { dataType: [{
149
174
  type: Input
150
175
  }], value: [{
@@ -1 +1 @@
1
- {"version":3,"file":"verben-workflow-ui-src-lib-components-form-control.mjs","sources":["../../../projects/verben-workflow-ui/src/lib/components/form-control/form-control.component.ts","../../../projects/verben-workflow-ui/src/lib/components/form-control/form-control.component.html","../../../projects/verben-workflow-ui/src/lib/components/form-control/form-control.module.ts","../../../projects/verben-workflow-ui/src/lib/components/form-control/verben-workflow-ui-src-lib-components-form-control.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport {\n ErrorResponse,\n FormProperty,\n ObjectState,\n} from 'verben-workflow-ui/src/lib/models';\nimport { DataType, File as FileData } from 'verben-workflow-ui/src/lib/models';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport {\n HttpWebRequestService,\n UtilService,\n} from 'verben-workflow-ui/src/lib/services';\nimport { EnvironmentService } from 'verben-workflow-ui/src/lib/services';\nimport { ChangeDetectorRef } from '@angular/core';\nexport type BoolInputType = 'switch' | 'checkbox' | 'radio';\n\n@Component({\n selector: 'form-control',\n templateUrl: './form-control.component.html',\n styleUrls: ['./form-control.component.css'],\n})\nexport class FormControlComponent implements OnInit {\n @Input() dataType!: DataType;\n @Input() value: any = '';\n @Input() boolInputType: BoolInputType = 'checkbox';\n @Input() formProperties: FormProperty[] = [];\n @Input() disabled: boolean = false;\n\n fileBaseUrl: string = '';\n fileUrl: string = '';\n constructor(\n private server: HttpWebRequestService,\n private utilService: UtilService,\n private cdr: ChangeDetectorRef,\n private envSvc: EnvironmentService,\n ) {\n this.fileBaseUrl = this.envSvc.environment.FILE_BASE_URL;\n this.fileUrl = this.envSvc.environment.FILE_URL;\n }\n\n ngOnInit(): void {\n this.initializeDefaultValue();\n }\n\n initializeDefaultValue() {\n if (this.dataType === DataType.YesNo && this.value === '') {\n this.value = false;\n } else if (!this.value) {\n this.value = '';\n }\n }\n onFileSelect(data: any, property: FormProperty): void {\n const files: any = data;\n\n if (!files || files.length === 0) return;\n\n const fileArray: FileData[] = [];\n const readers: Promise<void>[] = [];\n\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const reader = new FileReader();\n\n const promise = new Promise<void>((resolve, reject) => {\n reader.onload = () => {\n const base64 = reader.result as string;\n fileArray.push({\n Extension: file.name.split('.').pop(),\n Name: this.generateRandomCode(),\n Data: base64,\n DataState: ObjectState.New,\n });\n resolve();\n };\n\n reader.onerror = (error) => reject(error);\n reader.readAsDataURL(file);\n });\n\n readers.push(promise);\n }\n\n Promise.all(readers).then(() => {\n this.uploadFile(fileArray, property);\n });\n }\n private generateRandomCode(length: number = 10): string {\n const chars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return result;\n }\n setPreview(val: string): string {\n if (!val) return '';\n const first = val.split(',')[0].trim();\n\n if (first.startsWith('http') || first.startsWith('data:')) {\n return first;\n }\n return `${this.envSvc.environment.FILE_URL}/${first}`;\n }\n\n getFileArray(value: string): string[] {\n if (!value) return [];\n return value\n .split(',')\n .map((v) => v.trim())\n .filter((v) => v);\n }\n\n getFileExtension(fileUrl: string): string {\n const parts = fileUrl.split('.');\n return parts[parts.length - 1].toLowerCase();\n }\n\n async uploadFile(\n files: FileData[],\n property: FormProperty,\n ): Promise<any[] | undefined> {\n this.utilService.sendBI(true);\n const res = await this.server.post(\n `SaveFiles`,\n files,\n this.envSvc.environment.FILE_BASE_URL,\n );\n this.utilService.sendBI(false);\n if (res instanceof ErrorResponse) {\n return undefined;\n } else {\n var result = res as any;\n const joinedResult = result.join(',');\n property.Value = joinedResult;\n\n this.cdr.detectChanges();\n return result;\n }\n }\n formatLabel(property: any): string {\n return property.IsRequired\n ? `${property.Name} *`\n : `${property.Name} (Optional)`;\n }\n optionsArray(property: any) {\n property.Options?.split(',').map((option: any) => option.trim());\n return property.Options?.split(',').map((option: any) => option.trim());\n }\n onSelectedFileChange(files: File[]) {\n }\n\n getSelectedFilesIfAny(property: FormProperty): File[] {\n var fileMock: any = {\n name: property.Value,\n };\n\n return property.Value.trim().length > 0 ? [fileMock] : [];\n }\n\n selectedFilesMap = new Map<any, File[]>();\n\n getFiles(property: any): File[] {\n if (!this.selectedFilesMap.has(property)) {\n this.selectedFilesMap.set(property, this.getSelectedFilesIfAny(property));\n }\n return this.selectedFilesMap.get(property)!;\n }\n}\n","<div class=\"flex flex-col gap-6 w-full\">\n <div *ngFor=\"let property of formProperties\">\n <ng-container [ngSwitch]=\"property.DataType\">\n <!-- Text, URL, and Color -->\n <verbena-input\n *ngSwitchCase=\"'Text'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'MailAddress'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'email'\"\n [placeHolder]=\"'Enter email'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'URL'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'url'\"\n [placeHolder]=\"'https://example.com'\"\n ></verbena-input>\n <div *ngSwitchCase=\"'Colour'\">\n <label [htmlFor]=\"property.id\">\n {{ formatLabel(property) }}\n <span class=\"flex items-center gap-1\">\n <input\n [id]=\"property.id\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n class=\"block mt-2 w-[100px]\"\n [type]=\"'color'\"\n />\n <span\n *ngIf=\"property.Value !== ''\"\n class=\"font-semibold\"\n [style.color]=\"property.Value\"\n >:{{ property.Value }}</span\n >\n </span>\n </label>\n </div>\n <verbena-textarea\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'MultilineText'\"\n [label]=\"formatLabel(property)\"\n ></verbena-textarea>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'PhoneNumber'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n\n <!-- Numeric inputs -->\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Number'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'number'\"\n [placeHolder]=\"'Enter an integer'\"\n [max]=\"property.MaxValue\"\n [min]=\"property.MinValue\"\n ></verbena-input>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Decimal'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter decimal value'\"\n ></verbena-input>\n\n <!-- Boolean input -->\n <ng-container *ngSwitchCase=\"'YesNo'\">\n <label [htmlFor]=\"property.id\" class=\"block mb-2\">{{\n formatLabel(property)\n }}</label>\n <verbena-switch\n [disabled]=\"disabled || property.IsReadOnly\"\n [ngModel]=\"property.Value == 'true' || property.Value == 'True'\"\n (ngModelChange)=\"property.Value = $event.toString()\"\n [onText]=\"''\"\n [offText]=\"''\"\n [onColor]=\"'var(--vbn-color-text)'\"\n [label]=\"formatLabel(property)\"\n ></verbena-switch>\n </ng-container>\n\n <div *ngSwitchCase=\"'Video'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'video/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <video\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-full h-[100px] mt-3 rounded-md shadow\"\n ></video>\n </div>\n <div *ngSwitchCase=\"'Image'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'image/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <img\n class=\"w-[100px] mx-auto\"\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n />\n </div>\n <div *ngSwitchCase=\"'Audio'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'audio/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <audio\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"mt-3 w-full\"\n ></audio>\n </div>\n\n <div *ngSwitchCase=\"'SingleSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [placeholder]=\"property.Name\"\n [filter]=\"true\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'MultiSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [multiselect]=\"true\"\n [placeholder]=\"property.Name\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'SingleFileSelection'\">\n <file-upload\n [multiple]=\"false\"\n [selectedFiles]=\"getFiles(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [label]=\"formatLabel(property)\"\n ></file-upload>\n <ng-container [ngSwitch]=\"getFileExtension(property.Value)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'MultiFileSelection'\">\n <file-upload\n [disabled]=\"disabled || property.IsReadOnly\"\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [multiple]=\"true\"\n [label]=\"formatLabel(property)\"\n >\n </file-upload>\n\n <div *ngIf=\"property.Value !== ''\" class=\"flex flex-wrap gap-3 mt-3\">\n <div *ngFor=\"let file of getFileArray(property.Value)\">\n <ng-container [ngSwitch]=\"getFileExtension(file)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(file)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(file)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- Fallback for unsupported types -->\n <div *ngSwitchDefault>Unsupported data type: {{ property.DataType }}</div>\n </ng-container>\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport {\n CardDataViewModule,\n DataExportModule,\n DataTableModule,\n DataViewModule,\n DropDownModule,\n SortTableModule,\n SvgModule,\n TableFilterModule,\n VerbenaButtonModule,\n VerbenaInputModule,\n VerbenaSwitchModule,\n VerbenaTextareaModule,\n VerbenPopUpModule,\n VisibleColumnModule,\n} from 'verben-ng-ui';\nimport { FormControlComponent } from './form-control.component';\nimport { FileUploadModule } from 'verben-workflow-ui/src/lib/components/file-upload';\n@NgModule({\n declarations: [FormControlComponent],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n DataTableModule,\n SvgModule,\n VerbenPopUpModule,\n DataViewModule,\n VerbenaButtonModule,\n CardDataViewModule,\n DropDownModule,\n VerbenaSwitchModule,\n TableFilterModule,\n VisibleColumnModule,\n SortTableModule,\n DataExportModule,\n VerbenaInputModule,\n FileUploadModule,\n VerbenaTextareaModule,\n ],\n exports: [FormControlComponent],\n})\nexport class FormControlerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAqBa,oBAAoB,CAAA;AAUrB,IAAA,MAAA,CAAA;AACA,IAAA,WAAA,CAAA;AACA,IAAA,GAAA,CAAA;AACA,IAAA,MAAA,CAAA;AAZD,IAAA,QAAQ,CAAY;IACpB,KAAK,GAAQ,EAAE,CAAC;IAChB,aAAa,GAAkB,UAAU,CAAC;IAC1C,cAAc,GAAmB,EAAE,CAAC;IACpC,QAAQ,GAAY,KAAK,CAAC;IAEnC,WAAW,GAAW,EAAE,CAAC;IACzB,OAAO,GAAW,EAAE,CAAC;AACrB,IAAA,WAAA,CACU,MAA6B,E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B;YACjB,cAAc;YACd,mBAAmB;YACnB,kBAAkB;YAClB,cAAc;YACd,mBAAmB;YACnB,iBAAiB;YACjB,mBAAmB;YACnB,eAAe;YACf,gBAAgB;YAChB,kBAAkB;YAClB,gBAAgB;YAChB,qBAAqB,CAAA,EAAA,CAAA,CAAA;;4FAIZ,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAxB/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;AACpC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,eAAe;wBACf,SAAS;wBACT,iBAAiB;wBACjB,cAAc;wBACd,mBAAmB;wBACnB,kBAAkB;wBAClB,cAAc;wBACd,mBAAmB;wBACnB,iBAAiB;wBACjB,mBAAmB;wBACnB,eAAe;wBACf,gBAAgB;wBAChB,kBAAkB;wBAClB,gBAAgB;wBAChB,qBAAqB;AACtB,qBAAA;oBACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAChC,iBAAA,CAAA;;;AC7CD;;AAEG;;;;"}
1
+ {"version":3,"file":"verben-workflow-ui-src-lib-components-form-control.mjs","sources":["../../../projects/verben-workflow-ui/src/lib/components/form-control/form-control.component.ts","../../../projects/verben-workflow-ui/src/lib/components/form-control/form-control.component.html","../../../projects/verben-workflow-ui/src/lib/components/form-control/form-control.module.ts","../../../projects/verben-workflow-ui/src/lib/components/form-control/verben-workflow-ui-src-lib-components-form-control.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport {\n ErrorResponse,\n FormProperty,\n ObjectState,\n} from 'verben-workflow-ui/src/lib/models';\nimport { DataType, File as FileData } from 'verben-workflow-ui/src/lib/models';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport {\n HttpWebRequestService,\n UtilService,\n} from 'verben-workflow-ui/src/lib/services';\nimport { EnvironmentService } from 'verben-workflow-ui/src/lib/services';\nimport { ChangeDetectorRef } from '@angular/core';\nexport type BoolInputType = 'switch' | 'checkbox' | 'radio';\n\n@Component({\n selector: 'form-control',\n templateUrl: './form-control.component.html',\n styleUrls: ['./form-control.component.css'],\n})\nexport class FormControlComponent implements OnInit {\n @Input() dataType!: DataType;\n @Input() value: any = '';\n @Input() boolInputType: BoolInputType = 'checkbox';\n @Input() formProperties: FormProperty[] = [];\n @Input() disabled: boolean = false;\n\n fileBaseUrl: string = '';\n fileUrl: string = '';\n constructor(\n private server: HttpWebRequestService,\n private utilService: UtilService,\n private cdr: ChangeDetectorRef,\n private envSvc: EnvironmentService,\n ) {\n this.fileBaseUrl = this.envSvc.environment.FILE_BASE_URL;\n this.fileUrl = this.envSvc.environment.FILE_URL;\n }\n\n ngOnInit(): void {\n this.initializeDefaultValue();\n }\n\n initializeDefaultValue() {\n if (this.dataType === DataType.YesNo && this.value === '') {\n this.value = false;\n } else if (!this.value) {\n this.value = '';\n }\n }\n onFileSelect(data: any, property: FormProperty): void {\n const files: any[] = data;\n\n const isRemoval = files.every((x) => !x.size);\n if (isRemoval) {\n this.updateProperty(files, property);\n return;\n }\n\n if (!files || files.length === 0) return;\n\n const fileArray: FileData[] = [];\n const readers: Promise<void>[] = [];\n\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n // console.log({ File: file });\n if (!file.size) {\n continue;\n }\n const reader = new FileReader();\n\n const promise = new Promise<void>((resolve, reject) => {\n reader.onload = () => {\n const base64 = reader.result as string;\n fileArray.push({\n Extension: file.name.split('.').pop(),\n Name: this.generateRandomCode(),\n Data: base64,\n DataState: ObjectState.New,\n });\n resolve();\n };\n\n reader.onerror = (error) => reject(error);\n reader.readAsDataURL(file);\n });\n\n readers.push(promise);\n }\n\n Promise.all(readers).then(() => {\n this.uploadFile(fileArray, property);\n });\n }\n private generateRandomCode(length: number = 10): string {\n const chars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return result;\n }\n setPreview(val: string): string {\n if (!val) return '';\n const first = val.split(',')[0].trim();\n\n if (first.startsWith('http') || first.startsWith('data:')) {\n return first;\n }\n return `${this.envSvc.environment.FILE_URL}/${first}`;\n }\n\n getFileArray(value: string): string[] {\n if (!value) return [];\n return value\n .split(',')\n .map((v) => v.trim())\n .filter((v) => v);\n }\n\n getFileExtension(fileUrl: string): string {\n const parts = fileUrl.split('.');\n return parts[parts.length - 1].toLowerCase();\n }\n\n updateProperty(files: File[], property: FormProperty) {\n const values = files.map((x) => x.name);\n const joinedResult = values.join(',');\n property.Value = joinedResult;\n this.cdr.detectChanges();\n }\n\n async uploadFile(\n files: FileData[],\n property: FormProperty,\n ): Promise<any[] | undefined> {\n this.utilService.sendBI(true);\n const res = await this.server.post(\n `SaveFiles`,\n files,\n this.envSvc.environment.FILE_BASE_URL,\n );\n this.utilService.sendBI(false);\n if (res instanceof ErrorResponse) {\n return undefined;\n } else {\n var result = res as string[];\n const joinedResult = result.join(',');\n const updatedState =\n property.Value && property.Value.trim().length > 0\n ? [property.Value, joinedResult]\n : [joinedResult];\n property.Value =\n joinedResult.trim().length > 0\n ? updatedState.join(',')\n : property.Value;\n\n this.cdr.detectChanges();\n return result;\n }\n }\n formatLabel(property: any): string {\n return property.IsRequired\n ? `${property.Name} *`\n : `${property.Name} (Optional)`;\n }\n optionsArray(property: any) {\n property.Options?.split(',').map((option: any) => option.trim());\n return property.Options?.split(',').map((option: any) => option.trim());\n }\n onSelectedFileChange(files: File[]) {}\n\n getSelectedFilesIfAny(property: FormProperty): File[] {\n const fullList = property.Value.split(',').map((x: string) => {\n return {\n name: x,\n };\n });\n // var fileMock: any = {\n // name: property.Value,\n // };\n\n return property.Value.trim().length > 0 ? fullList : [];\n }\n\n selectedFilesMap = new Map<any, File[]>();\n\n getFiles(property: any): File[] {\n if (!this.selectedFilesMap.has(property)) {\n this.selectedFilesMap.set(property, this.getSelectedFilesIfAny(property));\n }\n return this.selectedFilesMap.get(property)!;\n }\n}\n","<div class=\"flex flex-col gap-6 w-full\">\n <div *ngFor=\"let property of formProperties\">\n <ng-container [ngSwitch]=\"property.DataType\">\n <!-- Text, URL, and Color -->\n <verbena-input\n *ngSwitchCase=\"'Text'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'MailAddress'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'email'\"\n [placeHolder]=\"'Enter email'\"\n ></verbena-input>\n <verbena-input\n *ngSwitchCase=\"'URL'\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [type]=\"'url'\"\n [placeHolder]=\"'https://example.com'\"\n ></verbena-input>\n <div *ngSwitchCase=\"'Colour'\">\n <label [htmlFor]=\"property.id\">\n {{ formatLabel(property) }}\n <span class=\"flex items-center gap-1\">\n <input\n [id]=\"property.id\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n class=\"block mt-2 w-[100px]\"\n [type]=\"'color'\"\n />\n <span\n *ngIf=\"property.Value !== ''\"\n class=\"font-semibold\"\n [style.color]=\"property.Value\"\n >:{{ property.Value }}</span\n >\n </span>\n </label>\n </div>\n <verbena-textarea\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'MultilineText'\"\n [label]=\"formatLabel(property)\"\n ></verbena-textarea>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'PhoneNumber'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter text'\"\n ></verbena-input>\n\n <!-- Numeric inputs -->\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Number'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'number'\"\n [placeHolder]=\"'Enter an integer'\"\n [max]=\"property.MaxValue\"\n [min]=\"property.MinValue\"\n ></verbena-input>\n <verbena-input\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n *ngSwitchCase=\"'Decimal'\"\n [label]=\"formatLabel(property)\"\n [type]=\"'text'\"\n [placeHolder]=\"'Enter decimal value'\"\n ></verbena-input>\n\n <!-- Boolean input -->\n <ng-container *ngSwitchCase=\"'YesNo'\">\n <label [htmlFor]=\"property.id\" class=\"block mb-2\">{{\n formatLabel(property)\n }}</label>\n <verbena-switch\n [disabled]=\"disabled || property.IsReadOnly\"\n [ngModel]=\"property.Value == 'true' || property.Value == 'True'\"\n (ngModelChange)=\"property.Value = $event.toString()\"\n [onText]=\"''\"\n [offText]=\"''\"\n [onColor]=\"'var(--vbn-color-text)'\"\n [label]=\"formatLabel(property)\"\n ></verbena-switch>\n </ng-container>\n\n <div *ngSwitchCase=\"'Video'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'video/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <video\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-full h-[100px] mt-3 rounded-md shadow\"\n ></video>\n </div>\n <div *ngSwitchCase=\"'Image'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'image/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <img\n class=\"w-[100px] mx-auto\"\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n />\n </div>\n <div *ngSwitchCase=\"'Audio'\">\n <file-upload\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n [label]=\"formatLabel(property)\"\n [accept]=\"'audio/*'\"\n [multiple]=\"false\"\n ></file-upload>\n <audio\n *ngIf=\"property.Value !== ''\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"mt-3 w-full\"\n ></audio>\n </div>\n\n <div *ngSwitchCase=\"'SingleSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [placeholder]=\"property.Name\"\n [filter]=\"true\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'MultiSelection'\">\n <div class=\"mb-2\">{{ formatLabel(property) }}</div>\n <verben-drop-down\n width=\"100%\"\n [multiselect]=\"true\"\n [placeholder]=\"property.Name\"\n [options]=\"optionsArray(property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [(ngModel)]=\"property.Value\"\n ></verben-drop-down>\n </div>\n <div *ngSwitchCase=\"'SingleFileSelection'\">\n <file-upload\n [multiple]=\"false\"\n [selectedFiles]=\"getFiles(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [disabled]=\"disabled || property.IsReadOnly\"\n [label]=\"formatLabel(property)\"\n ></file-upload>\n <ng-container [ngSwitch]=\"getFileExtension(property.Value)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(property.Value)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(property.Value)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'MultiFileSelection'\">\n <file-upload\n [disabled]=\"disabled || property.IsReadOnly\"\n [selectedFiles]=\"getSelectedFilesIfAny(property)\"\n (selectedFilesChange)=\"onFileSelect($event, property)\"\n [multiple]=\"true\"\n [label]=\"formatLabel(property)\"\n >\n </file-upload>\n\n <div *ngIf=\"property.Value !== ''\" class=\"flex flex-wrap gap-3 mt-3\">\n <div *ngFor=\"let file of getFileArray(property.Value)\">\n <ng-container [ngSwitch]=\"getFileExtension(file)\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'jpeg'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"setPreview(file)\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"setPreview(file)\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"setPreview(file)\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- Fallback for unsupported types -->\n <div *ngSwitchDefault>Unsupported data type: {{ property.DataType }}</div>\n </ng-container>\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport {\n CardDataViewModule,\n DataExportModule,\n DataTableModule,\n DataViewModule,\n DropDownModule,\n SortTableModule,\n SvgModule,\n TableFilterModule,\n VerbenaButtonModule,\n VerbenaInputModule,\n VerbenaSwitchModule,\n VerbenaTextareaModule,\n VerbenPopUpModule,\n VisibleColumnModule,\n} from 'verben-ng-ui';\nimport { FormControlComponent } from './form-control.component';\nimport { FileUploadModule } from 'verben-workflow-ui/src/lib/components/file-upload';\n@NgModule({\n declarations: [FormControlComponent],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n DataTableModule,\n SvgModule,\n VerbenPopUpModule,\n DataViewModule,\n VerbenaButtonModule,\n CardDataViewModule,\n DropDownModule,\n VerbenaSwitchModule,\n TableFilterModule,\n VisibleColumnModule,\n SortTableModule,\n DataExportModule,\n VerbenaInputModule,\n FileUploadModule,\n VerbenaTextareaModule,\n ],\n exports: [FormControlComponent],\n})\nexport class FormControlerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAqBa,oBAAoB,CAAA;AAUrB,IAAA,MAAA,CAAA;AACA,IAAA,WAAA,CAAA;AACA,IAAA,GAAA,CAAA;AACA,IAAA,MAAA,CAAA;AAZD,IAAA,QAAQ,CAAY;IACpB,KAAK,GAAQ,EAAE,CAAC;IAChB,aAAa,GAAkB,UAAU,CAAC;IAC1C,cAAc,GAAmB,EAAE,CAAC;IACpC,QAAQ,GAAY,KAAK,CAAC;IAEnC,WAAW,GAAW,EAAE,CAAC;IACzB,OAAO,GAAW,EAAE,CAAC;AACrB,IAAA,WAAA,CACU,MAA6B,EAC7B,WAAwB,EACxB,GAAsB,EACtB,MAA0B,EAAA;QAH1B,IAAM,CAAA,MAAA,GAAN,MAAM,CAAuB;QAC7B,IAAW,CAAA,WAAA,GAAX,WAAW,CAAa;QACxB,IAAG,CAAA,GAAA,GAAH,GAAG,CAAmB;QACtB,IAAM,CAAA,MAAA,GAA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BACnB,eAAe;wBACf,SAAS;wBACT,iBAAiB;wBACjB,cAAc;wBACd,mBAAmB;wBACnB,kBAAkB;wBAClB,cAAc;wBACd,mBAAmB;wBACnB,iBAAiB;wBACjB,mBAAmB;wBACnB,eAAe;wBACf,gBAAgB;wBAChB,kBAAkB;wBAClB,gBAAgB;wBAChB,qBAAqB;AACtB,qBAAA;oBACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAChC,iBAAA,CAAA;;;AC7CD;;AAEG;;;;"}
@@ -957,11 +957,11 @@ class TasksFormComponent {
957
957
  this.utilService.showSuccess('Task followed successfully');
958
958
  }
959
959
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TasksFormComponent, deps: [{ token: i1.FormBuilder }, { token: i2.TaskFacade }, { token: i3.EnvironmentService }, { token: i3.UtilService }, { token: MyQueueState }, { token: i5.OperationPopupService }], target: i0.ɵɵFactoryTarget.Component });
960
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TasksFormComponent, selector: "tasks-form", inputs: { currentData: "currentData", readOnly: "readOnly" }, outputs: { onTaskFormSave: "onTaskFormSave", onSave: "onSave" }, ngImport: i0, template: "@if (taskFormView && taskForm) {\n <div\n *ngIf=\"taskForm.Entities[active]\"\n class=\"flex flex-wrap bg-[#9A9FBF80] rounded-xl px-3 py-2 w-full relative gap-6\"\n >\n <app-form-timer></app-form-timer>\n <div *ngFor=\"let group of taskForm.Entities; let index = index\">\n <p\n (click)=\"active = index\"\n [ngClass]=\"{\n 'bg-[var(--vbn-color-surface)] text-primary rounded-lg shadow-lg':\n active === index,\n }\"\n class=\"px-6 py-2 cursor-pointer\"\n >\n {{ group.Name }}group\n </p>\n </div>\n </div>\n\n <div *ngIf=\"taskForm.Entities[active]; else emptyState\" class=\"mt-4\">\n <form-control\n [dataType]=\"dataType\"\n [formProperties]=\"taskForm.Entities[active].Properties\"\n ></form-control>\n\n <div class=\"flex gap-3 justify-end\">\n <verbena-button\n (click)=\"areRequiredPropertiesFilled()\"\n text=\"CHECK\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n (click)=\"taskFormView = false\"\n text=\"Close task form\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"sendTaskForm()\"\n [disable]=\"!areRequiredPropertiesFilled()\"\n text=\"Save\"\n ></verbena-button>\n </div>\n </div>\n\n <!-- Empty state template -->\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n} @else {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col px-3 pb-3 rounded-xl h-full w-full relative space-y-4\"\n (ngSubmit)=\"handleSubmit()\"\n >\n <verbena-input\n name=\"Name\"\n label=\"Name\"\n formControlName=\"Name\"\n placeHolder=\"Enter Name\"\n />\n <verbena-input\n name=\"Description\"\n label=\"Description\"\n formControlName=\"Description\"\n placeHolder=\"Enter Description\"\n />\n\n <div class=\"space-y-1\">\n <label for=\"workflow\">Workflow</label>\n\n <verben-drop-down\n label=\"Workflow\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n placeholder=\"Select\"\n [options]=\"workflows\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n id=\"workflow\"\n formControlName=\"WorkflowCode\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"status\">Status</label>\n\n <verben-drop-down\n label=\"Status\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n [showClear]=\"true\"\n placeholder=\"Null\"\n [(options)]=\"statuses\"\n id=\"status\"\n formControlName=\"Status\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <!-- buttons -->\n <div class=\"flex justify-between gap-4 my-2\">\n <div class=\"flex gap-3\">\n <div *ngIf=\"currentData && getRoute(currentData.data) as workflowRoute\">\n <ng-container\n *ngIf=\"\n currentData && workflowRoute && workflowRoute.trim().length > 0\n \"\n >\n <verbena-button\n *ngIf=\"currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"viewSource(currentData.data, workflowRoute)\"\n text=\"View Source Data\"\n ></verbena-button>\n </ng-container>\n </div>\n <verbena-button\n *ngIf=\"currentData && currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"followTask(currentData.data)\"\n text=\"Follow Task\"\n ></verbena-button>\n </div>\n\n <!-- <verbena-button\n width=\"114px\"\n height=\"39px\"\n text=\"Delete\"\n bgColor=\"var(--vbn-color-text-muted)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button> -->\n <!-- <verbena-button\n [disable]=\"!taskForm || loadingTaskForm\"\n (click)=\"taskFormView = true\"\n [text]=\"loadingTaskForm ? 'Checking for form' : 'Fill task form'\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button> -->\n <verbena-button\n *ngIf=\"!readOnly\"\n type=\"submit\"\n text=\"Save\"\n bgColor=\"var(--vbn-color-primary)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n pd=\"10px 20px\"\n width=\"114px\"\n height=\"39px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button>\n </div>\n </form>\n}\n", dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5$1.VerbenaInputComponent, selector: "verbena-input", inputs: ["disabled", "label", "placeHolder", "required", "svgPosition", "minLength", "maxLength", "type", "bgColor", "border", "borderRadius", "textColor", "value", "labelPosition", "labelColor", "disable", "readOnly", "min", "max", "showBorder", "showErrorMessage", "errorMessageColor", "errorBorderColor", "errorPosition", "svg", "fontSize", "svgWidth", "svgHeight", "svgColor", "capitalization", "inputContainerClass", "inputFieldClass", "passLength", "inputWrapperClass", "passwordToggle", "customErrorMessages", "icon", "textPass"], outputs: ["valueChange"] }, { kind: "component", type: i5$1.VerbenaButtonComponent, selector: "verbena-button", inputs: ["type", "text", "icon", "useIcon", "svgPosition", "iconPosition", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "fontSize", "fontWeight", "disable", "svgSize", "weight", "variant", "styleType", "svg", "svgWidth", "svgHeight", "iconColor", "svgColor", "buttonClass", "buttonTextClass", "isLoading", "spinnerSize", "spinnerColor"] }, { kind: "component", type: i5$1.DropDownComponent, selector: "verben-drop-down", inputs: ["options", "width", "overlayWidth", "showHorizontalLine", "horizontalLineColor", "optionLabel", "optionSubLabel", "optionValue", "placeholder", "invalidMessage", "errorPosition", "loadMoreCaption", "display", "showClear", "lazyLoad", "selectKey", "styleClass", "group", "multiselect", "filter", "avoidDuplication", "filterBy", "debounceTime", "minChar", "refPageSize", "disabled", "required", "load", "asyncLabel", "search"], outputs: ["optionsChange", "onChange", "onClick", "onClear"] }, { kind: "component", type: i8.FormControlComponent, selector: "form-control", inputs: ["dataType", "value", "boolInputType", "formProperties", "disabled"] }, { kind: "component", type: i9.FormTimerComponent, selector: "app-form-timer", inputs: ["expiryDate"] }] });
960
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TasksFormComponent, selector: "tasks-form", inputs: { currentData: "currentData", readOnly: "readOnly" }, outputs: { onTaskFormSave: "onTaskFormSave", onSave: "onSave" }, ngImport: i0, template: "@if (taskFormView && taskForm) {\n <div\n *ngIf=\"taskForm.Entities[active]\"\n class=\"flex flex-wrap bg-[#9A9FBF80] rounded-xl px-3 py-2 w-full relative gap-6\"\n >\n <app-form-timer></app-form-timer>\n <div *ngFor=\"let group of taskForm.Entities; let index = index\">\n <p\n (click)=\"active = index\"\n [ngClass]=\"{\n 'bg-[var(--vbn-color-surface)] text-primary rounded-lg shadow-lg':\n active === index,\n }\"\n class=\"px-6 py-2 cursor-pointer\"\n >\n {{ group.Name }}group\n </p>\n </div>\n </div>\n\n <div *ngIf=\"taskForm.Entities[active]; else emptyState\" class=\"mt-4\">\n <form-control\n [dataType]=\"dataType\"\n [formProperties]=\"taskForm.Entities[active].Properties\"\n ></form-control>\n\n <div class=\"flex gap-3 justify-end\">\n <verbena-button\n (click)=\"areRequiredPropertiesFilled()\"\n text=\"CHECK\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n (click)=\"taskFormView = false\"\n text=\"Close task form\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"sendTaskForm()\"\n [disable]=\"!areRequiredPropertiesFilled()\"\n text=\"Save\"\n ></verbena-button>\n </div>\n </div>\n\n <!-- Empty state template -->\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n} @else {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col px-3 pb-3 rounded-xl h-full w-full relative space-y-4\"\n (ngSubmit)=\"handleSubmit()\"\n >\n <verbena-input\n name=\"Name\"\n label=\"Name\"\n formControlName=\"Name\"\n placeHolder=\"Enter Name\"\n />\n <verbena-input\n name=\"Description\"\n label=\"Description\"\n formControlName=\"Description\"\n placeHolder=\"Enter Description\"\n />\n\n <div class=\"space-y-1\">\n <label for=\"workflow\">Workflow</label>\n\n <verben-drop-down\n label=\"Workflow\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n placeholder=\"Select\"\n [options]=\"workflows\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n id=\"workflow\"\n formControlName=\"WorkflowCode\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"status\">Status</label>\n\n <verben-drop-down\n label=\"Status\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n [showClear]=\"true\"\n placeholder=\"Null\"\n [(options)]=\"statuses\"\n id=\"status\"\n formControlName=\"Status\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <!-- buttons -->\n <div class=\"flex justify-between gap-4 my-2\">\n <div class=\"flex gap-3\">\n <div *ngIf=\"currentData && getRoute(currentData.data) as workflowRoute\">\n <ng-container\n *ngIf=\"\n currentData && workflowRoute && workflowRoute.trim().length > 0\n \"\n >\n <verbena-button\n *ngIf=\"currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"viewSource(currentData.data, workflowRoute)\"\n text=\"View Source Data\"\n ></verbena-button>\n </ng-container>\n </div>\n <verbena-button\n *ngIf=\"currentData && currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"followTask(currentData.data.TaskData)\"\n text=\"Follow Task\"\n ></verbena-button>\n </div>\n\n <!-- <verbena-button\n width=\"114px\"\n height=\"39px\"\n text=\"Delete\"\n bgColor=\"var(--vbn-color-text-muted)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button> -->\n <!-- <verbena-button\n [disable]=\"!taskForm || loadingTaskForm\"\n (click)=\"taskFormView = true\"\n [text]=\"loadingTaskForm ? 'Checking for form' : 'Fill task form'\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button> -->\n <verbena-button\n *ngIf=\"!readOnly\"\n type=\"submit\"\n text=\"Save\"\n bgColor=\"var(--vbn-color-primary)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n pd=\"10px 20px\"\n width=\"114px\"\n height=\"39px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button>\n </div>\n </form>\n}\n", dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5$1.VerbenaInputComponent, selector: "verbena-input", inputs: ["disabled", "label", "placeHolder", "required", "svgPosition", "minLength", "maxLength", "type", "bgColor", "border", "borderRadius", "textColor", "value", "labelPosition", "labelColor", "disable", "readOnly", "min", "max", "showBorder", "showErrorMessage", "errorMessageColor", "errorBorderColor", "errorPosition", "svg", "fontSize", "svgWidth", "svgHeight", "svgColor", "capitalization", "inputContainerClass", "inputFieldClass", "passLength", "inputWrapperClass", "passwordToggle", "customErrorMessages", "icon", "textPass"], outputs: ["valueChange"] }, { kind: "component", type: i5$1.VerbenaButtonComponent, selector: "verbena-button", inputs: ["type", "text", "icon", "useIcon", "svgPosition", "iconPosition", "bgColor", "textColor", "border", "borderRadius", "pd", "width", "height", "fontSize", "fontWeight", "disable", "svgSize", "weight", "variant", "styleType", "svg", "svgWidth", "svgHeight", "iconColor", "svgColor", "buttonClass", "buttonTextClass", "isLoading", "spinnerSize", "spinnerColor"] }, { kind: "component", type: i5$1.DropDownComponent, selector: "verben-drop-down", inputs: ["options", "width", "overlayWidth", "showHorizontalLine", "horizontalLineColor", "optionLabel", "optionSubLabel", "optionValue", "placeholder", "invalidMessage", "errorPosition", "loadMoreCaption", "display", "showClear", "lazyLoad", "selectKey", "styleClass", "group", "multiselect", "filter", "avoidDuplication", "filterBy", "debounceTime", "minChar", "refPageSize", "disabled", "required", "load", "asyncLabel", "search"], outputs: ["optionsChange", "onChange", "onClick", "onClear"] }, { kind: "component", type: i8.FormControlComponent, selector: "form-control", inputs: ["dataType", "value", "boolInputType", "formProperties", "disabled"] }, { kind: "component", type: i9.FormTimerComponent, selector: "app-form-timer", inputs: ["expiryDate"] }] });
961
961
  }
962
962
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TasksFormComponent, decorators: [{
963
963
  type: Component,
964
- args: [{ selector: 'tasks-form', template: "@if (taskFormView && taskForm) {\n <div\n *ngIf=\"taskForm.Entities[active]\"\n class=\"flex flex-wrap bg-[#9A9FBF80] rounded-xl px-3 py-2 w-full relative gap-6\"\n >\n <app-form-timer></app-form-timer>\n <div *ngFor=\"let group of taskForm.Entities; let index = index\">\n <p\n (click)=\"active = index\"\n [ngClass]=\"{\n 'bg-[var(--vbn-color-surface)] text-primary rounded-lg shadow-lg':\n active === index,\n }\"\n class=\"px-6 py-2 cursor-pointer\"\n >\n {{ group.Name }}group\n </p>\n </div>\n </div>\n\n <div *ngIf=\"taskForm.Entities[active]; else emptyState\" class=\"mt-4\">\n <form-control\n [dataType]=\"dataType\"\n [formProperties]=\"taskForm.Entities[active].Properties\"\n ></form-control>\n\n <div class=\"flex gap-3 justify-end\">\n <verbena-button\n (click)=\"areRequiredPropertiesFilled()\"\n text=\"CHECK\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n (click)=\"taskFormView = false\"\n text=\"Close task form\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"sendTaskForm()\"\n [disable]=\"!areRequiredPropertiesFilled()\"\n text=\"Save\"\n ></verbena-button>\n </div>\n </div>\n\n <!-- Empty state template -->\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n} @else {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col px-3 pb-3 rounded-xl h-full w-full relative space-y-4\"\n (ngSubmit)=\"handleSubmit()\"\n >\n <verbena-input\n name=\"Name\"\n label=\"Name\"\n formControlName=\"Name\"\n placeHolder=\"Enter Name\"\n />\n <verbena-input\n name=\"Description\"\n label=\"Description\"\n formControlName=\"Description\"\n placeHolder=\"Enter Description\"\n />\n\n <div class=\"space-y-1\">\n <label for=\"workflow\">Workflow</label>\n\n <verben-drop-down\n label=\"Workflow\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n placeholder=\"Select\"\n [options]=\"workflows\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n id=\"workflow\"\n formControlName=\"WorkflowCode\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"status\">Status</label>\n\n <verben-drop-down\n label=\"Status\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n [showClear]=\"true\"\n placeholder=\"Null\"\n [(options)]=\"statuses\"\n id=\"status\"\n formControlName=\"Status\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <!-- buttons -->\n <div class=\"flex justify-between gap-4 my-2\">\n <div class=\"flex gap-3\">\n <div *ngIf=\"currentData && getRoute(currentData.data) as workflowRoute\">\n <ng-container\n *ngIf=\"\n currentData && workflowRoute && workflowRoute.trim().length > 0\n \"\n >\n <verbena-button\n *ngIf=\"currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"viewSource(currentData.data, workflowRoute)\"\n text=\"View Source Data\"\n ></verbena-button>\n </ng-container>\n </div>\n <verbena-button\n *ngIf=\"currentData && currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"followTask(currentData.data)\"\n text=\"Follow Task\"\n ></verbena-button>\n </div>\n\n <!-- <verbena-button\n width=\"114px\"\n height=\"39px\"\n text=\"Delete\"\n bgColor=\"var(--vbn-color-text-muted)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button> -->\n <!-- <verbena-button\n [disable]=\"!taskForm || loadingTaskForm\"\n (click)=\"taskFormView = true\"\n [text]=\"loadingTaskForm ? 'Checking for form' : 'Fill task form'\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button> -->\n <verbena-button\n *ngIf=\"!readOnly\"\n type=\"submit\"\n text=\"Save\"\n bgColor=\"var(--vbn-color-primary)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n pd=\"10px 20px\"\n width=\"114px\"\n height=\"39px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button>\n </div>\n </form>\n}\n" }]
964
+ args: [{ selector: 'tasks-form', template: "@if (taskFormView && taskForm) {\n <div\n *ngIf=\"taskForm.Entities[active]\"\n class=\"flex flex-wrap bg-[#9A9FBF80] rounded-xl px-3 py-2 w-full relative gap-6\"\n >\n <app-form-timer></app-form-timer>\n <div *ngFor=\"let group of taskForm.Entities; let index = index\">\n <p\n (click)=\"active = index\"\n [ngClass]=\"{\n 'bg-[var(--vbn-color-surface)] text-primary rounded-lg shadow-lg':\n active === index,\n }\"\n class=\"px-6 py-2 cursor-pointer\"\n >\n {{ group.Name }}group\n </p>\n </div>\n </div>\n\n <div *ngIf=\"taskForm.Entities[active]; else emptyState\" class=\"mt-4\">\n <form-control\n [dataType]=\"dataType\"\n [formProperties]=\"taskForm.Entities[active].Properties\"\n ></form-control>\n\n <div class=\"flex gap-3 justify-end\">\n <verbena-button\n (click)=\"areRequiredPropertiesFilled()\"\n text=\"CHECK\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n (click)=\"taskFormView = false\"\n text=\"Close task form\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n\n <verbena-button\n class=\"verben-primary-button\"\n (click)=\"sendTaskForm()\"\n [disable]=\"!areRequiredPropertiesFilled()\"\n text=\"Save\"\n ></verbena-button>\n </div>\n </div>\n\n <!-- Empty state template -->\n <ng-template #emptyState>\n <p class=\"mt-4 p-4 text-gray-600 text-center\">\n No entries available for the selected form group.\n </p>\n </ng-template>\n} @else {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col px-3 pb-3 rounded-xl h-full w-full relative space-y-4\"\n (ngSubmit)=\"handleSubmit()\"\n >\n <verbena-input\n name=\"Name\"\n label=\"Name\"\n formControlName=\"Name\"\n placeHolder=\"Enter Name\"\n />\n <verbena-input\n name=\"Description\"\n label=\"Description\"\n formControlName=\"Description\"\n placeHolder=\"Enter Description\"\n />\n\n <div class=\"space-y-1\">\n <label for=\"workflow\">Workflow</label>\n\n <verben-drop-down\n label=\"Workflow\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n placeholder=\"Select\"\n [options]=\"workflows\"\n optionLabel=\"Name\"\n optionValue=\"Code\"\n id=\"workflow\"\n formControlName=\"WorkflowCode\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <div class=\"space-y-1\">\n <label for=\"status\">Status</label>\n\n <verben-drop-down\n label=\"Status\"\n styleClass=\"w-full\"\n width=\"100%\"\n [multiselect]=\"false\"\n [showClear]=\"true\"\n placeholder=\"Null\"\n [(options)]=\"statuses\"\n id=\"status\"\n formControlName=\"Status\"\n class=\"form-control\"\n >\n </verben-drop-down>\n </div>\n\n <!-- buttons -->\n <div class=\"flex justify-between gap-4 my-2\">\n <div class=\"flex gap-3\">\n <div *ngIf=\"currentData && getRoute(currentData.data) as workflowRoute\">\n <ng-container\n *ngIf=\"\n currentData && workflowRoute && workflowRoute.trim().length > 0\n \"\n >\n <verbena-button\n *ngIf=\"currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"viewSource(currentData.data, workflowRoute)\"\n text=\"View Source Data\"\n ></verbena-button>\n </ng-container>\n </div>\n <verbena-button\n *ngIf=\"currentData && currentData.data.DataState !== 'New'\"\n class=\"verben-switch-button\"\n (click)=\"followTask(currentData.data.TaskData)\"\n text=\"Follow Task\"\n ></verbena-button>\n </div>\n\n <!-- <verbena-button\n width=\"114px\"\n height=\"39px\"\n text=\"Delete\"\n bgColor=\"var(--vbn-color-text-muted)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button> -->\n <!-- <verbena-button\n [disable]=\"!taskForm || loadingTaskForm\"\n (click)=\"taskFormView = true\"\n [text]=\"loadingTaskForm ? 'Checking for form' : 'Fill task form'\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button> -->\n <verbena-button\n *ngIf=\"!readOnly\"\n type=\"submit\"\n text=\"Save\"\n bgColor=\"var(--vbn-color-primary)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n pd=\"10px 20px\"\n width=\"114px\"\n height=\"39px\"\n [disable]=\"disableProcessing()\"\n ></verbena-button>\n </div>\n </form>\n}\n" }]
965
965
  }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i2.TaskFacade }, { type: i3.EnvironmentService }, { type: i3.UtilService }, { type: MyQueueState }, { type: i5.OperationPopupService }], propDecorators: { currentData: [{
966
966
  type: Input
967
967
  }], readOnly: [{