wini-web-components 2.2.7 → 2.3.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 (63) hide show
  1. package/dist/component/button/button.d.ts +16 -16
  2. package/dist/component/button/button.js +39 -39
  3. package/dist/component/calendar/calendar.d.ts +30 -46
  4. package/dist/component/calendar/calendar.js +437 -432
  5. package/dist/component/checkbox/checkbox.d.ts +22 -22
  6. package/dist/component/checkbox/checkbox.js +80 -81
  7. package/dist/component/component-status.d.ts +8 -8
  8. package/dist/component/component-status.js +39 -39
  9. package/dist/component/date-picker/date-picker.d.ts +25 -36
  10. package/dist/component/date-picker/date-picker.js +362 -359
  11. package/dist/component/dialog/dialog.d.ts +36 -34
  12. package/dist/component/dialog/dialog.js +99 -97
  13. package/dist/component/import-file/import-file.d.ts +24 -36
  14. package/dist/component/import-file/import-file.js +154 -119
  15. package/dist/component/infinite-scroll/infinite-scroll.d.ts +17 -17
  16. package/dist/component/infinite-scroll/infinite-scroll.js +103 -103
  17. package/dist/component/input-multi-select/input-multi-select.d.ts +21 -38
  18. package/dist/component/input-multi-select/input-multi-select.js +334 -323
  19. package/dist/component/input-opt/input-opt.d.ts +21 -0
  20. package/dist/component/input-opt/input-opt.js +157 -0
  21. package/dist/component/number-picker/number-picker.d.ts +19 -19
  22. package/dist/component/number-picker/number-picker.js +137 -127
  23. package/dist/component/pagination/pagination.d.ts +13 -13
  24. package/dist/component/pagination/pagination.js +93 -82
  25. package/dist/component/popup/popup.d.ts +33 -33
  26. package/dist/component/popup/popup.js +138 -105
  27. package/dist/component/progress-bar/progress-bar.d.ts +16 -16
  28. package/dist/component/progress-bar/progress-bar.js +35 -36
  29. package/dist/component/progress-circle/progress-circle.d.ts +14 -14
  30. package/dist/component/progress-circle/progress-circle.js +30 -31
  31. package/dist/component/radio-button/radio-button.d.ts +20 -20
  32. package/dist/component/radio-button/radio-button.js +64 -64
  33. package/dist/component/rating/rating.d.ts +23 -23
  34. package/dist/component/rating/rating.js +73 -74
  35. package/dist/component/select1/select1.d.ts +31 -50
  36. package/dist/component/select1/select1.js +320 -309
  37. package/dist/component/slider/slider.d.ts +31 -31
  38. package/dist/component/slider/slider.js +80 -81
  39. package/dist/component/switch/switch.d.ts +23 -23
  40. package/dist/component/switch/switch.js +80 -81
  41. package/dist/component/table/table.d.ts +51 -51
  42. package/dist/component/table/table.js +119 -119
  43. package/dist/component/tag/tag.d.ts +17 -17
  44. package/dist/component/tag/tag.js +39 -39
  45. package/dist/component/text/text.d.ts +16 -16
  46. package/dist/component/text/text.js +51 -51
  47. package/dist/component/text-area/text-area.d.ts +28 -28
  48. package/dist/component/text-area/text-area.js +83 -73
  49. package/dist/component/text-field/text-field.d.ts +33 -33
  50. package/dist/component/text-field/text-field.js +107 -97
  51. package/dist/component/toast-noti/toast-noti.d.ts +5 -5
  52. package/dist/component/toast-noti/toast-noti.js +28 -28
  53. package/dist/component/wini-icon/winicon.d.ts +16 -16
  54. package/dist/component/wini-icon/winicon.js +121 -112
  55. package/dist/form/login/view.d.ts +40 -40
  56. package/dist/form/login/view.js +66 -65
  57. package/dist/i18n.d.ts +2 -0
  58. package/dist/i18n.js +125 -0
  59. package/dist/index.d.ts +32 -30
  60. package/dist/index.js +1 -1
  61. package/dist/language/i18n.d.ts +2 -0
  62. package/dist/language/i18n.js +125 -0
  63. package/package.json +5 -3
