survey-creator-react 3.0.0-beta.2 → 3.0.0-beta.3

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,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v3.0.0-beta.2
2
+ * SurveyJS Creator v3.0.0-beta.3
3
3
  * (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -2808,13 +2808,30 @@ class SurveyQuestionSpinEditor extends SurveyQuestionText {
2808
2808
  return this.question.renderedValue;
2809
2809
  }
2810
2810
  renderButtons() {
2811
- return (React.createElement("span", { className: this.question.cssClasses.buttonsContainer },
2812
- React.createElement("button", { tabIndex: -1, "aria-hidden": "true", className: this.question.cssClasses.arrowButton, disabled: this.isDisplayMode, onClick: this.question.onDownButtonClick, onMouseDown: this.question.onDownButtonMouseDown, onMouseUp: this.question.onButtonMouseUp, onMouseLeave: this.question.onButtonMouseLeave, onBlur: event => this.question.onBlur(event.nativeEvent), onFocus: event => this.question.onFocus(event.nativeEvent) },
2813
- React.createElement(SvgIcon, { iconName: this.question.cssClasses.decreaseButtonIcon, size: "auto" })),
2814
- React.createElement("button", { tabIndex: -1, "aria-hidden": "true", className: this.question.cssClasses.arrowButton, disabled: this.isDisplayMode, onClick: this.question.onUpButtonClick, onMouseDown: this.question.onUpButtonMouseDown, onMouseUp: this.question.onButtonMouseUp, onMouseLeave: this.question.onButtonMouseLeave, onBlur: event => this.question.onBlur(event.nativeEvent), onFocus: event => this.question.onFocus(event.nativeEvent) },
2815
- React.createElement(SvgIcon, { iconName: this.question.cssClasses.increaseButtonIcon, size: "auto" }))));
2811
+ return React.createElement(SurveyActionBar, { model: this.question.inputActionsContainer });
2816
2812
  }
2817
2813
  }
2814
+ class SurveySpinEditorButton extends SurveyElementBase {
2815
+ get item() {
2816
+ return this.props.item;
2817
+ }
2818
+ get itemAction() {
2819
+ return this.props.item;
2820
+ }
2821
+ getStateElement() {
2822
+ return this.itemAction;
2823
+ }
2824
+ get question() {
2825
+ return this.item.data.question;
2826
+ }
2827
+ renderElement() {
2828
+ return React.createElement("button", { tabIndex: -1, "aria-hidden": "true", className: this.itemAction.getActionBarItemCss(), disabled: this.itemAction.disabled, onClick: () => this.item.action(), onMouseDown: this.item.data.onMouseDown, onMouseUp: this.question.onButtonMouseUp, onMouseLeave: this.question.onButtonMouseLeave, onBlur: event => this.question.onBlur(event.nativeEvent), onFocus: event => this.question.onFocus(event.nativeEvent) },
2829
+ React.createElement(SvgIcon, { className: this.itemAction.cssClasses.itemIcon, iconName: this.item.iconName, size: "auto" }));
2830
+ }
2831
+ }
2832
+ ReactElementFactory.Instance.registerElement("sv-spinedit-button", (props) => {
2833
+ return React.createElement(SurveySpinEditorButton, props);
2834
+ });
2818
2835
  ReactQuestionFactory.Instance.registerQuestion("spinedit", (props) => {
2819
2836
  return React.createElement(SurveyQuestionSpinEditor, props);
2820
2837
  });
