survey-js-ui 3.2.4 → 3.2.5

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.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/fesm/survey-js-ui.mjs +175 -181
  3. package/fesm/survey-js-ui.mjs.map +1 -1
  4. package/package.json +2 -2
  5. package/survey-js-ui.js +174 -180
  6. package/survey-js-ui.js.map +1 -1
  7. package/survey-js-ui.min.js +2 -2
  8. package/typings/survey-react-ui/src/components/components-container.d.ts +3 -2
  9. package/typings/survey-react-ui/src/components/file/file-choose-button.d.ts +1 -1
  10. package/typings/survey-react-ui/src/components/header.d.ts +5 -4
  11. package/typings/survey-react-ui/src/components/list/list-item-content.d.ts +1 -1
  12. package/typings/survey-react-ui/src/components/list/list-item-group.d.ts +1 -1
  13. package/typings/survey-react-ui/src/components/list/list-item.d.ts +1 -1
  14. package/typings/survey-react-ui/src/components/matrix/row.d.ts +1 -1
  15. package/typings/survey-react-ui/src/components/popup/popup.d.ts +2 -2
  16. package/typings/survey-react-ui/src/components/question-hint.d.ts +3 -2
  17. package/typings/survey-react-ui/src/components/rating/rating-dropdown-item.d.ts +1 -1
  18. package/typings/survey-react-ui/src/components/rating/rating-item-smiley.d.ts +1 -1
  19. package/typings/survey-react-ui/src/components/rating/rating-item-star.d.ts +1 -1
  20. package/typings/survey-react-ui/src/components/rating/rating-item.d.ts +1 -2
  21. package/typings/survey-react-ui/src/components/survey-header/logo-image.d.ts +7 -2
  22. package/typings/survey-react-ui/src/components/survey-header/survey-header.d.ts +3 -2
  23. package/typings/survey-react-ui/src/components/title/title-actions.d.ts +3 -2
  24. package/typings/survey-react-ui/src/components/title/title-content.d.ts +3 -2
  25. package/typings/survey-react-ui/src/components/title/title-element.d.ts +3 -2
  26. package/typings/survey-react-ui/src/progress.d.ts +1 -1
  27. package/typings/survey-react-ui/src/progressButtons.d.ts +1 -1
  28. package/typings/survey-react-ui/src/progressToc.d.ts +1 -1
  29. package/typings/survey-react-ui/src/reactSurvey.d.ts +1 -0
  30. package/typings/survey-react-ui/src/reactquestion.d.ts +0 -2
  31. package/typings/survey-react-ui/src/reactquestion_element.d.ts +7 -10
  32. package/typings/survey-react-ui/src/reactquestion_matrixdropdownbase.d.ts +0 -4
  33. package/typings/survey-react-ui/src/reactquestion_paneldynamic.d.ts +14 -5
  34. package/typings/survey-react-ui/src/reacttimerpanel.d.ts +1 -1
  35. package/typings/survey-react-ui/src/row.d.ts +2 -1
  36. package/typings/survey-react-ui/src/tagbox-filter.d.ts +1 -1
package/survey-js-ui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v3.2.4
2
+ * surveyjs - Survey JavaScript library v3.2.5
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
  */
