wini-web-components 2.2.0 → 2.2.1
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.
|
@@ -37,10 +37,6 @@ var winicon_1 = require("../wini-icon/winicon");
|
|
|
37
37
|
function Pagination(_a) {
|
|
38
38
|
var id = _a.id, currentPage = _a.currentPage, itemPerPage = _a.itemPerPage, totalItem = _a.totalItem, onChangePage = _a.onChangePage, _b = _a.hidePageSize, hidePageSize = _b === void 0 ? false : _b, _c = _a.hideGoToPage, hideGoToPage = _c === void 0 ? false : _c, style = _a.style;
|
|
39
39
|
var goToPageRef = (0, react_1.useRef)();
|
|
40
|
-
if (currentPage > 1 && (totalItem === 0 || (Math.floor(totalItem / itemPerPage) + (totalItem % itemPerPage === 0 ? 0 : 1)) < currentPage)) {
|
|
41
|
-
onChangePage(1, itemPerPage);
|
|
42
|
-
return react_1.default.createElement("div", null);
|
|
43
|
-
}
|
|
44
40
|
(0, react_1.useEffect)(function () {
|
|
45
41
|
if (goToPageRef.current) {
|
|
46
42
|
var _inputPage = goToPageRef.current.getInput();
|
|
@@ -48,7 +44,11 @@ function Pagination(_a) {
|
|
|
48
44
|
_inputPage.value = currentPage.toString();
|
|
49
45
|
}
|
|
50
46
|
}, [currentPage]);
|
|
51
|
-
if (
|
|
47
|
+
if (currentPage > 1 && (totalItem === 0 || (Math.floor(totalItem / itemPerPage) + (totalItem % itemPerPage === 0 ? 0 : 1)) < currentPage)) {
|
|
48
|
+
onChangePage(1, itemPerPage);
|
|
49
|
+
return react_1.default.createElement("div", null);
|
|
50
|
+
}
|
|
51
|
+
else if (totalItem > 0) {
|
|
52
52
|
return react_1.default.createElement("div", { id: id, className: "".concat(pagination_module_css_1.default['custom-pagination'], " row"), style: style },
|
|
53
53
|
hidePageSize ? null : react_1.default.createElement("div", { className: "row", style: { gap: '0.8rem' } },
|
|
54
54
|
react_1.default.createElement(select1_1.Select1, { readOnly: true, placeholder: itemPerPage.toString(), options: [10, 20, 50, 80, 100, 150, 200].map(function (item, _) { return { id: item, name: item }; }), style: { borderRadius: '0.4rem', width: '5.6rem', padding: '0 0.8rem', height: '2.4rem' }, onChange: function (ev) {
|
|
@@ -285,7 +285,7 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
285
285
|
} : undefined },
|
|
286
286
|
((_h = this.state.search) !== null && _h !== void 0 ? _h : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) {
|
|
287
287
|
var _a, _b;
|
|
288
|
-
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
|
|
288
|
+
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; }) });
|
|
289
289
|
}),
|
|
290
290
|
(((_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));
|
|
291
291
|
};
|
|
@@ -107,6 +107,6 @@ function Winicon(_a) {
|
|
|
107
107
|
}); }); });
|
|
108
108
|
}
|
|
109
109
|
}, [src, link]);
|
|
110
|
-
return react_1.default.createElement("div", { id: id, onClick: onClick, className: "".concat(winicon_module_css_1.default['wini-icon'], " ").concat(onClick ? winicon_module_css_1.default['clickable'] : '', " ").concat(className !== null && className !== void 0 ? className : '', " ").concat(src ? src.split("/").map(function (e, i) { return i === 0 ? "".concat(e, "-icon") : e.replace(" ", "-"); }).join(" ") : '').concat(link ? ' link-icon' : ""), style: (style ? __assign(__assign({}, style), { '--size': size, '--color': color }) : { '--size': size, '--color': color }), dangerouslySetInnerHTML: { __html: svgData !== null && svgData !== void 0 ? svgData : '' } });
|
|
110
|
+
return react_1.default.createElement("div", { id: id, onClick: onClick, className: "".concat(winicon_module_css_1.default['wini-icon'], " ").concat(svgData ? "" : "skeleton-loading", " ").concat(onClick ? winicon_module_css_1.default['clickable'] : '', " ").concat(className !== null && className !== void 0 ? className : '', " ").concat(src ? src.split("/").map(function (e, i) { return i === 0 ? "".concat(e, "-icon") : e.replace(" ", "-"); }).join(" ") : '').concat(link ? ' link-icon' : ""), style: (style ? __assign(__assign({}, style), { '--size': size, '--color': color }) : { '--size': size, '--color': color }), dangerouslySetInnerHTML: { __html: svgData !== null && svgData !== void 0 ? svgData : '' } });
|
|
111
111
|
}
|
|
112
112
|
exports.Winicon = Winicon;
|