survey-js-ui 3.2.0 → 3.2.2
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 +189 -78
- package/fesm/survey-js-ui.mjs.map +1 -1
- package/package.json +2 -2
- package/survey-js-ui.js +189 -77
- package/survey-js-ui.js.map +1 -1
- package/survey-js-ui.min.js +2 -2
- package/typings/survey-react-ui/entries/react-ui-model.d.ts +1 -0
- package/typings/survey-react-ui/src/components/records-bar.d.ts +12 -0
- package/typings/survey-react-ui/src/dropdown-base.d.ts +3 -2
- package/typings/survey-react-ui/src/imagepicker.d.ts +2 -0
- package/typings/survey-react-ui/src/page.d.ts +1 -1
- package/typings/survey-react-ui/src/panel-base.d.ts +1 -0
- package/typings/survey-react-ui/src/reactquestion_checkbox.d.ts +3 -0
- package/typings/survey-react-ui/src/reactquestion_matrixdropdown.d.ts +2 -0
- package/typings/survey-react-ui/src/reactquestion_matrixdropdownbase.d.ts +1 -0
- package/typings/survey-react-ui/src/reactquestion_matrixdynamic.d.ts +1 -0
- package/typings/survey-react-ui/src/reactquestion_paneldynamic.d.ts +1 -0
- package/typings/survey-react-ui/src/reactquestion_radiogroup.d.ts +1 -0
- package/typings/survey-react-ui/src/reactquestion_selectbase.d.ts +1 -0
- package/typings/survey-react-ui/src/tagbox-filter.d.ts +4 -3
package/survey-js-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v3.2.
|
|
2
|
+
* surveyjs - Survey JavaScript library v3.2.2
|
|
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
|
*/
|
|
@@ -645,7 +645,7 @@
|
|
|
645
645
|
const className = this.item.getActionBarItemCss();
|
|
646
646
|
const buttonContent = this.renderButtonContent();
|
|
647
647
|
const tabIndex = this.item.disableTabStop ? -1 : undefined;
|
|
648
|
-
const button = attachKey2click(_$1("button", { ref: this.ref, className: className, type: "button", disabled: this.item.disabled, onMouseDown: (args) => this.item.doMouseDown(args), onFocus: (args) => this.item.doFocus(args), onClick: (args) => this.item.doAction(args), title: this.item.getTooltip(), tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, "aria-controls": this.item.ariaControls, "aria-labelledby": this.item.ariaLabelledBy, role: this.item.ariaRole }, buttonContent), this.item, { processEsc: false });
|
|
648
|
+
const button = attachKey2click(_$1("button", { ref: this.ref, className: className, type: "button", disabled: this.item.disabled, onMouseDown: (args) => this.item.doMouseDown(args), onFocus: (args) => this.item.doFocus(args), onClick: (args) => this.item.doAction(args), title: this.item.getTooltip(), tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, "aria-controls": this.item.ariaControls, "aria-labelledby": this.item.ariaLabelledBy, "aria-label": this.item.ariaLabel, role: this.item.ariaRole }, buttonContent), this.item, { processEsc: false });
|
|
649
649
|
return button;
|
|
650
650
|
}
|
|
651
651
|
componentDidMount() {
|
|
@@ -1116,6 +1116,9 @@
|
|
|
1116
1116
|
const popupDropdownModel = popupModel;
|
|
1117
1117
|
if (!popupDropdownModel || !popupDropdownModel.showHeader)
|
|
1118
1118
|
return null;
|
|
1119
|
+
// An overlay's header is its close button, not the pointer.
|
|
1120
|
+
if (popupDropdownModel.isOverlay)
|
|
1121
|
+
return super.renderHeaderPopup(popupModel);
|
|
1119
1122
|
return (_$1("span", { style: {
|
|
1120
1123
|
left: popupDropdownModel.pointerTarget.left,
|
|
1121
1124
|
top: popupDropdownModel.pointerTarget.top,
|
|
@@ -1224,9 +1227,17 @@
|
|
|
1224
1227
|
|
|
1225
1228
|
var check_24x24 = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19.5275 7.5275L9.5275 17.5275C9.3775 17.6775 9.1875 17.7475 8.9975 17.7475C8.8075 17.7475 8.6175 17.6775 8.4675 17.5275L4.4675 13.5275C4.1775 13.2375 4.1775 12.7575 4.4675 12.4675C4.7575 12.1775 5.2375 12.1775 5.5275 12.4675L8.9975 15.9375L18.4675 6.4675C18.7575 6.1775 19.2375 6.1775 19.5275 6.4675C19.8175 6.7575 19.8175 7.2375 19.5275 7.5275Z\"/></svg>";
|
|
1226
1229
|
|
|
1230
|
+
var chevrondoubleleft_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.96875 3.46909C7.25875 3.17909 7.73832 3.17909 8.02832 3.46909C8.31832 3.75909 8.31832 4.23866 8.02832 4.52866L4.55859 7.99838L8.02832 11.4691C8.31832 11.7591 8.31832 12.2387 8.02832 12.5287C7.7383 12.8185 7.25869 12.8186 6.96875 12.5287L2.96875 8.52866C2.81875 8.37866 2.74902 8.18838 2.74902 7.99838C2.7491 7.80856 2.81896 7.61898 2.96875 7.46909L6.96875 3.46909Z\"/><path d=\"M10.9688 3.46909C11.2587 3.17909 11.7383 3.17909 12.0283 3.46909C12.3183 3.75909 12.3183 4.23866 12.0283 4.52866L8.55859 7.99838L12.0283 11.4691C12.3183 11.7591 12.3183 12.2387 12.0283 12.5287C11.7383 12.8185 11.2587 12.8186 10.9688 12.5287L6.96875 8.52866C6.81875 8.37866 6.74902 8.18838 6.74902 7.99838C6.7491 7.80856 6.81896 7.61898 6.96875 7.46909L10.9688 3.46909Z\"/></svg>";
|
|
1231
|
+
|
|
1232
|
+
var chevrondoubleright_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.96642 3.46903C4.25642 3.17903 4.73599 3.17903 5.02599 3.46903L9.02599 7.46903C9.17588 7.61892 9.2466 7.80846 9.2467 7.99832C9.2467 8.18832 9.17599 8.3786 9.02599 8.5286L5.02599 12.5286C4.73599 12.8185 4.2564 12.8186 3.96642 12.5286C3.67645 12.2386 3.6765 11.759 3.96642 11.469L7.43615 7.99832L3.96642 4.5286C3.67645 4.23862 3.6765 3.75903 3.96642 3.46903Z\"/><path d=\"M7.96642 3.46903C8.25642 3.17903 8.73599 3.17903 9.02599 3.46903L13.026 7.46903C13.1759 7.61892 13.2466 7.80846 13.2467 7.99832C13.2467 8.18832 13.176 8.3786 13.026 8.5286L9.02599 12.5286C8.73599 12.8185 8.2564 12.8186 7.96642 12.5286C7.67645 12.2386 7.6765 11.759 7.96642 11.469L11.4361 7.99832L7.96642 4.5286C7.67645 4.23862 7.6765 3.75903 7.96642 3.46903Z\"/></svg>";
|
|
1233
|
+
|
|
1234
|
+
var chevrondown_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.5275 7.5275L8.5275 10.5275C8.3775 10.6775 8.1875 10.7475 7.9975 10.7475C7.8075 10.7475 7.6175 10.6775 7.4675 10.5275L4.4675 7.5275C4.1775 7.2375 4.1775 6.7575 4.4675 6.4675C4.7575 6.1775 5.2375 6.1775 5.5275 6.4675L7.9975 8.9375L10.4675 6.4675C10.7575 6.1775 11.2375 6.1775 11.5275 6.4675C11.8175 6.7575 11.8175 7.2375 11.5275 7.5275Z\"/></svg>";
|
|
1235
|
+
|
|
1227
1236
|
var chevrondown_24x24 = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16.5275 10.5275L12.5275 14.5275C12.3775 14.6775 12.1875 14.7475 11.9975 14.7475C11.8075 14.7475 11.6175 14.6775 11.4675 14.5275L7.4675 10.5275C7.1775 10.2375 7.1775 9.7575 7.4675 9.4675C7.7575 9.1775 8.2375 9.1775 8.5275 9.4675L11.9975 12.9375L15.4675 9.4675C15.7575 9.1775 16.2375 9.1775 16.5275 9.4675C16.8175 9.7575 16.8175 10.2375 16.5275 10.5275Z\"/></svg>";
|
|
1228
1237
|
|
|
1229
|
-
var
|
|
1238
|
+
var chevronleft_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.7687 12.5287L4.7687 8.52872C4.6187 8.37872 4.5487 8.18872 4.5487 7.99872C4.5487 7.80872 4.6187 7.61872 4.7687 7.46872L8.7687 3.46872C9.0587 3.17872 9.5387 3.17872 9.8287 3.46872C10.1187 3.75872 10.1187 4.23872 9.8287 4.52872L6.3587 7.99872L9.8287 11.4687C10.1187 11.7587 10.1187 12.2387 9.8287 12.5287C9.5387 12.8187 9.0587 12.8187 8.7687 12.5287Z\"/></svg>";
|
|
1239
|
+
|
|
1240
|
+
var chevronright_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.22629 3.46872L11.2263 7.46872C11.3763 7.61872 11.4463 7.80872 11.4463 7.99872C11.4463 8.18872 11.3763 8.37872 11.2263 8.52872L7.22629 12.5287C6.93629 12.8187 6.45629 12.8187 6.16629 12.5287C5.87629 12.2387 5.87629 11.7587 6.16629 11.4687L9.63629 7.99872L6.16629 4.52872C5.87629 4.23872 5.87629 3.75872 6.16629 3.46872C6.45629 3.17872 6.93629 3.17872 7.22629 3.46872Z\"/></svg>";
|
|
1230
1241
|
|
|
1231
1242
|
var chevronright_24x24 = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.2263 7.46872L15.2263 11.4687C15.3763 11.6187 15.4463 11.8087 15.4463 11.9987C15.4463 12.1887 15.3763 12.3787 15.2263 12.5287L11.2263 16.5287C10.9363 16.8187 10.4563 16.8187 10.1663 16.5287C9.87629 16.2387 9.87629 15.7587 10.1663 15.4687L13.6363 11.9987L10.1663 8.52872C9.87629 8.23872 9.87629 7.75872 10.1663 7.46872C10.4563 7.17872 10.9363 7.17872 11.2263 7.46872Z\"/></svg>";
|
|
1232
1243
|
|
|
@@ -1284,6 +1295,10 @@
|
|
|
1284
1295
|
|
|
1285
1296
|
var ranking_arrows = "<svg viewBox=\"0 0 10 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 5L5 0L0 5H4V9H6V5H10Z\"/><path d=\"M6 19V15H4V19H0L5 24L10 19H6Z\"/></svg>";
|
|
1286
1297
|
|
|
1298
|
+
var rankingdot_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z\"/></svg>";
|
|
1299
|
+
|
|
1300
|
+
var rankingplus_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8 2.25C8.41 2.25 8.75 2.59 8.75 3V7.25H13C13.41 7.25 13.75 7.59 13.75 8C13.75 8.41 13.41 8.75 13 8.75H8.75V13C8.75 13.41 8.41 13.75 8 13.75C7.59 13.75 7.25 13.41 7.25 13V8.75H3C2.59 8.75 2.25 8.41 2.25 8C2.25 7.59 2.59 7.25 3 7.25H7.25V3C7.25 2.59 7.59 2.25 8 2.25Z\"/></svg>";
|
|
1301
|
+
|
|
1287
1302
|
var rankingundefined_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.75 8C11.75 8.41 11.41 8.75 11 8.75H5C4.59 8.75 4.25 8.41 4.25 8C4.25 7.59 4.59 7.25 5 7.25H11C11.41 7.25 11.75 7.59 11.75 8Z\"/></svg>";
|
|
1288
1303
|
|
|
1289
1304
|
var rating_star_2 = "<svg viewBox=\"0 0 48 48\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M24 39.5057L11.7226 45.9839C10.4095 46.6739 8.87606 45.5622 9.12525 44.096L11.4734 30.373L1.54411 20.6556C0.480254 19.6207 1.06489 17.8095 2.53128 17.5986L16.2559 15.5957L22.3994 3.10891C23.0512 1.77685 24.9488 1.77685 25.6102 3.10891L31.7441 15.5957L45.4687 17.5986C46.9351 17.8095 47.5197 19.6207 46.4559 20.6556L36.5266 30.373L38.8748 44.096C39.1239 45.5622 37.5905 46.6835 36.2774 45.9839L24 39.5057Z\" fill=\"none\" stroke-width=\"2\"/><path d=\"M24.3981 33.1305L24 32.9206L23.6019 33.1305L15.8715 37.2059L17.3542 28.5663L17.43 28.1246L17.1095 27.8113L10.83 21.6746L19.4965 20.4049L19.9405 20.3399L20.1387 19.9373L24 12.0936L27.8613 19.9373L28.0595 20.3399L28.5035 20.4049L37.17 21.6746L30.8905 27.8113L30.57 28.1246L30.6458 28.5663L32.1285 37.2059L24.3981 33.1305Z\" stroke-width=\"1.70746\"/></svg>";
|
|
@@ -1337,7 +1352,11 @@
|
|
|
1337
1352
|
"cancel-24x24": cancel_24x24,
|
|
1338
1353
|
"check-16x16": check_16x16,
|
|
1339
1354
|
"check-24x24": check_24x24,
|
|
1355
|
+
"chevrondoubleleft-16x16": chevrondoubleleft_16x16,
|
|
1356
|
+
"chevrondoubleright-16x16": chevrondoubleright_16x16,
|
|
1357
|
+
"chevrondown-16x16": chevrondown_16x16,
|
|
1340
1358
|
"chevrondown-24x24": chevrondown_24x24,
|
|
1359
|
+
"chevronleft-16x16": chevronleft_16x16,
|
|
1341
1360
|
"chevronright-16x16": chevronright_16x16,
|
|
1342
1361
|
"chevronright-24x24": chevronright_24x24,
|
|
1343
1362
|
"clear-16x16": clear_16x16,
|
|
@@ -1367,6 +1386,8 @@
|
|
|
1367
1386
|
"noimage-48x48": noimage_48x48,
|
|
1368
1387
|
"radio-16x16": radio_16x16,
|
|
1369
1388
|
"ranking-arrows": ranking_arrows,
|
|
1389
|
+
"rankingdot-16x16": rankingdot_16x16,
|
|
1390
|
+
"rankingplus-16x16": rankingplus_16x16,
|
|
1370
1391
|
"rankingundefined-16x16": rankingundefined_16x16,
|
|
1371
1392
|
"rating-star-2": rating_star_2,
|
|
1372
1393
|
"rating-star-small-2": rating_star_small_2,
|
|
@@ -1484,7 +1505,7 @@
|
|
|
1484
1505
|
this.survey.renderCallback = undefined;
|
|
1485
1506
|
this.survey.onPartialSend.clear();
|
|
1486
1507
|
this.survey.stopTimer();
|
|
1487
|
-
this.survey.
|
|
1508
|
+
this.survey.beforeDestroySurveyElement();
|
|
1488
1509
|
}
|
|
1489
1510
|
}
|
|
1490
1511
|
componentWillUnmount() {
|
|
@@ -1945,8 +1966,11 @@
|
|
|
1945
1966
|
get css() {
|
|
1946
1967
|
return this.getCss();
|
|
1947
1968
|
}
|
|
1969
|
+
getPanelFromProps(props) {
|
|
1970
|
+
return this.props.element || this.props.question;
|
|
1971
|
+
}
|
|
1948
1972
|
get panelBase() {
|
|
1949
|
-
return this.
|
|
1973
|
+
return this.getPanelFromProps(this.props);
|
|
1950
1974
|
}
|
|
1951
1975
|
getPanelBase() {
|
|
1952
1976
|
return this.props.element || this.props.question;
|
|
@@ -1967,6 +1991,9 @@
|
|
|
1967
1991
|
if (!!el) {
|
|
1968
1992
|
el.removeAttribute("data-rendered");
|
|
1969
1993
|
}
|
|
1994
|
+
if (this.panelBase) {
|
|
1995
|
+
this.panelBase.beforeDestroy();
|
|
1996
|
+
}
|
|
1970
1997
|
}
|
|
1971
1998
|
componentDidUpdate(prevProps, prevState) {
|
|
1972
1999
|
super.componentDidUpdate(prevProps, prevState);
|
|
@@ -1975,6 +2002,10 @@
|
|
|
1975
2002
|
!!this.survey.activePage &&
|
|
1976
2003
|
prevProps.page.id === this.survey.activePage.id)
|
|
1977
2004
|
return;
|
|
2005
|
+
const prevPanel = this.getPanelFromProps(prevProps);
|
|
2006
|
+
if (prevPanel) {
|
|
2007
|
+
prevPanel.beforeDestroy();
|
|
2008
|
+
}
|
|
1978
2009
|
this.doAfterRender();
|
|
1979
2010
|
}
|
|
1980
2011
|
doAfterRender() {
|
|
@@ -2214,7 +2245,7 @@
|
|
|
2214
2245
|
renderNoItems() {
|
|
2215
2246
|
const q = this.summary.question;
|
|
2216
2247
|
const placeholder = ReactElementFactory.Instance.createElement("sv-placeholder-" + q.getTemplate(), { cssClasses: this.css, question: q });
|
|
2217
|
-
return placeholder || _$1("div", null, this.renderLocString(this.summary.noEntry));
|
|
2248
|
+
return _$1("div", { className: this.css.summaryPlaceholder }, placeholder || _$1("div", null, this.renderLocString(this.summary.noEntry)));
|
|
2218
2249
|
}
|
|
2219
2250
|
renderItem(item, index) {
|
|
2220
2251
|
const btnEdit = item.btnEdit ?
|
|
@@ -2590,8 +2621,8 @@
|
|
|
2590
2621
|
constructor(props) {
|
|
2591
2622
|
super(props);
|
|
2592
2623
|
}
|
|
2593
|
-
|
|
2594
|
-
return
|
|
2624
|
+
getPanelFromProps(props) {
|
|
2625
|
+
return props.page;
|
|
2595
2626
|
}
|
|
2596
2627
|
get page() {
|
|
2597
2628
|
return this.panelBase;
|
|
@@ -2644,17 +2675,13 @@
|
|
|
2644
2675
|
paddingInlineStart: this.panel.innerPaddingLeft
|
|
2645
2676
|
? `calc(${panelPaddingHorizontal} + ${this.panel.innerPaddingLeft})`
|
|
2646
2677
|
: this.panel.innerPaddingLeft,
|
|
2647
|
-
// paddingInlineEnd: this.panel.innerPaddingLeft ? panelPaddingHorizontal : undefined,
|
|
2648
|
-
display: this.panel.renderedIsExpanded ? undefined : "none",
|
|
2649
2678
|
};
|
|
2650
|
-
|
|
2651
|
-
let
|
|
2679
|
+
const className = this.panelBase.cssClasses.panel.content;
|
|
2680
|
+
let expandableContent = null;
|
|
2652
2681
|
if (this.panel.renderedIsExpanded) {
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
content = this.renderContent(style, rows, className);
|
|
2657
|
-
bottom = this.renderBottom();
|
|
2682
|
+
expandableContent = _$1("div", { className: this.panel.cssClasses.panel.expandableContent },
|
|
2683
|
+
this.renderContent(style, this.renderRows(this.panelBase.cssClasses), className),
|
|
2684
|
+
this.renderBottom());
|
|
2658
2685
|
}
|
|
2659
2686
|
const focusIn = () => {
|
|
2660
2687
|
if (this.panelBase)
|
|
@@ -2664,8 +2691,7 @@
|
|
|
2664
2691
|
this.panel.showErrorsAbovePanel ? errors : null,
|
|
2665
2692
|
header,
|
|
2666
2693
|
this.panel.showErrorsAbovePanel ? null : errors,
|
|
2667
|
-
|
|
2668
|
-
bottom));
|
|
2694
|
+
expandableContent));
|
|
2669
2695
|
}
|
|
2670
2696
|
renderHeader() {
|
|
2671
2697
|
if (!this.panel.hasTitle && !this.panel.hasDescription) {
|
|
@@ -2702,7 +2728,7 @@
|
|
|
2702
2728
|
return _$1(SurveyActionBar, { model: footerToolbar });
|
|
2703
2729
|
}
|
|
2704
2730
|
getIsVisible() {
|
|
2705
|
-
return this.panelBase.
|
|
2731
|
+
return this.panelBase.renderedIsContentVisible;
|
|
2706
2732
|
}
|
|
2707
2733
|
}
|
|
2708
2734
|
ReactElementFactory.Instance.registerElement("panel", (props) => {
|
|
@@ -2841,13 +2867,14 @@
|
|
|
2841
2867
|
}
|
|
2842
2868
|
renderElement() {
|
|
2843
2869
|
var cssClasses = this.question.cssClasses;
|
|
2844
|
-
return (_$1("fieldset", { className: this.question.getSelectBaseRootCss(), ref: (fieldset) => (this.setControl(fieldset)), role: this.question.a11y_input_ariaRole, "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 },
|
|
2870
|
+
return (_$1("fieldset", { className: this.question.getSelectBaseRootCss(), ref: (fieldset) => (this.setControl(fieldset)), onKeyDown: (event) => this.handleRootKeyDown(event), role: this.question.a11y_input_ariaRole, "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 },
|
|
2845
2871
|
this.renderHeader(),
|
|
2846
2872
|
this.question.hasColumns
|
|
2847
2873
|
? this.getColumnedBody(cssClasses)
|
|
2848
2874
|
: this.getBody(cssClasses),
|
|
2849
2875
|
this.getFooter()));
|
|
2850
2876
|
}
|
|
2877
|
+
handleRootKeyDown(_event) { }
|
|
2851
2878
|
renderHeader() { return null; }
|
|
2852
2879
|
getFooter() {
|
|
2853
2880
|
if (this.question.hasFootItems) {
|
|
@@ -3013,6 +3040,10 @@
|
|
|
3013
3040
|
get question() {
|
|
3014
3041
|
return this.questionBase;
|
|
3015
3042
|
}
|
|
3043
|
+
handleRootKeyDown(event) {
|
|
3044
|
+
var _a, _b;
|
|
3045
|
+
(_b = (_a = this.question).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
3046
|
+
}
|
|
3016
3047
|
renderHeader() {
|
|
3017
3048
|
return _$1(k$2, null,
|
|
3018
3049
|
_$1("legend", { className: "sv-hidden" }, this.question.locTitle.renderedHtml),
|
|
@@ -3028,6 +3059,12 @@
|
|
|
3028
3059
|
class SurveyQuestionCheckboxItem extends SurveyQuestionSelectBaseItem {
|
|
3029
3060
|
constructor(props) {
|
|
3030
3061
|
super(props);
|
|
3062
|
+
this.handleOnKeyDown = (event) => {
|
|
3063
|
+
this.question.onChoiceKeyDown(event.nativeEvent);
|
|
3064
|
+
};
|
|
3065
|
+
this.handleOnBlur = (event) => {
|
|
3066
|
+
this.question.onChoiceFocusOut(event.nativeEvent);
|
|
3067
|
+
};
|
|
3031
3068
|
}
|
|
3032
3069
|
doOnItemChange(event) {
|
|
3033
3070
|
this.question.clickItemHandler(this.item, event.target.checked);
|
|
@@ -3044,9 +3081,11 @@
|
|
|
3044
3081
|
const itemClass = this.question.getItemClass(this.item);
|
|
3045
3082
|
const labelClass = this.question.getLabelClass(this.item);
|
|
3046
3083
|
const itemLabel = !this.hideCaption ? _$1("span", { className: this.cssClasses.controlLabel, id: this.question.getItemLabelId(this.item), "aria-hidden": this.question.isItemLabelAriaHidden ? "true" : undefined }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
|
3084
|
+
const shortcutKey = this.question.getChoiceKeyBadge(this.item);
|
|
3047
3085
|
return (_$1("div", { className: itemClass, role: "presentation", ref: this.rootRef },
|
|
3048
3086
|
_$1("label", { className: labelClass },
|
|
3049
|
-
_$1("
|
|
3087
|
+
shortcutKey ? _$1("span", { className: this.question.getItemShortcutKeyClass(this.item), "aria-hidden": "true" }, shortcutKey) : null,
|
|
3088
|
+
_$1("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, onKeyDown: this.handleOnKeyDown, onBlur: this.handleOnBlur, required: this.question.hasRequiredError(), "aria-label": this.ariaLabel, "aria-labelledby": !this.ariaLabel && !this.hideCaption ? this.question.getItemLabelId(this.item) : undefined, "aria-keyshortcuts": this.question.getItemAriaKeyShortcuts(this.item) }),
|
|
3050
3089
|
this.cssClasses.materialDecorator ?
|
|
3051
3090
|
_$1("span", { className: this.cssClasses.materialDecorator, "aria-hidden": "true" }, this.question.itemSvgIcon ?
|
|
3052
3091
|
_$1("svg", { className: this.cssClasses.itemDecorator },
|
|
@@ -3161,7 +3200,7 @@
|
|
|
3161
3200
|
}
|
|
3162
3201
|
renderEmptyIcon() {
|
|
3163
3202
|
return (_$1("svg", null,
|
|
3164
|
-
_$1("use", { xlinkHref: this.question.
|
|
3203
|
+
_$1("use", { xlinkHref: this.question.emptyIndexSvgIcon })));
|
|
3165
3204
|
}
|
|
3166
3205
|
renderElement() {
|
|
3167
3206
|
let itemContent = ReactElementFactory.Instance.createElement(this.question.itemComponent, { item: this.item, cssClasses: this.cssClasses });
|
|
@@ -3282,8 +3321,12 @@
|
|
|
3282
3321
|
});
|
|
3283
3322
|
|
|
3284
3323
|
class TagboxFilterString extends SurveyElementBase {
|
|
3324
|
+
// Creates the model: used by the event handlers only.
|
|
3285
3325
|
get model() {
|
|
3286
|
-
return this.props.model;
|
|
3326
|
+
return this.props.model || this.question.dropdownListModel;
|
|
3327
|
+
}
|
|
3328
|
+
get renderState() {
|
|
3329
|
+
return this.props.model || this.question.dropdownRenderState;
|
|
3287
3330
|
}
|
|
3288
3331
|
get question() {
|
|
3289
3332
|
return this.props.question;
|
|
@@ -3299,9 +3342,9 @@
|
|
|
3299
3342
|
updateDomElement() {
|
|
3300
3343
|
if (!!this.inputElement) {
|
|
3301
3344
|
const control = this.inputElement;
|
|
3302
|
-
const newValue = this.
|
|
3345
|
+
const newValue = this.renderState.inputStringRendered;
|
|
3303
3346
|
if (!surveyCore.Helpers.isTwoValueEquals(newValue, control.value, false, true, false)) {
|
|
3304
|
-
control.value = this.
|
|
3347
|
+
control.value = this.renderState.inputStringRendered;
|
|
3305
3348
|
}
|
|
3306
3349
|
}
|
|
3307
3350
|
}
|
|
@@ -3325,19 +3368,19 @@
|
|
|
3325
3368
|
super(props);
|
|
3326
3369
|
}
|
|
3327
3370
|
getStateElement() {
|
|
3328
|
-
return this.model;
|
|
3371
|
+
return this.props.model || this.question.dropdownListModelValue;
|
|
3329
3372
|
}
|
|
3330
3373
|
render() {
|
|
3331
3374
|
return (_$1("div", { className: this.question.cssClasses.hint },
|
|
3332
|
-
this.
|
|
3375
|
+
this.renderState.showHintPrefix ?
|
|
3333
3376
|
(_$1("div", { className: this.question.cssClasses.hintPrefix },
|
|
3334
|
-
_$1("span", null, this.
|
|
3377
|
+
_$1("span", null, this.renderState.hintStringPrefix))) : null,
|
|
3335
3378
|
_$1("div", { className: this.question.cssClasses.hintSuffixWrapper },
|
|
3336
|
-
this.
|
|
3379
|
+
this.renderState.showHintString ?
|
|
3337
3380
|
(_$1("div", { className: this.question.cssClasses.hintSuffix },
|
|
3338
|
-
_$1("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.
|
|
3339
|
-
_$1("span", null, this.
|
|
3340
|
-
_$1("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.
|
|
3381
|
+
_$1("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.renderState.inputStringRendered),
|
|
3382
|
+
_$1("span", null, this.renderState.hintStringSuffix))) : null,
|
|
3383
|
+
_$1("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.renderState.inputMode, ref: (element) => (this.inputElement = element), className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: this.renderState.filterReadOnly ? true : undefined, size: !this.renderState.inputStringRendered ? 1 : undefined, role: this.renderState.ariaInputRole, "aria-required": this.renderState.ariaInputRequired, "aria-invalid": this.renderState.ariaInputInvalid, "aria-errormessage": this.renderState.ariaInputErrorMessage, "aria-expanded": this.renderState.ariaInputExpanded, "aria-label": this.renderState.ariaInputLabel, "aria-labelledby": this.renderState.ariaInputLabelledby, "aria-describedby": this.renderState.ariaInputDescribedby, "aria-controls": this.renderState.ariaInputControls, "aria-activedescendant": this.renderState.ariaInputActivedescendant, placeholder: this.renderState.filterStringPlaceholder, onKeyDown: (e) => { this.keyhandler(e); }, onChange: (e) => { this.onChange(e); }, onBlur: (e) => { this.onBlur(e); }, onFocus: (e) => { this.onFocus(e); } }))));
|
|
3341
3384
|
}
|
|
3342
3385
|
}
|
|
3343
3386
|
ReactQuestionFactory.Instance.registerQuestion("sv-tagbox-filter", (props) => {
|
|
@@ -3416,8 +3459,18 @@
|
|
|
3416
3459
|
get dropdownListModel() {
|
|
3417
3460
|
return this.question["dropdownListModel"];
|
|
3418
3461
|
}
|
|
3419
|
-
|
|
3420
|
-
|
|
3462
|
+
// Everything the closed control renders. It does not create DropdownListModel; a question without it (a custom type)
|
|
3463
|
+
// falls back to the model.
|
|
3464
|
+
get renderState() {
|
|
3465
|
+
return this.question["dropdownRenderState"] || this.question["dropdownListModel"];
|
|
3466
|
+
}
|
|
3467
|
+
// The model is created on the first interaction or when the popup is rendered; componentDidUpdate subscribes to it then.
|
|
3468
|
+
getStateElements() {
|
|
3469
|
+
const res = [this.question];
|
|
3470
|
+
const model = this.question["dropdownListModelValue"];
|
|
3471
|
+
if (!!model)
|
|
3472
|
+
res.push(model);
|
|
3473
|
+
return res;
|
|
3421
3474
|
}
|
|
3422
3475
|
setValueCore(newValue) {
|
|
3423
3476
|
this.questionBase.renderedValue = newValue;
|
|
@@ -3436,25 +3489,24 @@
|
|
|
3436
3489
|
}
|
|
3437
3490
|
renderSelect(cssClasses) {
|
|
3438
3491
|
let selectElement = null;
|
|
3439
|
-
const
|
|
3492
|
+
const renderState = this.renderState;
|
|
3440
3493
|
if (this.question.isReadOnly) {
|
|
3441
3494
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3442
3495
|
// @ts-ignore
|
|
3443
|
-
selectElement = _$1("div", { id: this.question.inputId, role:
|
|
3496
|
+
selectElement = _$1("div", { id: this.question.inputId, role: renderState === null || renderState === void 0 ? void 0 : renderState.ariaQuestionRole, "aria-label": renderState === null || renderState === void 0 ? void 0 : renderState.ariaQuestionLabel, "aria-labelledby": renderState === null || renderState === void 0 ? void 0 : renderState.ariaQuestionLabelledby, "aria-describedby": renderState === null || renderState === void 0 ? void 0 : renderState.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)) },
|
|
3444
3497
|
this.renderReadOnlyElement(),
|
|
3445
3498
|
this.renderEditorButtons());
|
|
3446
3499
|
}
|
|
3447
3500
|
else {
|
|
3448
3501
|
selectElement = _$1(k$2, null,
|
|
3449
3502
|
this.renderInput(),
|
|
3450
|
-
this.question.isInputReadOnly ? null : _$1(Popup, { model: dropdownListModel.popupModel }));
|
|
3503
|
+
this.question.isInputReadOnly ? null : _$1(Popup, { model: this.dropdownListModel.popupModel }));
|
|
3451
3504
|
}
|
|
3452
3505
|
return (_$1("div", { className: cssClasses.selectWrapper, onClick: this.click }, selectElement));
|
|
3453
3506
|
}
|
|
3454
3507
|
renderValueElement() {
|
|
3455
3508
|
if (this.question.showInputFieldComponent) {
|
|
3456
|
-
const
|
|
3457
|
-
const actionItem = !!listModel ? listModel.getSelectedAction() : this.question.selectedItem;
|
|
3509
|
+
const actionItem = this.renderState.getSelectedAction();
|
|
3458
3510
|
return ReactElementFactory.Instance.createElement(this.question.inputFieldComponentName, { item: actionItem, question: this.question });
|
|
3459
3511
|
}
|
|
3460
3512
|
else if (this.question.showSelectedItemLocText) {
|
|
@@ -3463,36 +3515,36 @@
|
|
|
3463
3515
|
return null;
|
|
3464
3516
|
}
|
|
3465
3517
|
renderInput() {
|
|
3466
|
-
const
|
|
3518
|
+
const renderState = this.renderState;
|
|
3467
3519
|
let valueElement = this.renderValueElement();
|
|
3468
|
-
return (_$1("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex:
|
|
3520
|
+
return (_$1("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: renderState.noTabIndex ? undefined : 0,
|
|
3469
3521
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3470
3522
|
// @ts-ignore
|
|
3471
|
-
disabled: this.question.isDisabledAttr, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, onFocus: this.focus, role:
|
|
3523
|
+
disabled: this.question.isDisabledAttr, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, onFocus: this.focus, role: renderState.ariaQuestionRole, "aria-required": renderState.ariaQuestionRequired, "aria-invalid": renderState.ariaQuestionInvalid, "aria-errormessage": renderState.ariaQuestionErrorMessage, "aria-expanded": renderState.ariaQuestionExpanded, "aria-label": renderState.ariaQuestionLabel, "aria-labelledby": renderState.ariaQuestionLabelledby, "aria-describedby": renderState.ariaQuestionDescribedby, "aria-controls": renderState.ariaQuestionControls, "aria-activedescendant": renderState.ariaQuestionActivedescendant, ref: (div) => (this.setControl(div)) },
|
|
3472
3524
|
_$1("div", { className: this.question.cssClasses.controlValue },
|
|
3473
|
-
|
|
3525
|
+
renderState.showHintPrefix ?
|
|
3474
3526
|
(_$1("div", { className: this.question.cssClasses.hintPrefix },
|
|
3475
|
-
_$1("span", null,
|
|
3527
|
+
_$1("span", null, renderState.hintStringPrefix))) : null,
|
|
3476
3528
|
_$1("div", { className: this.question.cssClasses.inputPrefixWrapper },
|
|
3477
|
-
|
|
3529
|
+
renderState.showHintString ?
|
|
3478
3530
|
(_$1("div", { className: this.question.cssClasses.hintSuffix },
|
|
3479
|
-
_$1("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" },
|
|
3480
|
-
_$1("span", null,
|
|
3531
|
+
_$1("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, renderState.inputStringRendered),
|
|
3532
|
+
_$1("span", null, renderState.hintStringSuffix))) : null,
|
|
3481
3533
|
valueElement,
|
|
3482
|
-
|
|
3534
|
+
renderState.needRenderInput ? this.renderFilterInput() : null)),
|
|
3483
3535
|
this.renderEditorButtons()));
|
|
3484
3536
|
}
|
|
3485
3537
|
renderFilterInput() {
|
|
3486
3538
|
surveyCore.settings.environment;
|
|
3487
|
-
const
|
|
3539
|
+
const renderState = this.renderState;
|
|
3488
3540
|
const onInputChange = (e) => {
|
|
3489
3541
|
var _a;
|
|
3490
3542
|
const activeElement = (_a = e.target.getRootNode()) === null || _a === void 0 ? void 0 : _a.activeElement;
|
|
3491
3543
|
if (e.target === activeElement) {
|
|
3492
|
-
dropdownListModel.inputStringRendered = e.target.value;
|
|
3544
|
+
this.dropdownListModel.inputStringRendered = e.target.value;
|
|
3493
3545
|
}
|
|
3494
3546
|
};
|
|
3495
|
-
return _$1("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: (element) => (this.inputElement = element), className: this.question.cssClasses.filterStringInput, role:
|
|
3547
|
+
return _$1("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: (element) => (this.inputElement = element), className: this.question.cssClasses.filterStringInput, role: renderState.ariaInputRole, "aria-required": renderState.ariaInputRequired, "aria-invalid": renderState.ariaInputInvalid, "aria-errormessage": renderState.ariaInputErrorMessage, "aria-expanded": renderState.ariaInputExpanded, "aria-label": renderState.ariaInputLabel, "aria-labelledby": renderState.ariaInputLabelledby, "aria-describedby": renderState.ariaInputDescribedby, "aria-controls": renderState.ariaInputControls, "aria-activedescendant": renderState.ariaInputActivedescendant, placeholder: renderState.placeholderRendered, readOnly: renderState.filterReadOnly ? true : undefined, tabIndex: renderState.noTabIndex ? undefined : -1, disabled: this.question.isDisabledAttr, inputMode: renderState.inputMode, onChange: (e) => { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus });
|
|
3496
3548
|
}
|
|
3497
3549
|
renderOther(item, cssClasses) {
|
|
3498
3550
|
if (!item || !item.isCommentShowing)
|
|
@@ -3501,7 +3553,7 @@
|
|
|
3501
3553
|
_$1(SurveyQuestionCommentValueItem, { question: this.question, item: item, cssClasses: this.question.cssClasses })));
|
|
3502
3554
|
}
|
|
3503
3555
|
renderEditorButtons() {
|
|
3504
|
-
return _$1(SurveyActionBar, { model: this.
|
|
3556
|
+
return _$1(SurveyActionBar, { model: this.renderState.editorButtons });
|
|
3505
3557
|
}
|
|
3506
3558
|
componentDidUpdate(prevProps, prevState) {
|
|
3507
3559
|
super.componentDidUpdate(prevProps, prevState);
|
|
@@ -3513,15 +3565,16 @@
|
|
|
3513
3565
|
}
|
|
3514
3566
|
componentWillUnmount() {
|
|
3515
3567
|
super.componentWillUnmount();
|
|
3516
|
-
|
|
3517
|
-
|
|
3568
|
+
const model = this.question["dropdownListModelValue"];
|
|
3569
|
+
if (model)
|
|
3570
|
+
model.focused = false;
|
|
3518
3571
|
}
|
|
3519
3572
|
updateInputDomElement() {
|
|
3520
3573
|
if (!!this.inputElement) {
|
|
3521
3574
|
const control = this.inputElement;
|
|
3522
|
-
const newValue = this.
|
|
3575
|
+
const newValue = this.renderState.inputStringRendered;
|
|
3523
3576
|
if (!surveyCore.Helpers.isTwoValueEquals(newValue, control.value, false, true, false)) {
|
|
3524
|
-
control.value = this.
|
|
3577
|
+
control.value = this.renderState.inputStringRendered;
|
|
3525
3578
|
}
|
|
3526
3579
|
}
|
|
3527
3580
|
}
|
|
@@ -3582,15 +3635,15 @@
|
|
|
3582
3635
|
return renderedItem;
|
|
3583
3636
|
}
|
|
3584
3637
|
renderInput() {
|
|
3585
|
-
const
|
|
3638
|
+
const renderState = this.renderState;
|
|
3586
3639
|
const items = this.question.selectedChoices.map((choice, index) => { return this.renderItem("item" + index, choice); });
|
|
3587
|
-
return (_$1("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex:
|
|
3640
|
+
return (_$1("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: renderState.noTabIndex ? undefined : 0,
|
|
3588
3641
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3589
3642
|
// @ts-ignore
|
|
3590
|
-
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role:
|
|
3643
|
+
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: renderState.ariaQuestionRole, "aria-required": renderState.ariaQuestionRequired, "aria-invalid": renderState.ariaQuestionInvalid, "aria-errormessage": renderState.ariaQuestionErrorMessage, "aria-label": renderState.ariaQuestionLabel, "aria-labelledby": renderState.ariaQuestionLabelledby, "aria-describedby": renderState.ariaQuestionDescribedby, "aria-expanded": renderState.ariaQuestionExpanded, "aria-controls": renderState.ariaQuestionControls, "aria-activedescendant": renderState.ariaQuestionActivedescendant, ref: (div) => (this.setControl(div)) },
|
|
3591
3644
|
_$1("div", { className: this.question.cssClasses.controlValue },
|
|
3592
3645
|
items,
|
|
3593
|
-
|
|
3646
|
+
renderState.needRenderInput ? _$1(TagboxFilterString, { question: this.question }) : null),
|
|
3594
3647
|
this.renderEditorButtons()));
|
|
3595
3648
|
}
|
|
3596
3649
|
renderElement() {
|
|
@@ -4122,6 +4175,10 @@
|
|
|
4122
4175
|
var _a, _b;
|
|
4123
4176
|
(_b = (_a = this.question).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
4124
4177
|
};
|
|
4178
|
+
this.handleOnBlur = (event) => {
|
|
4179
|
+
var _a, _b;
|
|
4180
|
+
(_b = (_a = this.question).onChoiceFocusOut) === null || _b === void 0 ? void 0 : _b.call(_a, event.nativeEvent);
|
|
4181
|
+
};
|
|
4125
4182
|
this.handleOnMouseDown = this.handleOnMouseDown.bind(this);
|
|
4126
4183
|
}
|
|
4127
4184
|
getStateElement() {
|
|
@@ -4147,9 +4204,11 @@
|
|
|
4147
4204
|
var labelClass = this.question.getLabelClass(this.item);
|
|
4148
4205
|
var controlLabelClass = this.question.getControlLabelClass(this.item);
|
|
4149
4206
|
const itemLabel = !this.hideCaption ? _$1("span", { className: controlLabelClass, id: this.question.getItemLabelId(this.item), "aria-hidden": this.question.isItemLabelAriaHidden ? "true" : undefined }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
|
4207
|
+
const shortcutKey = this.question.getChoiceKeyBadge(this.item);
|
|
4150
4208
|
return (_$1("div", { className: itemClass, role: "presentation", ref: this.rootRef },
|
|
4151
4209
|
_$1("label", { onMouseDown: this.handleOnMouseDown, className: labelClass },
|
|
4152
|
-
_$1("
|
|
4210
|
+
shortcutKey ? _$1("span", { className: this.question.getItemShortcutKeyClass(this.item), "aria-hidden": "true" }, shortcutKey) : null,
|
|
4211
|
+
_$1("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, onKeyDown: this.handleOnKeyDown, onBlur: this.handleOnBlur, "aria-label": this.ariaLabel, "aria-labelledby": !this.ariaLabel && !this.hideCaption ? this.question.getItemLabelId(this.item) : undefined, "aria-keyshortcuts": this.question.getItemAriaKeyShortcuts(this.item) }),
|
|
4153
4212
|
this.cssClasses.materialDecorator ?
|
|
4154
4213
|
_$1("span", { className: this.cssClasses.materialDecorator, "aria-hidden": "true" }, this.question.itemSvgIcon ?
|
|
4155
4214
|
_$1("svg", { className: this.cssClasses.itemDecorator },
|
|
@@ -4303,7 +4362,7 @@
|
|
|
4303
4362
|
const itemClass = this.question.getCheckboxItemCss();
|
|
4304
4363
|
const description = this.question.canRenderLabelDescription ?
|
|
4305
4364
|
SurveyElementBase.renderQuestionDescription(this.question) : null;
|
|
4306
|
-
return (_$1("div", { className: cssClasses.rootCheckbox },
|
|
4365
|
+
return (_$1("div", { className: cssClasses.rootCheckbox, onKeyDown: (event) => { var _a; return this.question.onKeyDown((_a = event.nativeEvent) !== null && _a !== void 0 ? _a : event); } },
|
|
4307
4366
|
_$1("div", { className: itemClass },
|
|
4308
4367
|
_$1("label", { className: cssClasses.checkboxLabel },
|
|
4309
4368
|
_$1("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
|
|
@@ -4616,6 +4675,10 @@
|
|
|
4616
4675
|
renderElement() {
|
|
4617
4676
|
return this.renderTableDiv();
|
|
4618
4677
|
}
|
|
4678
|
+
// The records bar under the table: the pager.
|
|
4679
|
+
renderRecordsBar() {
|
|
4680
|
+
return ReactElementFactory.Instance.createElement("sv-records-bar", { model: this.question.recordsBar });
|
|
4681
|
+
}
|
|
4619
4682
|
renderTableDiv() {
|
|
4620
4683
|
return (_$1("div", { className: this.question.getTableWrapperCss(), ref: (root) => (this.setControl(root)) },
|
|
4621
4684
|
_$1(SurveyQuestionMatrixTable, { question: this.question, creator: this.creator, wrapCell: (cell, element, reason) => this.wrapCell(cell, element, reason) })));
|
|
@@ -4780,6 +4843,12 @@
|
|
|
4780
4843
|
constructor(props) {
|
|
4781
4844
|
super(props);
|
|
4782
4845
|
}
|
|
4846
|
+
// A fragment: a matrix that does not page renders the table alone, as before the pager.
|
|
4847
|
+
renderElement() {
|
|
4848
|
+
return (_$1(k$2, null,
|
|
4849
|
+
this.renderTableDiv(),
|
|
4850
|
+
this.renderRecordsBar()));
|
|
4851
|
+
}
|
|
4783
4852
|
}
|
|
4784
4853
|
ReactQuestionFactory.Instance.registerQuestion("matrixdropdown", props => {
|
|
4785
4854
|
return _$1(SurveyQuestionMatrixDropdown, props);
|
|
@@ -4805,7 +4874,17 @@
|
|
|
4805
4874
|
return (_$1("div", null,
|
|
4806
4875
|
this.renderTopToolbar(),
|
|
4807
4876
|
mainDiv,
|
|
4808
|
-
this.
|
|
4877
|
+
this.renderRecordsFooter()));
|
|
4878
|
+
}
|
|
4879
|
+
// The footer exists only with the pager: the bottom toolbar and the pager in one row.
|
|
4880
|
+
// Without the pager the bottom toolbar is the next sibling of the table, as without paging.
|
|
4881
|
+
renderRecordsFooter() {
|
|
4882
|
+
const toolbar = this.renderBottomToolbar();
|
|
4883
|
+
if (!this.matrix.showPager)
|
|
4884
|
+
return toolbar;
|
|
4885
|
+
return _$1("div", { className: this.matrix.getFooterCss() },
|
|
4886
|
+
toolbar,
|
|
4887
|
+
this.renderRecordsBar());
|
|
4809
4888
|
}
|
|
4810
4889
|
renderToolbar(location) {
|
|
4811
4890
|
if (!this.matrix.getShowToolbar(location))
|
|
@@ -4834,7 +4913,7 @@
|
|
|
4834
4913
|
const matrix = this.props.question;
|
|
4835
4914
|
const text = this.renderLocString(matrix.locNoRowsText);
|
|
4836
4915
|
const textDiv = _$1("div", { className: cssClasses.noRowsText }, text);
|
|
4837
|
-
const toolbar = matrix.
|
|
4916
|
+
const toolbar = matrix.getShowPlaceholderToolbar() ? ReactElementFactory.Instance.createElement("sv-action-bar", { model: matrix.toolbar }) : null;
|
|
4838
4917
|
return (_$1("div", { className: cssClasses.noRowsSection },
|
|
4839
4918
|
textDiv,
|
|
4840
4919
|
toolbar));
|
|
@@ -4893,21 +4972,24 @@
|
|
|
4893
4972
|
_$1("div", { className: this.question.cssClasses.panelsContainer }, panels),
|
|
4894
4973
|
navigation));
|
|
4895
4974
|
}
|
|
4975
|
+
// The records bar in the footer: the pager.
|
|
4976
|
+
renderRecordsBar() {
|
|
4977
|
+
return ReactElementFactory.Instance.createElement("sv-records-bar", { model: this.question.recordsBar });
|
|
4978
|
+
}
|
|
4896
4979
|
renderRange() {
|
|
4897
4980
|
return (_$1("div", { className: this.question.cssClasses.progress },
|
|
4898
4981
|
_$1("div", { className: this.question.cssClasses.progressBar, style: { width: this.question.progress }, role: "progressbar", "aria-label": this.question.progressBarAriaLabel })));
|
|
4899
4982
|
}
|
|
4900
4983
|
renderNavigator() {
|
|
4901
|
-
if (!this.question.
|
|
4902
|
-
return null;
|
|
4903
|
-
const range = this.question.isRangeShowing && this.question.isProgressBottomShowing ? this.renderRange() : null;
|
|
4904
|
-
if (!range && !this.question.showFooterToolbar)
|
|
4984
|
+
if (!this.question.showFooter)
|
|
4905
4985
|
return null;
|
|
4906
|
-
|
|
4986
|
+
const range = this.question.showFooterProgress ? this.renderRange() : null;
|
|
4987
|
+
return (_$1("div", { className: this.question.getFooterCss() },
|
|
4907
4988
|
_$1("hr", { className: this.question.cssClasses.separator }),
|
|
4908
4989
|
range,
|
|
4909
|
-
this.question.
|
|
4910
|
-
_$1(SurveyActionBar, { model: this.question.footerToolbar }))) : null
|
|
4990
|
+
this.question.showFooterButtons ? (_$1("div", { className: this.question.cssClasses.footerButtonsContainer },
|
|
4991
|
+
_$1(SurveyActionBar, { model: this.question.footerToolbar }))) : null,
|
|
4992
|
+
this.renderRecordsBar()));
|
|
4911
4993
|
}
|
|
4912
4994
|
renderPlaceholder(cssClasses) {
|
|
4913
4995
|
if (this.question.getShowNoEntriesPlaceholder())
|
|
@@ -4958,7 +5040,7 @@
|
|
|
4958
5040
|
const question = this.props.question;
|
|
4959
5041
|
return (_$1("div", { className: cssClasses.noEntriesPlaceholder },
|
|
4960
5042
|
_$1("span", null, this.renderLocString(question.locNoEntriesText)),
|
|
4961
|
-
_$1(SurveyActionBar, { model:
|
|
5043
|
+
question.getShowPlaceholderToolbar() ? _$1(SurveyActionBar, { model: question.footerToolbar }) : null));
|
|
4962
5044
|
}
|
|
4963
5045
|
}
|
|
4964
5046
|
ReactElementFactory.Instance.registerElement("sv-placeholder-paneldynamic", (props) => { return _$1(SurveyQuestionPanelDynamicPlaceholder, props); });
|
|
@@ -5508,7 +5590,7 @@
|
|
|
5508
5590
|
}
|
|
5509
5591
|
renderElement() {
|
|
5510
5592
|
var cssClasses = this.question.cssClasses;
|
|
5511
|
-
return (_$1("fieldset", { className: this.question.getSelectBaseRootCss(), style: this.question.getContainerStyle() },
|
|
5593
|
+
return (_$1("fieldset", { className: this.question.getSelectBaseRootCss(), style: this.question.getContainerStyle(), onKeyDown: (event) => { var _a, _b; return (_b = (_a = this.question).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event); } },
|
|
5512
5594
|
_$1("legend", { className: "sv-hidden" }, this.question.locTitle.renderedHtml),
|
|
5513
5595
|
this.question.hasColumns ? this.getColumns(cssClasses) : this.getItems(cssClasses)));
|
|
5514
5596
|
}
|
|
@@ -5543,6 +5625,8 @@
|
|
|
5543
5625
|
constructor(props) {
|
|
5544
5626
|
super(props);
|
|
5545
5627
|
this.handleOnChange = this.handleOnChange.bind(this);
|
|
5628
|
+
this.handleOnKeyDown = this.handleOnKeyDown.bind(this);
|
|
5629
|
+
this.handleOnBlur = this.handleOnBlur.bind(this);
|
|
5546
5630
|
}
|
|
5547
5631
|
getStateElement() {
|
|
5548
5632
|
return this.item;
|
|
@@ -5573,6 +5657,12 @@
|
|
|
5573
5657
|
get question() {
|
|
5574
5658
|
return this.props.question;
|
|
5575
5659
|
}
|
|
5660
|
+
handleOnKeyDown(event) {
|
|
5661
|
+
this.question.onChoiceKeyDown(event.nativeEvent);
|
|
5662
|
+
}
|
|
5663
|
+
handleOnBlur(event) {
|
|
5664
|
+
this.question.onChoiceFocusOut(event.nativeEvent);
|
|
5665
|
+
}
|
|
5576
5666
|
handleOnChange(event) {
|
|
5577
5667
|
if (this.question.isReadOnlyAttr)
|
|
5578
5668
|
return;
|
|
@@ -5620,10 +5710,11 @@
|
|
|
5620
5710
|
null));
|
|
5621
5711
|
}
|
|
5622
5712
|
const renderedItem = (_$1("div", { className: itemClass },
|
|
5623
|
-
_$1("label", { className: cssClasses.label },
|
|
5624
|
-
_$1("input", { className: cssClasses.itemControl, id: this.question.getItemId(item), type: this.question.inputType, name: this.question.questionName, checked: isChecked, value: item.value, disabled: !this.question.getItemEnabled(item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange, required: this.question.inputRequiredAttribute, "aria-label": item.locText.renderedHtml, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
|
|
5713
|
+
_$1("label", { className: cssClasses.label, onMouseDown: () => this.question.onMouseDown() },
|
|
5714
|
+
_$1("input", { className: cssClasses.itemControl, id: this.question.getItemId(item), type: this.question.inputType, name: this.question.questionName, checked: isChecked, value: item.value, disabled: !this.question.getItemEnabled(item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange, onKeyDown: this.handleOnKeyDown, onBlur: this.handleOnBlur, required: this.question.inputRequiredAttribute, "aria-label": item.locText.renderedHtml, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, "aria-keyshortcuts": this.question.getItemAriaKeyShortcuts(item) }),
|
|
5625
5715
|
_$1("div", { className: this.question.cssClasses.itemDecorator },
|
|
5626
5716
|
_$1("div", { className: this.question.cssClasses.imageContainer },
|
|
5717
|
+
this.question.getChoiceKeyBadge(item) ? _$1("span", { className: this.question.getItemShortcutKeyClass(item), "aria-hidden": "true" }, this.question.getChoiceKeyBadge(item)) : null,
|
|
5627
5718
|
!!this.question.cssClasses.checkedItemDecorator ?
|
|
5628
5719
|
_$1("span", { className: this.question.cssClasses.checkedItemDecorator, "aria-hidden": "true" }, !!this.question.cssClasses.checkedItemSvgIconId ? _$1(SvgIcon, { size: "auto", className: this.question.cssClasses.checkedItemSvgIcon, iconName: this.question.cssClasses.checkedItemSvgIconId }) : null) : null,
|
|
5629
5720
|
control),
|
|
@@ -5944,6 +6035,26 @@
|
|
|
5944
6035
|
return _$1(SurveyActionBarItemDropdown, props);
|
|
5945
6036
|
});
|
|
5946
6037
|
|
|
6038
|
+
// The bar under the records of a dynamic panel and of a matrix: the pager.
|
|
6039
|
+
class SurveyRecordsBar extends SurveyElementBase {
|
|
6040
|
+
get model() {
|
|
6041
|
+
return this.props.model;
|
|
6042
|
+
}
|
|
6043
|
+
getStateElement() {
|
|
6044
|
+
return this.model;
|
|
6045
|
+
}
|
|
6046
|
+
renderElement() {
|
|
6047
|
+
if (!this.model.isVisible)
|
|
6048
|
+
return null;
|
|
6049
|
+
const css = this.model.cssClasses;
|
|
6050
|
+
return _$1("div", { className: css.root },
|
|
6051
|
+
_$1("div", { className: css.pager }, ReactElementFactory.Instance.createElement("sv-action-bar", { model: this.model.pagerActions })));
|
|
6052
|
+
}
|
|
6053
|
+
}
|
|
6054
|
+
ReactElementFactory.Instance.registerElement("sv-records-bar", (props) => {
|
|
6055
|
+
return _$1(SurveyRecordsBar, props);
|
|
6056
|
+
});
|
|
6057
|
+
|
|
5947
6058
|
class LogoImage extends x$2 {
|
|
5948
6059
|
constructor(props) {
|
|
5949
6060
|
super(props);
|
|
@@ -6265,7 +6376,7 @@
|
|
|
6265
6376
|
}
|
|
6266
6377
|
};
|
|
6267
6378
|
const preact = React;
|
|
6268
|
-
surveyCore.checkLibraryVersion(`${"3.2.
|
|
6379
|
+
surveyCore.checkLibraryVersion(`${"3.2.2"}`, "survey-js-ui");
|
|
6269
6380
|
|
|
6270
6381
|
Object.defineProperty(exports, 'Model', {
|
|
6271
6382
|
enumerable: true,
|
|
@@ -6391,6 +6502,7 @@
|
|
|
6391
6502
|
exports.SurveyQuestionTagbox = SurveyQuestionTagbox;
|
|
6392
6503
|
exports.SurveyQuestionTagboxItem = SurveyQuestionTagboxItem;
|
|
6393
6504
|
exports.SurveyQuestionText = SurveyQuestionText;
|
|
6505
|
+
exports.SurveyRecordsBar = SurveyRecordsBar;
|
|
6394
6506
|
exports.SurveyRow = SurveyRow;
|
|
6395
6507
|
exports.SurveyTimerPanel = SurveyTimerPanel;
|
|
6396
6508
|
exports.SurveyWindow = SurveyWindow;
|