<commit_before>import { Component, ChangeDetectionStrategy } from '@angular/core';
import { Validators, FormGroup } from '@angular/forms';
import { FormlyFieldConfig } from '@ngx-formly/core';

@Component({
	selector: 'demo-formly-basic',
	templateUrl: './basic.html',
	changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BasicComponent {
	form: FormGroup = new FormGroup({});
	userFields = [
		{
			key: 'name',
			type: 'input',
			templateOptions: {
				type: 'text',
				label: 'name - text',
			},
		},
		{
			key: 'email',
			type: 'input',
			templateOptions: {
				type: 'email',
				label: 'email - email',
			},
		},
		{
			key: 'password',
			type: 'input',
			templateOptions: {
				type: 'password',
				label: 'password - password',
			},
		},
		{
			key: 'age',
			type: 'input',
			templateOptions: {
				type: 'number',
				label: 'age - number',
			},
		},
		{
			key: 'birthDate',
			type: 'date',
			templateOptions: {
				label: 'birthDate - date',
			},
		},
		{
			key: 'description',
			type: 'textarea',
			templateOptions: {
				label: 'description - textarea',
				placeholder: 'enter your life journey',
			},
		},
		// {
		// 	key: 'gender',
		// 	type: 'autocomplete',
		// 	templateOptions: {
		// 		label: 'gender - autocomplete',
		// 		placeholder: 'choose well',
		// 		options: [
		// 			{ id: 0, name: 'female' },
		// 			{ id: 1, name: 'male' },
		// 			{ id: 2, name: 'other' },
		// 		],
		// 	},
		// },
		{
			key: 'orientation',
			type: 'select',
			templateOptions: {
				label: 'sexual orientation - select',
				placeholder: 'choose well',
				options: [
					{ id: 0, name: 'female' },
					{ id: 1, name: 'male' },
					{ id: 2, name: 'other' },
				],
			},
		},
		{
			key: 'manager',
			type: 'user',
			templateOptions: {
				label: 'manager - user',
				placeholder: 'pings /api/v3/users/find',
			},
		},
		{
			key: 'Radio',
			type: 'radio',
			templateOptions: {
				label: 'Radio input',
				options: [
					{ value: 1, label: 'Option 1'},
					{ value: 2, label: 'Option 2'},
					{ value: 3, label: 'Option 3'},
					{ value: 4, label: 'Option 4'},
				]
			}
		},
		{
			key: 'checkbox',
			type: 'checkbox',
			templateOptions: {
				label: 'Checkboxes',
			}
		},
		// {
		// 	key: 'department',
		// 	type: 'api',
		// 	templateOptions: {
		// 		label: 'department - api',
		// 		placeholder: 'pings /api/v3/departments',
		// 		api: '/api/v3/departments',
		// 	},
		// },
	];

	user = {
		orientation: { id: 0, name: 'female' },
		manager: { id: 421, firstName: 'Lulu', lastName: 'B.' },
	};

	submit(user) {
		console.log(user);
	}
}
<commit_msg>demo-formly [add] api-select<commit_after>import { Component, ChangeDetectionStrategy } from '@angular/core';
import { Validators, FormGroup } from '@angular/forms';
import { FormlyFieldConfig } from '@ngx-formly/core';

@Component({
	selector: 'demo-formly-basic',
	templateUrl: './basic.html',
	changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BasicComponent {
	form: FormGroup = new FormGroup({});
	userFields = [
		{
			key: 'name',
			type: 'input',
			templateOptions: {
				type: 'text',
				label: 'name - text',
			},
		},
		{
			key: 'email',
			type: 'input',
			templateOptions: {
				type: 'email',
				label: 'email - email',
			},
		},
		{
			key: 'password',
			type: 'input',
			templateOptions: {
				type: 'password',
				label: 'password - password',
			},
		},
		{
			key: 'age',
			type: 'input',
			templateOptions: {
				type: 'number',
				label: 'age - number',
			},
		},
		{
			key: 'birthDate',
			type: 'date',
			templateOptions: {
				label: 'birthDate - date',
			},
		},
		{
			key: 'description',
			type: 'textarea',
			templateOptions: {
				label: 'description - textarea',
				placeholder: 'enter your life journey',
			},
		},
		{
			key: 'orientation',
			type: 'select',
			templateOptions: {
				label: 'sexual orientation - select',
				placeholder: 'choose well',
				options: [
					{ id: 0, name: 'female' },
					{ id: 1, name: 'male' },
					{ id: 2, name: 'other' },
				],
			},
		},
		{
			key: 'manager',
			type: 'user',
			templateOptions: {
				label: 'manager - user',
				placeholder: 'pings /api/v3/users/search',
			},
		},
		{
			key: 'department',
			type: 'api',
			templateOptions: {
				label: 'department - api',
				placeholder: 'pings /api/v3/departments',
				api: '/api/v3/departments',
				filters: ['isActive=true'],
			},
		},
		{
			key: 'Radio',
			type: 'radio',
			templateOptions: {
				label: 'Radio input',
				options: [
					{ value: 1, label: 'Option 1'},
					{ value: 2, label: 'Option 2'},
					{ value: 3, label: 'Option 3'},
					{ value: 4, label: 'Option 4'},
				]
			}
		},
		{
			key: 'checkbox',
			type: 'checkbox',
			templateOptions: {
				label: 'Checkboxes',
			}
		},
	];

	user = {
		orientation: { id: 0, name: 'female' },
		manager: { id: 421, firstName: 'Lulu', lastName: 'B.' },
	};

	submit(user) {
		console.log(user);
	}
}

{'fraction_non_alphanumeric': 0.18152257077276204, 'fraction_numerical': 0.007459831675592961, 'mean_word_length': 2.0977488151658767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2554122', 'n_tokens_mistral': 2345, 'n_tokens_neox': 1814, 'n_words': 408}