wini-web-components 0.5.0 → 0.5.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 (50) hide show
  1. package/dist/component/calendar/calendar.d.ts +46 -0
  2. package/dist/component/calendar/calendar.js +426 -0
  3. package/dist/component/checkbox/checkbox.d.ts +20 -0
  4. package/dist/component/checkbox/checkbox.js +79 -0
  5. package/dist/component/component-status.d.ts +8 -0
  6. package/dist/component/component-status.js +32 -0
  7. package/dist/component/date-picker/date-picker.d.ts +31 -0
  8. package/dist/component/date-picker/date-picker.js +358 -0
  9. package/dist/component/dialog/dialog.d.ts +33 -0
  10. package/dist/component/dialog/dialog.js +96 -0
  11. package/dist/component/import-file/import-file.d.ts +35 -0
  12. package/dist/component/import-file/import-file.js +117 -0
  13. package/dist/component/infinite-scroll/infinite-scroll.d.ts +16 -0
  14. package/dist/component/infinite-scroll/infinite-scroll.js +102 -0
  15. package/dist/component/input-multi-select/input-multi-select.d.ts +39 -0
  16. package/dist/component/input-multi-select/input-multi-select.js +249 -0
  17. package/dist/component/pagination/pagination.d.ts +11 -0
  18. package/dist/component/pagination/pagination.js +46 -0
  19. package/dist/component/popup/popup.d.ts +31 -0
  20. package/dist/component/popup/popup.js +105 -0
  21. package/dist/component/progress-bar/progress-bar.d.ts +16 -0
  22. package/dist/component/progress-bar/progress-bar.js +39 -0
  23. package/dist/component/progress-circle/progress-circle.d.ts +13 -0
  24. package/dist/component/progress-circle/progress-circle.js +31 -0
  25. package/dist/component/radio-button/radio-button.d.ts +20 -0
  26. package/dist/component/radio-button/radio-button.js +64 -0
  27. package/dist/component/rating/rating.d.ts +23 -0
  28. package/dist/component/rating/rating.js +76 -0
  29. package/dist/component/select1/select1.d.ts +38 -0
  30. package/dist/component/select1/select1.js +185 -0
  31. package/dist/component/slider/slider.d.ts +31 -0
  32. package/dist/component/slider/slider.js +83 -0
  33. package/dist/component/switch/switch.d.ts +23 -0
  34. package/dist/component/switch/switch.js +81 -0
  35. package/dist/component/table/table.d.ts +46 -0
  36. package/dist/component/table/table.js +119 -0
  37. package/dist/component/text/text.d.ts +14 -0
  38. package/dist/component/text/text.js +50 -0
  39. package/dist/component/text-area/text-area.d.ts +25 -0
  40. package/dist/component/text-area/text-area.js +47 -0
  41. package/dist/component/text-field/text-field.d.ts +28 -0
  42. package/dist/component/text-field/text-field.js +50 -0
  43. package/dist/component/toast-noti/toast-noti.d.ts +4 -0
  44. package/dist/component/toast-noti/toast-noti.js +27 -0
  45. package/dist/index.d.ts +26 -0
  46. package/dist/index.js +59 -1
  47. package/dist/skin/color.css +17 -0
  48. package/dist/skin/layout.css +601 -0
  49. package/dist/skin/typography.css +378 -0
  50. package/package.json +4 -2
