@fixefy/fixefy-ui-components 0.2.91 → 0.2.93

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,7 @@
1
+ import React from 'react';
2
+ export declare const FxActionButton: ({ btnValue, onClick, startIcon, sx, }: {
3
+ btnValue: string;
4
+ onClick: any;
5
+ startIcon?: any;
6
+ sx?: any;
7
+ }) => React.JSX.Element;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxActionButton", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxActionButton;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
+ const _material = require("@mui/material");
14
+ function _define_property(obj, key, value) {
15
+ if (key in obj) {
16
+ Object.defineProperty(obj, key, {
17
+ value: value,
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true
21
+ });
22
+ } else {
23
+ obj[key] = value;
24
+ }
25
+ return obj;
26
+ }
27
+ function _interop_require_default(obj) {
28
+ return obj && obj.__esModule ? obj : {
29
+ default: obj
30
+ };
31
+ }
32
+ function _object_spread(target) {
33
+ for(var i = 1; i < arguments.length; i++){
34
+ var source = arguments[i] != null ? arguments[i] : {};
35
+ var ownKeys = Object.keys(source);
36
+ if (typeof Object.getOwnPropertySymbols === "function") {
37
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
38
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
39
+ }));
40
+ }
41
+ ownKeys.forEach(function(key) {
42
+ _define_property(target, key, source[key]);
43
+ });
44
+ }
45
+ return target;
46
+ }
47
+ function ownKeys(object, enumerableOnly) {
48
+ var keys = Object.keys(object);
49
+ if (Object.getOwnPropertySymbols) {
50
+ var symbols = Object.getOwnPropertySymbols(object);
51
+ if (enumerableOnly) {
52
+ symbols = symbols.filter(function(sym) {
53
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
54
+ });
55
+ }
56
+ keys.push.apply(keys, symbols);
57
+ }
58
+ return keys;
59
+ }
60
+ function _object_spread_props(target, source) {
61
+ source = source != null ? source : {};
62
+ if (Object.getOwnPropertyDescriptors) {
63
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
64
+ } else {
65
+ ownKeys(Object(source)).forEach(function(key) {
66
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
67
+ });
68
+ }
69
+ return target;
70
+ }
71
+ const FxActionButton = ({ btnValue, onClick, startIcon, sx })=>{
72
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
73
+ id: "fade-button",
74
+ sx: _object_spread_props(_object_spread({}, sx), {
75
+ fontWeight: 'normal'
76
+ }),
77
+ "aria-haspopup": "true",
78
+ startIcon: startIcon,
79
+ onClick: onClick,
80
+ children: btnValue
81
+ });
82
+ };
@@ -0,0 +1 @@
1
+ export { FxActionButton } from './FxActionButton';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxActionButton", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _FxActionButton.FxActionButton;
9
+ }
10
+ });
11
+ const _FxActionButton = require("./FxActionButton");
@@ -12,6 +12,7 @@ const _jsxruntime = require("react/jsx-runtime");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
13
  const _material = require("@mui/material");
14
14
  const _FxIcon = require("../FxIcon");
15
+ const _FxMenuItemWithIcon = require("../FxMenuItemWithIcon");
15
16
  function _getRequireWildcardCache(nodeInterop) {
16
17
  if (typeof WeakMap !== "function") return null;
17
18
  var cacheBabelInterop = new WeakMap();
@@ -59,9 +60,12 @@ const FxModalWithButton = ({ btnType = 'text', color, btnValue, modalData, onCli
59
60
  const handleClick = (e)=>{
60
61
  if (onClick) {
61
62
  onClick();
63
+ setIsOpen((prev)=>!prev);
64
+ setAnchorEl(e.currentTarget);
65
+ } else {
66
+ setIsOpen((prev)=>!prev);
67
+ setAnchorEl(e.currentTarget);
62
68
  }
63
- setIsOpen((prev)=>!prev);
64
- setAnchorEl(e.currentTarget);
65
69
  };
66
70
  const handleClose = ()=>{
67
71
  setIsOpen(false);
@@ -111,7 +115,16 @@ const FxModalWithButton = ({ btnType = 'text', color, btnValue, modalData, onCli
111
115
  open: isOpen,
112
116
  onClose: handleClose,
113
117
  TransitionComponent: _material.Fade,
114
- children: isOpen && modalData
118
+ children: isOpen && (modalData === null || modalData === void 0 ? void 0 : modalData.map((item, i)=>{
119
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxMenuItemWithIcon.FxMenuItemWithIcon, {
120
+ icon: item.icon,
121
+ title: item.title,
122
+ onClick: ()=>{
123
+ handleClose();
124
+ item.onClick();
125
+ }
126
+ }, i);
127
+ }))
115
128
  })
116
129
  ]
117
130
  });
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { FxAggregationsBar, AggregationsDataPropsType, AggreationsBarPropsType }
3
3
  export { FxAsyncDropdown, Option, StylesOptions, AsyncDropdownPropsType } from './FxAsyncDropdown';
4
4
  export { FxAvatar, AvatarPropsType, BackgroundColorsType } from './FxAvatar';
5
5
  export { FxButton, ButtonPropsType } from './FxButton';
6
- export { FxFilterActionButton } from './FxFilterActionButton';
6
+ export { FxActionButton } from './FxActionButton';
7
7
  export { FxChip, ChipPropsType } from './FxChip';
8
8
  export { FxIcon } from './FxIcon';
9
9
  export { FxMenuItemWithIcon } from './FxMenuItemWithIcon';
package/dist/index.js CHANGED
@@ -45,6 +45,9 @@ _export(exports, {
45
45
  DataWrapper: function() {
46
46
  return _FxStyledComponents.DataWrapper;
47
47
  },
48
+ FxActionButton: function() {
49
+ return _FxActionButton.FxActionButton;
50
+ },
48
51
  FxActionsTray: function() {
49
52
  return _FxActionsTray.FxActionsTray;
50
53
  },
@@ -63,9 +66,6 @@ _export(exports, {
63
66
  FxChip: function() {
64
67
  return _FxChip.FxChip;
65
68
  },
66
- FxFilterActionButton: function() {
67
- return _FxFilterActionButton.FxFilterActionButton;
68
- },
69
69
  FxIcon: function() {
70
70
  return _FxIcon.FxIcon;
71
71
  },
@@ -213,7 +213,7 @@ const _FxAggregationsBar = require("./FxAggregationsBar");
213
213
  const _FxAsyncDropdown = require("./FxAsyncDropdown");
214
214
  const _FxAvatar = require("./FxAvatar");
215
215
  const _FxButton = require("./FxButton");
216
- const _FxFilterActionButton = require("./FxFilterActionButton");
216
+ const _FxActionButton = require("./FxActionButton");
217
217
  const _FxChip = require("./FxChip");
218
218
  const _FxIcon = require("./FxIcon");
219
219
  const _FxMenuItemWithIcon = require("./FxMenuItemWithIcon");
package/package.json CHANGED
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.2.91"
68
+ "version": "0.2.93"
69
69
  }