survey-creator-react 3.0.0-beta.6 → 3.0.0-beta.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 +49 -29
- package/fesm/survey-creator-react.mjs.map +1 -1
- package/package.json +4 -4
- package/survey-creator-react.js +61 -36
- package/survey-creator-react.js.map +1 -1
- package/survey-creator-react.min.js +2 -2
- package/typings/custom-questions/Swatch.d.ts +23 -0
- package/typings/entries/index-wc.d.ts +0 -1
- package/typings/custom-questions/BooleanSwitch.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-creator-react",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.8",
|
|
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.
|
|
64
|
-
"survey-react-ui": "3.0.0-beta.
|
|
65
|
-
"survey-creator-core": "3.0.0-beta.
|
|
63
|
+
"survey-core": "3.0.0-beta.8",
|
|
64
|
+
"survey-react-ui": "3.0.0-beta.8",
|
|
65
|
+
"survey-creator-core": "3.0.0-beta.8"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"ace-builds": {
|
package/survey-creator-react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SurveyJS Creator v3.0.0-beta.
|
|
2
|
+
* SurveyJS Creator v3.0.0-beta.8
|
|
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: "
|
|
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(
|
|
3595
|
-
React__namespace.createElement("
|
|
3596
|
-
|
|
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
|
|
3634
|
-
return React__namespace.createElement("
|
|
3635
|
-
React__namespace.createElement(
|
|
3636
|
-
|
|
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;
|
|
@@ -3713,33 +3763,9 @@
|
|
|
3713
3763
|
return React__namespace.createElement(SurveyQuestionFileEditorButton, props);
|
|
3714
3764
|
});
|
|
3715
3765
|
|
|
3716
|
-
var SurveyQuestionBooleanSwitch = /** @class */ (function (_super) {
|
|
3717
|
-
__extends(SurveyQuestionBooleanSwitch, _super);
|
|
3718
|
-
function SurveyQuestionBooleanSwitch() {
|
|
3719
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
3720
|
-
}
|
|
3721
|
-
SurveyQuestionBooleanSwitch.prototype.renderElement = function () {
|
|
3722
|
-
var _this = this;
|
|
3723
|
-
var button = surveyReactUi.attachKey2click(React__namespace.createElement("div", { className: "spg-boolean-switch__button" + (this.questionBase.booleanValue ? " spg-boolean-switch__button--checked" : ""), tabIndex: 0, role: "checkbox", "aria-checked": this.questionBase.booleanValue || false, "aria-required": this.questionBase.a11y_input_ariaRequired, "aria-label": this.questionBase.a11y_input_ariaLabel, "aria-labelledby": this.questionBase.a11y_input_ariaLabelledBy, "aria-invalid": this.questionBase.a11y_input_ariaInvalid, "aria-errormessage": this.questionBase.a11y_input_ariaErrormessage },
|
|
3724
|
-
React__namespace.createElement("div", { className: "spg-boolean-switch__thumb" },
|
|
3725
|
-
React__namespace.createElement("div", { className: "spg-boolean-switch__thumb-circle spg-boolean-switch__thumb--left" })),
|
|
3726
|
-
React__namespace.createElement("div", { className: "spg-boolean-switch__thumb" },
|
|
3727
|
-
React__namespace.createElement("div", { className: "spg-boolean-switch__thumb-circle spg-boolean-switch__thumb--right" }))), this.questionBase, { processEsc: false });
|
|
3728
|
-
return (React__namespace.createElement("div", { className: "spg-boolean-switch", onClick: function () { return _this.questionBase.booleanValue = !_this.questionBase.booleanValue; } },
|
|
3729
|
-
button,
|
|
3730
|
-
React__namespace.createElement("div", { className: "spg-boolean-switch__caption" },
|
|
3731
|
-
React__namespace.createElement("div", { className: "spg-boolean-switch__title", id: this.questionBase.labelRenderedAriaID }, surveyReactUi.SurveyElementBase.renderLocString(this.questionBase.locTitle)))));
|
|
3732
|
-
};
|
|
3733
|
-
return SurveyQuestionBooleanSwitch;
|
|
3734
|
-
}(surveyReactUi.SurveyQuestionElementBase));
|
|
3735
|
-
surveyReactUi.ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", function (props) {
|
|
3736
|
-
return React__namespace.createElement(SurveyQuestionBooleanSwitch, props);
|
|
3737
|
-
});
|
|
3738
|
-
surveyCore.RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
|
|
3739
|
-
|
|
3740
3766
|
exports.Version = void 0;
|
|
3741
|
-
exports.Version = "".concat("3.0.0-beta.
|
|
3742
|
-
surveyCore.checkLibraryVersion("".concat("3.0.0-beta.
|
|
3767
|
+
exports.Version = "".concat("3.0.0-beta.8");
|
|
3768
|
+
surveyCore.checkLibraryVersion("".concat("3.0.0-beta.8"), "survey-creator-react");
|
|
3743
3769
|
|
|
3744
3770
|
Object.defineProperty(exports, "PropertyGridEditorCollection", {
|
|
3745
3771
|
enumerable: true,
|
|
@@ -3819,7 +3845,6 @@
|
|
|
3819
3845
|
exports.SurveyLocStringEditor = SurveyLocStringEditor;
|
|
3820
3846
|
exports.SurveyLogicOpertor = SurveyLogicOpertor;
|
|
3821
3847
|
exports.SurveyNavigation = SurveyNavigation;
|
|
3822
|
-
exports.SurveyQuestionBooleanSwitch = SurveyQuestionBooleanSwitch;
|
|
3823
3848
|
exports.SurveyQuestionColor = SurveyQuestionColor;
|
|
3824
3849
|
exports.SurveyQuestionFileEditor = SurveyQuestionFileEditor;
|
|
3825
3850
|
exports.SurveyQuestionFileEditorButton = SurveyQuestionFileEditorButton;
|