How to use the @ng-dynamic-forms/core.DynamicSelectModel function in @ng-dynamic-forms/core

To help you get started, we’ve selected a few @ng-dynamic-forms/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DSpace / dspace-angular / src / app / submission / section / upload / file / edit / file-edit.component.ts View on Github external
'groupUUID',
              (model.parent as DynamicFormArrayGroupModel).group) as DynamicSelectModel;

            this.availableAccessConditionGroups.forEach((group) => {
              groupOptions.push({
                label: group.name,
                value: group.uuid
              })
            });

            // Due to a bug can't dynamically change the select options, so replace the model with a new one
            const confGroup = { relation: groupModel.relation };
            const groupsConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG, confGroup);
            groupsConfig.options = groupOptions;
            model.parent.group.pop();
            model.parent.group.push(new DynamicSelectModel(groupsConfig, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_LAYOUT));
          }

        }
        if (accessCondition.hasStartDate) {
          const startDateModel = this.formBuilderService.findById(
            'startDate',
            (model.parent as DynamicFormArrayGroupModel).group) as DynamicDateControlModel;

          const min = new Date(accessCondition.maxStartDate);
          startDateModel.max = {
            year: min.getFullYear(),
            month: min.getMonth() + 1,
            day: min.getDate()
          };
        }
        if (accessCondition.hasEndDate) {
github udos86 / ng-dynamic-forms / projects / ng-dynamic-forms / ui-ionic / src / lib / select / dynamic-ionic-select.component.spec.ts View on Github external
describe("DynamicIonicSelectComponent test suite", () => {

    let testModel = new DynamicSelectModel({id: "select", options: [{value: "One"}, {value: "Two"}], value: "One"}),
        formModel = [testModel],
        formGroup: FormGroup,
        fixture: ComponentFixture,
        component: DynamicIonicSelectComponent,
        debugElement: DebugElement,
        testElement: DebugElement;

    beforeEach(async(() => {

        TestBed.configureTestingModule({

            imports: [
                ReactiveFormsModule,
                NoopAnimationsModule,
                IonicModule,
                TextMaskModule,
github DSpace / dspace-angular / src / app / submission / section / upload / files-edit / files-edit.component.ts View on Github external
accessConditionsArrayConfig.groupFactory = () => {
        const type = new DynamicSelectModel(accessConditionTypeModel, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_CLS);
        const startDateConfig = Object.assign(BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG, confStart);
        const endDateConfig = Object.assign(BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG, confEnd);
        const groupsConfig = Object.assign(BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG, confGroup);

        const startDate = new DynamicDatePickerModel(startDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CLS);
        const endDate = new DynamicDatePickerModel(endDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CLS);
        const groups = new DynamicSelectModel(groupsConfig, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CLS);
        return [type, startDate, endDate, groups];
      };
github DSpace / dspace-angular / src / app / submission / section / upload / file / edit / file-edit.component.ts View on Github external
accessConditionsArrayConfig.groupFactory = () => {
        const type = new DynamicSelectModel(accessConditionTypeModelConfig, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT);
        const startDateConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_CONFIG, confStart);
        const endDateConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_CONFIG, confEnd);
        const groupsConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_CONFIG, confGroup);

        const startDate = new DynamicDatePickerModel(startDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_START_DATE_LAYOUT);
        const endDate = new DynamicDatePickerModel(endDateConfig, BITSTREAM_FORM_ACCESS_CONDITION_END_DATE_LAYOUT);
        const groups = new DynamicSelectModel(groupsConfig, BITSTREAM_FORM_ACCESS_CONDITION_GROUPS_LAYOUT);

        return [ type, startDate, endDate, groups ];
      };
github mesemus / django-angular-dynamic-forms / angular / packages / django-angular-dynamic-forms / src / impl / django-form-content.component.ts View on Github external
required: field_config.required,
                        disabled: field_config.read_only,
                        validators: {
                            external_validator: {
                                name: external_validator.name,
                                args: {id: id, errors: this._external_errors}
                            }
                        },
                        errorMessages: {
                            external_error: '{{external_error}}'
                        }
                    },
                    merge_layouts(field_config.layout, extra_layout)
                );
            case SimpleFieldTypes.SELECT:
                return new DynamicSelectModel(
                    {
                        id: id,
                        placeholder: label,
                        options: (field_config as SelectFieldConfig).choices,
                        required: field_config.required,
                        disabled: field_config.read_only,
                        validators: {
                            external_validator: {
                                name: external_validator.name,
                                args: {id: id, errors: this._external_errors}
                            }
                        },
                        errorMessages: {
                            external_error: '{{external_error}}'
                        }
                    },
github udos86 / ng-dynamic-forms / packages / ui-ionic / src / select / dynamic-ionic-select.component.spec.ts View on Github external
xdescribe("DynamicIonicSelectComponent test suite", () => {

    let testModel = new DynamicSelectModel({id: "select", options: [{value: "One"}, {value: "Two"}], value: "One"}),
        formModel = [testModel],
        formGroup: FormGroup,
        fixture: ComponentFixture,
        component: DynamicIonicSelectComponent,
        debugElement: DebugElement,
        testElement: DebugElement;

    beforeEach(async(() => {

        TestBed.configureTestingModule({

            imports: [
                ReactiveFormsModule,
                NoopAnimationsModule,
                TextMaskModule,
                DynamicFormsCoreModule
github mesemus / django-angular-dynamic-forms / demo / angular / src / django-angular-dynamic-forms / src / impl / django-form-content.component.ts View on Github external
required: field_config.required,
                        disabled: field_config.read_only,
                        validators: {
                            external_validator: {
                                name: external_validator.name,
                                args: {id: id, errors: this._external_errors}
                            }
                        },
                        errorMessages: {
                            external_error: '{{external_error}}'
                        }
                    },
                    field_config.layout
                );
            case SimpleFieldTypes.SELECT:
                return new DynamicSelectModel(
                    {
                        id: id,
                        placeholder: label,
                        options: (field_config as SelectFieldConfig).choices,
                        required: field_config.required,
                        disabled: field_config.read_only,
                        validators: {
                            external_validator: {
                                name: external_validator.name,
                                args: {id: id, errors: this._external_errors}
                            }
                        },
                        errorMessages: {
                            external_error: '{{external_error}}'
                        }
                    },
github DSpace / dspace-angular / src / app / shared / mocks / mock-form-models.ts View on Github external
label: 'ISBN',
      value: 'dc.identifier.isbn'
    }
  ],
  value: 'dc.identifier.issn'
};

export const qualdropInputConfig = {
  name: 'dc.identifier_QUALDROP_VALUE',
  id: 'dc_identifier_QUALDROP_VALUE',
  readOnly: false,
  disabled: false,
  value: 'test'
};

export const mockQualdropSelectModel = new DynamicSelectModel(qualdropSelectConfig);
export const mockQualdropInputModel = new DsDynamicInputModel(qualdropInputConfig);

export const qualdropConfig = {
  id: 'dc_identifier_QUALDROP_GROUP',
  legend: 'Identifiers',
  readOnly: false,
  group: [mockQualdropSelectModel, mockQualdropInputModel]
};

export const MockQualdropModel = new DynamicQualdropModel(qualdropConfig);

const rowArrayQualdropConfig = {
  id: 'row_QUALDROP_GROUP',
  initialCount: 1,
  notRepeatable: true,
  groupFactory: () => {
github udos86 / ng-dynamic-forms / packages / ui-primeng / src / dropdown / dynamic-primeng-dropdown.component.spec.ts View on Github external
describe("DynamicPrimeNGDropdownComponent test suite", () => {

    let testModel = new DynamicSelectModel({id: "select", options: [{value: "One"}, {value: "Two"}], value: "One"}),
        formModel = [testModel],
        formGroup: FormGroup,
        fixture: ComponentFixture,
        component: DynamicPrimeNGDropdownComponent,
        debugElement: DebugElement,
        testElement: DebugElement;

    beforeEach(async(() => {

        TestBed.configureTestingModule({

            imports: [
                ReactiveFormsModule,
                NoopAnimationsModule,
                TextMaskModule,
                DropdownModule,
github udos86 / ng-dynamic-forms / packages / ui-ng-bootstrap / src / select / dynamic-ng-bootstrap-select.component.spec.ts View on Github external
describe("DynamicNGBootstrapSelectComponent test suite", () => {

    let testModel = new DynamicSelectModel({id: "select", options: [{value: "One"}, {value: "Two"}], value: "One"}),
        formModel = [testModel],
        formGroup: FormGroup,
        fixture: ComponentFixture,
        component: DynamicNGBootstrapSelectComponent,
        debugElement: DebugElement,
        testElement: DebugElement;

    beforeEach(async(() => {

        TestBed.configureTestingModule({

            imports: [
                ReactiveFormsModule,
                NoopAnimationsModule,
                TextMaskModule,
                DynamicFormsCoreModule