Skip to content

Commit

Permalink
Apply changes to events from master
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Feb 21, 2023
1 parent e6d715a commit 09232e6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
32 changes: 32 additions & 0 deletions src/survey-events-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IAction } from "./actions/action";
import { Base } from "./base";
import { IElement, ISurveyElement } from "./base-interfaces";
import { ItemValue } from "./itemvalue";
import { QuestionMultipleText } from "./knockout/koquestion_multipletext";
import { PageModel } from "./page";
import { PanelModel, PanelModelBase } from "./panel";
import { Question } from "./question";
Expand Down Expand Up @@ -1187,3 +1188,34 @@ export interface IOnGetExpressionDisplayValueOptions {
*/
question: Question;
}

export interface IOnMultipleTextItemAddedOptions {
/**
* A multiple text question.
*/
question: QuestionMultipleText;
/**
* A new added item.
*/
item: any;
}
export interface IOnMatrixColumnAddedOptions {
/**
* A matrix question.
*/
question: Question;
/**
* A new added column.
*/
column: any;
}
export interface IOnGetQuestionDisplayValueOptions {
/**
* A Question instance for which the event is raised.
*/
question: Question;
/**
* A question's display text. You can assign a custom value to this parameter.
*/
displayValue: any;
}
23 changes: 4 additions & 19 deletions src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { ActionContainer, defaultActionBarCss } from "./actions/container";
import { CssClassBuilder } from "./utils/cssClassBuilder";
import { QuestionPanelDynamicModel } from "./question_paneldynamic";
import { Notifier } from "./notifier";
import { IOnTriggerExecutedOptions, IOnCompletingOptions, IOnCompleteOptions, IOnShowingPreviewOptions, IOnNavigateToUrlOptions, IOnStartedOptions, IOnPartialSendOptions, IOnCurrentPageChangingOptions, IOnCurrentPageChangedOptions, IOnValueChangingOptions, IOnValueChangedOptions, IOnVariableChangedOptions, IOnQuestionVisibleChangedOptions, IOnPageVisibleChangedOptions, IOnPanelVisibleChangedOptions, IOnQuestionCreatedOptions, IOnQuestionAddedOptions, IOnQuestionRemovedOptions, IOnPanelAddedOptions, IOnPanelRemovedOptions, IOnPageAddedOptions, IOnValidateQuestionOptions, IOnSettingQuestionErrorsOptions, IOnValidatePanelOptions, IOnErrorCustomTextOptions, IOnValidatedErrorsOnCurrentPageOptions, IOnProcessHtmlOptions, IOnGetQuestionTitleOptions, IOnGetTitleTagNameOptions, IOnGetQuestionNoOptions, IOnProgressTextOptions, IOnTextMarkdownOptions, IOnTextRenderAsOptions, IOnSendResultOptions, IOnGetResultOptions, IOnUploadFilesOptions, IOnDownloadFileOptions, IOnClearFilesOptions, IOnLoadChoicesFromServerOptions, IOnLoadedSurveyFromServiceOptions, IOnProcessTextValueOptions, IOnUpdateQuestionCssClassesOptions, IOnUpdatePanelCssClassesOptions, IOnUpdatePageCssClassesOptions, IOnUpdateChoiceItemCssOptions, IOnAfterRenderSurveyOptions, IOnAfterRenderHeaderOptions, IOnAfterRenderPageOptions, IOnAfterRenderQuestionOptions, IOnAfterRenderQuestionInputOptions, IOnAfterRenderPanelOptions, IOnFocusInQuestionOptions, IOnFocusInPanelOptions, IOnShowingChoiceItemOptions, IOnChoicesLazyLoadOptions, IOnGetChoiceDisplayValueOptions, IOnMatrixRowAddedOptions, IOnMatrixBeforeRowAddedOptions, IOnMatrixRowRemovingOptions, IOnMatrixRowRemovedOptions, IOnMatrixAllowRemoveRowOptions, IOnMatrixCellCreatingOptions, IOnMatrixCellCreatedOptions, IOnMatrixAfterCellRenderOptions, IOnMatrixCellValueChangedOptions, IOnMatrixCellValueChangingOptions, IOnMatrixCellValidateOptions, IOnDynamicPanelAddedOptions, IOnDynamicPanelRemovedOptions, IOnDynamicPanelRemovingOptions, IOnTimerOptions, IOnTimerPanelInfoTextOptions, IOnDynamicPanelItemValueChangedOptions, IOnIsAnswerCorrectOptions, IOnDragDropAllowOptions, IOnScrollingElementToTopOptions, IOnLocaleChangedEventOptions, IOnGetQuestionTitleActionsOptions, IOnGetPanelTitleActionsOptions, IOnGetPageTitleActionsOptions, IOnGetPanelFooterActionsOptions, IOnGetMatrixRowActionsOptions, IOnElementContentVisibilityChangedOptions, IOnGetExpressionDisplayValueOptions, IOnServerValidateQuestionsOptions } from "./survey-events-api";
import { IOnTriggerExecutedOptions, IOnCompletingOptions, IOnCompleteOptions, IOnShowingPreviewOptions, IOnNavigateToUrlOptions, IOnStartedOptions, IOnPartialSendOptions, IOnCurrentPageChangingOptions, IOnCurrentPageChangedOptions, IOnValueChangingOptions, IOnValueChangedOptions, IOnVariableChangedOptions, IOnQuestionVisibleChangedOptions, IOnPageVisibleChangedOptions, IOnPanelVisibleChangedOptions, IOnQuestionCreatedOptions, IOnQuestionAddedOptions, IOnQuestionRemovedOptions, IOnPanelAddedOptions, IOnPanelRemovedOptions, IOnPageAddedOptions, IOnValidateQuestionOptions, IOnSettingQuestionErrorsOptions, IOnValidatePanelOptions, IOnErrorCustomTextOptions, IOnValidatedErrorsOnCurrentPageOptions, IOnProcessHtmlOptions, IOnGetQuestionTitleOptions, IOnGetTitleTagNameOptions, IOnGetQuestionNoOptions, IOnProgressTextOptions, IOnTextMarkdownOptions, IOnTextRenderAsOptions, IOnSendResultOptions, IOnGetResultOptions, IOnUploadFilesOptions, IOnDownloadFileOptions, IOnClearFilesOptions, IOnLoadChoicesFromServerOptions, IOnLoadedSurveyFromServiceOptions, IOnProcessTextValueOptions, IOnUpdateQuestionCssClassesOptions, IOnUpdatePanelCssClassesOptions, IOnUpdatePageCssClassesOptions, IOnUpdateChoiceItemCssOptions, IOnAfterRenderSurveyOptions, IOnAfterRenderHeaderOptions, IOnAfterRenderPageOptions, IOnAfterRenderQuestionOptions, IOnAfterRenderQuestionInputOptions, IOnAfterRenderPanelOptions, IOnFocusInQuestionOptions, IOnFocusInPanelOptions, IOnShowingChoiceItemOptions, IOnChoicesLazyLoadOptions, IOnGetChoiceDisplayValueOptions, IOnMatrixRowAddedOptions, IOnMatrixBeforeRowAddedOptions, IOnMatrixRowRemovingOptions, IOnMatrixRowRemovedOptions, IOnMatrixAllowRemoveRowOptions, IOnMatrixCellCreatingOptions, IOnMatrixCellCreatedOptions, IOnMatrixAfterCellRenderOptions, IOnMatrixCellValueChangedOptions, IOnMatrixCellValueChangingOptions, IOnMatrixCellValidateOptions, IOnDynamicPanelAddedOptions, IOnDynamicPanelRemovedOptions, IOnDynamicPanelRemovingOptions, IOnTimerOptions, IOnTimerPanelInfoTextOptions, IOnDynamicPanelItemValueChangedOptions, IOnIsAnswerCorrectOptions, IOnDragDropAllowOptions, IOnScrollingElementToTopOptions, IOnLocaleChangedEventOptions, IOnGetQuestionTitleActionsOptions, IOnGetPanelTitleActionsOptions, IOnGetPageTitleActionsOptions, IOnGetPanelFooterActionsOptions, IOnGetMatrixRowActionsOptions, IOnElementContentVisibilityChangedOptions, IOnGetExpressionDisplayValueOptions, IOnServerValidateQuestionsOptions, IOnMultipleTextItemAddedOptions, IOnMatrixColumnAddedOptions, IOnGetQuestionDisplayValueOptions } from "./survey-events-api";
import { QuestionMatrixDropdownModelBase } from "./question_matrixdropdownbase";
import { QuestionMatrixDynamicModel } from "./question_matrixdynamic";
import { QuestionFileModel } from "./question_file";
Expand Down Expand Up @@ -360,17 +360,8 @@ export class SurveyModel extends SurveyElementCore
public onProcessHtml: EventBase<SurveyModel, IOnProcessHtmlOptions> = this.addEvent<SurveyModel, IOnProcessHtmlOptions>();
/**
* Use this event to change a question's display text.
*
* Parameters:
*
* - `sender`: `SurveyModel`\
* A survey instance that raised the event.
* - `options.question`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
* A Question instance for which the event is raised.
* - `options.displayValue`: `String`\
* A question's display text. You can assign a custom value to this parameter.
*/
public onGetQuestionDisplayValue: EventBase<SurveyModel> = this.addEvent<SurveyModel>();
public onGetQuestionDisplayValue: EventBase<SurveyModel, IOnGetQuestionDisplayValueOptions> = this.addEvent<SurveyModel, IOnGetQuestionDisplayValueOptions>();
/**
* Use this event to change the question title in code. If you want to remove question numbering then set showQuestionNumbers to "off".
* @see showQuestionNumbers
Expand Down Expand Up @@ -668,18 +659,12 @@ export class SurveyModel extends SurveyElementCore

/**
* An event that is raised on adding a new column in Matrix Dynamic or Matrix Dropdown question.
* - `sender`: `SurveyModel` - A survey instance that raised the event.
* - `options.question` - a matrix question.
* - `options.column` - a new added column.
*/
public onMatrixColumnAdded: EventBase<SurveyModel> = this.addEvent<SurveyModel>();
public onMatrixColumnAdded: EventBase<SurveyModel, IOnMatrixColumnAddedOptions> = this.addEvent<SurveyModel, IOnMatrixColumnAddedOptions>();
/**
* An event that is raised on adding a new item in Multiple Text question.
* - `sender`: `SurveyModel` - A survey instance that raised the event.
* - `options.question` - a multiple text question.
* - `options.item` - a new added item.
*/
public onMultipleTextItemAdded: EventBase<SurveyModel> = this.addEvent<SurveyModel>();
public onMultipleTextItemAdded: EventBase<SurveyModel, IOnMultipleTextItemAddedOptions> = this.addEvent<SurveyModel, IOnMultipleTextItemAddedOptions>();
/**
* An event that is raised after a new panel is added to a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question.
*/
Expand Down

0 comments on commit 09232e6

Please sign in to comment.