wini-web-components 2.4.8 → 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.
@@ -5,6 +5,8 @@ interface ButtonProps {
5
5
  prefix?: ReactNode;
6
6
  suffix?: ReactNode;
7
7
  disabled?: boolean;
8
+ linkTo?: string;
9
+ target?: string;
8
10
  style?: CSSProperties;
9
11
  type?: "button" | "reset" | "submit";
10
12
  /**
@@ -28,8 +28,11 @@ var Button = /** @class */ (function (_super) {
28
28
  return _super !== null && _super.apply(this, arguments) || this;
29
29
  }
30
30
  Button.prototype.render = function () {
31
- var _a, _b;
32
- return react_1.default.createElement("button", { id: this.props.id, type: (_a = this.props.type) !== null && _a !== void 0 ? _a : "button", disabled: this.props.disabled, className: "".concat(button_module_css_1.default['button-container'], " row ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : "button-text-3"), style: this.props.style, onClick: this.props.onClick },
31
+ var _a, _b, _c;
32
+ return this.props.linkTo ? react_1.default.createElement("a", { id: this.props.id, href: this.props.disabled ? undefined : this.props.linkTo, target: this.props.target, className: "".concat(button_module_css_1.default['button-container'], " row ").concat((_a = this.props.className) !== null && _a !== void 0 ? _a : "button-text-3"), style: this.props.style },
33
+ this.props.prefix,
34
+ react_1.default.createElement(text_1.Text, { maxLine: 1, className: button_module_css_1.default['button-label'] }, this.props.label),
35
+ this.props.suffix) : react_1.default.createElement("button", { id: this.props.id, type: (_b = this.props.type) !== null && _b !== void 0 ? _b : "button", disabled: this.props.disabled, className: "".concat(button_module_css_1.default['button-container'], " row ").concat((_c = this.props.className) !== null && _c !== void 0 ? _c : "button-text-3"), style: this.props.style, onClick: this.props.onClick },
33
36
  this.props.prefix,
34
37
  react_1.default.createElement(text_1.Text, { maxLine: 1, className: button_module_css_1.default['button-label'] }, this.props.label),
35
38
  this.props.suffix);
@@ -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: "".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 : {
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", { style: { padding: '1.2rem 1.6rem', width: '100%', borderBottom: "var(--neutral-main-border)" } }, (function () {
308
- var _a, _b;
309
- var _list = ((_b = (_a = _this.state.search) !== null && _a !== void 0 ? _a : _this.props.options) !== null && _b !== void 0 ? _b : []);
310
- var isSelectedAll = _list.every(function (item) { return _this.state.value.some(function (vl) { return vl === item.id; }); });
311
- return react_1.default.createElement(text_1.Text, { onClick: function () {
312
- var newValue = [];
313
- if (_list.length) {
314
- if (isSelectedAll) {
315
- newValue = _this.state.value.filter(function (vl) { return _list.every(function (item) { return vl !== item.id || item.disabled; }); });
316
- }
317
- else {
318
- 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);
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
- _this.setState(__assign(__assign({}, _this.state), { value: newValue }));
322
- if (_this.props.onChange)
323
- _this.props.onChange(newValue);
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: "".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 : {
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: "col ".concat(select1_module_css_1.default['select-body']), onScroll: this.props.handleLoadmore ? function (ev) {
291
- if (_this.props.handleLoadmore) {
292
- var scrollElement = ev.target;
293
- _this.props.handleLoadmore(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
294
- }
295
- } : undefined },
296
- ((_h = this.state.search) !== null && _h !== void 0 ? _h : this.state.options).filter(function (e) { return !e.parentId; }).map(function (item) {
297
- var _a, _b;
298
- 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; }) });
299
- }),
300
- (!((_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));
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));