survey-creator-react 3.0.0-beta.6 → 3.0.0-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-creator-react",
3
- "version": "3.0.0-beta.6",
3
+ "version": "3.0.0-beta.7",
4
4
  "description": "A white-label drag-and-drop form builder for React that lets you design complex, interactive forms and surveys without writing code. It generates JSON schemas used by the SurveyJS Form Library to render dynamic forms in your React app.",
5
5
  "author": "DevSoft Baltic OU <info@devsoftbaltic.com>",
6
6
  "homepage": "https://surveyjs.io/",
@@ -60,9 +60,9 @@
60
60
  "ace-builds": "^1.4.12",
61
61
  "react": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0",
62
62
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0",
63
- "survey-core": "3.0.0-beta.6",
64
- "survey-react-ui": "3.0.0-beta.6",
65
- "survey-creator-core": "3.0.0-beta.6"
63
+ "survey-core": "3.0.0-beta.7",
64
+ "survey-react-ui": "3.0.0-beta.7",
65
+ "survey-creator-core": "3.0.0-beta.7"
66
66
  },
67
67
  "peerDependenciesMeta": {
68
68
  "ace-builds": {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v3.0.0-beta.6
2
+ * SurveyJS Creator v3.0.0-beta.7
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
@@ -2701,7 +2701,7 @@
2701
2701
  }
2702
2702
  QuestionErrorComponent.prototype.render = function () {
2703
2703
  return (React__namespace.createElement("div", null,
2704
- React__namespace.createElement(surveyReactUi.SvgIcon, { "aria-hidden": "true", iconName: "icon-alert_24x24", size: "24", className: this.props.cssClasses.error.icon }),
2704
+ React__namespace.createElement(surveyReactUi.SvgIcon, { "aria-hidden": "true", iconName: "icon-alert_24x24", size: "auto", className: this.props.cssClasses.error.icon }),
2705
2705
  React__namespace.createElement("span", { className: this.props.cssClasses.error.item || undefined },
2706
2706
  React__namespace.createElement(surveyReactUi.SurveyLocStringViewer, { model: this.props.error.locText }))));
2707
2707
  };
@@ -3584,6 +3584,50 @@
3584
3584
  return React__namespace.createElement(SurveyQuestionSpinEditor, props);
3585
3585
  });
3586
3586
 
3587
+ var Swatch = /** @class */ (function (_super) {
3588
+ __extends(Swatch, _super);
3589
+ function Swatch() {
3590
+ return _super !== null && _super.apply(this, arguments) || this;
3591
+ }
3592
+ Object.defineProperty(Swatch.prototype, "rootClassName", {
3593
+ get: function () {
3594
+ var _a;
3595
+ return (_a = this.props.className) !== null && _a !== void 0 ? _a : "sd-color-swatch";
3596
+ },
3597
+ enumerable: false,
3598
+ configurable: true
3599
+ });
3600
+ Object.defineProperty(Swatch.prototype, "rootStyle", {
3601
+ get: function () {
3602
+ return { backgroundColor: this.props.color };
3603
+ },
3604
+ enumerable: false,
3605
+ configurable: true
3606
+ });
3607
+ Swatch.prototype.renderIcon = function () {
3608
+ var _a, _b;
3609
+ if (!this.props.showIcon)
3610
+ return null;
3611
+ return (React__namespace.createElement(surveyReactUi.SvgIcon, { iconName: (_a = this.props.swatchIcon) !== null && _a !== void 0 ? _a : "icon-dropper-16x16", size: "auto", className: (_b = this.props.iconClassName) !== null && _b !== void 0 ? _b : "sd-color-swatch__icon" }));
3612
+ };
3613
+ Swatch.prototype.renderColorInput = function () {
3614
+ var _a = this.props, onColorInputChange = _a.onColorInputChange, colorInputValue = _a.colorInputValue, colorInputClassName = _a.colorInputClassName, inputDisabled = _a.inputDisabled, arias = _a.arias;
3615
+ if (!onColorInputChange)
3616
+ return null;
3617
+ return (React__namespace.createElement("input", __assign({ type: "color", disabled: inputDisabled, value: colorInputValue, className: colorInputClassName, onChange: onColorInputChange, tabIndex: -1 }, arias)));
3618
+ };
3619
+ Swatch.prototype.render = function () {
3620
+ var content = (React__namespace.createElement("div", { className: "sd-color-swatch__content", style: this.rootStyle },
3621
+ this.renderIcon(),
3622
+ this.renderColorInput()));
3623
+ if (this.props.onColorInputChange) {
3624
+ return React__namespace.createElement("label", { className: this.rootClassName }, content);
3625
+ }
3626
+ return React__namespace.createElement("div", { className: this.rootClassName }, content);
3627
+ };
3628
+ return Swatch;
3629
+ }(React__namespace.Component));
3630
+
3587
3631
  var ItemTemplateComponent = /** @class */ (function (_super) {
3588
3632
  __extends(ItemTemplateComponent, _super);
3589
3633
  function ItemTemplateComponent() {
@@ -3591,9 +3635,10 @@
3591
3635
  }
3592
3636
  ItemTemplateComponent.prototype.render = function () {
3593
3637
  var item = this.props.item;
3594
- return (React__namespace.createElement(React__namespace.Fragment, null,
3595
- React__namespace.createElement("span", { className: "spg-color-editor__color-swatch", style: { backgroundColor: item.value } }),
3596
- React__namespace.createElement("span", { key: 2 }, this.renderLocString(item.locTitle, undefined, "locString"))));
3638
+ return (React__namespace.createElement("div", { className: "sd-color-swatch-item" },
3639
+ React__namespace.createElement("div", { className: "sd-color-swatch-item__label" },
3640
+ React__namespace.createElement("span", { key: 2, className: "sd-color-swatch-item__caption" }, this.renderLocString(item.locTitle, undefined, "locString"))),
3641
+ React__namespace.createElement(Swatch, { color: item.value })));
3597
3642
  };
3598
3643
  return ItemTemplateComponent;
3599
3644
  }(surveyReactUi.SurveyElementBase));
