Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/SchemaUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ export default class SchemaUtil {
edited.id = parseInt(editedPart.values[0].value);
} else if (editedPart.part == 2) {
let value = editedPart.values[0].value;
if(value && typeof value != "string"){
if(value && typeof value != "string" &&typeof value != "number"){
edited.valueData = value
edited.value = value.value
}else{
Expand Down Expand Up @@ -657,7 +657,7 @@ export default class SchemaUtil {
let value = addedItem.parts.find((x) => x.part == 2)?.values[0]
.value;
let valueData : NodeJS.Dict<any>
if(value && typeof value != "string"){
if(value && typeof value != "string" &&typeof value != "number"){
valueData = value
value = value.value
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/modules/PartBaseModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export default abstract class PartBaseModule<
if (questionPart) {
this.data.viewType = schemaId;
this.data.caption =
typeof questionPart.caption == "string"
typeof questionPart.caption == "string" || typeof questionPart.caption != "number"
? questionPart.caption
: questionPart.caption
?
"value" in questionPart.caption && questionPart.caption["value"]
: undefined;
this.data["captionData"] =
typeof this.data.caption == "string"
typeof this.data.caption == "string" ||typeof this.data.caption == "number"
? null
: this.data.caption
? this.data.caption
Expand Down Expand Up @@ -79,7 +79,7 @@ export default abstract class PartBaseModule<
const caption = SchemaUtil.getCaptionProperty(result);
if (caption != null) {
this.data.caption = caption;
if (typeof caption != "string") {
if (typeof caption != "string"||typeof caption != "number") {
this.data.caption = caption.value;
this.data["captionData"]= caption;
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/modules/question/QuestionModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class QuestionModule extends ContainerModule {
}
setTitleData() {
this._data.titleData =
typeof this._data.title == "string" ? null : this._data.title;
typeof this._data.title == "string" || "number" ? null : this._data.title;
}
getTitleData() {
return this._data.titleData;
Expand Down Expand Up @@ -63,7 +63,7 @@ export default class QuestionModule extends ContainerModule {
this._data.title = value;
}
this.container.querySelector("[data-bc-title]").innerHTML =
typeof this._data.title == "string"
typeof this._data.title == "string" ||typeof this._data.title == "number"
? this._data.title
: this._data.title?.value;
this.setTitleData();
Expand Down Expand Up @@ -254,7 +254,7 @@ export default class QuestionModule extends ContainerModule {
...(this._schema && { vocab: this._schema.vocab }),
...(this._data.title && {
title:
typeof this._data.title == "string"
typeof this._data.title == "string" ||typeof this._data.title == "number"
? this._data.title
: this._data.title.value,
}),
Expand Down
4 changes: 2 additions & 2 deletions src/components/modules/section/SectionModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class SectionModule extends ContainerModule {
}
setTitleData() {
this._data.titleData =
typeof this._data.title == "string" ? undefined : this._data.title;
typeof this._data.title == "string" || typeof this._data.title == "number" ? undefined : this._data.title;
}
getTitleData() {
return this._data.titleData;
Expand All @@ -38,7 +38,7 @@ export default class SectionModule extends ContainerModule {
this._data.title = value;
}
this.container.querySelector("[data-bc-title]").innerHTML =
typeof this._data.title == "string"
typeof this._data.title == "string" || typeof this._data.title == "number"
? this._data.title
: this._data.title?.value;
this.setTitleData();
Expand Down