@alfresco/adf-process-services-cloud 9.2.0-37737973197 → 9.2.0-37849267175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, Injectable, InjectionToken, EventEmitter, DestroyRef, Output, Input, ContentChild, Directive, ViewEncapsulation, Component, Injector, NgModule, effect, ViewChild, ChangeDetectorRef, HostListener, ElementRef, Renderer2, signal, ViewContainerRef, ChangeDetectionStrategy, input, output, SecurityContext } from '@angular/core';
3
3
  import * as i3 from '@alfresco/adf-core';
4
- import { AppConfigService, JwtHelperService, OAuth2Service, TranslationService, DataTableSchema, UserPreferencesService, UserPreferenceValues, CustomEmptyContentTemplateDirective, ObjectDataTableAdapter, ColumnsSelectorComponent, MainMenuDataTableTemplateDirective, EmptyContentComponent, NoContentTemplateDirective, LoadingContentTemplateDirective, DataTableComponent, AdfDateFnsAdapter, MOMENT_DATE_FORMATS, AuthenticationService, StorageService, IconModule, DateFnsUtils, ADF_DATE_FORMATS, FullNamePipe, InitialUsernamePipe, FormService, FormModel, FormFieldTypes, ROW_ID_PREFIX, FormBaseComponent, ADF_DISPLAY_TEXT_SETTINGS, WidgetVisibilityService, FormExpressionService, UploadWidgetContentLinkModel, FormEvent, FormOutcomeModel, ConfirmDialogComponent, FormRulesEvent, FormOutcomeEvent, FormRendererComponent, ToolbarDividerComponent, ToolbarComponent, FormatSpacePipe, NotificationService, DownloadService, WidgetComponent, ThumbnailService, ErrorWidgetComponent, LocalizedDatePipe, UploadDirective, ContentLinkModel, ErrorMessageModel, DEFAULT_DATE_FORMAT, FormFieldValueFormatterService, ADF_TYPED_VALUE_FORMATTING_ENABLED, FormFieldEvent, SelectFilterInputComponent, FormRenderingService, DynamicComponentMapper, CardViewUpdateService, ClipboardService, CardViewTextItemModel, CardViewSelectItemModel, CardViewDatetimeItemModel, CardViewDateItemModel, CardViewArrayItemModel, CardViewComponent, CustomLoadingContentTemplateDirective, isOutcomeButtonVisible, FormOutcomeNotFoundError, InplaceFormInputComponent, BaseViewerWidgetComponent, BaseDisplayTextWidgetComponent, ObjectDataColumn, ObjectDataRow, FormBaseModule, provideTranslations } from '@alfresco/adf-core';
4
+ import { AppConfigService, JwtHelperService, OAuth2Service, TranslationService, DataTableSchema, UserPreferencesService, UserPreferenceValues, CustomEmptyContentTemplateDirective, ObjectDataTableAdapter, ColumnsSelectorComponent, MainMenuDataTableTemplateDirective, EmptyContentComponent, NoContentTemplateDirective, LoadingContentTemplateDirective, DataTableComponent, AdfDateFnsAdapter, MOMENT_DATE_FORMATS, AuthenticationService, StorageService, IconModule, DateFnsUtils, ADF_DATE_FORMATS, FullNamePipe, InitialUsernamePipe, FormFieldTypes, FormService, FormModel, ROW_ID_PREFIX, FormBaseComponent, ADF_DISPLAY_TEXT_SETTINGS, WidgetVisibilityService, FormExpressionService, UploadWidgetContentLinkModel, FormEvent, FormOutcomeModel, ConfirmDialogComponent, FormRulesEvent, FormOutcomeEvent, FormRendererComponent, ToolbarDividerComponent, ToolbarComponent, FormatSpacePipe, NotificationService, DownloadService, WidgetComponent, ThumbnailService, ErrorWidgetComponent, LocalizedDatePipe, UploadDirective, ContentLinkModel, getDynamicDateFieldRange, getDateFieldRange, isEmptyFieldValue, getValidationSummaryTranslationParameters, DEFAULT_DATE_FORMAT, FormFieldValueFormatterService, ADF_TYPED_VALUE_FORMATTING_ENABLED, FormFieldEvent, SelectFilterInputComponent, FormRenderingService, DynamicComponentMapper, CardViewUpdateService, ClipboardService, CardViewTextItemModel, CardViewSelectItemModel, CardViewDatetimeItemModel, CardViewDateItemModel, CardViewArrayItemModel, CardViewComponent, CustomLoadingContentTemplateDirective, isOutcomeButtonVisible, FormOutcomeNotFoundError, InplaceFormInputComponent, BaseViewerWidgetComponent, ErrorMessageModel, BaseDisplayTextWidgetComponent, ObjectDataColumn, ObjectDataRow, FormBaseModule, provideTranslations } from '@alfresco/adf-core';
5
5
  import { from, EMPTY, isObservable, of, Subject, throwError, BehaviorSubject, combineLatest, defer, merge, asapScheduler, firstValueFrom, forkJoin, catchError as catchError$1 } from 'rxjs';
6
6
  import { map, take, switchMap, catchError, distinctUntilChanged, filter, tap, finalize, debounceTime, shareReplay, mergeMap, expand, reduce, mapTo, concatMap } from 'rxjs/operators';
7
7
  import { AlfrescoApiService, NodeAction, ContentNodeSelectorComponent, NodesApiService, ContentService, ContentNodeSelectorPanelService, NewVersionUploaderService, NewVersionUploaderDataAction, ContentMetadataComponent, AlfrescoViewerComponent } from '@alfresco/adf-content-services';
@@ -24,7 +24,7 @@ import { ErrorLink } from '@apollo/client/link/error';
24
24
  import { CombinedGraphQLErrors, CombinedProtocolErrors } from '@apollo/client/errors';
25
25
  import { RetryLink } from '@apollo/client/link/retry';
26
26
  import { getMainDefinition } from '@apollo/client/utilities';
27
- import { add, endOfDay, startOfDay, endOfYear, startOfYear, endOfWeek, startOfWeek, endOfMonth, startOfMonth, endOfQuarter, startOfQuarter, isValid, set, addDays, parseISO, getTime } from 'date-fns';
27
+ import { add, endOfDay, startOfDay, endOfYear, startOfYear, endOfWeek, startOfWeek, endOfMonth, startOfMonth, endOfQuarter, startOfQuarter, isValid, set, getTime } from 'date-fns';
28
28
  import * as i2$1 from '@angular/material/list';
29
29
  import { MatListModule } from '@angular/material/list';
30
30
  import { ActivatedRoute, RouterLink } from '@angular/router';
@@ -7763,6 +7763,179 @@ class TaskVariableCloud {
7763
7763
  }
7764
7764
  }
7765
7765
 
