@fixefy/fixefy-ui-components 0.3.28 → 0.3.30

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.
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare const FxButtonModalWithComponent: ({ btnType, btnValue, modalData, onClick, disabled, icon, sx, iconSize, }: {
3
+ btnType?: 'text' | 'icon';
4
+ btnValue?: string;
5
+ modalData: any;
6
+ onClick?: any;
7
+ disabled?: boolean;
8
+ icon?: string;
9
+ sx?: any;
10
+ iconSize?: number;
11
+ }) => React.JSX.Element;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxButtonModalWithComponent", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxButtonModalWithComponent;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
+ const _material = require("@mui/material");
14
+ const _FxStyledButton = require("../FxStyledButton");
15
+ function _getRequireWildcardCache(nodeInterop) {
16
+ if (typeof WeakMap !== "function") return null;
17
+ var cacheBabelInterop = new WeakMap();
18
+ var cacheNodeInterop = new WeakMap();
19
+ return (_getRequireWildcardCache = function(nodeInterop) {
20
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
21
+ })(nodeInterop);
22
+ }
23
+ function _interop_require_wildcard(obj, nodeInterop) {
24
+ if (!nodeInterop && obj && obj.__esModule) {
25
+ return obj;
26
+ }
27
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
28
+ return {
29
+ default: obj
30
+ };
31
+ }
32
+ var cache = _getRequireWildcardCache(nodeInterop);
33
+ if (cache && cache.has(obj)) {
34
+ return cache.get(obj);
35
+ }
36
+ var newObj = {
37
+ __proto__: null
38
+ };
39
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
40
+ for(var key in obj){
41
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
42
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
43
+ if (desc && (desc.get || desc.set)) {
44
+ Object.defineProperty(newObj, key, desc);
45
+ } else {
46
+ newObj[key] = obj[key];
47
+ }
48
+ }
49
+ }
50
+ newObj.default = obj;
51
+ if (cache) {
52
+ cache.set(obj, newObj);
53
+ }
54
+ return newObj;
55
+ }
56
+ const FxButtonModalWithComponent = ({ btnType = 'text', btnValue, modalData, onClick, disabled, icon, sx, iconSize })=>{
57
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
58
+ const [AnchorEl, setAnchorEl] = (0, _react.useState)(null);
59
+ const handleClick = (e)=>{
60
+ if (onClick) {
61
+ onClick();
62
+ setIsOpen((prev)=>!prev);
63
+ setAnchorEl(e.currentTarget);
64
+ } else {
65
+ setIsOpen((prev)=>!prev);
66
+ setAnchorEl(e.currentTarget);
67
+ }
68
+ };
69
+ const handleClose = ()=>{
70
+ setIsOpen(false);
71
+ setAnchorEl(null);
72
+ };
73
+ (0, _react.useEffect)(()=>{
74
+ setIsOpen(false);
75
+ }, [
76
+ btnValue
77
+ ]);
78
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
79
+ children: [
80
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxStyledButton.FxStyledButton, {
81
+ sx: sx,
82
+ btnType: btnType,
83
+ btnValue: btnValue,
84
+ onClick: handleClick,
85
+ startIcon: icon,
86
+ disabled: disabled,
87
+ iconSize: iconSize || 20
88
+ }),
89
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
90
+ id: "fade-menu",
91
+ MenuListProps: {
92
+ 'aria-labelledby': 'fade-button'
93
+ },
94
+ anchorEl: AnchorEl,
95
+ open: isOpen,
96
+ onClose: handleClose,
97
+ TransitionComponent: _material.Fade,
98
+ children: isOpen && modalData
99
+ })
100
+ ]
101
+ });
102
+ };
@@ -0,0 +1 @@
1
+ export { FxButtonModalWithComponent } from './FxButtonModalWithComponent';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxButtonModalWithComponent", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _FxButtonModalWithComponent.FxButtonModalWithComponent;
9
+ }
10
+ });
11
+ const _FxButtonModalWithComponent = require("./FxButtonModalWithComponent");
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export declare const FxButtonModalWithMenu: ({ btnType, btnValue, modalData, onClick, disabled, startIcon, endIcon, shouldShowModal, buttonSx, menuItemSx, iconSize, }: {
3
+ btnType?: 'text' | 'icon';
4
+ btnValue?: string;
5
+ modalData: any;
6
+ onClick?: any;
7
+ disabled?: boolean;
8
+ startIcon?: string;
9
+ endIcon?: string;
10
+ shouldShowModal?: boolean;
11
+ buttonSx?: any;
12
+ menuItemSx?: any;
13
+ iconSize?: number;
14
+ }) => React.JSX.Element;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxButtonModalWithMenu", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxButtonModalWithMenu;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
+ const _material = require("@mui/material");
14
+ const _FxMenuItemWithIcon = require("../FxMenuItemWithIcon");
15
+ const _FxStyledButton = require("../FxStyledButton");
16
+ function _getRequireWildcardCache(nodeInterop) {
17
+ if (typeof WeakMap !== "function") return null;
18
+ var cacheBabelInterop = new WeakMap();
19
+ var cacheNodeInterop = new WeakMap();
20
+ return (_getRequireWildcardCache = function(nodeInterop) {
21
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
22
+ })(nodeInterop);
23
+ }
24
+ function _interop_require_wildcard(obj, nodeInterop) {
25
+ if (!nodeInterop && obj && obj.__esModule) {
26
+ return obj;
27
+ }
28
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
29
+ return {
30
+ default: obj
31
+ };
32
+ }
33
+ var cache = _getRequireWildcardCache(nodeInterop);
34
+ if (cache && cache.has(obj)) {
35
+ return cache.get(obj);
36
+ }
37
+ var newObj = {
38
+ __proto__: null
39
+ };
40
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
41
+ for(var key in obj){
42
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
43
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
44
+ if (desc && (desc.get || desc.set)) {
45
+ Object.defineProperty(newObj, key, desc);
46
+ } else {
47
+ newObj[key] = obj[key];
48
+ }
49
+ }
50
+ }
51
+ newObj.default = obj;
52
+ if (cache) {
53
+ cache.set(obj, newObj);
54
+ }
55
+ return newObj;
56
+ }
57
+ const FxButtonModalWithMenu = ({ btnType = 'text', btnValue, modalData, onClick, disabled, startIcon, endIcon, shouldShowModal = true, buttonSx, menuItemSx, iconSize })=>{
58
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
59
+ const [AnchorEl, setAnchorEl] = (0, _react.useState)(null);
60
+ const handleClick = (e)=>{
61
+ if (onClick) {
62
+ onClick();
63
+ setIsOpen((prev)=>!prev);
64
+ setAnchorEl(e.currentTarget);
65
+ } else {
66
+ setIsOpen((prev)=>!prev);
67
+ setAnchorEl(e.currentTarget);
68
+ }
69
+ };
70
+ const handleClose = ()=>{
71
+ setIsOpen(false);
72
+ setAnchorEl(null);
73
+ };
74
+ (0, _react.useEffect)(()=>{
75
+ setIsOpen(false);
76
+ }, [
77
+ btnValue
78
+ ]);
79
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
80
+ children: [
81
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxStyledButton.FxStyledButton, {
82
+ sx: buttonSx,
83
+ btnType: btnType,
84
+ btnValue: btnValue,
85
+ onClick: handleClick,
86
+ startIcon: startIcon,
87
+ endIcon: endIcon,
88
+ iconSize: iconSize || 20,
89
+ disabled: disabled
90
+ }),
91
+ shouldShowModal && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
92
+ id: "fade-menu",
93
+ MenuListProps: {
94
+ 'aria-labelledby': 'fade-button'
95
+ },
96
+ anchorEl: AnchorEl,
97
+ open: isOpen,
98
+ onClose: handleClose,
99
+ TransitionComponent: _material.Fade,
100
+ children: isOpen && (modalData === null || modalData === void 0 ? void 0 : modalData.map((item, i)=>{
101
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxMenuItemWithIcon.FxMenuItemWithIcon, {
102
+ icon: item.icon,
103
+ title: item.title,
104
+ onClick: ()=>{
105
+ handleClose();
106
+ item.onClick();
107
+ },
108
+ sx: menuItemSx
109
+ }, i);
110
+ }))
111
+ })
112
+ ]
113
+ });
114
+ };
@@ -0,0 +1 @@
1
+ export { FxButtonModalWithMenu } from './FxButtonModalWithMenu';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxButtonModalWithMenu", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _FxButtonModalWithMenu.FxButtonModalWithMenu;
9
+ }
10
+ });
11
+ const _FxButtonModalWithMenu = require("./FxButtonModalWithMenu");
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const FxGeneralModal: ({ buttonComponent, modalComponent, onClick, }: {
3
+ buttonComponent: any;
4
+ modalComponent: any;
5
+ onClick?: any;
6
+ }) => React.JSX.Element;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxGeneralModal", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxGeneralModal;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
+ const _material = require("@mui/material");
14
+ function _getRequireWildcardCache(nodeInterop) {
15
+ if (typeof WeakMap !== "function") return null;
16
+ var cacheBabelInterop = new WeakMap();
17
+ var cacheNodeInterop = new WeakMap();
18
+ return (_getRequireWildcardCache = function(nodeInterop) {
19
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
20
+ })(nodeInterop);
21
+ }
22
+ function _interop_require_wildcard(obj, nodeInterop) {
23
+ if (!nodeInterop && obj && obj.__esModule) {
24
+ return obj;
25
+ }
26
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
27
+ return {
28
+ default: obj
29
+ };
30
+ }
31
+ var cache = _getRequireWildcardCache(nodeInterop);
32
+ if (cache && cache.has(obj)) {
33
+ return cache.get(obj);
34
+ }
35
+ var newObj = {
36
+ __proto__: null
37
+ };
38
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
39
+ for(var key in obj){
40
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
41
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
42
+ if (desc && (desc.get || desc.set)) {
43
+ Object.defineProperty(newObj, key, desc);
44
+ } else {
45
+ newObj[key] = obj[key];
46
+ }
47
+ }
48
+ }
49
+ newObj.default = obj;
50
+ if (cache) {
51
+ cache.set(obj, newObj);
52
+ }
53
+ return newObj;
54
+ }
55
+ const FxGeneralModal = ({ buttonComponent, modalComponent, onClick })=>{
56
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
57
+ const [AnchorEl, setAnchorEl] = (0, _react.useState)(null);
58
+ const handleClick = (e)=>{
59
+ if (onClick) {
60
+ onClick();
61
+ setIsOpen((prev)=>!prev);
62
+ setAnchorEl(e.currentTarget);
63
+ } else {
64
+ setIsOpen((prev)=>!prev);
65
+ setAnchorEl(e.currentTarget);
66
+ }
67
+ };
68
+ const handleClose = ()=>{
69
+ setIsOpen(false);
70
+ setAnchorEl(null);
71
+ };
72
+ (0, _react.useEffect)(()=>{
73
+ setIsOpen(false);
74
+ }, [
75
+ buttonComponent
76
+ ]);
77
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
78
+ children: [
79
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
80
+ onClick: handleClick,
81
+ children: buttonComponent
82
+ }),
83
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
84
+ id: "fade-menu",
85
+ MenuListProps: {
86
+ 'aria-labelledby': 'fade-button'
87
+ },
88
+ anchorEl: AnchorEl,
89
+ open: isOpen,
90
+ onClose: handleClose,
91
+ TransitionComponent: _material.Fade,
92
+ children: isOpen && modalComponent
93
+ })
94
+ ]
95
+ });
96
+ };
@@ -0,0 +1 @@
1
+ export { FxGeneralModal } from './FxGeneralModal';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxGeneralModal", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _FxGeneralModal.FxGeneralModal;
9
+ }
10
+ });
11
+ const _FxGeneralModal = require("./FxGeneralModal");
package/dist/index.d.ts CHANGED
@@ -5,11 +5,12 @@ export { FxAvatar, AvatarPropsType, BackgroundColorsType } from './FxAvatar';
5
5
  export { FxButton, ButtonPropsType } from './FxButton';
