wini-web-components 2.7.0 → 2.7.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 (87) hide show
  1. package/dist/types/index.d.ts +1 -0
  2. package/dist/vite.svg +1 -0
  3. package/dist/wini-web-components.css +4 -0
  4. package/dist/wini-web-components.js +32 -0
  5. package/dist/wini-web-components.mjs +6753 -0
  6. package/package.json +48 -82
  7. package/README.md +0 -21
  8. package/dist/component/button/button.d.ts +0 -21
  9. package/dist/component/button/button.js +0 -73
  10. package/dist/component/calendar/calendar.d.ts +0 -30
  11. package/dist/component/calendar/calendar.js +0 -357
  12. package/dist/component/card/card-info.d.ts +0 -15
  13. package/dist/component/card/card-info.js +0 -51
  14. package/dist/component/card/card.d.ts +0 -13
  15. package/dist/component/card/card.js +0 -33
  16. package/dist/component/checkbox/checkbox.d.ts +0 -24
  17. package/dist/component/checkbox/checkbox.js +0 -90
  18. package/dist/component/ck-editor/ckeditor.d.ts +0 -36
  19. package/dist/component/ck-editor/ckeditor.js +0 -392
  20. package/dist/component/component-status.d.ts +0 -8
  21. package/dist/component/component-status.js +0 -39
  22. package/dist/component/date-picker/date-picker.d.ts +0 -25
  23. package/dist/component/date-picker/date-picker.js +0 -329
  24. package/dist/component/date-time-picker/date-time-picker.d.ts +0 -36
  25. package/dist/component/date-time-picker/date-time-picker.js +0 -528
  26. package/dist/component/dialog/dialog.d.ts +0 -18
  27. package/dist/component/dialog/dialog.js +0 -113
  28. package/dist/component/import-file/import-file.d.ts +0 -33
  29. package/dist/component/import-file/import-file.js +0 -151
  30. package/dist/component/infinite-scroll/infinite-scroll.d.ts +0 -17
  31. package/dist/component/infinite-scroll/infinite-scroll.js +0 -37
  32. package/dist/component/input-multi-select/input-multi-select.d.ts +0 -21
  33. package/dist/component/input-multi-select/input-multi-select.js +0 -260
  34. package/dist/component/input-opt/input-opt.d.ts +0 -21
  35. package/dist/component/input-opt/input-opt.js +0 -157
  36. package/dist/component/input-otp/input-otp.d.ts +0 -22
  37. package/dist/component/input-otp/input-otp.js +0 -131
  38. package/dist/component/number-picker/number-picker.d.ts +0 -23
  39. package/dist/component/number-picker/number-picker.js +0 -125
  40. package/dist/component/pagination/pagination.d.ts +0 -13
  41. package/dist/component/pagination/pagination.js +0 -90
  42. package/dist/component/popup/popup.d.ts +0 -40
  43. package/dist/component/popup/popup.js +0 -125
  44. package/dist/component/progress-bar/progress-bar.d.ts +0 -16
  45. package/dist/component/progress-bar/progress-bar.js +0 -23
  46. package/dist/component/progress-circle/progress-circle.d.ts +0 -14
  47. package/dist/component/progress-circle/progress-circle.js +0 -19
  48. package/dist/component/radio-button/radio-button.d.ts +0 -20
  49. package/dist/component/radio-button/radio-button.js +0 -33
  50. package/dist/component/rating/rating.d.ts +0 -23
  51. package/dist/component/rating/rating.js +0 -54
  52. package/dist/component/select1/select1.d.ts +0 -31
  53. package/dist/component/select1/select1.js +0 -249
  54. package/dist/component/slider/slider.d.ts +0 -31
  55. package/dist/component/slider/slider.js +0 -64
  56. package/dist/component/switch/switch.d.ts +0 -23
  57. package/dist/component/switch/switch.js +0 -50
  58. package/dist/component/table/table.d.ts +0 -51
  59. package/dist/component/table/table.js +0 -66
  60. package/dist/component/tag/tag.d.ts +0 -22
  61. package/dist/component/tag/tag.js +0 -19
  62. package/dist/component/text/text.d.ts +0 -16
  63. package/dist/component/text/text.js +0 -20
  64. package/dist/component/text-area/text-area.d.ts +0 -27
  65. package/dist/component/text-area/text-area.js +0 -57
  66. package/dist/component/text-field/text-field.d.ts +0 -36
  67. package/dist/component/text-field/text-field.js +0 -80
  68. package/dist/component/toast-noti/toast-noti.d.ts +0 -5
  69. package/dist/component/toast-noti/toast-noti.js +0 -25
  70. package/dist/component/wini-icon/winicon.d.ts +0 -20
  71. package/dist/component/wini-icon/winicon.js +0 -176
  72. package/dist/form/login/view.d.ts +0 -40
  73. package/dist/form/login/view.js +0 -66
  74. package/dist/i18n.d.ts +0 -2
  75. package/dist/i18n.js +0 -125
  76. package/dist/index.d.ts +0 -33
  77. package/dist/index.js +0 -2
  78. package/dist/index.js.LICENSE.txt +0 -18
  79. package/dist/language/i18n.d.ts +0 -2
  80. package/dist/language/i18n.js +0 -146
  81. package/global.d.ts +0 -4
  82. /package/{public → dist}/favicon.ico +0 -0
  83. /package/{public → dist}/index.html +0 -0
  84. /package/{public → dist}/logo192.png +0 -0
  85. /package/{public → dist}/logo512.png +0 -0
  86. /package/{public → dist}/manifest.json +0 -0
  87. /package/{public → dist}/robots.txt +0 -0