7766
+ /*!
7767
+ * @license
7768
+ * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
7769
+ *
7770
+ * Licensed under the Apache License, Version 2.0 (the "License");
7771
+ * you may not use this file except in compliance with the License.
7772
+ * You may obtain a copy of the License at
7773
+ *
7774
+ * http://www.apache.org/licenses/LICENSE-2.0
7775
+ *
7776
+ * Unless required by applicable law or agreed to in writing, software
7777
+ * distributed under the License is distributed on an "AS IS" BASIS,
7778
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7779
+ * See the License for the specific language governing permissions and
7780
+ * limitations under the License.
7781
+ */
7782
+ const DEFAULT_OPTION = {
7783
+ id: 'empty',
7784
+ name: 'Choose one...'
7785
+ };
7786
+ const DEFAULT_VARIABLE_OPTION_ID = 'id';
7787
+ const DEFAULT_VARIABLE_OPTION_LABEL = 'name';
7788
+ const DEFAULT_VARIABLE_OPTION_PATH = 'data';
7789
+ const toDropdownCloudControlValue = (value) => {
7790
+ if (Array.isArray(value)) {
7791
+ return value;
7792
+ }
7793
+ if (value && typeof value === 'object') {
7794
+ return { id: value.id, name: value.name };
7795
+ }
7796
+ if (value === null || value === undefined || value === '') {
7797
+ return null;
7798
+ }
7799
+ return { id: value, name: '' };
7800
+ };
7801
+ const isDropdownCloudValueInOptions = (value, options) => {
7802
+ const optionIds = new Set(options.map((option) => option.id));
7803
+ if (Array.isArray(value)) {
7804
+ return value.every((valueOption) => optionIds.has(valueOption.id));
7805
+ }
7806
+ if (value && typeof value === 'object') {
7807
+ return optionIds.has(value.id);
7808
+ }
7809
+ return optionIds.has(value);
7810
+ };
7811
+ const isDropdownCloudValidValue = (value, options) => !!value && isDropdownCloudValueInOptions(value, options);
7812
+ const isDropdownCloudRestField = (field) => field?.optionType === 'rest' && !!field?.restUrl;
7813
+ const isDropdownCloudLinkedField = (field) => !!field?.rule?.ruleOn;
7814
+ const getOptionsFromPath = (data, path, id, label) => {
7815
+ const properties = path.split('.');
7816
+ const currentProperty = properties.shift();
7817
+ if (data === null || typeof data !== 'object' || !Object.hasOwn(data, currentProperty)) {
7818
+ return { options: [], errors: [`${currentProperty} not found in ${JSON.stringify(data)}`] };
7819
+ }
7820
+ const nestedData = data[currentProperty];
7821
+ if (Array.isArray(nestedData)) {
7822
+ const options = nestedData.map((item) => ({ id: item?.[id], name: item?.[label] }));
7823
+ const invalidOptionErrors = options.filter((option) => !option.id || !option.name).map(() => `'id' or 'label' is not properly defined`);
7824
+ return invalidOptionErrors.length ? { options: [], errors: invalidOptionErrors } : { options, errors: [] };
7825
+ }
7826
+ return getOptionsFromPath(nestedData, properties.join('.'), id, label);
7827
+ };
7828
+ const resolveDropdownCloudVariableOptions = (field, variableConfig = field?.variableConfig) => {
7829
+ const data = field?.form?.resolveVariableValue(variableConfig?.variableName);
7830
+ if (data == null) {
7831
+ return null;
7832
+ }
7833
+ return getOptionsFromPath(data, variableConfig?.optionsPath ?? DEFAULT_VARIABLE_OPTION_PATH, variableConfig?.optionsId ?? DEFAULT_VARIABLE_OPTION_ID, variableConfig?.optionsLabel ?? DEFAULT_VARIABLE_OPTION_LABEL);
7834
+ };
7835
+
7836
+ /*!
7837
+ * @license
7838
+ * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
7839
+ *
7840
+ * Licensed under the Apache License, Version 2.0 (the "License");
7841
+ * you may not use this file except in compliance with the License.
7842
+ * You may obtain a copy of the License at
7843
+ *
7844
+ * http://www.apache.org/licenses/LICENSE-2.0
7845
+ *
7846
+ * Unless required by applicable law or agreed to in writing, software
7847
+ * distributed under the License is distributed on an "AS IS" BASIS,
7848
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7849
+ * See the License for the specific language governing permissions and
7850
+ * limitations under the License.
7851
+ */
7852
+ const defaultValueValidator = (filed) => (control) => {
7853
+ const optionsWithNoDefaultValue = filed.options.filter((dropdownOption) => {
7854
+ const isDefaultValue = dropdownOption.id === DEFAULT_OPTION.id;
7855
+ return !isDefaultValue;
7856
+ });
7857
+ const isSomeOptionSelected = optionsWithNoDefaultValue.some((dropdownOption) => {
7858
+ const isOptionSelected = dropdownOption.id === control.value?.id;
7859
+ return isOptionSelected;
7860
+ });
7861
+ return isSomeOptionSelected ? null : { required: true };
7862
+ };
7863
+ const getDropdownCloudRequiredValidators = (field, options) => {
7864
+ if (!field.hasEmptyValue) {
7865
+ return [Validators.required];
7866
+ }
7867
+ return [Validators.required, defaultValueValidator(options ? { options } : field)];
7868
+ };
7869
+
7870
+ /*!
7871
+ * @license
7872
+ * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
7873
+ *
7874
+ * Licensed under the Apache License, Version 2.0 (the "License");
7875
+ * you may not use this file except in compliance with the License.
7876
+ * You may obtain a copy of the License at
7877
+ *
7878
+ * http://www.apache.org/licenses/LICENSE-2.0
7879
+ *
7880
+ * Unless required by applicable law or agreed to in writing, software
7881
+ * distributed under the License is distributed on an "AS IS" BASIS,
7882
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7883
+ * See the License for the specific language governing permissions and
7884
+ * limitations under the License.
7885
+ */
7886
+ class DropdownCloudFieldValidator {
7887
+ isSupported(field) {
7888
+ return field?.type === FormFieldTypes.DROPDOWN && field.required;
7889
+ }
7890
+ validate(field) {
7891
+ if (!this.isSupported(field) || field.form?.isFieldOrParentHidden(field)) {
7892
+ return true;
7893
+ }
7894
+ if (this.hasMissingSelection(field)) {
7895
+ field.validationSummary.message = 'FORM.FIELD.REQUIRED';
7896
+ return false;
7897
+ }
7898
+ return true;
7899
+ }
7900
+ hasMissingSelection(field) {
7901
+ // REST and linked options load at runtime, so only an empty selection is reported
7902
+ if (isDropdownCloudRestField(field) || isDropdownCloudLinkedField(field)) {
7903
+ const controlValue = toDropdownCloudControlValue(field.value);
7904
+ return !controlValue || (Array.isArray(controlValue) ? !controlValue.length : controlValue.id === DEFAULT_OPTION.id);
7905
+ }
7906
+ let { options, value } = field;
7907
+ if (field.optionType === 'variable') {
7908
+ const variableOptions = resolveDropdownCloudVariableOptions(field);
7909
+ options = variableOptions?.options ?? [];
7910
+ if (variableOptions) {
7911
+ value = isDropdownCloudValidValue(value, options) ? value : '';
7912
+ }
7913
+ }
7914
+ return new FormControl(toDropdownCloudControlValue(value), getDropdownCloudRequiredValidators(field, options)).invalid;
7915
+ }
7916
+ }
7917
+
7918
+ /*!
7919
+ * @license
7920
+ * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
7921
+ *
7922
+ * Licensed under the Apache License, Version 2.0 (the "License");
7923
+ * you may not use this file except in compliance with the License.
7924
+ * You may obtain a copy of the License at
7925
+ *
7926
+ * http://www.apache.org/licenses/LICENSE-2.0
7927
+ *
7928
+ * Unless required by applicable law or agreed to in writing, software
7929
+ * distributed under the License is distributed on an "AS IS" BASIS,
7930
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7931
+ * See the License for the specific language governing permissions and
7932
+ * limitations under the License.
7933
+ */
7934
+ /**
7935
+ * Field validators for the rules of the cloud widgets. Pass them to a `FormModel` you build yourself.
7936
+ */
7937
+ const CLOUD_FORM_FIELD_VALIDATORS = [new DropdownCloudFieldValidator()];
7938
+
7766
7939
  var __decorate$3 = (this && this.__decorate) || function (decorators, target, key, desc) {
7767
7940
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7768
7941
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -7773,7 +7946,10 @@ const FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN = new InjectionToken('FORM_CLOUD
7773
7946
  class FormCloudService extends BaseCloudService {
7774
7947
  constructor() {
7775
7948
  super(...arguments);
7776
- this.fieldValidators = inject(FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, { optional: true }) ?? [];
7949
+ this.fieldValidators = [
7950
+ ...CLOUD_FORM_FIELD_VALIDATORS,
7951
+ ...(inject(FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, { optional: true }) ?? [])
7952
+ ];
7777
7953
  this.formService = inject(FormService);
7778
7954
  this.runtimeBundleFallbackEnabled$ = resolveTaskRuntimeBundleFallback$(inject(ADF_TASK_RUNTIME_BUNDLE_FALLBACK_ENABLED, { optional: true }));
7779
7955
  }
@@ -8707,7 +8883,10 @@ class FormCloudComponent extends FormBaseComponent {
8707
8883
  (this.data || []).forEach((variable) => {
8708
8884
  formValues[variable.name] = variable.value;
8709
8885
  });
8710
- const form = new FormModel(formCloudRepresentationJSON, formValues, this.readOnly, this.formService, undefined, this.fieldValidators);
8886
+ const form = new FormModel(formCloudRepresentationJSON, formValues, this.readOnly, this.formService, undefined, [
8887
+ ...CLOUD_FORM_FIELD_VALIDATORS,
8888
+ ...(this.fieldValidators ?? [])
8889
+ ]);
8711
8890
  if (this.taskId) {
8712
8891
  form.outcomes = (form.outcomes ?? []).filter((outcome) => outcome.id !== FormModel.START_PROCESS_OUTCOME);
8713
8892
  }
@@ -9679,6 +9858,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
9679
9858
  * limitations under the License.
9680
9859
  */
9681
9860
  /* eslint-disable @angular-eslint/component-selector */
9861
+ const getDateCloudWidgetRange = (field, today) => field?.dynamicDateRangeSelection ? getDynamicDateFieldRange(field, today) : getDateFieldRange(field);
9682
9862
  class DateCloudWidgetComponent extends WidgetComponent {
9683
9863
  constructor() {
9684
9864
  super(...arguments);
@@ -9687,6 +9867,10 @@ class DateCloudWidgetComponent extends WidgetComponent {
9687
9867
  this.maxDate = null;
9688
9868
  this.startAt = null;
9689
9869
  this.dateInputControl = new FormControl(null);
9870
+ this.translateParameters = {};
9871
+ this.errorStateMatcher = {
9872
+ isErrorState: (control) => !!control?.touched && this.hasValidationError()
9873
+ };
9690
9874
  this.formService = inject(FormService);
9691
9875
  this.destroyRef = inject(DestroyRef);
9692
9876
  this.dateAdapter = inject(DateAdapter);
@@ -9713,13 +9897,13 @@ class DateCloudWidgetComponent extends WidgetComponent {
9713
9897
  this.dateInputControl.setValue(this.field.value, { emitEvent: false });
9714
9898
  }
9715
9899
  }
9900
+ hasValidationError() {
9901
+ return !this.field.isValid && this.field.validationSummary.isActive();
9902
+ }
9903
+ hasRequiredError() {
9904
+ return !!this.field.required && isEmptyFieldValue(this.field.value);
9905
+ }
9716
9906
  updateFormControlState() {
9717
- if (this.isRequired() && this.field?.isVisible) {
9718
- this.dateInputControl.addValidators(Validators.required);
9719
- }
9720
- else {
9721
- this.dateInputControl.removeValidators(Validators.required);
9722
- }
9723
9907
  this.field?.readOnly || this.readOnly
9724
9908
  ? this.dateInputControl.disable({ emitEvent: false })
9725
9909
  : this.dateInputControl.enable({ emitEvent: false });
@@ -9744,48 +9928,9 @@ class DateCloudWidgetComponent extends WidgetComponent {
9744
9928
  return max ? DateFnsUtils.formatDate(max, this.field.dateDisplayFormat).toLocaleUpperCase() : '';
9745
9929
  }
9746
9930
  validateField() {
9747
- if (this.dateInputControl.invalid) {
9748
- this.handleErrors(this.dateInputControl.errors);
9749
- this.field.markAsInvalid();
9750
- }
9751
- else {
9752
- this.resetErrors();
9753
- this.field.markAsValid();
9754
- }
9755
- }
9756
- handleErrors(errors) {
9757
- const errorAttributes = new Map();
9758
- switch (true) {
9759
- case !!errors.matDatepickerParse: {
9760
- const format = this.field.dateDisplayFormat || this.field.defaultDateTimeFormat;
9761
- errorAttributes.set('format', format);
9762
- this.updateValidationSummary('FORM.FIELD.VALIDATOR.INVALID_DATE_FORMAT', errorAttributes);
9763
- break;
9764
- }
9765
- case !!errors.required:
9766
- this.updateValidationSummary('FORM.FIELD.REQUIRED');
9767
- break;
9768
- case !!errors.matDatepickerMin: {
9769
- const minValue = DateFnsUtils.formatDate(errors.matDatepickerMin.min, this.field.dateDisplayFormat).toLocaleUpperCase();
9770
- errorAttributes.set('minValue', minValue);
9771
- this.updateValidationSummary('FORM.FIELD.VALIDATOR.NOT_LESS_THAN', errorAttributes);
9772
- break;
9773
- }
9774
- case !!errors.matDatepickerMax: {
9775
- const maxValue = DateFnsUtils.formatDate(errors.matDatepickerMax.max, this.field.dateDisplayFormat).toLocaleUpperCase();
9776
- errorAttributes.set('maxValue', maxValue);
9777
- this.updateValidationSummary('FORM.FIELD.VALIDATOR.NOT_GREATER_THAN', errorAttributes);
9778
- break;
9779
- }
9780
- default:
9781
- break;
9782
- }
9783
- }
9784
- updateValidationSummary(message, attributes) {
9785
- this.field.validationSummary = new ErrorMessageModel({ message, attributes });
9786
- }
9787
- resetErrors() {
9788
- this.updateValidationSummary('');
9931
+ this.field.inputErrors = this.dateInputControl.hasError('matDatepickerParse') ? { matDatepickerParse: true } : null;
9932
+ this.field.validate();
9933
+ this.translateParameters = getValidationSummaryTranslationParameters(this.field.validationSummary);
9789
9934
  }
9790
9935
  initDateAdapter() {
9791
9936
  if (this.field?.dateDisplayFormat) {
@@ -9799,44 +9944,19 @@ class DateCloudWidgetComponent extends WidgetComponent {
9799
9944
  }
9800
9945
  }
9801
9946
  initRangeSelection() {
9947
+ const { min, max } = getDateCloudWidgetRange(this.field, this.dateAdapter.today());
9948
+ this.minDate = min;
9949
+ this.maxDate = max;
9802
9950
  if (this.field?.dynamicDateRangeSelection) {
9803
- this.setDynamicRangeSelection();
9804
- }
9805
- else {
9806
- this.setStaticRangeSelection();
9807
- }
9808
- }
9809
- setDynamicRangeSelection() {
9810
- if (this.field.minDateRangeValue === null) {
9811
- this.minDate = null;
9812
- this.field.minValue = null;
9813
- }
9814
- else {
9815
- this.minDate = addDays(this.dateAdapter.today(), this.field.minDateRangeValue);
9816
- this.field.minValue = DateFnsUtils.formatDate(this.minDate, DEFAULT_DATE_FORMAT);
9817
- }
9818
- if (this.field.maxDateRangeValue === null) {
9819
- this.maxDate = null;
9820
- this.field.maxValue = null;
9821
- }
9822
- else {
9823
- this.maxDate = addDays(this.dateAdapter.today(), this.field.maxDateRangeValue);
9824
- this.field.maxValue = DateFnsUtils.formatDate(this.maxDate, DEFAULT_DATE_FORMAT);
9825
- }
9826
- }
9827
- setStaticRangeSelection() {
9828
- if (this.field?.minValue) {
9829
- this.minDate = parseISO(this.field.minValue);
9830
- }
9831
- if (this.field?.maxValue) {
9832
- this.maxDate = parseISO(this.field.maxValue);
9951
+ this.field.minValue = min === null ? null : DateFnsUtils.formatDate(min, DEFAULT_DATE_FORMAT);
9952
+ this.field.maxValue = max === null ? null : DateFnsUtils.formatDate(max, DEFAULT_DATE_FORMAT);
9833
9953
  }
9834
9954
  }
9835
9955
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DateCloudWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
9836
9956
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DateCloudWidgetComponent, isStandalone: true, selector: "date-widget", host: { listeners: { "click": "event($event)", "blur": "event($event)", "change": "event($event)", "focus": "event($event)", "focusin": "event($event)", "focusout": "event($event)", "input": "event($event)", "invalid": "event($event)", "select": "event($event)" } }, providers: [
9837
9957
  { provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS },
9838
9958
  { provide: DateAdapter, useClass: AdfDateFnsAdapter }
9839
- ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"{{field.className}}\"\n id=\"data-widget\"\n [class.adf-invalid]=\"dateInputControl.invalid && dateInputControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }} ({{field.dateDisplayFormat}})<span\n class=\"adf-asterisk\"\n [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\"\n >*</span\n ></label\n >\n </div>\n <div class=\"adf-date-widget-container\">\n <mat-form-field\n class=\"adf-date-widget adf-form-field-input\"\n subscriptSizing=\"dynamic\"\n [class.adf-left-label-input-datepicker]=\"field.leftLabels\"\n >\n @if ( (field.name || field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">\n {{field.name | translate }} ({{field.dateDisplayFormat}})\n </mat-label>\n }\n <input\n matInput\n class=\"adf-input\"\n [matDatepicker]=\"datePicker\"\n [id]=\"field.id\"\n [formControl]=\"dateInputControl\"\n [placeholder]=\"field.placeholder\"\n [required]=\"field.required && field.isVisible\"\n [min]=\"minDate\"\n [max]=\"maxDate\"\n [title]=\"field.tooltip\"\n />\n <mat-datepicker-toggle matSuffix [for]=\"datePicker\" [disabled]=\"field.readOnly\" />\n <mat-datepicker #datePicker [startAt]=\"startAt\" [disabled]=\"field.readOnly\" />\n @if (dateInputControl.invalid && dateInputControl.touched) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\"\n >@if (dateInputControl.hasError('required')) {{{ 'FORM.FIELD.REQUIRED' | translate }}} @else if (dateInputControl.hasError('matDatepickerParse')) {{{ 'FORM.FIELD.VALIDATOR.INVALID_DATE_FORMAT' | translate: { format: field.dateDisplayFormat || field.defaultDateTimeFormat } }}} @else if (dateInputControl.hasError('matDatepickerMin')) {{{ 'FORM.FIELD.VALIDATOR.NOT_LESS_THAN' | translate: { minValue: formattedMinDate } }}} @else if (dateInputControl.hasError('matDatepickerMax')) {{{ 'FORM.FIELD.VALIDATOR.NOT_GREATER_THAN' | translate: { maxValue: formattedMaxDate } }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-date-widget .mat-mdc-form-field-text-suffix{top:26px}.adf-date-widget .adf-label{top:20px}.adf-date-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-left-label-input-datepicker .mat-mdc-form-field-text-suffix{top:0}.adf-left-label-input-datepicker .mat-mdc-form-text-infix{width:100%}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2$4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2$4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2$4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.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: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
9959
+ ], usesInheritance: true, ngImport: i0, template: "<div\n class=\"{{field.className}}\"\n id=\"data-widget\"\n [class.adf-invalid]=\"hasValidationError() && dateInputControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }} ({{field.dateDisplayFormat}})<span\n class=\"adf-asterisk\"\n [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\"\n >*</span\n ></label\n >\n </div>\n <div class=\"adf-date-widget-container\">\n <mat-form-field\n class=\"adf-date-widget adf-form-field-input\"\n subscriptSizing=\"dynamic\"\n [class.adf-left-label-input-datepicker]=\"field.leftLabels\"\n >\n @if ( (field.name || field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">\n {{field.name | translate }} ({{field.dateDisplayFormat}})\n </mat-label>\n }\n <input\n matInput\n class=\"adf-input\"\n [matDatepicker]=\"datePicker\"\n [id]=\"field.id\"\n [formControl]=\"dateInputControl\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [placeholder]=\"field.placeholder\"\n [required]=\"field.required && field.isVisible\"\n [min]=\"minDate\"\n [max]=\"maxDate\"\n [title]=\"field.tooltip\"\n />\n <mat-datepicker-toggle matSuffix [for]=\"datePicker\" [disabled]=\"field.readOnly\" />\n <mat-datepicker #datePicker [startAt]=\"startAt\" [disabled]=\"field.readOnly\" />\n @if (hasValidationError() && dateInputControl.touched) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\">@if (hasRequiredError()) {{{ 'FORM.FIELD.REQUIRED' | translate }}} @else {{{ field.validationSummary.message | translate: translateParameters }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-date-widget .mat-mdc-form-field-text-suffix{top:26px}.adf-date-widget .adf-label{top:20px}.adf-date-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-left-label-input-datepicker .mat-mdc-form-field-text-suffix{top:0}.adf-left-label-input-datepicker .mat-mdc-form-text-infix{width:100%}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2$4.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2$4.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2$4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.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: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
9840
9960
  }
9841
9961
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DateCloudWidgetComponent, decorators: [{
9842
9962
  type: Component,
@@ -9853,7 +9973,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
9853
9973
  '(input)': 'event($event)',
9854
9974
  '(invalid)': 'event($event)',
9855
9975
  '(select)': 'event($event)'
9856
- }, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"{{field.className}}\"\n id=\"data-widget\"\n [class.adf-invalid]=\"dateInputControl.invalid && dateInputControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }} ({{field.dateDisplayFormat}})<span\n class=\"adf-asterisk\"\n [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\"\n >*</span\n ></label\n >\n </div>\n <div class=\"adf-date-widget-container\">\n <mat-form-field\n class=\"adf-date-widget adf-form-field-input\"\n subscriptSizing=\"dynamic\"\n [class.adf-left-label-input-datepicker]=\"field.leftLabels\"\n >\n @if ( (field.name || field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">\n {{field.name | translate }} ({{field.dateDisplayFormat}})\n </mat-label>\n }\n <input\n matInput\n class=\"adf-input\"\n [matDatepicker]=\"datePicker\"\n [id]=\"field.id\"\n [formControl]=\"dateInputControl\"\n [placeholder]=\"field.placeholder\"\n [required]=\"field.required && field.isVisible\"\n [min]=\"minDate\"\n [max]=\"maxDate\"\n [title]=\"field.tooltip\"\n />\n <mat-datepicker-toggle matSuffix [for]=\"datePicker\" [disabled]=\"field.readOnly\" />\n <mat-datepicker #datePicker [startAt]=\"startAt\" [disabled]=\"field.readOnly\" />\n @if (dateInputControl.invalid && dateInputControl.touched) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\"\n >@if (dateInputControl.hasError('required')) {{{ 'FORM.FIELD.REQUIRED' | translate }}} @else if (dateInputControl.hasError('matDatepickerParse')) {{{ 'FORM.FIELD.VALIDATOR.INVALID_DATE_FORMAT' | translate: { format: field.dateDisplayFormat || field.defaultDateTimeFormat } }}} @else if (dateInputControl.hasError('matDatepickerMin')) {{{ 'FORM.FIELD.VALIDATOR.NOT_LESS_THAN' | translate: { minValue: formattedMinDate } }}} @else if (dateInputControl.hasError('matDatepickerMax')) {{{ 'FORM.FIELD.VALIDATOR.NOT_GREATER_THAN' | translate: { maxValue: formattedMaxDate } }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-date-widget .mat-mdc-form-field-text-suffix{top:26px}.adf-date-widget .adf-label{top:20px}.adf-date-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-left-label-input-datepicker .mat-mdc-form-field-text-suffix{top:0}.adf-left-label-input-datepicker .mat-mdc-form-text-infix{width:100%}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"] }]
9976
+ }, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"{{field.className}}\"\n id=\"data-widget\"\n [class.adf-invalid]=\"hasValidationError() && dateInputControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }} ({{field.dateDisplayFormat}})<span\n class=\"adf-asterisk\"\n [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\"\n >*</span\n ></label\n >\n </div>\n <div class=\"adf-date-widget-container\">\n <mat-form-field\n class=\"adf-date-widget adf-form-field-input\"\n subscriptSizing=\"dynamic\"\n [class.adf-left-label-input-datepicker]=\"field.leftLabels\"\n >\n @if ( (field.name || field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">\n {{field.name | translate }} ({{field.dateDisplayFormat}})\n </mat-label>\n }\n <input\n matInput\n class=\"adf-input\"\n [matDatepicker]=\"datePicker\"\n [id]=\"field.id\"\n [formControl]=\"dateInputControl\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [placeholder]=\"field.placeholder\"\n [required]=\"field.required && field.isVisible\"\n [min]=\"minDate\"\n [max]=\"maxDate\"\n [title]=\"field.tooltip\"\n />\n <mat-datepicker-toggle matSuffix [for]=\"datePicker\" [disabled]=\"field.readOnly\" />\n <mat-datepicker #datePicker [startAt]=\"startAt\" [disabled]=\"field.readOnly\" />\n @if (hasValidationError() && dateInputControl.touched) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\">@if (hasRequiredError()) {{{ 'FORM.FIELD.REQUIRED' | translate }}} @else {{{ field.validationSummary.message | translate: translateParameters }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-date-widget .mat-mdc-form-field-text-suffix{top:26px}.adf-date-widget .adf-label{top:20px}.adf-date-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-left-label-input-datepicker .mat-mdc-form-field-text-suffix{top:0}.adf-left-label-input-datepicker .mat-mdc-form-text-infix{width:100%}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"] }]
9857
9977
  }] });
