feat(SPA): media field type
This commit is contained in:
1 parent
a2d596f4ca
commit
3e7fc9a4a5
57 files changed
+6109
-75
No files matched your search
@@ -107,6 +107,10 @@ export function supportsUnique(type: FieldType) {
|
||||
return FIELD_TYPE_SPECS[type].supportsUnique
|
||||
}
|
||||
|
||||
export function supportsChoices(type: FieldType) {
|
||||
return FIELD_TYPE_SPECS[type].supportsChoices
|
||||
}
|
||||
|
||||
export function supportsLimits(type: FieldType) {
|
||||
return FIELD_TYPE_SPECS[type].supportsLimits
|
||||
}
|
||||
@@ -132,8 +136,12 @@ export function isUnique(field: BuilderField) {
|
||||
return field.unique && supportsUnique(field.type)
|
||||
}
|
||||
|
||||
export function supportsDefault(type: FieldType) {
|
||||
return FIELD_TYPE_SPECS[type].supportsDefault
|
||||
}
|
||||
|
||||
export function effectiveDefault(field: BuilderField) {
|
||||
if (isUnique(field) || field.defaultValue === '') {
|
||||
if (!supportsDefault(field.type) || isUnique(field) || field.defaultValue === '') {
|
||||
return ''
|
||||
}
|
||||
if (field.type === 'select') {
|
||||
|
||||
Reference in new issue
Block a user