ui-beyable 1.0.0 → 1.0.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 (48) hide show
  1. package/lib/cjs/components/Button/BYbtn.d.ts +6 -0
  2. package/lib/cjs/components/Button/type.d.ts +27 -0
  3. package/lib/cjs/components/Collapse/BYcollapse.d.ts +4 -0
  4. package/lib/cjs/components/Collapse/type.d.ts +5 -0
  5. package/lib/cjs/components/Modal/BYmodal.d.ts +4 -0
  6. package/lib/cjs/components/Modal/types.d.ts +11 -0
  7. package/lib/cjs/components/Portal/BYportal.d.ts +3 -0
  8. package/lib/cjs/components/Portal/type.d.ts +6 -0
  9. package/lib/cjs/esm/components/BYbtn.d.ts +6 -0
  10. package/lib/cjs/esm/components/Button/BYbtn.d.ts +6 -0
  11. package/lib/cjs/esm/components/Button/type.d.ts +27 -0
  12. package/lib/cjs/esm/components/Button.d.ts +7 -0
  13. package/lib/cjs/esm/components/Collapse/BYcollapse.d.ts +4 -0
  14. package/lib/cjs/esm/components/Collapse/type.d.ts +5 -0
  15. package/lib/cjs/esm/components/Modal/BYmodal.d.ts +4 -0
  16. package/lib/cjs/esm/components/Modal/types.d.ts +11 -0
  17. package/lib/cjs/esm/components/Portal/BYportal.d.ts +3 -0
  18. package/lib/cjs/esm/components/Portal/type.d.ts +6 -0
  19. package/lib/cjs/esm/components/type.d.ts +27 -0
  20. package/lib/cjs/esm/index.d.ts +60 -0
  21. package/lib/cjs/index.css +36 -0
  22. package/lib/cjs/index.css.map +1 -0
  23. package/lib/cjs/index.d.ts +60 -0
  24. package/lib/cjs/index.js +170 -0
  25. package/lib/cjs/index.js.map +1 -0
  26. package/lib/esm/components/BYbtn.d.ts +6 -0
  27. package/lib/esm/components/Button/BYbtn.d.ts +6 -0
  28. package/lib/esm/components/Button/type.d.ts +27 -0
  29. package/lib/esm/components/Button.d.ts +7 -0
  30. package/lib/esm/components/Collapse/BYcollapse.d.ts +4 -0
  31. package/lib/esm/components/Collapse/type.d.ts +5 -0
  32. package/lib/esm/components/Modal/BYmodal.d.ts +4 -0
  33. package/lib/esm/components/Modal/types.d.ts +11 -0
  34. package/lib/esm/components/Portal/BYportal.d.ts +3 -0
  35. package/lib/esm/components/Portal/type.d.ts +6 -0
  36. package/lib/esm/components/type.d.ts +27 -0
  37. package/lib/esm/index.css +36 -0
  38. package/lib/esm/index.css.map +1 -0
  39. package/lib/esm/index.d.ts +60 -0
  40. package/lib/esm/index.js +165 -0
  41. package/lib/esm/index.js.map +1 -0
  42. package/lib/index.d.ts +51 -0
  43. package/package.json +35 -15
  44. package/src/components/Button.css +0 -3
  45. package/src/components/Button.js +0 -8
  46. package/src/components/Button.tsx +0 -18
  47. package/src/components/ByBtn.js +0 -7
  48. package/src/components/ByBtn.tsx +0 -11