9858
9978
 
9859
9979
  /*!
@@ -9907,38 +10027,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
9907
10027
  * See the License for the specific language governing permissions and
9908
10028
  * limitations under the License.
9909
10029
  */
9910
- const defaultValueValidator = (filed) => (control) => {
9911
- const optionsWithNoDefaultValue = filed.options.filter((dropdownOption) => {
9912
- const isDefaultValue = dropdownOption.id === DEFAULT_OPTION.id;
9913
- return !isDefaultValue;
9914
- });
9915
- const isSomeOptionSelected = optionsWithNoDefaultValue.some((dropdownOption) => {
9916
- const isOptionSelected = dropdownOption.id === control.value?.id;
9917
- return isOptionSelected;
9918
- });
9919
- return isSomeOptionSelected ? null : { required: true };
9920
- };
9921
-
9922
- /*!
9923
- * @license
9924
- * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
9925
- *
9926
- * Licensed under the Apache License, Version 2.0 (the "License");
9927
- * you may not use this file except in compliance with the License.
9928
- * You may obtain a copy of the License at
9929
- *
9930
- * http://www.apache.org/licenses/LICENSE-2.0
9931
- *
9932
- * Unless required by applicable law or agreed to in writing, software
9933
- * distributed under the License is distributed on an "AS IS" BASIS,
9934
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9935
- * See the License for the specific language governing permissions and
9936
- * limitations under the License.
9937
- */
9938
- const DEFAULT_OPTION = {
9939
- id: 'empty',
9940
- name: 'Choose one...'
9941
- };
9942
10030
  const HIDE_FILTER_LIMIT = 5;
