wini-web-components 2.6.0 → 2.6.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.
Files changed (39) hide show
  1. package/dist/component/button/button.d.ts +2 -1
  2. package/dist/component/button/button.js +9 -29
  3. package/dist/component/calendar/calendar.d.ts +0 -6
  4. package/dist/component/calendar/calendar.js +141 -181
  5. package/dist/component/checkbox/checkbox.js +26 -56
  6. package/dist/component/ck-editor/ckeditor.js +18 -29
  7. package/dist/component/component-status.js +6 -6
  8. package/dist/component/date-picker/date-picker.js +141 -174
  9. package/dist/component/date-time-picker/date-time-picker.d.ts +36 -0
  10. package/dist/component/date-time-picker/date-time-picker.js +572 -0
  11. package/dist/component/dialog/dialog.js +37 -67
  12. package/dist/component/import-file/import-file.js +67 -106
  13. package/dist/component/infinite-scroll/infinite-scroll.js +17 -83
  14. package/dist/component/input-multi-select/input-multi-select.js +102 -178
  15. package/dist/component/input-otp/input-otp.js +29 -69
  16. package/dist/component/number-picker/number-picker.js +21 -33
  17. package/dist/component/pagination/pagination.js +19 -22
  18. package/dist/component/popup/popup.d.ts +2 -2
  19. package/dist/component/popup/popup.js +43 -70
  20. package/dist/component/progress-bar/progress-bar.js +12 -24
  21. package/dist/component/progress-circle/progress-circle.js +8 -19
  22. package/dist/component/radio-button/radio-button.js +11 -42
  23. package/dist/component/rating/rating.js +29 -48
  24. package/dist/component/select1/select1.js +91 -160
  25. package/dist/component/slider/slider.js +36 -54
  26. package/dist/component/switch/switch.js +22 -52
  27. package/dist/component/table/table.js +36 -89
  28. package/dist/component/tag/tag.js +8 -28
  29. package/dist/component/text/text.js +9 -40
  30. package/dist/component/text-area/text-area.js +12 -41
  31. package/dist/component/text-field/text-field.js +17 -47
  32. package/dist/component/toast-noti/toast-noti.js +7 -10
  33. package/dist/component/wini-icon/winicon.js +55 -113
  34. package/dist/form/login/view.js +28 -28
  35. package/dist/index.d.ts +3 -3
  36. package/dist/index.js +1 -1
  37. package/dist/index.js.LICENSE.txt +1 -11
  38. package/dist/language/i18n.js +24 -5
  39. 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