@@ -3630,10 +3675,15 @@
3630
3675
  return this.question.renderedValue;
3631
3676
  };
3632
3677
  SurveyQuestionColor.prototype.renderColorSwatch = function () {
3633
- var _this = this;
3634
- return React__namespace.createElement("label", { className: this.question.getSwatchCss(), style: this.question.getSwatchStyle() },
3635
- React__namespace.createElement(surveyReactUi.SvgIcon, { iconName: this.question.cssClasses.swatchIcon, size: "auto" }),
3636
- React__namespace.createElement("input", { type: "color", disabled: this.isDisplayMode, value: this.question.renderedColorValue, className: this.question.cssClasses.colorInput, onChange: function (event) { return _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 }));
3678
+ var question = this.question;
3679
+ return (React__namespace.createElement("div", { className: question.cssClasses.colorSwatch },
3680
+ React__namespace.createElement(Swatch, { className: question.getSwatchCss(), swatchIcon: question.cssClasses.swatchIcon, iconClassName: question.cssClasses.iconClassName, color: question.renderedValue, showIcon: true, colorInputValue: question.renderedColorValue, colorInputClassName: question.cssClasses.colorInput, inputDisabled: this.isDisplayMode, onColorInputChange: function (event) { return question.onColorInputChange(event.nativeEvent); }, arias: {
3681
+ "aria-required": question.a11y_input_ariaRequired,
3682
+ "aria-labelledby": question.a11y_input_ariaLabelledBy,
3683
+ "aria-label": question.a11y_input_ariaLabel,
3684
+ "aria-invalid": question.a11y_input_ariaInvalid,
3685
+ "aria-describedby": question.a11y_input_ariaDescribedBy,
3686
+ } })));
3637
3687
  };
3638
3688
  SurveyQuestionColor.prototype.renderButtons = function () {
3639
3689
  return this.question.hasVisibleInputActions ? React__namespace.createElement(surveyReactUi.SurveyActionBar, { model: this.question.inputActionsContainer }) : null;
@@ -3738,8 +3788,8 @@
3738
3788
  surveyCore.RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
3739
3789
 
3740
3790
  exports.Version = void 0;
3741
- exports.Version = "".concat("3.0.0-beta.6");
3742
- surveyCore.checkLibraryVersion("".concat("3.0.0-beta.6"), "survey-creator-react");
3791
+ exports.Version = "".concat("3.0.0-beta.7");
3792
+ surveyCore.checkLibraryVersion("".concat("3.0.0-beta.7"), "survey-creator-react");
3743
3793
 
3744
3794
  Object.defineProperty(exports, "PropertyGridEditorCollection", {
3745
3795
  enumerable: true,