survey-creator-react 2.0.6 → 2.0.8
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/fesm/survey-creator-react.mjs +21 -16
- package/fesm/survey-creator-react.mjs.map +1 -1
- package/package.json +4 -4
- package/survey-creator-react.js +21 -15
- package/survey-creator-react.js.map +1 -1
- package/survey-creator-react.min.js +1 -1
- package/survey-creator-react.min.js.LICENSE.txt +1 -1
- package/typings/ImageItemValueWrapper.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SurveyJS Creator React v2.0.
|
|
2
|
+
* SurveyJS Creator React v2.0.8
|
|
3
3
|
* (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* Github: https://github.com/surveyjs/survey-creator
|
|
5
5
|
* License: https://surveyjs.io/Licenses#SurveyCreator
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { createElement, Fragment } from 'react';
|
|
10
|
-
import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, ReactQuestionFactory, SurveyLocStringViewer, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List,
|
|
10
|
+
import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, ReactQuestionFactory, SurveyLocStringViewer, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List, SurveyQuestionText } from 'survey-react-ui';
|
|
11
11
|
import { SurveyCreatorModel, assign, RowViewModel, QuestionAdornerViewModel, QuestionDropdownAdornerViewModel, QuestionImageAdornerViewModel, QuestionRatingAdornerViewModel, PageAdorner, LogoImageViewModel, editorLocalization, ItemValueWrapperViewModel, ImageItemValueWrapperViewModel, MatrixCellWrapperViewModel, SurveyResultsModel, ToolboxToolViewModel, editableStringRendererName, StringEditorViewModelBase, initLogicOperator, PageNavigatorViewModel } from 'survey-creator-core';
|
|
12
12
|
export { PropertyGridEditorCollection, SurveyLogic, SurveyLogicUI, SurveyQuestionEditorDefinition, ToolboxToolViewModel, editorLocalization, localization, settings, svgBundle } from 'survey-creator-core';
|
|
13
13
|
import * as ReactDOM from 'react-dom';
|
|
@@ -1118,6 +1118,15 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
|
|
|
1118
1118
|
return React.createElement("div", { className: "svc-image-item-value__loading" },
|
|
1119
1119
|
React.createElement(LoadingIndicatorComponent, null));
|
|
1120
1120
|
}
|
|
1121
|
+
renderNewItemControls() {
|
|
1122
|
+
const addButton = attachKey2click(React.createElement("span", { className: this.model.addButtonCss, onClick: () => this.model.chooseNewFile(this.model) }, this.model.showChooseButtonAsIcon ?
|
|
1123
|
+
React.createElement(SvgIcon, { size: "auto", iconName: "icon-add-lg", title: this.model.addFileTitle }) :
|
|
1124
|
+
React.createElement("span", null, this.model.chooseImageText)));
|
|
1125
|
+
const placeholder = this.model.showPlaceholder ? React.createElement("span", { className: "svc-image-item-value__placeholder" }, this.model.placeholderText) : null;
|
|
1126
|
+
return React.createElement(React.Fragment, null,
|
|
1127
|
+
placeholder,
|
|
1128
|
+
addButton);
|
|
1129
|
+
}
|
|
1121
1130
|
render() {
|
|
1122
1131
|
this.model.item = this.props.item;
|
|
1123
1132
|
const isNew = !this.props.question.isItemInList(this.props.item);
|
|
@@ -1126,12 +1135,13 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
|
|
|
1126
1135
|
let content = null;
|
|
1127
1136
|
if (isNew || this.model.isUploading) {
|
|
1128
1137
|
content = (React.createElement(React.Fragment, null,
|
|
1129
|
-
React.createElement("div", { className: "svc-image-item-value__item"
|
|
1138
|
+
React.createElement("div", { className: "svc-image-item-value__item" },
|
|
1130
1139
|
React.createElement("div", { className: "sd-imagepicker__item sd-imagepicker__item--inline" },
|
|
1131
1140
|
React.createElement("label", { className: "sd-imagepicker__label" },
|
|
1132
1141
|
React.createElement("div", { style: imageStyle, className: "sd-imagepicker__image" }, this.model.isUploading ? this.renderLoadingIndicator() : null)))),
|
|
1133
|
-
|
|
1134
|
-
React.createElement(
|
|
1142
|
+
this.model.allowAdd && !this.model.isUploading ?
|
|
1143
|
+
React.createElement("div", { className: "svc-image-item-value-controls" }, this.renderNewItemControls())
|
|
1144
|
+
: null));
|
|
1135
1145
|
}
|
|
1136
1146
|
else {
|
|
1137
1147
|
content = (React.createElement(React.Fragment, null,
|
|
@@ -1148,7 +1158,7 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
|
|
|
1148
1158
|
React.createElement(SvgIcon, { role: "button", size: "auto", iconName: "icon-delete", title: this.model.removeFileTitle }))) : null)
|
|
1149
1159
|
: null));
|
|
1150
1160
|
}
|
|
1151
|
-
return (React.createElement("div", { ref: this.rootRef, className: this.model.getRootCss(), key: this.props.element.key, "data-sv-drop-target-item-value": this.model.isDraggable ? this.model.item.value : undefined, onPointerDown: (event) => this.model.onPointerDown(event), onDragStart: this.preventDragHandler },
|
|
1161
|
+
return (React.createElement("div", { ref: this.rootRef, className: this.model.getRootCss(), key: this.props.element.key, "data-sv-drop-target-item-value": this.model.isDraggable ? this.model.item.value : undefined, onPointerDown: (event) => this.model.onPointerDown(event), onDragStart: this.preventDragHandler, onDrop: this.model.onDrop, onDragEnter: this.model.onDragEnter, onDragOver: this.model.onDragOver, onDragLeave: this.model.onDragLeave },
|
|
1152
1162
|
React.createElement("div", { className: "svc-image-item-value-wrapper__ghost", style: imageStyle }),
|
|
1153
1163
|
React.createElement("div", { className: "svc-image-item-value-wrapper__content" },
|
|
1154
1164
|
React.createElement("input", { type: "file", "aria-hidden": "true", tabIndex: -1, accept: this.model.acceptedTypes, className: "svc-choose-file-input", style: {
|
|
@@ -2049,14 +2059,12 @@ class SurveyLogicOpertor extends SurveyQuestionDropdown {
|
|
|
2049
2059
|
renderInput() {
|
|
2050
2060
|
const q = this.question;
|
|
2051
2061
|
initLogicOperator(q);
|
|
2052
|
-
const text = (q.
|
|
2062
|
+
const text = (q.locReadOnlyText) ? this.renderLocString(q.locReadOnlyText) : "";
|
|
2053
2063
|
return (React.createElement("div", { id: this.question.inputId, className: q.getControlClass(), tabIndex: this.question.isInputReadOnly ? undefined : 0,
|
|
2054
2064
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2055
2065
|
// @ts-ignore
|
|
2056
2066
|
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onChange: this.updateValueOnEvent, onInput: this.updateValueOnEvent, onKeyUp: this.keyhandler, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-labelledby": this.question.ariaLabelledBy, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, "aria-expanded": this.question.ariaExpanded },
|
|
2057
|
-
React.createElement("div", { className: this.question.cssClasses.controlValue },
|
|
2058
|
-
text,
|
|
2059
|
-
React.createElement("div", null, q.readOnlyText)),
|
|
2067
|
+
React.createElement("div", { className: this.question.cssClasses.controlValue }, text),
|
|
2060
2068
|
this.createClearButton()));
|
|
2061
2069
|
}
|
|
2062
2070
|
}
|
|
@@ -2587,9 +2595,6 @@ class PropertyGridComponent extends SurveyElementBase {
|
|
|
2587
2595
|
React.createElement(Survey, { model: this.model.survey })));
|
|
2588
2596
|
}
|
|
2589
2597
|
}
|
|
2590
|
-
ReactQuestionFactory.Instance.registerQuestion("buttongroup", (props) => {
|
|
2591
|
-
return React.createElement(SurveyQuestionButtonGroup, props);
|
|
2592
|
-
});
|
|
2593
2598
|
ReactElementFactory.Instance.registerElement("svc-property-grid", (props) => {
|
|
2594
2599
|
return React.createElement(PropertyGridComponent, props);
|
|
2595
2600
|
});
|
|
@@ -2730,7 +2735,7 @@ class SurveyQuestionFileEditor extends SurveyQuestionText {
|
|
|
2730
2735
|
}
|
|
2731
2736
|
renderInput() {
|
|
2732
2737
|
return (React.createElement(React.Fragment, null,
|
|
2733
|
-
React.createElement("input", { disabled: this.
|
|
2738
|
+
React.createElement("input", { disabled: this.question.isTextInputReadOnly, className: this.questionFile.cssClasses.control, placeholder: this.questionFile.renderedPlaceholder, ref: (input) => (this.setControl(input)), autoComplete: "off", type: "text", onBlur: (event) => this.questionFile.onInputBlur(event.nativeEvent), onChange: (event) => this.questionFile.onInputChange(event.nativeEvent) })));
|
|
2734
2739
|
}
|
|
2735
2740
|
renderFileInput() {
|
|
2736
2741
|
return (React.createElement("input", { type: "file", disabled: this.isDisplayMode, className: this.questionFile.cssClasses.fileInput, id: this.questionFile.inputId, "aria-required": this.questionFile.ariaRequired, "aria-label": this.questionFile.ariaLabel, "aria-invalid": this.questionFile.ariaInvalid, "aria-describedby": this.questionFile.ariaDescribedBy, multiple: false, title: this.questionFile.inputTitle, accept: this.questionFile.acceptedTypes, tabIndex: -1, onChange: (event) => this.questionFile.onFileInputChange(event.nativeEvent) }));
|
|
@@ -2808,8 +2813,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
|
|
|
2808
2813
|
RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
|
|
2809
2814
|
|
|
2810
2815
|
let Version;
|
|
2811
|
-
Version = `${"2.0.
|
|
2812
|
-
checkLibraryVersion(`${"2.0.
|
|
2816
|
+
Version = `${"2.0.8"}`;
|
|
2817
|
+
checkLibraryVersion(`${"2.0.8"}`, "survey-creator-react");
|
|
2813
2818
|
|
|
2814
2819
|
export { ActionButton, AdaptiveToolbox, CellQuestionAdornerComponent, CellQuestionDropdownAdornerComponent, CreatorSurveyPageComponent, ImageItemValueAdornerComponent, ItemValueAdornerComponent, LogoImageComponent, MatrixCellAdornerComponent, PanelAdornerComponent, PropertyGridComponent, PropertyGridPlaceholderComponent, QuestionAdornerComponent, QuestionBanner, QuestionDropdownAdornerComponent, QuestionEditorContentComponent, QuestionErrorComponent, QuestionImageAdornerComponent, QuestionRatingAdornerComponent, QuestionWidgetAdornerComponent, QuestionWrapperFooter, QuestionWrapperHeader, ReactDragEvent, ReactMouseEvent, RowWrapper, SearchComponent, SideBarDefaultHeader, SidebarComponent, SurveyCreator, SurveyCreatorComponent, SurveyCreatorToolboxCategory, SurveyCreatorToolboxItem, SurveyCreatorToolboxItemGroup, SurveyCreatorToolboxTool, SurveyElementEmbeddedSurvey, SurveyLocStringEditor, SurveyLogicOpertor, SurveyNavigation, SurveyQuestionBooleanSwitch, SurveyQuestionColor, SurveyQuestionFileEditor, SurveyQuestionLinkValue, SurveyQuestionSpinEditor, SurveyQuestionTextWithReset, SurveyResults, SurveyResultsByRow, SurveySimulator, SwitcherComponent, TabButtonComponent, TabDesignerComponent, TabJsonEditorAceComponent, TabJsonEditorErrorsComponent, TabJsonEditorTextareaComponent, TabLogicAddButtonComponent, TabLogicComponent, TabPreviewSurveyComponent, TabPreviewTestSurveyAgainComponent, TabThemeSurveyComponent, TabTranslationComponent, TabbedMenuComponent, TabbedMenuItemComponent, ToolboxList, TranslateFromAction, TranslationLineSkeleton, Version };
|
|
2815
2820
|
//# sourceMappingURL=survey-creator-react.mjs.map
|