wini-web-components 2.1.6 → 2.1.7
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/dist/component/select1/select1.js +9 -10
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -275,7 +275,7 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
275
275
|
};
|
|
276
276
|
Select1.prototype.render = function () {
|
|
277
277
|
var _this = this;
|
|
278
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
278
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
279
279
|
var _value = this.state.options.find(function (e) { return e.id === _this.state.value; });
|
|
280
280
|
return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, className: "".concat(select1_module_css_1.default['select1-container'], " row ").concat(this.props.disabled ? select1_module_css_1.default['disabled'] : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && select1_module_css_1.default['helper-text'], " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : 'body-3'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' }, onClick: function () {
|
|
281
281
|
var _a, _b, _c;
|
|
@@ -290,14 +290,13 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
290
290
|
ev.target.focus();
|
|
291
291
|
else if (!_this.state.onSelect)
|
|
292
292
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: false, onSelect: null }));
|
|
293
|
-
} }) : _value.name,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
react_1.default.createElement(winicon_1.Winicon, { src: this.state.isOpen ? "fill/arrows/up-arrow" : "fill/arrows/down-arrow", size: "1.2rem" })),
|
|
293
|
+
} }) : _value.name, (_e = this.props.suffix) !== null && _e !== void 0 ? _e : react_1.default.createElement("div", { ref: function (iconRef) {
|
|
294
|
+
if ((iconRef === null || iconRef === void 0 ? void 0 : iconRef.parentElement) && iconRef.parentElement.getBoundingClientRect().width < 100)
|
|
295
|
+
iconRef.style.display = "none";
|
|
296
|
+
}, className: 'row' },
|
|
297
|
+
react_1.default.createElement(winicon_1.Winicon, { src: this.state.isOpen ? "fill/arrows/up-arrow" : "fill/arrows/down-arrow", size: "1.2rem" })),
|
|
299
298
|
this.state.isOpen &&
|
|
300
|
-
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "".concat(select1_module_css_1.default['select1-popup'], " select1-popup col ").concat((
|
|
299
|
+
react_dom_1.default.createPortal(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 : {
|
|
301
300
|
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
302
301
|
left: this.state.offset.x + 'px',
|
|
303
302
|
width: this.state.offset.width,
|
|
@@ -308,8 +307,8 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
308
307
|
_this.props.handleLoadmore(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
|
|
309
308
|
}
|
|
310
309
|
} : undefined },
|
|
311
|
-
((
|
|
312
|
-
(((
|
|
310
|
+
((_h = this.state.search) !== null && _h !== void 0 ? _h : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) { return _this.renderOptions(item); }),
|
|
311
|
+
(((_j = this.state.search) === null || _j === void 0 ? void 0 : _j.length) === 0 || ((_k = this.props.options) === null || _k === void 0 ? void 0 : _k.length) === 0) && (react_1.default.createElement("div", { className: select1_module_css_1.default['no-results-found'] }, "No result found")))), document.body));
|
|
313
312
|
};
|
|
314
313
|
return Select1;
|
|
315
314
|
}(react_1.default.Component));
|