survey-react-ui 2.0.10 → 2.1.1

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,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.0.10
2
+ * surveyjs - Survey JavaScript library v2.1.1
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
  */
@@ -1925,7 +1925,7 @@ class PopupModal extends SurveyElementBase {
1925
1925
  PopupModal.modalDescriptors = [];
1926
1926
 
1927
1927
  /*!
1928
- * surveyjs - Survey JavaScript library v2.0.10
1928
+ * surveyjs - Survey JavaScript library v2.1.1
1929
1929
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1930
1930
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1931
1931
  */
@@ -1995,7 +1995,7 @@ var iconsV1 = {
1995
1995
  };
1996
1996
 
1997
1997
  /*!
1998
- * surveyjs - Survey JavaScript library v2.0.10
1998
+ * surveyjs - Survey JavaScript library v2.1.1
1999
1999
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
2000
2000
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
2001
2001
  */
@@ -2479,7 +2479,7 @@ class SurveyPanel extends SurveyPanelBase {
2479
2479
  }
2480
2480
  renderContent(style, rows, className) {
2481
2481
  const bottom = this.renderBottom();
2482
- return (React.createElement("div", { style: style, className: className, id: this.panel.contentId },
2482
+ return (React.createElement("div", { style: style, className: className, id: this.panel.contentId, role: this.panel.ariaRole, "aria-labelledby": this.panel.ariaLabelledBy, "aria-label": this.panel.ariaLabel },
2483
2483
  rows,
2484
2484
  bottom));
2485
2485
  }
@@ -2744,6 +2744,9 @@ class SurveyQuestionCheckboxItem extends ReactSurveyElement {
2744
2744
  get hideCaption() {
2745
2745
  return this.props.hideCaption === true;
2746
2746
  }
2747
+ get ariaLabel() {
2748
+ return this.props.ariaLabel || null;
2749
+ }
2747
2750
  componentDidUpdate(prevProps, prevState) {
2748
2751
  super.componentDidUpdate(prevProps, prevState);
2749
2752
  if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
@@ -2780,7 +2783,7 @@ class SurveyQuestionCheckboxItem extends ReactSurveyElement {
2780
2783
  const itemLabel = !this.hideCaption ? React.createElement("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
2781
2784
  return (React.createElement("div", { className: itemClass, role: "presentation", ref: this.rootRef },
2782
2785
  React.createElement("label", { className: labelClass },
2783
- React.createElement("input", { className: this.cssClasses.itemControl, type: "checkbox", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, required: this.question.hasRequiredError() }),
2786
+ React.createElement("input", { className: this.cssClasses.itemControl, type: "checkbox", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, required: this.question.hasRequiredError(), "aria-label": this.ariaLabel }),
2784
2787
  this.cssClasses.materialDecorator ?
2785
2788
  React.createElement("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
2786
2789
  React.createElement("svg", { className: this.cssClasses.itemDecorator },
@@ -3159,6 +3162,9 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3159
3162
  this.question.onFocus(event);
3160
3163
  };
3161
3164
  }
3165
+ get dropdownListModel() {
3166
+ return this.question["dropdownListModel"];
3167
+ }
3162
3168
  getStateElement() {
3163
3169
  return this.question["dropdownListModel"];
3164
3170
  }
@@ -3170,7 +3176,7 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3170
3176
  }
3171
3177
  renderReadOnlyElement() {
3172
3178
  if (this.question.locReadOnlyText) {
3173
- return this.renderLocString(this.question.locReadOnlyText);
3179
+ return (React.createElement("div", { className: this.question.cssClasses.controlValue }, this.renderLocString(this.question.locReadOnlyText)));
3174
3180
  }
3175
3181
  else {
3176
3182
  return null;
@@ -3178,32 +3184,33 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3178
3184
  }
3179
3185
  renderSelect(cssClasses) {
3180
3186
  let selectElement = null;
3181
- const dropdownListModel = this.question.dropdownListModel;
3187
+ const dropdownListModel = this.dropdownListModel;
3182
3188
  if (this.question.isReadOnly) {
3183
3189
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3184
3190
  // @ts-ignore
3185
- selectElement = React.createElement("div", { id: this.question.inputId, role: dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionRole, "aria-label": dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionLabel, "aria-labelledby": dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionLabelledby, "aria-describedby": dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionDescribedby, "aria-expanded": "false", "aria-readonly": "true", "aria-disabled": "true", tabIndex: this.question.isDisabledAttr ? undefined : 0, className: this.question.getControlClass(), ref: (div) => (this.setControl(div)) }, this.renderReadOnlyElement());
3191
+ selectElement = React.createElement("div", { id: this.question.inputId, role: dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionRole, "aria-label": dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionLabel, "aria-labelledby": dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionLabelledby, "aria-describedby": dropdownListModel === null || dropdownListModel === void 0 ? void 0 : dropdownListModel.ariaQuestionDescribedby, "aria-expanded": "false", "aria-readonly": "true", "aria-disabled": "true", tabIndex: this.question.isDisabledAttr ? undefined : 0, className: this.question.getControlClass(), ref: (div) => (this.setControl(div)) },
3192
+ this.renderReadOnlyElement(),
3193
+ this.renderEditorButtons());
3186
3194
  }
3187
3195
  else {
3188
3196
  selectElement = React.createElement(React.Fragment, null,
3189
- this.renderInput(dropdownListModel),
3197
+ this.renderInput(),
3190
3198
  React.createElement(Popup, { model: dropdownListModel.popupModel }));
3191
3199
  }
3192
- return (React.createElement("div", { className: cssClasses.selectWrapper, onClick: this.click },
3193
- selectElement,
3194
- this.createChevronButton()));
3200
+ return (React.createElement("div", { className: cssClasses.selectWrapper, onClick: this.click }, selectElement));
3195
3201
  }
3196
- renderValueElement(dropdownListModel) {
3202
+ renderValueElement() {
3197
3203
  if (this.question.showInputFieldComponent) {
3198
- return ReactElementFactory.Instance.createElement(this.question.inputFieldComponentName, { item: dropdownListModel.getSelectedAction(), question: this.question });
3204
+ return ReactElementFactory.Instance.createElement(this.question.inputFieldComponentName, { item: this.dropdownListModel.getSelectedAction(), question: this.question });
3199
3205
  }
3200
3206
  else if (this.question.showSelectedItemLocText) {
3201
3207
  return this.renderLocString(this.question.selectedItemLocText);
3202
3208
  }
3203
3209
  return null;
3204
3210
  }
3205
- renderInput(dropdownListModel) {
3206
- let valueElement = this.renderValueElement(dropdownListModel);
3211
+ renderInput() {
3212
+ const dropdownListModel = this.dropdownListModel;
3213
+ let valueElement = this.renderValueElement();
3207
3214
  const { root } = settings.environment;
3208
3215
  const onInputChange = (e) => {
3209
3216
  if (e.target === root.activeElement) {
@@ -3224,25 +3231,15 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3224
3231
  React.createElement("span", null, dropdownListModel.hintStringSuffix))) : null,
3225
3232
  valueElement,
3226
3233
  React.createElement("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: (element) => (this.inputElement = element), className: this.question.cssClasses.filterStringInput, role: dropdownListModel.ariaInputRole, "aria-required": dropdownListModel.ariaInputRequired, "aria-invalid": dropdownListModel.ariaInputInvalid, "aria-errormessage": dropdownListModel.ariaInputErrorMessage, "aria-expanded": dropdownListModel.ariaInputExpanded, "aria-label": dropdownListModel.ariaInputLabel, "aria-labelledby": dropdownListModel.ariaInputLabelledby, "aria-describedby": dropdownListModel.ariaInputDescribedby, "aria-controls": dropdownListModel.ariaInputControls, "aria-activedescendant": dropdownListModel.ariaInputActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: dropdownListModel.filterReadOnly ? true : undefined, tabIndex: dropdownListModel.noTabIndex ? undefined : -1, disabled: this.question.isDisabledAttr, inputMode: dropdownListModel.inputMode, onChange: (e) => { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
3227
- this.createClearButton()));
3228
- }
3229
- createClearButton() {
3230
- if (!this.question.allowClear || !this.question.cssClasses.cleanButtonIconId)
3231
- return null;
3232
- const style = { display: !this.question.showClearButton ? "none" : "" };
3233
- return (React.createElement("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear, "aria-hidden": "true" },
3234
- React.createElement(SvgIcon, { className: this.question.cssClasses.cleanButtonSvg, iconName: this.question.cssClasses.cleanButtonIconId, title: this.question.clearCaption, size: "auto" })));
3235
- }
3236
- createChevronButton() {
3237
- if (!this.question.cssClasses.chevronButtonIconId)
3238
- return null;
3239
- return (React.createElement("div", { className: this.question.cssClasses.chevronButton, "aria-hidden": "true", onPointerDown: this.chevronPointerDown },
3240
- React.createElement(SvgIcon, { className: this.question.cssClasses.chevronButtonSvg, iconName: this.question.cssClasses.chevronButtonIconId, size: "auto" })));
3234
+ this.renderEditorButtons()));
3241
3235
  }
3242
3236
  renderOther(cssClasses) {
3243
3237
  return (React.createElement("div", { className: this.question.getCommentAreaCss(true) },
3244
3238
  React.createElement(SurveyQuestionOtherValueItem, { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode, isOther: true })));
3245
3239
  }
3240
+ renderEditorButtons() {
3241
+ return React.createElement(SurveyActionBar, { model: this.dropdownListModel.editorButtons });
3242
+ }
3246
3243
  componentDidUpdate(prevProps, prevState) {
3247
3244
  super.componentDidUpdate(prevProps, prevState);
3248
3245
  this.updateInputDomElement();
@@ -3318,8 +3315,8 @@ class SurveyQuestionTagbox extends SurveyQuestionDropdownBase {
3318
3315
  const renderedItem = (React.createElement(SurveyQuestionTagboxItem, { key: key, question: this.question, item: item }));
3319
3316
  return renderedItem;
3320
3317
  }
3321
- renderInput(dropdownListModel) {
3322
- const dropdownMultiSelectListModel = dropdownListModel;
3318
+ renderInput() {
3319
+ const dropdownListModel = this.dropdownListModel;
3323
3320
  const items = this.question.selectedChoices.map((choice, index) => { return this.renderItem("item" + index, choice); });
3324
3321
  return (React.createElement("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
3325
3322
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3327,8 +3324,8 @@ class SurveyQuestionTagbox extends SurveyQuestionDropdownBase {
3327
3324
  disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: dropdownListModel.ariaQuestionRole, "aria-required": dropdownListModel.ariaQuestionRequired, "aria-invalid": dropdownListModel.ariaQuestionInvalid, "aria-errormessage": dropdownListModel.ariaQuestionErrorMessage, "aria-label": dropdownListModel.ariaQuestionLabel, "aria-labelledby": dropdownListModel.ariaQuestionLabelledby, "aria-describedby": dropdownListModel.ariaQuestionDescribedby, "aria-expanded": dropdownListModel.ariaQuestionExpanded, "aria-controls": dropdownListModel.ariaQuestionControls, "aria-activedescendant": dropdownListModel.ariaQuestionActivedescendant, ref: (div) => (this.setControl(div)) },
3328
3325
  React.createElement("div", { className: this.question.cssClasses.controlValue },
3329
3326
  items,
3330
- React.createElement(TagboxFilterString, { model: dropdownMultiSelectListModel, question: this.question })),
3331
- this.createClearButton()));
3327
+ React.createElement(TagboxFilterString, { model: dropdownListModel, question: this.question })),
3328
+ this.renderEditorButtons()));
3332
3329
  }
3333
3330
  renderElement() {
3334
3331
  const cssClasses = this.question.cssClasses;
@@ -3338,14 +3335,6 @@ class SurveyQuestionTagbox extends SurveyQuestionDropdownBase {
3338
3335
  select,
3339
3336
  comment));
3340
3337
  }
3341
- renderReadOnlyElement() {
3342
- if (this.question.locReadOnlyText) {
3343
- return this.renderLocString(this.question.locReadOnlyText);
3344
- }
3345
- else {
3346
- return null;
3347
- }
3348
- }
3349
3338
  }
3350
3339
  ReactQuestionFactory.Instance.registerQuestion("tagbox", (props) => {
3351
3340
  return React.createElement(SurveyQuestionTagbox, props);
@@ -3373,6 +3362,12 @@ class SurveyQuestionDropdownSelect extends SurveyQuestionDropdown {
3373
3362
  selectElement,
3374
3363
  this.createChevronButton()));
3375
3364
  }
3365
+ createChevronButton() {
3366
+ if (!this.question.cssClasses.chevronButtonIconId)
3367
+ return null;
3368
+ return (React.createElement("div", { className: this.question.cssClasses.chevronButton, "aria-hidden": "true", onPointerDown: this.chevronPointerDown },
3369
+ React.createElement(SvgIcon, { className: this.question.cssClasses.chevronButtonSvg, iconName: this.question.cssClasses.chevronButtonIconId, size: "auto" })));
3370
+ }
3376
3371
  }
3377
3372
  ReactQuestionFactory.Instance.registerQuestion("sv-dropdown-select", (props) => {
3378
3373
  return React.createElement(SurveyQuestionDropdownSelect, props);
@@ -3559,7 +3554,7 @@ class SurveyQuestionMatrixCell extends ReactSurveyElement {
3559
3554
  mobileSpan));
3560
3555
  }
3561
3556
  renderInput(inputId, isChecked) {
3562
- return (React.createElement("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: this.row.fullName, value: this.column.value, disabled: this.row.isDisabledAttr, readOnly: this.row.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.getCellAriaLabel(this.row.locText.renderedHtml, this.column.locText.renderedHtml), "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }));
3557
+ return (React.createElement("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: this.row.fullName, value: this.column.value, disabled: this.row.isDisabledAttr, readOnly: this.row.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.getCellAriaLabel(this.row, this.column), "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }));
3563
3558
  }
3564
3559
  }
3565
3560
  ReactElementFactory.Instance.registerElement("survey-matrix-cell", props => {
@@ -3943,6 +3938,9 @@ class SurveyQuestionRadioItem extends ReactSurveyElement {
3943
3938
  get hideCaption() {
3944
3939
  return this.props.hideCaption === true;
3945
3940
  }
3941
+ get ariaLabel() {
3942
+ return this.props.ariaLabel || null;
3943
+ }
3946
3944
  shouldComponentUpdate(nextProps, nextState) {
3947
3945
  if (!super.shouldComponentUpdate(nextProps, nextState))
3948
3946
  return false;
@@ -3980,7 +3978,7 @@ class SurveyQuestionRadioItem extends ReactSurveyElement {
3980
3978
  const itemLabel = !this.hideCaption ? React.createElement("span", { className: controlLabelClass }, this.renderLocString(this.item.locText, this.textStyle)) : null;
3981
3979
  return (React.createElement("div", { className: itemClass, role: "presentation", ref: this.rootRef },
3982
3980
  React.createElement("label", { onMouseDown: this.handleOnMouseDown, className: labelClass },
3983
- React.createElement("input", { "aria-errormessage": this.question.ariaErrormessage, className: this.cssClasses.itemControl, id: this.question.getItemId(this.item), type: "radio", name: this.question.questionName, checked: this.isChecked, value: this.item.value, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange }),
3981
+ React.createElement("input", { "aria-errormessage": this.question.ariaErrormessage, className: this.cssClasses.itemControl, id: this.question.getItemId(this.item), type: "radio", name: this.question.questionName, checked: this.isChecked, value: this.item.value, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange, "aria-label": this.ariaLabel }),
3984
3982
  this.cssClasses.materialDecorator ?
3985
3983
  React.createElement("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
3986
3984
  React.createElement("svg", { className: this.cssClasses.itemDecorator },
@@ -4601,11 +4599,14 @@ class SurveyQuestionMatrixDropdownCell extends SurveyQuestionAndErrorsCell {
4601
4599
  }
4602
4600
  renderCellCheckboxButton() {
4603
4601
  var key = this.cell.question.id + "item" + this.cell.choiceIndex;
4604
- return (React.createElement(SurveyQuestionCheckboxItem, { key: key, question: this.cell.question, cssClasses: this.cell.question.cssClasses, isDisplayMode: this.cell.question.isInputReadOnly, item: this.cell.item, isFirst: this.cell.isFirstChoice, index: this.cell.choiceIndex.toString(), hideCaption: true }));
4602
+ return (React.createElement(SurveyQuestionCheckboxItem, { key: key, question: this.cell.question, cssClasses: this.cell.question.cssClasses, isDisplayMode: this.cell.question.isInputReadOnly, item: this.cell.item, isFirst: this.cell.isFirstChoice, index: this.cell.choiceIndex.toString(), hideCaption: true, ariaLabel: this.getCellAriaLabel() }));
4605
4603
  }
4606
4604
  renderCellRadiogroupButton() {
4607
4605
  var key = this.cell.question.id + "item" + this.cell.choiceIndex;
4608
- return (React.createElement(SurveyQuestionRadioItem, { key: key, question: this.cell.question, cssClasses: this.cell.question.cssClasses, isDisplayMode: this.cell.question.isInputReadOnly, item: this.cell.item, index: this.cell.choiceIndex.toString(), isChecked: this.cell.question.value === this.cell.item.value, isDisabled: this.cell.question.isReadOnly || !this.cell.item.isEnabled, hideCaption: true }));
4606
+ return (React.createElement(SurveyQuestionRadioItem, { key: key, question: this.cell.question, cssClasses: this.cell.question.cssClasses, isDisplayMode: this.cell.question.isInputReadOnly, item: this.cell.item, index: this.cell.choiceIndex.toString(), isChecked: this.cell.question.value === this.cell.item.value, isDisabled: this.cell.question.isReadOnly || !this.cell.item.isEnabled, hideCaption: true, ariaLabel: this.getCellAriaLabel() }));
4607
+ }
4608
+ getCellAriaLabel() {
4609
+ return this.question.parentQuestion.getCellAriaLabel(this.cell.row, this.cell.column);
4609
4610
  }
4610
4611
  }
4611
4612
 
@@ -5051,7 +5052,7 @@ class List extends SurveyElementBase {
5051
5052
  return null;
5052
5053
  const items = this.renderItems();
5053
5054
  const ulStyle = { display: this.model.isEmpty ? "none" : null };
5054
- return (React.createElement("ul", { className: this.model.getListClass(), style: ulStyle, role: this.model.listRole, "aria-label": this.model.a11yInputAriaLabel, id: this.model.elementId, onMouseDown: (e) => {
5055
+ return (React.createElement("ul", { className: this.model.getListClass(), style: ulStyle, role: this.model.listRole, "aria-label": this.model.a11ya11y_input_ariaLabel, id: this.model.elementId, onMouseDown: (e) => {
5055
5056
  e.preventDefault();
5056
5057
  }, onKeyDown: this.handleKeydown, onMouseMove: this.handleMouseMove }, items));
5057
5058
  }
@@ -5182,6 +5183,91 @@ ReactQuestionFactory.Instance.registerQuestion("sv-rating-dropdown", (props) =>
5182
5183
  });
5183
5184
  RendererFactory.Instance.registerRenderer("rating", "dropdown", "sv-rating-dropdown");
5184
5185
 
5186
+ class SurveyQuestionSlider extends SurveyQuestionElementBase {
5187
+ constructor(props) {
5188
+ super(props);
5189
+ this.rangeInputRef = React.createRef();
5190
+ }
5191
+ componentDidMount() {
5192
+ super.componentDidMount();
5193
+ this.question.refreshInputRange(this.rangeInputRef.current);
5194
+ }
5195
+ get question() {
5196
+ return this.questionBase;
5197
+ }
5198
+ getStateElement() {
5199
+ return this.question;
5200
+ }
5201
+ renderElement() {
5202
+ const { cssClasses, showLabels, sliderType, getTrackPercentLeft, getTrackPercentRight, allowDragRange, setValueByClickOnPath } = this.question;
5203
+ const rangeInput = (sliderType === "single" && allowDragRange) ? null : this.getRangeInput();
5204
+ const thumbsAndInputs = this.getInputsAndThumbs();
5205
+ const labels = showLabels ? this.getLabels() : null;
5206
+ return (React.createElement("div", { className: this.question.rootCss, ref: (div) => (this.setControl(div)) },
5207
+ rangeInput,
5208
+ React.createElement("div", { className: cssClasses.visualContainer, onPointerUp: (e) => { setValueByClickOnPath(e.nativeEvent, this.control); } },
5209
+ React.createElement("div", { className: cssClasses.visualContainerSlider },
5210
+ React.createElement("div", { className: cssClasses.inverseTrackLeft, style: { width: getTrackPercentLeft() + "%" } }),
5211
+ React.createElement("div", { className: cssClasses.inverseTrackRight, style: { width: getTrackPercentRight() + "%" } }),
5212
+ React.createElement("div", { className: cssClasses.rangeTrack, style: { left: getTrackPercentLeft() + "%", right: getTrackPercentRight() + "%" } }),
5213
+ thumbsAndInputs)),
5214
+ labels));
5215
+ }
5216
+ getInputsAndThumbs() {
5217
+ const inputsAndThumbs = [];
5218
+ const value = this.question.getRenderedValue();
5219
+ for (let i = 0; i < value.length; i++) {
5220
+ const thumbAndInput = React.createElement(React.Fragment, { key: i },
5221
+ this.getInput(i),
5222
+ this.getThumb(i));
5223
+ inputsAndThumbs.push(thumbAndInput);
5224
+ }
5225
+ return inputsAndThumbs;
5226
+ }
5227
+ getThumb(i) {
5228
+ const { cssClasses, getThumbContainerCss, tooltipVisibility, tooltipCss, getPercent, getRenderedValue, getTooltipValue } = this.question;
5229
+ const value = getRenderedValue()[i];
5230
+ let tooltip = null;
5231
+ if (tooltipVisibility !== "never") {
5232
+ tooltip = React.createElement("div", { className: tooltipCss },
5233
+ React.createElement("div", { className: cssClasses.tooltipPanel },
5234
+ React.createElement("div", { className: cssClasses.tooltipValue }, getTooltipValue(i))));
5235
+ }
5236
+ const thumb = React.createElement("div", { className: getThumbContainerCss(i), style: { left: getPercent(value) + "%" } },
5237
+ tooltip,
5238
+ React.createElement("div", { className: cssClasses.thumb },
5239
+ React.createElement("div", { className: cssClasses.thumbDot })));
5240
+ return thumb;
5241
+ }
5242
+ getInput(i) {
5243
+ const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, getRenderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur } = this.question;
5244
+ const value = getRenderedValue()[i];
5245
+ const input = React.createElement("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 });
5246
+ return input;
5247
+ }
5248
+ getRangeInput() {
5249
+ const { renderedMax: max, renderedMin: min, step, cssClasses, handleRangeOnChange, handleRangePointerDown, handleRangePointerUp } = this.question;
5250
+ return React.createElement("input", { name: "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); } });
5251
+ }
5252
+ getLabels() {
5253
+ const labels = [];
5254
+ const { renderedLabels, cssClasses, handleLabelPointerUp, getLabelCss } = this.question;
5255
+ for (let i = 0; i < renderedLabels.length; i++) {
5256
+ const value = renderedLabels[i].value;
5257
+ const text = renderedLabels[i].locText;
5258
+ const label = React.createElement("div", { key: i, className: getLabelCss(i), style: { left: value + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, i); } },
5259
+ React.createElement("div", { className: cssClasses.labelTick }),
5260
+ React.createElement("div", { className: cssClasses.labelText }, this.renderLocString(text)));
5261
+ labels.push(label);
5262
+ }
5263
+ return React.createElement("div", { className: cssClasses.labelsContainer },
5264
+ React.createElement("div", null, labels));
5265
+ }
5266
+ }
5267
+ ReactQuestionFactory.Instance.registerQuestion("slider", (props) => {
5268
+ return React.createElement(SurveyQuestionSlider, props);
5269
+ });
5270
+
5185
5271
  class SurveyQuestionExpression extends SurveyQuestionElementBase {
5186
5272
  constructor(props) {
5187
5273
  super(props);
@@ -6085,7 +6171,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6085
6171
  return React.createElement(SurveyLocStringEditor, props);
6086
6172
  });
6087
6173
 
6088
- checkLibraryVersion(`${"2.0.10"}`, "survey-react-ui");
6174
+ checkLibraryVersion(`${"2.1.1"}`, "survey-react-ui");
6089
6175
 
6090
- export { CharacterCounterComponent, ComponentsContainer, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, 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, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6176
+ export { CharacterCounterComponent, ComponentsContainer, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, 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, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6091
6177
  //# sourceMappingURL=survey-react-ui.mjs.map