@@ -0,0 +1,60 @@
1
+ import BYBtn from './components/Button/BYbtn';
2
+ import BYmodal from './components/Modal/BYmodal';
3
+ import ByPortal from './components/Portal/BYportal';
4
+ import BYcollapse from './components/Collapse/BYcollapse';
5
+ import "./style/globalStyle.css";
6
+ import "./style/params.css";
7
+ import "./style/animate.css";
8
+ import "./style/bootstrap-overrides.css";
9
+ import "./style/bootstrap/css/bootstrap_framework.css";
10
+ import "./style/btn.css";
11
+ import "./style/c3.min.css";
12
+ import "./style/checkbox.css";
13
+ import "./style/colorpicker.css";
14
+ import "./style/custom-antd.css";
15
+ import "./style/customInput.css";
16
+ import "./style/datepicker.css";
17
+ import "./style/datepickerrange.min.css";
18
+ import "./style/empty.css";
19
+ import "./style/field.css";
20
+ import "./style/flex.css";
21
+ import "./style/fonts.css";
22
+ import "./style/form.css";
23
+ import "./style/gridstack.min.css";
24
+ import "./style/Header.css";
25
+ import "./style/icofont.min.css";
26
+ import "./style/icon.css";
27
+ import "./style/Informations.css";
28
+ import "./style/insights.css";
29
+ import "./style/jqCron.css";
30
+ import "./style/listbox.css";
31
+ import "./style/modal.css";
32
+ import "./style/navigation.css";
33
+ import "./style/notifications.css";
34
+ import "./style/orchestration.css";
35
+ import "./style/page.css";
36
+ import "./style/panel.css";
37
+ import "./style/place_autocomplete.css";
38
+ import "./style/react-cron.css";
39
+ import "./style/react-table.css";
40
+ import "./style/reset.css";
41
+ import "./style/scroll.css";
42
+ import "./style/section.css";
43
+ import "./style/setup.css";
44
+ import "./style/shepherd.css";
45
+ import "./style/simplegrid.css";
46
+ import "./style/spinner.css";
47
+ import "./style/stats.css";
48
+ import "./style/style.css";
49
+ import "./style/SideBar.css";
50
+ import "./style/table.css";
51
+ import "./style/tabs.css";
52
+ import "./style/thumb_list.css";
53
+ import "./style/tippy.css";
54
+ import "./style/traffic-overview.css";
55
+ import "./style/utils.css";
56
+ import "./style/var.css";
57
+ import "./style/variation.css";
58
+ import "./style/wheel.css";
59
+ import "./style/wishlists.css";
60
+ export { BYBtn, BYmodal, ByPortal, BYcollapse };
@@ -0,0 +1,170 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var ReactDOM = require('react-dom');
5
+
6
+ var Btn = function (_a) {
7
+ var children = _a.children, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.htmlTag, htmlTag = _c === void 0 ? "button" : _c, onClickFunction = _a.onClickFunction, onClick = _a.onClick, _d = _a.href, href = _d === void 0 ? '' : _d, _e = _a.target, target = _e === void 0 ? '' : _e, _f = _a.message, message = _f === void 0 ? '' : _f, _g = _a.color, color = _g === void 0 ? 'primary' : _g, _h = _a.style, style = _h === void 0 ? '' : _h, _j = _a.rounded, rounded = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, _l = _a.className, className = _l === void 0 ? '' : _l, _m = _a.strong, strong = _m === void 0 ? false : _m, _o = _a.light, light = _o === void 0 ? false : _o, _p = _a.size, size = _p === void 0 ? "" : _p, _q = _a.fontSize, fontSize = _q === void 0 ? '' : _q, _r = _a.fullWidth, fullWidth = _r === void 0 ? false : _r, _s = _a.fullHeight, fullHeight = _s === void 0 ? false : _s, icon = _a.icon, _t = _a.iconPosition, iconPosition = _t === void 0 ? 'before' : _t, _u = _a.arrow, arrow = _u === void 0 ? false : _u, dataFor = _a.dataFor, dataTip = _a.dataTip;
8
+ var click = function (ev) {
9
+ if (typeof onClickFunction === 'function') {
10
+ onClickFunction(ev);
11
+ }
12
+ if (typeof onClick === 'function') {
13
+ onClick(ev);
14
+ }
15
+ };
16
+ var cssClass = ['btnUi'];
17
+ if (className) {
18
+ cssClass = cssClass.concat(className);
19
+ }
20
+ // Style and Color
21
+ var styleClass = 'btn';
22
+ if (style === 'outline' || style === 'ghost') {
23
+ styleClass += '_' + style;
24
+ }
25
+ styleClass += '_' + color;
26
+ cssClass.push(styleClass);
27
+ // Rounded
28
+ if (rounded) {
29
+ cssClass.push('btn_rounded');
30
+ }
31
+ // Disabled
32
+ if (disabled) {
33
+ cssClass.push('btn_disabled');
34
+ }
35
+ // Strong
36
+ if (strong) {
37
+ cssClass.push('btn_strong');
38
+ }
39
+ // Light
40
+ if (light) {
41
+ cssClass.push('btn_light');
42
+ }
43
+ // Arrow
44
+ if (arrow) {
45
+ cssClass.push('has_arrow');
46
+ }
47
+ // Size : xs, s, default, l, xl, xxl
48
+ if (size) {
49
+ cssClass.push('btn_' + size);
50
+ }
51
+ // Font size : s
52
+ if (fontSize) {
53
+ cssClass.push('btn_fs_' + fontSize);
54
+ }
55
+ // Icon
56
+ if (icon) {
57
+ cssClass.push('has_icon');
58
+ }
59
+ // Full width
60
+ if (fullWidth) {
61
+ cssClass.push('w_full');
62
+ }
63
+ // Full height
64
+ if (fullHeight) {
65
+ cssClass.push('h_full');
66
+ }
67
+ // Type
68
+ if (href) {
69
+ htmlTag = "a";
70
+ }
71
+ return (React.createElement("div", { className: "BYUI" },
72
+ htmlTag == 'button' &&
73
+ React.createElement("button", { type: type, className: cssClass.join(' '), onClick: function (e) { return click(e); }, "data-for": dataFor, "data-tip": dataTip },
74
+ icon && iconPosition !== 'after' &&
75
+ icon,
76
+ message &&
77
+ React.createElement("span", { className: "btn_txt" }, message),
78
+ children &&
79
+ React.createElement("span", { className: "btn_txt" }, children),
80
+ icon && iconPosition === 'after' &&
81
+ icon),
82
+ htmlTag == 'a' &&
83
+ React.createElement("a", { className: cssClass.join(' '), onClick: function (e) { return click(e); }, target: target, href: href, "data-for": dataFor, "data-tip": dataTip },
84
+ icon && iconPosition !== 'after' &&
85
+ icon,
86
+ message &&
87
+ React.createElement("span", { className: "btn_txt" }, message),
88
+ children &&
89
+ React.createElement("span", { className: "btn_txt" }, children),
90
+ icon && iconPosition === 'after' &&
91
+ icon)));
92
+ };
93
+ var BYbtn = React.memo(Btn);
94
+
95
+ function Portal(_a) {
96
+ var _b = _a.target, target = _b === void 0 ? document.body : _b, children = _a.children;
97
+ return ReactDOM.createPortal(children, target);
98
+ }
99
+
100
+ function Modal(_a) {
101
+ var children = _a.children, _b = _a.isOpen, isOpen = _b === void 0 ? false : _b, onClose = _a.onClose, _c = _a.noClose, noClose = _c === void 0 ? false : _c, width = _a.width, height = _a.height, minHeight = _a.minHeight;
102
+ var style = { width: '', height: '', minHeight: '' };
103
+ var hide = function (ev) {
104
+ if (typeof onClose === 'function') {
105
+ onClose(ev);
106
+ }
107
+ };
108
+ if (width) {
109
+ style.width = width + 'px';
110
+ }
111
+ if (height) {
112
+ style.height = height + 'px';
113
+ }
114
+ if (minHeight) {
115
+ style.minHeight = 'min(100%, ' + minHeight + 'px)';
116
+ }
117
+ if (!isOpen)
118
+ return React.createElement(React.Fragment, null);
119
+ return (React.createElement(Portal, null,
120
+ React.createElement("div", { className: "modal_outer section_root", tabIndex: -1 },
121
+ React.createElement("div", { className: "modal_inner", style: style },
122
+ !noClose &&
123
+ React.createElement("a", { onClick: function (ev) { return hide(ev); }, className: "modal_close" }),
124
+ children))));
125
+ }
126
+
127
+ var styles = {"wrapper_common":"collapse-module_wrapper_common__OhNXa","wrapper_close":"collapse-module_wrapper_close__pPihr","wrapper_open":"collapse-module_wrapper_open__-Pauk","header":"collapse-module_header__3XouW","header_btn":"collapse-module_header_btn__WqgSX","arrow":"collapse-module_arrow__m09w4","fas":"collapse-module_fas__KttZB","body":"collapse-module_body__n-AEV","wrapperCommon":"collapse-module_wrapper_common__OhNXa","wrapperClose":"collapse-module_wrapper_close__pPihr","wrapperOpen":"collapse-module_wrapper_open__-Pauk","headerBtn":"collapse-module_header_btn__WqgSX"};
128
+
129
+ console.log('🚀--** ~ file: BYcollapse.tsx:2 ~ React:', React);
130
+ function Collapse(_a) {
131
+ var label = _a.label, children = _a.children, _b = _a.defaultOpen, defaultOpen = _b === void 0 ? false : _b;
132
+ var _c = React.useState(true), isOpen = _c[0], setIsOpen = _c[1];
133
+ var bodyRef = React.useRef(null);
134
+ var toggle = function () {
135
+ if (!bodyRef.current)
136
+ return;
137
+ var delay = isOpen ? 0 : 300;
138
+ //@ts-ignore
139
+ var height = bodyRef.current.scrollHeight;
140
+ //@ts-ignore
141
+ bodyRef.current.style.height = height + 'px';
142
+ //@ts-ignore
143
+ bodyRef.current.style.overflow = 'hidden';
144
+ setTimeout(function () {
145
+ //@ts-ignore
146
+ bodyRef.current.style.height = '';
147
+ //@ts-ignore
148
+ bodyRef.current.style.overflow = '';
149
+ }, delay);
150
+ setIsOpen(!isOpen);
151
+ };
152
+ React.useEffect(function () {
153
+ if (defaultOpen && defaultOpen !== isOpen) {
154
+ setIsOpen(defaultOpen);
155
+ }
156
+ }, [defaultOpen]);
157
+ return (React.createElement("div", { className: isOpen ? styles.wrapper_open : styles.wrapper_close },
158
+ React.createElement("div", { className: styles.header },
159
+ React.createElement("div", { className: styles.header_btn, onClick: function () { return toggle(); } },
160
+ React.createElement("span", { className: styles.arrow },
161
+ React.createElement("i", { className: "fas fa-sm fa-chevron-down", style: { 'display': 'block' } })),
162
+ label)),
163
+ React.createElement("div", { className: styles.body, ref: bodyRef }, children)));
164
+ }
165
+
166
+ exports.BYBtn = BYbtn;
167
+ exports.BYcollapse = Collapse;
168
+ exports.BYmodal = Modal;
169
+ exports.ByPortal = Portal;
170
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { IBYbtn } from './type';
3
+ declare const Btn: ({ children, type, htmlTag, onClickFunction, onClick, href, target, message, color, style, rounded, disabled, className, strong, light, size, fontSize, fullWidth, fullHeight, icon, iconPosition, arrow, dataFor, dataTip }: IBYbtn) => React.JSX.Element;
4
+ export { Btn };
5
+ declare const BYbtn: React.MemoExoticComponent<({ children, type, htmlTag, onClickFunction, onClick, href, target, message, color, style, rounded, disabled, className, strong, light, size, fontSize, fullWidth, fullHeight, icon, iconPosition, arrow, dataFor, dataTip }: IBYbtn) => React.JSX.Element>;
6
+ export default BYbtn;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { IBYbtn } from './type';
3
+ declare const Btn: ({ children, type, htmlTag, onClickFunction, onClick, href, target, message, color, style, rounded, disabled, className, strong, light, size, fontSize, fullWidth, fullHeight, icon, iconPosition, arrow, dataFor, dataTip }: IBYbtn) => JSX.Element;
4
+ export { Btn };
5
+ declare const BYbtn: React.MemoExoticComponent<({ children, type, htmlTag, onClickFunction, onClick, href, target, message, color, style, rounded, disabled, className, strong, light, size, fontSize, fullWidth, fullHeight, icon, iconPosition, arrow, dataFor, dataTip }: IBYbtn) => JSX.Element>;
6
+ export default BYbtn;
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ export interface IBYbtn {
3
+ children?: React.ReactNode;
4
+ type?: "button" | "submit" | "reset";
5
+ htmlTag?: 'button' | 'a';
6
+ onClickFunction?: (e: React.MouseEvent) => any;
7
+ onClick?: (e: React.MouseEvent) => any;
8
+ href?: string;
9
+ target?: string;
10
+ message?: string;
11
+ color?: string;
12
+ style?: string;
13
+ rounded?: boolean;
14
+ disabled?: boolean;
15
+ className?: string;
16
+ strong?: boolean;
17
+ light?: boolean;
18
+ size?: "" | "xxs" | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
19
+ fontSize?: string;
20
+ fullWidth?: boolean;
21
+ fullHeight?: boolean;
22
+ icon?: any;
23
+ iconPosition?: 'before' | 'after';
24
+ arrow?: boolean | "true" | "false";
25
+ dataFor?: string;
26
+ dataTip?: string;
27
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface IButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
3
+ backgroundColor?: string;
4
+ color?: string;
5
+ }
6
+ declare const Button: React.FunctionComponent<IButtonProps>;
7
+ export default Button;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IBYcollapse } from './type';
3
+ declare function Collapse({ label, children, defaultOpen }: IBYcollapse): JSX.Element;
4
+ export default Collapse;
@@ -0,0 +1,5 @@
1
+ export interface IBYcollapse {
2
+ label?: string;
3
+ children?: any;
4
+ defaultOpen?: boolean;
5
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IBYmodal } from './types';
3
+ declare function Modal({ children, isOpen, onClose, noClose, width, height, minHeight }: IBYmodal): JSX.Element;
4
+ export default Modal;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ interface IBYmodal {
3
+ children: React.ReactNode;
4
+ isOpen: boolean;
5
+ onClose?: (e: any) => any;
6
+ noClose?: boolean;
7
+ width?: string;
8
+ height?: string;
9
+ minHeight?: string;
10
+ }
11
+ export type { IBYmodal };
@@ -0,0 +1,3 @@
1
+ import { IBYportal } from './type';
2
+ declare function Portal({ target, children }: IBYportal): any;
3
+ export default Portal;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface IBYportal {
3
+ target?: any;
4
+ children: React.ReactNode;
5
+ }
6
+ export type { IBYportal };
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ export interface IBYbtn {
3
+ children?: React.ReactNode;
4
+ type?: "button" | "submit" | "reset";
5
+ htmlTag?: 'button' | 'a';
6
+ onClickFunction?: (e: React.MouseEvent) => any;
7
+ onClick?: (e: React.MouseEvent) => any;
8
+ href?: string;
9
+ target?: string;
10
+ message?: string;
11
+ color?: string;
12
+ style?: string;
13
+ rounded?: boolean;
14
+ disabled?: boolean;
15
+ className?: string;
16
+ strong?: boolean;
17
+ light?: boolean;
18
+ size?: "" | "xxs" | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
19
+ fontSize?: string;
20
+ fullWidth?: boolean;
21
+ fullHeight?: boolean;
22
+ icon?: any;
23
+ iconPosition?: 'before' | 'after';
24
+ arrow?: boolean | "true" | "false";
25
+ dataFor?: string;
26
+ dataTip?: string;
27
+ }