@@ -2843,10 +2860,11 @@ class SurveyQuestionColor extends SurveyQuestionText {
2843
2860
  React.createElement("input", { id: this.question.inputId, disabled: this.isDisplayMode, className: this.question.cssClasses.control, ref: (input) => (this.setControl(input)), placeholder: this.question.renderedPlaceholder, autoComplete: "off", onKeyUp: (event) => this.question.onKeyUp(event.nativeEvent), onBlur: (event) => this.question.onBlur(event.nativeEvent), onChange: this.question.onChange, onBeforeInput: event => this.question.onBeforeInput(event.nativeEvent), "aria-required": this.question.a11y_input_ariaRequired, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-label": this.question.a11y_input_ariaLabel, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy })));
2844
2861
  }
2845
2862
  renderElement() {
2846
- return (React.createElement("div", { className: this.question.cssClasses.root, onKeyDown: event => this.question.onKeyDown(event.nativeEvent) },
2847
- this.renderColorSwatch(),
2848
- this.renderInput(),
2849
- this.question.showDropdownAction ? this.renderDropdownAction() : null));
2863
+ return (React.createElement("div", { className: this.question.cssClasses.rootWrapper },
2864
+ React.createElement("div", { className: this.question.cssClasses.root, onKeyDown: event => this.question.onKeyDown(event.nativeEvent) },
2865
+ this.renderColorSwatch(),
2866
+ this.renderInput(),
2867
+ this.renderButtons())));
2850
2868
  }
2851
2869
  getValueCore() {
2852
2870
  return this.question.renderedValue;
@@ -2856,13 +2874,8 @@ class SurveyQuestionColor extends SurveyQuestionText {
2856
2874
  React.createElement(SvgIcon, { iconName: this.question.cssClasses.swatchIcon, size: "auto" }),
2857
2875
  React.createElement("input", { type: "color", disabled: this.isDisplayMode, value: this.question.renderedColorValue, className: this.question.cssClasses.colorInput, onChange: (event) => this.question.onColorInputChange(event.nativeEvent), tabIndex: -1, "aria-required": this.question.a11y_input_ariaRequired, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-label": this.question.a11y_input_ariaLabel, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }));
2858
2876
  }
2859
- renderDropdownAction() {
2860
- return (React.createElement(React.Fragment, null,
2861
- React.createElement("div", { "aria-hidden": "true", className: this.question.cssClasses.choicesButtonWrapper }, ReactElementFactory.Instance.createElement("sv-action-bar-item", { item: this.question.dropdownAction })),
2862
- this.renderPopup()));
2863
- }
2864
- renderPopup() {
2865
- return React.createElement(Popup, { model: this.question.dropdownAction.popupModel });
2877
+ renderButtons() {
2878
+ return this.question.hasVisibleInputActions ? React.createElement(SurveyActionBar, { model: this.question.inputActionsContainer }) : null;
2866
2879
  }
2867
2880
  }
2868
2881
  ReactQuestionFactory.Instance.registerQuestion("color", (props) => {
@@ -2883,32 +2896,38 @@ class SurveyQuestionFileEditor extends SurveyQuestionText {
2883
2896
  return (React.createElement(React.Fragment, null,
2884
2897
  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) })));
2885
2898
  }
2886
- renderFileInput() {
2887
- 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) }));
2888
- }
2889
2899
  renderButtons() {
2890
- return (React.createElement("div", { className: this.questionFile.cssClasses.buttonsContainer },
2891
- this.renderClearButton(),
2892
- this.renderChooseButton()));
2893
- }
2894
- renderClearButton() {
2895
- return attachKey2click((React.createElement("button", { className: this.questionFile.cssClasses.clearButton, title: this.questionFile.clearButtonCaption, disabled: this.questionFile.getIsClearButtonDisabled(), onClick: this.questionFile.doClean },
2896
- React.createElement(SvgIcon, { iconName: this.questionFile.cssClasses.clearButtonIcon, size: "auto" }))));
2897
- }
2898
- renderChooseButton() {
2899
- return (attachKey2click(React.createElement("label", { onClick: event => this.questionFile.chooseFiles(event.nativeEvent), className: this.questionFile.getChooseButtonCss(), htmlFor: this.questionFile.inputId, "aria-label": this.questionFile.chooseButtonCaption },
2900
- React.createElement(SvgIcon, { iconName: this.questionFile.cssClasses.chooseButtonIcon, size: "auto", title: this.questionFile.chooseButtonCaption }))));
2900
+ return this.question.hasVisibleInputActions ? React.createElement(SurveyActionBar, { model: this.questionFile.inputActionsContainer }) : null;
2901
2901
  }
