wini-web-components 2.5.1 → 2.5.3
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.
|
@@ -109,7 +109,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
109
109
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
110
110
|
exports.SelectMultiple = void 0;
|
|
111
111
|
var react_1 = __importStar(require("react"));
|
|
112
|
-
var react_dom_1 = __importDefault(require("react-dom"));
|
|
113
112
|
var input_multi_select_module_css_1 = __importDefault(require("./input-multi-select.module.css"));
|
|
114
113
|
var checkbox_1 = require("../checkbox/checkbox");
|
|
115
114
|
var text_1 = require("../text/text");
|
|
@@ -295,43 +294,42 @@ var TSelectMultiple = /** @class */ (function (_super) {
|
|
|
295
294
|
iconRef.style.display = "none";
|
|
296
295
|
}, className: 'row' },
|
|
297
296
|
react_1.default.createElement(winicon_1.Winicon, { src: this.state.isOpen ? "fill/arrows/up-arrow" : "fill/arrows/down-arrow", size: '1.2rem' })),
|
|
298
|
-
this.state.isOpen &&
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
297
|
+
this.state.isOpen && react_1.default.createElement(popup_1.PopupOverlay, { className: "hidden-overlay", onClose: function (ev) {
|
|
298
|
+
if (ev.target !== _this.inputRef.current)
|
|
299
|
+
_this.setState(__assign(__assign({}, _this.state), { isOpen: false }));
|
|
300
|
+
} },
|
|
301
|
+
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 : {
|
|
302
|
+
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
303
|
+
left: this.state.offset.x + 'px',
|
|
304
|
+
width: this.state.offset.width,
|
|
302
305
|
} },
|
|
303
|
-
react_1.default.createElement("div", {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
-
}
|
|
306
|
+
react_1.default.createElement("div", { style: { padding: '1.2rem 1.6rem', width: '100%', borderBottom: "var(--neutral-main-border)" } }, (function () {
|
|
307
|
+
var _a, _b;
|
|
308
|
+
var _list = ((_b = (_a = _this.state.search) !== null && _a !== void 0 ? _a : _this.props.options) !== null && _b !== void 0 ? _b : []);
|
|
309
|
+
var isSelectedAll = _list.every(function (item) { return _this.state.value.some(function (vl) { return vl === item.id; }); });
|
|
310
|
+
return react_1.default.createElement(text_1.Text, { onClick: function () {
|
|
311
|
+
var newValue = [];
|
|
312
|
+
if (_list.length) {
|
|
313
|
+
if (isSelectedAll) {
|
|
314
|
+
newValue = _this.state.value.filter(function (vl) { return _list.every(function (item) { return vl !== item.id || item.disabled; }); });
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
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);
|
|
321
318
|
}
|
|
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);
|
|
331
319
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
320
|
+
_this.setState(__assign(__assign({}, _this.state), { value: newValue }));
|
|
321
|
+
if (_this.props.onChange)
|
|
322
|
+
_this.props.onChange(newValue);
|
|
323
|
+
}, 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()));
|
|
324
|
+
})()),
|
|
325
|
+
react_1.default.createElement("div", { className: "col ".concat(input_multi_select_module_css_1.default['select-body']), onScroll: this.props.handleLoadmore ? function (ev) {
|
|
326
|
+
if (_this.props.handleLoadmore) {
|
|
327
|
+
var scrollElement = ev.target;
|
|
328
|
+
_this.props.handleLoadmore(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
|
|
329
|
+
}
|
|
330
|
+
} : undefined },
|
|
331
|
+
((_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); }),
|
|
332
|
+
(!((_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")))))));
|
|
335
333
|
};
|
|
336
334
|
return TSelectMultiple;
|
|
337
335
|
}(react_1.default.Component));
|
|
@@ -58,14 +58,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
58
58
|
return result;
|
|
59
59
|
};
|
|
60
60
|
})();
|
|
61
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
-
};
|
|
64
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
62
|
exports.Popup = exports.closePopup = exports.showPopup = void 0;
|
|
66
63
|
exports.PopupOverlay = PopupOverlay;
|
|
67
64
|
var react_1 = __importStar(require("react"));
|
|
68
|
-
var react_dom_1 = __importDefault(require("react-dom"));
|
|
69
65
|
require("./popup.css");
|
|
70
66
|
var showPopup = function (props) {
|
|
71
67
|
var _a, _b;
|
|
@@ -123,13 +119,13 @@ var Popup = /** @class */ (function (_super) {
|
|
|
123
119
|
var _this = this;
|
|
124
120
|
var _a;
|
|
125
121
|
return (react_1.default.createElement(react_1.default.Fragment, null, this.state.open &&
|
|
126
|
-
|
|
122
|
+
react_1.default.createElement(PopupOverlay, { className: this.state.clickOverlayClosePopup ? 'hidden-overlay' : '', onClose: this.state.clickOverlayClosePopup ? function () { _this.onClose(); } : undefined }, (_a = this.state.content) !== null && _a !== void 0 ? _a : react_1.default.createElement("div", { ref: this.ref, className: 'popup-container col', onClick: function (e) { return e.stopPropagation(); }, style: this.state.style },
|
|
127
123
|
this.state.heading,
|
|
128
124
|
this.state.body,
|
|
129
125
|
this.state.footer,
|
|
130
126
|
this.state.hideButtonClose ? null : react_1.default.createElement("button", { type: 'button', onClick: function () { return _this.onClose(); }, className: 'popup-close-btn row' },
|
|
131
127
|
react_1.default.createElement("svg", { width: '100%', height: '100%', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', style: { width: '2rem', height: '2rem' } },
|
|
132
|
-
react_1.default.createElement("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M16.4223 4.7559C16.7477 4.43047 16.7477 3.90283 16.4223 3.57739C16.0968 3.25195 15.5692 3.25195 15.2438 3.57739L9.99967 8.82147L4.7556 3.57739C4.43016 3.25195 3.90252 3.25195 3.57709 3.57739C3.25165 3.90283 3.25165 4.43047 3.57709 4.7559L8.82116 9.99998L3.57709 15.2441C3.25165 15.5695 3.25165 16.0971 3.57709 16.4226C3.90252 16.748 4.43016 16.748 4.7556 16.4226L9.99967 11.1785L15.2438 16.4226C15.5692 16.748 16.0968 16.748 16.4223 16.4226C16.7477 16.0971 16.7477 15.5695 16.4223 15.2441L11.1782 9.99998L16.4223 4.7559Z', fill: '#00204D', fillOpacity: 0.6 })))))
|
|
128
|
+
react_1.default.createElement("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M16.4223 4.7559C16.7477 4.43047 16.7477 3.90283 16.4223 3.57739C16.0968 3.25195 15.5692 3.25195 15.2438 3.57739L9.99967 8.82147L4.7556 3.57739C4.43016 3.25195 3.90252 3.25195 3.57709 3.57739C3.25165 3.90283 3.25165 4.43047 3.57709 4.7559L8.82116 9.99998L3.57709 15.2441C3.25165 15.5695 3.25165 16.0971 3.57709 16.4226C3.90252 16.748 4.43016 16.748 4.7556 16.4226L9.99967 11.1785L15.2438 16.4226C15.5692 16.748 16.0968 16.748 16.4223 16.4226C16.7477 16.0971 16.7477 15.5695 16.4223 15.2441L11.1782 9.99998L16.4223 4.7559Z', fill: '#00204D', fillOpacity: 0.6 })))))));
|
|
133
129
|
};
|
|
134
130
|
return Popup;
|
|
135
131
|
}(react_1.default.Component));
|
|
@@ -101,7 +101,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
101
101
|
exports.Select1 = void 0;
|
|
102
102
|
var select1_module_css_1 = __importDefault(require("./select1.module.css"));
|
|
103
103
|
var react_1 = __importStar(require("react"));
|
|
104
|
-
var react_dom_1 = __importDefault(require("react-dom"));
|
|
105
104
|
var winicon_1 = require("../wini-icon/winicon");
|
|
106
105
|
var text_1 = require("../text/text");
|
|
107
106
|
var react_i18next_1 = require("react-i18next");
|
|
@@ -278,27 +277,26 @@ var TSelect1 = /** @class */ (function (_super) {
|
|
|
278
277
|
iconRef.style.display = "none";
|
|
279
278
|
}, className: 'row' },
|
|
280
279
|
react_1.default.createElement(winicon_1.Winicon, { src: this.state.isOpen ? "fill/arrows/up-arrow" : "fill/arrows/down-arrow", size: "1.2rem" })),
|
|
281
|
-
this.state.isOpen &&
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
this.state.isOpen && react_1.default.createElement(popup_1.PopupOverlay, { onOpen: this.props.onOpenOptions, className: "hidden-overlay", onClose: function (ev) {
|
|
281
|
+
if (ev.target !== _this.inputRef.current)
|
|
282
|
+
_this.setState(__assign(__assign({}, _this.state), { isOpen: false }));
|
|
283
|
+
} },
|
|
284
|
+
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 : {
|
|
285
|
+
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
286
|
+
left: this.state.offset.x + 'px',
|
|
287
|
+
width: this.state.offset.width,
|
|
285
288
|
} },
|
|
286
|
-
react_1.default.createElement("div", { className: "".concat(select1_module_css_1.default['
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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));
|
|
289
|
+
react_1.default.createElement("div", { className: "col ".concat(select1_module_css_1.default['select-body']), onScroll: this.props.handleLoadmore ? function (ev) {
|
|
290
|
+
if (_this.props.handleLoadmore) {
|
|
291
|
+
var scrollElement = ev.target;
|
|
292
|
+
_this.props.handleLoadmore(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
|
|
293
|
+
}
|
|
294
|
+
} : undefined },
|
|
295
|
+
((_h = this.state.search) !== null && _h !== void 0 ? _h : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) {
|
|
296
|
+
var _a, _b;
|
|
297
|
+
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; }) });
|
|
298
|
+
}),
|
|
299
|
+
(!((_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")))))));
|
|
302
300
|
};
|
|
303
301
|
return TSelect1;
|
|
304
302
|
}(react_1.default.Component));
|