wini-web-components 2.2.8 → 2.3.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.
- package/dist/component/button/button.d.ts +16 -16
- package/dist/component/button/button.js +39 -39
- package/dist/component/calendar/calendar.d.ts +30 -46
- package/dist/component/calendar/calendar.js +437 -432
- package/dist/component/checkbox/checkbox.d.ts +24 -22
- package/dist/component/checkbox/checkbox.js +120 -81
- package/dist/component/component-status.d.ts +8 -8
- package/dist/component/component-status.js +39 -39
- package/dist/component/date-picker/date-picker.d.ts +25 -36
- package/dist/component/date-picker/date-picker.js +362 -359
- package/dist/component/dialog/dialog.d.ts +36 -34
- package/dist/component/dialog/dialog.js +99 -97
- package/dist/component/import-file/import-file.d.ts +24 -36
- package/dist/component/import-file/import-file.js +154 -119
- package/dist/component/infinite-scroll/infinite-scroll.d.ts +17 -17
- package/dist/component/infinite-scroll/infinite-scroll.js +103 -103
- package/dist/component/input-multi-select/input-multi-select.d.ts +21 -38
- package/dist/component/input-multi-select/input-multi-select.js +334 -323
- package/dist/component/input-opt/input-opt.d.ts +21 -21
- package/dist/component/input-opt/input-opt.js +157 -147
- package/dist/component/number-picker/number-picker.d.ts +19 -19
- package/dist/component/number-picker/number-picker.js +137 -127
- package/dist/component/pagination/pagination.d.ts +13 -13
- package/dist/component/pagination/pagination.js +93 -82
- package/dist/component/popup/popup.d.ts +33 -33
- package/dist/component/popup/popup.js +138 -105
- package/dist/component/progress-bar/progress-bar.d.ts +16 -16
- package/dist/component/progress-bar/progress-bar.js +35 -36
- package/dist/component/progress-circle/progress-circle.d.ts +14 -14
- package/dist/component/progress-circle/progress-circle.js +30 -31
- package/dist/component/radio-button/radio-button.d.ts +20 -20
- package/dist/component/radio-button/radio-button.js +64 -64
- package/dist/component/rating/rating.d.ts +23 -23
- package/dist/component/rating/rating.js +73 -74
- package/dist/component/select1/select1.d.ts +31 -50
- package/dist/component/select1/select1.js +320 -309
- package/dist/component/slider/slider.d.ts +31 -31
- package/dist/component/slider/slider.js +80 -81
- package/dist/component/switch/switch.d.ts +23 -23
- package/dist/component/switch/switch.js +80 -81
- package/dist/component/table/table.d.ts +51 -51
- package/dist/component/table/table.js +119 -119
- package/dist/component/tag/tag.d.ts +17 -17
- package/dist/component/tag/tag.js +39 -39
- package/dist/component/text/text.d.ts +16 -16
- package/dist/component/text/text.js +51 -51
- package/dist/component/text-area/text-area.d.ts +28 -28
- package/dist/component/text-area/text-area.js +83 -73
- package/dist/component/text-field/text-field.d.ts +33 -33
- package/dist/component/text-field/text-field.js +107 -97
- package/dist/component/toast-noti/toast-noti.d.ts +5 -5
- package/dist/component/toast-noti/toast-noti.js +28 -28
- package/dist/component/wini-icon/winicon.d.ts +16 -16
- package/dist/component/wini-icon/winicon.js +121 -112
- package/dist/form/login/view.d.ts +40 -40
- package/dist/form/login/view.js +66 -65
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.js +125 -0
- package/dist/index.d.ts +32 -31
- package/dist/index.js +1 -1
- package/dist/language/i18n.d.ts +2 -0
- package/dist/language/i18n.js +125 -0
- package/package.json +5 -3
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import './slider.css';
|
|
3
|
-
interface SliderProps {
|
|
4
|
-
id?: string;
|
|
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 {};
|
|
1
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import './slider.css';
|
|
3
|
+
interface SliderProps {
|
|
4
|
+
id?: string;
|
|
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 {};
|
|
@@ -1,81 +1,80 @@
|
|
|
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("./slider.css");
|
|
25
|
-
var winicon_1 = require("../wini-icon/winicon");
|
|
26
|
-
var CustomSlider = /** @class */ (function (_super) {
|
|
27
|
-
__extends(CustomSlider, _super);
|
|
28
|
-
function CustomSlider(props) {
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
_this =
|
|
32
|
-
|
|
33
|
-
var _a
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _a
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
_this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var _a
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_this.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exports.CustomSlider = CustomSlider;
|
|
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("./slider.css");
|
|
25
|
+
var winicon_1 = require("../wini-icon/winicon");
|
|
26
|
+
var CustomSlider = /** @class */ (function (_super) {
|
|
27
|
+
__extends(CustomSlider, _super);
|
|
28
|
+
function CustomSlider(props) {
|
|
29
|
+
var _a;
|
|
30
|
+
var _this = _super.call(this, props) || this;
|
|
31
|
+
_this.nextPage = function () {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
var index = (_b = (_a = _this.state) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 0;
|
|
34
|
+
if (((_c = _this.props) === null || _c === void 0 ? void 0 : _c.children) && (index + 1) < _this.props.children.length) {
|
|
35
|
+
_this.setState({ page: index + 1 });
|
|
36
|
+
if (_this.props.onChage)
|
|
37
|
+
_this.props.onChage(index + 1);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
_this.previousPage = function () {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
var index = (_b = (_a = _this.state) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 0;
|
|
43
|
+
if (((_c = _this.props) === null || _c === void 0 ? void 0 : _c.children) && index > 0) {
|
|
44
|
+
_this.setState({ page: index - 1 });
|
|
45
|
+
if (_this.props.onChage)
|
|
46
|
+
_this.props.onChage(index - 1);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
_this.autoPlay = function () {
|
|
50
|
+
var _a, _b, _c;
|
|
51
|
+
var index = (_b = (_a = _this.state) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 0;
|
|
52
|
+
if (((_c = _this.props) === null || _c === void 0 ? void 0 : _c.children) && (index + 1) === _this.props.children.length)
|
|
53
|
+
index = -1;
|
|
54
|
+
_this.setState({ page: index + 1 });
|
|
55
|
+
if (_this.props.onChage)
|
|
56
|
+
_this.props.onChage(index + 1);
|
|
57
|
+
};
|
|
58
|
+
(_a = props.buttons) !== null && _a !== void 0 ? _a : (props.buttons = true);
|
|
59
|
+
_this.state = {
|
|
60
|
+
page: 0
|
|
61
|
+
};
|
|
62
|
+
_this.autoPlay = _this.autoPlay.bind(_this);
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
CustomSlider.prototype.componentDidMount = function () {
|
|
66
|
+
var _a;
|
|
67
|
+
if (this.props.autoPlay)
|
|
68
|
+
this.intervalPlay = setInterval(this.autoPlay, (_a = this.props.duration) !== null && _a !== void 0 ? _a : 2000);
|
|
69
|
+
};
|
|
70
|
+
CustomSlider.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
71
|
+
if (this.props.autoPlay !== prevProps.autoPlay && !this.props.autoPlay)
|
|
72
|
+
clearInterval(this.intervalPlay);
|
|
73
|
+
};
|
|
74
|
+
CustomSlider.prototype.render = function () {
|
|
75
|
+
var _a, _b, _c, _d, _e, _f;
|
|
76
|
+
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(winicon_1.Winicon, { src: "fill/arrows/circle-ctrl-left", size: "2.4rem", color: (_d = this.props.iconColor) !== null && _d !== void 0 ? _d : "var(--neutral-absolute-background-color)" }), buttonContentRight: (_e = this.props.nextButton) !== null && _e !== void 0 ? _e : react_1.default.createElement(winicon_1.Winicon, { src: "fill/arrows/circle-ctrl-right", size: "2.4rem", color: (_f = this.props.iconColor) !== null && _f !== void 0 ? _f : "var(--neutral-absolute-background-color)" }) }, this.props.children);
|
|
77
|
+
};
|
|
78
|
+
return CustomSlider;
|
|
79
|
+
}(react_1.default.Component));
|
|
80
|
+
exports.CustomSlider = CustomSlider;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
interface SwitchProps {
|
|
3
|
-
id?: string;
|
|
4
|
-
onChange?: (value: boolean) => void;
|
|
5
|
-
value?: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
style?: CSSProperties;
|
|
9
|
-
size?: number | string;
|
|
10
|
-
dotColor?: string;
|
|
11
|
-
onBackground?: string;
|
|
12
|
-
offBackground?: string;
|
|
13
|
-
name?: 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 {};
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
interface SwitchProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
onChange?: (value: boolean) => void;
|
|
5
|
+
value?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
size?: number | string;
|
|
10
|
+
dotColor?: string;
|
|
11
|
+
onBackground?: string;
|
|
12
|
+
offBackground?: string;
|
|
13
|
+
name?: 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 {};
|
|
@@ -1,81 +1,80 @@
|
|
|
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
|
-
var switch_module_css_1 = __importDefault(require("./switch.module.css"));
|
|
35
|
-
var Switch = /** @class */ (function (_super) {
|
|
36
|
-
__extends(Switch, _super);
|
|
37
|
-
function Switch() {
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
_this =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
'--
|
|
56
|
-
'--
|
|
57
|
-
'--
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
delete this.props.style.
|
|
63
|
-
delete this.props.style.
|
|
64
|
-
delete this.props.style.
|
|
65
|
-
delete this.props.style.
|
|
66
|
-
delete this.props.style.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
_this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exports.Switch = Switch;
|
|
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
|
+
var switch_module_css_1 = __importDefault(require("./switch.module.css"));
|
|
35
|
+
var Switch = /** @class */ (function (_super) {
|
|
36
|
+
__extends(Switch, _super);
|
|
37
|
+
function Switch() {
|
|
38
|
+
var _a;
|
|
39
|
+
var _this = _super.apply(this, arguments) || this;
|
|
40
|
+
_this.state = {
|
|
41
|
+
value: (_a = _this.props.value) !== null && _a !== void 0 ? _a : false
|
|
42
|
+
};
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
Switch.prototype.componentDidUpdate = function (prevProps) {
|
|
46
|
+
if (prevProps.value !== this.props.value) {
|
|
47
|
+
this.setState({ value: this.props.value });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
Switch.prototype.render = function () {
|
|
51
|
+
var _this = this;
|
|
52
|
+
var _a, _b, _c, _d, _e;
|
|
53
|
+
var propStyle = {
|
|
54
|
+
'--off-bg': (_a = this.props.offBackground) !== null && _a !== void 0 ? _a : 'var(--neutral-main-background-color)',
|
|
55
|
+
'--on-bg': (_b = this.props.onBackground) !== null && _b !== void 0 ? _b : 'var(--primary-main-color)',
|
|
56
|
+
'--dot-color': (_c = this.props.dotColor) !== null && _c !== void 0 ? _c : '#ffffff',
|
|
57
|
+
'--size': this.props.size ? (typeof this.props.size === 'number') ? "".concat(this.props.size, "px") : this.props.size : '2rem'
|
|
58
|
+
};
|
|
59
|
+
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);
|
|
60
|
+
if (this.props.style) {
|
|
61
|
+
delete this.props.style.width;
|
|
62
|
+
delete this.props.style.minWidth;
|
|
63
|
+
delete this.props.style.maxWidth;
|
|
64
|
+
delete this.props.style.height;
|
|
65
|
+
delete this.props.style.minHeight;
|
|
66
|
+
delete this.props.style.maxHeight;
|
|
67
|
+
convertStyle = __assign(__assign({}, this.props.style), convertStyle);
|
|
68
|
+
}
|
|
69
|
+
return react_1.default.createElement("label", { id: this.props.id, className: "".concat(switch_module_css_1.default['switch-container'], " row ").concat((_e = this.props.className) !== null && _e !== void 0 ? _e : ''), style: convertStyle },
|
|
70
|
+
react_1.default.createElement("input", { type: "checkbox", checked: this.state.value, name: this.props.name, disabled: this.props.disabled, onChange: function () {
|
|
71
|
+
var newValue = !_this.state.value;
|
|
72
|
+
_this.setState({ value: newValue });
|
|
73
|
+
if (_this.props.onChange)
|
|
74
|
+
_this.props.onChange(newValue);
|
|
75
|
+
} }),
|
|
76
|
+
react_1.default.createElement("span", { className: switch_module_css_1.default['slider'] }));
|
|
77
|
+
};
|
|
78
|
+
return Switch;
|
|
79
|
+
}(react_1.default.Component));
|
|
80
|
+
exports.Switch = Switch;
|
|
@@ -1,51 +1,51 @@
|
|
|
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
|
-
id?: string;
|
|
10
|
-
fixed?: boolean;
|
|
11
|
-
children?: ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
style?: CSSProperties;
|
|
14
|
-
align?: CellAlignItems | string;
|
|
15
|
-
onClick?: React.MouseEventHandler<HTMLTableDataCellElement>;
|
|
16
|
-
};
|
|
17
|
-
export declare class TbCell extends React.Component<TbCellProps> {
|
|
18
|
-
render(): React.ReactNode;
|
|
19
|
-
}
|
|
20
|
-
interface TbRowProps {
|
|
21
|
-
id?: string;
|
|
22
|
-
children?: Array<TbCell>;
|
|
23
|
-
className?: string;
|
|
24
|
-
style?: CSSProperties;
|
|
25
|
-
onClick?: MouseEventHandler<HTMLTableRowElement>;
|
|
26
|
-
}
|
|
27
|
-
export declare class TbRow extends React.Component<TbRowProps> {
|
|
28
|
-
render(): React.ReactNode;
|
|
29
|
-
}
|
|
30
|
-
export declare class TbHeader extends React.Component<TbRowProps> {
|
|
31
|
-
render(): React.JSX.Element;
|
|
32
|
-
}
|
|
33
|
-
interface TbBodyProps {
|
|
34
|
-
id?: string;
|
|
35
|
-
children?: Array<TbRow>;
|
|
36
|
-
className?: string;
|
|
37
|
-
style?: CSSProperties;
|
|
38
|
-
}
|
|
39
|
-
export declare class TbBody extends React.Component<TbBodyProps> {
|
|
40
|
-
render(): React.ReactNode;
|
|
41
|
-
}
|
|
42
|
-
interface TableProps {
|
|
43
|
-
id?: string;
|
|
44
|
-
children?: Array<TbBody | TbHeader>;
|
|
45
|
-
className?: string;
|
|
46
|
-
style?: CSSProperties;
|
|
47
|
-
}
|
|
48
|
-
export declare class Table extends React.Component<TableProps> {
|
|
49
|
-
render(): React.ReactNode;
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
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
|
+
id?: string;
|
|
10
|
+
fixed?: boolean;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
align?: CellAlignItems | string;
|
|
15
|
+
onClick?: React.MouseEventHandler<HTMLTableDataCellElement>;
|
|
16
|
+
};
|
|
17
|
+
export declare class TbCell extends React.Component<TbCellProps> {
|
|
18
|
+
render(): React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
interface TbRowProps {
|
|
21
|
+
id?: string;
|
|
22
|
+
children?: Array<TbCell>;
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
onClick?: MouseEventHandler<HTMLTableRowElement>;
|
|
26
|
+
}
|
|
27
|
+
export declare class TbRow extends React.Component<TbRowProps> {
|
|
28
|
+
render(): React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare class TbHeader extends React.Component<TbRowProps> {
|
|
31
|
+
render(): React.JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
interface TbBodyProps {
|
|
34
|
+
id?: string;
|
|
35
|
+
children?: Array<TbRow>;
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
}
|
|
39
|
+
export declare class TbBody extends React.Component<TbBodyProps> {
|
|
40
|
+
render(): React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
interface TableProps {
|
|
43
|
+
id?: string;
|
|
44
|
+
children?: Array<TbBody | TbHeader>;
|
|
45
|
+
className?: string;
|
|
46
|
+
style?: CSSProperties;
|
|
47
|
+
}
|
|
48
|
+
export declare class Table extends React.Component<TableProps> {
|
|
49
|
+
render(): React.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
export {};
|