2902
2902
  renderElement() {
2903
2903
  return (React.createElement("div", { className: this.questionFile.cssClasses.root, ref: el => this.setContent(el), onDragEnter: this.questionFile.onDragEnter, onDragOver: this.questionFile.onDragOver, onDrop: this.questionFile.onDrop, onDragLeave: this.questionFile.onDragLeave, onKeyDown: event => this.question.onKeyDown(event.nativeEvent) },
2904
2904
  this.renderInput(),
2905
- this.renderFileInput(),
2906
2905
  this.renderButtons()));
2907
2906
  }
2908
2907
  }
2908
+ class SurveyQuestionFileEditorButton extends SurveyElementBase {
2909
+ get item() {
2910
+ return this.props.item;
2911
+ }
2912
+ get question() {
2913
+ return this.props.item.data.question;
2914
+ }
2915
+ getStateElement() {
2916
+ return this.item;
2917
+ }
2918
+ renderElement() {
2919
+ return (React.createElement("div", null,
2920
+ attachKey2click(React.createElement("label", { onClick: event => this.question.chooseFiles(event.nativeEvent), className: this.item.getActionBarItemCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonCaption },
2921
+ React.createElement(SvgIcon, { iconName: this.item.iconName, size: "auto", title: this.item.title, className: this.item.cssClasses.itemIcon }))),
2922
+ React.createElement("input", { type: "file", disabled: this.item.disabled, className: this.question.cssClasses.fileInput, id: this.question.inputId, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, multiple: false, title: this.question.inputTitle, accept: this.question.acceptedTypes, tabIndex: -1, onChange: (event) => this.question.onFileInputChange(event.nativeEvent) })));
2923
+ }
2924
+ }
2909
2925
  ReactQuestionFactory.Instance.registerQuestion("fileedit", (props) => {
2910
2926
  return React.createElement(SurveyQuestionFileEditor, props);
2911
2927
  });
2928
+ ReactElementFactory.Instance.registerElement("sv-fileedit-button", (props) => {
2929
+ return React.createElement(SurveyQuestionFileEditorButton, props);
2930
+ });
2912
2931
 
2913
2932
  class SurveyQuestionBooleanSwitch extends SurveyQuestionElementBase {
2914
2933
  renderElement() {
@@ -2929,8 +2948,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
2929
2948
  RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
2930
2949
 
2931
2950
  let Version;
2932
- Version = `${"3.0.0-beta.2"}`;
2933
- checkLibraryVersion(`${"3.0.0-beta.2"}`, "survey-creator-react");
2951
+ Version = `${"3.0.0-beta.3"}`;
2952
+ checkLibraryVersion(`${"3.0.0-beta.3"}`, "survey-creator-react");
2934
2953
 
2935
- export { ActionButton, AdaptiveToolbox, CellQuestionAdornerComponent, CellQuestionDropdownAdornerComponent, ComponentContainer, 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, SurveyResults, SurveyResultsByRow, SurveySimulator, SwitcherComponent, TabButtonComponent, TabDesignerComponent, TabJsonEditorAceComponent, TabJsonEditorErrorsComponent, TabJsonEditorTextareaComponent, TabLogicAddButtonComponent, TabLogicComponent, TabPreviewSurveyComponent, TabPreviewTestSurveyAgainComponent, TabThemeSurveyComponent, TabTranslationComponent, TabbedMenuComponent, TabbedMenuItemComponent, ToolboxList, TranslateFromAction, TranslationLineSkeleton, Version };
2954
+ export { ActionButton, AdaptiveToolbox, CellQuestionAdornerComponent, CellQuestionDropdownAdornerComponent, ComponentContainer, 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, SurveyQuestionFileEditorButton, SurveyQuestionLinkValue, SurveyQuestionSpinEditor, SurveyResults, SurveyResultsByRow, SurveySimulator, SurveySpinEditorButton, SwitcherComponent, TabButtonComponent, TabDesignerComponent, TabJsonEditorAceComponent, TabJsonEditorErrorsComponent, TabJsonEditorTextareaComponent, TabLogicAddButtonComponent, TabLogicComponent, TabPreviewSurveyComponent, TabPreviewTestSurveyAgainComponent, TabThemeSurveyComponent, TabTranslationComponent, TabbedMenuComponent, TabbedMenuItemComponent, ToolboxList, TranslateFromAction, TranslationLineSkeleton, Version };
2936
2955
  //# sourceMappingURL=survey-creator-react.mjs.map