9943
10031
  const DROPDOWN_CLOUD_WIDGET_SET_VALUE_DEBOUNCE = 100;
9944
10032
  /* eslint-disable @angular-eslint/component-selector */
@@ -9960,20 +10048,17 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
9960
10048
  this.previewState = false;
9961
10049
  this.dropdownControl = new FormControl(undefined);
9962
10050
  this.dropdownErrorStateMatcher = {
9963
- isErrorState: (control) => (control?.touched && control?.invalid) || (!this.previewState && (this.isRestApiFailed || this.variableOptionsFailed))
10051
+ isErrorState: (control) => (control?.touched && this.hasValidationError()) || (!this.previewState && (this.isRestApiFailed || this.variableOptionsFailed))
9964
10052
  };
9965
10053
  this.list$ = new BehaviorSubject([]);
9966
10054
  this.filter$ = new BehaviorSubject('');
9967
- this.defaultVariableOptionId = 'id';
9968
- this.defaultVariableOptionLabel = 'name';
9969
- this.defaultVariableOptionPath = 'data';
9970
10055
  this.debounceSetValue = new Subject();
9971
10056
  }
9972
10057
  get isReadOnlyType() {
9973
10058
  return this.field.type === 'readonly';
9974
10059
  }
9975
10060
  get isLinkedWidget() {
9976
- return !!this.linkedWidgetId;
10061
+ return isDropdownCloudLinkedField(this.field);
9977
10062
  }
