@media-quest/builder 0.0.10 → 0.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@media-quest/builder",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Builder library for Media-quest schemas",
5
5
  "main": "dist/public-api.js",
6
6
  "module": "dist/public-api.mjs",
@@ -13,6 +13,6 @@
13
13
  "prepublishOnly": "npm run build"
14
14
  },
15
15
  "dependencies": {
16
- "@media-quest/engine": "0.0.10"
16
+ "@media-quest/engine": "0.0.11"
17
17
  }
18
18
  }
@@ -4,7 +4,8 @@ import type { BuilderQuestionDto } from "./Builder-question";
4
4
  import { BuilderQuestion } from "./Builder-question";
5
5
  import type { BuilderObjectId } from "./BuilderObject";
6
6
  import { DUtil, PageID } from "@media-quest/engine";
7
- import { PagePrefix, SchemaPrefix } from "./prefix";
7
+ import { PagePrefix } from "./primitives/page-prefix";
8
+ import { SchemaPrefix } from "./primitives/schema-prefix";
8
9
 
9
10
  const U = DUtil;
10
11
  const deleteIdsFromPage = (page: BuilderPageDto) => {
@@ -9,7 +9,9 @@ import type { BuilderMainTextDto } from "./BuilderMainText";
9
9
  import { BuilderMainText } from "./BuilderMainText";
10
10
  import { BuilderVariableOption, QuestionVariable } from "./rulebuilder/RuleVariable";
11
11
  import { DUtil, PageID } from "@media-quest/engine";
12
- import { PagePrefix, PagePrefixValue, VarID, SchemaPrefix, SchemaPrefixValue } from "./prefix";
12
+ import { PagePrefix, PagePrefixValue } from "./primitives/page-prefix";
13
+ import { VarID } from "./primitives/varID";
14
+ import { SchemaPrefix, SchemaPrefixValue } from "./primitives/schema-prefix";
13
15
 
14
16
  const U = DUtil;
15
17
  export type BuilderPageType = "info-page" | "question" | "multi-select" | "form";
@@ -5,7 +5,8 @@ import type { BuilderTagDto } from "./BuilderTag";
5
5
  import { BuilderTag } from "./BuilderTag";
6
6
  import type { BuilderObjectId } from "./BuilderObject";
7
7
  import { PageID, SchemaID } from "@media-quest/engine";
8
- import { PagePrefix, SchemaPrefix } from "./prefix";
8
+ import { PagePrefix } from "./primitives/page-prefix";
9
+ import { SchemaPrefix } from "./primitives/schema-prefix";
9
10
 
10
11
  const tag1: BuilderTagDto = BuilderTag.create("tag1", "This tag is defined in schemaDto1").toJson();
11
12
 
@@ -166,7 +167,7 @@ describe("Builder schema", () => {
166
167
  test("Can create Schema from dto", () => {
167
168
  const s = BuilderSchema.fromJson(schemaDto1);
168
169
  expect(s.id).toBe(schemaDto1.id);
169
- expect(s.prefix).toBe(schemaDto1.prefix);
170
+ expect(s.prefix.value).toBe(schemaDto1.prefix);
170
171
  expect(s.baseHeight).toBe(schemaDto1.baseHeight);
171
172
  expect(s.baseWidth).toBe(schemaDto1.baseWidth);
172
173
  expect(s.backgroundColor).toBe(schemaDto1.backgroundColor);
@@ -11,18 +11,10 @@ import { BuilderRule } from "./rulebuilder";
11
11
  import { DefaultThemeCompiler } from "./theme/default-theme-compiler";
12
12
  import { ImageFile } from "./media-files";
13
13
  import { SchemaDto, DUtil, PageID, SchemaID } from "@media-quest/engine";
14
- import { PagePrefix, SchemaPrefix, SchemaPrefixValue } from "./prefix";
14
+ import { PagePrefix } from "./primitives/page-prefix";
15
+ import { SchemaPrefix, SchemaPrefixValue } from "./primitives/schema-prefix";
15
16
  const U = DUtil;
16
17
 
17
- class PrimitiveWrapper<T> {
18
- constructor(private readonly _value: T) {}
19
-
20
- get value(): T {
21
- return this._value;
22
- }
23
- }
24
-
25
- // type SchemaHash = string & { __MD5__HASH: true };
26
18
  export interface BuilderSchemaDto {
27
19
  readonly id: SchemaID;
28
20
  readonly prefix: SchemaPrefixValue;
@@ -43,7 +35,7 @@ export interface SchemaBuildOutput {
43
35
  }
44
36
 
45
37
  export class BuilderSchema {
46
- private readonly _prefix: SchemaPrefix;
38
+ readonly prefix: SchemaPrefix;
47
39
  baseHeight = 1300;
48
40
  baseWidth = 1024;
49
41
  backgroundColor = "#000000";
@@ -54,9 +46,9 @@ export class BuilderSchema {
54
46
  return [...this._rules];
55
47
  }
56
48
 
57
- get prefix(): SchemaPrefixValue {
58
- return this._prefix.value;
59
- }
49
+ // get prefix(): SchemaPrefixValue {
50
+ // return this._prefix.value;
51
+ // }
60
52
 
61
53
  private readonly _tagCollection: TagCollection = TagCollection.create();
62
54
  get tags(): ReadonlyArray<BuilderTag> {
@@ -99,16 +91,16 @@ export class BuilderSchema {
99
91
  rules,
100
92
  tags,
101
93
  mainImage: this.mainImage,
102
- prefix: this.prefix,
94
+ prefix: this.prefix.value,
103
95
  };
104
96
  return dto;
105
97
  }
106
98
  private constructor(
107
99
  public readonly id: SchemaID,
108
100
  public name: string,
109
- _prefix: SchemaPrefix,
101
+ prefix: SchemaPrefix,
110
102
  ) {
111
- this._prefix = _prefix;
103
+ this.prefix = prefix;
112
104
  }
113
105
 
114
106
  addPage(type: BuilderPageType, atIndex = -1): BuilderPage {
@@ -208,9 +200,8 @@ export class BuilderSchema {
208
200
  return excludeByTagDto;
209
201
  });
210
202
  const jumpActions: JumpToPageAction[] = [];
211
- const prefix = this.prefix;
212
203
  this.pages.forEach((page, index) => {
213
- const pageVariables = page.getQuestionVariables(this._prefix, index);
204
+ const pageVariables = page.getQuestionVariables(this.prefix, index);
214
205
  qVars.push(...pageVariables);
215
206
  const mainText = page.mainText.text;
216
207
  const pagePrefix = page.prefix;
@@ -0,0 +1,58 @@
1
+ import { SchemaPrefix } from "./schema-prefix";
2
+
3
+ export type PagePrefixValue = string & { __PAGE_PREFIX__: true };
4
+ export const createRandomPrefix = <const P extends string>(length: number): P => {
5
+ const letters = "abcdefghijklmnopqrstuvyz";
6
+ const all = letters + letters.toUpperCase();
7
+ let result = "";
8
+ for (let i = 0; i < length; i++) {
9
+ const char = all.charAt(Math.floor(Math.random() * all.length));
10
+ result += char;
11
+ }
12
+ return result as P;
13
+ };
14
+
15
+ export class PagePrefix {
16
+ public static readonly MIN_LENGTH = 1;
17
+ private static randomLen = 5;
18
+ public static readonly MAX_LENGTH = 16;
19
+
20
+ public static create = (): PagePrefix => {
21
+ const v = createRandomPrefix<PagePrefixValue>(PagePrefix.randomLen);
22
+ return new PagePrefix(v);
23
+ };
24
+ public static fromString = (value: string): PagePrefix | false => {
25
+ if (!PagePrefix.isValid(value)) return false;
26
+ return new PagePrefix(value);
27
+ };
28
+
29
+ public static fromStringOrThrow = (value: string): PagePrefixValue => {
30
+ if (!PagePrefix.isValid(value)) throw new Error("Invalid prefix");
31
+ return value;
32
+ };
33
+ public static castOrCreateRandom = (value: string): PagePrefix => {
34
+ const v = PagePrefix.isValid(value) ? value : createRandomPrefix<PagePrefixValue>(PagePrefix.randomLen);
35
+ return new PagePrefix(v);
36
+ };
37
+
38
+ public static isValid = (prefix: string | 999): prefix is PagePrefixValue => {
39
+ if (typeof prefix !== "string") return false;
40
+ if (prefix.length < SchemaPrefix.MIN_LENGTH) return false;
41
+ if (prefix.length > SchemaPrefix.MAX_LENGTH) return false;
42
+ return true;
43
+ };
44
+
45
+ get value(): PagePrefixValue {
46
+ return this._value;
47
+ }
48
+
49
+ set value(value: string) {
50
+ if (!PagePrefix.isValid(value)) {
51
+ console.log("INVALID PREFIX", value);
52
+ } else {
53
+ this._value = value;
54
+ }
55
+ }
56
+
57
+ private constructor(private _value: PagePrefixValue) {}
58
+ }
File without changes
@@ -0,0 +1,52 @@
1
+ import { createRandomPrefix } from "./page-prefix";
2
+
3
+ export type SchemaPrefixValue = string & { __SCHEMA_PREFIX__: true };
4
+
5
+ export class SchemaPrefix {
6
+ public static readonly MIN_LENGTH = 1;
7
+ private static randomLen = 5;
8
+ public static readonly MAX_LENGTH = 16;
9
+
10
+ public static fromValue = (value: SchemaPrefixValue): SchemaPrefix => {
11
+ return new SchemaPrefix(value);
12
+ };
13
+
14
+ public static fromValueOrThrow = (value: string): SchemaPrefix => {
15
+ if (!SchemaPrefix.isValid(value)) throw new Error("Invalid prefix");
16
+ return new SchemaPrefix(value);
17
+ };
18
+ public static fromString = (value: string): SchemaPrefix | false => {
19
+ if (!SchemaPrefix.isValid(value)) return false;
20
+ return new SchemaPrefix(value);
21
+ };
22
+ public static castOrCreateRandom = (value: string): SchemaPrefix => {
23
+ const v = SchemaPrefix.isValid(value) ? value : createRandomPrefix<SchemaPrefixValue>(SchemaPrefix.randomLen);
24
+ return new SchemaPrefix(v);
25
+ };
26
+
27
+ public static isValid = (prefix: string | 999): prefix is SchemaPrefixValue => {
28
+ if (typeof prefix !== "string") return false;
29
+ if (prefix.length < SchemaPrefix.MIN_LENGTH) return false;
30
+ if (prefix.length > SchemaPrefix.MAX_LENGTH) return false;
31
+ return true;
32
+ };
33
+
34
+ toJSON() {}
35
+
36
+ get value(): SchemaPrefixValue {
37
+ return this._value;
38
+ }
39
+
40
+ get isValid() {
41
+ return SchemaPrefix.isValid(this._value);
42
+ }
43
+
44
+ set value(value: string) {
45
+ const casted = value as unknown;
46
+ if (typeof casted === "string") {
47
+ this._value = casted as SchemaPrefixValue;
48
+ }
49
+ }
50
+
51
+ private constructor(private _value: SchemaPrefixValue) {}
52
+ }
@@ -0,0 +1,11 @@
1
+ import { PagePrefixValue } from "./page-prefix";
2
+
3
+ import { SchemaPrefixValue } from "./schema-prefix";
4
+
5
+ export type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
6
+ export const VarID = {
7
+ create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue): VarID => {
8
+ const varId = schemaPrefix + "_" + pagePrefix;
9
+ return varId as VarID;
10
+ },
11
+ };
package/src/public-api.ts CHANGED
@@ -8,6 +8,9 @@ export { BuilderMainText, type BuilderMainTextDto } from "./BuilderMainText";
8
8
  export { type BuilderMainVideoDto } from "./BuilderMainVideoDto";
9
9
  export { type BuilderTagDto, BuilderTag, TagCollection } from "./BuilderTag";
10
10
  export { type AudioFile, type ImageFile, type VideoFile } from "./media-files";
11
- export * from "./prefix";
12
11
  // Public Api of rule-builder
13
12
  export * from "./rulebuilder";
13
+ export { PagePrefix } from "./primitives/page-prefix";
14
+ export { createRandomPrefix } from "./primitives/page-prefix";
15
+ export { PagePrefixValue } from "./primitives/page-prefix";
16
+ export { VarID } from "./primitives/varID";
@@ -4,7 +4,9 @@ import { RuleInput } from "./RuleInput";
4
4
  import type { BuilderConditionGroupDto } from "./condition/Builder-condition-group";
5
5
  import { BuilderConditionDto } from "./condition/Builder-condition";
6
6
  import { Condition, PageID } from "@media-quest/engine";
7
- import { PagePrefix, VarID, SchemaPrefix } from "../prefix";
7
+ import { PagePrefix } from "../primitives/page-prefix";
8
+ import { VarID } from "../primitives/varID";
9
+ import { SchemaPrefix } from "../primitives/schema-prefix";
8
10
 
9
11
  const { createPagesAndVars_A_H } = U;
10
12
 
@@ -9,14 +9,14 @@ import { BuilderObject } from "../BuilderObject";
9
9
  import { TagActionManager } from "./tag-action-manager";
10
10
  import { PageActionManager } from "./page-action-manager";
11
11
  import { JumpToActionManager } from "./jump-to-action-manager";
12
- import { Condition, PageQueCommand, PageQueRules } from "@media-quest/engine";
12
+ import { Condition, PageID, PageQueCommand, PageQueRules } from "@media-quest/engine";
13
13
 
14
14
  export interface BuilderRuleDto {
15
15
  readonly type: ConditionGroupType;
16
16
  readonly name: string;
17
17
  readonly conditions: ReadonlyArray<BuilderConditionDto | BuilderConditionGroupDto>;
18
18
  readonly excludeTags: ReadonlyArray<string>;
19
- readonly excludePages: ReadonlyArray<string>;
19
+ readonly excludePages: ReadonlyArray<PageID>;
20
20
  readonly jumpToPage: string | false;
21
21
  }
22
22
  export class BuilderRule extends BuilderObject<"builder-rule", BuilderRuleDto> {
@@ -1,5 +1,6 @@
1
1
  import { PageID } from "@media-quest/engine";
2
- import { PagePrefixValue } from "../prefix";
2
+
3
+ import { PagePrefixValue } from "../primitives/page-prefix";
3
4
 
4
5
  export interface ExcludeByPageAction {
5
6
  readonly kind: "exclude-by-pageId";
@@ -23,3 +24,83 @@ export interface ExcludeByTagAction {
23
24
  readonly description: string;
24
25
  readonly pageCount: number;
25
26
  }
27
+
28
+ // interface ISearchable {
29
+ // getLabel(): string;
30
+ // getTooltip(): string;
31
+ // getSearchString(): string;
32
+ // }
33
+ // interface ISelectable {
34
+ // isSelected: boolean;
35
+ // }
36
+ //
37
+ // export class PageAction implements ISearchable, ISelectable {
38
+ // public readonly description = "Will exclude this page from the survey.";
39
+ // private _isSelected: boolean = false;
40
+ // get isSelected(): boolean {
41
+ // return this._isSelected;
42
+ // }
43
+ // set isSelected(value: boolean) {
44
+ // const casted = value as unknown;
45
+ // if (typeof casted === "boolean") {
46
+ // this._isSelected = casted;
47
+ // }
48
+ // }
49
+ // get pageId(): PageID {
50
+ // return this.data.pageId;
51
+ // }
52
+ // get pagePrefix(): PagePrefixValue {
53
+ // return this.data.pagePrefix;
54
+ // }
55
+ // get mainText(): string {
56
+ // return this.data.mainText;
57
+ // }
58
+ // get pageNumber(): number {
59
+ // return this.data.pageNumber;
60
+ // }
61
+ // constructor(
62
+ // private readonly data: {
63
+ // pageId: PageID;
64
+ // pagePrefix: PagePrefixValue;
65
+ // mainText: string;
66
+ // pageNumber: number;
67
+ // isSelected: boolean;
68
+ // },
69
+ // ) {
70
+ // this.isSelected = this.data.isSelected;
71
+ // }
72
+ //
73
+ // getLabel(): string {
74
+ // return this.data.pagePrefix + " (" + this.data.pageNumber + ")";
75
+ // }
76
+ // getTooltip(): string {
77
+ // return this.data.mainText;
78
+ // }
79
+ // getSearchString(): string {
80
+ // return this.data.pagePrefix + this.data.mainText;
81
+ // }
82
+ // }
83
+ // export class TagAction implements ISearchable {
84
+ // constructor(
85
+ // readonly tag: string,
86
+ // readonly description: string,
87
+ // readonly usedInPages: { pageNumber: number; pagePrefix: PagePrefixValue }[],
88
+ // ) {}
89
+ // getLabel(): string {
90
+ // return this.tag + " (" + this.usedInPages.length + ")";
91
+ // }
92
+ // getTooltip(): string {
93
+ // return this.description;
94
+ // }
95
+ // getSearchString(): string {
96
+ // return this.tag;
97
+ // }
98
+ // }
99
+
100
+ // class SelectableCollection<T> {
101
+ // private readonly _items: Array<T>;
102
+ // private selected: T | false = false;
103
+ // constructor(items: ReadonlyArray<T>) {
104
+ // this._items = [...items];
105
+ // }
106
+ // }
@@ -7,7 +7,9 @@ import type { BuilderOperator } from "./condition/Builder-operator";
7
7
  import type { ExcludeByPageAction, ExcludeByTagAction, JumpToPageAction } from "./RuleAction";
8
8
  import { ExcludeByPageIdSelectItem, ExcludeByTagSelectItem } from "./multi-select-item";
9
9
  import { PageID } from "@media-quest/engine";
10
- import { PagePrefix, VarID, SchemaPrefix, PagePrefixValue } from "../prefix";
10
+ import { PagePrefix, PagePrefixValue } from "../primitives/page-prefix";
11
+ import { VarID } from "../primitives/varID";
12
+ import { SchemaPrefix } from "../primitives/schema-prefix";
11
13
 
12
14
  const idPxx = () => {
13
15
  const id = PageID.create();
@@ -1,4 +1,6 @@
1
- import { PagePrefix, VarID, SchemaPrefix } from "../prefix";
1
+ import { PagePrefix } from "../primitives/page-prefix";
2
+ import { VarID } from "../primitives/varID";
3
+ import { SchemaPrefix } from "../primitives/schema-prefix";
2
4
 
3
5
  const BuilderVariableType = {
4
6
  numericWithOptions: true,
@@ -2,7 +2,8 @@ import { BuilderCondition, type BuilderConditionDto } from "./Builder-condition"
2
2
  import { RuleBuilderTestUtils } from "../RuleBuilder-test-utils";
3
3
  import type { BuilderVariable, BuilderVariableOption } from "../RuleVariable";
4
4
  import { QuestionVariable } from "../RuleVariable";
5
- import { SchemaPrefix } from "../../prefix";
5
+
6
+ import { SchemaPrefix } from "../../primitives/schema-prefix";
6
7
 
7
8
  let condition = BuilderCondition.create([]);
8
9
 
@@ -1,10 +1,5 @@
1
1
  import { ExcludeByPageAction, ExcludeByTagAction } from "./RuleAction";
2
2
 
3
- interface IMultiSelectItem<T> {
4
- isSelected: boolean;
5
- readonly tooltip: string;
6
- readonly searchString: string;
7
- }
8
3
  export abstract class MultiSelectItem<T> {
9
4
  private readonly _isSelectedInitially: boolean;
10
5
  private readonly _selectLabel;
@@ -1,6 +1,7 @@
1
1
  import type { RuleInput } from "./RuleInput";
2
2
  import { ExcludeByPageIdSelectItem } from "./multi-select-item";
3
3
  import { ExcludeByPageAction } from "./RuleAction";
4
+ import { PageID } from "@media-quest/engine";
4
5
 
5
6
  export class PageActionManager {
6
7
  private readonly _initialSelection: Set<string>;
@@ -17,7 +18,7 @@ export class PageActionManager {
17
18
  });
18
19
  }
19
20
 
20
- getCurrentSelection(): ReadonlyArray<string> {
21
+ getCurrentSelection(): ReadonlyArray<PageID> {
21
22
  const selected = this.selectItems.filter((item) => item.isSelected).map((itm) => itm.data.pageId);
22
23
  return selected;
23
24
  }
package/src/prefix.ts DELETED
@@ -1,107 +0,0 @@
1
- export type SchemaPrefixValue = string & { __SCHEMA_PREFIX__: true };
2
- export type PagePrefixValue = string & { __PAGE_PREFIX__: true };
3
- // export type QuestionPrefixValue = string & { __QUESTION_PREFIX__: true };
4
- export type VarID = `${SchemaPrefixValue}_${PagePrefixValue}`;
5
- export const VarID = {
6
- create: (schemaPrefix: SchemaPrefixValue, pagePrefix: PagePrefixValue): VarID => {
7
- const varId = schemaPrefix + "_" + pagePrefix;
8
- return varId as VarID;
9
- },
10
- };
11
- const createRandomPrefix = <const P extends string>(length: number): P => {
12
- const letters = "abcdefghijklmnopqrstuvyz";
13
- const all = letters + letters.toUpperCase();
14
- let result = "";
15
- for (let i = 0; i < length; i++) {
16
- const char = all.charAt(Math.floor(Math.random() * all.length));
17
- result += char;
18
- }
19
- return result as P;
20
- };
21
- export class SchemaPrefix {
22
- public static readonly MIN_LENGTH = 1;
23
- private static randomLen = 5;
24
- public static readonly MAX_LENGTH = 16;
25
- public static fromValue = (value: SchemaPrefixValue): SchemaPrefix => {
26
- return new SchemaPrefix(value);
27
- };
28
-
29
- public static fromValueOrThrow = (value: string): SchemaPrefix => {
30
- if (!SchemaPrefix.isValid(value)) throw new Error("Invalid prefix");
31
- return new SchemaPrefix(value);
32
- };
33
- public static fromString = (value: string): SchemaPrefix | false => {
34
- if (!SchemaPrefix.isValid(value)) return false;
35
- return new SchemaPrefix(value);
36
- };
37
- public static castOrCreateRandom = (value: string): SchemaPrefix => {
38
- const v = SchemaPrefix.isValid(value) ? value : createRandomPrefix<SchemaPrefixValue>(SchemaPrefix.randomLen);
39
- return new SchemaPrefix(v);
40
- };
41
-
42
- public static isValid = (prefix: string | 999): prefix is SchemaPrefixValue => {
43
- if (typeof prefix !== "string") return false;
44
- if (prefix.length < SchemaPrefix.MIN_LENGTH) return false;
45
- if (prefix.length > SchemaPrefix.MAX_LENGTH) return false;
46
- return true;
47
- };
48
-
49
- get value(): SchemaPrefixValue {
50
- return this._value;
51
- }
52
-
53
- set value(value: string) {
54
- if (!SchemaPrefix.isValid(value)) {
55
- console.log("INVALID PREFIX", value);
56
- } else {
57
- this._value = value;
58
- }
59
- }
60
- private constructor(private _value: SchemaPrefixValue) {}
61
- }
62
- export class PagePrefix {
63
- public static readonly MIN_LENGTH = 1;
64
- private static randomLen = 5;
65
- public static readonly MAX_LENGTH = 16;
66
- public static fromValue = (value: PagePrefixValue): PagePrefix => {
67
- return new PagePrefix(value);
68
- };
69
-
70
- public static create = (): PagePrefix => {
71
- const v = createRandomPrefix<PagePrefixValue>(PagePrefix.randomLen);
72
- return new PagePrefix(v);
73
- };
74
- public static fromString = (value: string): PagePrefix | false => {
75
- if (!PagePrefix.isValid(value)) return false;
76
- return new PagePrefix(value);
77
- };
78
-
79
- public static fromStringOrThrow = (value: string): PagePrefixValue => {
80
- if (!PagePrefix.isValid(value)) throw new Error("Invalid prefix");
81
- return value;
82
- };
83
- public static castOrCreateRandom = (value: string): PagePrefix => {
84
- const v = PagePrefix.isValid(value) ? value : createRandomPrefix<PagePrefixValue>(PagePrefix.randomLen);
85
- return new PagePrefix(v);
86
- };
87
-
88
- public static isValid = (prefix: string | 999): prefix is PagePrefixValue => {
89
- if (typeof prefix !== "string") return false;
90
- if (prefix.length < SchemaPrefix.MIN_LENGTH) return false;
91
- if (prefix.length > SchemaPrefix.MAX_LENGTH) return false;
92
- return true;
93
- };
94
-
95
- get value(): PagePrefixValue {
96
- return this._value;
97
- }
98
-
99
- set value(value: string) {
100
- if (!PagePrefix.isValid(value)) {
101
- console.log("INVALID PREFIX", value);
102
- } else {
103
- this._value = value;
104
- }
105
- }
106
- private constructor(private _value: PagePrefixValue) {}
107
- }