wini-web-components 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +44 -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,113 +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.showDialog = exports.Dialog = exports.DialogAlignment = void 0;
40
- const react_1 = __importStar(require("react"));
41
- const react_dom_1 = __importDefault(require("react-dom"));
42
- const dialog_module_css_1 = __importDefault(require("./dialog.module.css"));
43
- const index_1 = require("../../index");
44
- const react_i18next_1 = require("react-i18next");
45
- var DialogAlignment;
46
- (function (DialogAlignment) {
47
- DialogAlignment["start"] = "start";
48
- DialogAlignment["center"] = "center";
49
- DialogAlignment["end"] = "end";
50
- })(DialogAlignment || (exports.DialogAlignment = DialogAlignment = {}));
51
- class TDialog extends react_1.default.Component {
52
- constructor(props) {
53
- super(props);
54
- this.state = {
55
- open: false,
56
- title: '',
57
- status: index_1.ComponentStatus.INFOR,
58
- content: '',
59
- onSubmit: () => { }
60
- };
61
- }
62
- showDialogNoti(data) {
63
- this.setState(Object.assign({ open: true }, data));
64
- }
65
- closeDialog() {
66
- this.setState({ open: false });
67
- }
68
- render() {
69
- var _a, _b;
70
- const { t } = this.props;
71
- return (react_1.default.createElement(react_1.default.Fragment, null, this.state.open &&
72
- react_dom_1.default.createPortal(react_1.default.createElement("div", { className: dialog_module_css_1.default['dialog-overlay'] },
73
- react_1.default.createElement("div", { className: `${dialog_module_css_1.default['dialog-container']} col`, style: { width: '41.4rem', alignItems: this.state.alignment }, "dialog-type": this.state.status, onClick: e => e.stopPropagation() },
74
- react_1.default.createElement("div", { className: `${dialog_module_css_1.default['dialog-body']} col`, style: { alignItems: 'inherit' } },
75
- react_1.default.createElement("div", { className: `${dialog_module_css_1.default['dialog-status']} row` }, (0, index_1.getStatusIcon)(this.state.status)),
76
- react_1.default.createElement("div", { className: 'col' },
77
- react_1.default.createElement(index_1.Text, { className: 'heading-6', style: { textAlign: this.state.alignment === DialogAlignment.center ? 'center' : 'start' } }, this.state.title),
78
- react_1.default.createElement(index_1.Text, { className: 'body-3', style: { textAlign: this.state.alignment === DialogAlignment.center ? 'center' : 'start' } }, this.state.content))),
79
- react_1.default.createElement("div", { className: `${dialog_module_css_1.default['dialog-footer']} row` },
80
- react_1.default.createElement("button", { type: 'button', style: this.state.alignment === DialogAlignment.center ? { flex: 1, width: '100%' } : undefined, onClick: () => {
81
- if (this.state.onCancel)
82
- this.state.onCancel();
83
- this.setState({ open: false });
84
- }, className: `${dialog_module_css_1.default['dialog-action']} row` },
85
- react_1.default.createElement(index_1.Text, { className: 'button-text-3' }, (_a = this.state.cancelTitle) !== null && _a !== void 0 ? _a : t("cancel"))),
86
- react_1.default.createElement("button", { type: 'button', style: this.state.alignment === DialogAlignment.center ? { flex: 1, width: '100%' } : undefined, onClick: () => {
87
- this.state.onSubmit();
88
- this.setState({ open: false });
89
- }, className: `${dialog_module_css_1.default['dialog-action']} row ${dialog_module_css_1.default['dialog-submit']}` },
90
- react_1.default.createElement(index_1.Text, { className: 'button-text-3' }, (_b = this.state.submitTitle) !== null && _b !== void 0 ? _b : t('submit')))))), document.body)));
91
- }
92
- }
93
- const dialogRef = (0, react_1.createRef)();
94
- const Dialog = () => {
95
- const { t, i18n } = (0, react_i18next_1.useTranslation)();
96
- return react_1.default.createElement(TDialog, { ref: dialogRef, t: t, i18n: i18n, tReady: true });
97
- };
98
- exports.Dialog = Dialog;
99
- const showDialog = (props) => {
100
- var _a, _b, _c, _d;
101
- if (dialogRef.current)
102
- dialogRef.current.showDialogNoti({
103
- title: (_a = props.title) !== null && _a !== void 0 ? _a : '',
104
- status: (_b = props.status) !== null && _b !== void 0 ? _b : index_1.ComponentStatus.INFOR,
105
- content: (_c = props.content) !== null && _c !== void 0 ? _c : '',
106
- onSubmit: (_d = props.onSubmit) !== null && _d !== void 0 ? _d : (() => { }),
107
- onCancel: props.onCancel,
108
- submitTitle: props.submitTitle,
109
- cancelTitle: props.cancelTitle,
110
- alignment: props.alignment
111
- });
112
- };
113
- exports.showDialog = showDialog;
@@ -1,33 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import { ComponentStatus } from '../component-status';
3
- import { WithTranslation } from 'react-i18next';
4
- type ChangeFileFunction = (a?: Array<File> | Array<{
5
- [k: string]: any;
6
- }>) => void;
7
- interface ImportFileProps extends WithTranslation {
8
- id?: string;
9
- status?: ComponentStatus;
10
- value?: File | Array<File> | {
11
- [k: string]: any;
12
- } | Array<{
13
- [k: string]: any;
14
- }>;
15
- buttonOnly?: boolean;
16
- onChange?: ChangeFileFunction;
17
- label?: string;
18
- className?: string;
19
- style?: CSSProperties;
20
- allowType?: Array<string>;
21
- subTitle?: string;
22
- multiple?: boolean;
23
- helperText?: string;
24
- helperTextColor?: string;
25
- disabled?: boolean;
26
- fileTagStyle?: CSSProperties;
27
- /**
28
- * maxSize unit: kb (kilobytes)
29
- */
30
- maxSize?: number;
31
- }
32
- export declare const ImportFile: React.ComponentType<Omit<import("react-i18next/helpers").$Subtract<ImportFileProps | Readonly<ImportFileProps>, import("react-i18next").WithTranslationProps>, keyof WithTranslation<Ns, undefined>> & import("react-i18next").WithTranslationProps>;
33
- export {};
@@ -1,151 +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.ImportFile = void 0;
40
- const react_1 = __importStar(require("react"));
41
- const import_file_module_css_1 = __importDefault(require("./import-file.module.css"));
42
- const index_1 = require("../../index");
43
- const react_i18next_1 = require("react-i18next");
44
- const cloudSvg = (react_1.default.createElement("svg", { width: '100%', height: '100%', style: { width: '3rem', height: '3rem' }, viewBox: '0 0 36 36', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
45
- react_1.default.createElement("path", { d: 'M22.5312 6.51941C20.3258 6.12929 18.0555 6.35518 15.9702 7.1722C13.8849 7.98923 12.0654 9.36573 10.712 11.1502C9.53042 12.7081 8.74407 14.5243 8.41412 16.4432C6.99557 16.9154 5.7486 17.8144 4.85059 19.0274C3.77621 20.4786 3.27749 22.2764 3.45068 24.0737C3.62388 25.871 4.45672 27.5405 5.78845 28.7599C7.12018 29.9792 8.85639 30.6621 10.662 30.6766H13.1063C13.7786 30.6766 14.3236 30.1316 14.3236 29.4594C14.3236 28.7871 13.7786 28.2421 13.1063 28.2421H10.6769C9.47485 28.2313 8.31921 27.7762 7.43253 26.9643C6.54471 26.1514 5.98948 25.0384 5.87402 23.8402C5.75855 22.642 6.09103 21.4435 6.80729 20.476C7.52354 19.5085 8.57279 18.8406 9.75252 18.6013C10.2753 18.4952 10.6682 18.061 10.7216 17.5303C10.9012 15.7476 11.5691 14.049 12.6518 12.6214C13.7345 11.1938 15.1901 10.0926 16.8583 9.43899C18.5266 8.78536 20.3428 8.60466 22.1071 8.91675C23.8715 9.22884 25.5155 10.0216 26.8583 11.2079C28.2011 12.3941 29.1905 13.9278 29.7178 15.6402C30.2451 17.3526 30.2898 19.1772 29.8469 20.9134C29.404 22.6495 28.4907 24.2297 27.2075 25.4802C25.9244 26.7308 24.3211 27.603 22.5742 28.001C21.9187 28.1504 21.5084 28.8028 21.6577 29.4583C21.807 30.1138 22.4595 30.5241 23.115 30.3748C25.2987 29.8772 27.3028 28.7869 28.9067 27.2238C30.5107 25.6606 31.6523 23.6853 32.2059 21.5152C32.7595 19.345 32.7037 17.0642 32.0446 14.9237C31.3855 12.7833 30.1486 10.8661 28.4701 9.38333C26.7916 7.90052 24.7366 6.90953 22.5312 6.51941Z', style: { fill: "var(--primary-main-color)" } }),
46
- react_1.default.createElement("path", { d: 'M17.1146 17.6431C17.2313 17.5264 17.3658 17.4384 17.5094 17.379C17.6513 17.3201 17.8067 17.2874 17.9697 17.2866L17.9753 17.2866L17.9809 17.2866C18.2906 17.288 18.5998 17.4069 18.8361 17.6431L23.7052 22.5123C24.1806 22.9876 24.1806 23.7584 23.7052 24.2338C23.2298 24.7091 22.4591 24.7091 21.9837 24.2338L19.1926 21.4427V29.4594C19.1926 30.1317 18.6476 30.6767 17.9753 30.6767C17.303 30.6767 16.758 30.1317 16.758 29.4594V21.4427L13.9669 24.2338C13.4916 24.7091 12.7208 24.7091 12.2455 24.2338C11.7701 23.7584 11.7701 22.9876 12.2455 22.5123L17.1146 17.6431Z', style: { fill: "var(--primary-main-color)" } })));
47
- const fileSvg = (react_1.default.createElement("svg", { className: import_file_module_css_1.default['preview-icon'], width: '100%', height: '100%', style: { width: '3rem', height: '3rem' }, viewBox: '0 0 36 36', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
48
- react_1.default.createElement("path", { d: 'M20.9163 3.41669H7.54829C7.22597 3.41669 6.91686 3.54472 6.68895 3.77263C6.46105 4.00054 6.33301 4.30965 6.33301 4.63196V31.3681C6.33301 31.6904 6.46105 31.9995 6.68895 32.2274C6.91686 32.4553 7.22597 32.5834 7.54829 32.5834H29.4233C29.7456 32.5834 30.0547 32.4553 30.2826 32.2274C30.5105 31.9995 30.6386 31.6904 30.6386 31.3681V13.1389H22.1316C21.8093 13.1389 21.5002 13.0109 21.2723 12.783C21.0444 12.5551 20.9163 12.2459 20.9163 11.9236V3.41669Z', style: { fill: "var(--primary-main-color)" } }),
49
- react_1.default.createElement("path", { d: 'M29.9264 10.7084H23.3469V4.12884L29.9264 10.7084Z', style: { fill: "var(--primary-main-color)" } })));
50
- const closeSvg = (react_1.default.createElement("svg", { width: '100%', height: '100%', style: { width: '2.4rem', height: '2.4rem' }, fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
51
- react_1.default.createElement("path", { d: 'M13.4144 12.0002L20.4144 5.00015L19.0002 3.58594L12.0002 10.5859L5.00015 3.58594L3.58594 5.00015L10.5859 12.0002L3.58594 19.0002L5.00015 20.4144L12.0002 13.4144L19.0002 20.4144L20.4144 19.0002L13.4144 12.0002Z', style: { fill: "var(--error-main-color)" } })));
52
- const formatFileSize = (bytes, decimalPoint) => {
53
- if (bytes == 0)
54
- return '0 Bytes';
55
- var k = 1000, dm = decimalPoint || 2, sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], i = Math.floor(Math.log(bytes) / Math.log(k));
56
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
57
- };
58
- class TImportFile extends react_1.default.Component {
59
- constructor(props) {
60
- super(props);
61
- this.fileRef = (0, react_1.createRef)();
62
- this.state = {
63
- preview: this.props.value ? Array.isArray(this.props.value) ? this.props.value : [this.props.value] : undefined
64
- };
65
- }
66
- showFilePicker() {
67
- var _a;
68
- (_a = this.fileRef.current) === null || _a === void 0 ? void 0 : _a.click();
69
- }
70
- componentDidUpdate(prevProps, prevState) {
71
- if (prevProps.value !== this.props.value || prevProps.status !== this.props.status) {
72
- this.setState(Object.assign(Object.assign({}, this.state), { status: this.props.status, preview: this.props.value ? Array.isArray(this.props.value) ? this.props.value : [this.props.value] : undefined }));
73
- }
74
- }
75
- render() {
76
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
77
- const { t } = this.props;
78
- let sizeTitle;
79
- if (this.props.maxSize)
80
- sizeTitle = formatFileSize(this.props.maxSize);
81
- let _style = this.state.preview ? ((_a = this.props.style) !== null && _a !== void 0 ? _a : {}) : Object.assign({ cursor: 'pointer' }, ((_b = this.props.style) !== null && _b !== void 0 ? _b : {}));
82
- return react_1.default.createElement("div", { id: this.props.id, className: `${import_file_module_css_1.default['import-file-container']} ${(_c = this.props.className) !== null && _c !== void 0 ? _c : 'row'} ${this.props.buttonOnly ? import_file_module_css_1.default['button-only'] : ''} ${((_d = this.props.helperText) === null || _d === void 0 ? void 0 : _d.length) ? import_file_module_css_1.default['helper-text'] : ""}`, style: Object.assign({ '--helper-text-color': (_e = this.props.helperTextColor) !== null && _e !== void 0 ? _e : '#e14337' }, _style), "helper-text": this.props.helperText, onClick: () => {
83
- if (!this.state.preview && !this.props.buttonOnly)
84
- this.showFilePicker();
85
- } },
86
- react_1.default.createElement("input", { disabled: this.props.disabled, type: 'file', multiple: this.props.multiple, accept: ((_f = this.props.allowType) !== null && _f !== void 0 ? _f : []).join(','), ref: this.fileRef, onChange: (ev) => {
87
- var _a, _b, _c, _d;
88
- let files;
89
- if ((_a = ev.target.files) === null || _a === void 0 ? void 0 : _a.length) {
90
- files = [...ev.target.files];
91
- if (this.props.maxSize) {
92
- if (files.some(f => (f.size > (this.props.maxSize * 1024)))) {
93
- index_1.ToastMessage.errors(t("limitFileError", { name: (_b = files.find(f => (f.size > (this.props.maxSize * 1024)))) === null || _b === void 0 ? void 0 : _b.name, sizeTitle: sizeTitle }));
94
- files = files.filter(f => (f.size <= (this.props.maxSize * 1024)));
95
- }
96
- }
97
- }
98
- if (files) {
99
- if (this.props.multiple) {
100
- const newValue = (_d = (_c = this.state.preview) === null || _c === void 0 ? void 0 : _c.filter(e => files.every(f => e.name !== f.name && e.size !== f.size && e.lastModified !== f.lastModified))) !== null && _d !== void 0 ? _d : [];
101
- this.setState(Object.assign(Object.assign({}, this.state), { preview: [...newValue, ...files] }));
102
- if (this.props.onChange)
103
- this.props.onChange([...newValue, ...files]);
104
- }
105
- else {
106
- this.setState(Object.assign(Object.assign({}, this.state), { preview: files }));
107
- if (this.props.onChange)
108
- this.props.onChange(files);
109
- }
110
- }
111
- } }),
112
- this.props.buttonOnly
113
- ? null
114
- : this.props.multiple && ((_g = this.state.preview) === null || _g === void 0 ? void 0 : _g.length) ? react_1.default.createElement("div", { className: 'row', style: { flex: 1, flexWrap: "wrap", gap: "0.8rem" } }, this.state.preview.map(f => {
115
- var _a, _b;
116
- return react_1.default.createElement("div", { key: `${f.name}-${f.size}-${f.lastModified}`, className: 'row', style: Object.assign({ gap: "0.8rem", padding: "0.6rem 0.8rem", borderRadius: "0.4rem", border: "var(--neutral-main-border)", flex: "0 calc((100% * 6 / 24) - 0.8rem * 3 / 4)", width: "auto", minWidth: "11.4rem" }, ((_a = this.props.fileTagStyle) !== null && _a !== void 0 ? _a : {})) },
117
- react_1.default.createElement(index_1.Winicon, { src: `outline/${((_b = f.type) === null || _b === void 0 ? void 0 : _b.includes('image')) ? "multimedia/image" : "files/file-export"}`, size: "1.4rem" }),
118
- react_1.default.createElement(index_1.Text, { className: 'subtitle-4', style: { flex: 1, width: "100%" }, maxLine: 1 }, f.name),
119
- react_1.default.createElement(index_1.Winicon, { src: 'fill/user interface/e-remove', size: "1.4rem", onClick: () => {
120
- var _a;
121
- const newValue = (_a = this.state.preview) === null || _a === void 0 ? void 0 : _a.filter(e => e.name !== f.name && e.size !== f.size && e.lastModified !== f.lastModified);
122
- this.setState(Object.assign(Object.assign({}, this.state), { preview: newValue }));
123
- if (this.props.onChange)
124
- this.props.onChange(newValue);
125
- }, color: '#E14337' }));
126
- })) : react_1.default.createElement(react_1.default.Fragment, null,
127
- react_1.default.createElement("div", { className: `${import_file_module_css_1.default['import-file-prefix']} row` }, ((_h = this.state.preview) === null || _h === void 0 ? void 0 : _h.length) ? ((_j = this.state.preview[0].type) === null || _j === void 0 ? void 0 : _j.includes('image')) ? react_1.default.createElement("img", { src: this.state.preview[0] instanceof File ? URL.createObjectURL(this.state.preview[0]) : (_l = (_k = this.state.preview) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.url }) : fileSvg : cloudSvg),
128
- react_1.default.createElement("div", { className: `${import_file_module_css_1.default['file-preview-content']} col` },
129
- react_1.default.createElement(index_1.Text, { className: `${import_file_module_css_1.default['title-file']} heading-8`, style: { maxWidth: '100%' } }, (_p = (_o = (_m = this.state.preview) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.name) !== null && _p !== void 0 ? _p : ((_q = this.props.label) !== null && _q !== void 0 ? _q : t("uploadFileAction"))),
130
- react_1.default.createElement(index_1.Text, { className: `${import_file_module_css_1.default['subtitle-file']} subtitle-3`, style: { maxWidth: '100%' } }, ((_s = (_r = this.state.preview) === null || _r === void 0 ? void 0 : _r[0]) === null || _s === void 0 ? void 0 : _s.size)
131
- ? `${(_t = this.state.preview) === null || _t === void 0 ? void 0 : _t[0].size}KB`
132
- : ((_u = this.props.subTitle) !== null && _u !== void 0 ? _u : (sizeTitle ? t("limitFileWarning", { sizeTitle: sizeTitle }) : ''))))),
133
- ((_v = this.state.preview) === null || _v === void 0 ? void 0 : _v.length) && this.props.buttonOnly && !this.props.multiple ? react_1.default.createElement("div", { className: 'row', style: { gap: "0.4rem" } },
134
- react_1.default.createElement(index_1.Text, { className: 'button-text-6' }, (_x = (_w = this.state.preview) === null || _w === void 0 ? void 0 : _w[0].name) !== null && _x !== void 0 ? _x : ''),
135
- react_1.default.createElement("button", { type: 'button', className: `${import_file_module_css_1.default['remove-preview-file']}`, onClick: () => {
136
- this.setState(Object.assign(Object.assign({}, this.state), { preview: undefined }));
137
- if (this.props.onChange)
138
- this.props.onChange(undefined);
139
- } }, closeSvg))
140
- : react_1.default.createElement(index_1.Button, { label: ((_y = this.state.preview) === null || _y === void 0 ? void 0 : _y.length) ? this.props.multiple ? `${t("add")} ${t("file").toLowerCase()}` : `${t("remove")} ${t("file").toLowerCase()}` : `${t("choose")} ${t("file").toLowerCase()}`, style: { padding: "1.2rem", backgroundColor: "var(--neutral-main-background-color)" }, className: 'button-text-4', onClick: () => {
141
- if (this.state.preview && !this.props.multiple) {
142
- this.setState(Object.assign(Object.assign({}, this.state), { preview: undefined }));
143
- if (this.props.onChange)
144
- this.props.onChange(undefined);
145
- }
146
- else if (this.props.buttonOnly || this.state.preview)
147
- this.showFilePicker();
148
- } }));
149
- }
150
- }
151
- exports.ImportFile = (0, react_i18next_1.withTranslation)()(TImportFile);
@@ -1,17 +0,0 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
2
- interface InfiniteScrollProps {
3
- id?: string;
4
- className?: string;
5
- style?: CSSProperties;
6
- handleScroll?: (onLoadMore: boolean, ev: React.UIEvent<HTMLDivElement, UIEvent>) => Promise<any> | null;
7
- children?: ReactNode;
8
- totalCount?: number;
9
- }
10
- interface InfiniteScrollState {
11
- loading: boolean;
12
- }
13
- export declare class InfiniteScroll extends React.Component<InfiniteScrollProps, InfiniteScrollState> {
14
- state: Readonly<InfiniteScrollState>;
15
- render(): React.JSX.Element;
16
- }
17
- export {};
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.InfiniteScroll = void 0;
16
- const react_1 = __importDefault(require("react"));
17
- const infinite_scroll_module_css_1 = __importDefault(require("./infinite-scroll.module.css"));
18
- class InfiniteScroll extends react_1.default.Component {
19
- constructor() {
20
- super(...arguments);
21
- this.state = {
22
- loading: false
23
- };
24
- }
25
- render() {
26
- var _a, _b;
27
- return react_1.default.createElement("div", { id: this.props.id, onScroll: (ev) => __awaiter(this, void 0, void 0, function* () {
28
- if (this.props.handleScroll) {
29
- this.setState(Object.assign(Object.assign({}, this.state), { loading: true }));
30
- let scrollElement = ev.target;
31
- yield this.props.handleScroll(Math.round(scrollElement.offsetHeight + scrollElement.scrollTop) >= (scrollElement.scrollHeight - 1), ev);
32
- this.setState({ loading: false });
33
- }
34
- }), className: `${infinite_scroll_module_css_1.default['infinite-scroll']} ${this.state.loading ? infinite_scroll_module_css_1.default['loading'] : ''} ${(_a = this.props.className) !== null && _a !== void 0 ? _a : 'col'}`, style: (_b = this.props.style) !== null && _b !== void 0 ? _b : { 'overflow': 'hidden auto' } }, this.props.children);
35
- }
36
- }
37
- exports.InfiniteScroll = InfiniteScroll;
@@ -1,21 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import { OptionsItem } from '../select1/select1';
3
- import { WithTranslation } from 'react-i18next';
4
- interface SelectMultipleProps extends WithTranslation {
5
- id?: string;
6
- value?: Array<string | number>;
7
- options: Required<Array<OptionsItem>>;
8
- onChange?: (value?: Array<string | number>) => void;
9
- placeholder?: string;
10
- disabled?: boolean;
11
- className?: string;
12
- helperText?: string;
13
- helperTextColor?: string;
14
- style?: CSSProperties;
15
- handleSearch?: (e: string) => Promise<Array<OptionsItem>>;
16
- handleLoadmore?: (onLoadMore: boolean, ev: React.UIEvent<HTMLDivElement, UIEvent>) => void;
17
- showClearValueButton?: boolean;
18
- popupClassName?: string;
19
- }
20
- export declare const SelectMultiple: React.ComponentType<Omit<import("react-i18next/helpers").$Subtract<SelectMultipleProps, import("react-i18next").WithTranslationProps>, keyof WithTranslation<Ns, undefined>> & import("react-i18next").WithTranslationProps>;
21
- export {};