- var react_1 = __importStar(require("react"));
52
- var number_picker_module_css_1 = __importDefault(require("./number-picker.module.css"));
53
- var NumberPicker = function (_a) {
54
- var id = _a.id, value = _a.value, onChange = _a.onChange, disabled = _a.disabled, readOnly = _a.readOnly, className = _a.className, helperText = _a.helperText, helperTextColor = _a.helperTextColor, max = _a.max, min = _a.min, style = _a.style, _b = _a.type, type = _b === void 0 ? "icon-button" : _b, _c = _a.volume, volume = _c === void 0 ? 1 : _c;
55
- var _d = (0, react_1.useState)(0), val = _d[0], setValue = _d[1];
56
- var inputRef = (0, react_1.useRef)(null);
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 = "".concat(value !== null && value !== void 0 ? value : 0);
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: "row ".concat(number_picker_module_css_1.default["number-picker-container"], " ").concat(className !== null && className !== void 0 ? className : "body-2", " ").concat((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 ? __assign(__assign({}, { '--helper-text-color': helperTextColor !== null && helperTextColor !== void 0 ? helperTextColor : '#e14337' }), style) : { '--helper-text-color': helperTextColor !== null && helperTextColor !== void 0 ? helperTextColor : '#e14337' } },
64
- react_1.default.createElement("div", { className: "row", onClick: function () {
65
- var newValue = val - volume;
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 = "".concat(newValue);
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: function (ev) {
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: function (ev) { ev.target.select(); }, onBlur: function (ev) {
89
- var newValue = volume % 1 === 0 ? parseInt(ev.target.value.trim()) : parseFloat(ev.target.value.trim());
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 = "".concat(val);
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 = "".concat(min);
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 = "".concat(max);
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 = "".concat(newValue);
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: function () {
121
- var newValue = val + volume;
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 = "".concat(newValue);
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
- var react_1 = __importStar(require("react"));
41
- var react_paginate_1 = __importDefault(require("react-paginate"));
42
- var pagination_module_css_1 = __importDefault(require("./pagination.module.css"));
43
- var select1_1 = require("../select1/select1");
44
- var text_1 = require("../text/text");
45
- var text_field_1 = require("../text-field/text-field");
46
- var winicon_1 = require("../wini-icon/winicon");
47
- var react_i18next_1 = require("react-i18next");
48
- function Pagination(_a) {
49
- 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;
50
- var goToPageRef = (0, react_1.useRef)(null);
51
- var t = (0, react_i18next_1.useTranslation)().t;
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
- var _inputPage = goToPageRef.current.getInput();
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: "".concat(pagination_module_css_1.default['custom-pagination'], " row"), style: style },
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(function (item, _) { return { id: item, name: item }; }), style: { borderRadius: '0.4rem', width: '5.6rem', padding: '0 0.8rem', height: '2.4rem' }, onChange: function (ev) {
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: function (ev) {
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: "".concat(pagination_module_css_1.default['pagination'], " row"), pageClassName: "row button-text-3", activeClassName: pagination_module_css_1.default['active'], hrefBuilder: function (pageIndex) {
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: function (ev) {
83
- var _tmp = ev.target.value.trim().length ? parseInt(ev.target.value.trim()) : undefined;
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,16 +19,15 @@ 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;
24
26
  export declare class Popup extends React.Component<Object, PopupState> {
25
- private ref;
26
27
  constructor(props: Object | Readonly<Object>);
27
28
  state: Readonly<PopupState>;
28
29
  onOpen(data: PopupState): void;
29
30
  onClose(): void;
30
- componentDidUpdate(prevProps: Readonly<Object>, prevState: Readonly<PopupState>): void;
31
31
  render(): React.JSX.Element;
32
32
  }
33
33
  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
- var react_1 = __importStar(require("react"));
38
+ const react_1 = __importStar(require("react"));
65
39
  require("./popup.css");
66
- var showPopup = function (props) {
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,80 @@ 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
- var closePopup = function (ref) {
54
+ const closePopup = (ref) => {
80
55
  ref.current.onClose();
81
56
  };
82
57
  exports.closePopup = closePopup;
83
- var Popup = /** @class */ (function (_super) {
84
- __extends(Popup, _super);
85
- function Popup(props) {
86
- var _this = _super.call(this, props) || this;
87
- _this.ref = (0, react_1.createRef)();
88
- _this.state = {
58
+ class Popup extends react_1.default.Component {
59
+ constructor(props) {
60
+ super(props);
61
+ this.state = {
89
62
  open: false,
90
63
  };
91
- return _this;
92
64
  }
93
- Popup.prototype.onOpen = function (data) {
94
- this.setState(__assign({ open: true }, data));
95
- };
96
- Popup.prototype.onClose = function () {
65
+ onOpen(data) {
66
+ this.setState(Object.assign({ open: true }, data));
67
+ }
68
+ onClose() {
97
69
  this.setState({ open: false });
98
- };
99
- Popup.prototype.componentDidUpdate = function (prevProps, prevState) {
100
- if (prevState.open !== this.state.open && this.state.open && this.state.style) {
101
- }
102
- };
103
- Popup.prototype.render = function () {
104
- var _this = this;
105
- var _a;
70
+ }
71
+ render() {
72
+ var _a, _b;
106
73
  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 ? function () { _this.onClose(); } : undefined }, (_a = this.state.content) !== null && _a !== void 0 ? _a : react_1.default.createElement("div", { ref: this.ref, className: 'popup-container col', onClick: function (e) { return e.stopPropagation(); }, style: this.state.style },
74
+ 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", { className: `popup-container col ${(_b = this.state.className) !== null && _b !== void 0 ? _b : ""}`, onClick: e => e.stopPropagation(), style: this.state.style },
108
75
  this.state.heading,
109
76
  this.state.body,
110
77
  this.state.footer,
111
- this.state.hideButtonClose ? null : react_1.default.createElement("button", { type: 'button', onClick: function () { return _this.onClose(); }, className: 'popup-close-btn row' },
78
+ this.state.hideButtonClose ? null : react_1.default.createElement("button", { type: 'button', onClick: () => this.onClose(), className: 'popup-close-btn row' },
112
79
  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
80
  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
- return Popup;
116
- }(react_1.default.Component));
81
+ }
82
+ }
117
83
  exports.Popup = Popup;
118
- function PopupOverlay(_a) {
119
- var children = _a.children, onClose = _a.onClose, className = _a.className, style = _a.style, onOpen = _a.onOpen;
120
- var overlayRef = (0, react_1.useRef)(null);
121
- (0, react_1.useEffect)(function () {
84
+ function PopupOverlay({ children, onClose, className, style, onOpen }) {
85
+ const overlayRef = (0, react_1.useRef)(null);
86
+ (0, react_1.useEffect)(() => {
122
87
  if (overlayRef.current && onClose) {
123
- var onClickDropDown_1 = function (ev) {
88
+ const onClickDropDown = (ev) => {
124
89
  if (ev.target !== overlayRef.current && !overlayRef.current.contains(ev.target))
125
90
  onClose(ev);
126
91
  };
127
- window.document.body.addEventListener("mousedown", onClickDropDown_1);
128
- return function () {
129
- window.document.body.removeEventListener("mousedown", onClickDropDown_1);
92
+ window.document.body.addEventListener("mousedown", onClickDropDown);
93
+ return () => {
94
+ window.document.body.removeEventListener("mousedown", onClickDropDown);
130
95
  };
131
96
  }
132
97
  }, [overlayRef]);
133
- (0, react_1.useEffect)(function () {
98
+ (0, react_1.useEffect)(() => {
134
99
  if (overlayRef.current && onOpen)
135
100
  onOpen(overlayRef.current);
136
101
  }, [overlayRef, onOpen]);
137
- (0, react_1.useEffect)(function () {
102
+ (0, react_1.useEffect)(() => {
138
103
  if (overlayRef.current && overlayRef.current.firstChild) {
139
- var popupContent = overlayRef.current.firstChild;
140
- var rect = popupContent.getBoundingClientRect();
141
- if (rect.x < 0)
104
+ const popupContent = overlayRef.current.firstChild;
105
+ const rect = popupContent.getBoundingClientRect();
106
+ if (rect.x < 0) {
142
107
  popupContent.style.left = "0px";
143
- else if (rect.right > document.body.offsetWidth)
108
+ popupContent.style.right = "unset";
109
+ }
110
+ else if (rect.right > document.body.offsetWidth) {
144
111
  popupContent.style.right = "0px";
145
- if (rect.y < 0)
112
+ popupContent.style.left = "unset";
113
+ }
114
+ if (rect.y < 0) {
146
115
  popupContent.style.top = "0px";
147
- else if (rect.bottom > document.body.offsetHeight)
116
+ popupContent.style.bottom = "unset";
117
+ }
118
+ else if (rect.bottom > document.body.offsetHeight) {
148
119
  popupContent.style.bottom = "0px";
120
+ popupContent.style.top = "unset";
121
+ }
149
122
  }
150
123
  }, [overlayRef]);
151
- return react_1.default.createElement("div", { ref: overlayRef, className: "popup-overlay ".concat(className !== null && className !== void 0 ? className : ""), style: style }, children);
124
+ return react_1.default.createElement("div", { ref: overlayRef, className: `popup-overlay ${className !== null && className !== void 0 ? className : ""}`, style: style }, children);
152
125
  }
@@ -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
- var react_1 = require("react");
19
- var progress_bar_module_css_1 = __importDefault(require("./progress-bar.module.css"));
20
- var react_2 = __importDefault(require("react"));
21
- var index_1 = require("../../index");
22
- function ProgressBar(_a) {
23
- 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(--neutral-main-background-color)' : _f, _g = _a.percentColor, percentColor = _g === void 0 ? 'var(--primary-main-color)' : _g, style = _a.style, progressBarStyle = _a.progressBarStyle;
24
- var _h = (0, react_1.useState)(true), openDetails = _h[0], setOpenDetails = _h[1];
25
- return react_2.default.createElement("div", { id: id, className: "col ".concat(progress_bar_module_css_1.default["progress-bar-container"]), style: style ? __assign({ padding: progressBarOnly ? '0' : '1.6rem 2.4rem' }, style) : { padding: progressBarOnly ? '0' : '1.6rem 2.4rem' } },
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: function () { setOpenDetails(!openDetails); } }))),
29
- openDetails ? react_2.default.createElement("div", { className: "row ".concat(progress_bar_module_css_1.default["progress-bar-tile"]) },
30
- react_2.default.createElement("div", { className: progress_bar_module_css_1.default["progress-bar-value"], style: __assign({ '--percent-color': percentColor, '--full-color': fullColor, '--percent': "".concat(percent, "%") }, (progressBarStyle !== null && progressBarStyle !== void 0 ? progressBarStyle : {})) }),
31
- progressBarOnly || status === index_1.ComponentStatus.INFOR ? null : react_2.default.createElement("div", { className: "".concat(progress_bar_module_css_1.default["status-icon"]) }, (0, index_1.getStatusIcon)(status)),
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
- var react_1 = __importDefault(require("react"));
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
- var radius = 30 - ((_a = props.strokeWidth) !== null && _a !== void 0 ? _a : 4);
23
- var diameter = Math.PI * 2 * radius;
24
- var strokeOffset = (1 - (((_b = props.percent) !== null && _b !== void 0 ? _b : 0) / 100)) * diameter;
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: __assign({ width: '6rem', height: '6rem' }, ((_c = props.style) !== null && _c !== void 0 ? _c : {})) },
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: (_d = props.strokeColor) !== null && _d !== void 0 ? _d : "var(--neutral-main-background-color)", strokeWidth: (_e = props.strokeWidth) !== null && _e !== void 0 ? _e : '4px', } }),
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: (_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: "".concat(diameter, "px ").concat(diameter, "px"), strokeDashoffset: "".concat(strokeOffset, "px") } }),
28
- react_1.default.createElement("text", { x: "50%", y: "50%", dy: ".3em", textAnchor: "middle", fontSize: "1.6rem", fontWeight: '600', style: __assign({ fill: "var(neutral-text-title-color)" }, ((_j = props.textStyle) !== null && _j !== void 0 ? _j : {})) }, (_k = props.percent) !== null && _k !== void 0 ? _k : 0,
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
- var react_1 = __importDefault(require("react"));
34
- var radio_button_module_css_1 = __importDefault(require("./radio-button.module.css"));
35
- var RadioButton = /** @class */ (function (_super) {
36
- __extends(RadioButton, _super);
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
- var convertStyle = {
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') ? "".concat(this.props.size, "px") : this.props.size : '20px'
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 = __assign(__assign({}, this.props.style), 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: "row ".concat(radio_button_module_css_1.default['radio-btn-container'], " ").concat((_c = this.props.className) !== null && _c !== void 0 ? _c : ''), style: convertStyle },
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", __assign({}, this.props.register, { type: "radio", value: this.props.value, disabled: this.props.disabled })) :
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
- return RadioButton;
63
- }(react_1.default.Component));
31
+ }
32
+ }
64
33
  exports.RadioButton = RadioButton;