survey-js-ui 1.12.56 → 1.12.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.3.11
2
+ * surveyjs - Survey JavaScript library v2.5.0
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
6
6
 
7
- import { SurveyModel, Helpers, createSvg, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, SvgRegistry, settings, createPopupModalViewModel, ScrollViewModel, addIconsToThemeSet, doKey2ClickBlur, doKey2ClickDown, Question, SurveyProgressModel, ProgressButtonsResponsivityManager, PopupSurveyModel, ButtonGroupItemModel, LocalizableString, checkLibraryVersion } from 'survey-core';
7
+ import { SurveyModel, Helpers, createSvg, LocalizableString, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, SvgRegistry, settings, createPopupModalViewModel, ScrollViewModel, addIconsToThemeSet, doKey2ClickBlur, doKey2ClickDown, Question, SurveyProgressModel, ProgressButtonsResponsivityManager, PopupSurveyModel, ButtonGroupItemModel, checkLibraryVersion } from 'survey-core';
8
8
  export { SurveyModel as Model, SurveyModel, SurveyWindowModel, settings, surveyLocalization, surveyStrings } from 'survey-core';
9
9
 
10
10
  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=true)&&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||false===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=true),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=false),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=true,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=true,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(false),a$1=F$2(true),h$1=0;
@@ -145,7 +145,7 @@ class SurveyElementBase extends x$2 {
145
145
  return ReactElementFactory.Instance.createElement(locStr.renderAs, {
146
146
  locStr: locStr.renderAsData,
147
147
  style: style,
148
- key: key,
148
+ key: key
149
149
  });
150
150
  }