@@ -0,0 +1,31 @@
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
+ import 'react-awesome-slider/dist/styles.css';
3
+ import './slider.css';
4
+ interface SliderProps {
5
+ children?: Array<ReactNode>;
6
+ autoPlay?: boolean;
7
+ /** default: 2000ms */
8
+ duration?: number;
9
+ className?: string;
10
+ iconSize?: number | string;
11
+ iconColor?: string;
12
+ prevButton?: ReactNode;
13
+ nextButton?: ReactNode;
14
+ style?: CSSProperties;
15
+ buttons?: boolean;
16
+ onChage?: (i: number) => void;
17
+ }
18
+ interface SliderState {
19
+ page: number;
20
+ }
21
+ export declare class CustomSlider extends React.Component<SliderProps, SliderState> {
22
+ private intervalPlay;
23
+ constructor(props: SliderProps);
24
+ nextPage: () => void;
25
+ previousPage: () => void;
26
+ private autoPlay;
27
+ componentDidMount(): void;
28
+ componentDidUpdate(prevProps: Readonly<SliderProps>, prevState: Readonly<SliderState>): void;
29
+ render(): React.JSX.Element;
30
+ }
31
+ export {};
@@ -0,0 +1,83 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.CustomSlider = void 0;
22
+ var react_1 = __importDefault(require("react"));
23
+ var react_awesome_slider_1 = __importDefault(require("react-awesome-slider"));
24
+ require("react-awesome-slider/dist/styles.css");
25
+ require("./slider.css");
26
+ var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
27
+ var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
28
+ var CustomSlider = /** @class */ (function (_super) {
29
+ __extends(CustomSlider, _super);
30
+ function CustomSlider(props) {
31
+ var _this = this;
32
+ var _a;
33
+ _this = _super.call(this, props) || this;
34
+ _this.nextPage = function () {
35
+ var _a, _b, _c;
36
+ var index = (_b = (_a = _this.state) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 0;
37
+ if (((_c = _this.props) === null || _c === void 0 ? void 0 : _c.children) && (index + 1) < _this.props.children.length) {
38
+ _this.setState({ page: index + 1 });
39
+ if (_this.props.onChage)
40
+ _this.props.onChage(index + 1);
41
+ }
42
+ };
43
+ _this.previousPage = function () {
44
+ var _a, _b, _c;
45
+ var index = (_b = (_a = _this.state) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 0;
46
+ if (((_c = _this.props) === null || _c === void 0 ? void 0 : _c.children) && index > 0) {
47
+ _this.setState({ page: index - 1 });
48
+ if (_this.props.onChage)
49
+ _this.props.onChage(index - 1);
50
+ }
51
+ };
52
+ _this.autoPlay = function () {
53
+ var _a, _b, _c;
54
+ var index = (_b = (_a = _this.state) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 0;
55
+ if (((_c = _this.props) === null || _c === void 0 ? void 0 : _c.children) && (index + 1) === _this.props.children.length)
56
+ index = -1;
57
+ _this.setState({ page: index + 1 });
58
+ if (_this.props.onChage)
59
+ _this.props.onChage(index + 1);
60
+ };
61
+ (_a = props.buttons) !== null && _a !== void 0 ? _a : (props.buttons = true);
62
+ _this.state = {
63
+ page: 0
64
+ };
65
+ _this.autoPlay = _this.autoPlay.bind(_this);
66
+ return _this;
67
+ }
68
+ CustomSlider.prototype.componentDidMount = function () {
69
+ var _a;
70
+ if (this.props.autoPlay)
71
+ this.intervalPlay = setInterval(this.autoPlay, (_a = this.props.duration) !== null && _a !== void 0 ? _a : 2000);
72
+ };
73
+ CustomSlider.prototype.componentDidUpdate = function (prevProps, prevState) {
74
+ if (this.props.autoPlay !== prevProps.autoPlay && !this.props.autoPlay)
75
+ clearInterval(this.intervalPlay);
76
+ };
77
+ CustomSlider.prototype.render = function () {
78
+ var _a, _b, _c, _d, _e, _f, _g, _h;
79
+ return react_1.default.createElement(react_awesome_slider_1.default, { style: this.props.style, className: "custom-slider-container ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ''), selected: this.state.page, bullets: false, buttons: this.props.buttons ? (this.props.children && ((_b = this.props.children) === null || _b === void 0 ? void 0 : _b.length) > 1) : false, organicArrows: false, buttonContentLeft: (_c = this.props.prevButton) !== null && _c !== void 0 ? _c : react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faCircleChevronLeft, style: { color: (_d = this.props.iconColor) !== null && _d !== void 0 ? _d : '#ffffff', fontSize: (_e = this.props.iconSize) !== null && _e !== void 0 ? _e : '2.4rem' } }), buttonContentRight: (_f = this.props.nextButton) !== null && _f !== void 0 ? _f : react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faCircleChevronRight, style: { color: (_g = this.props.iconColor) !== null && _g !== void 0 ? _g : '#ffffff', fontSize: (_h = this.props.iconSize) !== null && _h !== void 0 ? _h : '2.4rem' } }) }, this.props.children);
80
+ };
81
+ return CustomSlider;
82
+ }(react_1.default.Component));
83
+ exports.CustomSlider = CustomSlider;
@@ -0,0 +1,23 @@
1
+ import React, { CSSProperties } from 'react';
2
+ import './switch.css';
3
+ interface SwitchProps {
4
+ onChange?: (value: boolean) => void;
5
+ value?: boolean;
6
+ disabled: false;
7
+ style: CSSProperties;
8
+ size?: number | string;
9
+ dotColor?: string;
10
+ onBackground?: string;
11
+ offBackground?: string;
12
+ name?: string;
13
+ className?: string;
14
+ }
15
+ interface SwitchState {
16
+ value?: boolean;
17
+ }
18
+ export declare class Switch extends React.Component<SwitchProps, SwitchState> {
19
+ state: Readonly<SwitchState>;
20
+ componentDidUpdate(prevProps: Readonly<SwitchProps>): void;
21
+ render(): React.JSX.Element;
22
+ }
23
+ export {};
@@ -0,0 +1,81 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.Switch = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ require("./switch.css");
35
+ var Switch = /** @class */ (function (_super) {
36
+ __extends(Switch, _super);
37
+ function Switch() {
38
+ var _this = this;
39
+ var _a;
40
+ _this = _super.apply(this, arguments) || this;
41
+ _this.state = {
42
+ value: (_a = _this.props.value) !== null && _a !== void 0 ? _a : false
43
+ };
44
+ return _this;
45
+ }
46
+ Switch.prototype.componentDidUpdate = function (prevProps) {
47
+ if (prevProps.value !== this.props.value) {
48
+ this.setState({ value: this.props.value });
49
+ }
50
+ };
51
+ Switch.prototype.render = function () {
52
+ var _this = this;
53
+ var _a, _b, _c, _d, _e;
54
+ var propStyle = {
55
+ '--off-bg': (_a = this.props.offBackground) !== null && _a !== void 0 ? _a : 'var(--background)',
56
+ '--on-bg': (_b = this.props.onBackground) !== null && _b !== void 0 ? _b : 'var(--infor-color)',
57
+ '--dot-color': (_c = this.props.dotColor) !== null && _c !== void 0 ? _c : '#ffffff',
58
+ '--size': this.props.size ? (typeof this.props.size === 'number') ? "".concat(this.props.size, "px") : this.props.size : '2rem'
59
+ };
60
+ var convertStyle = __assign({ height: (_d = this.props.size) !== null && _d !== void 0 ? _d : '2rem', width: "calc(".concat(this.props.size ? (typeof this.props.size === 'number') ? "".concat(this.props.size, "px") : this.props.size : '2rem', " * 9 / 5)") }, propStyle);
61
+ if (this.props.style) {
62
+ delete this.props.style.width;
63
+ delete this.props.style.minWidth;
64
+ delete this.props.style.maxWidth;
65
+ delete this.props.style.height;
66
+ delete this.props.style.minHeight;
67
+ delete this.props.style.maxHeight;
68
+ convertStyle = __assign(__assign({}, this.props.style), convertStyle);
69
+ }
70
+ return react_1.default.createElement("label", { className: "switch-container row ".concat((_e = this.props.className) !== null && _e !== void 0 ? _e : ''), style: convertStyle },
71
+ react_1.default.createElement("input", { type: "checkbox", checked: this.state.value, name: this.props.name, disabled: this.props.disabled, onChange: function () {
72
+ var newValue = !_this.state.value;
73
+ _this.setState({ value: newValue });
74
+ if (_this.props.onChange)
75
+ _this.props.onChange(newValue);
76
+ } }),
77
+ react_1.default.createElement("span", { className: "slider" }));
78
+ };
79
+ return Switch;
80
+ }(react_1.default.Component));
81
+ exports.Switch = Switch;
@@ -0,0 +1,46 @@
1
+ import React, { CSSProperties, MouseEventHandler, ReactNode } from 'react';
2
+ import './table.css';
3
+ export declare enum CellAlignItems {
4
+ start = "start",
5
+ center = "center",
6
+ end = "end"
7
+ }
8
+ type TbCellProps = {
9
+ fixed?: boolean;
10
+ children?: ReactNode;
11
+ className?: string;
12
+ style?: CSSProperties;
13
+ align?: CellAlignItems | string;
14
+ };
15
+ export declare class TbCell extends React.Component<TbCellProps> {
16
+ render(): React.ReactNode;
17
+ }
18
+ interface TbRowProps {
19
+ children?: Array<TbCell>;
20
+ className?: string;
21
+ style?: CSSProperties;
22
+ onClick?: MouseEventHandler<HTMLTableRowElement>;
23
+ }
24
+ export declare class TbRow extends React.Component<TbRowProps> {
25
+ render(): React.ReactNode;
26
+ }
27
+ export declare class TbHeader extends React.Component<TbRowProps> {
28
+ render(): React.JSX.Element;
29
+ }
30
+ interface TbBodyProps {
31
+ children?: Array<TbRow>;
32
+ className?: string;
33
+ style?: CSSProperties;
34
+ }
35
+ export declare class TbBody extends React.Component<TbBodyProps> {
36
+ render(): React.ReactNode;
37
+ }
38
+ interface TableProps {
39
+ children?: Array<TbBody | TbHeader>;
40
+ className?: string;
41
+ style?: CSSProperties;
42
+ }
43
+ export declare class Table extends React.Component<TableProps> {
44
+ render(): React.ReactNode;
45
+ }
46
+ export {};
@@ -0,0 +1,119 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.Table = exports.TbBody = exports.TbHeader = exports.TbRow = exports.TbCell = exports.CellAlignItems = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ require("./table.css");
35
+ var CellAlignItems;
36
+ (function (CellAlignItems) {
37
+ CellAlignItems["start"] = "start";
38
+ CellAlignItems["center"] = "center";
39
+ CellAlignItems["end"] = "end";
40
+ })(CellAlignItems = exports.CellAlignItems || (exports.CellAlignItems = {}));
41
+ var TbCell = /** @class */ (function (_super) {
42
+ __extends(TbCell, _super);
43
+ function TbCell() {
44
+ return _super !== null && _super.apply(this, arguments) || this;
45
+ }
46
+ TbCell.prototype.render = function () {
47
+ var _a, _b;
48
+ return react_1.default.createElement("td", { style: this.props.style, "align-cell": (_a = this.props.align) !== null && _a !== void 0 ? _a : CellAlignItems.start, className: "tb-cell ".concat((_b = this.props.className) !== null && _b !== void 0 ? _b : '', " ").concat(this.props.fixed ? 'tb-cell-fixed' : '') }, this.props.children);
49
+ };
50
+ return TbCell;
51
+ }(react_1.default.Component));
52
+ exports.TbCell = TbCell;
53
+ var TbRow = /** @class */ (function (_super) {
54
+ __extends(TbRow, _super);
55
+ function TbRow() {
56
+ return _super !== null && _super.apply(this, arguments) || this;
57
+ }
58
+ TbRow.prototype.render = function () {
59
+ var _this = this;
60
+ var _a, _b;
61
+ return react_1.default.createElement("tr", { style: this.props.style, className: "tb-row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : ""), onClick: this.props.onClick }, ((_b = this.props.children) !== null && _b !== void 0 ? _b : []).map(function (e, i) {
62
+ var _a, _b;
63
+ var ox = 0;
64
+ if (_this.props.children && i > 0 && i < (_this.props.children.length - 1)) {
65
+ ox = "calc(".concat(_this.props.children.slice(0, i).map(function (tb) {
66
+ var _a, _b, _c;
67
+ var wValue = (_b = (_a = tb.props.style) === null || _a === void 0 ? void 0 : _a.minWidth) !== null && _b !== void 0 ? _b : (_c = tb.props.style) === null || _c === void 0 ? void 0 : _c.width;
68
+ return wValue ? typeof wValue === 'number' ? "".concat(wValue, "px") : wValue : '60px';
69
+ }).join(" + "), ")");
70
+ }
71
+ return react_1.default.createElement(TbCell, { key: "tb-cell-".concat(i), align: e.props.align, children: e.props.children, fixed: e.props.fixed, style: e.props.fixed ? (_this.props.children && i === _this.props.children.length - 1) ? __assign({ right: 0 }, ((_a = e.props.style) !== null && _a !== void 0 ? _a : {})) : __assign({ left: ox }, ((_b = e.props.style) !== null && _b !== void 0 ? _b : {})) : e.props.style, className: e.props.className });
72
+ }));
73
+ };
74
+ return TbRow;
75
+ }(react_1.default.Component));
76
+ exports.TbRow = TbRow;
77
+ var TbHeader = /** @class */ (function (_super) {
78
+ __extends(TbHeader, _super);
79
+ function TbHeader() {
80
+ return _super !== null && _super.apply(this, arguments) || this;
81
+ }
82
+ TbHeader.prototype.render = function () {
83
+ var _this = this;
84
+ var _a, _b;
85
+ return react_1.default.createElement("thead", { style: this.props.style, className: "tb-header ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : "") },
86
+ react_1.default.createElement("tr", null, ((_b = this.props.children) !== null && _b !== void 0 ? _b : []).map(function (e, i) {
87
+ var _a, _b;
88
+ var ox = 0;
89
+ if (_this.props.children && i > 0 && i < (_this.props.children.length - 1)) {
90
+ ox = "calc(".concat(_this.props.children.slice(0, i).map(function (tb) { var _a; return ((_a = tb.props.style) === null || _a === void 0 ? void 0 : _a.width) ? typeof tb.props.style.width === 'number' ? "".concat(tb.props.style.width, "px") : tb.props.style.width : '60px'; }).join(" + "), ")");
91
+ }
92
+ return react_1.default.createElement(TbCell, { key: "tb-cell-".concat(i), align: e.props.align, children: e.props.children, fixed: e.props.fixed, style: e.props.fixed ? (_this.props.children && i === _this.props.children.length - 1) ? __assign({ right: 0 }, ((_a = e.props.style) !== null && _a !== void 0 ? _a : {})) : __assign({ left: ox }, ((_b = e.props.style) !== null && _b !== void 0 ? _b : {})) : e.props.style, className: e.props.className });
93
+ })));
94
+ };
95
+ return TbHeader;
96
+ }(react_1.default.Component));
97
+ exports.TbHeader = TbHeader;
98
+ var TbBody = /** @class */ (function (_super) {
99
+ __extends(TbBody, _super);
100
+ function TbBody() {
101
+ return _super !== null && _super.apply(this, arguments) || this;
102
+ }
103
+ TbBody.prototype.render = function () {
104
+ return react_1.default.createElement("tbody", null, this.props.children);
105
+ };
106
+ return TbBody;
107
+ }(react_1.default.Component));
108
+ exports.TbBody = TbBody;
109
+ var Table = /** @class */ (function (_super) {
110
+ __extends(Table, _super);
111
+ function Table() {
112
+ return _super !== null && _super.apply(this, arguments) || this;
113
+ }
114
+ Table.prototype.render = function () {
115
+ return react_1.default.createElement("table", { className: "custom-table ".concat(this.props.className), style: this.props.style }, this.props.children);
116
+ };
117
+ return Table;
118
+ }(react_1.default.Component));
119
+ exports.Table = Table;
@@ -0,0 +1,14 @@
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
+ import './text.css';
3
+ interface TextProps {
4
+ children?: ReactNode;
5
+ style?: CSSProperties;
6
+ className?: string;
7
+ maxLine?: number;
8
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
9
+ onHover?: React.MouseEventHandler<HTMLDivElement>;
10
+ }
11
+ export declare class Text extends React.Component<TextProps> {
12
+ render(): React.ReactNode;
13
+ }
14
+ export {};
@@ -0,0 +1,50 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.Text = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ require("./text.css");
35
+ var Text = /** @class */ (function (_super) {
36
+ __extends(Text, _super);
37
+ function Text() {
38
+ return _super !== null && _super.apply(this, arguments) || this;
39
+ }
40
+ Text.prototype.render = function () {
41
+ var _a, _b;
42
+ var convertStyle = (_a = this.props.style) !== null && _a !== void 0 ? _a : {};
43
+ if (this.props.maxLine) {
44
+ convertStyle = __assign(__assign({}, convertStyle), { '--max-line': this.props.maxLine });
45
+ }
46
+ return react_1.default.createElement("div", { onMouseOver: this.props.onHover, onClick: this.props.onClick, className: "comp-text ".concat(this.props.onClick ? 'type-button' : '', " ").concat((_b = this.props.className) !== null && _b !== void 0 ? _b : ''), style: convertStyle }, this.props.children);
47
+ };
48
+ return Text;
49
+ }(react_1.default.Component));
50
+ exports.Text = Text;
@@ -0,0 +1,25 @@
1
+ import React, { CSSProperties } from "react";
2
+ import './text-area.css';
3
+ import { UseFormRegister } from "react-hook-form";
4
+ interface TextAreaProps {
5
+ value?: string;
6
+ maxLength?: number;
7
+ defaultValue?: string;
8
+ onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
9
+ onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
10
+ onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
11
+ placeholder?: string;
12
+ disabled?: boolean;
13
+ readOnly?: boolean;
14
+ autoFocus?: boolean;
15
+ className?: string;
16
+ helperText?: string;
17
+ name?: string;
18
+ helperTextColor?: string;
19
+ style?: CSSProperties;
20
+ register?: UseFormRegister<{}>;
21
+ }
22
+ export declare class TextArea extends React.Component<TextAreaProps> {
23
+ render(): React.ReactNode;
24
+ }
25
+ export {};
@@ -0,0 +1,47 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.TextArea = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ require("./text-area.css");
35
+ var TextArea = /** @class */ (function (_super) {
36
+ __extends(TextArea, _super);
37
+ function TextArea() {
38
+ return _super !== null && _super.apply(this, arguments) || this;
39
+ }
40
+ TextArea.prototype.render = function () {
41
+ var _a, _b, _c, _d;
42
+ return react_1.default.createElement("div", { className: "text-area-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'placeholder-2', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } }, this.props.register ?
43
+ react_1.default.createElement("textarea", __assign({ autoFocus: this.props.autoFocus }, this.props.register, { maxLength: this.props.maxLength, name: this.props.name, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onFocus: this.props.onFocus })) : react_1.default.createElement("textarea", { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, defaultValue: this.props.defaultValue, value: this.props.value, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onChange: this.props.onChange, onFocus: this.props.onFocus, onBlur: this.props.onBlur }));
44
+ };
45
+ return TextArea;
46
+ }(react_1.default.Component));
47
+ exports.TextArea = TextArea;
@@ -0,0 +1,28 @@
1
+ import React, { CSSProperties, ReactNode } from "react";
2
+ import './text-field.css';
3
+ import { UseFormRegister } from "react-hook-form";
4
+ interface TextFieldProps {
5
+ value?: string;
6
+ maxLength?: number;
7
+ defaultValue?: string;
8
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
9
+ onBlur?: React.FocusEventHandler<HTMLInputElement>;
10
+ onFocus?: React.FocusEventHandler<HTMLInputElement>;
11
+ placeholder?: string;
12
+ disabled?: boolean;
13
+ readOnly?: boolean;
14
+ className?: string;
15
+ helperText?: string;
16
+ name?: string;
17
+ suffix?: ReactNode;
18
+ prefix?: ReactNode;
19
+ helperTextColor?: string;
20
+ style?: CSSProperties;
21
+ type?: React.HTMLInputTypeAttribute;
22
+ autoFocus?: boolean;
23
+ register?: UseFormRegister<{}>;
24
+ }
25
+ export declare class TextField extends React.Component<TextFieldProps> {
26
+ render(): React.ReactNode;
27
+ }
28
+ export {};
@@ -0,0 +1,50 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.TextField = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ require("./text-field.css");
35
+ var TextField = /** @class */ (function (_super) {
36
+ __extends(TextField, _super);
37
+ function TextField() {
38
+ return _super !== null && _super.apply(this, arguments) || this;
39
+ }
40
+ TextField.prototype.render = function () {
41
+ var _a, _b, _c, _d, _e, _f;
42
+ return react_1.default.createElement("div", { className: "text-field-container row ".concat((_a = this.props.className) !== null && _a !== void 0 ? _a : 'placeholder-2', " ").concat(((_b = this.props.helperText) === null || _b === void 0 ? void 0 : _b.length) && 'helper-text'), "helper-text": this.props.helperText, style: this.props.style ? __assign(__assign({}, { '--helper-text-color': (_c = this.props.helperTextColor) !== null && _c !== void 0 ? _c : '#e14337' }), this.props.style) : { '--helper-text-color': (_d = this.props.helperTextColor) !== null && _d !== void 0 ? _d : '#e14337' } },
43
+ this.props.prefix,
44
+ this.props.register ?
45
+ react_1.default.createElement("input", __assign({}, this.props.register, { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, type: (_e = this.props.type) !== null && _e !== void 0 ? _e : 'text', placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onFocus: this.props.onFocus })) : react_1.default.createElement("input", { autoFocus: this.props.autoFocus, maxLength: this.props.maxLength, name: this.props.name, type: (_f = this.props.type) !== null && _f !== void 0 ? _f : 'text', defaultValue: this.props.defaultValue, value: this.props.value, placeholder: this.props.placeholder, readOnly: this.props.readOnly, disabled: this.props.disabled, onChange: this.props.onChange, onFocus: this.props.onFocus, onBlur: this.props.onBlur }),
46
+ this.props.suffix);
47
+ };
48
+ return TextField;
49
+ }(react_1.default.Component));
50
+ exports.TextField = TextField;
@@ -0,0 +1,4 @@
1
+ export declare class ToastMessage {
2
+ static success(message: string): void;
3
+ static errors(message: string): void;
4
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToastMessage = void 0;
4
+ var react_toastify_1 = require("react-toastify");
5
+ var ToastMessage = /** @class */ (function () {
6
+ function ToastMessage() {
7
+ }
8
+ ToastMessage.success = function (message) {
9
+ react_toastify_1.toast.success(message, {
10
+ hideProgressBar: true,
11
+ transition: react_toastify_1.Slide,
12
+ autoClose: 800,
13
+ theme: "colored",
14
+ });
15
+ };
16
+ ToastMessage.errors = function (message) {
17
+ react_toastify_1.toast.error(message, {
18
+ theme: "colored",
19
+ pauseOnHover: false,
20
+ hideProgressBar: true,
21
+ transition: react_toastify_1.Slide,
22
+ autoClose: 800,
23
+ });
24
+ };
25
+ return ToastMessage;
26
+ }());
27
+ exports.ToastMessage = ToastMessage;