@ldquocc/dynamic-form 0.0.1
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/README.md +63 -0
- package/fesm2022/ldquocc-dynamic-form.mjs +6466 -0
- package/fesm2022/ldquocc-dynamic-form.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/ldquocc-dynamic-form-0.0.1.tgz +0 -0
- package/lib/dynamic-form.component.d.ts +67 -0
- package/lib/dynamic-form.service.d.ts +6 -0
- package/lib/shared/base/base-value-accessor.d.ts +62 -0
- package/lib/shared/components/component.d.ts +14 -0
- package/lib/shared/components/dynamic-field/dynamic-field.component.d.ts +23 -0
- package/lib/shared/components/fields/components/suffix/suffix.component.d.ts +12 -0
- package/lib/shared/components/fields/date/date-picker/date-picker.component.d.ts +15 -0
- package/lib/shared/components/fields/date/date-range/date-range.component.d.ts +16 -0
- package/lib/shared/components/fields/input/input-password/input-password.component.d.ts +11 -0
- package/lib/shared/components/fields/input/input-text/input-text.component.d.ts +14 -0
- package/lib/shared/components/fields/radio/custom/reminder-type-radio/reminder-type-radio.component.d.ts +24 -0
- package/lib/shared/components/fields/select/multi-select/multi-select.component.d.ts +25 -0
- package/lib/shared/components/fields/select/single-select/single-select.component.d.ts +26 -0
- package/lib/shared/components/fields/select/tree-select/tree-select.component.d.ts +27 -0
- package/lib/shared/components/fields/textarea/textarea.component.d.ts +13 -0
- package/lib/shared/components/fields/upload/avatar-upload/avatar-upload.component.d.ts +26 -0
- package/lib/shared/components/fields/upload/multi-file-upload/multi-file-upload.component.d.ts +77 -0
- package/lib/shared/components/fields/upload/multi-image-upload/multi-image-upload.component.d.ts +27 -0
- package/lib/shared/components/fields/upload/single-file-upload/single-file-upload.component.d.ts +29 -0
- package/lib/shared/config/dynamic-form.config.d.ts +9 -0
- package/lib/shared/consts/common/common.const.d.ts +1 -0
- package/lib/shared/consts/common/field-dependency.const.d.ts +1 -0
- package/lib/shared/consts/common/file.const.d.ts +148 -0
- package/lib/shared/consts/common/index.d.ts +5 -0
- package/lib/shared/consts/common/sample-test.const.d.ts +68 -0
- package/lib/shared/consts/common/standalone-import.const.d.ts +7 -0
- package/lib/shared/consts/controls/control.const.d.ts +1 -0
- package/lib/shared/consts/controls/index.d.ts +1 -0
- package/lib/shared/consts/fields/date-field.const.d.ts +7 -0
- package/lib/shared/consts/fields/field.const.d.ts +4 -0
- package/lib/shared/consts/fields/index.d.ts +4 -0
- package/lib/shared/consts/fields/input-field.const.d.ts +4 -0
- package/lib/shared/consts/fields/radio-field.const.d.ts +10 -0
- package/lib/shared/consts/fields/select-field.const.d.ts +6 -0
- package/lib/shared/consts/fields/upload-field.const.d.ts +1 -0
- package/lib/shared/consts/validators/pattern.const.d.ts +2 -0
- package/lib/shared/enums/common/field-dependency.enum.d.ts +9 -0
- package/lib/shared/enums/common/file-size-type.enum.d.ts +6 -0
- package/lib/shared/enums/common/index.d.ts +4 -0
- package/lib/shared/enums/common/output-value-type.enum.d.ts +19 -0
- package/lib/shared/enums/common/view-mode.enum.d.ts +4 -0
- package/lib/shared/enums/controls/control.enum.d.ts +11 -0
- package/lib/shared/enums/controls/index.d.ts +1 -0
- package/lib/shared/enums/fields/date-field.enum.d.ts +4 -0
- package/lib/shared/enums/fields/field.enum.d.ts +19 -0
- package/lib/shared/enums/fields/index.d.ts +5 -0
- package/lib/shared/enums/fields/input-field.enum.d.ts +6 -0
- package/lib/shared/enums/fields/select-field.enum.d.ts +4 -0
- package/lib/shared/enums/fields/upload-field.enum.d.ts +5 -0
- package/lib/shared/enums/form/dynamic-form.enum.d.ts +6 -0
- package/lib/shared/enums/form/index.d.ts +1 -0
- package/lib/shared/enums/validators/index.d.ts +1 -0
- package/lib/shared/enums/validators/validators.enum.d.ts +14 -0
- package/lib/shared/models/common/api-config.model.d.ts +4 -0
- package/lib/shared/models/common/api-response.model.d.ts +19 -0
- package/lib/shared/models/common/common.model.d.ts +29 -0
- package/lib/shared/models/common/field-dependency.model.d.ts +16 -0
- package/lib/shared/models/common/file-config.model.d.ts +11 -0
- package/lib/shared/models/common/index.d.ts +7 -0
- package/lib/shared/models/common/obj-field.model.d.ts +59 -0
- package/lib/shared/models/common/object-storage.model.d.ts +15 -0
- package/lib/shared/models/common/output-value-type.model.d.ts +4 -0
- package/lib/shared/models/common/table-models.d.ts +15 -0
- package/lib/shared/models/common/view-mode.model.d.ts +1 -0
- package/lib/shared/models/controls/control.model.d.ts +2 -0
- package/lib/shared/models/controls/index.d.ts +1 -0
- package/lib/shared/models/fields/date/base-date-field.model.d.ts +19 -0
- package/lib/shared/models/fields/date/date-picker-field.model.d.ts +12 -0
- package/lib/shared/models/fields/date/date-range-field.model.d.ts +11 -0
- package/lib/shared/models/fields/date/index.d.ts +3 -0
- package/lib/shared/models/fields/field-grid.model.d.ts +9 -0
- package/lib/shared/models/fields/field-group.model.d.ts +21 -0
- package/lib/shared/models/fields/field.model.d.ts +55 -0
- package/lib/shared/models/fields/index.model.d.ts +1 -0
- package/lib/shared/models/fields/input/index.d.ts +3 -0
- package/lib/shared/models/fields/input/input-field.model.d.ts +31 -0
- package/lib/shared/models/fields/input/input-password-field.model.d.ts +11 -0
- package/lib/shared/models/fields/input/input-text-field.model.d.ts +9 -0
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-option.model.d.ts +26 -0
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-type-radio-field.model.d.ts +14 -0
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-type.model.d.ts +1 -0
- package/lib/shared/models/fields/radio/custom/reminder-type-radio/reminder-value.model.d.ts +7 -0
- package/lib/shared/models/fields/radio/radio-base-field.model.d.ts +26 -0
- package/lib/shared/models/fields/select/multi-select-field.model.d.ts +11 -0
- package/lib/shared/models/fields/select/select-base-field.model.d.ts +40 -0
- package/lib/shared/models/fields/select/single-select-field.model.d.ts +9 -0
- package/lib/shared/models/fields/select/tree-select-field.model.d.ts +10 -0
- package/lib/shared/models/fields/textarea/textarea-field.model.d.ts +20 -0
- package/lib/shared/models/fields/upload/avatar-upload-field.model.d.ts +9 -0
- package/lib/shared/models/fields/upload/base-upload-field.model.d.ts +25 -0
- package/lib/shared/models/fields/upload/index.d.ts +1 -0
- package/lib/shared/models/fields/upload/multi-file-upload-field.model.d.ts +10 -0
- package/lib/shared/models/fields/upload/multi-image-upload-field.model.d.ts +12 -0
- package/lib/shared/models/fields/upload/single-file-upload-field.model.d.ts +11 -0
- package/lib/shared/models/form/dynamic-form.model.d.ts +1 -0
- package/lib/shared/models/form/index.d.ts +1 -0
- package/lib/shared/services/dynamic-form.service.d.ts +48 -0
- package/lib/shared/services/field.service.d.ts +29 -0
- package/lib/shared/services/file.service.d.ts +20 -0
- package/lib/shared/services/form-config.service.d.ts +10 -0
- package/lib/shared/services/form-data.service.d.ts +53 -0
- package/lib/shared/services/form-utils.d.ts +5 -0
- package/lib/shared/services/suffix.service.d.ts +12 -0
- package/lib/shared/services/validation.service.d.ts +10 -0
- package/lib/shared/utils/common/common.utils.d.ts +7 -0
- package/lib/shared/utils/common/index.d.ts +1 -0
- package/lib/shared/utils/date/date.utils.d.ts +6 -0
- package/lib/shared/utils/date/index.d.ts +1 -0
- package/lib/shared/utils/dynamic-form/dynamic-form.d.ts +7 -0
- package/lib/shared/utils/fields/fields.d.ts +20 -0
- package/lib/shared/utils/fields/index.d.ts +1 -0
- package/lib/shared/utils/file/file.utils.d.ts +4 -0
- package/lib/shared/utils/file/index.d.ts +1 -0
- package/lib/shared/utils/validators/custom-validators.d.ts +12 -0
- package/lib/shared/utils/validators/default-error-message.d.ts +6 -0
- package/lib/shared/utils/validators/index.d.ts +3 -0
- package/lib/shared/utils/validators/pattern.d.ts +4 -0
- package/package.json +23 -0
- package/public-api.d.ts +28 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export declare const IMAGE_TYPES: {
|
|
2
|
+
apng: string;
|
|
3
|
+
avif: string;
|
|
4
|
+
bmp: string;
|
|
5
|
+
gif: string;
|
|
6
|
+
jpeg: string;
|
|
7
|
+
jpg: string;
|
|
8
|
+
png: string;
|
|
9
|
+
svg: string;
|
|
10
|
+
tif: string;
|
|
11
|
+
tiff: string;
|
|
12
|
+
webp: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const AUDIO_TYPES: {
|
|
15
|
+
aac: string;
|
|
16
|
+
mp3: string;
|
|
17
|
+
oga: string;
|
|
18
|
+
opus: string;
|
|
19
|
+
wav: string;
|
|
20
|
+
weba: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const VIDEO_TYPES: {
|
|
23
|
+
avi: string;
|
|
24
|
+
mp4: string;
|
|
25
|
+
mpeg: string;
|
|
26
|
+
ogv: string;
|
|
27
|
+
ts: string;
|
|
28
|
+
webm: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const videoTypesPath: string[];
|
|
31
|
+
export declare const TEXT_TYPES: {
|
|
32
|
+
css: string;
|
|
33
|
+
csv: string;
|
|
34
|
+
html: string;
|
|
35
|
+
ics: string;
|
|
36
|
+
js: string;
|
|
37
|
+
mjs: string;
|
|
38
|
+
txt: string;
|
|
39
|
+
};
|
|
40
|
+
export declare const APPLICATION_TYPES: {
|
|
41
|
+
abw: string;
|
|
42
|
+
arc: string;
|
|
43
|
+
azw: string;
|
|
44
|
+
bin: string;
|
|
45
|
+
bz: string;
|
|
46
|
+
bz2: string;
|
|
47
|
+
cda: string;
|
|
48
|
+
csh: string;
|
|
49
|
+
doc: string;
|
|
50
|
+
docx: string;
|
|
51
|
+
eot: string;
|
|
52
|
+
epub: string;
|
|
53
|
+
jar: string;
|
|
54
|
+
json: string;
|
|
55
|
+
jsonld: string;
|
|
56
|
+
mpkg: string;
|
|
57
|
+
ods: string;
|
|
58
|
+
odt: string;
|
|
59
|
+
ogx: string;
|
|
60
|
+
pdf: string;
|
|
61
|
+
php: string;
|
|
62
|
+
ppt: string;
|
|
63
|
+
pptx: string;
|
|
64
|
+
rar: string;
|
|
65
|
+
rarX: string;
|
|
66
|
+
rtf: string;
|
|
67
|
+
sh: string;
|
|
68
|
+
tar: string;
|
|
69
|
+
vsd: string;
|
|
70
|
+
xhtml: string;
|
|
71
|
+
xls: string;
|
|
72
|
+
xlsx: string;
|
|
73
|
+
zip: string;
|
|
74
|
+
zipN: string;
|
|
75
|
+
sevenZ: string;
|
|
76
|
+
csv: string;
|
|
77
|
+
};
|
|
78
|
+
export declare const MIME_TYPES_TO_EXTENSION: Record<string, string>;
|
|
79
|
+
export declare const ALL_MIME_TYPES: {
|
|
80
|
+
abw: string;
|
|
81
|
+
arc: string;
|
|
82
|
+
azw: string;
|
|
83
|
+
bin: string;
|
|
84
|
+
bz: string;
|
|
85
|
+
bz2: string;
|
|
86
|
+
cda: string;
|
|
87
|
+
csh: string;
|
|
88
|
+
doc: string;
|
|
89
|
+
docx: string;
|
|
90
|
+
eot: string;
|
|
91
|
+
epub: string;
|
|
92
|
+
jar: string;
|
|
93
|
+
json: string;
|
|
94
|
+
jsonld: string;
|
|
95
|
+
mpkg: string;
|
|
96
|
+
ods: string;
|
|
97
|
+
odt: string;
|
|
98
|
+
ogx: string;
|
|
99
|
+
pdf: string;
|
|
100
|
+
php: string;
|
|
101
|
+
ppt: string;
|
|
102
|
+
pptx: string;
|
|
103
|
+
rar: string;
|
|
104
|
+
rarX: string;
|
|
105
|
+
rtf: string;
|
|
106
|
+
sh: string;
|
|
107
|
+
tar: string;
|
|
108
|
+
vsd: string;
|
|
109
|
+
xhtml: string;
|
|
110
|
+
xls: string;
|
|
111
|
+
xlsx: string;
|
|
112
|
+
zip: string;
|
|
113
|
+
zipN: string;
|
|
114
|
+
sevenZ: string;
|
|
115
|
+
csv: string;
|
|
116
|
+
css: string;
|
|
117
|
+
html: string;
|
|
118
|
+
ics: string;
|
|
119
|
+
js: string;
|
|
120
|
+
mjs: string;
|
|
121
|
+
txt: string;
|
|
122
|
+
avi: string;
|
|
123
|
+
mp4: string;
|
|
124
|
+
mpeg: string;
|
|
125
|
+
ogv: string;
|
|
126
|
+
ts: string;
|
|
127
|
+
webm: string;
|
|
128
|
+
aac: string;
|
|
129
|
+
mp3: string;
|
|
130
|
+
oga: string;
|
|
131
|
+
opus: string;
|
|
132
|
+
wav: string;
|
|
133
|
+
weba: string;
|
|
134
|
+
apng: string;
|
|
135
|
+
avif: string;
|
|
136
|
+
bmp: string;
|
|
137
|
+
gif: string;
|
|
138
|
+
jpeg: string;
|
|
139
|
+
jpg: string;
|
|
140
|
+
png: string;
|
|
141
|
+
svg: string;
|
|
142
|
+
tif: string;
|
|
143
|
+
tiff: string;
|
|
144
|
+
webp: string;
|
|
145
|
+
};
|
|
146
|
+
export declare const ALL_MIME_TYPES_VALUE: string[];
|
|
147
|
+
export declare const DEFAULT_ACCEPTED_MIME_TYPES: string[];
|
|
148
|
+
export declare const DEFAULT_ACCEPTED_IMAGE_MIME_TYPES: string[];
|
|
@@ -0,0 +1,68 @@
|
|
|
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)[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { RouterModule } from '@angular/router';
|
|
4
|
+
export declare const CORE_MODULES: (typeof CommonModule)[];
|
|
5
|
+
export declare const FORM_MODULES: (typeof FormsModule)[];
|
|
6
|
+
export declare const ROUTING_MODULES: (typeof RouterModule)[];
|
|
7
|
+
export declare const SHARED_MODULES: (typeof CommonModule)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CONTROL_TYPES: readonly ["input", "textarea", "select", "checkbox", "radio", "date", "upload", "switch", "autocomplete"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './control.const';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FIELD_TYPES là readonly ['input', 'select', 'checkbox',...]
|
|
3
|
+
*/
|
|
4
|
+
export declare const FIELD_TYPES: readonly ["input-text", "input-password", "textarea", "date-picker", "date-range", "single-select", "tree-select", "multi-select", "single-file-upload", "multi-file-upload", "multi-image-upload", "avatar-upload", "checkbox", "radio", "reminder-type-radio", "switch", "autocomplete"];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FIELD_TYPES là readonly ['normal', 'reminderType',...]
|
|
3
|
+
*/
|
|
4
|
+
export declare const RADIO_FIELD_TYPES: readonly ["normal", "reminderType"];
|
|
5
|
+
export declare const DEFAULT_BIND_LABEL = "name";
|
|
6
|
+
export declare const DEFAULT_BIND_VALUE = "code";
|
|
7
|
+
export declare const TIME_SELECT_OPTIONS: {
|
|
8
|
+
name: string;
|
|
9
|
+
code: string;
|
|
10
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UPLOAD_FIELD_TYPES: readonly ["single-file", "multi-file", "avatar"];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum SelectOutputValueTypeEnum {
|
|
2
|
+
Single = "single",// Giá trị đơn theo bindValue.
|
|
3
|
+
Object = "object",// Giá trị object chỉ kèm theo 1 prop theo bindValue.
|
|
4
|
+
SourceObject = "sourceObject"
|
|
5
|
+
}
|
|
6
|
+
export declare enum DatePickerOutputValueTypeEnum {
|
|
7
|
+
String = "string",
|
|
8
|
+
Date = "date"
|
|
9
|
+
}
|
|
10
|
+
export declare enum DateRangeOutputValueTypeEnum {
|
|
11
|
+
String = "string",
|
|
12
|
+
StringArray = "string-array",
|
|
13
|
+
DateArray = "date-array"
|
|
14
|
+
}
|
|
15
|
+
export declare enum UploadOutputValueTypeEnum {
|
|
16
|
+
File = "file",
|
|
17
|
+
ObjectStorage = "object-storage",
|
|
18
|
+
Object = "object"
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './control.enum';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum FieldTypeEnum {
|
|
2
|
+
InputText = "input-text",
|
|
3
|
+
InputPassword = "input-password",
|
|
4
|
+
Textarea = "textarea",
|
|
5
|
+
DatePicker = "date-picker",
|
|
6
|
+
DateRange = "date-range",
|
|
7
|
+
SingleSelect = "single-select",
|
|
8
|
+
TreeSelect = "tree-select",
|
|
9
|
+
MultiSelect = "multi-select",
|
|
10
|
+
SingleFileUpload = "single-file-upload",
|
|
11
|
+
MultiFileUpload = "multi-file-upload",
|
|
12
|
+
MultiImageUpload = "multi-image-upload",
|
|
13
|
+
AvatarUpload = "avatar-upload",
|
|
14
|
+
Checkbox = "checkbox",
|
|
15
|
+
Radio = "radio",
|
|
16
|
+
ReminderTypeRadio = "reminder-type-radio",
|
|
17
|
+
Switch = "switch",
|
|
18
|
+
Autocomplete = "autocomplete"
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dynamic-form.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './validators.enum';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum CommonValidaterEnum {
|
|
2
|
+
Required = "required",
|
|
3
|
+
MinLength = "minlength",
|
|
4
|
+
MaxLength = "maxlength",
|
|
5
|
+
Min = "min",
|
|
6
|
+
Max = "max",
|
|
7
|
+
Pattern = "pattern"
|
|
8
|
+
}
|
|
9
|
+
export declare enum CustomValidaterEnum {
|
|
10
|
+
MatchField = "matchField",
|
|
11
|
+
AcceptedMimiTypes = "acceptedMimeTypes",
|
|
12
|
+
MaxSizeInMB = "maxSizeInMB",
|
|
13
|
+
LeadingSpace = "leadingSpace"
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ApiResponse<T> {
|
|
2
|
+
code: number;
|
|
3
|
+
data: T;
|
|
4
|
+
message: string;
|
|
5
|
+
metadata?: any;
|
|
6
|
+
}
|
|
7
|
+
export interface ApiPagingResponse<T> {
|
|
8
|
+
code: number;
|
|
9
|
+
data: {
|
|
10
|
+
content: T[];
|
|
11
|
+
numOfElement?: number;
|
|
12
|
+
numOfElements?: number;
|
|
13
|
+
pageIndex: number;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
totalElements: number;
|
|
16
|
+
totalPages: number;
|
|
17
|
+
};
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NzUploadFile } from 'ng-zorro-antd/upload';
|
|
2
|
+
import { ObjectStorage } from './object-storage.model';
|
|
3
|
+
import { FormMode } from '../form';
|
|
4
|
+
export interface ExtendUploadFile {
|
|
5
|
+
fromServer?: boolean;
|
|
6
|
+
markedForDelete?: boolean;
|
|
7
|
+
objStorage: ObjectStorage;
|
|
8
|
+
}
|
|
9
|
+
export interface MyUploadFile extends NzUploadFile {
|
|
10
|
+
fromServer?: boolean;
|
|
11
|
+
markedForDelete?: boolean;
|
|
12
|
+
objStorage: ObjectStorage;
|
|
13
|
+
isTemp: boolean;
|
|
14
|
+
previewUrl: string;
|
|
15
|
+
uploadStatus?: 'loading' | 'success' | 'error';
|
|
16
|
+
}
|
|
17
|
+
export declare class Suffix {
|
|
18
|
+
key: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
class?: string;
|
|
21
|
+
description: string;
|
|
22
|
+
icon?: {
|
|
23
|
+
type: 'mdi' | 'zorro';
|
|
24
|
+
value: string;
|
|
25
|
+
class?: string;
|
|
26
|
+
};
|
|
27
|
+
visibleOn?: FormMode[];
|
|
28
|
+
constructor(init: Partial<Suffix>);
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface FieldDependency {
|
|
2
|
+
fieldKey: string;
|
|
3
|
+
paramKey: string;
|
|
4
|
+
fieldLabel?: string;
|
|
5
|
+
mapFn?: (value: any) => any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* FieldDependencyType:
|
|
9
|
+
* - 'all' → cần tất cả field cha có giá trị mới gọi API
|
|
10
|
+
* - 'any' → chỉ cần 1 field cha có giá trị cũng gọi API theo từng cha
|
|
11
|
+
*/
|
|
12
|
+
export type FieldDependencyType = 'all' | 'any';
|
|
13
|
+
export interface LastChangedParent {
|
|
14
|
+
key: string;
|
|
15
|
+
value: unknown;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ApiFileConfig {
|
|
2
|
+
uploadUrl: string;
|
|
3
|
+
deleteUrl: string;
|
|
4
|
+
uploadByPath?: boolean;
|
|
5
|
+
uploadPath?: string;
|
|
6
|
+
isOriginName?: boolean;
|
|
7
|
+
perMimeTypeConfig?: Record<string, {
|
|
8
|
+
uploadUrl?: string;
|
|
9
|
+
buildFormData?: (file: File, extraParams?: Record<string, any>) => FormData;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './api-config.model';
|
|
2
|
+
export * from './field-dependency.model';
|
|
3
|
+
export * from './api-response.model';
|
|
4
|
+
export * from './object-storage.model';
|
|
5
|
+
export * from './output-value-type.model';
|
|
6
|
+
export * from './file-config.model';
|
|
7
|
+
export * from './view-mode.model';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { RawColumn, TableCellTypeEnum } from './table-models';
|
|
2
|
+
import { BaseField } from '../fields/field.model';
|
|
3
|
+
export declare class ObjField {
|
|
4
|
+
required: number;
|
|
5
|
+
componentUI: string;
|
|
6
|
+
appliedFields?: string[];
|
|
7
|
+
allowShare: number;
|
|
8
|
+
allowView?: number;
|
|
9
|
+
allowSort?: number;
|
|
10
|
+
allowStatistic?: number;
|
|
11
|
+
code: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
dataType: string;
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
nameEn: string;
|
|
17
|
+
objClassCode: string;
|
|
18
|
+
objClassSubCode: string;
|
|
19
|
+
codeOnDb?: string;
|
|
20
|
+
value?: any;
|
|
21
|
+
apiURL?: string;
|
|
22
|
+
seqNum?: number;
|
|
23
|
+
parentCode?: string;
|
|
24
|
+
parentCondition?: string;
|
|
25
|
+
parentApiBindValue: string;
|
|
26
|
+
preventEdit?: number;
|
|
27
|
+
minSize?: number;
|
|
28
|
+
maxSize?: number;
|
|
29
|
+
minValue?: string;
|
|
30
|
+
maxValue?: string;
|
|
31
|
+
validateRegex?: string;
|
|
32
|
+
extra?: string;
|
|
33
|
+
note?: string;
|
|
34
|
+
transportType?: any;
|
|
35
|
+
iconData?: string;
|
|
36
|
+
objTypeGroupCode?: string;
|
|
37
|
+
viewType?: string;
|
|
38
|
+
}
|
|
39
|
+
interface FieldFormConfig {
|
|
40
|
+
formTypes: string[];
|
|
41
|
+
configs: Record<string, BaseField<any>>;
|
|
42
|
+
}
|
|
43
|
+
export interface Extra {
|
|
44
|
+
form?: FieldFormConfig;
|
|
45
|
+
table?: Partial<RawColumn> & {
|
|
46
|
+
cellType: TableCellTypeEnum;
|
|
47
|
+
seqNum: number;
|
|
48
|
+
valueConfig?: {
|
|
49
|
+
params: string[];
|
|
50
|
+
body: string;
|
|
51
|
+
};
|
|
52
|
+
subValueConfig?: {
|
|
53
|
+
params: string[];
|
|
54
|
+
body: string;
|
|
55
|
+
};
|
|
56
|
+
dateFormat: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ObjectStorage {
|
|
2
|
+
id: string;
|
|
3
|
+
uid?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
contentType?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
bucket?: string;
|
|
8
|
+
isDir?: boolean;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
isPublic?: boolean;
|
|
13
|
+
originalName?: string;
|
|
14
|
+
nameAlias?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type SelectOutputValueType = 'single' | 'object' | 'sourceObject';
|
|
2
|
+
export type DatePickerOutputValueType = 'string' | 'date';
|
|
3
|
+
export type DateRangeOutputValueType = 'string' | 'string-array' | 'date-array';
|
|
4
|
+
export type UploadOutputValueType = 'file' | 'object-storage' | 'object';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum TableCellTypeEnum {
|
|
2
|
+
ACTION = "action",
|
|
3
|
+
CHECK = "check",
|
|
4
|
+
SUBTEXT = "subtext",
|
|
5
|
+
IMAGE = "image",
|
|
6
|
+
BADGE = "badge",
|
|
7
|
+
INDEX = "index",
|
|
8
|
+
TEXT = "text",
|
|
9
|
+
ICON_TEXT = "icon-text",
|
|
10
|
+
SWAP_FUNC = "swap",
|
|
11
|
+
EMPTY = "empty"
|
|
12
|
+
}
|
|
13
|
+
export interface RawColumn {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ViewMode = 'form' | 'text';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './control.model';
|