151
151
  static renderQuestionDescription(question) {
@@ -156,20 +156,16 @@ class SurveyElementBase extends x$2 {
156
156
  super(props);
157
157
  this._allowComponentUpdate = true;
158
158
  this.prevStateElements = [];
159
- this.propertyValueChangedHandler = (hash, key, val) => {
160
- if (hash[key] !== val) {
161
- hash[key] = val;
162
- if (!this.canUsePropInState(key))
163
- return;
164
- if (this.isRendering)
165
- return;
166
- this.changedStatePropNameValue = key;
167
- this.setState((state) => {
168
- var newState = {};
169
- newState[key] = val;
170
- return newState;
171
- });
172
- }
159
+ this.propertyValueChangedHandler = (stateElement, options) => {
160
+ const key = options.name;
161
+ if (!this.canUsePropInState(key) || this.isRendering)
162
+ return;
163
+ this.changedStatePropNameValue = key;
164
+ this.setState((state) => {
165
+ var newState = {};
166
+ newState[key] = options.newValue;
167
+ return newState;
168
+ });
173
169
  };
174
170
  this.onArrayChangedCallback = (stateElement, options) => {
175
171
  if (this.isRendering)
@@ -295,22 +291,11 @@ class SurveyElementBase extends x$2 {
295
291
  canMakeReact(stateElement) {
296
292
  return !!stateElement && !!stateElement.iteratePropertiesHash;
297
293
  }
298
- isCurrentStateElement(stateElement) {
299
- return !!stateElement && !!stateElement.setPropertyValueCoreHandler && stateElement.setPropertyValueCoreHandler === this.propertyValueChangedHandler;
300
- }
301
294
  makeBaseElementReact(stateElement) {
302
295
  if (!this.canMakeReact(stateElement))
303
296
  return;
304
- stateElement.iteratePropertiesHash((hash, key) => {
305
- if (!this.canUsePropInState(key))
306
- return;
307
- var val = hash[key];
308
- if (Array.isArray(val)) {
309
- var val = val;
310
- stateElement.addOnArrayChangedCallback(val, this.onArrayChangedCallback);
311
- }
312
- });
313
- stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
297
+ stateElement.addOnArrayChangedCallback(this.onArrayChangedCallback);
298
+ stateElement.addOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
314
299
  }
315
300
  canUsePropInState(key) {
316
301
  return true;
@@ -318,15 +303,8 @@ class SurveyElementBase extends x$2 {
318
303
  unMakeBaseElementReact(stateElement) {
319
304
  if (!this.canMakeReact(stateElement))
320
305
  return;
321
- if (!this.isCurrentStateElement(stateElement)) ;
322
- stateElement.setPropertyValueCoreHandler = undefined;
323
- stateElement.iteratePropertiesHash((hash, key) => {
324
- var val = hash[key];
325
- if (Array.isArray(val)) {
326
- var val = val;
327
- stateElement.removeOnArrayChangedCallback(val, this.onArrayChangedCallback);
328
- }
329
- });
306
+ stateElement.removeOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
307
+ stateElement.removeOnArrayChangedCallback(this.onArrayChangedCallback);
330
308
  }
331
309
  }
332
310
  class ReactSurveyElement extends SurveyElementBase {
@@ -495,6 +473,65 @@ ReactElementFactory.Instance.registerElement("sv-action-bar-separator", (props)
495
473
  return _$1(SurveyActionBarSeparator, props);
496
474
  });
497
475
 
476
+ class SurveyLocStringViewer extends x$2 {
477
+ constructor(props) {
478
+ super(props);
479
+ this.onChangedHandler = (sender, options) => {
480
+ if (this.isRendering)
481
+ return;
482
+ this.setState({ changed: !!this.state && this.state.changed ? this.state.changed + 1 : 1 });
483
+ };
484
+ this.rootRef = b$1();
485
+ }
486
+ get locStr() {
487
+ return this.props.locStr;
488
+ }
489
+ get style() {
490
+ return this.props.style;
491
+ }
492
+ get textClass() {
493
+ return this.props.textClass;
494
+ }
495
+ componentDidMount() {
496
+ this.reactOnStrChanged();
497
+ }
498
+ componentWillUnmount() {
499
+ if (!this.locStr)
500
+ return;
501
+ this.locStr.onStringChanged.remove(this.onChangedHandler);
502
+ }
503
+ componentDidUpdate(prevProps, prevState) {
504
+ if (!!prevProps.locStr) {
505
+ prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
506
+ }
507
+ this.reactOnStrChanged();
508
+ }
509
+ reactOnStrChanged() {
510
+ if (!this.locStr)
511
+ return;
512
+ this.locStr.onStringChanged.add(this.onChangedHandler);
513
+ }
514
+ render() {
515
+ if (!this.locStr)
516
+ return null;
517
+ this.isRendering = true;
518
+ const strEl = this.renderString();
519
+ this.isRendering = false;
520
+ return strEl;
521
+ }
522
+ renderString() {
523
+ const className = this.locStr.getStringViewerClassName(this.textClass);
524
+ if (this.locStr.hasHtml) {
525
+ let htmlValue = { __html: this.locStr.renderedHtml };
526
+ return _$1("span", { ref: this.rootRef, className: className, style: this.style, dangerouslySetInnerHTML: htmlValue });
527
+ }
528
+ return _$1("span", { ref: this.rootRef, className: className, style: this.style }, this.locStr.renderedHtml);
529
+ }
530
+ }
531
+ ReactElementFactory.Instance.registerElement(LocalizableString.defaultRenderer, (props) => {
532
+ return _$1(SurveyLocStringViewer, props);
533
+ });
534
+
498
535
  class SurveyAction extends SurveyElementBase {
499
536
  constructor(props) {
500
537
  super(props);
@@ -513,7 +550,7 @@ class SurveyAction extends SurveyElementBase {
513
550
  const itemComponent = ReactElementFactory.Instance.createElement(this.item.component || "sv-action-bar-item", {
514
551
  item: this.item,
515
552
  });
516
- return (_$1("div", { className: itemClass, id: this.item.id, ref: this.ref },
553
+ return (_$1("div", { className: itemClass, id: "" + this.item.uniqueId, ref: this.ref },
517
554
  _$1("div", { className: "sv-action__content" },
518
555
  separator,
519
556
  itemComponent)));
@@ -555,8 +592,7 @@ class SurveyActionBarItem extends SurveyElementBase {
555
592
  renderText() {
556
593
  if (!this.item.hasTitle)
557
594
  return null;
558
- const titleClass = this.item.getActionBarItemTitleCss();
559
- return _$1("span", { className: titleClass }, this.item.title);
595
+ return _$1(SurveyLocStringViewer, { locStr: this.item.locTitle, textClass: this.item.getActionBarItemTitleCss() });
560
596
  }
561
597
  renderButtonContent() {
562
598
  const text = this.renderText();
@@ -1131,7 +1167,7 @@ class PopupModal extends SurveyElementBase {
1131
1167
  PopupModal.modalDescriptors = [];
1132
1168
 
1133
1169
  /*!
1134
- * surveyjs - Survey JavaScript library v2.3.11
1170
+ * surveyjs - Survey JavaScript library v2.5.0
1135
1171
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1136
1172
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1137
1173
  */
@@ -1201,7 +1237,7 @@ var iconsV1 = {
1201
1237
  };
1202
1238
 
1203
1239
  /*!
1204
- * surveyjs - Survey JavaScript library v2.3.11
1240
+ * surveyjs - Survey JavaScript library v2.5.0
1205
1241
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1206
1242
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1207
1243
  */
@@ -1792,11 +1828,12 @@ class SurveyRow extends SurveyElementBase {
1792
1828
  this.row.isNeedRender = !this.row.isLazyRendering();
1793
1829
  }
1794
1830
  componentWillUnmount() {
1795
- const isCurrentStateElement = this.isCurrentStateElement(this.getStateElement());
1796
1831
  super.componentWillUnmount();
1797
- if (isCurrentStateElement) {
1798
- this.row.setRootElement(undefined);
1799
- this.stopLazyRendering();
1832
+ if (!!this.row) {
1833
+ if (!this.row.hasActiveUISubscribers) {
1834
+ this.row.setRootElement(undefined);
1835
+ this.stopLazyRendering();
1836
+ }
1800
1837
  }
1801
1838
  }
1802
1839
  createElement(element, elementIndex) {
@@ -2298,8 +2335,6 @@ class SurveyQuestion extends SurveyElementBase {
2298
2335
  _$1(SurveyQuestionCommentItem, { question: this.question, cssClasses: cssClasses, isDisplayMode: this.question.isInputReadOnly })));
2299
2336
  }
2300
2337
  renderHeader(question) {
2301
- if (question.singleInputHideHeader)
2302
- return null;
2303
2338
  return _$1(SurveyElementHeader, { element: question });
2304
2339
  }
2305
2340
  renderErrors(cssClasses, location) {
@@ -3746,15 +3781,18 @@ class SurveyQuestionFile extends SurveyQuestionElementBase {
3746
3781
  const video = this.question.isPlayingVideo ? this.renderVideo() : null;
3747
3782
  const fileDecorator = this.question.showFileDecorator ? this.renderFileDecorator() : null;
3748
3783
  const fileNavigator = this.question.fileNavigatorVisible ? (_$1(SurveyActionBar, { model: this.question.fileNavigator })) : null;
3784
+ const acceptedTypes = this.question.renderedAcceptedTypes;
3785
+ const className = !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss();
3786
+ const style = this.isDisplayMode ? { color: "transparent" } : {};
3749
3787
  let fileInput;
3750
3788
  if (this.question.isReadOnlyAttr) {
3751
- fileInput = _$1("input", { readOnly: true, type: "file", className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: input => (this.setControl(input)), style: !this.isDisplayMode ? {} : { color: "transparent" }, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: this.question.acceptedTypes });
3789
+ fileInput = _$1("input", { readOnly: true, type: "file", className: className, id: this.question.inputId, ref: input => (this.setControl(input)), style: style, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: acceptedTypes });
3752
3790
  }
3753
3791
  else if (this.question.isDisabledAttr) {
3754
- fileInput = _$1("input", { disabled: true, type: "file", className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: input => (this.setControl(input)), style: !this.isDisplayMode ? {} : { color: "transparent" }, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: this.question.acceptedTypes });
3792
+ fileInput = _$1("input", { disabled: true, type: "file", className: className, id: this.question.inputId, ref: input => (this.setControl(input)), style: style, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: acceptedTypes });
3755
3793
  }
3756
3794
  else if (this.question.hasFileUI) {
3757
- fileInput = _$1("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: input => (this.setControl(input)), style: !this.isDisplayMode ? {} : { color: "transparent" }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: this.question.acceptedTypes, capture: this.question.renderCapture });
3795
+ fileInput = _$1("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: className, id: this.question.inputId, ref: input => (this.setControl(input)), style: style, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: acceptedTypes, capture: this.question.renderCapture });
3758
3796
  }
3759
3797
  else {
3760
3798
  fileInput = null;
@@ -3860,7 +3898,7 @@ class SurveyFileItem extends SurveyElementBase {
3860
3898
  return (_$1("div", { className: className },
3861
3899
  _$1("a", { href: val.content, onClick: event => {
3862
3900
  this.question.doDownloadFile(event, val);
3863
- }, title: val.name, download: val.name, style: { width: this.question.imageWidth } }, val.name)));
3901
+ }, title: val.name, download: val.name, target: "_blank", rel: "noreferrer", style: { width: this.question.imageWidth } }, val.name)));
3864
3902
  }
3865
3903
  renderElement() {
3866
3904
  const val = this.item;
@@ -4276,7 +4314,7 @@ class MatrixRow extends SurveyElementBase {
4276
4314
  const model = this.model;
4277
4315
  if (!model.visible)
4278
4316
  return null;
4279
- return (_$1("tr", { ref: this.root, className: model.className, "data-sv-drop-target-matrix-row": model.dropTargetId, onPointerDown: (event) => this.onPointerDownHandler(event) }, this.props.children));
4317
+ return (_$1("tr", { ref: this.root, className: model.className, "data-sv-drop-target-matrix-row": model.dropTargetId }, this.props.children));
4280
4318
  }
4281
4319
  }
4282
4320
  ReactElementFactory.Instance.registerElement("sv-matrix-row", (props) => {
@@ -4287,8 +4325,11 @@ class SurveyQuestionMatrixDynamicDragDropIcon extends ReactSurveyElement {
4287
4325
  get question() {
4288
4326
  return this.props.item.data.question;
4289
4327
  }
4328
+ get row() {
4329
+ return this.props.item.data.row;
4330
+ }
4290
4331
  renderElement() {
4291
- return _$1("div", null, this.renderIcon());
4332
+ return _$1("div", { onPointerDown: (event) => { this.question.onPointerDown(event.nativeEvent, this.row); } }, this.renderIcon());
4292
4333
  }
4293
4334
  renderIcon() {
4294
4335
  if (this.question.iconDragElement) {
@@ -5265,14 +5306,14 @@ class SurveyQuestionSlider extends SurveyQuestionElementBase {
5265
5306
  return thumb;
5266
5307
  }
5267
5308
  getInput(i) {
5268
- const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, renderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur } = this.question;
5309
+ const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, renderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur, id } = this.question;
5269
5310
  const value = renderedValue[i];
5270
- const input = _$1("input", { className: cssClasses.input, 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 });
5311
+ 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 });
5271
5312
  return input;
5272
5313
  }
5273
5314
  getRangeInput() {
5274
- const { renderedMax: max, renderedMin: min, step, cssClasses, handleRangeOnChange, handleRangePointerDown, handleRangePointerUp } = this.question;
5275
- return _$1("input", { name: "range-input", 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); } });
5315
+ const { renderedMax: max, renderedMin: min, step, cssClasses, handleRangeOnChange, handleRangePointerDown, handleRangePointerUp, id } = this.question;
5316
+ 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); } });
5276
5317
  }
5277
5318
  getLabels() {
5278
5319
  const labels = [];
@@ -5992,62 +6033,6 @@ ReactElementFactory.Instance.registerElement("sv-nav-btn", (props) => {
5992
6033
  return _$1(SurveyNavigationButton, props);
5993
6034
  });
5994
6035
 
5995
- class SurveyLocStringViewer extends x$2 {
5996
- constructor(props) {
5997
- super(props);
5998
- this.onChangedHandler = (sender, options) => {
5999
- if (this.isRendering)
6000
- return;
6001
- this.setState({ changed: !!this.state && this.state.changed ? this.state.changed + 1 : 1 });
6002
- };
6003
- this.rootRef = b$1();
6004
- }
6005
- get locStr() {
6006
- return this.props.locStr;
6007
- }
6008
- get style() {
6009
- return this.props.style;
6010
- }
6011
- componentDidMount() {
6012
- this.reactOnStrChanged();
6013
- }
6014
- componentWillUnmount() {
6015
- if (!this.locStr)
6016
- return;
6017
- this.locStr.onStringChanged.remove(this.onChangedHandler);
6018
- }
6019
- componentDidUpdate(prevProps, prevState) {
6020
- if (!!prevProps.locStr) {
6021
- prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
6022
- }
6023
- this.reactOnStrChanged();
6024
- }
6025
- reactOnStrChanged() {
6026
- if (!this.locStr)
6027
- return;
6028
- this.locStr.onStringChanged.add(this.onChangedHandler);
6029
- }
6030
- render() {
6031
- if (!this.locStr)
6032
- return null;
6033
- this.isRendering = true;
6034
- const strEl = this.renderString();
6035
- this.isRendering = false;
6036
- return strEl;
6037
- }
6038
- renderString() {
6039
- const className = this.locStr.allowLineBreaks ? "sv-string-viewer sv-string-viewer--multiline" : "sv-string-viewer";
6040
- if (this.locStr.hasHtml) {
6041
- let htmlValue = { __html: this.locStr.renderedHtml };
6042
- return _$1("span", { ref: this.rootRef, className: className, style: this.style, dangerouslySetInnerHTML: htmlValue });
6043
- }
6044
- return _$1("span", { ref: this.rootRef, className: className, style: this.style }, this.locStr.renderedHtml);
6045
- }
6046
- }
6047
- ReactElementFactory.Instance.registerElement(LocalizableString.defaultRenderer, (props) => {
6048
- return _$1(SurveyLocStringViewer, props);
6049
- });
6050
-
6051
6036
  class QuestionErrorComponent extends x$2 {
6052
6037
  render() {
6053
6038
  const error = this.props.error;
@@ -6280,7 +6265,7 @@ SurveyModel.prototype["render"] = function (element = null) {
6280
6265
  }
6281
6266
  };
6282
6267
  const preact = React;
6283
- checkLibraryVersion(`${"2.3.11"}`, "survey-js-ui");
6268
+ checkLibraryVersion(`${"2.5.0"}`, "survey-js-ui");
6284
6269
 
6285
6270
  export { CharacterCounterComponent, O as Children, x$2 as Component, ComponentsContainer, k$2 as Fragment, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, N as PureComponent, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, SliderLabelItem, Cn as StrictMode, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, SurveyFileItem, SurveyFilePreview, SurveyFlowPanel, SurveyHeader, SurveyLocStringEditor, SurveyLocStringViewer, SurveyNavigationBase, SurveyNavigationButton, SurveyPage, SurveyPanel, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestion, SurveyQuestionAndErrorsCell, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionButtonGroup, SurveyQuestionButtonGroupDropdown, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionComment, SurveyQuestionCommentItem, SurveyQuestionComposite, SurveyQuestionCustom, SurveyQuestionDropdown, SurveyQuestionDropdownBase, SurveyQuestionDropdownSelect, SurveyQuestionElementBase, SurveyQuestionEmpty, SurveyQuestionExpression, SurveyQuestionFile, SurveyQuestionHtml, SurveyQuestionImage, SurveyQuestionImagePicker, SurveyQuestionMatrix, SurveyQuestionMatrixCell, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixRow, SurveyQuestionMultipleText, SurveyQuestionOptionItem, SurveyQuestionPanelDynamic, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicProgressText, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionRadioItem, SurveyQuestionRadiogroup, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionSignaturePad, SurveyQuestionSlider, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, P as Suspense, B as SuspenseList, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click, _n as cloneElement, Q$1 as createContext, _$1 as createElement, dn as createFactory, $ as createPortal, b$1 as createRef, Sn as findDOMNode, En as flushSync, D as forwardRef, tn as hydrate, pn as isFragment, yn as isMemo, mn as isValidElement, z as lazy, M as memo, preact, nn as render, renderPopupSurvey, renderSurvey, R as startTransition, bn as unmountComponentAtNode, gn as unstable_batchedUpdates, q$1 as useCallback, x$1 as useContext, P$1 as useDebugValue, w as useDeferredValue, y as useEffect, g$1 as useId, F$1 as useImperativeHandle, I as useInsertionEffect, _ as useLayoutEffect, T$1 as useMemo, h as useReducer, A$1 as useRef, d as useState, C as useSyncExternalStore, k as useTransition, vn as version };
6286
6271
  //# sourceMappingURL=survey-js-ui.mjs.map