@fixefy/fixefy-ui-components 0.3.0 → 0.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.
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- export declare const FxMenuItemWithIcon: ({ title, icon, onClick }: {
2
+ export declare const FxMenuItemWithIcon: ({ title, icon, onClick, sx, }: {
3
3
  title: string;
4
4
  icon: any;
5
5
  onClick?: any;
6
+ sx?: any;
6
7
  }) => React.JSX.Element;
@@ -13,12 +13,40 @@ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
13
  const _material = require("@mui/material");
14
14
  const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
15
15
  const _FxIcon = require("../FxIcon");
16
+ function _define_property(obj, key, value) {
17
+ if (key in obj) {
18
+ Object.defineProperty(obj, key, {
19
+ value: value,
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true
23
+ });
24
+ } else {
25
+ obj[key] = value;
26
+ }
27
+ return obj;
28
+ }
16
29
  function _interop_require_default(obj) {
17
30
  return obj && obj.__esModule ? obj : {
18
31
  default: obj
19
32
  };
20
33
  }
21
- const FxMenuItemWithIcon = ({ title, icon, onClick })=>{
34
+ function _object_spread(target) {
35
+ for(var i = 1; i < arguments.length; i++){
36
+ var source = arguments[i] != null ? arguments[i] : {};
37
+ var ownKeys = Object.keys(source);
38
+ if (typeof Object.getOwnPropertySymbols === "function") {
39
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
40
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
41
+ }));
42
+ }
43
+ ownKeys.forEach(function(key) {
44
+ _define_property(target, key, source[key]);
45
+ });
46
+ }
47
+ return target;
48
+ }
49
+ const FxMenuItemWithIcon = ({ title, icon, onClick, sx = {} })=>{
22
50
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.MenuItem, {
23
51
  sx: {
24
52
  width: '197px',
@@ -43,10 +71,10 @@ const FxMenuItemWithIcon = ({ title, icon, onClick })=>{
43
71
  }),
44
72
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ListItemText, {
45
73
  secondary: (0, _fixefyuiutils.titleCase)(title),
46
- secondaryTypographyProps: {
74
+ secondaryTypographyProps: _object_spread({
47
75
  fontSize: '14px',
48
76
  marginLeft: '-10px'
49
- }
77
+ }, sx)
50
78
  })
51
79
  ]
52
80
  });
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
- export declare const FxModalWithMenu: ({ btnType, btnValue, modalData, onClick, disabled, icon, shouldShowModal, sx, iconSize, }: {
2
+ export declare const FxModalWithMenu: ({ btnType, btnValue, modalData, onClick, disabled, startIcon, endIcon, shouldShowModal, buttonSx, menuItemSx, iconSize, }: {
3
3
  btnType?: 'text' | 'icon';
4
4
  btnValue?: string;
5
5
  modalData: any;
6
6
  onClick?: any;
7
7
  disabled?: boolean;
8
- icon?: string;
8
+ startIcon?: string;
9
+ endIcon?: string;
9
10
  shouldShowModal?: boolean;
10
- sx?: any;
11
+ buttonSx?: any;
12
+ menuItemSx?: any;
11
13
  iconSize?: number;
12
14
  }) => React.JSX.Element;
@@ -54,7 +54,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
54
54
  }
55
55
  return newObj;
56
56
  }
57
- const FxModalWithMenu = ({ btnType = 'text', btnValue, modalData, onClick, disabled, icon, shouldShowModal = true, sx, iconSize })=>{
57
+ const FxModalWithMenu = ({ btnType = 'text', btnValue, modalData, onClick, disabled, startIcon, endIcon, shouldShowModal = true, buttonSx, menuItemSx, iconSize })=>{
58
58
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
59
59
  const [AnchorEl, setAnchorEl] = (0, _react.useState)(null);
60
60
  const handleClick = (e)=>{
@@ -79,11 +79,12 @@ const FxModalWithMenu = ({ btnType = 'text', btnValue, modalData, onClick, disab
79
79
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
80
80
  children: [
81
81
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxStyledButton.FxStyledButton, {
82
- sx: sx,
82
+ sx: buttonSx,
83
83
  btnType: btnType,
84
84
  btnValue: btnValue,
85
85
  onClick: handleClick,
86
- startIcon: icon,
86
+ startIcon: startIcon,
87
+ endIcon: endIcon,
87
88
  iconSize: iconSize || 20,
88
89
  disabled: disabled
89
90
  }),
@@ -103,7 +104,8 @@ const FxModalWithMenu = ({ btnType = 'text', btnValue, modalData, onClick, disab
103
104
  onClick: ()=>{
104
105
  handleClose();
105
106
  item.onClick();
106
- }
107
+ },
108
+ sx: menuItemSx
107
109
  }, i);
108
110
  }))
109
111
  })
package/package.json CHANGED
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.3.0"
68
+ "version": "0.3.1"
69
69
  }