survey-creator-js 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.
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * SurveyJS Creator UI v2.0.6
2
+ * SurveyJS Creator UI 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
6
6
  */
7
7
 
8
8
  import * as React from 'survey-js-ui';
9
- import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, ReactQuestionFactory, SurveyLocStringViewer, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, createElement, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List, Fragment, SurveyQuestionButtonGroup, SurveyQuestionText, preact } from 'survey-js-ui';
9
+ import { ReactElementFactory, SurveyElementBase, attachKey2click, SvgIcon, Survey, SvgBundleComponent, PopupModal, SurveyActionBar, NotifierComponent, ReactQuestionFactory, SurveyLocStringViewer, TitleElement, ReactSurveyElementsWrapper, LoadingIndicatorComponent, SurveyPage, Popup, LogoImage, SurveyQuestionElementBase, SurveyQuestion, createElement, Scroll, CharacterCounterComponent, SurveyQuestionDropdown, SurveyHeader, List, Fragment, SurveyQuestionText, preact } from 'survey-js-ui';
10
10
  import { assign, SurveyCreatorModel, RowViewModel, QuestionAdornerViewModel, QuestionDropdownAdornerViewModel, QuestionImageAdornerViewModel, QuestionRatingAdornerViewModel, PageAdorner, LogoImageViewModel, editorLocalization, ItemValueWrapperViewModel, ImageItemValueWrapperViewModel, MatrixCellWrapperViewModel, SurveyResultsModel, ToolboxToolViewModel, editableStringRendererName, StringEditorViewModelBase, initLogicOperator, PageNavigatorViewModel } from 'survey-creator-core';
11
11
  export { PropertyGridEditorCollection, SurveyLogic, SurveyLogicUI, SurveyQuestionEditorDefinition, ToolboxToolViewModel, editorLocalization, localization, settings, svgBundle } from 'survey-creator-core';
12
12
  import { ResponsivityManager, CssClassBuilder, settings, VerticalResponsivityManager, RendererFactory, unwrap, checkLibraryVersion } from 'survey-core';
@@ -1116,6 +1116,15 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1116
1116
  return React.createElement("div", { className: "svc-image-item-value__loading" },
1117
1117
  React.createElement(LoadingIndicatorComponent, null));
1118
1118
  }
1119
+ renderNewItemControls() {
1120
+ const addButton = attachKey2click(React.createElement("span", { className: this.model.addButtonCss, onClick: () => this.model.chooseNewFile(this.model) }, this.model.showChooseButtonAsIcon ?
1121
+ React.createElement(SvgIcon, { size: "auto", iconName: "icon-add-lg", title: this.model.addFileTitle }) :
1122
+ React.createElement("span", null, this.model.chooseImageText)));
1123
+ const placeholder = this.model.showPlaceholder ? React.createElement("span", { className: "svc-image-item-value__placeholder" }, this.model.placeholderText) : null;
1124
+ return React.createElement(React.Fragment, null,
1125
+ placeholder,
1126
+ addButton);
1127
+ }
1119
1128
  render() {
1120
1129
  this.model.item = this.props.item;
1121
1130
  const isNew = !this.props.question.isItemInList(this.props.item);
@@ -1124,12 +1133,13 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1124
1133
  let content = null;
1125
1134
  if (isNew || this.model.isUploading) {
1126
1135
  content = (React.createElement(React.Fragment, null,
1127
- React.createElement("div", { className: "svc-image-item-value__item", onDrop: this.model.onDrop, onDragOver: this.model.onDragOver, onDragLeave: this.model.onDragLeave },
1136
+ React.createElement("div", { className: "svc-image-item-value__item" },
1128
1137
  React.createElement("div", { className: "sd-imagepicker__item sd-imagepicker__item--inline" },
1129
1138
  React.createElement("label", { className: "sd-imagepicker__label" },
1130
1139
  React.createElement("div", { style: imageStyle, className: "sd-imagepicker__image" }, this.model.isUploading ? this.renderLoadingIndicator() : null)))),
1131
- React.createElement("div", { className: "svc-image-item-value-controls" }, this.model.allowAdd && !this.model.isUploading ? attachKey2click(React.createElement("span", { className: "svc-context-button svc-image-item-value-controls__add", onClick: () => this.model.chooseNewFile(this.model) },
1132
- React.createElement(SvgIcon, { size: "auto", iconName: "icon-add-lg", title: this.model.addFileTitle }))) : null)));
1140
+ this.model.allowAdd && !this.model.isUploading ?
1141
+ React.createElement("div", { className: "svc-image-item-value-controls" }, this.renderNewItemControls())
1142
+ : null));
1133
1143
  }
