superdesk-ui-framework 3.0.57 → 3.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,6 +48,9 @@ export class RadioButtonGroup extends React.Component<IProps> {
|
|
48
48
|
[`sd-check-button__group--grid`]: this.props.group?.grid,
|
49
49
|
[`sd-check-button__group--padded`]: this.props.group?.padded === true,
|
50
50
|
});
|
51
|
+
|
52
|
+
const selectedOption = this.props.value == null ? undefined : this.props.options.find(({value}) => value === this.props.value);
|
53
|
+
|
51
54
|
return (
|
52
55
|
<React.Fragment>
|
53
56
|
{!this.props.group?.groupLabel ?
|
@@ -56,6 +59,7 @@ export class RadioButtonGroup extends React.Component<IProps> {
|
|
56
59
|
className={classes}
|
57
60
|
aria-labelledby={this.props.group?.groupLabelledBy}
|
58
61
|
data-test-id={this.props['data-test-id']}
|
62
|
+
data-test-value={selectedOption == null ? undefined : selectedOption.label}
|
59
63
|
>{
|
60
64
|
this.props.options.map((item: any, index: number) => (
|
61
65
|
<span className="sd-check-button sd-check-button--native"
|
@@ -86,7 +90,11 @@ export class RadioButtonGroup extends React.Component<IProps> {
|
|
86
90
|
}</div>
|
87
91
|
: null }
|
88
92
|
{this.props.group?.groupLabel ?
|
89
|
-
<div
|
93
|
+
<div
|
94
|
+
className='sd-check-button__group-wrapper'
|
95
|
+
data-test-id={this.props['data-test-id']}
|
96
|
+
data-test-value={selectedOption == null ? undefined : selectedOption.label}
|
97
|
+
>
|
90
98
|
|
91
99
|
<FormLabel forId={this.htmlId + 'group'} text={this.props.group.groupLabel} />
|
92
100
|
<div role="radiogroup" id={this.htmlId + 'group'} className={classes}>{
|
package/dist/examples.bundle.js
CHANGED
@@ -78582,9 +78582,13 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
78582
78582
|
_a["sd-check-button__group--grid"] = (_g = this.props.group) === null || _g === void 0 ? void 0 : _g.grid,
|
78583
78583
|
_a["sd-check-button__group--padded"] = ((_h = this.props.group) === null || _h === void 0 ? void 0 : _h.padded) === true,
|
78584
78584
|
_a));
|
78585
|
+
var selectedOption = this.props.value == null ? undefined : this.props.options.find(function (_a) {
|
78586
|
+
var value = _a.value;
|
78587
|
+
return value === _this.props.value;
|
78588
|
+
});
|
78585
78589
|
return (React.createElement(React.Fragment, null,
|
78586
78590
|
!((_j = this.props.group) === null || _j === void 0 ? void 0 : _j.groupLabel) ?
|
78587
|
-
React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy, "data-test-id": this.props['data-test-id'] }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
|
78591
|
+
React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy, "data-test-id": this.props['data-test-id'], "data-test-value": selectedOption == null ? undefined : selectedOption.label }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
|
78588
78592
|
React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: _this.props.tabindex, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
|
78589
78593
|
React.createElement("label", { className: "sd-check-button__text-label", htmlFor: _this.htmlId + index, "aria-label": item.labelHidden ? item.label : undefined, "data-test-id": "item" },
|
78590
78594
|
item.icon ? React.createElement("i", { className: "icon-".concat(item.icon), "aria-hidden": "true" }) : null,
|
@@ -78592,7 +78596,7 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
78592
78596
|
React.createElement("span", { className: "sd-check-button__text-label-inner" }, item.label) : null))); }))
|
78593
78597
|
: null,
|
78594
78598
|
((_l = this.props.group) === null || _l === void 0 ? void 0 : _l.groupLabel) ?
|
78595
|
-
React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'] },
|
78599
|
+
React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'], "data-test-value": selectedOption == null ? undefined : selectedOption.label },
|
78596
78600
|
React.createElement(FormLabel_1.FormLabel, { forId: this.htmlId + 'group', text: this.props.group.groupLabel }),
|
78597
78601
|
React.createElement("div", { role: "radiogroup", id: this.htmlId + 'group', className: classes }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: -1 },
|
78598
78602
|
React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: 0, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
|
@@ -144092,7 +144096,7 @@ exports.ResizablePanelsDoc = ResizablePanelsDoc;
|
|
144092
144096
|
/* 692 */
|
144093
144097
|
/***/ (function(module, exports) {
|
144094
144098
|
|
144095
|
-
module.exports = {"name":"superdesk-ui-framework","version":"3.0.
|
144099
|
+
module.exports = {"name":"superdesk-ui-framework","version":"3.0.58","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build","unit-test":"mocha","debug-unit-tests":"mocha --inspect-brk"},"devDependencies":{"@types/assert":"^1.5.6","@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/enzyme":"^3.10.12","@types/lodash":"^4.14.161","@types/mocha":"^9.1.1","@types/react":"16.8.23","@types/react-beautiful-dnd":"^13.1.2","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","@types/react-scrollspy":"^3.3.5","@typescript-eslint/parser":"^5.58.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","jsdom":"20.0.3","jsdom-global":"3.0.2","lodash":"4.17.21","mocha":"^8.4.0","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","ts-node":"^10.9.1","tslint":"^5.18.0","typescript":"4.9.5","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-12","@superdesk/react-resizable-panels":"0.0.39","@types/enzyme-adapter-react-16":"^1.0.6","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.7","moment":"^2.29.3","popper-max-size-modifier":"^0.2.0","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-popper":"^2.2.3","react-scrollspy":"^3.4.3"}}
|
144096
144100
|
|
144097
144101
|
/***/ }),
|
144098
144102
|
/* 693 */
|
@@ -77843,9 +77843,13 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
77843
77843
|
_a["sd-check-button__group--grid"] = (_g = this.props.group) === null || _g === void 0 ? void 0 : _g.grid,
|
77844
77844
|
_a["sd-check-button__group--padded"] = ((_h = this.props.group) === null || _h === void 0 ? void 0 : _h.padded) === true,
|
77845
77845
|
_a));
|
77846
|
+
var selectedOption = this.props.value == null ? undefined : this.props.options.find(function (_a) {
|
77847
|
+
var value = _a.value;
|
77848
|
+
return value === _this.props.value;
|
77849
|
+
});
|
77846
77850
|
return (React.createElement(React.Fragment, null,
|
77847
77851
|
!((_j = this.props.group) === null || _j === void 0 ? void 0 : _j.groupLabel) ?
|
77848
|
-
React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy, "data-test-id": this.props['data-test-id'] }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
|
77852
|
+
React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy, "data-test-id": this.props['data-test-id'], "data-test-value": selectedOption == null ? undefined : selectedOption.label }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
|
77849
77853
|
React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: _this.props.tabindex, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
|
77850
77854
|
React.createElement("label", { className: "sd-check-button__text-label", htmlFor: _this.htmlId + index, "aria-label": item.labelHidden ? item.label : undefined, "data-test-id": "item" },
|
77851
77855
|
item.icon ? React.createElement("i", { className: "icon-".concat(item.icon), "aria-hidden": "true" }) : null,
|
@@ -77853,7 +77857,7 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
77853
77857
|
React.createElement("span", { className: "sd-check-button__text-label-inner" }, item.label) : null))); }))
|
77854
77858
|
: null,
|
77855
77859
|
((_l = this.props.group) === null || _l === void 0 ? void 0 : _l.groupLabel) ?
|
77856
|
-
React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'] },
|
77860
|
+
React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'], "data-test-value": selectedOption == null ? undefined : selectedOption.label },
|
77857
77861
|
React.createElement(FormLabel_1.FormLabel, { forId: this.htmlId + 'group', text: this.props.group.groupLabel }),
|
77858
77862
|
React.createElement("div", { role: "radiogroup", id: this.htmlId + 'group', className: classes }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: -1 },
|
77859
77863
|
React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: 0, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
|
package/package.json
CHANGED
@@ -70,9 +70,13 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
70
70
|
_a["sd-check-button__group--grid"] = (_g = this.props.group) === null || _g === void 0 ? void 0 : _g.grid,
|
71
71
|
_a["sd-check-button__group--padded"] = ((_h = this.props.group) === null || _h === void 0 ? void 0 : _h.padded) === true,
|
72
72
|
_a));
|
73
|
+
var selectedOption = this.props.value == null ? undefined : this.props.options.find(function (_a) {
|
74
|
+
var value = _a.value;
|
75
|
+
return value === _this.props.value;
|
76
|
+
});
|
73
77
|
return (React.createElement(React.Fragment, null,
|
74
78
|
!((_j = this.props.group) === null || _j === void 0 ? void 0 : _j.groupLabel) ?
|
75
|
-
React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy, "data-test-id": this.props['data-test-id'] }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
|
79
|
+
React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy, "data-test-id": this.props['data-test-id'], "data-test-value": selectedOption == null ? undefined : selectedOption.label }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
|
76
80
|
React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: _this.props.tabindex, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
|
77
81
|
React.createElement("label", { className: "sd-check-button__text-label", htmlFor: _this.htmlId + index, "aria-label": item.labelHidden ? item.label : undefined, "data-test-id": "item" },
|
78
82
|
item.icon ? React.createElement("i", { className: "icon-".concat(item.icon), "aria-hidden": "true" }) : null,
|
@@ -80,7 +84,7 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
80
84
|
React.createElement("span", { className: "sd-check-button__text-label-inner" }, item.label) : null))); }))
|
81
85
|
: null,
|
82
86
|
((_l = this.props.group) === null || _l === void 0 ? void 0 : _l.groupLabel) ?
|
83
|
-
React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'] },
|
87
|
+
React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'], "data-test-value": selectedOption == null ? undefined : selectedOption.label },
|
84
88
|
React.createElement(FormLabel_1.FormLabel, { forId: this.htmlId + 'group', text: this.props.group.groupLabel }),
|
85
89
|
React.createElement("div", { role: "radiogroup", id: this.htmlId + 'group', className: classes }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: -1 },
|
86
90
|
React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: 0, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
|