survey-js-ui 3.2.6 → 3.2.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/README.md +21 -0
- package/fesm/survey-js-ui.mjs +85 -133
- package/fesm/survey-js-ui.mjs.map +1 -1
- package/package.json +7 -3
- package/survey-js-ui.js +85 -133
- package/survey-js-ui.js.map +1 -1
- package/survey-js-ui.min.js +2 -2
- package/typings/survey-js-ui/src/preact-replaced-vnodes.d.ts +12 -0
- package/typings/survey-react-ui/src/boolean-checkbox.d.ts +1 -1
- package/typings/survey-react-ui/src/components/survey-header/logo-image.d.ts +0 -4
- package/typings/survey-react-ui/src/components/survey-header/survey-header.d.ts +0 -1
- package/typings/survey-react-ui/src/image.d.ts +0 -2
- package/typings/survey-react-ui/src/imagepicker.d.ts +0 -4
- package/typings/survey-react-ui/src/reactquestion_element.d.ts +2 -2
- package/typings/survey-react-ui/src/reactquestion_html.d.ts +0 -4
- package/typings/survey-react-ui/src/row.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-js-ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://surveyjs.io/",
|
|
6
6
|
"author": "DevSoft Baltic OU <info@devsoftbaltic.com>",
|
|
@@ -56,11 +56,15 @@
|
|
|
56
56
|
},
|
|
57
57
|
"repository": {
|
|
58
58
|
"type": "git",
|
|
59
|
-
"url": "https://github.com/surveyjs/
|
|
59
|
+
"url": "git+https://github.com/surveyjs/survey-library.git",
|
|
60
|
+
"directory": "packages/survey-js-ui"
|
|
61
|
+
},
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/surveyjs/survey-library/issues"
|
|
60
64
|
},
|
|
61
65
|
"dependencies": {},
|
|
62
66
|
"peerDependencies": {
|
|
63
|
-
"survey-core": "3.2.
|
|
67
|
+
"survey-core": "3.2.8",
|
|
64
68
|
"@types/react-dom": "*",
|
|
65
69
|
"@types/react": "*"
|
|
66
70
|
}
|
package/survey-js-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v3.2.
|
|
2
|
+
* surveyjs - Survey JavaScript library v3.2.8
|
|
3
3
|
* Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -157,10 +157,9 @@
|
|
|
157
157
|
}
|
|
158
158
|
constructor(props) {
|
|
159
159
|
super(props);
|
|
160
|
-
this.allowUpdate = false;
|
|
161
160
|
this.update = (stateElement, options) => {
|
|
162
161
|
const key = options.name;
|
|
163
|
-
if (!this.canUsePropInState(key)
|
|
162
|
+
if (!this.canUsePropInState(key))
|
|
164
163
|
return;
|
|
165
164
|
this.changedStatePropNameValue = key;
|
|
166
165
|
this.setState((state) => {
|
|
@@ -170,8 +169,8 @@
|
|
|
170
169
|
});
|
|
171
170
|
};
|
|
172
171
|
this.propertyAccessTracker = new surveyCore.PropertyAccessTracker(this.update);
|
|
172
|
+
this.rerenderEventStateElements = new Set();
|
|
173
173
|
this._allowComponentUpdate = true;
|
|
174
|
-
this.prevStateElements = [];
|
|
175
174
|
const render = this.render;
|
|
176
175
|
this.render = () => this.renderWithTracking(render);
|
|
177
176
|
}
|
|
@@ -194,26 +193,30 @@
|
|
|
194
193
|
return res;
|
|
195
194
|
}
|
|
196
195
|
componentDidMount() {
|
|
197
|
-
this.
|
|
198
|
-
this.allowUpdate = true;
|
|
196
|
+
this.syncStateElementsRerenderEvent();
|
|
199
197
|
this.propertyAccessTracker.subscribe();
|
|
200
198
|
}
|
|
201
199
|
componentWillUnmount() {
|
|
202
|
-
this.disableStateElementsRerenderEvent(this.
|
|
203
|
-
this.
|
|
200
|
+
this.disableStateElementsRerenderEvent(Array.from(this.rerenderEventStateElements));
|
|
201
|
+
this.rerenderEventStateElements.clear();
|
|
204
202
|
this.propertyAccessTracker.unsubscribe();
|
|
205
203
|
}
|
|
206
204
|
componentDidUpdate(prevProps, prevState) {
|
|
207
|
-
var _a;
|
|
208
205
|
this.propertyAccessTracker.subscribe();
|
|
209
|
-
this.
|
|
210
|
-
|
|
211
|
-
this.disableStateElementsRerenderEvent(((_a = this.prevStateElements) !== null && _a !== void 0 ? _a : []).filter(el => !stateElements.find(stateElement => stateElement == el)));
|
|
212
|
-
this.prevStateElements = [];
|
|
213
|
-
this.getStateElements().forEach((el) => {
|
|
206
|
+
const stateElements = this.syncStateElementsRerenderEvent();
|
|
207
|
+
stateElements.forEach((el) => {
|
|
214
208
|
el.afterRerender();
|
|
215
209
|
});
|
|
216
210
|
}
|
|
211
|
+
syncStateElementsRerenderEvent() {
|
|
212
|
+
const stateElements = this.getStateElements();
|
|
213
|
+
const current = new Set(stateElements);
|
|
214
|
+
const prev = this.rerenderEventStateElements;
|
|
215
|
+
this.disableStateElementsRerenderEvent(Array.from(prev).filter(el => !current.has(el)));
|
|
216
|
+
this.enableStateElementsRerenderEvent(Array.from(current).filter(el => !prev.has(el)));
|
|
217
|
+
this.rerenderEventStateElements = current;
|
|
218
|
+
return stateElements;
|
|
219
|
+
}
|
|
217
220
|
allowComponentUpdate() {
|
|
218
221
|
this._allowComponentUpdate = true;
|
|
219
222
|
this.forceUpdate();
|
|
@@ -222,11 +225,7 @@
|
|
|
222
225
|
this._allowComponentUpdate = false;
|
|
223
226
|
}
|
|
224
227
|
shouldComponentUpdate(nextProps, nextState) {
|
|
225
|
-
|
|
226
|
-
if (res) {
|
|
227
|
-
this.prevStateElements = this.getStateElements();
|
|
228
|
-
}
|
|
229
|
-
return res;
|
|
228
|
+
return this._allowComponentUpdate && (this.state !== nextState || Object.keys(this.props).some(key => nextProps[key] !== this.props[key]));
|
|
230
229
|
}
|
|
231
230
|
forceHiddenDependencies() { }
|
|
232
231
|
render() {
|
|
@@ -366,7 +365,7 @@
|
|
|
366
365
|
constructor(props) {
|
|
367
366
|
super(props);
|
|
368
367
|
this.updateValueOnEvent = (event) => {
|
|
369
|
-
if (!surveyCore.Helpers.
|
|
368
|
+
if (!surveyCore.Helpers.checkIfValuesEqual(this.questionBase.value, event.target.value, { ignoreOrder: false, caseSensitive: true, trimStrings: false })) {
|
|
370
369
|
this.setValueCore(event.target.value);
|
|
371
370
|
}
|
|
372
371
|
};
|
|
@@ -388,7 +387,7 @@
|
|
|
388
387
|
if (!!this.control) {
|
|
389
388
|
const control = this.control;
|
|
390
389
|
const newValue = this.getValueCore();
|
|
391
|
-
if (!surveyCore.Helpers.
|
|
390
|
+
if (!surveyCore.Helpers.checkIfValuesEqual(newValue, control.value, { ignoreOrder: false, caseSensitive: true, trimStrings: false })) {
|
|
392
391
|
control.value = this.getValue(newValue);
|
|
393
392
|
}
|
|
394
393
|
}
|
|
@@ -796,7 +795,6 @@
|
|
|
796
795
|
class SurveyHeader extends SurveyElementBase {
|
|
797
796
|
constructor(props) {
|
|
798
797
|
super(props);
|
|
799
|
-
this.state = { changed: 0 };
|
|
800
798
|
this.rootRef = b$1();
|
|
801
799
|
}
|
|
802
800
|
get survey() {
|
|
@@ -808,11 +806,6 @@
|
|
|
808
806
|
componentDidMount() {
|
|
809
807
|
super.componentDidMount();
|
|
810
808
|
this.survey.afterRenderHeader(this.rootRef.current);
|
|
811
|
-
this.survey.locLogo.onChanged = () => { this.setState({ changed: this.state.changed + 1 }); };
|
|
812
|
-
}
|
|
813
|
-
componentWillUnmount() {
|
|
814
|
-
super.componentWillUnmount();
|
|
815
|
-
this.survey.locLogo.onChanged = function () { };
|
|
816
809
|
}
|
|
817
810
|
renderTitle() {
|
|
818
811
|
if (!this.survey.renderedHasTitle)
|
|
@@ -1682,13 +1675,6 @@
|
|
|
1682
1675
|
}
|
|
1683
1676
|
if (newProps[key] === oldProps[key])
|
|
1684
1677
|
continue;
|
|
1685
|
-
if (key == "settings") {
|
|
1686
|
-
// Data for the model's settings() method; assigning it would replace the method. An absent value applies nothing
|
|
1687
|
-
if (newProps.settings !== undefined && newProps.settings !== null) {
|
|
1688
|
-
this.survey.settings(newProps.settings);
|
|
1689
|
-
}
|
|
1690
|
-
continue;
|
|
1691
|
-
}
|
|
1692
1678
|
if (key.indexOf("on") == 0 && this.survey[key] && this.survey[key].add) {
|
|
1693
1679
|
if (!!oldProps[key]) {
|
|
1694
1680
|
this.survey[key].remove(oldProps[key]);
|
|
@@ -1923,17 +1909,9 @@
|
|
|
1923
1909
|
if (!this.row)
|
|
1924
1910
|
return;
|
|
1925
1911
|
this.row.changeUIMountCount(1);
|
|
1926
|
-
var el = this.rootRef.current;
|
|
1927
1912
|
if (this.rootRef.current) {
|
|
1928
1913
|
this.row.setRootElement(this.rootRef.current);
|
|
1929
1914
|
}
|
|
1930
|
-
if (!!el && !this.row.isNeedRender) {
|
|
1931
|
-
var row = this.row;
|
|
1932
|
-
var rowContainerDiv = el;
|
|
1933
|
-
this.lazyRenderingTimeout = setTimeout(() => {
|
|
1934
|
-
row.startLazyRendering(rowContainerDiv);
|
|
1935
|
-
}, 10);
|
|
1936
|
-
}
|
|
1937
1915
|
}
|
|
1938
1916
|
shouldComponentUpdate(nextProps, nextState) {
|
|
1939
1917
|
if (!super.shouldComponentUpdate(nextProps, nextState))
|
|
@@ -1951,7 +1929,6 @@
|
|
|
1951
1929
|
const prevRow = prevProps.row;
|
|
1952
1930
|
if (prevRow === this.row)
|
|
1953
1931
|
return;
|
|
1954
|
-
clearTimeout(this.lazyRenderingTimeout);
|
|
1955
1932
|
if (!!this.row) {
|
|
1956
1933
|
this.row.changeUIMountCount(1);
|
|
1957
1934
|
}
|
|
@@ -1959,7 +1936,6 @@
|
|
|
1959
1936
|
}
|
|
1960
1937
|
componentWillUnmount() {
|
|
1961
1938
|
super.componentWillUnmount();
|
|
1962
|
-
clearTimeout(this.lazyRenderingTimeout);
|
|
1963
1939
|
this.releaseRowIfUnmounted(this.row);
|
|
1964
1940
|
}
|
|
1965
1941
|
// Another component may still render the row (#10701), so only the last one to unmount resets it.
|
|
@@ -2057,12 +2033,7 @@
|
|
|
2057
2033
|
doAfterRender() {
|
|
2058
2034
|
var el = this.rootRef.current;
|
|
2059
2035
|
if (el && this.survey) {
|
|
2060
|
-
|
|
2061
|
-
this.panelBase.afterRender(el);
|
|
2062
|
-
}
|
|
2063
|
-
else {
|
|
2064
|
-
this.survey.afterRenderPage(el);
|
|
2065
|
-
}
|
|
2036
|
+
this.panelBase.afterRender(el);
|
|
2066
2037
|
}
|
|
2067
2038
|
}
|
|
2068
2039
|
getIsVisible() {
|
|
@@ -3405,7 +3376,7 @@
|
|
|
3405
3376
|
if (!!this.inputElement) {
|
|
3406
3377
|
const control = this.inputElement;
|
|
3407
3378
|
const newValue = this.renderState.inputStringRendered;
|
|
3408
|
-
if (!surveyCore.Helpers.
|
|
3379
|
+
if (!surveyCore.Helpers.checkIfValuesEqual(newValue, control.value, { ignoreOrder: false, caseSensitive: true, trimStrings: false })) {
|
|
3409
3380
|
control.value = this.renderState.inputStringRendered;
|
|
3410
3381
|
}
|
|
3411
3382
|
}
|
|
@@ -3635,7 +3606,7 @@
|
|
|
3635
3606
|
if (!!this.inputElement) {
|
|
3636
3607
|
const control = this.inputElement;
|
|
3637
3608
|
const newValue = this.renderState.inputStringRendered;
|
|
3638
|
-
if (!surveyCore.Helpers.
|
|
3609
|
+
if (!surveyCore.Helpers.checkIfValuesEqual(newValue, control.value, { ignoreOrder: false, caseSensitive: true, trimStrings: false })) {
|
|
3639
3610
|
control.value = this.renderState.inputStringRendered;
|
|
3640
3611
|
}
|
|
3641
3612
|
}
|
|
@@ -3955,28 +3926,11 @@
|
|
|
3955
3926
|
get question() {
|
|
3956
3927
|
return this.questionBase;
|
|
3957
3928
|
}
|
|
3958
|
-
componentDidMount() {
|
|
3959
|
-
super.componentDidMount();
|
|
3960
|
-
this.reactOnStrChanged();
|
|
3961
|
-
}
|
|
3962
|
-
componentWillUnmount() {
|
|
3963
|
-
super.componentWillUnmount();
|
|
3964
|
-
this.question.locHtml.onChanged = function () { };
|
|
3965
|
-
}
|
|
3966
|
-
componentDidUpdate(prevProps, prevState) {
|
|
3967
|
-
super.componentDidUpdate(prevProps, prevState);
|
|
3968
|
-
this.reactOnStrChanged();
|
|
3969
|
-
}
|
|
3970
|
-
reactOnStrChanged() {
|
|
3971
|
-
this.question.locHtml.onChanged = () => {
|
|
3972
|
-
this.setState({ changed: !!this.state && this.state.changed ? this.state.changed + 1 : 1 });
|
|
3973
|
-
};
|
|
3974
|
-
}
|
|
3975
3929
|
canRender() {
|
|
3976
3930
|
return super.canRender() && !!this.question.html;
|
|
3977
3931
|
}
|
|
3978
3932
|
renderElement() {
|
|
3979
|
-
var htmlValue = { __html: this.question.
|
|
3933
|
+
var htmlValue = { __html: this.question.renderedHtml };
|
|
3980
3934
|
return (_$1("div", { className: this.question.renderCssRoot, dangerouslySetInnerHTML: htmlValue }));
|
|
3981
3935
|
}
|
|
3982
3936
|
}
|
|
@@ -4435,6 +4389,10 @@
|
|
|
4435
4389
|
super(props);
|
|
4436
4390
|
}
|
|
4437
4391
|
renderElement() {
|
|
4392
|
+
if (this.question.isCheckboxView && this.question.booleanValue !== true && !this.question.isLabelRendered) {
|
|
4393
|
+
return (_$1("div", { className: this.question.viewModeCssClass, id: this.question.inputId }, this.question.checkboxViewText));
|
|
4394
|
+
}
|
|
4395
|
+
const showDash = this.question.isCheckboxView && this.question.booleanValue !== true;
|
|
4438
4396
|
const cssClasses = this.question.cssClasses;
|
|
4439
4397
|
const itemClass = this.question.getCheckboxItemCss();
|
|
4440
4398
|
const description = this.question.canRenderLabelDescription ?
|
|
@@ -4442,14 +4400,14 @@
|
|
|
4442
4400
|
return (_$1("div", { className: cssClasses.rootCheckbox, onKeyDown: (event) => { var _a; return this.question.onKeyDown((_a = event.nativeEvent) !== null && _a !== void 0 ? _a : event); } },
|
|
4443
4401
|
_$1("div", { className: itemClass },
|
|
4444
4402
|
_$1("label", { className: cssClasses.checkboxLabel },
|
|
4445
|
-
_$1("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
|
|
4403
|
+
showDash ? null : _$1("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
|
|
4446
4404
|
? ""
|
|
4447
|
-
: this.question.booleanValue, id: this.question.inputId, className: cssClasses.controlCheckbox, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, checked: this.question.booleanValue || false, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }),
|
|
4448
|
-
_$1("span", { className: cssClasses.checkboxMaterialDecorator, "aria-hidden": "true" },
|
|
4405
|
+
: this.question.booleanValue, id: this.question.inputId, className: cssClasses.controlCheckbox, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, checked: this.question.booleanValue || false, tabIndex: this.question.isCheckboxView ? -1 : undefined, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }),
|
|
4406
|
+
showDash ? (_$1("span", { className: this.question.viewModeCssClass, id: this.question.inputId }, this.question.checkboxViewText)) : (_$1("span", { className: cssClasses.checkboxMaterialDecorator, "aria-hidden": "true" },
|
|
4449
4407
|
this.question.svgIcon ?
|
|
4450
4408
|
_$1("svg", { className: cssClasses.checkboxItemDecorator },
|
|
4451
4409
|
_$1("use", { xlinkHref: this.question.svgIcon })) : null,
|
|
4452
|
-
_$1("span", { className: "check" })),
|
|
4410
|
+
_$1("span", { className: "check" }))),
|
|
4453
4411
|
this.question.isLabelRendered && (_$1("span", { className: cssClasses.checkboxControlLabel, id: this.question.labelRenderedAriaID },
|
|
4454
4412
|
_$1(TitleActions, { element: this.question, cssClasses: this.question.cssClasses })))),
|
|
4455
4413
|
description)));
|
|
@@ -4483,7 +4441,7 @@
|
|
|
4483
4441
|
renderElement() {
|
|
4484
4442
|
const cssClasses = this.question.cssClasses;
|
|
4485
4443
|
return (_$1("div", { className: cssClasses.rootRadio, onKeyDown: this.handleOnKeyDown },
|
|
4486
|
-
_$1("fieldset", { role: "
|
|
4444
|
+
_$1("fieldset", { className: cssClasses.radioFieldset, role: "radiogroup", "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }, !this.question.swapOrder ?
|
|
4487
4445
|
(_$1(k$2, null,
|
|
4488
4446
|
this.renderRadioItem(this.question.getValueFalse(), this.question.locLabelFalse),
|
|
4489
4447
|
this.renderRadioItem(this.question.getValueTrue(), this.question.locLabelTrue)))
|
|
@@ -5764,7 +5722,7 @@
|
|
|
5764
5722
|
const isVideo = this.question.contentMode === "video";
|
|
5765
5723
|
const style = { objectFit: this.question.imageFit };
|
|
5766
5724
|
return (_$1("div", { className: this.question.getSelectBaseRootCss(), id: this.question.inputId, ref: (root) => (this.setControl(root)) }, items.map((item) => {
|
|
5767
|
-
const src = item.
|
|
5725
|
+
const src = item.renderedImageURL;
|
|
5768
5726
|
const width = this.question.renderedImageWidth;
|
|
5769
5727
|
const height = this.question.renderedImageHeight;
|
|
5770
5728
|
if (isVideo) {
|
|
@@ -5810,23 +5768,6 @@
|
|
|
5810
5768
|
getStateElement() {
|
|
5811
5769
|
return this.item;
|
|
5812
5770
|
}
|
|
5813
|
-
componentDidMount() {
|
|
5814
|
-
super.componentDidMount();
|
|
5815
|
-
this.reactOnStrChanged();
|
|
5816
|
-
}
|
|
5817
|
-
componentWillUnmount() {
|
|
5818
|
-
super.componentWillUnmount();
|
|
5819
|
-
this.item.locImageLink.onChanged = function () { };
|
|
5820
|
-
}
|
|
5821
|
-
componentDidUpdate(prevProps, prevState) {
|
|
5822
|
-
super.componentDidUpdate(prevProps, prevState);
|
|
5823
|
-
this.reactOnStrChanged();
|
|
5824
|
-
}
|
|
5825
|
-
reactOnStrChanged() {
|
|
5826
|
-
this.item.locImageLink.onChanged = () => {
|
|
5827
|
-
this.setState({ locImageLinkchanged: !!this.state && this.state.locImageLink ? this.state.locImageLink + 1 : 1 });
|
|
5828
|
-
};
|
|
5829
|
-
}
|
|
5830
5771
|
get cssClasses() {
|
|
5831
5772
|
return this.props.cssClasses;
|
|
5832
5773
|
}
|
|
@@ -5872,13 +5813,13 @@
|
|
|
5872
5813
|
}
|
|
5873
5814
|
var style = { objectFit: this.question.imageFit };
|
|
5874
5815
|
var control = null;
|
|
5875
|
-
if (item.
|
|
5876
|
-
control = (_$1("img", { className: cssClasses.image, src: item.
|
|
5816
|
+
if (item.renderedImageURL && this.question.contentMode === "image") {
|
|
5817
|
+
control = (_$1("img", { className: cssClasses.image, src: item.renderedImageURL, width: this.question.renderedImageWidth, height: this.question.renderedImageHeight, alt: item.locText.renderedHtml, style: style, onLoad: (event) => { this.question["onContentLoaded"](item, event.nativeEvent); }, onError: (event) => { item.onErrorHandler(item, event.nativeEvent); } }));
|
|
5877
5818
|
}
|
|
5878
|
-
if (item.
|
|
5879
|
-
control = (_$1("video", { controls: true, className: cssClasses.image, src: item.
|
|
5819
|
+
if (item.renderedImageURL && this.question.contentMode === "video") {
|
|
5820
|
+
control = (_$1("video", { controls: true, className: cssClasses.image, src: item.renderedImageURL, width: this.question.renderedImageWidth, height: this.question.renderedImageHeight, style: style, onLoadedMetadata: (event) => { this.question["onContentLoaded"](item, event.nativeEvent); }, onError: (event) => { item.onErrorHandler(item, event.nativeEvent); } }));
|
|
5880
5821
|
}
|
|
5881
|
-
if (!item.
|
|
5822
|
+
if (!item.renderedImageURL || item.contentNotLoaded) {
|
|
5882
5823
|
let style = {
|
|
5883
5824
|
width: this.question.renderedImageWidth,
|
|
5884
5825
|
height: this.question.renderedImageHeight,
|
|
@@ -5933,16 +5874,6 @@
|
|
|
5933
5874
|
constructor(props) {
|
|
5934
5875
|
super(props);
|
|
5935
5876
|
}
|
|
5936
|
-
componentDidMount() {
|
|
5937
|
-
super.componentDidMount();
|
|
5938
|
-
this.question.locImageLink.onChanged = () => {
|
|
5939
|
-
this.forceUpdate();
|
|
5940
|
-
};
|
|
5941
|
-
}
|
|
5942
|
-
componentWillUnmount() {
|
|
5943
|
-
super.componentWillUnmount();
|
|
5944
|
-
this.question.locImageLink.onChanged = () => { };
|
|
5945
|
-
}
|
|
5946
5877
|
get question() {
|
|
5947
5878
|
return this.questionBase;
|
|
5948
5879
|
}
|
|
@@ -5954,13 +5885,13 @@
|
|
|
5954
5885
|
}
|
|
5955
5886
|
var control = null;
|
|
5956
5887
|
if (this.question.renderedMode === "image") {
|
|
5957
|
-
control = (_$1("img", { className: cssClasses, src: this.question.
|
|
5888
|
+
control = (_$1("img", { className: cssClasses, src: this.question.renderedImageURL || null, alt: this.question.renderedAltText, width: this.question.renderedWidth, height: this.question.renderedHeight, style: style, onLoad: (event) => { this.question.onLoadHandler(); }, onError: (event) => { this.question.onErrorHandler(); } }));
|
|
5958
5889
|
}
|
|
5959
5890
|
if (this.question.renderedMode === "video") {
|
|
5960
|
-
control = (_$1("video", { controls: true, className: cssClasses, src: this.question.
|
|
5891
|
+
control = (_$1("video", { controls: true, className: cssClasses, src: this.question.renderedImageURL, width: this.question.renderedWidth, height: this.question.renderedHeight, style: style, onLoadedMetadata: (event) => { this.question.onLoadHandler(); }, onError: (event) => { this.question.onErrorHandler(); } }));
|
|
5961
5892
|
}
|
|
5962
5893
|
if (this.question.renderedMode === "youtube") {
|
|
5963
|
-
control = (_$1("iframe", { className: cssClasses, src: this.question.
|
|
5894
|
+
control = (_$1("iframe", { className: cssClasses, src: this.question.renderedImageURL, width: this.question.renderedWidth, height: this.question.renderedHeight, style: style, title: this.question.renderedAltText }));
|
|
5964
5895
|
}
|
|
5965
5896
|
var noImage = null;
|
|
5966
5897
|
if (!this.question.imageLink || this.question.contentNotLoaded) {
|
|
@@ -6083,7 +6014,7 @@
|
|
|
6083
6014
|
return _$1("div", { className: css.modalSection },
|
|
6084
6015
|
_$1("div", { className: searchCss.root },
|
|
6085
6016
|
_$1(SvgIcon, { className: css.searchIcon, iconName: "icon-search-24x24", size: "auto" }),
|
|
6086
|
-
_$1("input", { type: "text", className: searchCss.control, value: modal.filterText, placeholder: modal.searchPlaceholder, "aria-label": modal.searchPlaceholder, onChange: (e) => { modal.filterText = e.target.value; } }),
|
|
6017
|
+
_$1("input", { type: "text", autoComplete: "off", className: searchCss.control, value: modal.filterText, placeholder: modal.searchPlaceholder, "aria-label": modal.searchPlaceholder, onChange: (e) => { modal.filterText = e.target.value; } }),
|
|
6087
6018
|
modal.showSearchClear ? _$1(SurveyActionBarItem, { item: modal.searchClearAction }) : null));
|
|
6088
6019
|
}
|
|
6089
6020
|
renderPresets(modal) {
|
|
@@ -6181,7 +6112,7 @@
|
|
|
6181
6112
|
const css = popup.cssClasses;
|
|
6182
6113
|
return _$1("div", { className: css.popupSearch },
|
|
6183
6114
|
_$1(SvgIcon, { className: css.popupSearchIcon, iconName: "icon-search-24x24", size: "auto" }),
|
|
6184
|
-
_$1("input", { type: "text", className: css.popupSearchInput, value: list.filterString || "", placeholder: list.filterStringPlaceholder, "aria-label": list.filterStringPlaceholder, onChange: (e) => { list.filterString = e.target.value; }, onKeyDown: (e) => { popup.onSearchKeyDown(e.nativeEvent); } }));
|
|
6115
|
+
_$1("input", { type: "text", autoComplete: "off", className: css.popupSearchInput, value: list.filterString || "", placeholder: list.filterStringPlaceholder, "aria-label": list.filterStringPlaceholder, onChange: (e) => { list.filterString = e.target.value; }, onKeyDown: (e) => { popup.onSearchKeyDown(e.nativeEvent); } }));
|
|
6185
6116
|
}
|
|
6186
6117
|
renderElement() {
|
|
6187
6118
|
const popup = this.popup;
|
|
@@ -6311,14 +6242,14 @@
|
|
|
6311
6242
|
}
|
|
6312
6243
|
renderSearch() {
|
|
6313
6244
|
const q = this.question;
|
|
6314
|
-
if (!q.
|
|
6245
|
+
if (!q.showSearchBar)
|
|
6315
6246
|
return null;
|
|
6316
6247
|
const css = q.cssClasses;
|
|
6317
6248
|
const searchCss = q.searchCss;
|
|
6318
6249
|
return _$1("div", { className: css.searchRow },
|
|
6319
6250
|
_$1("div", { className: q.searchRootCss },
|
|
6320
6251
|
_$1(SvgIcon, { className: css.searchIcon, iconName: "icon-search-24x24", size: "auto" }),
|
|
6321
|
-
_$1("input", { type: "text", className: searchCss.control, value: q.searchString, placeholder: q.searchPlaceholder, "aria-label": q.searchLabel, disabled: q.isSearchDisabled, onChange: (e) => { q.searchString = e.target.value; } }),
|
|
6252
|
+
_$1("input", { type: "text", autoComplete: "off", className: searchCss.control, value: q.searchString, placeholder: q.searchPlaceholder, "aria-label": q.searchLabel, disabled: q.isSearchDisabled, onChange: (e) => { q.searchString = e.target.value; } }),
|
|
6322
6253
|
q.showSearchClear ? _$1(SurveyActionBarItem, { item: q.searchClearAction }) : null),
|
|
6323
6254
|
_$1(SurveyActionBar, { model: q.searchToolbar }));
|
|
6324
6255
|
}
|
|
@@ -6438,7 +6369,7 @@
|
|
|
6438
6369
|
return null;
|
|
6439
6370
|
}
|
|
6440
6371
|
renderInput() {
|
|
6441
|
-
return (_$1("input", { className: this.model.css.control, id: this.model.id, type: "radio", name: this.model.name, checked: this.model.selected, value: this.model.value, disabled: this.model.readOnly, onChange: () => {
|
|
6372
|
+
return (_$1("input", { className: this.model.css.control, id: this.model.id, type: "radio", name: this.model.name, checked: this.model.selected, value: this.model.value, disabled: this.model.disabled, readOnly: this.question.isReadOnlyAttr, onChange: () => {
|
|
6442
6373
|
this.model.onChange();
|
|
6443
6374
|
}, "aria-required": this.model.isRequired, "aria-label": this.model.caption.renderedHtml, "aria-invalid": this.model.hasErrors, "aria-errormessage": this.model.describedBy }));
|
|
6444
6375
|
}
|
|
@@ -6602,29 +6533,14 @@
|
|
|
6602
6533
|
class LogoImage extends SurveyElementBase {
|
|
6603
6534
|
constructor(props) {
|
|
6604
6535
|
super(props);
|
|
6605
|
-
this.reactOnStrChanged = () => {
|
|
6606
|
-
this.setState({ locLogoLinkchanged: !!this.state && this.state.locLogoLink ? this.state.locLogoLink + 1 : 1 });
|
|
6607
|
-
};
|
|
6608
6536
|
}
|
|
6609
6537
|
get survey() {
|
|
6610
6538
|
return this.props.data;
|
|
6611
6539
|
}
|
|
6612
|
-
componentDidMount() {
|
|
6613
|
-
super.componentDidMount();
|
|
6614
|
-
this.survey.locLogo.onStringChanged.add(this.reactOnStrChanged);
|
|
6615
|
-
}
|
|
6616
|
-
componentDidUpdate(prevProps, prevState) {
|
|
6617
|
-
super.componentDidUpdate(prevProps, prevState);
|
|
6618
|
-
this.survey.locLogo.onStringChanged.add(this.reactOnStrChanged);
|
|
6619
|
-
}
|
|
6620
|
-
componentWillUnmount() {
|
|
6621
|
-
super.componentWillUnmount();
|
|
6622
|
-
this.survey.locLogo.onStringChanged.remove(this.reactOnStrChanged);
|
|
6623
|
-
}
|
|
6624
6540
|
renderElement() {
|
|
6625
6541
|
const content = [];
|
|
6626
6542
|
content.push(_$1("div", { key: "logo-image", className: this.survey.logoClassNames },
|
|
6627
|
-
_$1("img", { className: this.survey.css.logoImage, src: this.survey.
|
|
6543
|
+
_$1("img", { className: this.survey.css.logoImage, src: this.survey.renderedLogoURL || null, role: "presentation", width: this.survey.renderedLogoWidth, height: this.survey.renderedLogoHeight, style: { objectFit: this.survey.logoFit, width: this.survey.renderedStyleLogoWidth, height: this.survey.renderedStyleLogoHeight } })));
|
|
6628
6544
|
return _$1(k$2, null, content);
|
|
6629
6545
|
}
|
|
6630
6546
|
}
|
|
@@ -6889,6 +6805,41 @@
|
|
|
6889
6805
|
return _$1(SurveyLocStringEditor, props);
|
|
6890
6806
|
});
|
|
6891
6807
|
|
|
6808
|
+
const installed = [];
|
|
6809
|
+
/* A component that re-renders on its own (setState, forceUpdate) gets a shallow copy of its vnode, diffed and put in
|
|
6810
|
+
its parent's _children. The vnode the copy replaces is still in the props.children of the vnode that rendered it,
|
|
6811
|
+
and Preact clears only its _dom and _parent: its _children keeps the subtree it rendered, with the DOM nodes,
|
|
6812
|
+
detached as the component goes on rendering. Where shouldComponentUpdate returns false, a vnode and its successor
|
|
6813
|
+
share one _children array, so the replaced subtrees chain up and the detached DOM grows with every re-render: a
|
|
6814
|
+
sort of a dynamic matrix keeps the cells it hides and the actions it rebuilds. React keeps no such references.
|
|
6815
|
+
The copy reaches options.vnode before the diff, while its component still points to the vnode it replaces (and the
|
|
6816
|
+
two share _children); the diff is the last reader of the replaced vnode's _children, so the commit drops them. */
|
|
6817
|
+
function releaseReplacedVNodes(opts = l$1) {
|
|
6818
|
+
if (installed.indexOf(opts) > -1)
|
|
6819
|
+
return;
|
|
6820
|
+
installed.push(opts);
|
|
6821
|
+
const replaced = [];
|
|
6822
|
+
const prevVNode = opts.vnode;
|
|
6823
|
+
opts.vnode = (vnode) => {
|
|
6824
|
+
const component = vnode.__c;
|
|
6825
|
+
const prev = !!component ? component.__v : undefined;
|
|
6826
|
+
if (!!prev && prev !== vnode && !!prev.__k && prev.__k === vnode.__k) {
|
|
6827
|
+
replaced.push(prev);
|
|
6828
|
+
}
|
|
6829
|
+
if (!!prevVNode)
|
|
6830
|
+
prevVNode(vnode);
|
|
6831
|
+
};
|
|
6832
|
+
const prevCommit = opts.__c;
|
|
6833
|
+
opts.__c = (root, commitQueue) => {
|
|
6834
|
+
for (let i = 0; i < replaced.length; i++) {
|
|
6835
|
+
replaced[i].__k = null;
|
|
6836
|
+
}
|
|
6837
|
+
replaced.length = 0;
|
|
6838
|
+
if (!!prevCommit)
|
|
6839
|
+
prevCommit(root, commitQueue);
|
|
6840
|
+
};
|
|
6841
|
+
}
|
|
6842
|
+
|
|
6892
6843
|
function renderSurvey(model, element, props = {}) {
|
|
6893
6844
|
const survey = _$1(Survey, { model, ...props });
|
|
6894
6845
|
nn(survey, element);
|
|
@@ -6928,6 +6879,7 @@
|
|
|
6928
6879
|
SurveyWindow: doPopupSurvey
|
|
6929
6880
|
});
|
|
6930
6881
|
}
|
|
6882
|
+
releaseReplacedVNodes();
|
|
6931
6883
|
surveyCore.SurveyModel.platform = "js-ui";
|
|
6932
6884
|
surveyCore.SurveyModel.prototype["render"] = function (element = null) {
|
|
6933
6885
|
if (this.renderCallback) {
|
|
@@ -6938,7 +6890,7 @@
|
|
|
6938
6890
|
}
|
|
6939
6891
|
};
|
|
6940
6892
|
const preact = React;
|
|
6941
|
-
surveyCore.checkLibraryVersion(`${"3.2.
|
|
6893
|
+
surveyCore.checkLibraryVersion(`${"3.2.8"}`, "survey-js-ui");
|
|
6942
6894
|
|
|
6943
6895
|
Object.defineProperty(exports, 'Model', {
|
|
6944
6896
|
enumerable: true,
|