@ldquocc/dynamic-form 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ldquocc-dynamic-form.mjs +1029 -2842
- package/fesm2022/ldquocc-dynamic-form.mjs.map +1 -1
- package/lib/shared/components/component.d.ts +13 -14
- package/lib/shared/components/dynamic-field/dynamic-field.component.d.ts +5 -5
- package/lib/shared/components/fields/upload/avatar-upload/avatar-upload.component.d.ts +1 -0
- package/lib/shared/components/fields/upload/multi-file-upload/multi-file-upload.component.d.ts +7 -6
- package/lib/shared/components/fields/upload/multi-image-upload/multi-image-upload.component.d.ts +1 -0
- package/lib/shared/components/fields/upload/single-file-upload/single-file-upload.component.d.ts +1 -0
- package/lib/shared/consts/common/index.d.ts +0 -1
- package/lib/shared/models/fields/upload/index.d.ts +4 -0
- package/lib/shared/services/dynamic-form.service.d.ts +3 -3
- package/lib/shared/utils/validators/custom-validators.d.ts +1 -2
- package/package.json +1 -1
- package/public-api.d.ts +3 -4
- package/lib/shared/components/fields/radio/custom/reminder-type-radio/reminder-type-radio.component.d.ts +0 -24
- package/lib/shared/consts/common/sample-test.const.d.ts +0 -68
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-option.model.d.ts +0 -26
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-type-radio-field.model.d.ts +0 -14
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-type.model.d.ts +0 -1
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-value.model.d.ts +0 -7
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { DatePickerComponent } from
|
|
2
|
-
import { DateRangeComponent } from
|
|
3
|
-
import { InputPasswordComponent } from
|
|
4
|
-
import { InputTextComponent } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
export declare const FIELD_COMPONENTS: (typeof DatePickerComponent | typeof DateRangeComponent | typeof InputPasswordComponent | typeof InputTextComponent | typeof ReminderTypeRadioComponent | typeof MultiSelectComponent | typeof SingleSelectComponent | typeof TreeSelectComponent | typeof TextareaComponent | typeof AvatarUploadComponent | typeof MultiFileUploadComponent | typeof MultiImageUploadComponent | typeof SingleFileUploadComponent)[];
|
|
1
|
+
import { DatePickerComponent } from "./fields/date/date-picker/date-picker.component";
|
|
2
|
+
import { DateRangeComponent } from "./fields/date/date-range/date-range.component";
|
|
3
|
+
import { InputPasswordComponent } from "./fields/input/input-password/input-password.component";
|
|
4
|
+
import { InputTextComponent } from "./fields/input/input-text/input-text.component";
|
|
5
|
+
import { MultiSelectComponent } from "./fields/select/multi-select/multi-select.component";
|
|
6
|
+
import { SingleSelectComponent } from "./fields/select/single-select/single-select.component";
|
|
7
|
+
import { TreeSelectComponent } from "./fields/select/tree-select/tree-select.component";
|
|
8
|
+
import { TextareaComponent } from "./fields/textarea/textarea.component";
|
|
9
|
+
import { AvatarUploadComponent } from "./fields/upload/avatar-upload/avatar-upload.component";
|
|
10
|
+
import { MultiFileUploadComponent } from "./fields/upload/multi-file-upload/multi-file-upload.component";
|
|
11
|
+
import { MultiImageUploadComponent } from "./fields/upload/multi-image-upload/multi-image-upload.component";
|
|
12
|
+
import { SingleFileUploadComponent } from "./fields/upload/single-file-upload/single-file-upload.component";
|
|
13
|
+
export declare const FIELD_COMPONENTS: (typeof DatePickerComponent | typeof DateRangeComponent | typeof InputPasswordComponent | typeof InputTextComponent | typeof MultiSelectComponent | typeof SingleSelectComponent | typeof TreeSelectComponent | typeof TextareaComponent | typeof AvatarUploadComponent | typeof MultiFileUploadComponent | typeof MultiImageUploadComponent | typeof SingleFileUploadComponent)[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseField } from
|
|
2
|
-
import { AbstractControl, FormGroup } from
|
|
3
|
-
import { FormMode } from
|
|
4
|
-
import { FieldTypeEnum } from
|
|
5
|
-
import { FormModeEnum } from
|
|
1
|
+
import { BaseField } from "../../models/fields/field.model";
|
|
2
|
+
import { AbstractControl, FormGroup } from "@angular/forms";
|
|
3
|
+
import { FormMode } from "../../models/form";
|
|
4
|
+
import { FieldTypeEnum } from "../../enums/fields";
|
|
5
|
+
import { FormModeEnum } from "../../enums/form";
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class DynamicFieldComponent {
|
|
8
8
|
readonly field: import("@angular/core").InputSignal<BaseField<any>>;
|
|
@@ -12,6 +12,7 @@ export declare class AvatarUploadComponent extends BaseValueAccessor<string | Fi
|
|
|
12
12
|
objStorageList: import("@angular/core").WritableSignal<ObjectStorage[]>;
|
|
13
13
|
private fileService;
|
|
14
14
|
private formConfigService;
|
|
15
|
+
private nzNotification;
|
|
15
16
|
constructor();
|
|
16
17
|
protected writeValueToView(value: string): void;
|
|
17
18
|
private handleInitAllData;
|
package/lib/shared/components/fields/upload/multi-file-upload/multi-file-upload.component.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseValueAccessor } from
|
|
2
|
-
import { NzUploadFile, NzUploadXHRArgs } from
|
|
3
|
-
import { MultiFileUploadField } from
|
|
4
|
-
import { MyUploadFile } from
|
|
5
|
-
import { ObjectStorage } from
|
|
6
|
-
import { Observable, Subscription } from
|
|
1
|
+
import { BaseValueAccessor } from "../../../../base/base-value-accessor";
|
|
2
|
+
import { NzUploadFile, NzUploadXHRArgs } from "ng-zorro-antd/upload";
|
|
3
|
+
import { MultiFileUploadField } from "../../../../models/fields/upload/multi-file-upload-field.model";
|
|
4
|
+
import { MyUploadFile } from "../../../../models/common/common.model";
|
|
5
|
+
import { ObjectStorage } from "../../../../models/common";
|
|
6
|
+
import { Observable, Subscription } from "rxjs";
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class MultiFileUploadComponent extends BaseValueAccessor<string | File | NzUploadFile> {
|
|
9
9
|
readonly fieldSignal: import("@angular/core").Signal<MultiFileUploadField>;
|
|
@@ -17,6 +17,7 @@ export declare class MultiFileUploadComponent extends BaseValueAccessor<string |
|
|
|
17
17
|
private toast;
|
|
18
18
|
private translate;
|
|
19
19
|
private nzMessage;
|
|
20
|
+
private nzNotification;
|
|
20
21
|
private formConfigService;
|
|
21
22
|
constructor();
|
|
22
23
|
protected writeValueToView(value: string): void;
|
package/lib/shared/components/fields/upload/multi-image-upload/multi-image-upload.component.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare class MultiImageUploadComponent extends BaseValueAccessor<string
|
|
|
12
12
|
private fileService;
|
|
13
13
|
private toast;
|
|
14
14
|
private translate;
|
|
15
|
+
private nzNotification;
|
|
15
16
|
private formConfigService;
|
|
16
17
|
constructor();
|
|
17
18
|
protected writeValueToView(value: string): void;
|
package/lib/shared/components/fields/upload/single-file-upload/single-file-upload.component.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare class SingleFileUploadComponent extends BaseValueAccessor<string
|
|
|
15
15
|
private fileService;
|
|
16
16
|
private toast;
|
|
17
17
|
private translate;
|
|
18
|
+
private nzNotification;
|
|
18
19
|
private formConfigService;
|
|
19
20
|
constructor();
|
|
20
21
|
protected writeValueToView(value: string): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseField } from
|
|
2
|
-
import { ObjField } from
|
|
3
|
-
import { FormGroup } from
|
|
1
|
+
import { BaseField } from "../models/fields/field.model";
|
|
2
|
+
import { ObjField } from "../models/common/obj-field.model";
|
|
3
|
+
import { FormGroup } from "@angular/forms";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class DynamicFormService {
|
|
6
6
|
private formConfigService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsyncValidatorFn, ValidatorFn } from
|
|
1
|
+
import { AsyncValidatorFn, ValidatorFn } from "@angular/forms";
|
|
2
2
|
export declare const noLeadingSpaceValidator: () => ValidatorFn;
|
|
3
3
|
export declare const noWhitespaceValidator: () => ValidatorFn;
|
|
4
4
|
export declare const startsWithValidator: (prefix: string) => ValidatorFn;
|
|
@@ -9,4 +9,3 @@ export declare const noSpecialCharValidator: () => ValidatorFn;
|
|
|
9
9
|
export declare const usernameBlacklistValidator: (blacklist: string[]) => ValidatorFn;
|
|
10
10
|
export declare const acceptedMimeTypesValidator: (acceptedMimeTypes: string[]) => ValidatorFn;
|
|
11
11
|
export declare const maxFileSizeInMBValidator: (maxSizeInMB: number) => ValidatorFn;
|
|
12
|
-
export declare const reminderCustomRequiredValidator: () => ValidatorFn;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export * from "./lib/shared/config/dynamic-form.config";
|
|
|
7
7
|
export * from "./lib/shared/services/form-config.service";
|
|
8
8
|
export * from "./lib/shared/services/dynamic-form.service";
|
|
9
9
|
export * from "./lib/shared/services/form-data.service";
|
|
10
|
+
export * from "./lib/shared/services/suffix.service";
|
|
11
|
+
export * from "./lib/shared/services/file.service";
|
|
12
|
+
export * from "./lib/shared/consts/common/file.const";
|
|
10
13
|
export * from "./lib/shared/enums/controls/index";
|
|
11
14
|
export * from "./lib/shared/enums/fields/index";
|
|
12
15
|
export * from "./lib/shared/enums/validators/index";
|
|
@@ -23,7 +26,3 @@ export * from "./lib/shared/models/fields/select/multi-select-field.model";
|
|
|
23
26
|
export * from "./lib/shared/models/fields/select/tree-select-field.model";
|
|
24
27
|
export * from "./lib/shared/models/fields/upload/index";
|
|
25
28
|
export * from "./lib/shared/models/fields/radio/radio-base-field.model";
|
|
26
|
-
export * from "./lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-type-radio-field.model";
|
|
27
|
-
export * from "./lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-value.model";
|
|
28
|
-
export * from "./lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-option.model";
|
|
29
|
-
export * from "./lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-type.model";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BaseValueAccessor } from '../../../../../base/base-value-accessor';
|
|
2
|
-
import { DateOptions, ReminderOption, SelectOption } from '../../../../../models/fields/radio/custom/reminder-type-radio/reminder-option.model';
|
|
3
|
-
import { ReminderTypeRadioField } from '../../../../../models/fields/radio/custom/reminder-type-radio/reminder-type-radio-field.model';
|
|
4
|
-
import { ReminderValue } from '../../../../../models/fields/radio/custom/reminder-type-radio/reminder-value.model';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class ReminderTypeRadioComponent extends BaseValueAccessor<ReminderValue | null> {
|
|
7
|
-
readonly fieldSignal: import("@angular/core").Signal<ReminderTypeRadioField>;
|
|
8
|
-
options: ReminderOption[];
|
|
9
|
-
selectedOption: ReminderOption;
|
|
10
|
-
selectedOptionCode: string;
|
|
11
|
-
deadline: Date | null;
|
|
12
|
-
get selectDetail(): SelectOption | undefined;
|
|
13
|
-
get dateDetail(): DateOptions | undefined;
|
|
14
|
-
disabledAfterLimit: (current: Date) => boolean;
|
|
15
|
-
private toast;
|
|
16
|
-
constructor();
|
|
17
|
-
protected writeValueToView(value: ReminderValue | null): void;
|
|
18
|
-
protected handleValueChange(value: ReminderValue): void;
|
|
19
|
-
reminderRadioChange(radioValue: string): void;
|
|
20
|
-
changeOptionSelect(optionValue: string): void;
|
|
21
|
-
changeDate(date: Date): void;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ReminderTypeRadioComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ReminderTypeRadioComponent, "app-reminder-type-radio", never, {}, {}, never, never, true, never>;
|
|
24
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { ObjField } from '../../models/common/obj-field.model';
|
|
2
|
-
import { DatePickerField, DateRangeField } from '../../models/fields/date';
|
|
3
|
-
import { InputTextField } from '../../models/fields/input';
|
|
4
|
-
import { MultiSelectField } from '../../models/fields/select/multi-select-field.model';
|
|
5
|
-
import { SingleSelectField } from '../../models/fields/select/single-select-field.model';
|
|
6
|
-
import { TextareaField } from '../../models/fields/textarea/textarea-field.model';
|
|
7
|
-
import { AvatarUploadField } from '../../models/fields/upload/avatar-upload-field.model';
|
|
8
|
-
import { MultiFileUploadField } from '../../models/fields/upload/multi-file-upload-field.model';
|
|
9
|
-
import { MultiImageUploadField } from '../../models/fields/upload/multi-image-upload-field.model';
|
|
10
|
-
import { SingleFileUploadField } from '../../models/fields/upload/single-file-upload-field.model';
|
|
11
|
-
export declare const sampleObjFields: ObjField[];
|
|
12
|
-
export declare const sampleFields: MultiFileUploadField[];
|
|
13
|
-
export declare const sampleFields2: (DatePickerField | DateRangeField | InputTextField | MultiSelectField | SingleSelectField | TextareaField | MultiFileUploadField | SingleFileUploadField)[];
|
|
14
|
-
export declare const sampleModel: {
|
|
15
|
-
province: {
|
|
16
|
-
code: number;
|
|
17
|
-
name: string;
|
|
18
|
-
};
|
|
19
|
-
username: string;
|
|
20
|
-
role: {
|
|
21
|
-
name: string;
|
|
22
|
-
code: string;
|
|
23
|
-
};
|
|
24
|
-
multiRole: {
|
|
25
|
-
name: string;
|
|
26
|
-
code: string;
|
|
27
|
-
}[];
|
|
28
|
-
note: string;
|
|
29
|
-
date: Date;
|
|
30
|
-
expectedTime: (string | Date)[];
|
|
31
|
-
attachment: string;
|
|
32
|
-
pictures: string;
|
|
33
|
-
};
|
|
34
|
-
export declare const sampleModel2: {
|
|
35
|
-
images: string;
|
|
36
|
-
avatar: string;
|
|
37
|
-
province: {
|
|
38
|
-
code: number;
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
41
|
-
district: {
|
|
42
|
-
code: number;
|
|
43
|
-
name: string;
|
|
44
|
-
};
|
|
45
|
-
username: string;
|
|
46
|
-
role: {
|
|
47
|
-
name: string;
|
|
48
|
-
code: string;
|
|
49
|
-
};
|
|
50
|
-
multiRole: {
|
|
51
|
-
name: string;
|
|
52
|
-
code: string;
|
|
53
|
-
}[];
|
|
54
|
-
note: string;
|
|
55
|
-
date: Date;
|
|
56
|
-
expectedTime: (string | Date)[];
|
|
57
|
-
attachment: string;
|
|
58
|
-
pictures: string;
|
|
59
|
-
};
|
|
60
|
-
export declare const sampleMultiFormFieldsA: (InputTextField | AvatarUploadField | MultiFileUploadField | MultiImageUploadField | SingleFileUploadField)[];
|
|
61
|
-
export declare const sampleMultiFormFieldsB: (InputTextField | AvatarUploadField | MultiFileUploadField | MultiImageUploadField | SingleFileUploadField)[];
|
|
62
|
-
export declare const sampleMultiFormModelA: {
|
|
63
|
-
usernameA: string;
|
|
64
|
-
};
|
|
65
|
-
export declare const sampleMultiFormModelB: {
|
|
66
|
-
usernameB: string;
|
|
67
|
-
};
|
|
68
|
-
export declare const sampleMultiSelectDependOnParent: (MultiSelectField | SingleSelectField | MultiFileUploadField)[];
|
package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-option.model.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ReminderType } from './reminder-type.model';
|
|
2
|
-
export interface ReminderOptionBase {
|
|
3
|
-
code: string;
|
|
4
|
-
name: string;
|
|
5
|
-
type: ReminderType;
|
|
6
|
-
}
|
|
7
|
-
export declare class SelectOption {
|
|
8
|
-
options: {
|
|
9
|
-
code: string;
|
|
10
|
-
name: string;
|
|
11
|
-
}[];
|
|
12
|
-
constructor(init?: Partial<SelectOption>);
|
|
13
|
-
}
|
|
14
|
-
export declare class DateOptions {
|
|
15
|
-
format?: string;
|
|
16
|
-
minDate?: Date;
|
|
17
|
-
maxDate?: Date;
|
|
18
|
-
constructor(init?: Partial<DateOptions>);
|
|
19
|
-
}
|
|
20
|
-
export declare class ReminderOption implements ReminderOptionBase {
|
|
21
|
-
code: string;
|
|
22
|
-
name: string;
|
|
23
|
-
type: ReminderType;
|
|
24
|
-
detail?: SelectOption | DateOptions;
|
|
25
|
-
constructor(init?: Partial<ReminderOption>);
|
|
26
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FormControl, ValidatorFn } from '@angular/forms';
|
|
2
|
-
import { RadioBaseField } from '../../radio-base-field.model';
|
|
3
|
-
import { ReminderOption } from './reminder-option.model';
|
|
4
|
-
import { ReminderValue } from './reminder-value.model';
|
|
5
|
-
/**
|
|
6
|
-
* Interface của Select Field type là dạng Reminder Type Radio.
|
|
7
|
-
*/
|
|
8
|
-
export declare class ReminderTypeRadioField extends RadioBaseField<ReminderValue | null, ReminderOption> {
|
|
9
|
-
constructor(init: Partial<ReminderTypeRadioField>);
|
|
10
|
-
getDefaultValue(): ReminderValue | null;
|
|
11
|
-
toFormValue(modelValue: unknown): ReminderValue | null;
|
|
12
|
-
protected getCustomReminderTypeValidators(): ValidatorFn[];
|
|
13
|
-
toFormControl(): FormControl;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ReminderType = 'select' | 'date';
|