@@ -1,125 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.NumberPicker = void 0;
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)(() => {
46
- if (inputRef.current) {
47
- setValue(value !== null && value !== void 0 ? value : 0);
48
- inputRef.current.value = `${value !== null && value !== void 0 ? value : 0}`;
49
- }
50
- }, [value, inputRef]);
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;
54
- if (min === undefined || newValue >= min) {
55
- if (volume % 1 === 0)
56
- newValue = Math.round(newValue);
57
- else
58
- newValue = parseFloat(newValue.toFixed(1));
59
- setValue(newValue);
60
- if (inputRef.current)
61
- inputRef.current.value = `${newValue}`;
62
- if (onChange)
63
- onChange(newValue);
64
- }
65
- } },
66
- react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
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" }))),
68
- react_1.default.createElement("input", { ref: inputRef, readOnly: readOnly, disabled: disabled, onKeyDown: (ev) => {
69
- switch (ev.key.toLowerCase()) {
70
- case "enter":
71
- ev.target.blur();
72
- break;
73
- default:
74
- break;
75
- }
76
- }, onFocus: (ev) => { ev.target.select(); }, onBlur: (ev) => {
77
- let newValue = volume % 1 === 0 ? parseInt(ev.target.value.trim()) : parseFloat(ev.target.value.trim());
78
- if (isNaN(newValue))
79
- ev.target.value = `${val}`;
80
- else {
81
- if (volume % 1 === 0)
82
- newValue = Math.round(newValue);
83
- else
84
- newValue = parseFloat(newValue.toFixed(1));
85
- if (min !== undefined && newValue < min) {
86
- setValue(min);
87
- if (inputRef.current)
88
- inputRef.current.value = `${min}`;
89
- if (onChange)
90
- onChange(min);
91
- }
92
- else if (max !== undefined && newValue > max) {
93
- setValue(max);
94
- if (inputRef.current)
95
- inputRef.current.value = `${max}`;
96
- if (onChange)
97
- onChange(max);
98
- }
99
- else {
100
- setValue(newValue);
101
- if (inputRef.current)
102
- inputRef.current.value = `${newValue}`;
103
- if (onChange)
104
- onChange(newValue);
105
- }
106
- }
107
- } }),
108
- react_1.default.createElement("div", { className: "row", onClick: () => {
109
- let newValue = val + volume;
110
- if (max === undefined || newValue <= max) {
111
- if (volume % 1 === 0)
112
- newValue = Math.round(newValue);
113
- else
114
- newValue = parseFloat(newValue.toFixed(1));
115
- setValue(newValue);
116
- if (inputRef.current)
117
- inputRef.current.value = `${newValue}`;
118
- if (onChange)
119
- onChange(newValue);
120
- }
121
- } },
122
- react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
123
- react_1.default.createElement("path", { d: "M8.60622 1.93907C8.60622 1.60435 8.33488 1.33301 8.00016 1.33301C7.66544 1.33301 7.3941 1.60435 7.3941 1.93907V7.39361H1.93956C1.60484 7.39361 1.3335 7.66496 1.3335 7.99967C1.3335 8.33439 1.60484 8.60574 1.93956 8.60574H7.3941V14.0603C7.3941 14.395 7.66544 14.6663 8.00016 14.6663C8.33488 14.6663 8.60622 14.395 8.60622 14.0603V8.60574H14.0608C14.3955 8.60574 14.6668 8.33439 14.6668 7.99967C14.6668 7.66496 14.3955 7.39361 14.0608 7.39361H8.60622V1.93907Z" }))));
124
- };
125
- exports.NumberPicker = NumberPicker;
@@ -1,13 +0,0 @@
1
- import React, { CSSProperties } from "react";
2
- interface Props {
3
- id?: string;
4
- currentPage: number;
5
- itemPerPage: number;
6
- totalItem: number;
7
- onChangePage: Function;
8
- hideGoToPage?: boolean;
9
- hidePageSize?: boolean;
10
- style: CSSProperties;
11
- }
12
- export declare function Pagination({ id, currentPage, itemPerPage, totalItem, onChangePage, hidePageSize, hideGoToPage, style }: Props): React.JSX.Element;
13
- export {};
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Pagination = Pagination;
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)(() => {
52
- if (goToPageRef.current) {
53
- const _inputPage = goToPageRef.current.getInput();
54
- if (_inputPage)
55
- _inputPage.value = currentPage.toString();
56
- }
57
- }, [currentPage]);
58
- if (currentPage > 1 && (totalItem === 0 || (Math.floor(totalItem / itemPerPage) + (totalItem % itemPerPage === 0 ? 0 : 1)) < currentPage)) {
59
- onChangePage(1, itemPerPage);
60
- return react_1.default.createElement("div", null);
61
- }
62
- else if (totalItem > 0) {
63
- return react_1.default.createElement("div", { id: id, className: `${pagination_module_css_1.default['custom-pagination']} row`, style: style },
64
- hidePageSize ? null : react_1.default.createElement("div", { className: "row", style: { gap: '0.8rem' } },
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) => {
66
- onChangePage(currentPage, isNaN(parseInt(ev.id)) ? itemPerPage : parseInt(ev.id));
67
- } }),
68
- react_1.default.createElement(text_1.Text, { className: "body-3" }, t("ofItems", { totalItem: totalItem }))),
69
- react_1.default.createElement("div", { style: { flex: 1 } }),
70
- react_1.default.createElement(react_paginate_1.default, { onPageChange: (ev) => {
71
- onChangePage(ev.selected + 1, itemPerPage);
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 }),
73
- hideGoToPage ? null : react_1.default.createElement(react_1.default.Fragment, null,
74
- react_1.default.createElement("div", { style: { height: '1.6rem', backgroundColor: "var(--neutral-bolder-border-color)", width: 1 } }),
75
- react_1.default.createElement(text_1.Text, { className: "label-3" },
76
- t("go"),
77
- " ",
78
- t("page").toLowerCase()),
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;
81
- if (_tmp && !isNaN(_tmp) && _tmp > 0 && _tmp <= Math.ceil(totalItem / itemPerPage)) {
82
- onChangePage(_tmp, itemPerPage);
83
- }
84
- else
85
- ev.target.value = "";
86
- } })));
87
- }
88
- else
89
- return react_1.default.createElement("div", { id: id });
90
- }
@@ -1,40 +0,0 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
2
- import './popup.css';
3
- interface PopupState {
4
- readonly open?: boolean;
5
- heading?: ReactNode;
6
- body?: ReactNode;
7
- content?: ReactNode;
8
- footer?: ReactNode;
9
- clickOverlayClosePopup?: boolean;
10
- style?: CSSProperties;
11
- className?: string;
12
- hideButtonClose?: boolean;
13
- }
14
- export declare const showPopup: (props: {
15
- ref: React.RefObject<Popup | undefined>;
16
- heading?: ReactNode;
17
- content?: ReactNode;
18
- body?: ReactNode;
19
- footer?: ReactNode;
20
- clickOverlayClosePopup?: boolean;
21
- style?: CSSProperties;
22
- className?: string;
23
- hideButtonClose?: boolean;
24
- }) => void;
25
- export declare const closePopup: (ref: React.RefObject<Popup>) => void;
26
- export declare class Popup extends React.Component<Object, PopupState> {
27
- constructor(props: Object | Readonly<Object>);
28
- state: Readonly<PopupState>;
29
- onOpen(data: PopupState): void;
30
- onClose(): void;
31
- render(): React.JSX.Element;
32
- }
33
- export declare function PopupOverlay({ children, onClose, className, style, onOpen }: {
34
- children?: ReactNode;
35
- className?: string;
36
- onClose?: (ev: MouseEvent) => void;
37
- style?: CSSProperties;
38
- onOpen?: (ev: HTMLDivElement) => void;
39
- }): React.JSX.Element;
40
- export {};
@@ -1,125 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Popup = exports.closePopup = exports.showPopup = void 0;
37
- exports.PopupOverlay = PopupOverlay;
38
- const react_1 = __importStar(require("react"));
39
- require("./popup.css");
40
- const showPopup = (props) => {
41
- var _a, _b;
42
- (_b = (_a = props.ref) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.onOpen({
43
- heading: props.heading,
44
- content: props.content,
45
- body: props.body,
46
- footer: props.footer,
47
- clickOverlayClosePopup: props.clickOverlayClosePopup,
48
- style: props.style,
49
- className: props.className,
50
- hideButtonClose: props.hideButtonClose
51
- });
52
- };
53
- exports.showPopup = showPopup;
54
- const closePopup = (ref) => {
55
- ref.current.onClose();
56
- };
57
- exports.closePopup = closePopup;
58
- class Popup extends react_1.default.Component {
59
- constructor(props) {
60
- super(props);
61
- this.state = {
62
- open: false,
63
- };
64
- }
65
- onOpen(data) {
66
- this.setState(Object.assign({ open: true }, data));
67
- }
68
- onClose() {
69
- this.setState({ open: false });
70
- }
71
- render() {
72
- var _a, _b;
73
- return (react_1.default.createElement(react_1.default.Fragment, null, this.state.open &&
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 },
75
- this.state.heading,
76
- this.state.body,
77
- this.state.footer,
78
- this.state.hideButtonClose ? null : react_1.default.createElement("button", { type: 'button', onClick: () => this.onClose(), className: 'popup-close-btn row' },
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' } },
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 })))))));
81
- }
82
- }
83
- exports.Popup = Popup;
84
- function PopupOverlay({ children, onClose, className, style, onOpen }) {
85
- const overlayRef = (0, react_1.useRef)(null);
86
- (0, react_1.useEffect)(() => {
87
- if (overlayRef.current && onClose) {
88
- const onClickDropDown = (ev) => {
89
- if (ev.target === overlayRef.current || !overlayRef.current.contains(ev.target))
90
- onClose(ev);
91
- };
92
- window.document.body.addEventListener("mousedown", onClickDropDown);
93
- return () => {
94
- window.document.body.removeEventListener("mousedown", onClickDropDown);
95
- };
96
- }
97
- }, [overlayRef.current]);
98
- (0, react_1.useEffect)(() => {
99
- if (overlayRef.current && onOpen)
100
- onOpen(overlayRef.current);
101
- }, [overlayRef.current, onOpen]);
102
- (0, react_1.useEffect)(() => {
103
- if (overlayRef.current && overlayRef.current.firstChild) {
104
- const popupContent = overlayRef.current.firstChild;
105
- const rect = popupContent.getBoundingClientRect();
106
- if (rect.x < 0) {
107
- popupContent.style.left = "0px";
108
- popupContent.style.right = "unset";
109
- }
110
- else if (rect.right > document.body.offsetWidth) {
111
- popupContent.style.right = "0px";
112
- popupContent.style.left = "unset";
113
- }
114
- if (rect.y < 0) {
115
- popupContent.style.top = "0px";
116
- popupContent.style.bottom = "unset";
117
- }
118
- else if (rect.bottom > document.body.offsetHeight) {
119
- popupContent.style.bottom = "0px";
120
- popupContent.style.top = "unset";
121
- }
122
- }
123
- }, [overlayRef]);
124
- return react_1.default.createElement("div", { ref: overlayRef, className: `popup-overlay ${className !== null && className !== void 0 ? className : ""}`, style: style }, children);
125
- }
@@ -1,16 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- import React from 'react';
3
- import { ComponentStatus } from '../../index';
4
- export declare function ProgressBar({ id, status, percent, titleText, title, hideTitle, progressBarOnly, fullColor, percentColor, style, progressBarStyle }: {
5
- id?: string;
6
- percent: number;
7
- titleText?: string;
8
- title?: ReactNode;
9
- hideTitle: boolean;
10
- progressBarOnly: boolean;
11
- fullColor: string;
12
- percentColor: string;
13
- style?: CSSProperties;
14
- status: ComponentStatus;
15
- progressBarStyle?: CSSProperties;
16
- }): React.JSX.Element;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ProgressBar = ProgressBar;
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"]}` },
15
- react_2.default.createElement("div", { className: "heading-8" }, titleText),
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)),
20
- progressBarOnly ? null : react_2.default.createElement("div", { className: 'label-4' },
21
- percent,
22
- "/100")) : null);
23
- }
@@ -1,14 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- import './progress-circle.css';
3
- import React from 'react';
4
- export declare function ProgressCircle(props: {
5
- id?: string;
6
- /** value: 0 - 100 (%)*/
7
- percent?: number;
8
- style?: CSSProperties;
9
- fillColor?: string;
10
- percentColor?: string;
11
- strokeWidth?: number;
12
- strokeColor?: string;
13
- textStyle?: CSSProperties;
14
- }): React.JSX.Element;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ProgressCircle = ProgressCircle;
7
- require("./progress-circle.css");
8
- const react_1 = __importDefault(require("react"));
9
- function ProgressCircle(props) {
10
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
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,
18
- "%"));
19
- }
@@ -1,20 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import { UseFormRegister } from 'react-hook-form';
3
- interface RadioButtonProps {
4
- id?: string;
5
- onChange?: React.ChangeEventHandler<HTMLInputElement>;
6
- value?: string | number | readonly string[];
7
- disabled?: boolean;
8
- style?: CSSProperties;
9
- size?: number | string;
10
- defaultChecked?: boolean;
11
- name?: string;
12
- activeColor?: string;
13
- offColor?: string;
14
- className?: string;
15
- register?: UseFormRegister<{}>;
16
- }
17
- export declare class RadioButton extends React.Component<RadioButtonProps> {
18
- render(): React.ReactNode;
19
- }
20
- export {};
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.RadioButton = void 0;
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() {
11
- var _a, _b, _c;
12
- let convertStyle = {
13
- '--off-color': (_a = this.props.offColor) !== null && _a !== void 0 ? _a : 'var(--neutral-bolder-border-color)',
14
- '--active-color': (_b = this.props.activeColor) !== null && _b !== void 0 ? _b : 'var(--primary-main-color)',
15
- '--size': this.props.size ? (typeof this.props.size === 'number') ? `${this.props.size}px` : this.props.size : '20px'
16
- };
17
- if (this.props.style) {
18
- delete this.props.style.width;
19
- delete this.props.style.minWidth;
20
- delete this.props.style.maxWidth;
21
- delete this.props.style.height;
22
- delete this.props.style.minHeight;
23
- delete this.props.style.maxHeight;
24
- convertStyle = Object.assign(Object.assign({}, this.props.style), convertStyle);
25
- }
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 },
27
- this.props.register ?
28
- react_1.default.createElement("input", Object.assign({}, this.props.register, { type: "radio", value: this.props.value, disabled: this.props.disabled })) :
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 }),
30
- react_1.default.createElement("span", { className: radio_button_module_css_1.default['checkmark'] }));
31
- }
32
- }
33
- exports.RadioButton = RadioButton;
@@ -1,23 +0,0 @@
1
- import React, { CSSProperties } from "react";
2
- interface RatingProps {
3
- id?: string;
4
- /**
5
- value: 0-5
6
- */
7
- value?: number;
8
- size?: number | string;
9
- onChange?: (e: number) => void;
10
- className?: string;
11
- style?: CSSProperties;
12
- strokeColor?: string;
13
- fillColor?: string;
14
- }
15
- interface RatingState {
16
- value: number;
17
- }
18
- export declare class Rating extends React.Component<RatingProps, RatingState> {
19
- state: Readonly<RatingState>;
20
- componentDidUpdate(prevProps: Readonly<RatingProps>): void;
21
- render(): React.ReactNode;
22
- }
23
- export {};
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Rating = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const rating_module_css_1 = __importDefault(require("./rating.module.css"));
9
- const autoKeyId = () => window.crypto.randomUUID().replace(/-/g, '');
10
- class Rating extends react_1.default.Component {
11
- constructor() {
12
- var _a;
13
- super(...arguments);
14
- this.state = {
15
- value: (_a = this.props.value) !== null && _a !== void 0 ? _a : 0
16
- };
17
- }
18
- componentDidUpdate(prevProps) {
19
- var _a;
20
- if (prevProps.value !== this.props.value) {
21
- this.setState({ value: (_a = this.props.value) !== null && _a !== void 0 ? _a : 0 });
22
- }
23
- }
24
- render() {
25
- var _a;
26
- return react_1.default.createElement("div", { id: this.props.id, className: `row ${rating_module_css_1.default['rating-container']} ${(_a = this.props.className) !== null && _a !== void 0 ? _a : ''}`, style: this.props.style }, Array.from({ length: 5 }).map((_, i) => {
27
- var _a, _b, _c, _d, _e;
28
- let uniqueId = 'rating-star-grad-0';
29
- let stopValue = 0;
30
- if (this.state.value >= 5) {
31
- uniqueId = 'rating-star-grad-5';
32
- stopValue = 100;
33
- }
34
- else if (this.state.value >= i) {
35
- uniqueId = autoKeyId();
36
- stopValue = (this.state.value - i) * 100;
37
- }
38
- return react_1.default.createElement("svg", { onClick: () => {
39
- if (this.props.onChange) {
40
- this.setState({ value: i + 1 });
41
- this.props.onChange(i + 1);
42
- }
43
- }, key: 'rate-' + i, width: "100%", height: "100%", style: { width: (_a = this.props.size) !== null && _a !== void 0 ? _a : '2rem', height: (_b = this.props.size) !== null && _b !== void 0 ? _b : '2rem' }, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
44
- react_1.default.createElement("defs", null,
45
- react_1.default.createElement("linearGradient", { id: uniqueId, x1: "0%", x2: "100%", y1: "0%", y2: "0%" },
46
- react_1.default.createElement("stop", { offset: "0%", style: { stopColor: (_c = this.props.fillColor) !== null && _c !== void 0 ? _c : 'var(--secondary3-main-color,#FAAD1E)' } }),
47
- react_1.default.createElement("stop", { offset: `${stopValue}%`, style: { stopColor: (_d = this.props.fillColor) !== null && _d !== void 0 ? _d : 'var(--secondary3-main-color,#FAAD1E)' } }),
48
- react_1.default.createElement("stop", { offset: `${stopValue}%`, style: { stopColor: '#00000000' } }))),
49
- react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 1.66667C10.2884 1.66667 10.5518 1.82993 10.6794 2.0878L12.844 6.46194L17.6847 7.16325C17.97 7.20459 18.2071 7.4039 18.2962 7.67736C18.3853 7.95082 18.311 8.25101 18.1045 8.45172L14.6018 11.8563L15.4285 16.6636C15.4772 16.947 15.3604 17.2334 15.127 17.4024C14.8937 17.5714 14.5844 17.5937 14.3292 17.4599L10 15.1897L5.67081 17.4599C5.41557 17.5937 5.10627 17.5714 4.87295 17.4024C4.63964 17.2334 4.52278 16.947 4.57151 16.6636L5.39815 11.8563L1.89545 8.45172C1.68896 8.25101 1.61465 7.95082 1.70377 7.67736C1.79288 7.4039 2.02996 7.20459 2.31533 7.16325L7.15599 6.46194L9.32063 2.0878C9.44825 1.82993 9.71162 1.66667 10 1.66667ZM10 4.12915L8.33846 7.48665C8.22811 7.70963 8.01479 7.86418 7.76802 7.89993L4.05223 8.43827L6.74094 11.0517C6.91947 11.2252 7.00094 11.4752 6.95881 11.7203L6.3243 15.4102L9.64738 13.6676C9.86813 13.5519 10.1319 13.5519 10.3526 13.6676L13.6757 15.4102L13.0412 11.7203C12.9991 11.4752 13.0805 11.2252 13.2591 11.0517L15.9478 8.43827L12.232 7.89993C11.9852 7.86418 11.7719 7.70963 11.6615 7.48665L10 4.12915Z", style: { fill: (_e = this.props.strokeColor) !== null && _e !== void 0 ? _e : 'var(--neutral-text-placeholder-color,#878792)' } }),
50
- react_1.default.createElement("path", { d: "M17.738 7.18949L12.8212 6.47499L10.6249 2.02268C10.5611 1.91426 10.47 1.82438 10.3608 1.76194C10.2515 1.6995 10.1279 1.66666 10.0021 1.66666C9.87623 1.66666 9.75259 1.6995 9.64335 1.76194C9.53411 1.82438 9.44306 1.91426 9.37921 2.02268L7.17875 6.47499L2.26191 7.18949C2.13368 7.208 2.0132 7.26201 1.91406 7.34542C1.81493 7.42882 1.74111 7.5383 1.70095 7.66147C1.66078 7.78463 1.65588 7.91658 1.68678 8.04239C1.71769 8.1682 1.78317 8.28286 1.87583 8.3734L5.43449 11.8411L4.59499 16.7385C4.57311 16.8662 4.58739 16.9975 4.63622 17.1175C4.68505 17.2375 4.76648 17.3414 4.8713 17.4175C4.97612 17.4937 5.10016 17.539 5.22938 17.5483C5.3586 17.5577 5.48785 17.5306 5.60252 17.4704L9.99998 15.1588L14.3974 17.4704C14.5121 17.5306 14.6414 17.5577 14.7706 17.5483C14.8998 17.539 15.0238 17.4937 15.1286 17.4175C15.2335 17.3414 15.3149 17.2375 15.3637 17.1175C15.4126 16.9975 15.4268 16.8662 15.405 16.7385L14.5655 11.8411L18.1241 8.3734C18.2168 8.28295 18.2823 8.16841 18.3132 8.0427C18.3442 7.91699 18.3394 7.78512 18.2994 7.66199C18.2594 7.53886 18.1858 7.42937 18.0868 7.34587C17.9879 7.26238 17.8675 7.20822 17.7394 7.18949H17.738Z", fill: `url(#${uniqueId})` }));
51
- }));
52
- }
53
- }
54
- exports.Rating = Rating;
@@ -1,31 +0,0 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
2
- import { WithTranslation } from 'react-i18next';
3
- export interface OptionsItem {
4
- id: string | number;
5
- parentId?: string;
6
- name: string | ReactNode;
7
- title?: string | ((onSelect: (e: OptionsItem) => void) => ReactNode);
8
- disabled?: boolean;
9
- }
10
- interface Select1Props extends WithTranslation {
11
- id?: string;
12
- value?: string | number;
13
- options: Required<Array<OptionsItem>>;
14
- onChange?: (v?: OptionsItem) => void;
15
- placeholder?: string;
16
- disabled?: boolean;
17
- className?: string;
18
- helperText?: string;
19
- helperTextColor?: string;
20
- style?: CSSProperties;
21
- handleSearch?: (e: string) => Promise<Array<OptionsItem>>;
22
- handleLoadmore?: (onLoadMore: boolean, ev: React.UIEvent<HTMLDivElement, UIEvent>) => void;
23
- handleLoadChildren?: () => {};
24
- readOnly?: boolean;
25
- popupClassName?: string;
26
- prefix?: ReactNode;
27
- suffix?: ReactNode;
28
- onOpenOptions?: (popupRef: HTMLDivElement) => void;
29
- }
30
- export declare const Select1: React.ComponentType<Omit<import("react-i18next/helpers").$Subtract<Select1Props, import("react-i18next").WithTranslationProps>, keyof WithTranslation<Ns, undefined>> & import("react-i18next").WithTranslationProps>;
31
- export {};