6
6
  export { FxChip, ChipPropsType } from './FxChip';
7
7
  export { FxDatesProgress } from './FxDatesProgress';
8
+ export { FxGeneralModal } from './FxGeneralModal';
8
9
  export { FxIcon } from './FxIcon';
9
10
  export { FxMenuItemWithIcon } from './FxMenuItemWithIcon';
10
11
  export { FxModal, ModalPropsType } from './FxModal';
11
- export { FxModalWithComponent } from './FxModalWithComponent';
12
- export { FxModalWithMenu } from './FxModalWithMenu';
12
+ export { FxButtonModalWithComponent } from './FxButtonModalWithComponent';
13
+ export { FxButtonModalWithMenu } from './FxButtonModalWithMenu';
13
14
  export { FxNotes, NoteCreateInput, NotesPropsType } from './FxNotes';
14
15
  export { FxNumberField, NumberfieldPropsType } from './FxNumberField';
15
16
  export { Arrow, PopperHeader, PopperWithOutside } from './FxPopper';
package/dist/index.js CHANGED
@@ -60,12 +60,21 @@ _export(exports, {
60
60
  FxButton: function() {
61
61
  return _FxButton.FxButton;
62
62
  },
63
+ FxButtonModalWithComponent: function() {
64
+ return _FxButtonModalWithComponent.FxButtonModalWithComponent;
65
+ },
66
+ FxButtonModalWithMenu: function() {
67
+ return _FxButtonModalWithMenu.FxButtonModalWithMenu;
68
+ },
63
69
  FxChip: function() {
64
70
  return _FxChip.FxChip;
65
71
  },
66
72
  FxDatesProgress: function() {
67
73
  return _FxDatesProgress.FxDatesProgress;
68
74
  },
75
+ FxGeneralModal: function() {
76
+ return _FxGeneralModal.FxGeneralModal;
77
+ },
69
78
  FxIcon: function() {
70
79
  return _FxIcon.FxIcon;
71
80
  },
@@ -75,12 +84,6 @@ _export(exports, {
75
84
  FxModal: function() {
76
85
  return _FxModal.FxModal;
77
86
  },
78
- FxModalWithComponent: function() {
79
- return _FxModalWithComponent.FxModalWithComponent;
80
- },
81
- FxModalWithMenu: function() {
82
- return _FxModalWithMenu.FxModalWithMenu;
83
- },
84
87
  FxNotes: function() {
85
88
  return _FxNotes.FxNotes;
86
89
  },
@@ -233,11 +236,12 @@ const _FxAvatar = require("./FxAvatar");
233
236
  const _FxButton = require("./FxButton");
234
237
  const _FxChip = require("./FxChip");
235
238
  const _FxDatesProgress = require("./FxDatesProgress");
239
+ const _FxGeneralModal = require("./FxGeneralModal");
236
240
  const _FxIcon = require("./FxIcon");
237
241
  const _FxMenuItemWithIcon = require("./FxMenuItemWithIcon");
238
242
  const _FxModal = require("./FxModal");
239
- const _FxModalWithComponent = require("./FxModalWithComponent");
240
- const _FxModalWithMenu = require("./FxModalWithMenu");
243
+ const _FxButtonModalWithComponent = require("./FxButtonModalWithComponent");
244
+ const _FxButtonModalWithMenu = require("./FxButtonModalWithMenu");
241
245
  const _FxNotes = require("./FxNotes");
242
246
  const _FxNumberField = require("./FxNumberField");
243
247
  const _FxPopper = require("./FxPopper");
package/package.json CHANGED
@@ -67,5 +67,5 @@
67
67
  "require": "./dist/index.js"
68
68
  }
69
69
  },
70
- "version": "0.3.28"
70
+ "version": "0.3.30"
71
71
  }