survey-js-ui 2.1.1 → 2.2.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.
- package/fesm/survey-js-ui.mjs +39 -18
- package/fesm/survey-js-ui.mjs.map +1 -1
- package/package.json +2 -2
- package/survey-js-ui.js +120 -48
- package/survey-js-ui.js.map +1 -1
- package/survey-js-ui.min.js +1 -1
- package/survey-js-ui.min.js.LICENSE.txt +1 -1
- package/typings/survey-react-ui/entries/react-ui-model.d.ts +1 -0
- package/typings/survey-react-ui/src/components/slider/slider-label-item.d.ts +10 -0
package/fesm/survey-js-ui.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v2.
|
|
2
|
+
* surveyjs - Survey JavaScript library v2.2.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
|
*/
|
|
@@ -1503,7 +1503,7 @@ class SurveyQuestion extends SurveyElementBase {
|
|
|
1503
1503
|
var descriptionUnderInput = question.hasDescriptionUnderInput
|
|
1504
1504
|
? this.renderDescription()
|
|
1505
1505
|
: null;
|
|
1506
|
-
return (_$1("div", { className: question.cssContent || undefined, style: contentStyle, role: "presentation" },
|
|
1506
|
+
return (_$1("div", { className: question.cssContent || undefined, style: contentStyle, "aria-hidden": question.contentAriaHidden, role: "presentation" },
|
|
1507
1507
|
questionRender,
|
|
1508
1508
|
comment,
|
|
1509
1509
|
descriptionUnderInput));
|
|
@@ -1978,7 +1978,7 @@ class PopupModal extends SurveyElementBase {
|
|
|
1978
1978
|
PopupModal.modalDescriptors = [];
|
|
1979
1979
|
|
|
1980
1980
|
/*!
|
|
1981
|
-
* surveyjs - Survey JavaScript library v2.
|
|
1981
|
+
* surveyjs - Survey JavaScript library v2.2.1
|
|
1982
1982
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
1983
1983
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
1984
1984
|
*/
|
|
@@ -2048,7 +2048,7 @@ var iconsV1 = {
|
|
|
2048
2048
|
};
|
|
2049
2049
|
|
|
2050
2050
|
/*!
|
|
2051
|
-
* surveyjs - Survey JavaScript library v2.
|
|
2051
|
+
* surveyjs - Survey JavaScript library v2.2.1
|
|
2052
2052
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
2053
2053
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
2054
2054
|
*/
|
|
@@ -5268,7 +5268,7 @@ class SurveyQuestionSlider extends SurveyQuestionElementBase {
|
|
|
5268
5268
|
}
|
|
5269
5269
|
getInputsAndThumbs() {
|
|
5270
5270
|
const inputsAndThumbs = [];
|
|
5271
|
-
const value = this.question.
|
|
5271
|
+
const value = this.question.renderedValue;
|
|
5272
5272
|
for (let i = 0; i < value.length; i++) {
|
|
5273
5273
|
const thumbAndInput = _$1(k$2, { key: i },
|
|
5274
5274
|
this.getInput(i),
|
|
@@ -5278,8 +5278,8 @@ class SurveyQuestionSlider extends SurveyQuestionElementBase {
|
|
|
5278
5278
|
return inputsAndThumbs;
|
|
5279
5279
|
}
|
|
5280
5280
|
getThumb(i) {
|
|
5281
|
-
const { cssClasses, getThumbContainerCss, tooltipVisibility, tooltipCss, getPercent,
|
|
5282
|
-
const value =
|
|
5281
|
+
const { cssClasses, getThumbContainerCss, tooltipVisibility, tooltipCss, getPercent, renderedValue, getTooltipValue } = this.question;
|
|
5282
|
+
const value = renderedValue[i];
|
|
5283
5283
|
let tooltip = null;
|
|
5284
5284
|
if (tooltipVisibility !== "never") {
|
|
5285
5285
|
tooltip = _$1("div", { className: tooltipCss },
|
|
@@ -5293,24 +5293,20 @@ class SurveyQuestionSlider extends SurveyQuestionElementBase {
|
|
|
5293
5293
|
return thumb;
|
|
5294
5294
|
}
|
|
5295
5295
|
getInput(i) {
|
|
5296
|
-
const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr,
|
|
5297
|
-
const value =
|
|
5296
|
+
const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, renderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur } = this.question;
|
|
5297
|
+
const value = renderedValue[i];
|
|
5298
5298
|
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 });
|
|
5299
5299
|
return input;
|
|
5300
5300
|
}
|
|
5301
5301
|
getRangeInput() {
|
|
5302
5302
|
const { renderedMax: max, renderedMin: min, step, cssClasses, handleRangeOnChange, handleRangePointerDown, handleRangePointerUp } = this.question;
|
|
5303
|
-
return _$1("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); } });
|
|
5303
|
+
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); } });
|
|
5304
5304
|
}
|
|
5305
5305
|
getLabels() {
|
|
5306
5306
|
const labels = [];
|
|
5307
|
-
const { renderedLabels, cssClasses
|
|
5307
|
+
const { renderedLabels, cssClasses } = this.question;
|
|
5308
5308
|
for (let i = 0; i < renderedLabels.length; i++) {
|
|
5309
|
-
const
|
|
5310
|
-
const text = renderedLabels[i].locText;
|
|
5311
|
-
const label = _$1("div", { key: i, className: getLabelCss(i), style: { left: value + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, i); } },
|
|
5312
|
-
_$1("div", { className: cssClasses.labelTick }),
|
|
5313
|
-
_$1("div", { className: cssClasses.labelText }, this.renderLocString(text)));
|
|
5309
|
+
const label = ReactElementFactory.Instance.createElement("sv-slider-label-item", { item: renderedLabels[i], question: this.question, key: renderedLabels[i].id });
|
|
5314
5310
|
labels.push(label);
|
|
5315
5311
|
}
|
|
5316
5312
|
return _$1("div", { className: cssClasses.labelsContainer },
|
|
@@ -6091,6 +6087,31 @@ ReactElementFactory.Instance.registerElement("sv-question-error", (props) => {
|
|
|
6091
6087
|
return _$1(QuestionErrorComponent, props);
|
|
6092
6088
|
});
|
|
6093
6089
|
|
|
6090
|
+
class SliderLabelItem extends SurveyElementBase {
|
|
6091
|
+
getStateElement() {
|
|
6092
|
+
return this.item;
|
|
6093
|
+
}
|
|
6094
|
+
get item() {
|
|
6095
|
+
return this.props.item;
|
|
6096
|
+
}
|
|
6097
|
+
get question() {
|
|
6098
|
+
return this.props.question;
|
|
6099
|
+
}
|
|
6100
|
+
componentDidUpdate(prevProps, prevState) {
|
|
6101
|
+
super.componentDidUpdate(prevProps, prevState);
|
|
6102
|
+
}
|
|
6103
|
+
renderElement() {
|
|
6104
|
+
const { cssClasses, handleLabelPointerUp, getLabelCss, getPercent } = this.question;
|
|
6105
|
+
const { value, locText } = this.item;
|
|
6106
|
+
return _$1("div", { key: this.item.id, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, value); } },
|
|
6107
|
+
_$1("div", { className: cssClasses.labelTick }),
|
|
6108
|
+
_$1("div", { className: cssClasses.labelText }, this.renderLocString(locText)));
|
|
6109
|
+
}
|
|
6110
|
+
}
|
|
6111
|
+
ReactElementFactory.Instance.registerElement("sv-slider-label-item", (props) => {
|
|
6112
|
+
return _$1(SliderLabelItem, props);
|
|
6113
|
+
});
|
|
6114
|
+
|
|
6094
6115
|
class Skeleton extends x$2 {
|
|
6095
6116
|
render() {
|
|
6096
6117
|
var _a, _b;
|
|
@@ -6273,7 +6294,7 @@ SurveyModel.prototype["render"] = function (element = null) {
|
|
|
6273
6294
|
}
|
|
6274
6295
|
};
|
|
6275
6296
|
const preact = React;
|
|
6276
|
-
checkLibraryVersion(`${"2.
|
|
6297
|
+
checkLibraryVersion(`${"2.2.1"}`, "survey-js-ui");
|
|
6277
6298
|
|
|
6278
|
-
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, Cn as StrictMode, 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, P as Suspense, B as SuspenseList, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click, _n as cloneElement, K$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 };
|
|
6299
|
+
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, 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, K$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 };
|
|
6279
6300
|
//# sourceMappingURL=survey-js-ui.mjs.map
|