wini-web-components 2.4.9 → 2.5.0
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.
|
@@ -296,41 +296,42 @@ var TSelectMultiple = /** @class */ (function (_super) {
|
|
|
296
296
|
}, className: 'row' },
|
|
297
297
|
react_1.default.createElement(winicon_1.Winicon, { src: this.state.isOpen ? "fill/arrows/up-arrow" : "fill/arrows/down-arrow", size: '1.2rem' })),
|
|
298
298
|
this.state.isOpen &&
|
|
299
|
-
react_dom_1.default.createPortal(react_1.default.createElement(popup_1.PopupOverlay, { className: "
|
|
300
|
-
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
301
|
-
left: this.state.offset.x + 'px',
|
|
302
|
-
width: this.state.offset.width,
|
|
303
|
-
}, onClose: function (ev) {
|
|
299
|
+
react_dom_1.default.createPortal(react_1.default.createElement(popup_1.PopupOverlay, { className: "hidden-overlay", onClose: function (ev) {
|
|
304
300
|
if (ev.target !== _this.inputRef.current)
|
|
305
301
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: false }));
|
|
306
302
|
} },
|
|
307
|
-
react_1.default.createElement("div", {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
303
|
+
react_1.default.createElement("div", { className: "".concat(input_multi_select_module_css_1.default['select-multi-popup'], " select-multi-popup col ").concat((_e = this.props.popupClassName) !== null && _e !== void 0 ? _e : ""), style: (_f = this.state.style) !== null && _f !== void 0 ? _f : {
|
|
304
|
+
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
305
|
+
left: this.state.offset.x + 'px',
|
|
306
|
+
width: this.state.offset.width,
|
|
307
|
+
} },
|
|
308
|
+
react_1.default.createElement("div", { style: { padding: '1.2rem 1.6rem', width: '100%', borderBottom: "var(--neutral-main-border)" } }, (function () {
|
|
309
|
+
var _a, _b;
|
|
310
|
+
var _list = ((_b = (_a = _this.state.search) !== null && _a !== void 0 ? _a : _this.props.options) !== null && _b !== void 0 ? _b : []);
|
|
311
|
+
var isSelectedAll = _list.every(function (item) { return _this.state.value.some(function (vl) { return vl === item.id; }); });
|
|
312
|
+
return react_1.default.createElement(text_1.Text, { onClick: function () {
|
|
313
|
+
var newValue = [];
|
|
314
|
+
if (_list.length) {
|
|
315
|
+
if (isSelectedAll) {
|
|
316
|
+
newValue = _this.state.value.filter(function (vl) { return _list.every(function (item) { return vl !== item.id || item.disabled; }); });
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
newValue = __spreadArray(__spreadArray([], _this.state.value, true), _list.filter(function (item) { return _this.state.value.every(function (vl) { return vl !== item.id; }) && !item.disabled; }).map(function (e) { return e.id; }), true);
|
|
320
|
+
}
|
|
319
321
|
}
|
|
322
|
+
_this.setState(__assign(__assign({}, _this.state), { value: newValue }));
|
|
323
|
+
if (_this.props.onChange)
|
|
324
|
+
_this.props.onChange(newValue);
|
|
325
|
+
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-main-color)' : 'var(--neutral-text-title-color)' } }, _list.length && isSelectedAll ? "".concat(t("remove"), " ").concat(t("all").toLowerCase()) : "".concat(t("select"), " ").concat(t("all").toLowerCase()));
|
|
326
|
+
})()),
|
|
327
|
+
react_1.default.createElement("div", { className: "col ".concat(input_multi_select_module_css_1.default['select-body']), onScroll: this.props.handleLoadmore ? function (ev) {
|
|
328
|
+
if (_this.props.handleLoadmore) {
|
|
329
|
+
var scrollElement = ev.target;
|
|
330
|
+
_this.props.handleLoadmore(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
|
|
320
331
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-main-color)' : 'var(--neutral-text-title-color)' } }, _list.length && isSelectedAll ? "".concat(t("remove"), " ").concat(t("all").toLowerCase()) : "".concat(t("select"), " ").concat(t("all").toLowerCase()));
|
|
325
|
-
})()),
|
|
326
|
-
react_1.default.createElement("div", { className: "col ".concat(input_multi_select_module_css_1.default['select-body']), onScroll: this.props.handleLoadmore ? function (ev) {
|
|
327
|
-
if (_this.props.handleLoadmore) {
|
|
328
|
-
var scrollElement = ev.target;
|
|
329
|
-
_this.props.handleLoadmore(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
|
|
330
|
-
}
|
|
331
|
-
} : undefined },
|
|
332
|
-
((_g = this.state.search) !== null && _g !== void 0 ? _g : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) { return _this.renderOptions(item); }),
|
|
333
|
-
(!((_h = this.state.search) === null || _h === void 0 ? void 0 : _h.length) && !((_j = this.props.options) === null || _j === void 0 ? void 0 : _j.length)) && (react_1.default.createElement("div", { className: input_multi_select_module_css_1.default['no-results-found'] }, t("noResultFound"))))), document.body));
|
|
332
|
+
} : undefined },
|
|
333
|
+
((_g = this.state.search) !== null && _g !== void 0 ? _g : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) { return _this.renderOptions(item); }),
|
|
334
|
+
(!((_h = this.state.search) === null || _h === void 0 ? void 0 : _h.length) && !((_j = this.props.options) === null || _j === void 0 ? void 0 : _j.length)) && (react_1.default.createElement("div", { className: input_multi_select_module_css_1.default['no-results-found'] }, t("noResultFound")))))), document.body));
|
|
334
335
|
};
|
|
335
336
|
return TSelectMultiple;
|
|
336
337
|
}(react_1.default.Component));
|
|
@@ -279,25 +279,26 @@ var TSelect1 = /** @class */ (function (_super) {
|
|
|
279
279
|
}, className: 'row' },
|
|
280
280
|
react_1.default.createElement(winicon_1.Winicon, { src: this.state.isOpen ? "fill/arrows/up-arrow" : "fill/arrows/down-arrow", size: "1.2rem" })),
|
|
281
281
|
this.state.isOpen &&
|
|
282
|
-
react_dom_1.default.createPortal(react_1.default.createElement(popup_1.PopupOverlay, { onOpen: this.props.onOpenOptions, className: "
|
|
283
|
-
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
284
|
-
left: this.state.offset.x + 'px',
|
|
285
|
-
width: this.state.offset.width,
|
|
286
|
-
}, onClose: function (ev) {
|
|
282
|
+
react_dom_1.default.createPortal(react_1.default.createElement(popup_1.PopupOverlay, { onOpen: this.props.onOpenOptions, className: "hidden-overlay", onClose: function (ev) {
|
|
287
283
|
if (ev.target !== _this.inputRef.current)
|
|
288
284
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: false }));
|
|
289
285
|
} },
|
|
290
|
-
react_1.default.createElement("div", { className: "
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
286
|
+
react_1.default.createElement("div", { className: "".concat(select1_module_css_1.default['select1-popup'], " select1-popup col ").concat((_f = this.props.popupClassName) !== null && _f !== void 0 ? _f : ""), style: (_g = this.state.style) !== null && _g !== void 0 ? _g : {
|
|
287
|
+
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
288
|
+
left: this.state.offset.x + 'px',
|
|
289
|
+
width: this.state.offset.width,
|
|
290
|
+
} },
|
|
291
|
+
react_1.default.createElement("div", { className: "col ".concat(select1_module_css_1.default['select-body']), onScroll: this.props.handleLoadmore ? function (ev) {
|
|
292
|
+
if (_this.props.handleLoadmore) {
|
|
293
|
+
var scrollElement = ev.target;
|
|
294
|
+
_this.props.handleLoadmore(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
|
|
295
|
+
}
|
|
296
|
+
} : undefined },
|
|
297
|
+
((_h = this.state.search) !== null && _h !== void 0 ? _h : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) {
|
|
298
|
+
var _a, _b;
|
|
299
|
+
return react_1.default.createElement(OptionsItemTile, { key: item.id, item: item, children: ((_a = _this.state.search) !== null && _a !== void 0 ? _a : _this.state.options).filter(function (e) { return e.parentId === item.id; }), selected: _this.state.selected === item.id, onClick: _this.onSelect, treeData: ((_b = _this.state.search) !== null && _b !== void 0 ? _b : _this.state.options).some(function (e) { return e.parentId; }) });
|
|
300
|
+
}),
|
|
301
|
+
(!((_j = this.state.search) === null || _j === void 0 ? void 0 : _j.length) && !((_k = this.props.options) === null || _k === void 0 ? void 0 : _k.length)) && (react_1.default.createElement("div", { className: select1_module_css_1.default['no-results-found'] }, t("noResultFound")))))), document.body));
|
|
301
302
|
};
|
|
302
303
|
return TSelect1;
|
|
303
304
|
}(react_1.default.Component));
|