@codeleap/web 2.0.1 → 2.3.12
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/components/ActivityIndicator/index.d.ts +12 -12
- package/dist/components/ActivityIndicator/index.js +60 -60
- package/dist/components/ActivityIndicator/styles.d.ts +53 -53
- package/dist/components/ActivityIndicator/styles.js +21 -21
- package/dist/components/Button.d.ts +18 -18
- package/dist/components/Button.js +66 -66
- package/dist/components/CenterWrapper.d.ts +7 -7
- package/dist/components/CenterWrapper.js +27 -27
- package/dist/components/Checkbox/index.d.ts +12 -12
- package/dist/components/Checkbox/index.js +61 -61
- package/dist/components/Checkbox/styles.d.ts +53 -53
- package/dist/components/Checkbox/styles.js +63 -63
- package/dist/components/Collapse.d.ts +20 -20
- package/dist/components/Collapse.js +67 -67
- package/dist/components/ContentView.d.ts +10 -10
- package/dist/components/ContentView.js +51 -51
- package/dist/components/Drawer.d.ts +23 -23
- package/dist/components/Drawer.js +72 -72
- package/dist/components/FileInput.d.ts +8 -8
- package/dist/components/FileInput.js +72 -72
- package/dist/components/HorizontalScroll.d.ts +3 -3
- package/dist/components/HorizontalScroll.js +41 -41
- package/dist/components/Icon.d.ts +8 -8
- package/dist/components/Icon.js +54 -54
- package/dist/components/Link.d.ts +7 -7
- package/dist/components/Link.js +62 -62
- package/dist/components/List.d.ts +18 -18
- package/dist/components/List.js +51 -51
- package/dist/components/Modal/index.d.ts +21 -21
- package/dist/components/Modal/index.js +119 -119
- package/dist/components/Modal/styles.d.ts +56 -56
- package/dist/components/Modal/styles.js +35 -35
- package/dist/components/Overlay.d.ts +10 -10
- package/dist/components/Overlay.js +40 -40
- package/dist/components/RadioInput/index.d.ts +21 -21
- package/dist/components/RadioInput/index.js +54 -54
- package/dist/components/RadioInput/styles.d.ts +54 -54
- package/dist/components/RadioInput/styles.js +43 -43
- package/dist/components/RouterPage/Menu.d.ts +10 -10
- package/dist/components/RouterPage/Menu.js +35 -35
- package/dist/components/RouterPage/MenuItem.d.ts +12 -12
- package/dist/components/RouterPage/MenuItem.js +41 -41
- package/dist/components/RouterPage/Router.d.ts +8 -8
- package/dist/components/RouterPage/Router.js +26 -26
- package/dist/components/RouterPage/index.d.ts +29 -29
- package/dist/components/RouterPage/index.js +88 -88
- package/dist/components/RouterPage/styles.d.ts +54 -54
- package/dist/components/RouterPage/styles.js +86 -86
- package/dist/components/Scroll.d.ts +5 -5
- package/dist/components/Scroll.js +23 -23
- package/dist/components/Select/Custom.d.ts +8 -8
- package/dist/components/Select/Custom.js +103 -103
- package/dist/components/Select/Multi.d.ts +3 -3
- package/dist/components/Select/Multi.js +104 -104
- package/dist/components/Select/Native.d.ts +17 -17
- package/dist/components/Select/Native.js +43 -43
- package/dist/components/Select/index.d.ts +12 -12
- package/dist/components/Select/index.js +43 -43
- package/dist/components/Select/styles.d.ts +5 -5
- package/dist/components/Select/styles.js +56 -56
- package/dist/components/Select/types.d.ts +49 -49
- package/dist/components/Select/types.js +2 -2
- package/dist/components/Slider.d.ts +5 -5
- package/dist/components/Slider.js +35 -35
- package/dist/components/Text.d.ts +9 -9
- package/dist/components/Text.js +40 -40
- package/dist/components/TextInput.d.ts +150 -150
- package/dist/components/TextInput.js +124 -124
- package/dist/components/Tooltip.d.ts +12 -12
- package/dist/components/Tooltip.js +121 -121
- package/dist/components/Touchable.d.ts +15 -15
- package/dist/components/Touchable.js +51 -51
- package/dist/components/View.d.ts +10 -10
- package/dist/components/View.js +61 -61
- package/dist/components/index.d.ts +24 -24
- package/dist/components/index.js +40 -40
- package/dist/index.d.ts +6 -6
- package/dist/index.js +28 -28
- package/dist/lib/OSAlert.d.ts +21 -21
- package/dist/lib/OSAlert.js +139 -139
- package/dist/lib/Toast.d.ts +13 -13
- package/dist/lib/Toast.js +31 -31
- package/dist/lib/hooks.d.ts +28 -28
- package/dist/lib/hooks.js +182 -182
- package/dist/lib/logger.d.ts +2 -2
- package/dist/lib/logger.js +15 -15
- package/dist/lib/utils/cookies.d.ts +6 -6
- package/dist/lib/utils/cookies.js +14 -14
- package/dist/lib/utils/index.d.ts +4 -4
- package/dist/lib/utils/index.js +26 -26
- package/dist/lib/utils/pollyfils/scroll.d.ts +1 -1
- package/dist/lib/utils/pollyfils/scroll.js +65 -65
- package/dist/lib/utils/stopPropagation.d.ts +1 -1
- package/dist/lib/utils/stopPropagation.js +19 -19
- package/dist/types/utility.d.ts +2 -2
- package/dist/types/utility.js +2 -2
- package/package.json +47 -47
package/dist/lib/OSAlert.js
CHANGED
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.CreateOSAlert = void 0;
|
|
18
|
-
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
-
var common_1 = require("@codeleap/common");
|
|
20
|
-
var components_1 = require("../components");
|
|
21
|
-
var react_dom_1 = __importDefault(require("react-dom"));
|
|
22
|
-
function RenderModal(props) {
|
|
23
|
-
var _a = (0, common_1.useBooleanToggle)(false), visible = _a[0], toggle = _a[1];
|
|
24
|
-
var previousVisible = (0, common_1.usePrevious)(visible);
|
|
25
|
-
var _b = props.args, title = _b.title, body = _b.body, _c = _b.options, options = _c === void 0 ? [] : _c;
|
|
26
|
-
(0, common_1.onMount)(function () {
|
|
27
|
-
toggle();
|
|
28
|
-
});
|
|
29
|
-
(0, common_1.onUpdate)(function () {
|
|
30
|
-
if (!visible && previousVisible) {
|
|
31
|
-
setTimeout(props.removeSelf, 1000);
|
|
32
|
-
}
|
|
33
|
-
}, [visible]);
|
|
34
|
-
return (0, jsx_runtime_1.jsx)(common_1.StyleProvider, __assign({}, props.contextProps, { children: (0, jsx_runtime_1.jsx)(components_1.Modal, __assign({ visible: visible, toggle: toggle, title: title, showClose: false, closable: false, variants: ['OSAlert'], footer: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: options.map(function (o, idx) { return (0, jsx_runtime_1.jsx)(components_1.Button, __assign({}, o, { onPress: function () {
|
|
35
|
-
var _a;
|
|
36
|
-
(_a = o.onPress) === null || _a === void 0 ? void 0 : _a.call(o);
|
|
37
|
-
toggle();
|
|
38
|
-
} }), idx); }) }) }, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { text: body || '', variants: ['OSAlertBody'] }) })) }));
|
|
39
|
-
}
|
|
40
|
-
var MODAL_ID = '__CODELEAP_MODAL__';
|
|
41
|
-
function OSAlert(props) {
|
|
42
|
-
if (!document)
|
|
43
|
-
return;
|
|
44
|
-
var modalDiv = document.getElementById(MODAL_ID);
|
|
45
|
-
var remove = function () {
|
|
46
|
-
react_dom_1.default.unmountComponentAtNode(modalDiv);
|
|
47
|
-
};
|
|
48
|
-
if (!modalDiv) {
|
|
49
|
-
modalDiv = document.createElement('div');
|
|
50
|
-
modalDiv.setAttribute('id', MODAL_ID);
|
|
51
|
-
document.body.appendChild(modalDiv);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
remove();
|
|
55
|
-
}
|
|
56
|
-
react_dom_1.default.render((0, jsx_runtime_1.jsx)(RenderModal, { contextProps: props.context, removeSelf: remove, args: props }), modalDiv);
|
|
57
|
-
}
|
|
58
|
-
function CreateOSAlert(context) {
|
|
59
|
-
function ask(_a) {
|
|
60
|
-
var title = _a.title, body = _a.body, options = _a.options;
|
|
61
|
-
if (!title) {
|
|
62
|
-
title = 'Quick quetion';
|
|
63
|
-
}
|
|
64
|
-
OSAlert({
|
|
65
|
-
context: context,
|
|
66
|
-
title: title,
|
|
67
|
-
body: body,
|
|
68
|
-
options: options,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function OSError(args) {
|
|
72
|
-
var title = args.title, body = args.body;
|
|
73
|
-
if (!title) {
|
|
74
|
-
title = 'Whoops!';
|
|
75
|
-
}
|
|
76
|
-
if (!body) {
|
|
77
|
-
body = 'Something went wrong';
|
|
78
|
-
}
|
|
79
|
-
OSAlert({
|
|
80
|
-
title: title,
|
|
81
|
-
context: context,
|
|
82
|
-
body: body,
|
|
83
|
-
options: [
|
|
84
|
-
{
|
|
85
|
-
text: 'OK',
|
|
86
|
-
onPress: function () {
|
|
87
|
-
var _a;
|
|
88
|
-
(_a = args === null || args === void 0 ? void 0 : args.onDismiss) === null || _a === void 0 ? void 0 : _a.call(args);
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function warn(args) {
|
|
95
|
-
var _a = args.title, title = _a === void 0 ? 'Hang on' : _a, _b = args.body, body = _b === void 0 ? 'Are you sure?' : _b, onAccept = args.onAccept, _c = args.onReject, onReject = _c === void 0 ? function () { return null; } : _c;
|
|
96
|
-
OSAlert({
|
|
97
|
-
context: context,
|
|
98
|
-
title: title,
|
|
99
|
-
body: body,
|
|
100
|
-
options: [
|
|
101
|
-
{
|
|
102
|
-
text: 'Cancel',
|
|
103
|
-
onPress: function () {
|
|
104
|
-
onReject();
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
text: 'OK',
|
|
109
|
-
onPress: function () {
|
|
110
|
-
onAccept === null || onAccept === void 0 ? void 0 : onAccept();
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
function info(args) {
|
|
117
|
-
var _a = args.title, title = _a === void 0 ? 'FYI' : _a, body = args.body, _b = args.onDismiss, onDismiss = _b === void 0 ? function () { return null; } : _b;
|
|
118
|
-
OSAlert({
|
|
119
|
-
context: context,
|
|
120
|
-
title: title,
|
|
121
|
-
body: body,
|
|
122
|
-
options: [
|
|
123
|
-
{
|
|
124
|
-
text: 'OK',
|
|
125
|
-
onPress: function () {
|
|
126
|
-
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
ask: ask,
|
|
134
|
-
warn: warn,
|
|
135
|
-
info: info,
|
|
136
|
-
error: OSError,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
exports.CreateOSAlert = CreateOSAlert;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.CreateOSAlert = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
19
|
+
var common_1 = require("@codeleap/common");
|
|
20
|
+
var components_1 = require("../components");
|
|
21
|
+
var react_dom_1 = __importDefault(require("react-dom"));
|
|
22
|
+
function RenderModal(props) {
|
|
23
|
+
var _a = (0, common_1.useBooleanToggle)(false), visible = _a[0], toggle = _a[1];
|
|
24
|
+
var previousVisible = (0, common_1.usePrevious)(visible);
|
|
25
|
+
var _b = props.args, title = _b.title, body = _b.body, _c = _b.options, options = _c === void 0 ? [] : _c;
|
|
26
|
+
(0, common_1.onMount)(function () {
|
|
27
|
+
toggle();
|
|
28
|
+
});
|
|
29
|
+
(0, common_1.onUpdate)(function () {
|
|
30
|
+
if (!visible && previousVisible) {
|
|
31
|
+
setTimeout(props.removeSelf, 1000);
|
|
32
|
+
}
|
|
33
|
+
}, [visible]);
|
|
34
|
+
return (0, jsx_runtime_1.jsx)(common_1.StyleProvider, __assign({}, props.contextProps, { children: (0, jsx_runtime_1.jsx)(components_1.Modal, __assign({ visible: visible, toggle: toggle, title: title, showClose: false, closable: false, variants: ['OSAlert'], footer: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: options.map(function (o, idx) { return (0, jsx_runtime_1.jsx)(components_1.Button, __assign({}, o, { onPress: function () {
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = o.onPress) === null || _a === void 0 ? void 0 : _a.call(o);
|
|
37
|
+
toggle();
|
|
38
|
+
} }), idx); }) }) }, { children: (0, jsx_runtime_1.jsx)(components_1.Text, { text: body || '', variants: ['OSAlertBody'] }) })) }));
|
|
39
|
+
}
|
|
40
|
+
var MODAL_ID = '__CODELEAP_MODAL__';
|
|
41
|
+
function OSAlert(props) {
|
|
42
|
+
if (!document)
|
|
43
|
+
return;
|
|
44
|
+
var modalDiv = document.getElementById(MODAL_ID);
|
|
45
|
+
var remove = function () {
|
|
46
|
+
react_dom_1.default.unmountComponentAtNode(modalDiv);
|
|
47
|
+
};
|
|
48
|
+
if (!modalDiv) {
|
|
49
|
+
modalDiv = document.createElement('div');
|
|
50
|
+
modalDiv.setAttribute('id', MODAL_ID);
|
|
51
|
+
document.body.appendChild(modalDiv);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
remove();
|
|
55
|
+
}
|
|
56
|
+
react_dom_1.default.render((0, jsx_runtime_1.jsx)(RenderModal, { contextProps: props.context, removeSelf: remove, args: props }), modalDiv);
|
|
57
|
+
}
|
|
58
|
+
function CreateOSAlert(context) {
|
|
59
|
+
function ask(_a) {
|
|
60
|
+
var title = _a.title, body = _a.body, options = _a.options;
|
|
61
|
+
if (!title) {
|
|
62
|
+
title = 'Quick quetion';
|
|
63
|
+
}
|
|
64
|
+
OSAlert({
|
|
65
|
+
context: context,
|
|
66
|
+
title: title,
|
|
67
|
+
body: body,
|
|
68
|
+
options: options,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function OSError(args) {
|
|
72
|
+
var title = args.title, body = args.body;
|
|
73
|
+
if (!title) {
|
|
74
|
+
title = 'Whoops!';
|
|
75
|
+
}
|
|
76
|
+
if (!body) {
|
|
77
|
+
body = 'Something went wrong';
|
|
78
|
+
}
|
|
79
|
+
OSAlert({
|
|
80
|
+
title: title,
|
|
81
|
+
context: context,
|
|
82
|
+
body: body,
|
|
83
|
+
options: [
|
|
84
|
+
{
|
|
85
|
+
text: 'OK',
|
|
86
|
+
onPress: function () {
|
|
87
|
+
var _a;
|
|
88
|
+
(_a = args === null || args === void 0 ? void 0 : args.onDismiss) === null || _a === void 0 ? void 0 : _a.call(args);
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function warn(args) {
|
|
95
|
+
var _a = args.title, title = _a === void 0 ? 'Hang on' : _a, _b = args.body, body = _b === void 0 ? 'Are you sure?' : _b, onAccept = args.onAccept, _c = args.onReject, onReject = _c === void 0 ? function () { return null; } : _c;
|
|
96
|
+
OSAlert({
|
|
97
|
+
context: context,
|
|
98
|
+
title: title,
|
|
99
|
+
body: body,
|
|
100
|
+
options: [
|
|
101
|
+
{
|
|
102
|
+
text: 'Cancel',
|
|
103
|
+
onPress: function () {
|
|
104
|
+
onReject();
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
text: 'OK',
|
|
109
|
+
onPress: function () {
|
|
110
|
+
onAccept === null || onAccept === void 0 ? void 0 : onAccept();
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function info(args) {
|
|
117
|
+
var _a = args.title, title = _a === void 0 ? 'FYI' : _a, body = args.body, _b = args.onDismiss, onDismiss = _b === void 0 ? function () { return null; } : _b;
|
|
118
|
+
OSAlert({
|
|
119
|
+
context: context,
|
|
120
|
+
title: title,
|
|
121
|
+
body: body,
|
|
122
|
+
options: [
|
|
123
|
+
{
|
|
124
|
+
text: 'OK',
|
|
125
|
+
onPress: function () {
|
|
126
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
ask: ask,
|
|
134
|
+
warn: warn,
|
|
135
|
+
info: info,
|
|
136
|
+
error: OSError,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
exports.CreateOSAlert = CreateOSAlert;
|
|
140
140
|
//# sourceMappingURL=OSAlert.js.map
|
package/dist/lib/Toast.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { toast } from 'react-toastify';
|
|
2
|
-
declare type ToastArgs = {
|
|
3
|
-
title: string;
|
|
4
|
-
} & Parameters<typeof toast.info>[1];
|
|
5
|
-
declare function info({ title, ...others }: ToastArgs): void;
|
|
6
|
-
declare function success({ title, ...others }: ToastArgs): void;
|
|
7
|
-
declare function error({ title, ...others }: ToastArgs): void;
|
|
8
|
-
declare const _default: {
|
|
9
|
-
info: typeof info;
|
|
10
|
-
success: typeof success;
|
|
11
|
-
error: typeof error;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
1
|
+
import { toast } from 'react-toastify';
|
|
2
|
+
declare type ToastArgs = {
|
|
3
|
+
title: string;
|
|
4
|
+
} & Parameters<typeof toast.info>[1];
|
|
5
|
+
declare function info({ title, ...others }: ToastArgs): void;
|
|
6
|
+
declare function success({ title, ...others }: ToastArgs): void;
|
|
7
|
+
declare function error({ title, ...others }: ToastArgs): void;
|
|
8
|
+
declare const _default: {
|
|
9
|
+
info: typeof info;
|
|
10
|
+
success: typeof success;
|
|
11
|
+
error: typeof error;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
package/dist/lib/Toast.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
var react_toastify_1 = require("react-toastify");
|
|
15
|
-
function info(_a) {
|
|
16
|
-
var title = _a.title, others = __rest(_a, ["title"]);
|
|
17
|
-
react_toastify_1.toast.info(title, others);
|
|
18
|
-
}
|
|
19
|
-
function success(_a) {
|
|
20
|
-
var title = _a.title, others = __rest(_a, ["title"]);
|
|
21
|
-
react_toastify_1.toast.success(title, others);
|
|
22
|
-
}
|
|
23
|
-
function error(_a) {
|
|
24
|
-
var title = _a.title, others = __rest(_a, ["title"]);
|
|
25
|
-
react_toastify_1.toast.error(title, others);
|
|
26
|
-
}
|
|
27
|
-
exports.default = {
|
|
28
|
-
info: info,
|
|
29
|
-
success: success,
|
|
30
|
-
error: error,
|
|
31
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var react_toastify_1 = require("react-toastify");
|
|
15
|
+
function info(_a) {
|
|
16
|
+
var title = _a.title, others = __rest(_a, ["title"]);
|
|
17
|
+
react_toastify_1.toast.info(title, others);
|
|
18
|
+
}
|
|
19
|
+
function success(_a) {
|
|
20
|
+
var title = _a.title, others = __rest(_a, ["title"]);
|
|
21
|
+
react_toastify_1.toast.success(title, others);
|
|
22
|
+
}
|
|
23
|
+
function error(_a) {
|
|
24
|
+
var title = _a.title, others = __rest(_a, ["title"]);
|
|
25
|
+
react_toastify_1.toast.error(title, others);
|
|
26
|
+
}
|
|
27
|
+
exports.default = {
|
|
28
|
+
info: info,
|
|
29
|
+
success: success,
|
|
30
|
+
error: error,
|
|
31
|
+
};
|
|
32
32
|
//# sourceMappingURL=Toast.js.map
|
package/dist/lib/hooks.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare function useWindowSize(): any[];
|
|
3
|
-
export declare function useClickOutside<T extends HTMLElement = any>(handler: () => void, events?: string[] | null, nodes?: HTMLElement[]): import("react").MutableRefObject<T>;
|
|
4
|
-
export declare function useScrollEffect(effect: (passed: boolean, current: number) => any, breakpoint: number, extraDependencies?: any[]): void;
|
|
5
|
-
export declare const DOTS = "dots";
|
|
6
|
-
export interface PaginationParams {
|
|
7
|
-
/** Page selected on initial render, defaults to 1 */
|
|
8
|
-
initialPage?: number;
|
|
9
|
-
/** Controlled active page number */
|
|
10
|
-
page?: number;
|
|
11
|
-
/** Total amount of pages */
|
|
12
|
-
total: number;
|
|
13
|
-
/** Siblings amount on left/right side of selected page, defaults to 1 */
|
|
14
|
-
siblings?: number;
|
|
15
|
-
/** Amount of elements visible on left/right edges, defaults to 1 */
|
|
16
|
-
boundaries?: number;
|
|
17
|
-
/** Callback fired after change of each page */
|
|
18
|
-
onChange?: (page: number) => void;
|
|
19
|
-
}
|
|
20
|
-
export declare function usePagination({ total, siblings, boundaries, page, initialPage, onChange, }: PaginationParams): {
|
|
21
|
-
range: (number | "dots")[];
|
|
22
|
-
active: number;
|
|
23
|
-
setPage: (pageNumber: number) => void;
|
|
24
|
-
next: () => void;
|
|
25
|
-
previous: () => void;
|
|
26
|
-
first: () => void;
|
|
27
|
-
last: () => void;
|
|
28
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function useWindowSize(): any[];
|
|
3
|
+
export declare function useClickOutside<T extends HTMLElement = any>(handler: () => void, events?: string[] | null, nodes?: HTMLElement[]): import("react").MutableRefObject<T>;
|
|
4
|
+
export declare function useScrollEffect(effect: (passed: boolean, current: number) => any, breakpoint: number, extraDependencies?: any[]): void;
|
|
5
|
+
export declare const DOTS = "dots";
|
|
6
|
+
export interface PaginationParams {
|
|
7
|
+
/** Page selected on initial render, defaults to 1 */
|
|
8
|
+
initialPage?: number;
|
|
9
|
+
/** Controlled active page number */
|
|
10
|
+
page?: number;
|
|
11
|
+
/** Total amount of pages */
|
|
12
|
+
total: number;
|
|
13
|
+
/** Siblings amount on left/right side of selected page, defaults to 1 */
|
|
14
|
+
siblings?: number;
|
|
15
|
+
/** Amount of elements visible on left/right edges, defaults to 1 */
|
|
16
|
+
boundaries?: number;
|
|
17
|
+
/** Callback fired after change of each page */
|
|
18
|
+
onChange?: (page: number) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function usePagination({ total, siblings, boundaries, page, initialPage, onChange, }: PaginationParams): {
|
|
21
|
+
range: (number | "dots")[];
|
|
22
|
+
active: number;
|
|
23
|
+
setPage: (pageNumber: number) => void;
|
|
24
|
+
next: () => void;
|
|
25
|
+
previous: () => void;
|
|
26
|
+
first: () => void;
|
|
27
|
+
last: () => void;
|
|
28
|
+
};
|