survey-react 1.11.1 → 1.11.2
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/defaultV2.css +24 -10
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +1 -1
- package/modern.css.map +1 -1
- package/modern.min.css +1 -1
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.css.map +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +23 -5
- package/survey.react.js +56 -30
- package/survey.react.js.map +1 -1
- package/survey.react.min.js +3 -3
package/survey.min.css
CHANGED
package/survey.react.d.ts
CHANGED
@@ -3107,7 +3107,7 @@ declare module "questionfactory" {
|
|
3107
3107
|
static get DefaultColums(): string[];
|
3108
3108
|
static get DefaultRows(): string[];
|
3109
3109
|
static get DefaultMutlipleTextItems(): string[];
|
3110
|
-
registerQuestion(questionType: string, questionCreator: (name: string) => Question): void;
|
3110
|
+
registerQuestion(questionType: string, questionCreator: (name: string) => Question, showInToolbox?: boolean): void;
|
3111
3111
|
registerCustomQuestion(questionType: string): void;
|
3112
3112
|
unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
|
3113
3113
|
clear(): void;
|
@@ -3117,12 +3117,14 @@ declare module "questionfactory" {
|
|
3117
3117
|
export class ElementFactory {
|
3118
3118
|
static Instance: ElementFactory;
|
3119
3119
|
private creatorHash;
|
3120
|
-
registerElement(elementType: string, elementCreator: (name: string) => IElement): void;
|
3121
|
-
registerCustomQuestion: (questionType: string) => void;
|
3120
|
+
registerElement(elementType: string, elementCreator: (name: string) => IElement, showInToolbox?: boolean): void;
|
3121
|
+
registerCustomQuestion: (questionType: string, showInToolbox?: boolean) => void;
|
3122
3122
|
clear(): void;
|
3123
3123
|
unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
|
3124
|
+
getAllToolboxTypes(): Array<string>;
|
3124
3125
|
getAllTypes(): Array<string>;
|
3125
3126
|
createElement(elementType: string, name: string): IElement;
|
3127
|
+
private getAllTypesCore;
|
3126
3128
|
}
|
3127
3129
|
}
|
3128
3130
|
declare module "drag-drop-helper-v1" {
|
@@ -8031,6 +8033,18 @@ declare module "survey-events-api" {
|
|
8031
8033
|
*/
|
8032
8034
|
visible: boolean;
|
8033
8035
|
}
|
8036
|
+
export interface ElementWrapperComponentEventMixin {
|
8037
|
+
element: any;
|
8038
|
+
wrapperName: string;
|
8039
|
+
reason?: string;
|
8040
|
+
item?: ItemValue;
|
8041
|
+
}
|
8042
|
+
export interface ElementWrapperComponentNameEvent extends ElementWrapperComponentEventMixin {
|
8043
|
+
componentName: string;
|
8044
|
+
}
|
8045
|
+
export interface ElementWrapperComponentDataEvent extends ElementWrapperComponentEventMixin {
|
8046
|
+
data: any;
|
8047
|
+
}
|
8034
8048
|
}
|
8035
8049
|
declare module "drag-drop-page-helper-v1" {
|
8036
8050
|
import { IElement, ISurveyElement } from "base-interfaces";
|
@@ -9254,7 +9268,7 @@ declare module "survey" {
|
|
9254
9268
|
import { ActionContainer } from "actions/container";
|
9255
9269
|
import { QuestionPanelDynamicModel } from "question_paneldynamic";
|
9256
9270
|
import { Notifier } from "notifier";
|
9257
|
-
import { TriggerExecutedEvent, CompletingEvent, CompleteEvent, ShowingPreviewEvent, NavigateToUrlEvent, CurrentPageChangingEvent, CurrentPageChangedEvent, ValueChangingEvent, ValueChangedEvent, VariableChangedEvent, QuestionVisibleChangedEvent, PageVisibleChangedEvent, PanelVisibleChangedEvent, QuestionCreatedEvent, QuestionAddedEvent, QuestionRemovedEvent, PanelAddedEvent, PanelRemovedEvent, PageAddedEvent, ValidateQuestionEvent, SettingQuestionErrorsEvent, ValidatePanelEvent, ErrorCustomTextEvent, ValidatedErrorsOnCurrentPageEvent, ProcessHtmlEvent, GetQuestionTitleEvent, GetTitleTagNameEvent, GetQuestionNoEvent, ProgressTextEvent, TextMarkdownEvent, TextRenderAsEvent, SendResultEvent, GetResultEvent, UploadFilesEvent, DownloadFileEvent, ClearFilesEvent, LoadChoicesFromServerEvent, ProcessTextValueEvent, UpdateQuestionCssClassesEvent, UpdatePanelCssClassesEvent, UpdatePageCssClassesEvent, UpdateChoiceItemCssEvent, AfterRenderSurveyEvent, AfterRenderHeaderEvent, AfterRenderPageEvent, AfterRenderQuestionEvent, AfterRenderQuestionInputEvent, AfterRenderPanelEvent, FocusInQuestionEvent, FocusInPanelEvent, ShowingChoiceItemEvent, ChoicesLazyLoadEvent, GetChoiceDisplayValueEvent, MatrixRowAddedEvent, MatrixBeforeRowAddedEvent, MatrixRowRemovingEvent, MatrixRowRemovedEvent, MatrixAllowRemoveRowEvent, MatrixDetailPanelVisibleChangedEvent, MatrixCellCreatingEvent, MatrixCellCreatedEvent, MatrixAfterCellRenderEvent, MatrixCellValueChangedEvent, MatrixCellValueChangingEvent, MatrixCellValidateEvent, DynamicPanelModifiedEvent, DynamicPanelRemovingEvent, TimerPanelInfoTextEvent, DynamicPanelItemValueChangedEvent, DynamicPanelGetTabTitleEvent, DynamicPanelCurrentIndexChangedEvent, IsAnswerCorrectEvent, DragDropAllowEvent, ScrollingElementToTopEvent, GetQuestionTitleActionsEvent, GetPanelTitleActionsEvent, GetPageTitleActionsEvent, GetPanelFooterActionsEvent, GetMatrixRowActionsEvent, ElementContentVisibilityChangedEvent, GetExpressionDisplayValueEvent, ServerValidateQuestionsEvent, MultipleTextItemAddedEvent, MatrixColumnAddedEvent, GetQuestionDisplayValueEvent, PopupVisibleChangedEvent, ChoicesSearchEvent, OpenFileChooserEvent } from "survey-events-api";
|
9271
|
+
import { TriggerExecutedEvent, CompletingEvent, CompleteEvent, ShowingPreviewEvent, NavigateToUrlEvent, CurrentPageChangingEvent, CurrentPageChangedEvent, ValueChangingEvent, ValueChangedEvent, VariableChangedEvent, QuestionVisibleChangedEvent, PageVisibleChangedEvent, PanelVisibleChangedEvent, QuestionCreatedEvent, QuestionAddedEvent, QuestionRemovedEvent, PanelAddedEvent, PanelRemovedEvent, PageAddedEvent, ValidateQuestionEvent, SettingQuestionErrorsEvent, ValidatePanelEvent, ErrorCustomTextEvent, ValidatedErrorsOnCurrentPageEvent, ProcessHtmlEvent, GetQuestionTitleEvent, GetTitleTagNameEvent, GetQuestionNoEvent, ProgressTextEvent, TextMarkdownEvent, TextRenderAsEvent, SendResultEvent, GetResultEvent, UploadFilesEvent, DownloadFileEvent, ClearFilesEvent, LoadChoicesFromServerEvent, ProcessTextValueEvent, UpdateQuestionCssClassesEvent, UpdatePanelCssClassesEvent, UpdatePageCssClassesEvent, UpdateChoiceItemCssEvent, AfterRenderSurveyEvent, AfterRenderHeaderEvent, AfterRenderPageEvent, AfterRenderQuestionEvent, AfterRenderQuestionInputEvent, AfterRenderPanelEvent, FocusInQuestionEvent, FocusInPanelEvent, ShowingChoiceItemEvent, ChoicesLazyLoadEvent, GetChoiceDisplayValueEvent, MatrixRowAddedEvent, MatrixBeforeRowAddedEvent, MatrixRowRemovingEvent, MatrixRowRemovedEvent, MatrixAllowRemoveRowEvent, MatrixDetailPanelVisibleChangedEvent, MatrixCellCreatingEvent, MatrixCellCreatedEvent, MatrixAfterCellRenderEvent, MatrixCellValueChangedEvent, MatrixCellValueChangingEvent, MatrixCellValidateEvent, DynamicPanelModifiedEvent, DynamicPanelRemovingEvent, TimerPanelInfoTextEvent, DynamicPanelItemValueChangedEvent, DynamicPanelGetTabTitleEvent, DynamicPanelCurrentIndexChangedEvent, IsAnswerCorrectEvent, DragDropAllowEvent, ScrollingElementToTopEvent, GetQuestionTitleActionsEvent, GetPanelTitleActionsEvent, GetPageTitleActionsEvent, GetPanelFooterActionsEvent, GetMatrixRowActionsEvent, ElementContentVisibilityChangedEvent, GetExpressionDisplayValueEvent, ServerValidateQuestionsEvent, MultipleTextItemAddedEvent, MatrixColumnAddedEvent, GetQuestionDisplayValueEvent, PopupVisibleChangedEvent, ChoicesSearchEvent, OpenFileChooserEvent, ElementWrapperComponentNameEvent, ElementWrapperComponentDataEvent } from "survey-events-api";
|
9258
9272
|
import { QuestionMatrixDropdownModelBase } from "question_matrixdropdownbase";
|
9259
9273
|
import { QuestionMatrixDynamicModel } from "question_matrixdynamic";
|
9260
9274
|
import { QuestionFileModel } from "question_file";
|
@@ -9952,6 +9966,8 @@ declare module "survey" {
|
|
9952
9966
|
* An event that is raised after the visibility of a popup is changed. This event can be raised for [Single-](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) and [Multi-Select Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) questions and [Rating](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) questions [rendered as drop-down menus](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#displayMode).
|
9953
9967
|
*/
|
9954
9968
|
onPopupVisibleChanged: EventBase<SurveyModel, PopupVisibleChangedEvent>;
|
9969
|
+
onElementWrapperComponentName: EventBase<SurveyModel, ElementWrapperComponentNameEvent>;
|
9970
|
+
onElementWrapperComponentData: EventBase<SurveyModel, ElementWrapperComponentDataEvent>;
|
9955
9971
|
constructor(jsonObj?: any, renderedElement?: any);
|
9956
9972
|
processClosedPopup(question: IQuestion, popupModel: PopupModel<any>): void;
|
9957
9973
|
protected createTryAgainAction(): IAction;
|
@@ -12013,12 +12029,14 @@ declare module "survey" {
|
|
12013
12029
|
focusQuestionByInstance(question: Question, onError?: boolean): boolean;
|
12014
12030
|
private focusQuestionInfo;
|
12015
12031
|
questionEditFinishCallback(question: Question, event: any): void;
|
12032
|
+
private elementWrapperComponentNameCore;
|
12033
|
+
private elementWrapperDataCore;
|
12016
12034
|
getElementWrapperComponentName(element: any, reason?: string): string;
|
12017
12035
|
getQuestionContentWrapperComponentName(element: any): string;
|
12018
12036
|
getRowWrapperComponentName(row: QuestionRowModel): string;
|
12037
|
+
getItemValueWrapperComponentName(item: ItemValue, question: QuestionSelectBase): string;
|
12019
12038
|
getElementWrapperComponentData(element: any, reason?: string): any;
|
12020
12039
|
getRowWrapperComponentData(row: QuestionRowModel): any;
|
12021
|
-
getItemValueWrapperComponentName(item: ItemValue, question: QuestionSelectBase): string;
|
12022
12040
|
getItemValueWrapperComponentData(item: ItemValue, question: QuestionSelectBase): any;
|
12023
12041
|
getMatrixCellTemplateData(cell: any): any;
|
12024
12042
|
searchText(text: string): Array<IFindElement>;
|
package/survey.react.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* surveyjs - Survey JavaScript library v1.11.
|
2
|
+
* surveyjs - Survey JavaScript library v1.11.2
|
3
3
|
* Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
@@ -9898,8 +9898,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9898
9898
|
|
9899
9899
|
var Version;
|
9900
9900
|
var ReleaseDate;
|
9901
|
-
Version = "" + "1.11.
|
9902
|
-
ReleaseDate = "" + "2024-06-
|
9901
|
+
Version = "" + "1.11.2";
|
9902
|
+
ReleaseDate = "" + "2024-06-11";
|
9903
9903
|
function checkLibraryVersion(ver, libraryName) {
|
9904
9904
|
if (Version != ver) {
|
9905
9905
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -66854,8 +66854,9 @@ var QuestionFactory = /** @class */ (function () {
|
|
66854
66854
|
enumerable: false,
|
66855
66855
|
configurable: true
|
66856
66856
|
});
|
66857
|
-
QuestionFactory.prototype.registerQuestion = function (questionType, questionCreator) {
|
66858
|
-
|
66857
|
+
QuestionFactory.prototype.registerQuestion = function (questionType, questionCreator, showInToolbox) {
|
66858
|
+
if (showInToolbox === void 0) { showInToolbox = true; }
|
66859
|
+
ElementFactory.Instance.registerElement(questionType, questionCreator, showInToolbox);
|
66859
66860
|
};
|
66860
66861
|
QuestionFactory.prototype.registerCustomQuestion = function (questionType) {
|
66861
66862
|
ElementFactory.Instance.registerCustomQuestion(questionType);
|
@@ -66881,18 +66882,20 @@ var ElementFactory = /** @class */ (function () {
|
|
66881
66882
|
function ElementFactory() {
|
66882
66883
|
var _this = this;
|
66883
66884
|
this.creatorHash = {};
|
66884
|
-
this.registerCustomQuestion = function (questionType) {
|
66885
|
+
this.registerCustomQuestion = function (questionType, showInToolbox) {
|
66886
|
+
if (showInToolbox === void 0) { showInToolbox = true; }
|
66885
66887
|
var creator = function (name) {
|
66886
66888
|
var el = _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].createClass(questionType);
|
66887
66889
|
if (!!el)
|
66888
66890
|
el.name = name;
|
66889
66891
|
return el;
|
66890
66892
|
};
|
66891
|
-
_this.registerElement(questionType, creator);
|
66893
|
+
_this.registerElement(questionType, creator, showInToolbox);
|
66892
66894
|
};
|
66893
66895
|
}
|
66894
|
-
ElementFactory.prototype.registerElement = function (elementType, elementCreator) {
|
66895
|
-
|
66896
|
+
ElementFactory.prototype.registerElement = function (elementType, elementCreator, showInToolbox) {
|
66897
|
+
if (showInToolbox === void 0) { showInToolbox = true; }
|
66898
|
+
this.creatorHash[elementType] = { showInToolbox: showInToolbox, creator: elementCreator };
|
66896
66899
|
};
|
66897
66900
|
ElementFactory.prototype.clear = function () {
|
66898
66901
|
this.creatorHash = {};
|
@@ -66904,22 +66907,30 @@ var ElementFactory = /** @class */ (function () {
|
|
66904
66907
|
_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(elementType);
|
66905
66908
|
}
|
66906
66909
|
};
|
66910
|
+
ElementFactory.prototype.getAllToolboxTypes = function () {
|
66911
|
+
return this.getAllTypesCore(true);
|
66912
|
+
};
|
66907
66913
|
ElementFactory.prototype.getAllTypes = function () {
|
66908
|
-
|
66909
|
-
for (var key in this.creatorHash) {
|
66910
|
-
result.push(key);
|
66911
|
-
}
|
66912
|
-
return result.sort();
|
66914
|
+
return this.getAllTypesCore(false);
|
66913
66915
|
};
|
66914
66916
|
ElementFactory.prototype.createElement = function (elementType, name) {
|
66915
|
-
var
|
66916
|
-
if (!!creator)
|
66917
|
-
return creator(name);
|
66917
|
+
var item = this.creatorHash[elementType];
|
66918
|
+
if (!!item && !!item.creator)
|
66919
|
+
return item.creator(name);
|
66918
66920
|
var compJSON = _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.getCustomQuestionByName(elementType);
|
66919
66921
|
if (!!compJSON)
|
66920
66922
|
return _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.createQuestion(name, compJSON);
|
66921
66923
|
return null;
|
66922
66924
|
};
|
66925
|
+
ElementFactory.prototype.getAllTypesCore = function (showInToolboxOnly) {
|
66926
|
+
var result = new Array();
|
66927
|
+
for (var key in this.creatorHash) {
|
66928
|
+
if (!showInToolboxOnly || this.creatorHash[key].showInToolbox) {
|
66929
|
+
result.push(key);
|
66930
|
+
}
|
66931
|
+
}
|
66932
|
+
return result.sort();
|
66933
|
+
};
|
66923
66934
|
ElementFactory.Instance = new ElementFactory();
|
66924
66935
|
return ElementFactory;
|
66925
66936
|
}());
|
@@ -80957,6 +80968,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
80957
80968
|
* An event that is raised after the visibility of a popup is changed. This event can be raised for [Single-](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) and [Multi-Select Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) questions and [Rating](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) questions [rendered as drop-down menus](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#displayMode).
|
80958
80969
|
*/
|
80959
80970
|
_this.onPopupVisibleChanged = _this.addEvent();
|
80971
|
+
_this.onElementWrapperComponentName = _this.addEvent();
|
80972
|
+
_this.onElementWrapperComponentData = _this.addEvent();
|
80960
80973
|
/**
|
80961
80974
|
* A list of errors in a survey JSON schema.
|
80962
80975
|
* @see ensureUniqueNames
|
@@ -88218,32 +88231,45 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
88218
88231
|
}
|
88219
88232
|
}
|
88220
88233
|
};
|
88234
|
+
SurveyModel.prototype.elementWrapperComponentNameCore = function (componentName, element, wrapperName, reason, item) {
|
88235
|
+
if (this.onElementWrapperComponentName.isEmpty)
|
88236
|
+
return componentName;
|
88237
|
+
var options = { componentName: componentName, element: element, wrapperName: wrapperName, reason: reason, item: item };
|
88238
|
+
this.onElementWrapperComponentName.fire(this, options);
|
88239
|
+
return options.componentName;
|
88240
|
+
};
|
88241
|
+
SurveyModel.prototype.elementWrapperDataCore = function (data, element, wrapperName, reason, item) {
|
88242
|
+
if (this.onElementWrapperComponentData.isEmpty)
|
88243
|
+
return data;
|
88244
|
+
var options = { data: data, element: element, wrapperName: wrapperName, reason: reason, item: item };
|
88245
|
+
this.onElementWrapperComponentData.fire(this, options);
|
88246
|
+
return options.data;
|
88247
|
+
};
|
88221
88248
|
SurveyModel.prototype.getElementWrapperComponentName = function (element, reason) {
|
88222
|
-
|
88223
|
-
|
88224
|
-
}
|
88225
|
-
return SurveyModel.TemplateRendererComponentName;
|
88249
|
+
var res = reason === "logo-image" ? "sv-logo-image" : SurveyModel.TemplateRendererComponentName;
|
88250
|
+
return this.elementWrapperComponentNameCore(res, element, "component", reason);
|
88226
88251
|
};
|
88227
88252
|
SurveyModel.prototype.getQuestionContentWrapperComponentName = function (element) {
|
88228
|
-
return SurveyModel.TemplateRendererComponentName;
|
88253
|
+
return this.elementWrapperComponentNameCore(SurveyModel.TemplateRendererComponentName, element, "content-component");
|
88229
88254
|
};
|
88230
88255
|
SurveyModel.prototype.getRowWrapperComponentName = function (row) {
|
88231
|
-
return SurveyModel.TemplateRendererComponentName;
|
88256
|
+
return this.elementWrapperComponentNameCore(SurveyModel.TemplateRendererComponentName, row, "row");
|
88257
|
+
};
|
88258
|
+
SurveyModel.prototype.getItemValueWrapperComponentName = function (item, question) {
|
88259
|
+
return this.elementWrapperComponentNameCore(SurveyModel.TemplateRendererComponentName, question, "itemvalue", undefined, item);
|
88232
88260
|
};
|
88233
88261
|
SurveyModel.prototype.getElementWrapperComponentData = function (element, reason) {
|
88234
|
-
return element;
|
88262
|
+
return this.elementWrapperDataCore(element, element, "component", reason);
|
88235
88263
|
};
|
88236
88264
|
SurveyModel.prototype.getRowWrapperComponentData = function (row) {
|
88237
|
-
return row;
|
88238
|
-
};
|
88239
|
-
SurveyModel.prototype.getItemValueWrapperComponentName = function (item, question) {
|
88240
|
-
return SurveyModel.TemplateRendererComponentName;
|
88265
|
+
return this.elementWrapperDataCore(row, row, "row");
|
88241
88266
|
};
|
88242
88267
|
SurveyModel.prototype.getItemValueWrapperComponentData = function (item, question) {
|
88243
|
-
return item;
|
88268
|
+
return this.elementWrapperDataCore(item, question, "itemvalue", undefined, item);
|
88244
88269
|
};
|
88245
88270
|
SurveyModel.prototype.getMatrixCellTemplateData = function (cell) {
|
88246
|
-
|
88271
|
+
var res = cell.question;
|
88272
|
+
return this.elementWrapperDataCore(res, res, "cell");
|
88247
88273
|
};
|
88248
88274
|
SurveyModel.prototype.searchText = function (text) {
|
88249
88275
|
if (!!text)
|