diff --git a/packages/survey-creator-core/src/property-grid/index.ts b/packages/survey-creator-core/src/property-grid/index.ts index 194c577bad..fdac2cbb25 100644 --- a/packages/survey-creator-core/src/property-grid/index.ts +++ b/packages/survey-creator-core/src/property-grid/index.ts @@ -19,7 +19,8 @@ import { PopupBaseViewModel, surveyLocalization, QuestionTextBase, - IDialogOptions + IDialogOptions, + IAction } from "survey-core"; import { editorLocalization, getLocString } from "../editorLocalization"; import { EditableObject } from "../editable-object"; @@ -426,7 +427,7 @@ export class PropertyGridTitleActionsCreator { property: JsonObjectProperty, question: Question, enabled: boolean - ): any { + ): IAction { var setupAction = { id: "property-grid-setup", iconName: property.isArray ? "icon-fast-entry" : "icon-wizard", @@ -439,7 +440,7 @@ export class PropertyGridTitleActionsCreator { }; return setupAction; } - private createPropertyHelpAction(question: Question): any { + private createPropertyHelpAction(question: Question): Action | null { if (!question.description) return null; const action = new Action({ title: "", @@ -661,11 +662,17 @@ export class PropertyJSONGenerator { } return panel; } - private updateQuestionJSONOnSameLine(json: any) { + private updateQuestionJSONOnSameLine(json: any): void { json.titleLocation = "left"; json.minWidth = "50px"; } - private createPanelJSON(category: string, title: string, isChild: boolean): any { + private createPanelJSON(category: string, title: string, isChild: boolean): { + type: "panel", + name: string, + title: string, + elements: Array, + state?: "collapsed", + } { const res: any = { type: "panel", name: category, @@ -1553,7 +1560,7 @@ export class PropertyGridEditorNumber extends PropertyGridEditor { if (prop.defaultValue !== undefined) { options.value = prop.defaultValue; } else { - if(!prop.isRequired && options.value === "") { + if (!prop.isRequired && options.value === "") { options.value = undefined; } else { diff --git a/packages/survey-creator-core/src/property-grid/values.ts b/packages/survey-creator-core/src/property-grid/values.ts index 1c2c61a833..3b807b74b8 100644 --- a/packages/survey-creator-core/src/property-grid/values.ts +++ b/packages/survey-creator-core/src/property-grid/values.ts @@ -16,7 +16,11 @@ export abstract class PropertyGridValueEditorBase extends PropertyGridEditor { obj: Base, prop: JsonObjectProperty, options: ISurveyCreatorOptions - ): any { + ): { + type: "linkvalue", + showValueInLink: false, + titleLocation: "hidden", + } { return { type: "linkvalue", showValueInLink: false,