Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe the onCreatorThemeSelected event (fix #6731) #6735

Merged
merged 1 commit into from
Mar 13, 2025
Merged
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
8 changes: 6 additions & 2 deletions packages/survey-creator-core/src/creator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ import {
ElementSelectingEvent,
ElementSelectedEvent,
DefineElementMenuItemsEvent,
CreatorThemePropertyChangedEvent
CreatorThemePropertyChangedEvent,
CreatorThemeSelectedEvent
} from "./creator-events-api";
import { ExpandCollapseManager } from "./expand-collapse-manager";
import designTabSurveyThemeJSON from "./designTabSurveyThemeJSON";
Expand Down Expand Up @@ -1011,7 +1012,10 @@ export class SurveyCreatorModel extends Base
* An event that is raised when users change a property in a [Survey Creator theme](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#creatorTheme).
*/
public onCreatorThemePropertyChanged: EventBase<SurveyCreatorModel, CreatorThemePropertyChangedEvent> = this.addCreatorEvent<SurveyCreatorModel, CreatorThemePropertyChangedEvent>();
public onCreatorThemeSelected: EventBase<SurveyCreatorModel, { theme: ICreatorTheme }> = this.addCreatorEvent<SurveyCreatorModel, { theme: ICreatorTheme }>();
/**
* An event that is raised when users select a [Survey Creator theme](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#creatorTheme) from the drop-down list of UI themes.
*/
public onCreatorThemeSelected: EventBase<SurveyCreatorModel, CreatorThemeSelectedEvent> = this.addCreatorEvent<SurveyCreatorModel, CreatorThemeSelectedEvent>();

public getSurveyJSONTextCallback: () => { text: string, isModified: boolean };
public setSurveyJSONTextCallback: (text: string) => void;
Expand Down
7 changes: 7 additions & 0 deletions packages/survey-creator-core/src/creator-events-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
} from "survey-core";
import { SurveyLogicItem } from "./components/tabs/logic-items";
import { ICreatorPlugin } from "./creator-settings";
import { ICreatorTheme } from "./creator-theme/creator-themes";

export interface ElementDeletingEvent {
/**
Expand Down Expand Up @@ -1097,4 +1098,10 @@ export interface CreatorThemePropertyChangedEvent {
* A new property value.
*/
value: any;
}
export interface CreatorThemeSelectedEvent {
/**
* A selected Survey Creator theme.
*/
theme: ICreatorTheme;
}