wini-web-components 1.3.0 → 1.3.2
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/calendar/calendar.d.ts +1 -0
- package/dist/component/calendar/calendar.js +1 -1
- package/dist/component/checkbox/checkbox.d.ts +1 -0
- package/dist/component/checkbox/checkbox.js +1 -1
- package/dist/component/date-picker/date-picker.d.ts +1 -0
- package/dist/component/date-picker/date-picker.js +1 -1
- package/dist/component/import-file/import-file.d.ts +1 -0
- package/dist/component/import-file/import-file.js +1 -1
- package/dist/component/infinite-scroll/infinite-scroll.d.ts +1 -0
- package/dist/component/infinite-scroll/infinite-scroll.js +1 -1
- package/dist/component/input-multi-select/input-multi-select.d.ts +2 -0
- package/dist/component/input-multi-select/input-multi-select.js +5 -5
- package/dist/component/pagination/pagination.d.ts +2 -1
- package/dist/component/pagination/pagination.js +3 -3
- package/dist/component/progress-bar/progress-bar.d.ts +2 -1
- package/dist/component/progress-bar/progress-bar.js +2 -2
- package/dist/component/progress-circle/progress-circle.d.ts +2 -1
- package/dist/component/progress-circle/progress-circle.js +2 -2
- package/dist/component/radio-button/radio-button.d.ts +1 -0
- package/dist/component/radio-button/radio-button.js +1 -1
- package/dist/component/rating/rating.d.ts +1 -0
- package/dist/component/rating/rating.js +1 -1
- package/dist/component/select1/select1.d.ts +2 -0
- package/dist/component/select1/select1.js +5 -5
- package/dist/component/slider/slider.d.ts +1 -0
- package/dist/component/switch/switch.d.ts +1 -0
- package/dist/component/switch/switch.js +1 -1
- package/dist/component/table/table.d.ts +4 -0
- package/dist/component/table/table.js +6 -6
- package/dist/component/text/text.d.ts +1 -0
- package/dist/component/text/text.js +1 -1
- package/dist/component/text-area/text-area.d.ts +1 -0
- package/dist/component/text-area/text-area.js +1 -1
- package/dist/component/text-field/text-field.d.ts +1 -0
- package/dist/component/text-field/text-field.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -290,7 +290,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
290
290
|
};
|
|
291
291
|
Calendar.prototype.render = function () {
|
|
292
292
|
var _this = this;
|
|
293
|
-
return react_1.default.createElement("div", { className: "row calendar-container ".concat(this.props.className), style: this.props.style },
|
|
293
|
+
return react_1.default.createElement("div", { id: this.props.id, className: "row calendar-container ".concat(this.props.className), style: this.props.style },
|
|
294
294
|
this.props.showSidebar ? react_1.default.createElement("div", { className: "calendar-sidebar-options col" },
|
|
295
295
|
react_1.default.createElement("button", { type: "button", onClick: function () { }, className: "label-4 calendar-sidebar-option-buttton" }, "Yesterday"),
|
|
296
296
|
react_1.default.createElement("button", { type: "button", className: "label-4 calendar-sidebar-option-buttton" }, "Last week"),
|
|
@@ -64,7 +64,7 @@ var Checkbox = /** @class */ (function (_super) {
|
|
|
64
64
|
delete this.props.style.maxHeight;
|
|
65
65
|
convertStyle = __assign(__assign({}, this.props.style), convertStyle);
|
|
66
66
|
}
|
|
67
|
-
return react_1.default.createElement("label", { className: "checkbox-container row", style: convertStyle, "is-null-value": "".concat(this.state.value == undefined), onClick: this.props.onClick },
|
|
67
|
+
return react_1.default.createElement("label", { id: this.props.id, className: "checkbox-container row", style: convertStyle, "is-null-value": "".concat(this.state.value == undefined), onClick: this.props.onClick },
|
|
68
68
|
react_1.default.createElement("input", { type: "checkbox", checked: this.state.value, disabled: this.props.disabled, onChange: function (ev) {
|
|
69
69
|
ev.stopPropagation();
|
|
70
70
|
var newValue = !_this.state.value;
|
|
@@ -214,7 +214,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
214
214
|
default:
|
|
215
215
|
break;
|
|
216
216
|
}
|
|
217
|
-
return react_1.default.createElement("
|
|
217
|
+
return react_1.default.createElement("div", { id: this.props.id, className: "date-picker-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3', " ").concat(this.props.disabled ? 'disabled' : '', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "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' } },
|
|
218
218
|
react_1.default.createElement("div", { className: 'input-field-value row', style: { height: '4rem' } },
|
|
219
219
|
react_1.default.createElement("input", { autoComplete: 'off', value: (_e = this.state.value) !== null && _e !== void 0 ? _e : '', onChange: function (ev) { return _this.setState(__assign(__assign({}, _this.state), { value: ev.target.value })); }, placeholder: this.props.placeholder, maxLength: maxLength, onBlur: function (ev) {
|
|
220
220
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
@@ -70,7 +70,7 @@ var ImportFile = /** @class */ (function (_super) {
|
|
|
70
70
|
if (this.props.maxSize) {
|
|
71
71
|
sizeTitle = this.props.maxSize > Math.pow(1024, 3) ? "".concat(Math.round(this.props.maxSize / Math.pow(1024, 3)), "TB") : this.props.maxSize > Math.pow(1024, 2) ? "".concat(Math.round(this.props.maxSize / Math.pow(1024, 2)), "GB") : this.props.maxSize > 1024 ? "".concat(Math.round(this.props.maxSize / 1024), "MB") : "".concat(this.props.maxSize, "KB");
|
|
72
72
|
}
|
|
73
|
-
return react_1.default.createElement("div", { className: "import-file-container ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'row', " ").concat(this.props.buttonOnly ? 'button-only' : ''), style: this.state.preview ? this.props.style : __assign({ cursor: 'pointer' }, this.props.style), onClick: function () {
|
|
73
|
+
return react_1.default.createElement("div", { id: this.props.id, className: "import-file-container ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'row', " ").concat(this.props.buttonOnly ? 'button-only' : ''), style: this.state.preview ? this.props.style : __assign({ cursor: 'pointer' }, this.props.style), onClick: function () {
|
|
74
74
|
if (!_this.state.preview && !_this.props.buttonOnly)
|
|
75
75
|
_this.showFilePicker();
|
|
76
76
|
} },
|
|
@@ -79,7 +79,7 @@ var InfiniteScroll = /** @class */ (function (_super) {
|
|
|
79
79
|
InfiniteScroll.prototype.render = function () {
|
|
80
80
|
var _this = this;
|
|
81
81
|
var _a, _b;
|
|
82
|
-
return react_1.default.createElement("div", { onScroll: function (ev) { return __awaiter(_this, void 0, void 0, function () {
|
|
82
|
+
return react_1.default.createElement("div", { id: this.props.id, onScroll: function (ev) { return __awaiter(_this, void 0, void 0, function () {
|
|
83
83
|
var scrollElement;
|
|
84
84
|
return __generator(this, function (_a) {
|
|
85
85
|
switch (_a.label) {
|
|
@@ -2,6 +2,7 @@ import React, { CSSProperties } from 'react';
|
|
|
2
2
|
import './input-multi-select.css';
|
|
3
3
|
import { OptionsItem } from '../select1/select1';
|
|
4
4
|
interface SelectMultipleProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
value?: Array<string | number>;
|
|
6
7
|
options: Required<Array<OptionsItem>>;
|
|
7
8
|
onChange?: (value?: Array<string | number>) => void;
|
|
@@ -13,6 +14,7 @@ interface SelectMultipleProps {
|
|
|
13
14
|
style?: CSSProperties;
|
|
14
15
|
handleSearch?: (e: string) => Promise<Array<OptionsItem>>;
|
|
15
16
|
showClearValueButton?: boolean;
|
|
17
|
+
popupClassName?: string;
|
|
16
18
|
}
|
|
17
19
|
interface SelectMultipleState {
|
|
18
20
|
value: Array<string | number>;
|
|
@@ -256,8 +256,8 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
256
256
|
};
|
|
257
257
|
SelectMultiple.prototype.render = function () {
|
|
258
258
|
var _this = this;
|
|
259
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
260
|
-
return react_1.default.createElement("div", { ref: this.containerRef, className: "select-multi-container row ".concat(this.props.disabled ? 'disabled' : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && '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 () {
|
|
259
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
260
|
+
return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, className: "select-multi-container row ".concat(this.props.disabled ? 'disabled' : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && '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 () {
|
|
261
261
|
var _a, _b;
|
|
262
262
|
if (!_this.state.isOpen)
|
|
263
263
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: true, style: undefined, offset: (_b = (_a = _this.containerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect() }));
|
|
@@ -282,7 +282,7 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
282
282
|
} },
|
|
283
283
|
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faXmarkCircle, style: { fontSize: '1.6rem', color: '#161C24' } })),
|
|
284
284
|
this.state.isOpen &&
|
|
285
|
-
react_dom_1.default.createPortal(react_1.default.createElement("div", { className:
|
|
285
|
+
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "select-multi-popup col ".concat((_e = this.props.popupClassName) !== null && _e !== void 0 ? _e : ""), style: (_f = this.state.style) !== null && _f !== void 0 ? _f : {
|
|
286
286
|
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
287
287
|
left: this.state.offset.x + 'px',
|
|
288
288
|
width: this.state.offset.width,
|
|
@@ -307,8 +307,8 @@ var SelectMultiple = /** @class */ (function (_super) {
|
|
|
307
307
|
}, className: 'button-text-3', style: { color: _list.length ? 'var(--infor-color)' : '#00204D99', } }, _list.length && isSelectedAll ? 'Bỏ chọn tất cả' : 'Chọn tất cả');
|
|
308
308
|
})()),
|
|
309
309
|
react_1.default.createElement("div", { className: 'col select-body' },
|
|
310
|
-
((
|
|
311
|
-
(((
|
|
310
|
+
((_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); }),
|
|
311
|
+
(((_h = this.state.search) === null || _h === void 0 ? void 0 : _h.length) === 0 || ((_j = this.props.options) === null || _j === void 0 ? void 0 : _j.length) === 0) && (react_1.default.createElement("div", { className: 'no-results-found' }, "No result found")))), document.body));
|
|
312
312
|
};
|
|
313
313
|
return SelectMultiple;
|
|
314
314
|
}(react_1.default.Component));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties } from "react";
|
|
2
2
|
import './pagination.css';
|
|
3
|
-
export declare function Pagination({ currentPage, itemPerPage, totalItem, onChangePage, hiddenPageSize, hiddenTotal, style }: {
|
|
3
|
+
export declare function Pagination({ id, currentPage, itemPerPage, totalItem, onChangePage, hiddenPageSize, hiddenTotal, style }: {
|
|
4
|
+
id?: string;
|
|
4
5
|
currentPage: number;
|
|
5
6
|
itemPerPage: number;
|
|
6
7
|
totalItem: number;
|
|
@@ -9,13 +9,13 @@ var react_paginate_1 = __importDefault(require("react-paginate"));
|
|
|
9
9
|
require("./pagination.css");
|
|
10
10
|
var index_1 = require("../../index");
|
|
11
11
|
function Pagination(_a) {
|
|
12
|
-
var currentPage = _a.currentPage, itemPerPage = _a.itemPerPage, totalItem = _a.totalItem, onChangePage = _a.onChangePage, _b = _a.hiddenPageSize, hiddenPageSize = _b === void 0 ? false : _b, _c = _a.hiddenTotal, hiddenTotal = _c === void 0 ? false : _c, style = _a.style;
|
|
12
|
+
var id = _a.id, currentPage = _a.currentPage, itemPerPage = _a.itemPerPage, totalItem = _a.totalItem, onChangePage = _a.onChangePage, _b = _a.hiddenPageSize, hiddenPageSize = _b === void 0 ? false : _b, _c = _a.hiddenTotal, hiddenTotal = _c === void 0 ? false : _c, style = _a.style;
|
|
13
13
|
if (currentPage > 1 && (totalItem === 0 || (Math.floor(totalItem / itemPerPage) + (totalItem % itemPerPage === 0 ? 0 : 1)) < currentPage)) {
|
|
14
14
|
onChangePage(1, itemPerPage);
|
|
15
15
|
return react_1.default.createElement("div", null);
|
|
16
16
|
}
|
|
17
17
|
if (totalItem > 0) {
|
|
18
|
-
return (react_1.default.createElement("div", { className: "row custom-pagination", style: style },
|
|
18
|
+
return (react_1.default.createElement("div", { id: id, className: "row custom-pagination", style: style },
|
|
19
19
|
hiddenTotal ? null : react_1.default.createElement(index_1.Text, { className: "regular2" },
|
|
20
20
|
"Hi\u1EC3n th\u1ECB ",
|
|
21
21
|
itemPerPage * (currentPage - 1) + 1,
|
|
@@ -40,7 +40,7 @@ function Pagination(_a) {
|
|
|
40
40
|
}, renderOnZeroPageCount: null }))));
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
return (react_1.default.createElement("div",
|
|
43
|
+
return (react_1.default.createElement("div", { id: id }));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.Pagination = Pagination;
|
|
@@ -2,7 +2,8 @@ import { CSSProperties, ReactNode } from 'react';
|
|
|
2
2
|
import './progress-bar.css';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ComponentStatus } from '../../index';
|
|
5
|
-
export declare function ProgressBar({ status, percent, titleText, title, hideTitle, progressBarOnly, fullColor, percentColor, style, progressBarStyle }: {
|
|
5
|
+
export declare function ProgressBar({ id, status, percent, titleText, title, hideTitle, progressBarOnly, fullColor, percentColor, style, progressBarStyle }: {
|
|
6
|
+
id?: string;
|
|
6
7
|
percent: number;
|
|
7
8
|
titleText?: string;
|
|
8
9
|
title?: ReactNode;
|
|
@@ -22,9 +22,9 @@ var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
|
|
|
22
22
|
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
|
|
23
23
|
var index_1 = require("../../index");
|
|
24
24
|
function ProgressBar(_a) {
|
|
25
|
-
var _b = _a.status, status = _b === void 0 ? index_1.ComponentStatus.INFOR : _b, _c = _a.percent, percent = _c === void 0 ? 100 : _c, titleText = _a.titleText, title = _a.title, _d = _a.hideTitle, hideTitle = _d === void 0 ? false : _d, _e = _a.progressBarOnly, progressBarOnly = _e === void 0 ? false : _e, _f = _a.fullColor, fullColor = _f === void 0 ? 'var(--background)' : _f, _g = _a.percentColor, percentColor = _g === void 0 ? 'var(--infor-color)' : _g, style = _a.style, progressBarStyle = _a.progressBarStyle;
|
|
25
|
+
var id = _a.id, _b = _a.status, status = _b === void 0 ? index_1.ComponentStatus.INFOR : _b, _c = _a.percent, percent = _c === void 0 ? 100 : _c, titleText = _a.titleText, title = _a.title, _d = _a.hideTitle, hideTitle = _d === void 0 ? false : _d, _e = _a.progressBarOnly, progressBarOnly = _e === void 0 ? false : _e, _f = _a.fullColor, fullColor = _f === void 0 ? 'var(--background)' : _f, _g = _a.percentColor, percentColor = _g === void 0 ? 'var(--infor-color)' : _g, style = _a.style, progressBarStyle = _a.progressBarStyle;
|
|
26
26
|
var _h = (0, react_1.useState)(true), openDetails = _h[0], setOpenDetails = _h[1];
|
|
27
|
-
return react_2.default.createElement("div", { className: "progress-bar-container col", style: style ? __assign({ padding: progressBarOnly ? '0' : '1.6rem 2.4rem' }, style) : { padding: progressBarOnly ? '0' : '1.6rem 2.4rem' } },
|
|
27
|
+
return react_2.default.createElement("div", { id: id, className: "progress-bar-container col", style: style ? __assign({ padding: progressBarOnly ? '0' : '1.6rem 2.4rem' }, style) : { padding: progressBarOnly ? '0' : '1.6rem 2.4rem' } },
|
|
28
28
|
(hideTitle || progressBarOnly) ? null : (title !== null && title !== void 0 ? title : react_2.default.createElement("div", { className: "progress-bar-title row" },
|
|
29
29
|
react_2.default.createElement("div", { className: "heading-text" }, titleText),
|
|
30
30
|
react_2.default.createElement("button", { type: "button", className: "suffix-action", onClick: function () { setOpenDetails(!openDetails); } },
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import './progress-circle.css';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export declare function ProgressCircle({ percent, style, fillColor, percentColor, strokeWidth, strokeColor, textStyle }: {
|
|
4
|
+
export declare function ProgressCircle({ id, percent, style, fillColor, percentColor, strokeWidth, strokeColor, textStyle }: {
|
|
5
|
+
id?: string;
|
|
5
6
|
/** value: 0 - 100 (%)*/
|
|
6
7
|
percent?: number;
|
|
7
8
|
style?: CSSProperties;
|
|
@@ -18,11 +18,11 @@ exports.ProgressCircle = void 0;
|
|
|
18
18
|
require("./progress-circle.css");
|
|
19
19
|
var react_1 = __importDefault(require("react"));
|
|
20
20
|
function ProgressCircle(_a) {
|
|
21
|
-
var percent = _a.percent, style = _a.style, fillColor = _a.fillColor, percentColor = _a.percentColor, strokeWidth = _a.strokeWidth, strokeColor = _a.strokeColor, textStyle = _a.textStyle;
|
|
21
|
+
var id = _a.id, percent = _a.percent, style = _a.style, fillColor = _a.fillColor, percentColor = _a.percentColor, strokeWidth = _a.strokeWidth, strokeColor = _a.strokeColor, textStyle = _a.textStyle;
|
|
22
22
|
var radius = 30 - (strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : 4);
|
|
23
23
|
var diameter = Math.PI * 2 * radius;
|
|
24
24
|
var strokeOffset = (1 - ((percent !== null && percent !== void 0 ? percent : 0) / 100)) * diameter;
|
|
25
|
-
return react_1.default.createElement("svg", { width: "100%", height: "100%", viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: __assign({ width: 60, height: 60 }, (style !== null && style !== void 0 ? style : {})) },
|
|
25
|
+
return react_1.default.createElement("svg", { id: id, width: "100%", height: "100%", viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: __assign({ width: 60, height: 60 }, (style !== null && style !== void 0 ? style : {})) },
|
|
26
26
|
react_1.default.createElement("path", { d: "M 30,30 m 0,-".concat(radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,").concat(2 * radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,-").concat(2 * radius), style: { fill: "none", stroke: strokeColor !== null && strokeColor !== void 0 ? strokeColor : "#E6EAF0", strokeWidth: strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : '4px', } }),
|
|
27
27
|
react_1.default.createElement("path", { d: "M 30,30 m 0,-".concat(radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,").concat(2 * radius, " a ").concat(radius, ",").concat(radius, " 0 1 1 0,-").concat(2 * radius), style: { fill: fillColor !== null && fillColor !== void 0 ? fillColor : "none", stroke: percentColor !== null && percentColor !== void 0 ? percentColor : "var(--infor-color)", strokeWidth: strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : '4px', strokeLinecap: 'round', strokeDasharray: "".concat(diameter, "px ").concat(diameter, "px"), strokeDashoffset: "".concat(strokeOffset, "px") } }),
|
|
28
28
|
react_1.default.createElement("text", { x: "50%", y: "50%", fill: "#00204D", dy: ".3em", textAnchor: "middle", fontSize: 16, fontWeight: '600', style: textStyle }, percent !== null && percent !== void 0 ? percent : 0,
|
|
@@ -2,6 +2,7 @@ import React, { CSSProperties } from 'react';
|
|
|
2
2
|
import './radio-button.css';
|
|
3
3
|
import { UseFormRegister } from 'react-hook-form';
|
|
4
4
|
interface RadioButtonProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
6
7
|
value?: string | number | readonly string[];
|
|
7
8
|
disabled?: boolean;
|
|
@@ -53,7 +53,7 @@ var RadioButton = /** @class */ (function (_super) {
|
|
|
53
53
|
delete this.props.style.maxHeight;
|
|
54
54
|
convertStyle = __assign(__assign({}, this.props.style), convertStyle);
|
|
55
55
|
}
|
|
56
|
-
return react_1.default.createElement("label", { className: "radio-btn-container row ".concat((_c = this.props.className) !== null && _c !== void 0 ? _c : ''), style: convertStyle },
|
|
56
|
+
return react_1.default.createElement("label", { id: this.props.id, className: "radio-btn-container row ".concat((_c = this.props.className) !== null && _c !== void 0 ? _c : ''), style: convertStyle },
|
|
57
57
|
this.props.register ?
|
|
58
58
|
react_1.default.createElement("input", __assign({}, this.props.register, { type: "radio", value: this.props.value, disabled: this.props.disabled })) :
|
|
59
59
|
react_1.default.createElement("input", { type: "radio", name: this.props.name, value: this.props.value, defaultChecked: this.props.defaultChecked, disabled: this.props.disabled, onChange: this.props.onChange }),
|
|
@@ -44,7 +44,7 @@ var Rating = /** @class */ (function (_super) {
|
|
|
44
44
|
Rating.prototype.render = function () {
|
|
45
45
|
var _this = this;
|
|
46
46
|
var _a;
|
|
47
|
-
return react_1.default.createElement("div", { className: "row rating-container ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ''), style: this.props.style }, Array.from({ length: 5 }).map(function (_, i) {
|
|
47
|
+
return react_1.default.createElement("div", { id: this.props.id, className: "row rating-container ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ''), style: this.props.style }, Array.from({ length: 5 }).map(function (_, i) {
|
|
48
48
|
var _a, _b, _c, _d, _e;
|
|
49
49
|
var uniqueId = 'rating-star-grad-0';
|
|
50
50
|
var stopValue = 0;
|
|
@@ -8,6 +8,7 @@ export interface OptionsItem {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
10
|
interface Select1Props {
|
|
11
|
+
id?: string;
|
|
11
12
|
value?: string | number;
|
|
12
13
|
options: Required<Array<OptionsItem>>;
|
|
13
14
|
onChange?: (v?: OptionsItem) => void;
|
|
@@ -20,6 +21,7 @@ interface Select1Props {
|
|
|
20
21
|
handleSearch?: (e: string) => Promise<Array<OptionsItem>>;
|
|
21
22
|
showClearValueButton?: boolean;
|
|
22
23
|
readOnly?: boolean;
|
|
24
|
+
popupClassName?: string;
|
|
23
25
|
}
|
|
24
26
|
interface Select1State {
|
|
25
27
|
value?: string | number;
|
|
@@ -271,9 +271,9 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
271
271
|
};
|
|
272
272
|
Select1.prototype.render = function () {
|
|
273
273
|
var _this = this;
|
|
274
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
274
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
275
275
|
var _value = this.state.options.find(function (e) { return e.id === _this.state.value; });
|
|
276
|
-
return react_1.default.createElement("div", { ref: this.containerRef, className: "select1-container row ".concat(this.props.disabled ? 'disabled' : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && '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 () {
|
|
276
|
+
return react_1.default.createElement("div", { id: this.props.id, ref: this.containerRef, className: "select1-container row ".concat(this.props.disabled ? 'disabled' : '', " ").concat(((_a = this.props.helperText) === null || _a === void 0 ? void 0 : _a.length) && '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 () {
|
|
277
277
|
var _a, _b, _c;
|
|
278
278
|
if (!_this.state.isOpen) {
|
|
279
279
|
_this.setState(__assign(__assign({}, _this.state), { isOpen: true, style: undefined, offset: (_b = (_a = _this.containerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect() }));
|
|
@@ -293,14 +293,14 @@ var Select1 = /** @class */ (function (_super) {
|
|
|
293
293
|
} },
|
|
294
294
|
react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faXmarkCircle, style: { fontSize: '1.6rem', color: '#161C24' } })),
|
|
295
295
|
this.state.isOpen &&
|
|
296
|
-
react_dom_1.default.createPortal(react_1.default.createElement("div", { className:
|
|
296
|
+
react_dom_1.default.createPortal(react_1.default.createElement("div", { className: "select1-popup col ".concat((_e = this.props.popupClassName) !== null && _e !== void 0 ? _e : ""), style: (_f = this.state.style) !== null && _f !== void 0 ? _f : {
|
|
297
297
|
top: this.state.offset.y + this.state.offset.height + 2 + 'px',
|
|
298
298
|
left: this.state.offset.x + 'px',
|
|
299
299
|
width: this.state.offset.width,
|
|
300
300
|
}, onMouseOver: function (ev) { return _this.setState(__assign(__assign({}, _this.state), { onSelect: ev.target })); }, onMouseOut: function () { return _this.setState(__assign(__assign({}, _this.state), { onSelect: null })); } },
|
|
301
301
|
react_1.default.createElement("div", { className: 'col select-body' },
|
|
302
|
-
((
|
|
303
|
-
(((
|
|
302
|
+
((_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); }),
|
|
303
|
+
(((_h = this.state.search) === null || _h === void 0 ? void 0 : _h.length) === 0 || ((_j = this.props.options) === null || _j === void 0 ? void 0 : _j.length) === 0) && (react_1.default.createElement("div", { className: 'no-results-found' }, "No result found")))), document.body));
|
|
304
304
|
};
|
|
305
305
|
return Select1;
|
|
306
306
|
}(react_1.default.Component));
|
|
@@ -67,7 +67,7 @@ var Switch = /** @class */ (function (_super) {
|
|
|
67
67
|
delete this.props.style.maxHeight;
|
|
68
68
|
convertStyle = __assign(__assign({}, this.props.style), convertStyle);
|
|
69
69
|
}
|
|
70
|
-
return react_1.default.createElement("label", { className: "switch-container row ".concat((_e = this.props.className) !== null && _e !== void 0 ? _e : ''), style: convertStyle },
|
|
70
|
+
return react_1.default.createElement("label", { id: this.props.id, className: "switch-container row ".concat((_e = this.props.className) !== null && _e !== void 0 ? _e : ''), style: convertStyle },
|
|
71
71
|
react_1.default.createElement("input", { type: "checkbox", checked: this.state.value, name: this.props.name, disabled: this.props.disabled, onChange: function () {
|
|
72
72
|
var newValue = !_this.state.value;
|
|
73
73
|
_this.setState({ value: newValue });
|
|
@@ -6,6 +6,7 @@ export declare enum CellAlignItems {
|
|
|
6
6
|
end = "end"
|
|
7
7
|
}
|
|
8
8
|
type TbCellProps = {
|
|
9
|
+
id?: string;
|
|
9
10
|
fixed?: boolean;
|
|
10
11
|
children?: ReactNode;
|
|
11
12
|
className?: string;
|
|
@@ -17,6 +18,7 @@ export declare class TbCell extends React.Component<TbCellProps> {
|
|
|
17
18
|
render(): React.ReactNode;
|
|
18
19
|
}
|
|
19
20
|
interface TbRowProps {
|
|
21
|
+
id?: string;
|
|
20
22
|
children?: Array<TbCell>;
|
|
21
23
|
className?: string;
|
|
22
24
|
style?: CSSProperties;
|
|
@@ -29,6 +31,7 @@ export declare class TbHeader extends React.Component<TbRowProps> {
|
|
|
29
31
|
render(): React.JSX.Element;
|
|
30
32
|
}
|
|
31
33
|
interface TbBodyProps {
|
|
34
|
+
id?: string;
|
|
32
35
|
children?: Array<TbRow>;
|
|
33
36
|
className?: string;
|
|
34
37
|
style?: CSSProperties;
|
|
@@ -37,6 +40,7 @@ export declare class TbBody extends React.Component<TbBodyProps> {
|
|
|
37
40
|
render(): React.ReactNode;
|
|
38
41
|
}
|
|
39
42
|
interface TableProps {
|
|
43
|
+
id?: string;
|
|
40
44
|
children?: Array<TbBody | TbHeader>;
|
|
41
45
|
className?: string;
|
|
42
46
|
style?: CSSProperties;
|
|
@@ -45,7 +45,7 @@ var TbCell = /** @class */ (function (_super) {
|
|
|
45
45
|
}
|
|
46
46
|
TbCell.prototype.render = function () {
|
|
47
47
|
var _a, _b;
|
|
48
|
-
return react_1.default.createElement("td", { onClick: this.props.onClick, style: this.props.style, "align-cell": (_a = this.props.align) !== null && _a !== void 0 ? _a : CellAlignItems.start, className: "tb-cell ".concat((_b = this.props.className) !== null && _b !== void 0 ? _b : '', " ").concat(this.props.fixed ? 'tb-cell-fixed' : '') }, this.props.children);
|
|
48
|
+
return react_1.default.createElement("td", { id: this.props.id, onClick: this.props.onClick, style: this.props.style, "align-cell": (_a = this.props.align) !== null && _a !== void 0 ? _a : CellAlignItems.start, className: "tb-cell ".concat((_b = this.props.className) !== null && _b !== void 0 ? _b : '', " ").concat(this.props.fixed ? 'tb-cell-fixed' : '') }, this.props.children);
|
|
49
49
|
};
|
|
50
50
|
return TbCell;
|
|
51
51
|
}(react_1.default.Component));
|
|
@@ -58,7 +58,7 @@ var TbRow = /** @class */ (function (_super) {
|
|
|
58
58
|
TbRow.prototype.render = function () {
|
|
59
59
|
var _this = this;
|
|
60
60
|
var _a, _b;
|
|
61
|
-
return react_1.default.createElement("tr", { style: this.props.style, className: "tb-row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ""), onClick: this.props.onClick }, ((_b = this.props.children) !== null && _b !== void 0 ? _b : []).map(function (e, i) {
|
|
61
|
+
return react_1.default.createElement("tr", { id: this.props.id, style: this.props.style, className: "tb-row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ""), onClick: this.props.onClick }, ((_b = this.props.children) !== null && _b !== void 0 ? _b : []).map(function (e, i) {
|
|
62
62
|
var _a, _b;
|
|
63
63
|
var ox = 0;
|
|
64
64
|
if (_this.props.children && i > 0 && i < (_this.props.children.length - 1)) {
|
|
@@ -68,7 +68,7 @@ var TbRow = /** @class */ (function (_super) {
|
|
|
68
68
|
return wValue ? typeof wValue === 'number' ? "".concat(wValue, "px") : wValue : '60px';
|
|
69
69
|
}).join(" + "), ")");
|
|
70
70
|
}
|
|
71
|
-
return react_1.default.createElement(TbCell, { key: "tb-cell-".concat(i), align: e.props.align, children: e.props.children, fixed: e.props.fixed, onClick: e.props.onClick, style: e.props.fixed ? (_this.props.children && i === _this.props.children.length - 1) ? __assign({ right: 0 }, ((_a = e.props.style) !== null && _a !== void 0 ? _a : {})) : __assign({ left: ox }, ((_b = e.props.style) !== null && _b !== void 0 ? _b : {})) : e.props.style, className: e.props.className });
|
|
71
|
+
return react_1.default.createElement(TbCell, { id: e.props.id, key: "tb-cell-".concat(i), align: e.props.align, children: e.props.children, fixed: e.props.fixed, onClick: e.props.onClick, style: e.props.fixed ? (_this.props.children && i === _this.props.children.length - 1) ? __assign({ right: 0 }, ((_a = e.props.style) !== null && _a !== void 0 ? _a : {})) : __assign({ left: ox }, ((_b = e.props.style) !== null && _b !== void 0 ? _b : {})) : e.props.style, className: e.props.className });
|
|
72
72
|
}));
|
|
73
73
|
};
|
|
74
74
|
return TbRow;
|
|
@@ -89,7 +89,7 @@ var TbHeader = /** @class */ (function (_super) {
|
|
|
89
89
|
if (_this.props.children && i > 0 && i < (_this.props.children.length - 1)) {
|
|
90
90
|
ox = "calc(".concat(_this.props.children.slice(0, i).map(function (tb) { var _a; return ((_a = tb.props.style) === null || _a === void 0 ? void 0 : _a.width) ? typeof tb.props.style.width === 'number' ? "".concat(tb.props.style.width, "px") : tb.props.style.width : '60px'; }).join(" + "), ")");
|
|
91
91
|
}
|
|
92
|
-
return react_1.default.createElement(TbCell, { key: "tb-cell-".concat(i), align: e.props.align, children: e.props.children, onClick: e.props.onClick, fixed: e.props.fixed, style: e.props.fixed ? (_this.props.children && i === _this.props.children.length - 1) ? __assign({ right: 0 }, ((_a = e.props.style) !== null && _a !== void 0 ? _a : {})) : __assign({ left: ox }, ((_b = e.props.style) !== null && _b !== void 0 ? _b : {})) : e.props.style, className: e.props.className });
|
|
92
|
+
return react_1.default.createElement(TbCell, { id: e.props.id, key: "tb-cell-".concat(i), align: e.props.align, children: e.props.children, onClick: e.props.onClick, fixed: e.props.fixed, style: e.props.fixed ? (_this.props.children && i === _this.props.children.length - 1) ? __assign({ right: 0 }, ((_a = e.props.style) !== null && _a !== void 0 ? _a : {})) : __assign({ left: ox }, ((_b = e.props.style) !== null && _b !== void 0 ? _b : {})) : e.props.style, className: e.props.className });
|
|
93
93
|
})));
|
|
94
94
|
};
|
|
95
95
|
return TbHeader;
|
|
@@ -101,7 +101,7 @@ var TbBody = /** @class */ (function (_super) {
|
|
|
101
101
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
102
102
|
}
|
|
103
103
|
TbBody.prototype.render = function () {
|
|
104
|
-
return react_1.default.createElement("tbody",
|
|
104
|
+
return react_1.default.createElement("tbody", { id: this.props.id }, this.props.children);
|
|
105
105
|
};
|
|
106
106
|
return TbBody;
|
|
107
107
|
}(react_1.default.Component));
|
|
@@ -112,7 +112,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
112
112
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
113
113
|
}
|
|
114
114
|
Table.prototype.render = function () {
|
|
115
|
-
return react_1.default.createElement("table", { className: "custom-table ".concat(this.props.className), style: this.props.style }, this.props.children);
|
|
115
|
+
return react_1.default.createElement("table", { id: this.props.id, className: "custom-table ".concat(this.props.className), style: this.props.style }, this.props.children);
|
|
116
116
|
};
|
|
117
117
|
return Table;
|
|
118
118
|
}(react_1.default.Component));
|
|
@@ -43,7 +43,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
43
43
|
if (this.props.maxLine) {
|
|
44
44
|
convertStyle = __assign(__assign({}, convertStyle), { '--max-line': this.props.maxLine });
|
|
45
45
|
}
|
|
46
|
-
return react_1.default.createElement("div", { onMouseOver: this.props.onHover, onClick: this.props.onClick, className: "comp-text ".concat(this.props.onClick ? 'type-button' : '', " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : ''), style: convertStyle }, this.props.children);
|
|
46
|
+
return react_1.default.createElement("div", { id: this.props.id, onMouseOver: this.props.onHover, onClick: this.props.onClick, className: "comp-text ".concat(this.props.onClick ? 'type-button' : '', " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : ''), style: convertStyle }, this.props.children);
|
|
47
47
|
};
|
|
48
48
|
return Text;
|
|
49
49
|
}(react_1.default.Component));
|
|
@@ -39,7 +39,7 @@ var TextArea = /** @class */ (function (_super) {
|
|
|
39
39
|
}
|
|
40
40
|
TextArea.prototype.render = function () {
|
|
41
41
|
var _a, _b, _c, _d;
|
|
42
|
-
return react_1.default.createElement("div", { className: "text-area-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "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' } }, this.props.register ?
|
|
42
|
+
return react_1.default.createElement("div", { id: this.props.id, className: "text-area-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "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' } }, this.props.register ?
|
|
43
43
|
react_1.default.createElement("textarea", __assign({ autoFocus: this.props.autoFocus }, this.props.register, { maxLength: this.props.maxLength, name: this.props.name, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onFocus: this.props.onFocus })) : react_1.default.createElement("textarea", { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, defaultValue: this.props.defaultValue, value: this.props.value, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onChange: this.props.onChange, onFocus: this.props.onFocus, onBlur: this.props.onBlur }));
|
|
44
44
|
};
|
|
45
45
|
return TextArea;
|
|
@@ -39,7 +39,7 @@ var TextField = /** @class */ (function (_super) {
|
|
|
39
39
|
}
|
|
40
40
|
TextField.prototype.render = function () {
|
|
41
41
|
var _a, _b, _c, _d, _e, _f;
|
|
42
|
-
return react_1.default.createElement("div", { className: "text-field-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "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' } },
|
|
42
|
+
return react_1.default.createElement("div", { id: this.props.id, className: "text-field-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'body-3', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "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' } },
|
|
43
43
|
this.props.prefix,
|
|
44
44
|
this.props.register ?
|
|
45
45
|
react_1.default.createElement("input", __assign({}, this.props.register, { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, type: (_e = this.props.type) !== null && _e !== void 0 ? _e : 'text', placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onFocus: this.props.onFocus })) : react_1.default.createElement("input", { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, type: (_f = this.props.type) !== null && _f !== void 0 ? _f : 'text', defaultValue: this.props.defaultValue, value: this.props.value, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onChange: this.props.onChange, onFocus: this.props.onFocus, onBlur: this.props.onBlur }),
|