@@ -10,7 +10,7 @@
10
10
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SurveyUI = {}, global.Survey));
11
11
  })(this, (function (exports, surveyCore) { 'use strict';
12
12
 
13
- var n,l$1,u$1,i$1,r$1,o$1,e$1,f$1,c$1,s$1,a$1,h$1,p$1={},v$1=[],y$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w$2=Array.isArray;function d$1(n,l){for(var u in l)n[u]=l[u];return n}function g$2(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _$1(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m$1(l,e,i,r,null)}function m$1(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$1:o,__i:-1,__u:0};return null==o&&null!=l$1.vnode&&l$1.vnode(e),e}function b$1(){return {current:null}}function k$2(n){return n.children}function x$2(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C$2(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C$2(n)}}function M$1(n){(!n.__d&&(n.__d=!0)&&i$1.push(n)&&!$$1.__r++||r$1!=l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$1)($$1);}function $$1(){for(var n,u,t,r,o,f,c,s=1;i$1.length;)i$1.length>s&&i$1.sort(e$1),n=i$1.shift(),s=i$1.length,n.__d&&(t=void 0,r=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d$1({},r)).__v=r.__v+1,l$1.vnode&&l$1.vnode(t),O$1(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N$1(f,t,c),r.__e=r.__=null,t.__e!=o&&C$2(t)));$$1.__r=0;}function I$1(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_,m=t&&t.__k||v$1,b=l.length;for(f=P$2(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p$1:m[y.__i]||p$1,y.__i=a,g=O$1(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B$2(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),(_=!!(4&y.__u))||h.__k===y.__k?f=A$2(y,f,n,_):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P$2(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m$1(null,o,null,null,null):w$2(o)?m$1(k$2,{children:o},null,null,null):null==o.constructor&&o.__b>0?m$1(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L$1(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D$2(e,e));return t}function A$2(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=A$2(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function H$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(w$2(n)?n.some(function(n){H$1(n,l);}):l.push(n)),l}function L$1(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function T$2(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y$1.test(l)?u:u+"px";}function j$2(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T$2(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T$2(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f$1,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c$1,n.addEventListener(l,r?a$1:s$1,r)):n.removeEventListener(l,r?a$1:s$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F$2(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c$1++;else if(u.t<t.u)return;return t(l$1.event?l$1.event(u):u)}}}function O$1(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l$1.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x$2(b,M),h.constructor=j,h.render=E$1),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d$1({},h.__s)),d$1(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l$1.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d$1(d$1({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k$2&&null==a.key&&(L=V$1(a.props.children)),f=I$1(n,w$2(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else {for(T=o.length;T--;)g$2(o[T]);z$2(u);}else u.__e=t.__e,u.__k=t.__k,n.then||z$2(u);l$1.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q$2(t.__e,u,t,i,r,o,e,c,s);return (a=l$1.diffed)&&a(u),128&u.__u?void 0:f}function z$2(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(z$2);}function N$1(n,u,t){for(var i=0;i<t.length;i++)B$2(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function V$1(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w$2(n)?n.map(V$1):d$1({},n)}function q$2(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=!1),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p$1,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j$2(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j$2(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I$1("template"==t.type?u.content:u,w$2(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g$2(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j$2(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j$2(u,a,m,b[a],o));}return u}function B$2(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function D$2(n,u,t){var i,r;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B$2(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D$2(i[r],u,t||"function"!=typeof n.type);t||g$2(n.__e),n.__c=n.__=n.__e=void 0;}function E$1(n,l,u){return this.constructor(n,u)}function G$1(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),o=(r="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],O$1(t,u=(!r&&i||t).__k=_$1(k$2,null,[u]),o||p$1,p$1,t.namespaceURI,!r&&i?[i]:o?null:t.firstChild?n.call(t.childNodes):null,e,!r&&i?i:o?o.__e:t.firstChild,r,f),N$1(e,u,f);}function J$1(n,l){G$1(n,l,J$1);}function K$1(l,u,t){var i,r,o,e,f=d$1({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==o?i=u[o]:"ref"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m$1(l.type,f,i||l.key,r||l.ref,null)}function Q$1(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null;},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,M$1(n);});},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n);};}),n.children}return l.__c="__cC"+h$1++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v$1.slice,l$1={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,x$2.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d$1({},this.state),"function"==typeof n&&(n=n(d$1({},u),this.props)),n&&d$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M$1(this));},x$2.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M$1(this));},x$2.prototype.render=k$2,i$1=[],o$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},$$1.__r=0,f$1=/(PointerCapture)$|Capture$/i,c$1=0,s$1=F$2(!1),a$1=F$2(!0),h$1=0;
13
+ var n,l$1,u$1,i$1,o$1,r$1,e$1,f$1,c$1,s$1,a$1,h$1,p$1={},v$1=[],y$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d$1=Array.isArray;function w$2(n,l){for(var u in l)n[u]=l[u];return n}function g$2(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _$1(l,u,t){var i,o,r,e={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=u[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m$1(l,e,i,o,null)}function m$1(n,t,i,o,r){var e={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++u$1:r,__i:-1,__u:0};return null==r&&null!=l$1.vnode&&l$1.vnode(e),e}function b$1(){return {current:null}}function k$2(n){return n.children}function x$2(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C$2(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C$2(n)}}function M$1(n){(!n.__d&&(n.__d=!0)&&i$1.push(n)&&!$$1.__r++||o$1!=l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||r$1)($$1);}function $$1(){for(var n,u,t,o,r,f,c,s=1;i$1.length;)i$1.length>s&&i$1.sort(e$1),n=i$1.shift(),s=i$1.length,n.__d&&(t=void 0,o=void 0,r=(o=(u=n).__v).__e,f=[],c=[],u.__P&&((t=w$2({},o)).__v=o.__v+1,l$1.vnode&&l$1.vnode(t),O$1(u.__P,t,o,u.__n,u.__P.namespaceURI,32&o.__u?[r]:null,f,null==r?S(o):r,!!(32&o.__u),c),t.__v=o.__v,t.__.__k[t.__i]=t,N$1(f,t,c),o.__e=o.__=null,t.__e!=r&&C$2(t)));$$1.__r=0;}function I$1(n,l,u,t,i,o,r,e,f,c,s){var a,h,y,d,w,g,_,m=t&&t.__k||v$1,b=l.length;for(f=P$2(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p$1:m[y.__i]||p$1,y.__i=a,g=O$1(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B$2(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),(_=!!(4&y.__u))||h.__k===y.__k?f=A$2(y,f,n,_):"function"==typeof y.type&&void 0!==g?f=g:d&&(f=d.nextSibling),y.__u&=-7);return u.__e=w,f}function P$2(n,l,u,t,i){var o,r,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),o=0;o<i;o++)null!=(r=l[o])&&"boolean"!=typeof r&&"function"!=typeof r?(f=o+h,(r=n.__k[o]="string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?m$1(null,r,null,null,null):d$1(r)?m$1(k$2,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?m$1(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=n,r.__b=n.__b+1,e=null,-1!=(c=r.__i=L$1(r,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof r.type&&(r.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,r.__u|=4))):n.__k[o]=null;if(a)for(o=0;o<s;o++)null!=(e=u[o])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D$2(e,e));return t}function A$2(n,l,u,t){var i,o;if("function"==typeof n.type){for(i=n.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=n,l=A$2(i[o],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function H$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(d$1(n)?n.some(function(n){H$1(n,l);}):l.push(n)),l}function L$1(n,l,u,t){var i,o,r,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,o=u+1;i>=0||o<l.length;)if(null!=(c=l[r=i>=0?i--:o++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return r;return -1}function T$2(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y$1.test(l)?u:u+"px";}function j$2(n,l,u,t,i){var o,r;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T$2(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T$2(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])o=l!=(l=l.replace(f$1,"$1")),r=l.toLowerCase(),l=r in n||"onFocusOut"==l||"onFocusIn"==l?r.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=c$1,n.addEventListener(l,o?a$1:s$1,o)):n.removeEventListener(l,o?a$1:s$1,o);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F$2(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c$1++;else if(u.t<t.u)return;return t(l$1.event?l$1.event(u):u)}}}function O$1(n,u,t,i,o,r,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[f=u.__e=t.__e]),(a=l$1.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x$2(b,M),h.constructor=j,h.render=E$1),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w$2({},h.__s)),w$2(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l$1.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=w$2(w$2({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k$2&&null==a.key&&(L=V$1(a.props.children)),f=I$1(n,d$1(L)?L:[L],u,t,i,o,r,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=r)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,u.__e=f;}else {for(T=r.length;T--;)g$2(r[T]);z$2(u);}else u.__e=t.__e,u.__k=t.__k,n.then||z$2(u);l$1.__e(n,u,t);}else null==r&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q$2(t.__e,u,t,i,o,r,e,c,s);return (a=l$1.diffed)&&a(u),128&u.__u?void 0:f}function z$2(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(z$2);}function N$1(n,u,t){for(var i=0;i<t.length;i++)B$2(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function V$1(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:d$1(n)?n.map(V$1):w$2({},n)}function q$2(u,t,i,o,r,e,f,c,s){var a,h,v,y,w,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?r="http://www.w3.org/2000/svg":"math"==x?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!x&&(x?w.localName==x:3==w.nodeType)){u=w,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(r,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=!1),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),b=i.props||p$1,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(w=u.attributes[a]).name]=w.value;for(a in b)if(w=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j$2(u,a,null,w,r);}for(a in k)w=k[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?_=w:"checked"==a?m=w:c&&"function"!=typeof w||b[a]===w||j$2(u,a,w,b[a],r);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I$1("template"==t.type?u.content:u,d$1(y)?y:[y],t,i,o,"foreignObject"==x?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g$2(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j$2(u,a,_,b[a],r),a="checked",null!=m&&m!=u[a]&&j$2(u,a,m,b[a],r));}return u}function B$2(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function D$2(n,u,t){var i,o;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B$2(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&D$2(i[o],u,t||"function"!=typeof n.type);t||g$2(n.__e),n.__c=n.__=n.__e=void 0;}function E$1(n,l,u){return this.constructor(n,u)}function G$1(u,t,i){var o,r,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],O$1(t,u=(!o&&i||t).__k=_$1(k$2,null,[u]),r||p$1,p$1,t.namespaceURI,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,e,!o&&i?i:r?r.__e:t.firstChild,o,f),N$1(e,u,f);}function J$1(n,l){G$1(n,l,J$1);}function K$1(l,u,t){var i,o,r,e,f=w$2({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=void 0===u[r]&&null!=e?e[r]:u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m$1(l.type,f,i||l.key,o||l.ref,null)}function Q$1(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null;},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,M$1(n);});},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n);};}),n.children}return l.__c="__cC"+h$1++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v$1.slice,l$1={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,x$2.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w$2({},this.state),"function"==typeof n&&(n=n(w$2({},u),this.props)),n&&w$2(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M$1(this));},x$2.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M$1(this));},x$2.prototype.render=k$2,i$1=[],r$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},$$1.__r=0,f$1=/(PointerCapture)$|Capture$/i,c$1=0,s$1=F$2(!1),a$1=F$2(!0),h$1=0;
14
14
 
15
15
  var t,r,u,i,o=0,f=[],c=l$1,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D$1,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return !!n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function y(n,u){var i=p(t++,3);!c.__s&&C$1(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i));}function _(n,u){var i=p(t++,4);!c.__s&&C$1(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i));}function A$1(n){return o=5,T$1(function(){return {current:n}},[])}function F$1(n,t,r){o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r();}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n));}function T$1(n,r){var u=p(t++,7);return C$1(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q$1(n,t){return o=8,T$1(function(){return n},t)}function x$1(n){var u=r.context[n.__c],i=p(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P$1(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n);}function b(n){var u=p(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n);}),[i[0],function(){i[1](void 0);}]}function g$1(){var n=p(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++;}return n.__}function j$1(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z$1),n.__H.__h.forEach(B$1),n.__H.__h=[];}catch(t){n.__H.__h=[],c.__e(t,n.__v);}}c.__b=function(n){r=null,e&&e(n);},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t);},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.forEach(z$1),i.__h.forEach(B$1),i.__h=[],t=0)),u=r;},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w$1)(j$1)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),u=r=null;},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z$1),n.__h=n.__h.filter(function(n){return !n.__||B$1(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c.__e(r,n.__v);}}),l&&l(n,t);},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z$1(n);}catch(n){t=n;}}),r.__H=void 0,t&&c.__e(t,r.__v));};var k$1="function"==typeof requestAnimationFrame;function w$1(n){var t,r=function(){clearTimeout(u),k$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k$1&&(t=requestAnimationFrame(r));}function z$1(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function B$1(n){var t=r;n.__c=n.__(),r=t;}function C$1(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D$1(n,t){return "function"==typeof t?t(n):t}
16
16
 
@@ -157,11 +157,10 @@
157
157
  }
158
158
  constructor(props) {
159
159
  super(props);
160
- this._allowComponentUpdate = true;
161
- this.prevStateElements = [];
162
- this.propertyValueChangedHandler = (stateElement, options) => {
160
+ this.allowUpdate = false;
161
+ this.update = (stateElement, options) => {
163
162
  const key = options.name;
164
- if (!this.canUsePropInState(key) || this.isRendering)
163
+ if (!this.canUsePropInState(key) || !this.allowUpdate)
165
164
  return;
166
165
  this.changedStatePropNameValue = key;
167
166
  this.setState((state) => {
@@ -170,27 +169,44 @@
170
169
  return newState;
171
170
  });
172
171
  };
173
- this.onArrayChangedCallback = (stateElement, options) => {
174
- if (this.isRendering)
175
- return;
176
- this.changedStatePropNameValue = options.name;
177
- this.setState((state) => {
178
- var newState = {};
179
- newState[options.name] = options.newValue;
180
- return newState;
181
- });
182
- };
172
+ this.propertyAccessTracker = new surveyCore.PropertyAccessTracker(this.update);
173
+ this._allowComponentUpdate = true;
174
+ this.prevStateElements = [];
175
+ const render = this.render;
176
+ this.render = () => this.renderWithTracking(render);
177
+ }
178
+ renderWithTracking(render) {
179
+ let res = null;
180
+ this.propertyAccessTracker.startTracking();
181
+ try {
182
+ if (this.canRender()) {
183
+ this.forceHiddenDependencies();
184
+ res = render.call(this);
185
+ }
186
+ }
187
+ finally {
188
+ this.propertyAccessTracker.stopTracking();
189
+ }
190
+ if (!!res) {
191
+ res = this.wrapElement(res);
192
+ }
193
+ this.changedStatePropNameValue = undefined;
194
+ return res;
183
195
  }
184
196
  componentDidMount() {
185
- this.makeBaseElementsReact();
197
+ this.enableStateElementsRerenderEvent(this.getStateElements());
198
+ this.allowUpdate = true;
199
+ this.propertyAccessTracker.subscribe();
186
200
  }
187
201
  componentWillUnmount() {
188
- this.unMakeBaseElementsReact();
189
202
  this.disableStateElementsRerenderEvent(this.getStateElements());
203
+ this.allowUpdate = false;
204
+ this.propertyAccessTracker.unsubscribe();
190
205
  }
191
206
  componentDidUpdate(prevProps, prevState) {
192
207
  var _a;
193
- this.makeBaseElementsReact();
208
+ this.propertyAccessTracker.subscribe();
209
+ this.enableStateElementsRerenderEvent(this.getStateElements());
194
210
  const stateElements = this.getStateElements();
195
211
  this.disableStateElementsRerenderEvent(((_a = this.prevStateElements) !== null && _a !== void 0 ? _a : []).filter(el => !stateElements.find(stateElement => stateElement == el)));
196
212
  this.prevStateElements = [];
@@ -206,47 +222,22 @@
206
222
  this._allowComponentUpdate = false;
207
223
  }
208
224
  shouldComponentUpdate(nextProps, nextState) {
209
- if (this._allowComponentUpdate) {
210
- this.unMakeBaseElementsReact();
225
+ const res = this._allowComponentUpdate && (this.state !== nextState || Object.keys(this.props).some(key => nextProps[key] !== this.props[key]));
226
+ if (res) {
211
227
  this.prevStateElements = this.getStateElements();
212
228
  }
213
- return this._allowComponentUpdate;
229
+ return res;
214
230
  }
231
+ forceHiddenDependencies() { }
215
232
  render() {
216
- if (!this.canRender()) {
217
- return null;
218
- }
219
- this.startEndRendering(1);
220
- var res = this.renderElement();
221
- this.startEndRendering(-1);
222
- if (!!res) {
223
- res = this.wrapElement(res);
224
- }
225
- this.changedStatePropNameValue = undefined;
226
- return res;
233
+ return this.renderElement();
227
234
  }
228
235
  wrapElement(element) {
229
236
  return element;
230
237
  }
231
- get isRendering() {
232
- var stateEls = this.getRenderedElements();
233
- for (let stateEl of stateEls) {
234
- if (stateEl.reactRendering > 0)
235
- return true;
236
- }
237
- return false;
238
- }
239
238
  getRenderedElements() {
240
239
  return this.getStateElements();
241
240
  }
242
- startEndRendering(val) {
243
- var stateEls = this.getRenderedElements();
244
- for (let stateEl of stateEls) {
245
- if (!stateEl.reactRendering)
246
- stateEl.reactRendering = 0;
247
- stateEl.reactRendering += val;
248
- }
249
- }
250
241
  canRender() {
251
242
  return true;
252
243
  }
@@ -256,27 +247,16 @@
256
247
  get changedStatePropName() {
257
248
  return this.changedStatePropNameValue;
258
249
  }
259
- makeBaseElementsReact() {
260
- var els = this.getStateElements();
261
- for (var i = 0; i < els.length; i++) {
262
- els[i].enableOnElementRerenderedEvent();
263
- this.makeBaseElementReact(els[i]);
264
- }
265
- }
266
- unMakeBaseElementsReact() {
267
- var els = this.getStateElements();
268
- this.unMakeBaseElementsReactive(els);
269
- }
270
- unMakeBaseElementsReactive(els) {
271
- for (var i = 0; i < els.length; i++) {
272
- this.unMakeBaseElementReact(els[i]);
273
- }
274
- }
275
250
  disableStateElementsRerenderEvent(els) {
276
251
  els.forEach(el => {
277
252
  el.disableOnElementRerenderedEvent();
278
253
  });
279
254
  }
255
+ enableStateElementsRerenderEvent(els) {
256
+ els.forEach(el => {
257
+ el.enableOnElementRerenderedEvent();
258
+ });
259
+ }
280
260
  getStateElements() {
281
261
  var el = this.getStateElement();
282
262
  return !!el ? [el] : [];
@@ -291,24 +271,9 @@
291
271
  renderLocString(locStr, style = null, key) {
292
272
  return SurveyElementBase.renderLocString(locStr, style, key);
293
273
  }
294
- canMakeReact(stateElement) {
295
- return !!stateElement && !!stateElement.iteratePropertiesHash;
296
- }
297
- makeBaseElementReact(stateElement) {
298
- if (!this.canMakeReact(stateElement))
299
- return;
300
- stateElement.addOnArrayChangedCallback(this.onArrayChangedCallback);
301
- stateElement.addOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
302
- }
303
274
  canUsePropInState(key) {
304
275
  return true;
305
276
  }
306
- unMakeBaseElementReact(stateElement) {
307
- if (!this.canMakeReact(stateElement))
308
- return;
309
- stateElement.removeOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
310
- stateElement.removeOnArrayChangedCallback(this.onArrayChangedCallback);
311
- }
312
277
  }
313
278
  class ReactSurveyElement extends SurveyElementBase {
314
279
  constructor(props) {
@@ -410,6 +375,9 @@
410
375
  get question() {
411
376
  return this.questionBase;
412
377
  }
378
+ forceHiddenDependencies() {
379
+ this.getValueCore();
380
+ }
413
381
  setValueCore(newValue) {
414
382
  this.questionBase.value = newValue;
415
383
  }
@@ -718,7 +686,7 @@
718
686
  return _$1(SurveyActionBar, props);
719
687
  });
720
688
 
721
- class TitleContent extends x$2 {
689
+ class TitleContent extends SurveyElementBase {
722
690
  constructor(props) {
723
691
  super(props);
724
692
  }
@@ -728,7 +696,7 @@
728
696
  get element() {
729
697
  return this.props.element;
730
698
  }
731
- render() {
699
+ renderElement() {
732
700
  if (this.element.isTitleRenderedAsString)
733
701
  return SurveyElementBase.renderLocString(this.element.locRenderedTitle);
734
702
  var spans = this.renderTitleSpans(this.element.getTitleOwner(), this.cssClasses);
@@ -764,7 +732,7 @@
764
732
  }
765
733
  }
766
734
 
767
- class TitleActions extends x$2 {
735
+ class TitleActions extends SurveyElementBase {
768
736
  get cssClasses() {
769
737
  return this.props.cssClasses;
770
738
  }
@@ -774,7 +742,7 @@
774
742
  get renderActions() {
775
743
  return this.props.renderActions === undefined ? true : this.props.renderActions;
776
744
  }
777
- render() {
745
+ renderElement() {
778
746
  const titleContent = _$1(TitleContent, { element: this.element, cssClasses: this.cssClasses });
779
747
  if (!this.element.hasVisibleTitleActions)
780
748
  return titleContent;
@@ -788,7 +756,7 @@
788
756
  return _$1(TitleActions, props);
789
757
  });
790
758
 
791
- class TitleElement extends x$2 {
759
+ class TitleElement extends SurveyElementBase {
792
760
  constructor(props) {
793
761
  super(props);
794
762
  }
@@ -801,7 +769,7 @@
801
769
  return _$1("span", { className: this.element.getCssTitleExpandableSvgContainer() },
802
770
  _$1(SvgIcon, { className: this.element.getCssTitleExpandableSvg(), iconName: this.element.titleExpandableSvgIconName, size: "auto" }));
803
771
  }
804
- render() {
772
+ renderElement() {
805
773
  const element = this.element;
806
774
  if (!element || !element.hasTitle)
807
775
  return null;
@@ -822,7 +790,7 @@
822
790
  }
823
791
  }
824
792
 
825
- class SurveyHeader extends x$2 {
793
+ class SurveyHeader extends SurveyElementBase {
826
794
  constructor(props) {
827
795
  super(props);
828
796
  this.state = { changed: 0 };
@@ -835,13 +803,12 @@
835
803
  return this.survey.css;
836
804
  }
837
805
  componentDidMount() {
838
- const self = this;
806
+ super.componentDidMount();
839
807
  this.survey.afterRenderHeader(this.rootRef.current);
840
- this.survey.locLogo.onChanged = function () {
841
- self.setState({ changed: self.state.changed + 1 });
842
- };
808
+ this.survey.locLogo.onChanged = () => { this.setState({ changed: this.state.changed + 1 }); };
843
809
  }
844
810
  componentWillUnmount() {
811
+ super.componentWillUnmount();
845
812
  this.survey.locLogo.onChanged = function () { };
846
813
  }
847
814
  renderTitle() {
@@ -861,7 +828,7 @@
861
828
  data: componentData,
862
829
  });
863
830
  }
864
- render() {
831
+ renderElement() {
865
832
  if (!this.survey.renderedHasHeader)
866
833
  return null;
867
834
  return (_$1("div", { className: this.css.header, ref: this.rootRef },
@@ -931,8 +898,8 @@
931
898
  return _$1(NotifierComponent, props);
932
899
  });
933
900
 
934
- class ComponentsContainer extends x$2 {
935
- render() {
901
+ class ComponentsContainer extends SurveyElementBase {
902
+ renderElement() {
936
903
  const components = this.props.survey.getContainerContent(this.props.container);
937
904
  const needRenderWrapper = this.props.needRenderWrapper === false ? false : true;
938
905
  if (components.length == 0) {
@@ -1019,7 +986,7 @@
1019
986
  }
1020
987
  return isNeedUpdate;
1021
988
  }
1022
- render() {
989
+ renderElement() {
1023
990
  this.popup.model = this.model;
1024
991
  let popupContainer;
1025
992
  if (this.model.isModal) {
@@ -1091,7 +1058,7 @@
1091
1058
  return (_$1("div", { className: "sv-popup__body-footer" },
1092
1059
  _$1(SurveyActionBar, { model: popuModel.footerToolbar })));
1093
1060
  }
1094
- render() {
1061
+ renderElement() {
1095
1062
  // Stays mounted and subscribed to the view model: Popup does not re-render when the popup opens.
1096
1063
  if (!this.model.hasBeenShown)
1097
1064
  return null;
@@ -1176,9 +1143,11 @@
1176
1143
  return _$1(k$2, null, this.modalManager.getModals().map(model => $(_$1(PopupContainer, { model: model }), model.container, model.uniqueId.toString())));
1177
1144
  }
1178
1145
  componentDidMount() {
1146
+ super.componentDidMount();
1179
1147
  PopupModal.addModalDescriptor(this.descriptor);
1180
1148
  }
1181
1149
  componentWillUnmount() {
1150
+ super.componentWillUnmount();
1182
1151
  this.modalManager.clear();
1183
1152
  PopupModal.removeModalDescriptor(this.descriptor);
1184
1153
  }
@@ -1477,6 +1446,7 @@
1477
1446
  super(props);
1478
1447
  this.previousJSON = {};
1479
1448
  this.isSurveyUpdated = false;
1449
+ this.key = 0;
1480
1450
  this.createSurvey(props);
1481
1451
  this.updateSurvey(props, {});
1482
1452
  this.rootRef = b$1();
@@ -1610,7 +1580,7 @@
1610
1580
  if (!!this.survey.renderedWidth) {
1611
1581
  style.maxWidth = this.survey.renderedWidth;
1612
1582
  }
1613
- return (_$1("div", { className: this.survey.bodyContainerCss },
1583
+ return (_$1("div", { key: this.key, className: this.survey.bodyContainerCss },
1614
1584
  _$1(ComponentsContainer, { survey: this.survey, container: "left" }),
1615
1585
  _$1("div", { className: "sv-components-column sv-components-column--expandable" },
1616
1586
  _$1(ComponentsContainer, { survey: this.survey, container: "center" }),
@@ -1679,6 +1649,13 @@
1679
1649
  }
1680
1650
  if (newProps[key] === oldProps[key])
1681
1651
  continue;
1652
+ if (key == "settings") {
1653
+ // Data for the model's settings() method; assigning it would replace the method. An absent value applies nothing
1654
+ if (newProps.settings !== undefined && newProps.settings !== null) {
1655
+ this.survey.settings(newProps.settings);
1656
+ }
1657
+ continue;
1658
+ }
1682
1659
  if (key.indexOf("on") == 0 && this.survey[key] && this.survey[key].add) {
1683
1660
  if (!!oldProps[key]) {
1684
1661
  this.survey[key].remove(oldProps[key]);
@@ -1691,14 +1668,13 @@
1691
1668
  }
1692
1669
  }
1693
1670
  setSurveyEvents() {
1694
- var self = this;
1695
- this.survey.renderCallback = function () {
1696
- var counter = !!self.state && !!self.state.modelChanged ? self.state.modelChanged : 0;
1697
- self.setState({ modelChanged: counter + 1 });
1671
+ this.survey.renderCallback = () => {
1672
+ this.key++;
1673
+ this.forceUpdate();
1698
1674
  };
1699
1675
  this.survey.onPartialSend.add((sender) => {
1700
- if (!!self.state) {
1701
- self.setState(self.state);
1676
+ if (!!this.state) {
1677
+ this.setState(this.state);
1702
1678
  }
1703
1679
  });
1704
1680
  }
@@ -1769,7 +1745,7 @@
1769
1745
  get progress() {
1770
1746
  return -this.timerModel.progress * this.circleLength;
1771
1747
  }
1772
- render() {
1748
+ renderElement() {
1773
1749
  if (!this.timerModel.isRunning) {
1774
1750
  return null;
1775
1751
  }
@@ -1911,14 +1887,18 @@
1911
1887
  }
1912
1888
  componentDidMount() {
1913
1889
  super.componentDidMount();
1890
+ if (!this.row)
1891
+ return;
1892
+ this.row.changeUIMountCount(1);
1914
1893
  var el = this.rootRef.current;
1915
1894
  if (this.rootRef.current) {
1916
1895
  this.row.setRootElement(this.rootRef.current);
1917
1896
  }
1918
1897
  if (!!el && !this.row.isNeedRender) {
1898
+ var row = this.row;
1919
1899
  var rowContainerDiv = el;
1920
1900
  this.lazyRenderingTimeout = setTimeout(() => {
1921
- this.row.startLazyRendering(rowContainerDiv);
1901
+ row.startLazyRendering(rowContainerDiv);
1922
1902
  }, 10);
1923
1903
  }
1924
1904
  }
@@ -1926,27 +1906,42 @@
1926
1906
  if (!super.shouldComponentUpdate(nextProps, nextState))
1927
1907
  return false;
1928
1908
  if (nextProps.row !== this.row) {
1909
+ // The next render reads these from the new row. The previous row is released at commit, in componentDidUpdate.
1929
1910
  nextProps.row.isNeedRender = this.row.isNeedRender;
1930
1911
  nextProps.row.setRootElement(this.rootRef.current);
1931
- this.row.setRootElement(undefined);
1932
- this.stopLazyRendering();
1933
1912
  }
1934
1913
  this.recalculateCss();
1935
1914
  return true;
1936
1915
  }
1937
- stopLazyRendering() {
1916
+ componentDidUpdate(prevProps, prevState) {
1917
+ super.componentDidUpdate(prevProps, prevState);
1918
+ const prevRow = prevProps.row;
1919
+ if (prevRow === this.row)
1920
+ return;
1938
1921
  clearTimeout(this.lazyRenderingTimeout);
1939
- this.row.stopLazyRendering();
1940
- this.row.isNeedRender = !this.row.isLazyRendering();
1922
+ if (!!this.row) {
1923
+ this.row.changeUIMountCount(1);
1924
+ }
1925
+ this.releaseRowIfUnmounted(prevRow);
1941
1926
  }
1942
1927
  componentWillUnmount() {
1943
1928
  super.componentWillUnmount();
1944
- if (!!this.row) {
1945
- if (!this.row.hasActiveUISubscribers) {
1946
- this.row.setRootElement(undefined);
1947
- this.stopLazyRendering();
1929
+ clearTimeout(this.lazyRenderingTimeout);
1930
+ this.releaseRowIfUnmounted(this.row);
1931
+ }
1932
+ // Another component may still render the row (#10701), so only the last one to unmount resets it.
1933
+ releaseRowIfUnmounted(row) {
1934
+ if (!row)
1935
+ return;
1936
+ if (row.changeUIMountCount(-1) > 0) {
1937
+ if (row.getRootElement() === this.rootRef.current) {
1938
+ row.setRootElement(undefined);
1948
1939
  }
1940
+ return;
1949
1941
  }
1942
+ row.setRootElement(undefined);
1943
+ row.stopLazyRendering();
1944
+ row.isNeedRender = !row.isLazyRendering();
1950
1945
  }
1951
1946
  createElement(element, elementIndex) {
1952
1947
  const index = elementIndex ? "-" + elementIndex : 0;
@@ -1985,7 +1980,7 @@
1985
1980
  return this.getCss();
1986
1981
  }
1987
1982
  getPanelFromProps(props) {
1988
- return this.props.element || this.props.question;
1983
+ return props.element || props.question;
1989
1984
  }
1990
1985
  get panelBase() {
1991
1986
  return this.getPanelFromProps(this.props);
@@ -2326,14 +2321,14 @@
2326
2321
  return _$1(SurveyBreadcrumbs, props);
2327
2322
  });
2328
2323
 
2329
- class QuestionHint extends x$2 {
2324
+ class QuestionHint extends SurveyElementBase {
2330
2325
  renderHint(hint, index) {
2331
2326
  if (hint.alternatives.length > 0) {
2332
2327
  return (_$1("span", { className: hint.className, key: index }, hint.alternatives.map((alternative, alternativeIndex) => this.renderHint(alternative, alternativeIndex))));
2333
2328
  }
2334
2329
  return (_$1("span", { className: hint.className, key: index }, hint.parts.map((part, partIndex) => (_$1("span", { key: partIndex, className: part.className }, part.text)))));
2335
2330
  }
2336
- render() {
2331
+ renderElement() {
2337
2332
  const keyboardHintModel = this.props.question.getKeyboardHintModel();
2338
2333
  if (!keyboardHintModel.hasItems())
2339
2334
  return null;
@@ -2441,7 +2436,7 @@
2441
2436
  const singleInput = singleSummary || (question.singleInputQuestion ? this.renderSingleInputQuestion(question, cssClasses) : undefined);
2442
2437
  const questionContent = singleInput || this.wrapQuestionContent(this.renderQuestionContent());
2443
2438
  return (_$1(k$2, null,
2444
- _$1("div", { ref: this.rootRef, id: question.id, className: question.getRootCss(), style: rootStyle, "data-name": question.name, role: question.ariaRole, "aria-required": this.question.ariaRequired, "aria-invalid": this.question.ariaInvalid, "aria-label": this.question.ariaLabel, "aria-labelledby": question.ariaLabelledBy, "aria-describedby": question.ariaDescribedBy, "aria-expanded": question.ariaExpanded, onClick: (event) => question.clickRootFunction && question.clickRootFunction(event.nativeEvent) },
2439
+ _$1("div", { ref: this.rootRef, id: question.renderedId, className: question.getRootCss(), style: rootStyle, "data-name": question.name, role: question.ariaRole, "aria-required": this.question.ariaRequired, "aria-invalid": this.question.ariaInvalid, "aria-label": this.question.ariaLabel, "aria-labelledby": question.ariaLabelledBy, "aria-describedby": question.ariaDescribedBy, "aria-expanded": question.ariaExpanded, onClick: (event) => question.clickRootFunction && question.clickRootFunction(event.nativeEvent) },
2445
2440
  singleBreadcrumbs,
2446
2441
  _$1("div", { className: question.getQuestionContainerCss() },
2447
2442
  errorsAboveQuestion,
@@ -2504,7 +2499,6 @@
2504
2499
  class SurveyElementErrors extends ReactSurveyElement {
2505
2500
  constructor(props) {
2506
2501
  super(props);
2507
- this.state = this.getState();
2508
2502
  }
2509
2503
  get id() {
2510
2504
  return this.props.element.renderedId + "_errors";
@@ -2515,14 +2509,9 @@
2515
2509
  get creator() {
2516
2510
  return this.props.creator;
2517
2511
  }
2518
- getState(prevState = null) {
2519
- return !prevState ? { error: 0 } : { error: prevState.error + 1 };
2520
- }
2521
2512
  canRender() {
2522
2513
  return !!this.element && this.element.hasVisibleErrors;
2523
2514
  }
2524
- componentWillUnmount() {
2525
- }
2526
2515
  renderElement() {
2527
2516
  const errors = [];
2528
2517
  for (let i = 0; i < this.element.renderedErrors.length; i++) {
@@ -2730,7 +2719,7 @@
2730
2719
  if (this.panelBase)
2731
2720
  this.panelBase.focusIn();
2732
2721
  };
2733
- return (_$1("div", { ref: this.rootRef, className: this.panelBase.getContainerCss(), onFocus: focusIn, id: this.panelBase.id, onClick: (e) => this.panelBase.clickRootFunction && this.panelBase.clickRootFunction(e.nativeEvent) },
2722
+ return (_$1("div", { ref: this.rootRef, className: this.panelBase.getContainerCss(), onFocus: focusIn, id: this.panelBase.renderedId, onClick: (e) => this.panelBase.clickRootFunction && this.panelBase.clickRootFunction(e.nativeEvent) },
2734
2723
  this.panel.showErrorsAbovePanel ? errors : null,
2735
2724
  header,
2736
2725
  this.panel.showErrorsAbovePanel ? null : errors,
@@ -3300,22 +3289,19 @@
3300
3289
  }
3301
3290
  }
3302
3291
  class RatingItem extends RatingItemBase {
3303
- render() {
3292
+ renderElement() {
3304
3293
  var itemText = this.renderLocString(this.item.locText);
3305
3294
  return (_$1("label", { className: this.item.className, onMouseDown: this.handleOnMouseDown },
3306
3295
  _$1("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: () => { }, "aria-label": this.question.ariaLabel }),
3307
3296
  _$1("span", { className: this.question.cssClasses.itemText, "data-text": this.item.text }, itemText)));
3308
3297
  }
3309
- componentDidMount() {
3310
- super.componentDidMount();
3311
- }
3312
3298
  }
3313
3299
  ReactElementFactory.Instance.registerElement("sv-rating-item", (props) => {
3314
3300
  return _$1(RatingItem, props);
3315
3301
  });
3316
3302
 
3317
3303
  class RatingItemStar extends RatingItemBase {
3318
- render() {
3304
+ renderElement() {
3319
3305
  return (_$1("label", { className: this.item.className, onMouseDown: this.handleOnMouseDown, onMouseOver: e => this.question.onItemMouseIn(this.item), onMouseOut: e => this.question.onItemMouseOut(this.item), title: this.item.text },
3320
3306
  _$1("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, tabIndex: this.question.itemTabIndex, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: () => { }, "aria-label": this.question.ariaLabel }),
3321
3307
  _$1(SvgIcon, { className: "sv-star", size: "auto", iconName: this.question.itemStarIcon }),
@@ -3327,7 +3313,7 @@
3327
3313
  });
3328
3314
 
3329
3315
  class RatingItemSmiley extends RatingItemBase {
3330
- render() {
3316
+ renderElement() {
3331
3317
  return (_$1("label", { style: this.item.style, className: this.item.className, onMouseDown: this.handleOnMouseDown, onMouseOver: e => this.question.onItemMouseIn(this.item), onMouseOut: e => this.question.onItemMouseOut(this.item), title: this.item.text },
3332
3318
  _$1("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, tabIndex: this.question.itemTabIndex, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: () => { }, "aria-label": this.question.ariaLabel }),
3333
3319
  _$1(SvgIcon, { size: "auto", iconName: this.question.getItemSmileyIconName(this.item) })));
@@ -3344,7 +3330,7 @@
3344
3330
  getStateElement() {
3345
3331
  return this.item;
3346
3332
  }
3347
- render() {
3333
+ renderElement() {
3348
3334
  if (!this.item)
3349
3335
  return null;
3350
3336
  const item = this.props.item;
@@ -3413,7 +3399,7 @@
3413
3399
  getStateElement() {
3414
3400
  return this.props.model || this.question.dropdownListModelValue;
3415
3401
  }
3416
- render() {
3402
+ renderElement() {
3417
3403
  return (_$1("div", { className: this.question.cssClasses.hint },
3418
3404
  this.renderState.showHintPrefix ?
3419
3405
  (_$1("div", { className: this.question.cssClasses.hintPrefix },
@@ -3937,12 +3923,15 @@
3937
3923
  return this.questionBase;
3938
3924
  }
3939
3925
  componentDidMount() {
3926
+ super.componentDidMount();
3940
3927
  this.reactOnStrChanged();
3941
3928
  }
3942
3929
  componentWillUnmount() {
3930
+ super.componentWillUnmount();
3943
3931
  this.question.locHtml.onChanged = function () { };
3944
3932
  }
3945
3933
  componentDidUpdate(prevProps, prevState) {
3934
+ super.componentDidUpdate(prevProps, prevState);
3946
3935
  this.reactOnStrChanged();
3947
3936
  }
3948
3937
  reactOnStrChanged() {
@@ -4045,7 +4034,7 @@
4045
4034
  get question() {
4046
4035
  return (this.props.item && this.props.item.data.question) || this.props.data.question;
4047
4036
  }
4048
- render() {
4037
+ renderElement() {
4049
4038
  return attachKey2click(_$1("label", { tabIndex: 0, className: this.props.item.getActionBarItemCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonText, onClick: (e) => this.question.chooseFile(e.nativeEvent) },
4050
4039
  !!this.props.item.iconName ? _$1(SvgIcon, { title: this.question.chooseButtonText, iconName: this.question.cssClasses.chooseFileIconId, size: "auto", className: this.props.item.cssClasses.itemIcon }) : null,
4051
4040
  this.props.item.hasTitle ? _$1(SurveyLocStringViewer, { model: this.props.item.locTitle, textClass: this.props.item.getActionBarItemTitleCss() }) : null));
@@ -4064,7 +4053,7 @@
4064
4053
  }
4065
4054
  renderElement() {
4066
4055
  const items = this.page.items.map((item, index) => { return ReactElementFactory.Instance.createElement("sv-file-item", { item, question: this.question, key: index }); });
4067
- return (_$1("div", { className: this.page.css, id: this.page.id }, items));
4056
+ return (_$1("div", { className: this.page.css, id: this.page.renderedId }, items));
4068
4057
  }
4069
4058
  }
4070
4059
 
@@ -4561,7 +4550,7 @@
4561
4550
  }
4562
4551
  return true;
4563
4552
  }
4564
- render() {
4553
+ renderElement() {
4565
4554
  const model = this.model;
4566
4555
  if (!model.visible)
4567
4556
  return null;
@@ -4754,29 +4743,10 @@
4754
4743
  super(props);
4755
4744
  //Create rendered table in contructor and not on rendering
4756
4745
  this.question.renderedTable;
4757
- this.state = this.getState();
4758
4746
  }
4759
4747
  get question() {
4760
4748
  return this.questionBase;
4761
4749
  }
4762
- getState(prevState = null) {
4763
- return { rowCounter: !prevState ? 0 : prevState.rowCounter + 1 };
4764
- }
4765
- updateStateOnCallback() {
4766
- if (this.isRendering)
4767
- return;
4768
- this.setState(this.getState(this.state));
4769
- }
4770
- componentDidMount() {
4771
- super.componentDidMount();
4772
- this.question.onRenderedTableResetCallback = () => {
4773
- this.updateStateOnCallback();
4774
- };
4775
- }
4776
- componentWillUnmount() {
4777
- super.componentWillUnmount();
4778
- this.question.onRenderedTableResetCallback = () => { };
4779
- }
4780
4750
  renderElement() {
4781
4751
  return this.renderTableDiv();
4782
4752
  }
@@ -5041,6 +5011,9 @@
5041
5011
  get question() {
5042
5012
  return this.questionBase;
5043
5013
  }
5014
+ getStateElement() {
5015
+ return this.question;
5016
+ }
5044
5017
  componentDidMount() {
5045
5018
  super.componentDidMount();
5046
5019
  this.setState({ panelCounter: 0 });
@@ -5070,7 +5043,7 @@
5070
5043
  const panels = [];
5071
5044
  const cssClasses = this.question.cssClasses;
5072
5045
  this.question.renderedPanels.forEach((panel, index) => {
5073
- panels.push(_$1(SurveyQuestionPanelDynamicItem, { key: panel.id, element: panel, question: this.question, index: index, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode, creator: this.creator }));
5046
+ panels.push(_$1(SurveyQuestionPanelDynamicItem, { key: panel.id, panel: panel, question: this.question, index: index, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode, creator: this.creator }));
5074
5047
  });
5075
5048
  const rangeTop = this.question.isRangeShowing && this.question.isProgressTopShowing
5076
5049
  ? this.renderRange()
@@ -5116,13 +5089,16 @@
5116
5089
  return null;
5117
5090
  }
5118
5091
  }
5119
- class SurveyQuestionPanelDynamicItem extends SurveyPanel {
5092
+ class SurveyQuestionPanelDynamicItem extends SurveyElementBase {
5120
5093
  get question() {
5121
5094
  return this.props.question;
5122
5095
  }
5123
5096
  get index() {
5124
5097
  return this.props.index;
5125
5098
  }
5099
+ get panel() {
5100
+ return this.props.panel;
5101
+ }
5126
5102
  getSurvey() {
5127
5103
  return !!this.question ? this.question.survey : null;
5128
5104
  }
@@ -5130,14 +5106,13 @@
5130
5106
  const survey = this.getSurvey();
5131
5107
  return !!survey ? survey.getCss() : {};
5132
5108
  }
5133
- render() {
5134
- const panel = super.render();
5109
+ renderElement() {
5135
5110
  const removeButton = this.renderButton();
5136
5111
  const separator = this.question.showSeparator(this.index) ?
5137
5112
  (_$1("hr", { className: this.question.cssClasses.separator })) : null;
5138
5113
  return (_$1(k$2, null,
5139
5114
  _$1("div", { className: this.question.getPanelWrapperCss(this.panel) },
5140
- panel,
5115
+ _$1(SurveyPanel, { element: this.panel, cssClasses: this.props.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.props.creator }),
5141
5116
  removeButton),
5142
5117
  separator));
5143
5118
  }
@@ -5186,7 +5161,7 @@
5186
5161
  get progressBarAriaLabel() {
5187
5162
  return this.model.progressBarAriaLabel;
5188
5163
  }
5189
- render() {
5164
+ renderElement() {
5190
5165
  var progressStyle = {
5191
5166
  width: this.progress + "%",
5192
5167
  };
@@ -5222,7 +5197,7 @@
5222
5197
  getStateElement() {
5223
5198
  return this.model;
5224
5199
  }
5225
- render() {
5200
+ renderElement() {
5226
5201
  return (_$1("div", { className: this.model.getRootCss(this.props.container), style: { "maxWidth": this.model.progressWidth }, role: "tablist", "aria-label": this.model.progressBarAriaLabel, onKeyDown: (event) => this.model.onKeyDown(event.nativeEvent) },
5227
5202
  _$1("div", { className: this.css.progressButtonsContainer, role: "presentation" },
5228
5203
  _$1("div", { className: this.css.progressButtonsListContainer, role: "presentation" },
@@ -5270,7 +5245,7 @@
5270
5245
  getStateElement() {
5271
5246
  return this.item;
5272
5247
  }
5273
- render() {
5248
+ renderElement() {
5274
5249
  if (!this.item)
5275
5250
  return null;
5276
5251
  const className = this.model.getItemClass(this.item);
@@ -5438,7 +5413,7 @@
5438
5413
  const tocModel = this.props.model;
5439
5414
  tocModel.updateStickyTOCSize(this.survey.rootElement);
5440
5415
  }
5441
- render() {
5416
+ renderElement() {
5442
5417
  const tocModel = this.props.model;
5443
5418
  let content;
5444
5419
  if (tocModel.isMobile) {
@@ -5575,14 +5550,14 @@
5575
5550
  return thumb;
5576
5551
  }
5577
5552
  getInput(i) {
5578
- const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, renderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur, id } = this.question;
5553
+ const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, renderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur, renderedId } = this.question;
5579
5554
  const value = renderedValue[i];
5580
- const input = _$1("input", { className: cssClasses.input, id: id + "-sjs-slider-input-" + i, type: "range", min: min, max: max, step: step, value: value, onChange: (e) => { handleOnChange(e.nativeEvent, i); }, onPointerDown: (e) => { handlePointerDown(e.nativeEvent); }, onPointerUp: (e) => { e.stopPropagation(); handlePointerUp(e.nativeEvent); }, onKeyDown: (e) => { handleKeyDown(e.nativeEvent); }, onKeyUp: (e) => { handleKeyUp(e.nativeEvent); }, onFocus: () => { handleOnFocus(i); }, onBlur: () => { handleOnBlur(); }, disabled: isDisabledAttr, "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 });
5555
+ const input = _$1("input", { className: cssClasses.input, id: renderedId + "-sjs-slider-input-" + i, type: "range", min: min, max: max, step: step, value: value, onChange: (e) => { handleOnChange(e.nativeEvent, i); }, onPointerDown: (e) => { handlePointerDown(e.nativeEvent); }, onPointerUp: (e) => { e.stopPropagation(); handlePointerUp(e.nativeEvent); }, onKeyDown: (e) => { handleKeyDown(e.nativeEvent); }, onKeyUp: (e) => { handleKeyUp(e.nativeEvent); }, onFocus: () => { handleOnFocus(i); }, onBlur: () => { handleOnBlur(); }, disabled: isDisabledAttr, "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 });
5581
5556
  return input;
5582
5557
  }
5583
5558
  getRangeInput() {
5584
- const { renderedMax: max, renderedMin: min, step, cssClasses, handleRangeOnChange, handleRangePointerDown, handleRangePointerUp, id } = this.question;
5585
- return _$1("input", { name: "range-input", id: id + "-sjs-slider-input-range-input", ref: this.rangeInputRef, className: cssClasses.input, type: "range", "aria-hidden": "true", min: min, max: max, step: step, tabIndex: -1, onChange: (e) => { handleRangeOnChange(e.nativeEvent); }, onPointerDown: (e) => { e.persist(); handleRangePointerDown(e.nativeEvent, this.control); }, onPointerUp: (e) => { handleRangePointerUp(e.nativeEvent, this.control); } });
5559
+ const { renderedMax: max, renderedMin: min, step, cssClasses, handleRangeOnChange, handleRangePointerDown, handleRangePointerUp, renderedId } = this.question;
5560
+ return _$1("input", { name: "range-input", id: renderedId + "-sjs-slider-input-range-input", ref: this.rangeInputRef, className: cssClasses.input, type: "range", "aria-hidden": "true", min: min, max: max, step: step, tabIndex: -1, onChange: (e) => { handleRangeOnChange(e.nativeEvent); }, onPointerDown: (e) => { e.persist(); handleRangePointerDown(e.nativeEvent, this.control); }, onPointerUp: (e) => { handleRangePointerUp(e.nativeEvent, this.control); } });
5586
5561
  }
5587
5562
  getLabels() {
5588
5563
  const labels = [];
@@ -5913,8 +5888,8 @@
5913
5888
  }
5914
5889
  renderElement() {
5915
5890
  return (_$1("div", { className: this.question.cssClasses.root, ref: (root) => (this.setControl(root)) },
5916
- _$1("img", { className: this.question.cssClasses.bg, id: `${this.question.id}-bg`, src: this.question.imageLink, role: "presentation" }),
5917
- _$1("svg", { className: this.question.cssClasses.svg, id: `${this.question.id}-svg` })));
5891
+ _$1("img", { className: this.question.cssClasses.bg, id: `${this.question.renderedId}-bg`, src: this.question.imageLink, role: "presentation" }),
5892
+ _$1("svg", { className: this.question.cssClasses.svg, id: `${this.question.renderedId}-svg` })));
5918
5893
  }
5919
5894
  }
5920
5895
  ReactQuestionFactory.Instance.registerQuestion("imagemap", (props) => {
@@ -6148,7 +6123,7 @@
6148
6123
  getStateElement() {
6149
6124
  return this.item;
6150
6125
  }
6151
- render() {
6126
+ renderElement() {
6152
6127
  if (!this.item)
6153
6128
  return null;
6154
6129
  const text = this.renderLocString(this.item.locTitle, undefined, "locString");
@@ -6176,7 +6151,7 @@
6176
6151
  getStateElement() {
6177
6152
  return this.item;
6178
6153
  }
6179
- render() {
6154
+ renderElement() {
6180
6155
  var _a;
6181
6156
  if (!this.item)
6182
6157
  return null;
@@ -6201,6 +6176,7 @@
6201
6176
  _$1(Popup, { model: this.item.popupModel })));
6202
6177
  }
6203
6178
  componentDidMount() {
6179
+ super.componentDidMount();
6204
6180
  this.viewModel = new surveyCore.ActionDropdownViewModel(this.item);
6205
6181
  }
6206
6182
  componentWillUnmount() {
@@ -6228,14 +6204,29 @@
6228
6204
  return _$1(SurveySortBarLevel, props);
6229
6205
  });
6230
6206
 
6231
- class LogoImage extends x$2 {
6207
+ class LogoImage extends SurveyElementBase {
6232
6208
  constructor(props) {
6233
6209
  super(props);
6210
+ this.reactOnStrChanged = () => {
6211
+ this.setState({ locLogoLinkchanged: !!this.state && this.state.locLogoLink ? this.state.locLogoLink + 1 : 1 });
6212
+ };
6234
6213
  }
6235
6214
  get survey() {
6236
6215
  return this.props.data;
6237
6216
  }
6238
- render() {
6217
+ componentDidMount() {
6218
+ super.componentDidMount();
6219
+ this.survey.locLogo.onStringChanged.add(this.reactOnStrChanged);
6220
+ }
6221
+ componentDidUpdate(prevProps, prevState) {
6222
+ super.componentDidUpdate(prevProps, prevState);
6223
+ this.survey.locLogo.onStringChanged.add(this.reactOnStrChanged);
6224
+ }
6225
+ componentWillUnmount() {
6226
+ super.componentWillUnmount();
6227
+ this.survey.locLogo.onStringChanged.remove(this.reactOnStrChanged);
6228
+ }
6229
+ renderElement() {
6239
6230
  const content = [];
6240
6231
  content.push(_$1("div", { key: "logo-image", className: this.survey.logoClassNames },
6241
6232
  _$1("img", { className: this.survey.css.logoImage, src: this.survey.locLogo.renderedHtml || null, alt: this.survey.locTitle.renderedHtml, width: this.survey.renderedLogoWidth, height: this.survey.renderedLogoHeight, style: { objectFit: this.survey.logoFit, width: this.survey.renderedStyleLogoWidth, height: this.survey.renderedStyleLogoHeight } })));
@@ -6340,7 +6331,7 @@
6340
6331
  class Skeleton extends x$2 {
6341
6332
  render() {
6342
6333
  var _a, _b;
6343
- return (_$1("div", { className: "sv-skeleton-element", id: (_a = this.props.element) === null || _a === void 0 ? void 0 : _a.id, style: { height: (_b = this.props.element) === null || _b === void 0 ? void 0 : _b.skeletonHeight } }));
6334
+ return (_$1("div", { className: "sv-skeleton-element", id: (_a = this.props.element) === null || _a === void 0 ? void 0 : _a.renderedId, style: { height: (_b = this.props.element) === null || _b === void 0 ? void 0 : _b.skeletonHeight } }));
6344
6335
  }
6345
6336
  }
6346
6337
  ReactElementFactory.Instance.registerElement("sv-skeleton", (props) => {
@@ -6377,7 +6368,7 @@
6377
6368
  return _$1(CharacterCounterComponent, props);
6378
6369
  });
6379
6370
 
6380
- class HeaderMobile extends x$2 {
6371
+ class HeaderMobile extends SurveyElementBase {
6381
6372
  get model() {
6382
6373
  return this.props.model;
6383
6374
  }
@@ -6388,7 +6379,7 @@
6388
6379
  data: componentData,
6389
6380
  });
6390
6381
  }
6391
- render() {
6382
+ renderElement() {
6392
6383
  return (_$1("div", { className: "sv-header--mobile" },
6393
6384
  this.model.survey.hasLogo ? (_$1("div", { className: "sv-header__logo" }, this.renderLogoImage())) : null,
6394
6385
  this.model.survey.hasTitle ? (_$1("div", { className: "sv-header__title", style: { maxWidth: this.model.renderedTextAreaWidth } },
@@ -6397,7 +6388,7 @@
6397
6388
  _$1("div", { className: this.model.survey.css.description }, SurveyElementBase.renderLocString(this.model.survey.locDescription)))) : null));
6398
6389
  }
6399
6390
  }
6400
- class HeaderCell extends x$2 {
6391
+ class HeaderCell extends SurveyElementBase {
6401
6392
  get model() {
6402
6393
  return this.props.model;
6403
6394
  }
@@ -6408,7 +6399,7 @@
6408
6399
  data: componentData,
6409
6400
  });
6410
6401
  }
6411
- render() {
6402
+ renderElement() {
6412
6403
  return (_$1("div", { className: this.model.css, style: this.model.style },
6413
6404
  _$1("div", { className: "sv-header__cell-content", style: this.model.contentStyle },
6414
6405
  this.model.showLogo ? (_$1("div", { className: "sv-header__logo" }, this.renderLogoImage())) : null,
@@ -6441,6 +6432,9 @@
6441
6432
  this.model.backgroundImage ? _$1("div", { style: this.model.backgroundImageStyle, className: this.model.backgroundImageClasses }) : null,
6442
6433
  headerContent));
6443
6434
  }
6435
+ forceHiddenDependencies() {
6436
+ this.model.width;
6437
+ }
6444
6438
  componentDidMount() {
6445
6439
  super.componentDidMount();
6446
6440
  this.model.processResponsiveness();
@@ -6549,7 +6543,7 @@
6549
6543
  }
6550
6544
  };
6551
6545
  const preact = React;
6552
- surveyCore.checkLibraryVersion(`${"3.2.4"}`, "survey-js-ui");
6546
+ surveyCore.checkLibraryVersion(`${"3.2.5"}`, "survey-js-ui");
6553
6547
 
6554
6548
  Object.defineProperty(exports, 'Model', {
6555
6549
  enumerable: true,