9978
10063
  get linkedWidgetId() {
9979
10064
  return this.field?.rule?.ruleOn;
@@ -9981,14 +10066,8 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
9981
10066
  get isReadOnlyForm() {
9982
10067
  return !!this.field?.form?.readOnly;
9983
10068
  }
9984
- get hasRestUrl() {
9985
- return !!this.field?.restUrl;
9986
- }
9987
10069
  get isValidRestConfig() {
9988
- return this.isRestOptionType && this.hasRestUrl;
9989
- }
9990
- get isRestOptionType() {
9991
- return this.field?.optionType === 'rest';
10070
+ return isDropdownCloudRestField(this.field);
9992
10071
  }
9993
10072
  get isVariableOptionType() {
9994
10073
  return this.field?.optionType === 'variable';
@@ -10009,20 +10088,7 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
10009
10088
  e.g. every time if we focusin/focusout etc. we are calling a setValue.
10010
10089
  */
10011
10090
  this.debounceSetValue.pipe(debounceTime(DROPDOWN_CLOUD_WIDGET_SET_VALUE_DEBOUNCE), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
10012
- let value;
10013
- if (Array.isArray(this.field.value)) {
10014
- value = this.field?.value;
10015
- }
10016
- else if (this.field?.value && typeof this.field?.value === 'object') {
10017
- value = { id: this.field?.value.id, name: this.field?.value.name };
10018
- }
10019
- else if (this.field.value === null || this.field.value === undefined || this.field.value === '') {
10020
- value = null;
10021
- }
10022
- else {
10023
- value = { id: this.field?.value, name: '' };
10024
- }
10025
- this.dropdownControl.setValue(value, { emitEvent: false });
10091
+ this.applyFieldValueToControl();
10026
10092
  });
10027
10093
  this.setupDropdown();
10028
10094
  /*
@@ -10057,7 +10123,7 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
10057
10123
  if (this.field?.form?.showAllValidationErrors) {
10058
10124
  this.dropdownControl.markAsTouched();
10059
10125
  }
10060
- this.handleErrors();
10126
+ this.validateField();
10061
10127
  }
10062
10128
  compareDropdownValues(opt1, opt2) {
10063
10129
  if (!opt1 || !opt2) {
@@ -10083,39 +10149,32 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
10083
10149
  this.setPreviewState();
10084
10150
  this.checkFieldOptionsSource();
10085
10151
  this.updateOptions();
10086
- this.setFormControlValue();
10152
+ this.applyFieldValueToControl();
10087
10153
  this.updateFormControlState();
10088
- this.handleErrors();
10154
+ this.validateField();
10089
10155
  }
10090
10156
  subscribeToInputChanges() {
10091
10157
  this.dropdownControl.valueChanges
10092
10158
  .pipe(filter(() => !!this.field), takeUntilDestroyed(this.destroyRef))
10093
10159
  .subscribe((value) => {
10094
10160
  this.setOptionValue(value, this.field);
10095
- this.handleErrors();
10161
+ this.validateField();
10096
10162
  this.selectionChangedForField(this.field);
10097
10163
  });
10098
10164
  }
10099
10165
  setFormControlValue() {
10100
10166
  this.debounceSetValue.next();
10101
10167
  }
10168
+ applyFieldValueToControl() {
10169
+ this.dropdownControl.setValue(toDropdownCloudControlValue(this.field.value), { emitEvent: false });
10170
+ }
10171
+ hasValidationError() {
10172
+ return !this.field?.isValid && !!this.field?.validationSummary?.isActive();
10173
+ }
10102
10174
  updateFormControlState() {
10103
- this.updateDropdownValidationRules();
10104
10175
  this.updateDropdownReadonlyRules();
10105
10176
  this.dropdownControl.updateValueAndValidity({ emitEvent: false });
10106
10177
  }
10107
- updateDropdownValidationRules() {
10108
- this.dropdownControl.setValidators([]);
10109
- if (!this.field?.isVisible) {
10110
- return;
10111
- }
10112
- if (this.isRequired()) {
10113
- this.dropdownControl.addValidators([Validators.required]);
10114
- if (this.field.hasEmptyValue) {
10115
- this.dropdownControl.addValidators([defaultValueValidator(this.field)]);
10116
- }
10117
- }
10118
- }
10119
10178
  updateDropdownReadonlyRules() {
10120
10179
  if (this.field?.readOnly || this.readOnly) {
10121
10180
  this.dropdownControl.disable({ emitEvent: false });
@@ -10124,16 +10183,8 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
10124
10183
  this.dropdownControl.enable({ emitEvent: false });
10125
10184
  }
10126
10185
  }
10127
- handleErrors() {
10128
- if (this.dropdownControl.valid) {
10129
- this.field.validationSummary = new ErrorMessageModel('');
10130
- this.field.markAsValid();
10131
- return;
10132
- }
10133
- if (this.dropdownControl.invalid && this.dropdownControl.errors.required) {
10134
- this.field.validationSummary = new ErrorMessageModel({ message: 'FORM.FIELD.REQUIRED' });
10135
- this.field.markAsInvalid();
10136
- }
10186
+ validateField() {
10187
+ this.field.validate();
10137
10188
  }
10138
10189
  initFilter() {
10139
10190
  this.filter$
@@ -10158,58 +10209,20 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
10158
10209
  }
10159
10210
  }
10160
10211
  persistFieldOptionsFromVariable() {
10161
- const optionsPath = this.field?.variableConfig?.optionsPath ?? this.defaultVariableOptionPath;
10162
- const variableName = this.field?.variableConfig?.variableName;
10163
- const dropdownOptions = this.field?.form?.resolveVariableValue(variableName);
10164
- if (dropdownOptions != null) {
10165
- const formVariableOptions = this.getOptionsFromPath(dropdownOptions, optionsPath);
10166
- this.updateOptions(formVariableOptions);
10212
+ const variableOptions = resolveDropdownCloudVariableOptions(this.field);
10213
+ if (variableOptions) {
10214
+ variableOptions.errors.forEach((error) => this.handleError(error));
10215
+ this.variableOptionsFailed = variableOptions.errors.length > 0;
10216
+ this.updateOptions(variableOptions.options);
10167
10217
  this.resetInvalidValue();
10168
10218
  this.field.updateForm();
10169
10219
  }
10170
10220
  else {
10171
- this.handleError(`${variableName} not found`);
10221
+ this.handleError(`${this.field?.variableConfig?.variableName} not found`);
10172
10222
  this.resetOptions();
10173
10223
  this.variableOptionsFailed = true;
10174
10224
  }
10175
10225
  }
10176
- getOptionsFromPath(data, path) {
10177
- const optionsId = this.field?.variableConfig?.optionsId ?? this.defaultVariableOptionId;
10178
- const optionsLabel = this.field?.variableConfig?.optionsLabel ?? this.defaultVariableOptionLabel;
10179
- const properties = path.split('.');
10180
- const currentProperty = properties.shift();
10181
- if (!Object.prototype.hasOwnProperty.call(data, currentProperty)) {
10182
- this.handleError(`${currentProperty} not found in ${JSON.stringify(data)}`);
10183
- this.variableOptionsFailed = true;
10184
- return [];
10185
- }
10186
- const nestedData = data[currentProperty];
10187
- if (Array.isArray(nestedData)) {
10188
- return this.getOptionsFromArray(nestedData, optionsId, optionsLabel);
10189
- }
10190
- return this.getOptionsFromPath(nestedData, properties.join('.'));
10191
- }
10192
- getOptionsFromArray(nestedData, id, label) {
10193
- const options = nestedData.map((item) => this.createOption(item, id, label));
10194
- const hasInvalidOption = options.some((option) => !option);
10195
- if (hasInvalidOption) {
10196
- this.variableOptionsFailed = true;
10197
- return [];
10198
- }
10199
- this.variableOptionsFailed = false;
10200
- return options;
10201
- }
10202
- createOption(item, id, label) {
10203
- const option = {
10204
- id: item[id],
10205
- name: item[label]
10206
- };
10207
- if (!option.id || !option.name) {
10208
- this.handleError(`'id' or 'label' is not properly defined`);
10209
- return undefined;
10210
- }
10211
- return option;
10212
- }
10213
10226
  persistFieldOptionsFromRestApi() {
10214
10227
  if (this.isValidRestConfig) {
10215
10228
  this.resetRestApiErrorMessage();
@@ -10299,22 +10312,7 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
10299
10312
  this.field.updateForm();
10300
10313
  }
10301
10314
  isValidValue() {
10302
- return this.field.value && this.isSelectedValueInOptions();
10303
- }
10304
- isSelectedValueInOptions() {
10305
- if (Array.isArray(this.field.value)) {
10306
- const optionIdList = [...this.field.options].map((option) => option.id);
10307
- const fieldValueIds = this.field.value.map((valueOption) => valueOption.id);
10308
- return fieldValueIds.every((valueOptionId) => optionIdList.includes(valueOptionId));
10309
- }
10310
- else {
10311
- if (this.field?.value && typeof this.field?.value === 'object') {
10312
- return [...this.field.options].map((option) => option.id).includes(this.field.value.id);
10313
- }
10314
- else {
10315
- return [...this.field.options].map((option) => option.id).includes(this.field.value);
10316
- }
10317
- }
10315
+ return isDropdownCloudValidValue(this.field.value, this.field.options);
10318
10316
  }
10319
10317
  hasRuleEntries() {
10320
10318
  return !!this.field.rule.entries.length;
@@ -10386,13 +10384,13 @@ class DropdownCloudWidgetComponent extends WidgetComponent {
10386
10384
  }
10387
10385
  }
10388
10386
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DropdownCloudWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
10389
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DropdownCloudWidgetComponent, isStandalone: true, selector: "dropdown-cloud-widget", host: { listeners: { "click": "event($event)" } }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"adf-dropdown-widget {{field.className}}\"\n [class.adf-invalid]=\"dropdownControl.invalid && dropdownControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n @if(field.leftLabels) {\n <div>\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\">\n {{ field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span>\n </label>\n </div>\n }\n <div class=\"adf-dropdown-widget-container\">\n <mat-form-field class=\"adf-form-field-input\" subscriptSizing=\"dynamic\">\n @if ( (field.name || this.field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">{{ field.name | translate }}</mat-label>\n }\n <mat-select\n class=\"adf-select\"\n [formControl]=\"dropdownControl\"\n [id]=\"field.id\"\n [compareWith]=\"compareDropdownValues\"\n [title]=\"field.tooltip\"\n panelClass=\"adf-select-filter\"\n [multiple]=\"field.hasMultipleValues\"\n [required]=\"field.required\"\n [errorStateMatcher]=\"dropdownErrorStateMatcher\"\n #select\n (keydown.escape)=\"select.close()\"\n >\n @if(showInputFilter) {\n <adf-select-filter-input (change)=\"filter$.next($event)\" />\n }\n\n @for(opt of (list$ | async); track opt.id) {\n <mat-option [value]=\"opt\" [id]=\"opt.id\" [attr.data-automation-id]=\"'adf-dropdown-widget-option-' + opt.id\">\n {{opt.name}}\n </mat-option>\n }\n\n @if(isReadOnlyType) {\n <mat-option\n [id]=\"'readonlyOption-' + field.id\"\n [value]=\"field.value\"\n >\n {{readOnlyDisplayValue}}\n </mat-option>\n }\n </mat-select>\n @if ((dropdownControl.hasError('required') && !isRestApiFailed && !variableOptionsFailed) || (!previewState && !field.readOnly && (isRestApiFailed || variableOptionsFailed))) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\"\n >@if (dropdownControl.hasError('required') && !isRestApiFailed && !variableOptionsFailed) {{{ 'FORM.FIELD.REQUIRED' | translate }}} @else if (isRestApiFailed) {{{ 'FORM.FIELD.REST_API_FAILED' | translate: { hostname: restApiHostName } }}} @else if (variableOptionsFailed) {{{ 'FORM.FIELD.VARIABLE_DROPDOWN_OPTIONS_FAILED' | translate }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-dropdown-widget{width:100%}.adf-dropdown-widget .adf-select{padding-top:0;width:100%}.adf-dropdown-widget-select{width:100%}.adf-dropdown-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-dropdown-widget-dropdown-required-message .adf-error-container,.adf-dropdown-widget-dropdown-failed-message .adf-error-container{margin-top:1px}.adf-dropdown-widget .mat-mdc-select-arrow-wrapper{height:auto}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: SelectFilterInputComponent, selector: "adf-select-filter-input", outputs: ["change"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
10387
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: DropdownCloudWidgetComponent, isStandalone: true, selector: "dropdown-cloud-widget", host: { listeners: { "click": "event($event)" } }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"adf-dropdown-widget {{field.className}}\"\n [class.adf-invalid]=\"hasValidationError() && dropdownControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n @if(field.leftLabels) {\n <div>\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\">\n {{ field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span>\n </label>\n </div>\n }\n <div class=\"adf-dropdown-widget-container\">\n <mat-form-field class=\"adf-form-field-input\" subscriptSizing=\"dynamic\">\n @if ( (field.name || this.field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">{{ field.name | translate }}</mat-label>\n }\n <mat-select\n class=\"adf-select\"\n [formControl]=\"dropdownControl\"\n [id]=\"field.id\"\n [compareWith]=\"compareDropdownValues\"\n [title]=\"field.tooltip\"\n panelClass=\"adf-select-filter\"\n [multiple]=\"field.hasMultipleValues\"\n [required]=\"field.required\"\n [errorStateMatcher]=\"dropdownErrorStateMatcher\"\n #select\n (keydown.escape)=\"select.close()\"\n >\n @if(showInputFilter) {\n <adf-select-filter-input (change)=\"filter$.next($event)\" />\n }\n\n @for(opt of (list$ | async); track opt.id) {\n <mat-option [value]=\"opt\" [id]=\"opt.id\" [attr.data-automation-id]=\"'adf-dropdown-widget-option-' + opt.id\">\n {{opt.name}}\n </mat-option>\n }\n\n @if(isReadOnlyType) {\n <mat-option\n [id]=\"'readonlyOption-' + field.id\"\n [value]=\"field.value\"\n >\n {{readOnlyDisplayValue}}\n </mat-option>\n }\n </mat-select>\n @if ((hasValidationError() && !isRestApiFailed && !variableOptionsFailed) || (!previewState && !field.readOnly && (isRestApiFailed || variableOptionsFailed))) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\"\n >@if (hasValidationError() && !isRestApiFailed && !variableOptionsFailed) {{{ field.validationSummary.message | translate }}} @else if (isRestApiFailed) {{{ 'FORM.FIELD.REST_API_FAILED' | translate: { hostname: restApiHostName } }}} @else if (variableOptionsFailed) {{{ 'FORM.FIELD.VARIABLE_DROPDOWN_OPTIONS_FAILED' | translate }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-dropdown-widget{width:100%}.adf-dropdown-widget .adf-select{padding-top:0;width:100%}.adf-dropdown-widget-select{width:100%}.adf-dropdown-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-dropdown-widget-dropdown-required-message .adf-error-container,.adf-dropdown-widget-dropdown-failed-message .adf-error-container{margin-top:1px}.adf-dropdown-widget .mat-mdc-select-arrow-wrapper{height:auto}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: SelectFilterInputComponent, selector: "adf-select-filter-input", outputs: ["change"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
10390
10388
  }
10391
10389
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DropdownCloudWidgetComponent, decorators: [{
10392
10390
  type: Component,
10393
10391
  args: [{ selector: 'dropdown-cloud-widget', host: {
10394
10392
  '(click)': 'event($event)'
10395
- }, encapsulation: ViewEncapsulation.None, imports: [AsyncPipe, ReactiveFormsModule, MatFormFieldModule, MatSelectModule, TranslatePipe, SelectFilterInputComponent, MatIconModule], template: "<div\n class=\"adf-dropdown-widget {{field.className}}\"\n [class.adf-invalid]=\"dropdownControl.invalid && dropdownControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n @if(field.leftLabels) {\n <div>\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\">\n {{ field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span>\n </label>\n </div>\n }\n <div class=\"adf-dropdown-widget-container\">\n <mat-form-field class=\"adf-form-field-input\" subscriptSizing=\"dynamic\">\n @if ( (field.name || this.field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">{{ field.name | translate }}</mat-label>\n }\n <mat-select\n class=\"adf-select\"\n [formControl]=\"dropdownControl\"\n [id]=\"field.id\"\n [compareWith]=\"compareDropdownValues\"\n [title]=\"field.tooltip\"\n panelClass=\"adf-select-filter\"\n [multiple]=\"field.hasMultipleValues\"\n [required]=\"field.required\"\n [errorStateMatcher]=\"dropdownErrorStateMatcher\"\n #select\n (keydown.escape)=\"select.close()\"\n >\n @if(showInputFilter) {\n <adf-select-filter-input (change)=\"filter$.next($event)\" />\n }\n\n @for(opt of (list$ | async); track opt.id) {\n <mat-option [value]=\"opt\" [id]=\"opt.id\" [attr.data-automation-id]=\"'adf-dropdown-widget-option-' + opt.id\">\n {{opt.name}}\n </mat-option>\n }\n\n @if(isReadOnlyType) {\n <mat-option\n [id]=\"'readonlyOption-' + field.id\"\n [value]=\"field.value\"\n >\n {{readOnlyDisplayValue}}\n </mat-option>\n }\n </mat-select>\n @if ((dropdownControl.hasError('required') && !isRestApiFailed && !variableOptionsFailed) || (!previewState && !field.readOnly && (isRestApiFailed || variableOptionsFailed))) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\"\n >@if (dropdownControl.hasError('required') && !isRestApiFailed && !variableOptionsFailed) {{{ 'FORM.FIELD.REQUIRED' | translate }}} @else if (isRestApiFailed) {{{ 'FORM.FIELD.REST_API_FAILED' | translate: { hostname: restApiHostName } }}} @else if (variableOptionsFailed) {{{ 'FORM.FIELD.VARIABLE_DROPDOWN_OPTIONS_FAILED' | translate }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-dropdown-widget{width:100%}.adf-dropdown-widget .adf-select{padding-top:0;width:100%}.adf-dropdown-widget-select{width:100%}.adf-dropdown-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-dropdown-widget-dropdown-required-message .adf-error-container,.adf-dropdown-widget-dropdown-failed-message .adf-error-container{margin-top:1px}.adf-dropdown-widget .mat-mdc-select-arrow-wrapper{height:auto}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"] }]
10393
+ }, encapsulation: ViewEncapsulation.None, imports: [AsyncPipe, ReactiveFormsModule, MatFormFieldModule, MatSelectModule, TranslatePipe, SelectFilterInputComponent, MatIconModule], template: "<div\n class=\"adf-dropdown-widget {{field.className}}\"\n [class.adf-invalid]=\"hasValidationError() && dropdownControl.touched\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n @if(field.leftLabels) {\n <div>\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\">\n {{ field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span>\n </label>\n </div>\n }\n <div class=\"adf-dropdown-widget-container\">\n <mat-form-field class=\"adf-form-field-input\" subscriptSizing=\"dynamic\">\n @if ( (field.name || this.field?.required) && !field.leftLabels) {\n <mat-label class=\"adf-label\">{{ field.name | translate }}</mat-label>\n }\n <mat-select\n class=\"adf-select\"\n [formControl]=\"dropdownControl\"\n [id]=\"field.id\"\n [compareWith]=\"compareDropdownValues\"\n [title]=\"field.tooltip\"\n panelClass=\"adf-select-filter\"\n [multiple]=\"field.hasMultipleValues\"\n [required]=\"field.required\"\n [errorStateMatcher]=\"dropdownErrorStateMatcher\"\n #select\n (keydown.escape)=\"select.close()\"\n >\n @if(showInputFilter) {\n <adf-select-filter-input (change)=\"filter$.next($event)\" />\n }\n\n @for(opt of (list$ | async); track opt.id) {\n <mat-option [value]=\"opt\" [id]=\"opt.id\" [attr.data-automation-id]=\"'adf-dropdown-widget-option-' + opt.id\">\n {{opt.name}}\n </mat-option>\n }\n\n @if(isReadOnlyType) {\n <mat-option\n [id]=\"'readonlyOption-' + field.id\"\n [value]=\"field.value\"\n >\n {{readOnlyDisplayValue}}\n </mat-option>\n }\n </mat-select>\n @if ((hasValidationError() && !isRestApiFailed && !variableOptionsFailed) || (!previewState && !field.readOnly && (isRestApiFailed || variableOptionsFailed))) {\n <mat-error class=\"adf-form-field-status-slot\">\n <mat-icon class=\"adf-error-icon\">error_outline</mat-icon>\n <span class=\"adf-error-text\"\n >@if (hasValidationError() && !isRestApiFailed && !variableOptionsFailed) {{{ field.validationSummary.message | translate }}} @else if (isRestApiFailed) {{{ 'FORM.FIELD.REST_API_FAILED' | translate: { hostname: restApiHostName } }}} @else if (variableOptionsFailed) {{{ 'FORM.FIELD.VARIABLE_DROPDOWN_OPTIONS_FAILED' | translate }}}</span>\n </mat-error>\n }\n <mat-hint class=\"adf-form-field-status-slot\" aria-hidden=\"true\" />\n </mat-form-field>\n </div>\n</div>\n", styles: [".adf-dropdown-widget{width:100%}.adf-dropdown-widget .adf-select{padding-top:0;width:100%}.adf-dropdown-widget-select{width:100%}.adf-dropdown-widget-container{display:flex;align-items:flex-start;flex-direction:column}.adf-dropdown-widget-dropdown-required-message .adf-error-container,.adf-dropdown-widget-dropdown-failed-message .adf-error-container{margin-top:1px}.adf-dropdown-widget .mat-mdc-select-arrow-wrapper{height:auto}.adf-form-field-input .adf-error-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:text-bottom}\n"] }]
10396
10394
  }] });
10397
10395
 
10398
10396
  /*!
@@ -15063,8 +15061,7 @@ class GroupCloudWidgetComponent extends WidgetComponent {
15063
15061
  this.search.statusChanges
15064
15062
  .pipe(filter((value) => value === 'INVALID'), takeUntilDestroyed(this.destroyRef))
15065
15063
  .subscribe(() => {
15066
- this.field.markAsInvalid();
15067
- this.field.form.markAsInvalid();
15064
+ this.field.form.markFieldAsInvalid(this.field);
15068
15065
  });
15069
15066
  this.search.statusChanges
15070
15067
  .pipe(filter((value) => value === 'VALID'), takeUntilDestroyed(this.destroyRef))
@@ -15148,8 +15145,7 @@ class PeopleCloudWidgetComponent extends WidgetComponent {
15148
15145
  this.search.statusChanges
15149
15146
  .pipe(filter((value) => value === 'INVALID'), takeUntilDestroyed(this.destroyRef))
15150
15147
  .subscribe(() => {
15151
- this.field.markAsInvalid();
15152
- this.field.form.markAsInvalid();
15148
+ this.field.form.markFieldAsInvalid(this.field);
15153
15149
  });
15154
15150
  this.search.statusChanges
15155
15151
  .pipe(filter((value) => value === 'VALID'), takeUntilDestroyed(this.destroyRef))
@@ -17161,5 +17157,5 @@ const DATE_FORMAT_CLOUD = 'YYYY-MM-DD';
17161
17157
  * Generated bundle index. Do not edit.
17162
17158
  */
17163
17159
 
17164
- export { ADF_FORM_TAB_NAV_ENABLED, ADF_TASK_RUNTIME_BUNDLE_FALLBACK_ENABLED, APP_CUSTOM_SCREEN_TOKEN, ApplicationVersionModel, ApplicationVersionResponseModel, AppsProcessCloudService, AssignmentType, AttachFileCloudWidgetComponent, BaseCloudService, CloudFormRenderingService, ContentCloudNodeSelectorService, DATE_FORMAT_CLOUD, DEFAULT_OPTION, DEFAULT_TASK_PRIORITIES, DROPDOWN_CLOUD_WIDGET_SET_VALUE_DEBOUNCE, DateCloudFilterType, DateCloudWidgetComponent, DateRangeFilterService, DescriptorCustomUIAuthFlowType, DisplayModeService, DisplayRichTextWidgetComponent, DropdownCloudWidgetComponent, EditProcessFilterCloudComponent, EditServiceTaskFilterCloudComponent, EditTaskFilterCloudComponent, FORM_CLOUD_DIRECTIVES, FORM_CLOUD_FIELD_VALIDATORS_TOKEN, FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, FilePropertiesTableCloudComponent, FileViewerWidgetComponent, FilterCounterEntityType, FilterCountersCloudService, FormCloudComponent, FormCloudDisplayMode, FormCloudModule, FormCloudService, FormCustomOutcomesComponent, FormFieldType, FormSpinnerComponent, GroupCloudComponent, GroupCloudModule, GroupCloudWidgetComponent, HIDE_FILTER_LIMIT, IdentityGroupService, IdentityUserService, LocalPreferenceCloudService, NotificationCloudService, PROCESS_CLOUD_DIRECTIVES, PROCESS_FILTERS_CLOUD_DIRECTIVES, PROCESS_FILTERS_SERVICE_TOKEN, PROCESS_FILTER_ACTION_DELETE, PROCESS_FILTER_ACTION_RESTORE, PROCESS_FILTER_ACTION_SAVE, PROCESS_FILTER_ACTION_SAVE_AS, PROCESS_FILTER_ACTION_SAVE_DEFAULT, PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, PROCESS_SERVICES_CLOUD_DIRECTIVES, PeopleCloudComponent, PeopleCloudModule, PeopleCloudWidgetComponent, PeopleModeOptions, ProcessCloudContentService, ProcessCloudModule, ProcessCloudService, ProcessDefinitionCloud, ProcessFilterCloudAdapter, ProcessFilterCloudModel, ProcessFilterCloudService, ProcessFilterDialogCloudComponent, ProcessFiltersCloudComponent, ProcessFiltersCloudModule, ProcessHeaderCloudComponent, ProcessHeaderCloudModule, ProcessListCloudComponent, ProcessListCloudModule, ProcessListCloudPreferences, ProcessListCloudService, ProcessListCloudSortingModel, ProcessListRequestModel, ProcessListRequestSortingModel, ProcessPayloadCloud, ProcessQueryCloudRequestModel, ProcessServicesCloudModule, ProcessTaskListCloudService, PropertiesViewerWidgetComponent, PropertiesViewerWrapperComponent, RICH_TEXT_PARSER_TOKEN, RadioButtonsCloudWidgetComponent, ScreenRenderingService, ServiceTaskFilterCloudService, ServiceTaskFiltersCloudComponent, ServiceTaskListCloudComponent, ServiceTaskListCloudService, StartProcessCloudComponent, StartProcessCloudService, StartProcessScreenCloudComponent, StartTaskCloudRequestModel, TASK_ASSIGNED_STATE, TASK_CANCELLED_STATE, TASK_CLAIM_PERMISSION, TASK_COMPLETED_STATE, TASK_CREATED_STATE, TASK_FILTERS_CLOUD_DIRECTIVES, TASK_FILTERS_SERVICE_TOKEN, TASK_FORM_CLOUD_DIRECTIVES, TASK_LIST_CLOUD_DIRECTIVES, TASK_LIST_CLOUD_TOKEN, TASK_LIST_PREFERENCES_SERVICE_TOKEN, TASK_RELEASE_PERMISSION, TASK_SUSPENDED_STATE, TASK_UPDATE_PERMISSION, TASK_VIEW_PERMISSION, TaskAssignmentFilterCloudComponent, TaskCloudEntryModel, TaskCloudModule, TaskCloudNodePaging, TaskCloudPagingList, TaskCloudService, TaskFilterCloudAdapter, TaskFilterCloudModel, TaskFilterCloudService, TaskFilterDialogCloudComponent, TaskFiltersCloudComponent, TaskFiltersCloudModule, TaskFormCloudComponent, TaskFormModule, TaskHeaderCloudComponent, TaskHeaderCloudModule, TaskListCloudComponent, TaskListCloudModule, TaskListCloudService, TaskListCloudSortingModel, TaskListRequestModel, TaskListRequestSortingModel, TaskQueryCloudRequestModel, TaskStatusFilter, TaskVariableCloud, UploadCloudWidgetComponent, UserPreferenceCloudService, UserTaskCloudButtonsComponent, UserTaskCloudComponent, VariableMapperService, WebSocketService, getExpressionEvaluationEnabled$, materializeSubmissionValues, processCloudPresetsDefaultModel, provideCloudFormRenderer, provideCloudPreferences, provideScreen, radioButtonsSchema, resolveTaskRuntimeBundleFallback$ };
17160
+ export { ADF_FORM_TAB_NAV_ENABLED, ADF_TASK_RUNTIME_BUNDLE_FALLBACK_ENABLED, APP_CUSTOM_SCREEN_TOKEN, ApplicationVersionModel, ApplicationVersionResponseModel, AppsProcessCloudService, AssignmentType, AttachFileCloudWidgetComponent, BaseCloudService, CLOUD_FORM_FIELD_VALIDATORS, CloudFormRenderingService, ContentCloudNodeSelectorService, DATE_FORMAT_CLOUD, DEFAULT_OPTION, DEFAULT_TASK_PRIORITIES, DROPDOWN_CLOUD_WIDGET_SET_VALUE_DEBOUNCE, DateCloudFilterType, DateCloudWidgetComponent, DateRangeFilterService, DescriptorCustomUIAuthFlowType, DisplayModeService, DisplayRichTextWidgetComponent, DropdownCloudFieldValidator, DropdownCloudWidgetComponent, EditProcessFilterCloudComponent, EditServiceTaskFilterCloudComponent, EditTaskFilterCloudComponent, FORM_CLOUD_DIRECTIVES, FORM_CLOUD_FIELD_VALIDATORS_TOKEN, FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, FilePropertiesTableCloudComponent, FileViewerWidgetComponent, FilterCounterEntityType, FilterCountersCloudService, FormCloudComponent, FormCloudDisplayMode, FormCloudModule, FormCloudService, FormCustomOutcomesComponent, FormFieldType, FormSpinnerComponent, GroupCloudComponent, GroupCloudModule, GroupCloudWidgetComponent, HIDE_FILTER_LIMIT, IdentityGroupService, IdentityUserService, LocalPreferenceCloudService, NotificationCloudService, PROCESS_CLOUD_DIRECTIVES, PROCESS_FILTERS_CLOUD_DIRECTIVES, PROCESS_FILTERS_SERVICE_TOKEN, PROCESS_FILTER_ACTION_DELETE, PROCESS_FILTER_ACTION_RESTORE, PROCESS_FILTER_ACTION_SAVE, PROCESS_FILTER_ACTION_SAVE_AS, PROCESS_FILTER_ACTION_SAVE_DEFAULT, PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, PROCESS_SERVICES_CLOUD_DIRECTIVES, PeopleCloudComponent, PeopleCloudModule, PeopleCloudWidgetComponent, PeopleModeOptions, ProcessCloudContentService, ProcessCloudModule, ProcessCloudService, ProcessDefinitionCloud, ProcessFilterCloudAdapter, ProcessFilterCloudModel, ProcessFilterCloudService, ProcessFilterDialogCloudComponent, ProcessFiltersCloudComponent, ProcessFiltersCloudModule, ProcessHeaderCloudComponent, ProcessHeaderCloudModule, ProcessListCloudComponent, ProcessListCloudModule, ProcessListCloudPreferences, ProcessListCloudService, ProcessListCloudSortingModel, ProcessListRequestModel, ProcessListRequestSortingModel, ProcessPayloadCloud, ProcessQueryCloudRequestModel, ProcessServicesCloudModule, ProcessTaskListCloudService, PropertiesViewerWidgetComponent, PropertiesViewerWrapperComponent, RICH_TEXT_PARSER_TOKEN, RadioButtonsCloudWidgetComponent, ScreenRenderingService, ServiceTaskFilterCloudService, ServiceTaskFiltersCloudComponent, ServiceTaskListCloudComponent, ServiceTaskListCloudService, StartProcessCloudComponent, StartProcessCloudService, StartProcessScreenCloudComponent, StartTaskCloudRequestModel, TASK_ASSIGNED_STATE, TASK_CANCELLED_STATE, TASK_CLAIM_PERMISSION, TASK_COMPLETED_STATE, TASK_CREATED_STATE, TASK_FILTERS_CLOUD_DIRECTIVES, TASK_FILTERS_SERVICE_TOKEN, TASK_FORM_CLOUD_DIRECTIVES, TASK_LIST_CLOUD_DIRECTIVES, TASK_LIST_CLOUD_TOKEN, TASK_LIST_PREFERENCES_SERVICE_TOKEN, TASK_RELEASE_PERMISSION, TASK_SUSPENDED_STATE, TASK_UPDATE_PERMISSION, TASK_VIEW_PERMISSION, TaskAssignmentFilterCloudComponent, TaskCloudEntryModel, TaskCloudModule, TaskCloudNodePaging, TaskCloudPagingList, TaskCloudService, TaskFilterCloudAdapter, TaskFilterCloudModel, TaskFilterCloudService, TaskFilterDialogCloudComponent, TaskFiltersCloudComponent, TaskFiltersCloudModule, TaskFormCloudComponent, TaskFormModule, TaskHeaderCloudComponent, TaskHeaderCloudModule, TaskListCloudComponent, TaskListCloudModule, TaskListCloudService, TaskListCloudSortingModel, TaskListRequestModel, TaskListRequestSortingModel, TaskQueryCloudRequestModel, TaskStatusFilter, TaskVariableCloud, UploadCloudWidgetComponent, UserPreferenceCloudService, UserTaskCloudButtonsComponent, UserTaskCloudComponent, VariableMapperService, WebSocketService, getDateCloudWidgetRange, getExpressionEvaluationEnabled$, materializeSubmissionValues, processCloudPresetsDefaultModel, provideCloudFormRenderer, provideCloudPreferences, provideScreen, radioButtonsSchema, resolveTaskRuntimeBundleFallback$ };
17165
17161
  //# sourceMappingURL=adf-process-services-cloud.mjs.map