superdesk-ui-framework 3.0.53 → 3.0.55
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/app/styles/_sd-tag-input.scss +213 -215
- package/app/styles/primereact/_pr-general.scss +2 -2
- package/app-typescript/components/DatePicker.tsx +8 -0
- package/app-typescript/components/Input.tsx +2 -0
- package/app-typescript/components/RadioButtonGroup.tsx +8 -2
- package/app-typescript/components/SelectWithTemplate.tsx +12 -2
- package/app-typescript/components/TabCustom.tsx +9 -2
- package/app-typescript/components/TimePicker.tsx +2 -0
- package/app-typescript/components/TreeSelect/TreeSelect.tsx +120 -107
- package/app-typescript/components/avatar/avatar-image.tsx +17 -5
- package/dist/examples.bundle.js +114 -84
- package/dist/superdesk-ui.bundle.css +186 -202
- package/dist/superdesk-ui.bundle.js +113 -83
- package/package.json +1 -1
- package/react/components/DatePicker.d.ts +1 -0
- package/react/components/DatePicker.js +4 -0
- package/react/components/Input.d.ts +1 -0
- package/react/components/Input.js +1 -1
- package/react/components/RadioButtonGroup.d.ts +1 -0
- package/react/components/RadioButtonGroup.js +2 -2
- package/react/components/SelectWithTemplate.d.ts +3 -0
- package/react/components/SelectWithTemplate.js +7 -1
- package/react/components/TabCustom.d.ts +2 -1
- package/react/components/TabCustom.js +9 -9
- package/react/components/TimePicker.d.ts +1 -0
- package/react/components/TimePicker.js +1 -1
- package/react/components/TreeSelect/TreeSelect.d.ts +1 -0
- package/react/components/TreeSelect/TreeSelect.js +70 -64
- package/react/components/avatar/avatar-image.js +19 -5
package/dist/examples.bundle.js
CHANGED
@@ -39175,6 +39175,17 @@ var __extends = (this && this.__extends) || (function () {
|
|
39175
39175
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
39176
39176
|
};
|
39177
39177
|
})();
|
39178
|
+
var __assign = (this && this.__assign) || function () {
|
39179
|
+
__assign = Object.assign || function(t) {
|
39180
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
39181
|
+
s = arguments[i];
|
39182
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
39183
|
+
t[p] = s[p];
|
39184
|
+
}
|
39185
|
+
return t;
|
39186
|
+
};
|
39187
|
+
return __assign.apply(this, arguments);
|
39188
|
+
};
|
39178
39189
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
39179
39190
|
if (k2 === undefined) k2 = k;
|
39180
39191
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
@@ -39208,15 +39219,18 @@ var AvatarContentImage = /** @class */ (function (_super) {
|
|
39208
39219
|
}
|
39209
39220
|
AvatarContentImage.prototype.render = function () {
|
39210
39221
|
var _a = this.props, imageUrl = _a.imageUrl, tooltipText = _a.tooltipText, onClick = _a.onClick;
|
39211
|
-
var
|
39222
|
+
var maybeButtonProps = onClick == null ? {} : {
|
39223
|
+
role: 'button',
|
39224
|
+
onClick: function () { return onClick(); },
|
39225
|
+
};
|
39212
39226
|
if (imageUrl == null) {
|
39213
|
-
return (React.createElement("span", { className: "sd-avatar-content sd-avatar-content--dummy-img", title: tooltipText
|
39227
|
+
return (React.createElement("span", __assign({}, maybeButtonProps, { className: "sd-avatar-content sd-avatar-content--dummy-img", title: tooltipText }),
|
39214
39228
|
React.createElement("svg", { width: "200", height: "200", viewBox: "0 0 200 200", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
39215
|
-
React.createElement("circle", { cx: "100", cy: "100", r: "100", fill: "white",
|
39216
|
-
React.createElement("path", {
|
39229
|
+
React.createElement("circle", { cx: "100", cy: "100", r: "100", fill: "white", fillOpacity: "0.01" }),
|
39230
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M40 153V145.384C40 141.557 41.16 137.981 43.16 135C49.14 126.057 66.24 119.711 77.14 118C82.74 117.115 90.16 116.538 100 116.538C109.84 116.538 117.26 117.115 122.86 118C133.76 119.711 150.86 126.057 156.84 135C158.84 137.981 160 141.557 160 145.384V153C150 165 130 180 100 180C70 180 50 165 40 153ZM100 30C122.08 30 140 47.2307 140 68.4614C140 89.6922 122.08 106.923 100 106.923C77.92 106.923 60 89.6922 60 68.4614C60 47.2307 77.92 30 100 30Z", fill: "var(--sd-colour-avatar-dummy)", fillOpacity: "1" }))));
|
39217
39231
|
}
|
39218
39232
|
else {
|
39219
|
-
return (React.createElement("span", { className: "sd-avatar-content", title: tooltipText
|
39233
|
+
return (React.createElement("span", __assign({}, maybeButtonProps, { className: "sd-avatar-content", title: tooltipText }),
|
39220
39234
|
React.createElement("img", { src: imageUrl })));
|
39221
39235
|
}
|
39222
39236
|
};
|
@@ -40133,6 +40147,10 @@ var DatePicker = /** @class */ (function (_super) {
|
|
40133
40147
|
return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, htmlId: this.htmlId, tabindex: this.props.tabindex },
|
40134
40148
|
React.createElement(calendar_1.Calendar, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', ref: function (ref) {
|
40135
40149
|
_this.instance = ref;
|
40150
|
+
var refAny = ref;
|
40151
|
+
if (_this.props['data-test-id'] != null && (refAny === null || refAny === void 0 ? void 0 : refAny.inputElement) != null) {
|
40152
|
+
refAny.inputElement.setAttribute('data-test-id', _this.props['data-test-id']);
|
40153
|
+
}
|
40136
40154
|
}, value: this.state.value === null ? undefined : this.state.value, onChange: function (event) {
|
40137
40155
|
var result = parseFromPrimeReactCalendarFormat(event.value);
|
40138
40156
|
if (result !== 'failed-to-parse') {
|
@@ -64126,7 +64144,7 @@ var TimePicker = /** @class */ (function (_super) {
|
|
64126
64144
|
return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, htmlId: this.htmlId, tabindex: this.props.tabindex },
|
64127
64145
|
React.createElement("input", { value: this.props.value, type: "time", className: "sd-input__input", id: this.htmlId, "aria-labelledby": this.htmlId + 'label', step: this.props.allowSeconds ? 1 : undefined, required: this.props.required, disabled: this.props.disabled, onChange: function (event) {
|
64128
64146
|
_this.props.onChange(event.target.value);
|
64129
|
-
} })));
|
64147
|
+
}, "data-test-id": this.props['data-test-id'] })));
|
64130
64148
|
};
|
64131
64149
|
return TimePicker;
|
64132
64150
|
}(React.PureComponent));
|
@@ -64489,6 +64507,7 @@ var Label_1 = __webpack_require__(36);
|
|
64489
64507
|
var SelectPreview_1 = __webpack_require__(75);
|
64490
64508
|
var TreeSelectPill_1 = __webpack_require__(513);
|
64491
64509
|
var TreeSelectItem_1 = __webpack_require__(514);
|
64510
|
+
var react_dom_1 = __webpack_require__(8);
|
64492
64511
|
var TreeSelect = /** @class */ (function (_super) {
|
64493
64512
|
__extends(TreeSelect, _super);
|
64494
64513
|
function TreeSelect(props) {
|
@@ -64507,8 +64526,9 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
64507
64526
|
(_a = _this.categoryButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
64508
64527
|
};
|
64509
64528
|
_this.onMouseDown = function (event) {
|
64510
|
-
var _a;
|
64511
|
-
if ((((_a = _this.
|
64529
|
+
var _a, _b;
|
64530
|
+
if ((((_a = _this.dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) !== true)
|
64531
|
+
&& (((_b = _this.treeSelectRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)) !== true)
|
64512
64532
|
&& _this.state.openDropdown) {
|
64513
64533
|
_this.setState({ openDropdown: false });
|
64514
64534
|
}
|
@@ -64911,6 +64931,7 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
64911
64931
|
};
|
64912
64932
|
TreeSelect.prototype.render = function () {
|
64913
64933
|
var _this = this;
|
64934
|
+
var _a;
|
64914
64935
|
if (this.props.preview) {
|
64915
64936
|
return (React.createElement(SelectPreview_1.SelectPreview, { kind: this.props.allowMultiple
|
64916
64937
|
? {
|
@@ -64923,67 +64944,70 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
64923
64944
|
}, items: this.state.value, valueTemplate: this.props.valueTemplate, getLabel: this.props.getLabel }));
|
64924
64945
|
}
|
64925
64946
|
return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, htmlId: this.htmlId, tabindex: this.props.tabindex },
|
64926
|
-
React.createElement("div", { className: "tags-input sd-input__input tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef },
|
64927
|
-
|
64928
|
-
|
64929
|
-
this.props.
|
64930
|
-
|
64947
|
+
React.createElement("div", { className: "tags-input sd-input__input tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef }, this.props.allowMultiple
|
64948
|
+
? React.createElement("div", { className: "tags-input__tags" },
|
64949
|
+
this.props.readOnly
|
64950
|
+
|| React.createElement("button", { ref: this.openDropdownRef, className: "tags-input__add-button ".concat(this.props.disabled ? 'tags-input__add-button--disabled' : ''), onClick: function (e) {
|
64951
|
+
e.stopPropagation();
|
64952
|
+
if (!_this.props.disabled) {
|
64953
|
+
_this.setState({ openDropdown: !_this.state.openDropdown });
|
64954
|
+
}
|
64955
|
+
} },
|
64956
|
+
React.createElement("i", { className: "icon-plus-large" })),
|
64957
|
+
React.createElement("ul", { className: "tags-input__tag-list" }, this.state.value.map(function (item, i) {
|
64958
|
+
var Wrapper = function (_a) {
|
64959
|
+
var backgroundColor = _a.backgroundColor, children = _a.children;
|
64960
|
+
return (React.createElement(TreeSelectPill_1.TreeSelectPill, { item: item, readOnly: _this.props.readOnly, disabled: _this.props.disabled, valueTemplate: _this.props.valueTemplate, backgroundColor: backgroundColor, onRemove: function () { return _this.removeClick(i); }, getBackgroundColor: _this.props.getBackgroundColor }, children));
|
64961
|
+
};
|
64962
|
+
return (React.createElement(React.Fragment, { key: i }, _this.props.valueTemplate
|
64963
|
+
? _this.props.valueTemplate(item, Wrapper)
|
64964
|
+
: (React.createElement(Wrapper, null,
|
64965
|
+
React.createElement("span", null, _this.props.getLabel(item))))));
|
64966
|
+
})),
|
64967
|
+
this.state.value.length > 0
|
64968
|
+
? (this.props.readOnly || this.props.disabled)
|
64969
|
+
|| React.createElement("button", { className: "tags-input__remove-value", style: { position: 'relative', bottom: '2px' }, onClick: function (e) {
|
64931
64970
|
e.stopPropagation();
|
64932
|
-
|
64933
|
-
_this.setState({ openDropdown: !_this.state.openDropdown });
|
64934
|
-
}
|
64971
|
+
_this.setState({ value: [] });
|
64935
64972
|
} },
|
64936
|
-
React.createElement(
|
64937
|
-
|
64938
|
-
|
64939
|
-
|
64940
|
-
|
64941
|
-
|
64942
|
-
|
64943
|
-
|
64944
|
-
|
64945
|
-
|
64946
|
-
|
64947
|
-
|
64948
|
-
|
64949
|
-
|
64950
|
-
|
64951
|
-
|
64952
|
-
|
64953
|
-
React.createElement(
|
64954
|
-
|
64955
|
-
|
64956
|
-
|
64957
|
-
|
64958
|
-
_this.
|
64959
|
-
|
64960
|
-
|
64961
|
-
|
64962
|
-
|
64963
|
-
|
64964
|
-
|
64965
|
-
|
64966
|
-
|
64967
|
-
|
64968
|
-
|
64969
|
-
|
64970
|
-
|
64971
|
-
|
64972
|
-
|
64973
|
-
|
64974
|
-
React.createElement("span", { className: backgroundColor && "tags-input__tag-item", style: { backgroundColor: backgroundColor, margin: 0 } }, children),
|
64975
|
-
_this.props.readOnly
|
64976
|
-
|| React.createElement("span", { className: "tags-input__remove-button" },
|
64977
|
-
React.createElement(Icon_1.Icon, { name: 'remove-sign' })))));
|
64978
|
-
};
|
64979
|
-
return React.createElement(React.Fragment, { key: i }, _this.props.valueTemplate
|
64980
|
-
? _this.props.valueTemplate(item, Wrapper)
|
64981
|
-
: (React.createElement(Wrapper, null,
|
64982
|
-
React.createElement("span", null, _this.props.getLabel(item)))));
|
64983
|
-
})),
|
64984
|
-
this.state.openDropdown
|
64985
|
-
&& React.createElement("div", { className: "autocomplete autocomplete--multi-select"
|
64986
|
-
+ (this.props.width === 'medium' ? ' autocomplete--fixed-width' : ''), style: { zIndex: this.props.zIndex }, ref: this.dropdownRef },
|
64973
|
+
React.createElement(Icon_1.Icon, { name: 'remove-sign' }))
|
64974
|
+
: null)
|
64975
|
+
: React.createElement("div", { className: "tags-input__tags" },
|
64976
|
+
this.props.readOnly
|
64977
|
+
|| React.createElement("button", { className: "tags-input__overlay-button", ref: this.openDropdownRef, onClick: function () {
|
64978
|
+
_this.setState({ openDropdown: !_this.state.openDropdown });
|
64979
|
+
}, "data-test-id": this.state.openDropdown ? undefined : this.props['data-test-id'] }),
|
64980
|
+
this.state.value.length < 1
|
64981
|
+
&& React.createElement("span", { className: 'tags-input__single-item'
|
64982
|
+
+ (this.props.readOnly ? ' tags-input__tag-item--readonly' : '') },
|
64983
|
+
React.createElement("span", { className: "tags-input__placeholder" }, this.props.placeholder)),
|
64984
|
+
this.state.value.map(function (item, i) {
|
64985
|
+
var Wrapper = function (_a) {
|
64986
|
+
var backgroundColor = _a.backgroundColor, borderColor = _a.borderColor, children = _a.children;
|
64987
|
+
return (React.createElement("span", { className: 'tags-input__single-item'
|
64988
|
+
+ (_this.props.readOnly ? ' tags-input__tag-item--readonly' : ''), onClick: function () { return !_this.props.readOnly && _this.removeClick(i); } },
|
64989
|
+
_this.props.getBorderColor
|
64990
|
+
&& React.createElement("div", { className: "item-border item-border-selected", style: borderColor
|
64991
|
+
? { backgroundColor: borderColor }
|
64992
|
+
: { backgroundColor: _this.props.getBorderColor(item) } }),
|
64993
|
+
React.createElement("span", { className: "tags-input__helper-box", style: { color: backgroundColor && (0, Label_1.getTextColor)(backgroundColor) } },
|
64994
|
+
React.createElement("span", { className: backgroundColor && "tags-input__tag-item", style: { backgroundColor: backgroundColor, margin: 0 } }, children),
|
64995
|
+
_this.props.readOnly
|
64996
|
+
|| React.createElement("span", { className: "tags-input__remove-button" },
|
64997
|
+
React.createElement(Icon_1.Icon, { name: 'remove-sign' })))));
|
64998
|
+
};
|
64999
|
+
return React.createElement(React.Fragment, { key: i }, _this.props.valueTemplate
|
65000
|
+
? _this.props.valueTemplate(item, Wrapper)
|
65001
|
+
: (React.createElement(Wrapper, null,
|
65002
|
+
React.createElement("span", null, _this.props.getLabel(item)))));
|
65003
|
+
}))),
|
65004
|
+
(0, react_dom_1.createPortal)(this.state.openDropdown
|
65005
|
+
&& React.createElement("div", { id: 'TREESELECT_DROPDOWN', "data-test-id": this.props['data-test-id'] },
|
65006
|
+
React.createElement("div", { className: "autocomplete autocomplete--multi-select"
|
65007
|
+
+ (this.props.width === 'medium' ? ' autocomplete--fixed-width' : ''), style: {
|
65008
|
+
zIndex: this.props.zIndex,
|
65009
|
+
width: (_a = this.treeSelectRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth,
|
65010
|
+
}, ref: this.dropdownRef },
|
64987
65011
|
React.createElement("div", { className: 'autocomplete__header' },
|
64988
65012
|
React.createElement("div", { className: "autocomplete__icon", onClick: function () {
|
64989
65013
|
_this.backButton();
|
@@ -65007,7 +65031,7 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
65007
65031
|
else {
|
65008
65032
|
return;
|
65009
65033
|
}
|
65010
|
-
} }))),
|
65034
|
+
}, "data-test-id": "filter-input" }))),
|
65011
65035
|
(this.state.activeTree.length > 0 && this.state.buttonValue != null)
|
65012
65036
|
&& React.createElement("div", { className: 'autocomplete__category-header' },
|
65013
65037
|
React.createElement("div", { className: "autocomplete__icon", onClick: function () {
|
@@ -65025,7 +65049,7 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
65025
65049
|
React.createElement(Loader_1.Loader, { overlay: true }))
|
65026
65050
|
: this.state.searchFieldValue === ''
|
65027
65051
|
? this.props.getOptions
|
65028
|
-
? React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select", ref: this.ref }, this.state.options.map(function (option, i) {
|
65052
|
+
? React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select", ref: this.ref, "data-test-id": "options" }, this.state.options.map(function (option, i) {
|
65029
65053
|
var selectedItem = _this.state.value.some(function (obj) {
|
65030
65054
|
return _this.props.getId(obj) === _this.props.getId(option.value);
|
65031
65055
|
});
|
@@ -65038,7 +65062,7 @@ var TreeSelect = /** @class */ (function (_super) {
|
|
65038
65062
|
: null
|
65039
65063
|
: React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select", ref: this.ref }, this.filteredItem(this.props.singleLevelSearch
|
65040
65064
|
? this.state.options
|
65041
|
-
: this.state.filterArr))))));
|
65065
|
+
: this.state.filterArr)))), document.body)));
|
65042
65066
|
};
|
65043
65067
|
return TreeSelect;
|
65044
65068
|
}(React.Component));
|
@@ -66713,7 +66737,7 @@ var Input = /** @class */ (function (_super) {
|
|
66713
66737
|
React.createElement("span", null, this.props.value)));
|
66714
66738
|
}
|
66715
66739
|
return (React.createElement(InputWrapper_1.InputWrapper, { label: this.props.label, required: this.props.required, disabled: this.props.disabled, value: this.props.value, error: this.props.error, invalid: this.props.error != null, info: this.props.info, maxLength: this.props.maxLength, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, size: (_a = this.props.size) !== null && _a !== void 0 ? _a : 'medium', fullWidth: this.props.fullWidth, htmlId: this.htmlId, boxedStyle: this.props.boxedStyle, boxedLable: this.props.boxedLable, tabindex: this.props.tabindex },
|
66716
|
-
React.createElement("input", { className: 'sd-input__input', type: (_b = this.props.type) !== null && _b !== void 0 ? _b : 'text', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, placeholder: this.props.placeholder, disabled: this.props.disabled })));
|
66740
|
+
React.createElement("input", { className: 'sd-input__input', type: (_b = this.props.type) !== null && _b !== void 0 ? _b : 'text', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, placeholder: this.props.placeholder, disabled: this.props.disabled, "data-test-id": this.props['data-test-id'] })));
|
66717
66741
|
};
|
66718
66742
|
return Input;
|
66719
66743
|
}(React.Component));
|
@@ -67428,6 +67452,7 @@ var SelectWithTemplate = /** @class */ (function (_super) {
|
|
67428
67452
|
var _this = this;
|
67429
67453
|
var _a;
|
67430
67454
|
var ItemTemplate = this.props.itemTemplate;
|
67455
|
+
var ValueTemplate = this.props.valueTemplate;
|
67431
67456
|
var _b = this.state, loading = _b.loading, options = _b.options;
|
67432
67457
|
var _c = this.props, value = _c.value, onChange = _c.onChange, getLabel = _c.getLabel, disabled = _c.disabled, required = _c.required, zIndex = _c.zIndex, autoFocus = _c.autoFocus, areEqual = _c.areEqual, getItems = _c.getItems, emptyFilterMessage = _c.noResultsFoundMessage, filterPlaceholder = _c.filterPlaceholder, width = _c.width;
|
67433
67458
|
// Using another data structure so it is possible to have getLabel function
|
@@ -67451,7 +67476,12 @@ var SelectWithTemplate = /** @class */ (function (_super) {
|
|
67451
67476
|
return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
|
67452
67477
|
React.createElement(dropdown_1.Dropdown, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', value: valueInternal, options: optionsInternal, onChange: function (e) {
|
67453
67478
|
onChange(e.value == null ? null : e.value.original);
|
67454
|
-
}, placeholder: fakePlaceholderWithNonBreakingSpace, filterPlaceholder: filterPlaceholder, filter: true, filterBy: labelKey, showClear: !required, emptyFilterMessage: emptyFilterMessage,
|
67479
|
+
}, placeholder: fakePlaceholderWithNonBreakingSpace, filterPlaceholder: filterPlaceholder, filter: true, filterBy: labelKey, showClear: !required, emptyFilterMessage: emptyFilterMessage, itemTemplate: function (option) { var _a; return React.createElement(ItemTemplate, { option: (_a = option === null || option === void 0 ? void 0 : option.original) !== null && _a !== void 0 ? _a : null }); }, valueTemplate: function (option) {
|
67480
|
+
var _a, _b;
|
67481
|
+
return ValueTemplate != null
|
67482
|
+
? (React.createElement(ValueTemplate, { option: (_a = option === null || option === void 0 ? void 0 : option.original) !== null && _a !== void 0 ? _a : null }))
|
67483
|
+
: (React.createElement(ItemTemplate, { option: (_b = option === null || option === void 0 ? void 0 : option.original) !== null && _b !== void 0 ? _b : null }));
|
67484
|
+
}, disabled: disabled, required: required, autoFocus: autoFocus, appendTo: document.body, loading: loading, onFilterInputChange: function (searchString) {
|
67455
67485
|
_this.setState({ loading: true });
|
67456
67486
|
getItems(searchString).then(function (_options) {
|
67457
67487
|
_this.setState({ options: _options, loading: false });
|
@@ -78433,7 +78463,7 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
78433
78463
|
_a));
|
78434
78464
|
return (React.createElement(React.Fragment, null,
|
78435
78465
|
!((_j = this.props.group) === null || _j === void 0 ? void 0 : _j.groupLabel) ?
|
78436
|
-
React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy }, 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 },
|
78466
|
+
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 },
|
78437
78467
|
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 }),
|
78438
78468
|
React.createElement("label", { className: "sd-check-button__text-label", htmlFor: _this.htmlId + index, "aria-label": item.labelHidden ? item.label : undefined },
|
78439
78469
|
item.icon ? React.createElement("i", { className: "icon-".concat(item.icon), "aria-hidden": "true" }) : null,
|
@@ -78441,7 +78471,7 @@ var RadioButtonGroup = /** @class */ (function (_super) {
|
|
78441
78471
|
React.createElement("span", { className: "sd-check-button__text-label-inner" }, item.label) : null))); }))
|
78442
78472
|
: null,
|
78443
78473
|
((_l = this.props.group) === null || _l === void 0 ? void 0 : _l.groupLabel) ?
|
78444
|
-
React.createElement("div", { className: 'sd-check-button__group-wrapper' },
|
78474
|
+
React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'] },
|
78445
78475
|
React.createElement(FormLabel_1.FormLabel, { forId: this.htmlId + 'group', text: this.props.group.groupLabel }),
|
78446
78476
|
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 },
|
78447
78477
|
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 }),
|
@@ -80361,10 +80391,10 @@ var TabLabel = function (_a) {
|
|
80361
80391
|
return (React.createElement("span", null, label));
|
80362
80392
|
};
|
80363
80393
|
exports.TabLabel = TabLabel;
|
80364
|
-
var Tabs = function (
|
80365
|
-
var
|
80366
|
-
var initiallySelectedIndex =
|
80367
|
-
var
|
80394
|
+
var Tabs = function (props) {
|
80395
|
+
var _a;
|
80396
|
+
var initiallySelectedIndex = props.initiallySelectedIndex, size = props.size, theme = props.theme, ariaLabel = props.ariaLabel, children = props.children, onClick = props.onClick;
|
80397
|
+
var _b = React.useState(initiallySelectedIndex !== null && initiallySelectedIndex !== void 0 ? initiallySelectedIndex : 0), index = _b[0], setIndex = _b[1];
|
80368
80398
|
function handleSelected(i) {
|
80369
80399
|
setIndex(i);
|
80370
80400
|
handleClick(i);
|
@@ -80372,11 +80402,11 @@ var Tabs = function (_a) {
|
|
80372
80402
|
var handleClick = function (i) {
|
80373
80403
|
onClick(i);
|
80374
80404
|
};
|
80375
|
-
var classes = (0, classnames_1.default)('sd-nav-tabs', (
|
80376
|
-
|
80377
|
-
|
80378
|
-
|
80379
|
-
return (React.createElement("div", { className: classes, role: 'tablist', "aria-label": ariaLabel ? ariaLabel : 'tabs' }, children.map(function (item, i) { return (React.createElement("button", { key: i, "aria-controls": 'tabpanel-' + i, className: 'sd-nav-tabs__tab' + (index === i ? ' sd-nav-tabs__tab--active' : ''), onClick: function () { return handleSelected(i); }, role: 'tab', "aria-selected": index === i ? 'true' : 'false' }, item)); })));
|
80405
|
+
var classes = (0, classnames_1.default)('sd-nav-tabs', (_a = {},
|
80406
|
+
_a["sd-nav-tabs--".concat(size)] = size && size !== undefined,
|
80407
|
+
_a['sd-nav-tabs--ui-dark'] = theme === 'dark',
|
80408
|
+
_a));
|
80409
|
+
return (React.createElement("div", { className: classes, role: 'tablist', "aria-label": ariaLabel ? ariaLabel : 'tabs', "data-test-id": props['data-test-id'] }, children.map(function (item, i) { return (React.createElement("button", { key: i, "aria-controls": 'tabpanel-' + i, className: 'sd-nav-tabs__tab' + (index === i ? ' sd-nav-tabs__tab--active' : ''), onClick: function () { return handleSelected(i); }, role: 'tab', "aria-selected": index === i ? 'true' : 'false' }, item)); })));
|
80380
80410
|
};
|
80381
80411
|
exports.Tabs = Tabs;
|
80382
80412
|
var TabContent = function (_a) {
|
@@ -143444,7 +143474,7 @@ exports.ResizablePanelsDoc = ResizablePanelsDoc;
|
|
143444
143474
|
/* 689 */
|
143445
143475
|
/***/ (function(module, exports) {
|
143446
143476
|
|
143447
|
-
module.exports = {"name":"superdesk-ui-framework","version":"3.0.
|
143477
|
+
module.exports = {"name":"superdesk-ui-framework","version":"3.0.55","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"}}
|
143448
143478
|
|
143449
143479
|
/***/ }),
|
143450
143480
|
/* 690 */
|