wini-web-components 2.6.0 → 2.6.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.
- package/dist/component/button/button.js +9 -29
- package/dist/component/calendar/calendar.js +140 -173
- package/dist/component/checkbox/checkbox.js +26 -56
- package/dist/component/ck-editor/ckeditor.js +18 -29
- package/dist/component/component-status.js +6 -6
- package/dist/component/date-picker/date-picker.js +141 -174
- package/dist/component/dialog/dialog.js +37 -67
- package/dist/component/import-file/import-file.js +67 -106
- package/dist/component/infinite-scroll/infinite-scroll.js +17 -83
- package/dist/component/input-multi-select/input-multi-select.js +102 -178
- package/dist/component/input-otp/input-otp.js +29 -69
- package/dist/component/number-picker/number-picker.js +21 -33
- package/dist/component/pagination/pagination.js +19 -22
- package/dist/component/popup/popup.d.ts +2 -1
- package/dist/component/popup/popup.js +44 -70
- package/dist/component/progress-bar/progress-bar.js +12 -24
- package/dist/component/progress-circle/progress-circle.js +8 -19
- package/dist/component/radio-button/radio-button.js +11 -42
- package/dist/component/rating/rating.js +29 -48
- package/dist/component/select1/select1.js +91 -160
- package/dist/component/slider/slider.js +36 -54
- package/dist/component/switch/switch.js +22 -52
- package/dist/component/table/table.js +36 -89
- package/dist/component/tag/tag.js +8 -28
- package/dist/component/text/text.js +9 -40
- package/dist/component/text-area/text-area.js +12 -41
- package/dist/component/text-field/text-field.js +17 -47
- package/dist/component/toast-noti/toast-noti.js +7 -10
- package/dist/component/wini-icon/winicon.js +55 -113
- package/dist/form/login/view.js +28 -28
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +1 -11
- package/dist/language/i18n.js +4 -4
- package/package.json +1 -1
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -48,21 +37,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
37
|
};
|
|
49
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
39
|
exports.NumberPicker = void 0;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(0, react_1.useEffect)(function () {
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const number_picker_module_css_1 = __importDefault(require("./number-picker.module.css"));
|
|
42
|
+
const NumberPicker = ({ id, value, onChange, disabled, readOnly, className, helperText, helperTextColor, max, min, style, type = "icon-button", volume = 1 }) => {
|
|
43
|
+
const [val, setValue] = (0, react_1.useState)(0);
|
|
44
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
58
46
|
if (inputRef.current) {
|
|
59
47
|
setValue(value !== null && value !== void 0 ? value : 0);
|
|
60
|
-
inputRef.current.value =
|
|
48
|
+
inputRef.current.value = `${value !== null && value !== void 0 ? value : 0}`;
|
|
61
49
|
}
|
|
62
50
|
}, [value, inputRef]);
|
|
63
|
-
return react_1.default.createElement("div", { id: id, className:
|
|
64
|
-
react_1.default.createElement("div", { className: "row", onClick:
|
|
65
|
-
|
|
51
|
+
return react_1.default.createElement("div", { id: id, className: `row ${number_picker_module_css_1.default["number-picker-container"]} ${className !== null && className !== void 0 ? className : "body-2"} ${(helperText === null || helperText === void 0 ? void 0 : helperText.length) && number_picker_module_css_1.default['helper-text']}`, "number-picker-type": type !== null && type !== void 0 ? type : "icon-button", "helper-text": helperText, style: style ? Object.assign(Object.assign({}, { '--helper-text-color': helperTextColor !== null && helperTextColor !== void 0 ? helperTextColor : '#e14337' }), style) : { '--helper-text-color': helperTextColor !== null && helperTextColor !== void 0 ? helperTextColor : '#e14337' } },
|
|
52
|
+
react_1.default.createElement("div", { className: "row", onClick: () => {
|
|
53
|
+
let newValue = val - volume;
|
|
66
54
|
if (min === undefined || newValue >= min) {
|
|
67
55
|
if (volume % 1 === 0)
|
|
68
56
|
newValue = Math.round(newValue);
|
|
@@ -70,14 +58,14 @@ var NumberPicker = function (_a) {
|
|
|
70
58
|
newValue = parseFloat(newValue.toFixed(1));
|
|
71
59
|
setValue(newValue);
|
|
72
60
|
if (inputRef.current)
|
|
73
|
-
inputRef.current.value =
|
|
61
|
+
inputRef.current.value = `${newValue}`;
|
|
74
62
|
if (onChange)
|
|
75
63
|
onChange(newValue);
|
|
76
64
|
}
|
|
77
65
|
} },
|
|
78
66
|
react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
79
67
|
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.3335 7.93907C1.3335 7.60435 1.60484 7.33301 1.93956 7.33301H14.0608C14.3955 7.33301 14.6668 7.60435 14.6668 7.93907C14.6668 8.27379 14.3955 8.54513 14.0608 8.54513H1.93956C1.60484 8.54513 1.3335 8.27379 1.3335 7.93907Z" }))),
|
|
80
|
-
react_1.default.createElement("input", { ref: inputRef, readOnly: readOnly, disabled: disabled, onKeyDown:
|
|
68
|
+
react_1.default.createElement("input", { ref: inputRef, readOnly: readOnly, disabled: disabled, onKeyDown: (ev) => {
|
|
81
69
|
switch (ev.key.toLowerCase()) {
|
|
82
70
|
case "enter":
|
|
83
71
|
ev.target.blur();
|
|
@@ -85,10 +73,10 @@ var NumberPicker = function (_a) {
|
|
|
85
73
|
default:
|
|
86
74
|
break;
|
|
87
75
|
}
|
|
88
|
-
}, onFocus:
|
|
89
|
-
|
|
76
|
+
}, onFocus: (ev) => { ev.target.select(); }, onBlur: (ev) => {
|
|
77
|
+
let newValue = volume % 1 === 0 ? parseInt(ev.target.value.trim()) : parseFloat(ev.target.value.trim());
|
|
90
78
|
if (isNaN(newValue))
|
|
91
|
-
ev.target.value =
|
|
79
|
+
ev.target.value = `${val}`;
|
|
92
80
|
else {
|
|
93
81
|
if (volume % 1 === 0)
|
|
94
82
|
newValue = Math.round(newValue);
|
|
@@ -97,28 +85,28 @@ var NumberPicker = function (_a) {
|
|
|
97
85
|
if (min !== undefined && newValue < min) {
|
|
98
86
|
setValue(min);
|
|
99
87
|
if (inputRef.current)
|
|
100
|
-
inputRef.current.value =
|
|
88
|
+
inputRef.current.value = `${min}`;
|
|
101
89
|
if (onChange)
|
|
102
90
|
onChange(min);
|
|
103
91
|
}
|
|
104
92
|
else if (max !== undefined && newValue > max) {
|
|
105
93
|
setValue(max);
|
|
106
94
|
if (inputRef.current)
|
|
107
|
-
inputRef.current.value =
|
|
95
|
+
inputRef.current.value = `${max}`;
|
|
108
96
|
if (onChange)
|
|
109
97
|
onChange(max);
|
|
110
98
|
}
|
|
111
99
|
else {
|
|
112
100
|
setValue(newValue);
|
|
113
101
|
if (inputRef.current)
|
|
114
|
-
inputRef.current.value =
|
|
102
|
+
inputRef.current.value = `${newValue}`;
|
|
115
103
|
if (onChange)
|
|
116
104
|
onChange(newValue);
|
|
117
105
|
}
|
|
118
106
|
}
|
|
119
107
|
} }),
|
|
120
|
-
react_1.default.createElement("div", { className: "row", onClick:
|
|
121
|
-
|
|
108
|
+
react_1.default.createElement("div", { className: "row", onClick: () => {
|
|
109
|
+
let newValue = val + volume;
|
|
122
110
|
if (max === undefined || newValue <= max) {
|
|
123
111
|
if (volume % 1 === 0)
|
|
124
112
|
newValue = Math.round(newValue);
|
|
@@ -126,7 +114,7 @@ var NumberPicker = function (_a) {
|
|
|
126
114
|
newValue = parseFloat(newValue.toFixed(1));
|
|
127
115
|
setValue(newValue);
|
|
128
116
|
if (inputRef.current)
|
|
129
|
-
inputRef.current.value =
|
|
117
|
+
inputRef.current.value = `${newValue}`;
|
|
130
118
|
if (onChange)
|
|
131
119
|
onChange(newValue);
|
|
132
120
|
}
|
|
@@ -37,21 +37,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Pagination = Pagination;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
function Pagination(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(0, react_1.useEffect)(function () {
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const react_paginate_1 = __importDefault(require("react-paginate"));
|
|
42
|
+
const pagination_module_css_1 = __importDefault(require("./pagination.module.css"));
|
|
43
|
+
const select1_1 = require("../select1/select1");
|
|
44
|
+
const text_1 = require("../text/text");
|
|
45
|
+
const text_field_1 = require("../text-field/text-field");
|
|
46
|
+
const winicon_1 = require("../wini-icon/winicon");
|
|
47
|
+
const react_i18next_1 = require("react-i18next");
|
|
48
|
+
function Pagination({ id, currentPage, itemPerPage, totalItem, onChangePage, hidePageSize = false, hideGoToPage = false, style }) {
|
|
49
|
+
const goToPageRef = (0, react_1.useRef)(null);
|
|
50
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
53
52
|
if (goToPageRef.current) {
|
|
54
|
-
|
|
53
|
+
const _inputPage = goToPageRef.current.getInput();
|
|
55
54
|
if (_inputPage)
|
|
56
55
|
_inputPage.value = currentPage.toString();
|
|
57
56
|
}
|
|
@@ -61,26 +60,24 @@ function Pagination(_a) {
|
|
|
61
60
|
return react_1.default.createElement("div", null);
|
|
62
61
|
}
|
|
63
62
|
else if (totalItem > 0) {
|
|
64
|
-
return react_1.default.createElement("div", { id: id, className:
|
|
63
|
+
return react_1.default.createElement("div", { id: id, className: `${pagination_module_css_1.default['custom-pagination']} row`, style: style },
|
|
65
64
|
hidePageSize ? null : react_1.default.createElement("div", { className: "row", style: { gap: '0.8rem' } },
|
|
66
|
-
react_1.default.createElement(select1_1.Select1, { readOnly: true, placeholder: itemPerPage.toString(), options: [10, 20, 50, 80, 100, 150, 200].map(
|
|
65
|
+
react_1.default.createElement(select1_1.Select1, { readOnly: true, placeholder: itemPerPage.toString(), options: [10, 20, 50, 80, 100, 150, 200].map((item, _) => { return { id: item, name: item }; }), style: { borderRadius: '0.4rem', width: '5.6rem', padding: '0 0.8rem', height: '2.4rem' }, onChange: (ev) => {
|
|
67
66
|
onChangePage(currentPage, isNaN(parseInt(ev.id)) ? itemPerPage : parseInt(ev.id));
|
|
68
67
|
} }),
|
|
69
68
|
react_1.default.createElement(text_1.Text, { className: "body-3" }, t("ofItems", { totalItem: totalItem }))),
|
|
70
69
|
react_1.default.createElement("div", { style: { flex: 1 } }),
|
|
71
|
-
react_1.default.createElement(react_paginate_1.default, { onPageChange:
|
|
70
|
+
react_1.default.createElement(react_paginate_1.default, { onPageChange: (ev) => {
|
|
72
71
|
onChangePage(ev.selected + 1, itemPerPage);
|
|
73
|
-
}, forcePage: currentPage - 1, breakClassName: "row button-text-3", breakLabel: "...", pageCount: Math.ceil(totalItem / itemPerPage), previousClassName: "row", previousLabel: react_1.default.createElement(winicon_1.Winicon, { src: "fill/arrows/left-arrow", size: "1.4rem" }), nextClassName: "row", nextLabel: react_1.default.createElement(winicon_1.Winicon, { src: "fill/arrows/right-arrow", size: "1.4rem" }), containerClassName:
|
|
74
|
-
return pageIndex >= 1 && pageIndex <= Math.ceil(totalItem / itemPerPage) ? "/page/".concat(pageIndex) : '#';
|
|
75
|
-
}, renderOnZeroPageCount: null }),
|
|
72
|
+
}, forcePage: currentPage - 1, breakClassName: "row button-text-3", breakLabel: "...", pageCount: Math.ceil(totalItem / itemPerPage), previousClassName: "row", previousLabel: react_1.default.createElement(winicon_1.Winicon, { src: "fill/arrows/left-arrow", size: "1.4rem" }), nextClassName: "row", nextLabel: react_1.default.createElement(winicon_1.Winicon, { src: "fill/arrows/right-arrow", size: "1.4rem" }), containerClassName: `${pagination_module_css_1.default['pagination']} row`, pageClassName: "row button-text-3", activeClassName: pagination_module_css_1.default['active'], hrefBuilder: (pageIndex) => pageIndex >= 1 && pageIndex <= Math.ceil(totalItem / itemPerPage) ? `/page/${pageIndex}` : '#', renderOnZeroPageCount: null }),
|
|
76
73
|
hideGoToPage ? null : react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
74
|
react_1.default.createElement("div", { style: { height: '1.6rem', backgroundColor: "var(--neutral-bolder-border-color)", width: 1 } }),
|
|
78
75
|
react_1.default.createElement(text_1.Text, { className: "label-3" },
|
|
79
76
|
t("go"),
|
|
80
77
|
" ",
|
|
81
78
|
t("page").toLowerCase()),
|
|
82
|
-
react_1.default.createElement(text_field_1.TextField, { ref: goToPageRef, style: { width: '4.8rem', textAlign: "center", padding: 0, height: '2.4rem', borderRadius: '0.4rem' }, className: "body-3", type: "number", onBlur:
|
|
83
|
-
|
|
79
|
+
react_1.default.createElement(text_field_1.TextField, { ref: goToPageRef, style: { width: '4.8rem', textAlign: "center", padding: 0, height: '2.4rem', borderRadius: '0.4rem' }, className: "body-3", type: "number", onBlur: (ev) => {
|
|
80
|
+
const _tmp = ev.target.value.trim().length ? parseInt(ev.target.value.trim()) : undefined;
|
|
84
81
|
if (_tmp && !isNaN(_tmp) && _tmp > 0 && _tmp <= Math.ceil(totalItem / itemPerPage)) {
|
|
85
82
|
onChangePage(_tmp, itemPerPage);
|
|
86
83
|
}
|
|
@@ -8,6 +8,7 @@ interface PopupState {
|
|
|
8
8
|
footer?: ReactNode;
|
|
9
9
|
clickOverlayClosePopup?: boolean;
|
|
10
10
|
style?: CSSProperties;
|
|
11
|
+
className?: string;
|
|
11
12
|
hideButtonClose?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const showPopup: (props: {
|
|
@@ -18,6 +19,7 @@ export declare const showPopup: (props: {
|
|
|
18
19
|
footer?: ReactNode;
|
|
19
20
|
clickOverlayClosePopup?: boolean;
|
|
20
21
|
style?: CSSProperties;
|
|
22
|
+
className?: string;
|
|
21
23
|
hideButtonClose?: boolean;
|
|
22
24
|
}) => void;
|
|
23
25
|
export declare const closePopup: (ref: React.RefObject<Popup>) => void;
|
|
@@ -27,7 +29,6 @@ export declare class Popup extends React.Component<Object, PopupState> {
|
|
|
27
29
|
state: Readonly<PopupState>;
|
|
28
30
|
onOpen(data: PopupState): void;
|
|
29
31
|
onClose(): void;
|
|
30
|
-
componentDidUpdate(prevProps: Readonly<Object>, prevState: Readonly<PopupState>): void;
|
|
31
32
|
render(): React.JSX.Element;
|
|
32
33
|
}
|
|
33
34
|
export declare function PopupOverlay({ children, onClose, className, style, onOpen }: {
|
|
@@ -1,30 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
3
|
if (k2 === undefined) k2 = k;
|
|
30
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -61,9 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
61
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
36
|
exports.Popup = exports.closePopup = exports.showPopup = void 0;
|
|
63
37
|
exports.PopupOverlay = PopupOverlay;
|
|
64
|
-
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
65
39
|
require("./popup.css");
|
|
66
|
-
|
|
40
|
+
const showPopup = (props) => {
|
|
67
41
|
var _a, _b;
|
|
68
42
|
(_b = (_a = props.ref) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.onOpen({
|
|
69
43
|
heading: props.heading,
|
|
@@ -72,81 +46,81 @@ var showPopup = function (props) {
|
|
|
72
46
|
footer: props.footer,
|
|
73
47
|
clickOverlayClosePopup: props.clickOverlayClosePopup,
|
|
74
48
|
style: props.style,
|
|
49
|
+
className: props.className,
|
|
75
50
|
hideButtonClose: props.hideButtonClose
|
|
76
51
|
});
|
|
77
52
|
};
|
|
78
53
|
exports.showPopup = showPopup;
|
|
79
|
-
|
|
54
|
+
const closePopup = (ref) => {
|
|
80
55
|
ref.current.onClose();
|
|
81
56
|
};
|
|
82
57
|
exports.closePopup = closePopup;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_this.state = {
|
|
58
|
+
class Popup extends react_1.default.Component {
|
|
59
|
+
constructor(props) {
|
|
60
|
+
super(props);
|
|
61
|
+
this.ref = (0, react_1.createRef)();
|
|
62
|
+
this.state = {
|
|
89
63
|
open: false,
|
|
90
64
|
};
|
|
91
|
-
return _this;
|
|
92
65
|
}
|
|
93
|
-
|
|
94
|
-
this.setState(
|
|
95
|
-
}
|
|
96
|
-
|
|
66
|
+
onOpen(data) {
|
|
67
|
+
this.setState(Object.assign({ open: true }, data));
|
|
68
|
+
}
|
|
69
|
+
onClose() {
|
|
97
70
|
this.setState({ open: false });
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
Popup.prototype.render = function () {
|
|
104
|
-
var _this = this;
|
|
105
|
-
var _a;
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
var _a, _b;
|
|
106
74
|
return (react_1.default.createElement(react_1.default.Fragment, null, this.state.open &&
|
|
107
|
-
react_1.default.createElement(PopupOverlay, { className: this.state.clickOverlayClosePopup ? 'hidden-overlay' : '', onClose: this.state.clickOverlayClosePopup ?
|
|
75
|
+
react_1.default.createElement(PopupOverlay, { className: this.state.clickOverlayClosePopup ? 'hidden-overlay' : '', onClose: this.state.clickOverlayClosePopup ? () => { this.onClose(); } : undefined }, (_a = this.state.content) !== null && _a !== void 0 ? _a : react_1.default.createElement("div", { ref: this.ref, className: `popup-container col ${(_b = this.state.className) !== null && _b !== void 0 ? _b : ""}`, onClick: e => e.stopPropagation(), style: this.state.style },
|
|
108
76
|
this.state.heading,
|
|
109
77
|
this.state.body,
|
|
110
78
|
this.state.footer,
|
|
111
|
-
this.state.hideButtonClose ? null : react_1.default.createElement("button", { type: 'button', onClick:
|
|
79
|
+
this.state.hideButtonClose ? null : react_1.default.createElement("button", { type: 'button', onClick: () => this.onClose(), className: 'popup-close-btn row' },
|
|
112
80
|
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' } },
|
|
113
81
|
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 })))))));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
}(react_1.default.Component));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
117
84
|
exports.Popup = Popup;
|
|
118
|
-
function PopupOverlay(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
(0, react_1.useEffect)(function () {
|
|
85
|
+
function PopupOverlay({ children, onClose, className, style, onOpen }) {
|
|
86
|
+
const overlayRef = (0, react_1.useRef)(null);
|
|
87
|
+
(0, react_1.useEffect)(() => {
|
|
122
88
|
if (overlayRef.current && onClose) {
|
|
123
|
-
|
|
89
|
+
const onClickDropDown = (ev) => {
|
|
124
90
|
if (ev.target !== overlayRef.current && !overlayRef.current.contains(ev.target))
|
|
125
91
|
onClose(ev);
|
|
126
92
|
};
|
|
127
|
-
window.document.body.addEventListener("mousedown",
|
|
128
|
-
return
|
|
129
|
-
window.document.body.removeEventListener("mousedown",
|
|
93
|
+
window.document.body.addEventListener("mousedown", onClickDropDown);
|
|
94
|
+
return () => {
|
|
95
|
+
window.document.body.removeEventListener("mousedown", onClickDropDown);
|
|
130
96
|
};
|
|
131
97
|
}
|
|
132
98
|
}, [overlayRef]);
|
|
133
|
-
(0, react_1.useEffect)(
|
|
99
|
+
(0, react_1.useEffect)(() => {
|
|
134
100
|
if (overlayRef.current && onOpen)
|
|
135
101
|
onOpen(overlayRef.current);
|
|
136
102
|
}, [overlayRef, onOpen]);
|
|
137
|
-
(0, react_1.useEffect)(
|
|
103
|
+
(0, react_1.useEffect)(() => {
|
|
138
104
|
if (overlayRef.current && overlayRef.current.firstChild) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (rect.x < 0)
|
|
105
|
+
const popupContent = overlayRef.current.firstChild;
|
|
106
|
+
const rect = popupContent.getBoundingClientRect();
|
|
107
|
+
if (rect.x < 0) {
|
|
142
108
|
popupContent.style.left = "0px";
|
|
143
|
-
|
|
109
|
+
popupContent.style.right = "unset";
|
|
110
|
+
}
|
|
111
|
+
else if (rect.right > document.body.offsetWidth) {
|
|
144
112
|
popupContent.style.right = "0px";
|
|
145
|
-
|
|
113
|
+
popupContent.style.left = "unset";
|
|
114
|
+
}
|
|
115
|
+
if (rect.y < 0) {
|
|
146
116
|
popupContent.style.top = "0px";
|
|
147
|
-
|
|
117
|
+
popupContent.style.bottom = "unset";
|
|
118
|
+
}
|
|
119
|
+
else if (rect.bottom > document.body.offsetHeight) {
|
|
148
120
|
popupContent.style.bottom = "0px";
|
|
121
|
+
popupContent.style.top = "unset";
|
|
122
|
+
}
|
|
149
123
|
}
|
|
150
124
|
}, [overlayRef]);
|
|
151
|
-
return react_1.default.createElement("div", { ref: overlayRef, className:
|
|
125
|
+
return react_1.default.createElement("div", { ref: overlayRef, className: `popup-overlay ${className !== null && className !== void 0 ? className : ""}`, style: style }, children);
|
|
152
126
|
}
|
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
6
|
exports.ProgressBar = ProgressBar;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function ProgressBar(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(hideTitle || progressBarOnly) ? null : (title !== null && title !== void 0 ? title : react_2.default.createElement("div", { className: "row ".concat(progress_bar_module_css_1.default["progress-bar-title"]) },
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const progress_bar_module_css_1 = __importDefault(require("./progress-bar.module.css"));
|
|
9
|
+
const react_2 = __importDefault(require("react"));
|
|
10
|
+
const index_1 = require("../../index");
|
|
11
|
+
function ProgressBar({ id, status = index_1.ComponentStatus.INFOR, percent = 100, titleText, title, hideTitle = false, progressBarOnly = false, fullColor = 'var(--neutral-main-background-color)', percentColor = 'var(--primary-main-color)', style, progressBarStyle }) {
|
|
12
|
+
const [openDetails, setOpenDetails] = (0, react_1.useState)(true);
|
|
13
|
+
return react_2.default.createElement("div", { id: id, className: `col ${progress_bar_module_css_1.default["progress-bar-container"]}`, style: style ? Object.assign({ padding: progressBarOnly ? '0' : '1.6rem 2.4rem' }, style) : { padding: progressBarOnly ? '0' : '1.6rem 2.4rem' } },
|
|
14
|
+
(hideTitle || progressBarOnly) ? null : (title !== null && title !== void 0 ? title : react_2.default.createElement("div", { className: `row ${progress_bar_module_css_1.default["progress-bar-title"]}` },
|
|
27
15
|
react_2.default.createElement("div", { className: "heading-8" }, titleText),
|
|
28
|
-
react_2.default.createElement(index_1.Winicon, { src: openDetails ? "fill/arrows/down-arrow" : "fill/arrows/up-arrow", onClick:
|
|
29
|
-
openDetails ? react_2.default.createElement("div", { className:
|
|
30
|
-
react_2.default.createElement("div", { className: progress_bar_module_css_1.default["progress-bar-value"], style:
|
|
31
|
-
progressBarOnly || status === index_1.ComponentStatus.INFOR ? null : react_2.default.createElement("div", { className:
|
|
16
|
+
react_2.default.createElement(index_1.Winicon, { src: openDetails ? "fill/arrows/down-arrow" : "fill/arrows/up-arrow", onClick: () => { setOpenDetails(!openDetails); } }))),
|
|
17
|
+
openDetails ? react_2.default.createElement("div", { className: `row ${progress_bar_module_css_1.default["progress-bar-tile"]}` },
|
|
18
|
+
react_2.default.createElement("div", { className: progress_bar_module_css_1.default["progress-bar-value"], style: Object.assign({ '--percent-color': percentColor, '--full-color': fullColor, '--percent': `${percent}%` }, (progressBarStyle !== null && progressBarStyle !== void 0 ? progressBarStyle : {})) }),
|
|
19
|
+
progressBarOnly || status === index_1.ComponentStatus.INFOR ? null : react_2.default.createElement("div", { className: `${progress_bar_module_css_1.default["status-icon"]}` }, (0, index_1.getStatusIcon)(status)),
|
|
32
20
|
progressBarOnly ? null : react_2.default.createElement("div", { className: 'label-4' },
|
|
33
21
|
percent,
|
|
34
22
|
"/100")) : null);
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
6
|
exports.ProgressCircle = ProgressCircle;
|
|
18
7
|
require("./progress-circle.css");
|
|
19
|
-
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
20
9
|
function ProgressCircle(props) {
|
|
21
10
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return react_1.default.createElement("svg", { id: props.id, width: "100%", height: "100%", viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", style:
|
|
26
|
-
react_1.default.createElement("path", { d:
|
|
27
|
-
react_1.default.createElement("path", { d:
|
|
28
|
-
react_1.default.createElement("text", { x: "50%", y: "50%", dy: ".3em", textAnchor: "middle", fontSize: "1.6rem", fontWeight: '600', style:
|
|
11
|
+
const radius = 30 - ((_a = props.strokeWidth) !== null && _a !== void 0 ? _a : 4);
|
|
12
|
+
const diameter = Math.PI * 2 * radius;
|
|
13
|
+
const strokeOffset = (1 - (((_b = props.percent) !== null && _b !== void 0 ? _b : 0) / 100)) * diameter;
|
|
14
|
+
return react_1.default.createElement("svg", { id: props.id, width: "100%", height: "100%", viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: Object.assign({ width: '6rem', height: '6rem' }, ((_c = props.style) !== null && _c !== void 0 ? _c : {})) },
|
|
15
|
+
react_1.default.createElement("path", { d: `M 30,30 m 0,-${radius} a ${radius},${radius} 0 1 1 0,${2 * radius} a ${radius},${radius} 0 1 1 0,-${2 * radius}`, style: { fill: "none", stroke: (_d = props.strokeColor) !== null && _d !== void 0 ? _d : "var(--neutral-main-background-color)", strokeWidth: (_e = props.strokeWidth) !== null && _e !== void 0 ? _e : '4px', } }),
|
|
16
|
+
react_1.default.createElement("path", { d: `M 30,30 m 0,-${radius} a ${radius},${radius} 0 1 1 0,${2 * radius} a ${radius},${radius} 0 1 1 0,-${2 * radius}`, style: { fill: (_f = props.fillColor) !== null && _f !== void 0 ? _f : "none", stroke: (_g = props.percentColor) !== null && _g !== void 0 ? _g : "var(--primary-main-color)", strokeWidth: (_h = props.strokeWidth) !== null && _h !== void 0 ? _h : '4px', strokeLinecap: 'round', strokeDasharray: `${diameter}px ${diameter}px`, strokeDashoffset: `${strokeOffset}px` } }),
|
|
17
|
+
react_1.default.createElement("text", { x: "50%", y: "50%", dy: ".3em", textAnchor: "middle", fontSize: "1.6rem", fontWeight: '600', style: Object.assign({ fill: "var(neutral-text-title-color)" }, ((_j = props.textStyle) !== null && _j !== void 0 ? _j : {})) }, (_k = props.percent) !== null && _k !== void 0 ? _k : 0,
|
|
29
18
|
"%"));
|
|
30
19
|
}
|
|
@@ -1,48 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
4
|
};
|
|
31
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
6
|
exports.RadioButton = void 0;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
function RadioButton() {
|
|
38
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
39
|
-
}
|
|
40
|
-
RadioButton.prototype.render = function () {
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const radio_button_module_css_1 = __importDefault(require("./radio-button.module.css"));
|
|
9
|
+
class RadioButton extends react_1.default.Component {
|
|
10
|
+
render() {
|
|
41
11
|
var _a, _b, _c;
|
|
42
|
-
|
|
12
|
+
let convertStyle = {
|
|
43
13
|
'--off-color': (_a = this.props.offColor) !== null && _a !== void 0 ? _a : 'var(--neutral-bolder-border-color)',
|
|
44
14
|
'--active-color': (_b = this.props.activeColor) !== null && _b !== void 0 ? _b : 'var(--primary-main-color)',
|
|
45
|
-
'--size': this.props.size ? (typeof this.props.size === 'number') ?
|
|
15
|
+
'--size': this.props.size ? (typeof this.props.size === 'number') ? `${this.props.size}px` : this.props.size : '20px'
|
|
46
16
|
};
|
|
47
17
|
if (this.props.style) {
|
|
48
18
|
delete this.props.style.width;
|
|
@@ -51,14 +21,13 @@ var RadioButton = /** @class */ (function (_super) {
|
|
|
51
21
|
delete this.props.style.height;
|
|
52
22
|
delete this.props.style.minHeight;
|
|
53
23
|
delete this.props.style.maxHeight;
|
|
54
|
-
convertStyle =
|
|
24
|
+
convertStyle = Object.assign(Object.assign({}, this.props.style), convertStyle);
|
|
55
25
|
}
|
|
56
|
-
return react_1.default.createElement("label", { id: this.props.id, className:
|
|
26
|
+
return react_1.default.createElement("label", { id: this.props.id, className: `row ${radio_button_module_css_1.default['radio-btn-container']} ${(_c = this.props.className) !== null && _c !== void 0 ? _c : ''}`, style: convertStyle },
|
|
57
27
|
this.props.register ?
|
|
58
|
-
react_1.default.createElement("input",
|
|
28
|
+
react_1.default.createElement("input", Object.assign({}, this.props.register, { type: "radio", value: this.props.value, disabled: this.props.disabled })) :
|
|
59
29
|
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 }),
|
|
60
30
|
react_1.default.createElement("span", { className: radio_button_module_css_1.default['checkmark'] }));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
}(react_1.default.Component));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
64
33
|
exports.RadioButton = RadioButton;
|