@@ -1,34 +1,36 @@
1
- import React from 'react';
2
- import { ComponentStatus } from '../../index';
3
- export declare enum DialogAlignment {
4
- start = "start",
5
- center = "center",
6
- end = "end"
7
- }
8
- interface DialogState {
9
- readonly open?: boolean;
10
- title: string;
11
- status: ComponentStatus;
12
- content: string;
13
- onSubmit: Function;
14
- submitTitle?: string;
15
- cancelTitle?: string;
16
- alignment?: DialogAlignment;
17
- }
18
- export declare const showDialog: ({ ref, title, status, content, onSubmit, submitTitle, cancelTitle, alignment }: {
19
- ref: React.MutableRefObject<Dialog>;
20
- title?: string | undefined;
21
- status?: ComponentStatus | undefined;
22
- content?: string | undefined;
23
- onSubmit?: Function | undefined;
24
- submitTitle?: string | undefined;
25
- cancelTitle?: string | undefined;
26
- alignment?: DialogAlignment | undefined;
27
- }) => void;
28
- export declare class Dialog extends React.Component<Object, DialogState> {
29
- state: Readonly<DialogState>;
30
- showDialogNoti(data: DialogState): void;
31
- closeDialog(): void;
32
- render(): React.JSX.Element;
33
- }
34
- export {};
1
+ import React from 'react';
2
+ import { ComponentStatus } from '../../index';
3
+ import { WithTranslation } from 'react-i18next';
4
+ export declare enum DialogAlignment {
5
+ start = "start",
6
+ center = "center",
7
+ end = "end"
8
+ }
9
+ interface DialogState {
10
+ readonly open?: boolean;
11
+ title: string;
12
+ status: ComponentStatus;
13
+ content: string;
14
+ onSubmit: Function;
15
+ submitTitle?: string;
16
+ cancelTitle?: string;
17
+ alignment?: DialogAlignment;
18
+ }
19
+ export declare const showDialog: ({ ref, title, status, content, onSubmit, submitTitle, cancelTitle, alignment }: {
20
+ ref: React.MutableRefObject<TDialog>;
21
+ title?: string;
22
+ status?: ComponentStatus;
23
+ content?: string;
24
+ onSubmit?: Function;
25
+ submitTitle?: string;
26
+ cancelTitle?: string;
27
+ alignment?: DialogAlignment;
28
+ }) => void;
29
+ declare class TDialog extends React.Component<WithTranslation, DialogState> {
30
+ constructor(props: WithTranslation);
31
+ showDialogNoti(data: DialogState): void;
32
+ closeDialog(): void;
33
+ render(): React.JSX.Element;
34
+ }
35
+ export declare const Dialog: React.ComponentType<Omit<import("react-i18next/helpers").$Subtract<WithTranslation<undefined, undefined>, import("react-i18next").WithTranslationProps>, keyof WithTranslation<Ns, undefined>> & import("react-i18next").WithTranslationProps>;
36
+ export {};
@@ -1,97 +1,99 @@
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.Dialog = exports.showDialog = exports.DialogAlignment = void 0;
33
- var react_1 = __importDefault(require("react"));
34
- var react_dom_1 = __importDefault(require("react-dom"));
35
- var dialog_module_css_1 = __importDefault(require("./dialog.module.css"));
36
- var index_1 = require("../../index");
37
- var DialogAlignment;
38
- (function (DialogAlignment) {
39
- DialogAlignment["start"] = "start";
40
- DialogAlignment["center"] = "center";
41
- DialogAlignment["end"] = "end";
42
- })(DialogAlignment = exports.DialogAlignment || (exports.DialogAlignment = {}));
43
- var showDialog = function (_a) {
44
- var ref = _a.ref, title = _a.title, status = _a.status, content = _a.content, onSubmit = _a.onSubmit, submitTitle = _a.submitTitle, cancelTitle = _a.cancelTitle, alignment = _a.alignment;
45
- ref.current.showDialogNoti({
46
- title: title !== null && title !== void 0 ? title : '',
47
- status: status !== null && status !== void 0 ? status : index_1.ComponentStatus.INFOR,
48
- content: content !== null && content !== void 0 ? content : '',
49
- onSubmit: onSubmit !== null && onSubmit !== void 0 ? onSubmit : (function () { }),
50
- submitTitle: submitTitle,
51
- cancelTitle: cancelTitle,
52
- alignment: alignment
53
- });
54
- };
55
- exports.showDialog = showDialog;
56
- var Dialog = /** @class */ (function (_super) {
57
- __extends(Dialog, _super);
58
- function Dialog() {
59
- var _this = _super !== null && _super.apply(this, arguments) || this;
60
- _this.state = {
61
- open: false,
62
- title: '',
63
- status: index_1.ComponentStatus.INFOR,
64
- content: '',
65
- onSubmit: function () { }
66
- };
67
- return _this;
68
- }
69
- Dialog.prototype.showDialogNoti = function (data) {
70
- this.setState(__assign({ open: true }, data));
71
- };
72
- Dialog.prototype.closeDialog = function () {
73
- this.setState({ open: false });
74
- };
75
- Dialog.prototype.render = function () {
76
- var _this = this;
77
- var _a, _b;
78
- return (react_1.default.createElement(react_1.default.Fragment, null, this.state.open &&
79
- react_dom_1.default.createPortal(react_1.default.createElement("div", { className: dialog_module_css_1.default['dialog-overlay'] },
80
- react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-container'], " col"), style: { width: '41.4rem', alignItems: this.state.alignment }, "dialog-type": this.state.status, onClick: function (e) { return e.stopPropagation(); } },
81
- react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-body'], " col"), style: { alignItems: 'inherit' } },
82
- react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-status'], " row") }, (0, index_1.getStatusIcon)(this.state.status)),
83
- react_1.default.createElement("div", { className: 'col' },
84
- react_1.default.createElement(index_1.Text, { className: 'heading-6', style: { textAlign: this.state.alignment === DialogAlignment.center ? 'center' : 'start' } }, this.state.title),
85
- react_1.default.createElement(index_1.Text, { className: 'body-3', style: { textAlign: this.state.alignment === DialogAlignment.center ? 'center' : 'start' } }, this.state.content))),
86
- react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-footer'], " row") },
87
- react_1.default.createElement("button", { type: 'button', style: this.state.alignment === DialogAlignment.center ? { flex: 1, width: '100%' } : undefined, onClick: function () { return _this.setState({ open: false }); }, className: "".concat(dialog_module_css_1.default['dialog-action'], " row") },
88
- react_1.default.createElement(index_1.Text, { className: 'button-text-3' }, (_a = this.state.cancelTitle) !== null && _a !== void 0 ? _a : "Cancel")),
89
- react_1.default.createElement("button", { type: 'button', style: this.state.alignment === DialogAlignment.center ? { flex: 1, width: '100%' } : undefined, onClick: function () {
90
- _this.state.onSubmit();
91
- _this.setState({ open: false });
92
- }, className: "".concat(dialog_module_css_1.default['dialog-action'], " row ").concat(dialog_module_css_1.default['dialog-submit']) },
93
- react_1.default.createElement(index_1.Text, { className: 'button-text-3' }, (_b = this.state.submitTitle) !== null && _b !== void 0 ? _b : 'Submit'))))), document.body)));
94
- };
95
- return Dialog;
96
- }(react_1.default.Component));
97
- exports.Dialog = Dialog;
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.Dialog = exports.showDialog = exports.DialogAlignment = void 0;
33
+ var react_1 = __importDefault(require("react"));
34
+ var react_dom_1 = __importDefault(require("react-dom"));
35
+ var dialog_module_css_1 = __importDefault(require("./dialog.module.css"));
36
+ var index_1 = require("../../index");
37
+ var react_i18next_1 = require("react-i18next");
38
+ var DialogAlignment;
39
+ (function (DialogAlignment) {
40
+ DialogAlignment["start"] = "start";
41
+ DialogAlignment["center"] = "center";
42
+ DialogAlignment["end"] = "end";
43
+ })(DialogAlignment || (exports.DialogAlignment = DialogAlignment = {}));
44
+ var showDialog = function (_a) {
45
+ var ref = _a.ref, title = _a.title, status = _a.status, content = _a.content, onSubmit = _a.onSubmit, submitTitle = _a.submitTitle, cancelTitle = _a.cancelTitle, alignment = _a.alignment;
46
+ ref.current.showDialogNoti({
47
+ title: title !== null && title !== void 0 ? title : '',
48
+ status: status !== null && status !== void 0 ? status : index_1.ComponentStatus.INFOR,
49
+ content: content !== null && content !== void 0 ? content : '',
50
+ onSubmit: onSubmit !== null && onSubmit !== void 0 ? onSubmit : (function () { }),
51
+ submitTitle: submitTitle,
52
+ cancelTitle: cancelTitle,
53
+ alignment: alignment
54
+ });
55
+ };
56
+ exports.showDialog = showDialog;
57
+ var TDialog = /** @class */ (function (_super) {
58
+ __extends(TDialog, _super);
59
+ function TDialog(props) {
60
+ var _this = _super.call(this, props) || this;
61
+ _this.state = {
62
+ open: false,
63
+ title: '',
64
+ status: index_1.ComponentStatus.INFOR,
65
+ content: '',
66
+ onSubmit: function () { }
67
+ };
68
+ return _this;
69
+ }
70
+ TDialog.prototype.showDialogNoti = function (data) {
71
+ this.setState(__assign({ open: true }, data));
72
+ };
73
+ TDialog.prototype.closeDialog = function () {
74
+ this.setState({ open: false });
75
+ };
76
+ TDialog.prototype.render = function () {
77
+ var _this = this;
78
+ var _a, _b;
79
+ var t = this.props.t;
80
+ return (react_1.default.createElement(react_1.default.Fragment, null, this.state.open &&
81
+ react_dom_1.default.createPortal(react_1.default.createElement("div", { className: dialog_module_css_1.default['dialog-overlay'] },
82
+ react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-container'], " col"), style: { width: '41.4rem', alignItems: this.state.alignment }, "dialog-type": this.state.status, onClick: function (e) { return e.stopPropagation(); } },
83
+ react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-body'], " col"), style: { alignItems: 'inherit' } },
84
+ react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-status'], " row") }, (0, index_1.getStatusIcon)(this.state.status)),
85
+ react_1.default.createElement("div", { className: 'col' },
86
+ react_1.default.createElement(index_1.Text, { className: 'heading-6', style: { textAlign: this.state.alignment === DialogAlignment.center ? 'center' : 'start' } }, this.state.title),
87
+ react_1.default.createElement(index_1.Text, { className: 'body-3', style: { textAlign: this.state.alignment === DialogAlignment.center ? 'center' : 'start' } }, this.state.content))),
88
+ react_1.default.createElement("div", { className: "".concat(dialog_module_css_1.default['dialog-footer'], " row") },
89
+ react_1.default.createElement("button", { type: 'button', style: this.state.alignment === DialogAlignment.center ? { flex: 1, width: '100%' } : undefined, onClick: function () { return _this.setState({ open: false }); }, className: "".concat(dialog_module_css_1.default['dialog-action'], " row") },
90
+ react_1.default.createElement(index_1.Text, { className: 'button-text-3' }, (_a = this.state.cancelTitle) !== null && _a !== void 0 ? _a : t("cancel"))),
91
+ react_1.default.createElement("button", { type: 'button', style: this.state.alignment === DialogAlignment.center ? { flex: 1, width: '100%' } : undefined, onClick: function () {
92
+ _this.state.onSubmit();
93
+ _this.setState({ open: false });
94
+ }, className: "".concat(dialog_module_css_1.default['dialog-action'], " row ").concat(dialog_module_css_1.default['dialog-submit']) },
95
+ react_1.default.createElement(index_1.Text, { className: 'button-text-3' }, (_b = this.state.submitTitle) !== null && _b !== void 0 ? _b : t('submit')))))), document.body)));
96
+ };
97
+ return TDialog;
98
+ }(react_1.default.Component));
99
+ exports.Dialog = (0, react_i18next_1.withTranslation)()(TDialog);
@@ -1,36 +1,24 @@
1
- import React, { CSSProperties } from 'react';
2
- import { ComponentStatus } from '../component-status';
3
- interface ImportFileState {
4
- status?: ComponentStatus;
5
- preview: File | {
6
- [k: string]: any;
7
- } | undefined | null;
8
- }
9
- type ChangeFileFunction = (a?: File) => void;
10
- interface ImportFileProps {
11
- id?: string;
12
- status?: ComponentStatus;
13
- value?: File | {
14
- [k: string]: any;
15
- };
16
- buttonOnly?: boolean;
17
- onChange?: ChangeFileFunction;
18
- label?: string;
19
- className?: string;
20
- style?: CSSProperties;
21
- allowType?: Array<string>;
22
- subTitle?: string;
23
- /**
24
- * maxSize unit: kb (kilobytes)
25
- */
26
- maxSize?: number;
27
- }
28
- export declare class ImportFile extends React.Component<ImportFileProps, ImportFileState> {
29
- private fileRef;
30
- constructor(props: ImportFileProps | Readonly<ImportFileProps>);
31
- state: Readonly<ImportFileState>;
32
- showFilePicker(): void;
33
- componentDidUpdate(prevProps: Readonly<ImportFileProps>, prevState: Readonly<ImportFileState>): void;
34
- render(): React.JSX.Element;
35
- }
36
- export {};
1
+ import React, { CSSProperties } from 'react';
2
+ import { ComponentStatus } from '../component-status';
3
+ import { WithTranslation } from 'react-i18next';
4
+ type ChangeFileFunction = (a?: File) => void;
5
+ interface ImportFileProps extends WithTranslation {
6
+ id?: string;
7
+ status?: ComponentStatus;
8
+ value?: File | {
9
+ [k: string]: any;
10
+ };
11
+ buttonOnly?: boolean;
12
+ onChange?: ChangeFileFunction;
13
+ label?: string;
14
+ className?: string;
15
+ style?: CSSProperties;
16
+ allowType?: Array<string>;
17
+ subTitle?: string;
18
+ /**
19
+ * maxSize unit: kb (kilobytes)
20
+ */
21
+ maxSize?: number;
22
+ }
23
+ 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>;
24
+ export {};