1134
1144
  else {
1135
1145
  content = (React.createElement(React.Fragment, null,
@@ -1146,7 +1156,7 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1146
1156
  React.createElement(SvgIcon, { role: "button", size: "auto", iconName: "icon-delete", title: this.model.removeFileTitle }))) : null)
1147
1157
  : null));
1148
1158
  }
1149
- 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 },
1159
+ 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 },
1150
1160
  React.createElement("div", { className: "svc-image-item-value-wrapper__ghost", style: imageStyle }),
1151
1161
  React.createElement("div", { className: "svc-image-item-value-wrapper__content" },
1152
1162
  React.createElement("input", { type: "file", "aria-hidden": "true", tabIndex: -1, accept: this.model.acceptedTypes, className: "svc-choose-file-input", style: {
@@ -2047,14 +2057,12 @@ class SurveyLogicOpertor extends SurveyQuestionDropdown {
2047
2057
  renderInput() {
2048
2058
  const q = this.question;
2049
2059
  initLogicOperator(q);
2050
- const text = (q.selectedItemLocText) ? this.renderLocString(q.selectedItemLocText) : "";
2060
+ const text = (q.locReadOnlyText) ? this.renderLocString(q.locReadOnlyText) : "";
2051
2061
  return (React.createElement("div", { id: this.question.inputId, className: q.getControlClass(), tabIndex: this.question.isInputReadOnly ? undefined : 0,
2052
2062
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2053
2063
  // @ts-ignore
2054
2064
  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 },
2055
- React.createElement("div", { className: this.question.cssClasses.controlValue },
2056
- text,
2057
- React.createElement("div", null, q.readOnlyText)),
2065
+ React.createElement("div", { className: this.question.cssClasses.controlValue }, text),
2058
2066
  this.createClearButton()));
2059
2067
  }
2060
2068
  }
@@ -2585,9 +2593,6 @@ class PropertyGridComponent extends SurveyElementBase {
2585
2593
  React.createElement(Survey, { model: this.model.survey })));
2586
2594
  }
2587
2595
  }
2588
- ReactQuestionFactory.Instance.registerQuestion("buttongroup", (props) => {
2589
- return React.createElement(SurveyQuestionButtonGroup, props);
2590
- });
2591
2596
  ReactElementFactory.Instance.registerElement("svc-property-grid", (props) => {
2592
2597
  return React.createElement(PropertyGridComponent, props);
2593
2598
  });
@@ -2728,7 +2733,7 @@ class SurveyQuestionFileEditor extends SurveyQuestionText {
2728
2733
  }
2729
2734
  renderInput() {
2730
2735
  return (React.createElement(React.Fragment, null,
2731
- React.createElement("input", { disabled: this.isDisplayMode, 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) })));
2736
+ 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) })));
2732
2737
  }
2733
2738
  renderFileInput() {
2734
2739
  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) }));
@@ -2806,8 +2811,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
2806
2811
  RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
2807
2812
 
2808
2813
  let Version;
2809
- Version = `${"2.0.6"}`;
2810
- checkLibraryVersion(`${"2.0.6"}`, "survey-creator-react");
2814
+ Version = `${"2.0.8"}`;
2815
+ checkLibraryVersion(`${"2.0.8"}`, "survey-creator-react");
2811
2816
 
2812
2817
  function renderSurveyCreator(creator, element, props = {}) {
2813
2818
  let node = element;