aboutsummaryrefslogtreecommitdiff
path: root/src/fields/SchemaHeaderField.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-06-23 21:44:01 -0400
committerbobzel <zzzman@gmail.com>2023-06-23 21:44:01 -0400
commit85c017527f209c9d007d67ac70958843ab45e729 (patch)
treee2649860002e0c60e98d84439a67235002ddd9a4 /src/fields/SchemaHeaderField.ts
parente9d5dbeef2bf1dab9dfb863d970b70b3074e3d0a (diff)
parent1429ab79eac9aa316082f52c14c576f6b3a97111 (diff)
Merge branch 'master' into heartbeat
Diffstat (limited to 'src/fields/SchemaHeaderField.ts')
-rw-r--r--src/fields/SchemaHeaderField.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fields/SchemaHeaderField.ts b/src/fields/SchemaHeaderField.ts
index 0b51db70b..4b1855cb0 100644
--- a/src/fields/SchemaHeaderField.ts
+++ b/src/fields/SchemaHeaderField.ts
@@ -2,7 +2,7 @@ import { Deserializable } from '../client/util/SerializationHelper';
import { serializable, primitive } from 'serializr';
import { ObjectField } from './ObjectField';
import { Copy, ToScriptString, ToString, OnUpdate } from './FieldSymbols';
-import { scriptingGlobal } from '../client/util/ScriptingGlobals';
+import { scriptingGlobal, ScriptingGlobals } from '../client/util/ScriptingGlobals';
import { ColumnType } from '../client/views/collections/collectionSchema/CollectionSchemaView';
export const PastelSchemaPalette = new Map<string, string>([
@@ -115,9 +115,12 @@ export class SchemaHeaderField extends ObjectField {
}
[ToScriptString]() {
- return `header(${this.heading},${this.type},${this.width}})`;
+ return `schemaHeaderField("${this.heading}","${this.color}",${this.type},${this.width},${this.desc},${this.collapsed})`;
}
[ToString]() {
return `SchemaHeaderField`;
}
}
+ScriptingGlobals.add(function schemaHeaderField(heading: string, color: string, type: number, width: number, desc?: boolean, collapsed?: boolean) {
+ return new SchemaHeaderField(heading, color, type, width, desc, collapsed);
+});