@fixefy/fixefy-ui-components 0.2.86 → 0.2.88

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.
@@ -120,7 +120,7 @@ const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox,
120
120
  fontSize: "small"
121
121
  });
122
122
  const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
123
- const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride, logo_placeholder, logo_folder_name, options_path } = props;
123
+ const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride, logo_placeholder, logo_folder_name, options_path, _id } = props;
124
124
  let { defaultValue } = props;
125
125
  const ref = (0, _react.useRef)(null);
126
126
  const theme = (0, _material.useTheme)();
@@ -181,7 +181,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
181
181
  }
182
182
  }, []);
183
183
  (0, _react.useEffect)(()=>{
184
- const storedData = sessionStorage.getItem(`dropdown-${query}-${name}`);
184
+ const storedData = sessionStorage.getItem(`dropdown-${query}-${name}-${_id}`);
185
185
  if (storedData) {
186
186
  const parsedData = JSON.parse(storedData);
187
187
  const items = parsedData[name];
@@ -236,7 +236,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
236
236
  setIsLastPage(false);
237
237
  };
238
238
  const addToStoredDisplayed = (option)=>{
239
- const prevStored = sessionStorage.getItem(`dropdown-${query}-${name}`);
239
+ const prevStored = sessionStorage.getItem(`dropdown-${query}-${name}-${_id}`);
240
240
  let data = prevStored ? JSON.parse(prevStored) : {};
241
241
  if (data[name]) {
242
242
  if (multiple) {
@@ -254,10 +254,10 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
254
254
  option
255
255
  ];
256
256
  }
257
- sessionStorage.setItem(`dropdown-${query}-${name}`, JSON.stringify(data));
257
+ sessionStorage.setItem(`dropdown-${query}-${name}-${_id}`, JSON.stringify(data));
258
258
  };
259
259
  const removeOneFromStoredDisplayed = (option)=>{
260
- let storedDisplayed = sessionStorage.getItem(`dropdown-${query}-${name}`);
260
+ let storedDisplayed = sessionStorage.getItem(`dropdown-${query}-${name}-${_id}`);
261
261
  if (storedDisplayed) {
262
262
  storedDisplayed = JSON.parse(storedDisplayed);
263
263
  if (multiple) {
@@ -266,7 +266,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
266
266
  } else {
267
267
  delete storedDisplayed[name];
268
268
  }
269
- sessionStorage.setItem(`dropdown-${query}-${name}`, JSON.stringify(storedDisplayed));
269
+ sessionStorage.setItem(`dropdown-${query}-${name}-${_id}`, JSON.stringify(storedDisplayed));
270
270
  }
271
271
  };
272
272
  const handleOptionClick = (option)=>{
@@ -527,7 +527,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
527
527
  onClick: ()=>{
528
528
  setDisplayed([]);
529
529
  onRemoveAll && onRemoveAll();
530
- sessionStorage.removeItem(`dropdown-${query}-${name}`);
530
+ sessionStorage.removeItem(`dropdown-${query}-${name}-${_id}`);
531
531
  },
532
532
  icon: `filters/remove_all_button.svg`,
533
533
  width: 16,
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- export declare const FxModalWithButton: ({ color, btnValue, modalData, onClick, disabled, }: {
2
+ export declare const FxModalWithButton: ({ btnType, color, btnValue, modalData, onClick, disabled, icon, }: {
3
+ btnType?: 'text' | 'icon';
3
4
  color?: 'secondary' | undefined;
4
5
  btnValue: string;
5
6
  modalData: any;
6
7
  onClick?: any;
7
8
  disabled?: boolean;
9
+ icon?: string;
8
10
  }) => React.JSX.Element;
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "FxModalWithButton", {
11
11
  const _jsxruntime = require("react/jsx-runtime");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
13
  const _material = require("@mui/material");
14
+ const _FxIcon = require("../FxIcon");
14
15
  function _getRequireWildcardCache(nodeInterop) {
15
16
  if (typeof WeakMap !== "function") return null;
16
17
  var cacheBabelInterop = new WeakMap();
@@ -52,7 +53,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
52
53
  }
53
54
  return newObj;
54
55
  }
55
- const FxModalWithButton = ({ color, btnValue, modalData, onClick, disabled })=>{
56
+ const FxModalWithButton = ({ btnType = 'text', color, btnValue, modalData, onClick, disabled, icon })=>{
56
57
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
57
58
  const [AnchorEl, setAnchorEl] = (0, _react.useState)(null);
58
59
  const handleClick = (e)=>{
@@ -73,7 +74,7 @@ const FxModalWithButton = ({ color, btnValue, modalData, onClick, disabled })=>{
73
74
  ]);
74
75
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
75
76
  children: [
76
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
77
+ btnType == 'text' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
77
78
  disabled: disabled,
78
79
  color: color || 'primary',
79
80
  id: "fade-button",
@@ -90,7 +91,17 @@ const FxModalWithButton = ({ color, btnValue, modalData, onClick, disabled })=>{
90
91
  },
91
92
  children: btnValue
92
93
  }),
93
- ' ',
94
+ btnType == 'icon' && icon && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.IconButton, {
95
+ onClick: onClick,
96
+ children: [
97
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
98
+ icon: icon,
99
+ width: 20,
100
+ height: 20
101
+ }),
102
+ ' '
103
+ ]
104
+ }),
94
105
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
95
106
  id: "fade-menu",
96
107
  MenuListProps: {
package/package.json CHANGED
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.2.86"
68
+ "version": "0.2.88"
69
69
  }