aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 2d2f5fe4a..8a13395c3 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -68,10 +68,20 @@ class EmptyBox {
return '';
}
}
+
+export enum FInfoFieldType {
+ string,
+ boolean,
+ number,
+ Doc,
+ enumeration,
+ date,
+ list,
+}
export class FInfo {
description: string = '';
readOnly: boolean = false;
- fieldType?: string = '';
+ fieldType?: FInfoFieldType;
values?: Field[];
filterable?: boolean = true;
@@ -84,7 +94,7 @@ export class FInfo {
searchable = () => true;
}
class BoolInfo extends FInfo {
- fieldType? = 'boolean';
+ fieldType? = FInfoFieldType.boolean;
values?: boolean[] = [true, false];
constructor(d: string, filterable?: boolean) {
super(d);
@@ -93,7 +103,7 @@ class BoolInfo extends FInfo {
override searchable = () => false;
}
class NumInfo extends FInfo {
- fieldType? = 'number';
+ fieldType? = FInfoFieldType.number;
values?: number[] = [];
constructor(d: string, filterable?: boolean, readOnly?: boolean, values?: number[]) {
super(d, readOnly);
@@ -103,7 +113,7 @@ class NumInfo extends FInfo {
override searchable = () => false;
}
class StrInfo extends FInfo {
- fieldType? = 'string';
+ fieldType? = FInfoFieldType.string;
values?: string[] = [];
constructor(d: string, filterable?: boolean, readOnly?: boolean, values?: string[]) {
super(d, readOnly);
@@ -112,7 +122,7 @@ class StrInfo extends FInfo {
}
}
class DocInfo extends FInfo {
- fieldType? = 'Doc';
+ fieldType? = FInfoFieldType.Doc;
values?: Doc[] = [];
constructor(d: string, filterable?: boolean, values?: Doc[]) {
super(d, true);
@@ -122,45 +132,45 @@ class DocInfo extends FInfo {
override searchable = () => false;
}
class DimInfo extends FInfo {
- fieldType? = 'enumeration';
+ fieldType? = FInfoFieldType.enumeration;
values? = [DimUnit.Pixel, DimUnit.Ratio];
readOnly = false;
filterable = false;
override searchable = () => false;
}
class PEInfo extends FInfo {
- fieldType? = 'enumeration';
+ fieldType? = FInfoFieldType.enumeration;
values? = ['all', 'none'];
readOnly = false;
filterable = false;
override searchable = () => false;
}
class DAInfo extends FInfo {
- fieldType? = 'enumeration';
- values? = ['embed', 'copy', 'move', 'same', 'proto', 'none'];
+ fieldType? = FInfoFieldType.enumeration;
+ values? = ['embed', 'copy', 'move', 'same', 'add', 'inSame', 'proto'];
readOnly = false;
filterable = false;
override searchable = () => false;
}
class CTypeInfo extends FInfo {
- fieldType? = 'enumeration';
+ fieldType? = FInfoFieldType.enumeration;
values? = Array.from(Object.keys(CollectionViewType));
readOnly = false;
filterable = false;
override searchable = () => false;
}
class DTypeInfo extends FInfo {
- fieldType? = 'enumeration';
+ fieldType? = FInfoFieldType.enumeration;
values? = Array.from(Object.keys(DocumentType));
override searchable = () => false;
}
class DateInfo extends FInfo {
- fieldType? = 'date';
+ fieldType? = FInfoFieldType.date;
values?: DateField[] = [];
filterable = true;
}
class ListInfo extends FInfo {
- fieldType? = 'list';
+ fieldType? = FInfoFieldType.list;
values?: List<any>[] = [];
}
type BOOLt = BoolInfo | boolean;
@@ -728,7 +738,7 @@ export namespace Docs {
{
data: '',
layout: { view: ComparisonBox, dataField: defaultDataKey },
- options: { backgroundColor: 'gray', dropAction: 'move', waitForDoubleClickToClick: 'always', layout_reflowHorizontal: true, layout_reflowVertical: true, layout_nativeDimEditable: true, systemIcon: 'BsLayoutSplit' },
+ options: { backgroundColor: 'gray', dropAction: dropActionType.move, waitForDoubleClickToClick: 'always', layout_reflowHorizontal: true, layout_reflowVertical: true, layout_nativeDimEditable: true, systemIcon: 'BsLayoutSplit' },
},
],
[
@@ -1182,7 +1192,7 @@ export namespace Docs {
return InstanceFromProto(
Prototypes.get(DocumentType.COL),
new List(documents),
- { backgroundColor: 'transparent', dropAction: 'move', _forceActive: true, _freeform_noZoom: true, _freeform_noAutoPan: true, ...options, _type_collection: CollectionViewType.Pile },
+ { backgroundColor: 'transparent', dropAction: dropActionType.move, _forceActive: true, _freeform_noZoom: true, _freeform_noAutoPan: true, ...options, _type_collection: CollectionViewType.Pile },
id
);
}