@fixefy/fixefy-ui-components 0.3.10 → 0.3.12

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.
@@ -6,7 +6,8 @@ export interface Tab {
6
6
  maxWidth?: number | string;
7
7
  minWidth?: number | string;
8
8
  }
9
- export declare const FxTabs: ({ tabsData, handleClickPOV }: {
9
+ export declare const FxTabs: ({ activeTab, tabsData, handleClickPOV, }: {
10
+ activeTab: string;
10
11
  tabsData: Tab[];
11
12
  handleClickPOV: any;
12
13
  }) => React.JSX.Element;
@@ -9,51 +9,15 @@ Object.defineProperty(exports, "FxTabs", {
9
9
  }
10
10
  });
11
11
  const _jsxruntime = require("react/jsx-runtime");
12
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
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
14
+ function _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
37
17
  };
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
18
  }
55
- const FxTabs = ({ tabsData, handleClickPOV })=>{
56
- const [activeTab, setActiveTab] = (0, _react.useState)(tabsData[0].value);
19
+ const FxTabs = ({ activeTab, tabsData, handleClickPOV })=>{
20
+ // const [activeTab, setActiveTab] = useState(tabsData[0].value)
57
21
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButtonGroup, {
58
22
  sx: {
59
23
  height: '40px',
@@ -65,7 +29,7 @@ const FxTabs = ({ tabsData, handleClickPOV })=>{
65
29
  onChange: (e, val)=>{
66
30
  e.preventDefault();
67
31
  setTimeout(()=>{
68
- setActiveTab(val);
32
+ // setActiveTab(val)
69
33
  handleClickPOV(val);
70
34
  }, 500);
71
35
  },
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface Tab {
3
+ value: string | number | boolean;
4
+ label: string;
5
+ show: boolean;
6
+ maxWidth?: number | string;
7
+ minWidth?: number | string;
8
+ }
9
+ export declare const FxToggleButtons: ({ activeTab, tabsData, handleClickPOV, }: {
10
+ activeTab: string;
11
+ tabsData: Tab[];
12
+ handleClickPOV: any;
13
+ }) => React.JSX.Element;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxToggleButtons", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxToggleButtons;
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 _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ const FxToggleButtons = ({ activeTab, tabsData, handleClickPOV })=>{
20
+ // const [activeTab, setActiveTab] = useState(tabsData[0].value)
21
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButtonGroup, {
22
+ sx: {
23
+ height: '40px',
24
+ backgroundColor: '#fff'
25
+ },
26
+ color: "primary",
27
+ value: activeTab,
28
+ exclusive: true,
29
+ onChange: (e, val)=>{
30
+ e.preventDefault();
31
+ setTimeout(()=>{
32
+ // setActiveTab(val)
33
+ handleClickPOV(val);
34
+ }, 500);
35
+ },
36
+ children: tabsData.map((tab, i)=>{
37
+ const { value, show, label, maxWidth, minWidth } = tab;
38
+ return show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
39
+ disabled: activeTab === value,
40
+ //@ts-ignore
41
+ sx: {
42
+ '&.Mui-disabled': {
43
+ border: '1px solid #568793 !important'
44
+ },
45
+ '&.MuiToggleButtonGroup-grouped': {
46
+ borderRadius: 'inherit',
47
+ maxWidth: maxWidth || '161px',
48
+ minWidth: minWidth || '161px'
49
+ },
50
+ '&.Mui-selected': {
51
+ backgroundColor: '#F1FBFE',
52
+ border: '1px solid #568793'
53
+ }
54
+ },
55
+ value: value,
56
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
57
+ lineHeight: '24px',
58
+ fontSize: '12px',
59
+ fontWeight: 500,
60
+ color: 'primary',
61
+ variant: "button",
62
+ children: label
63
+ })
64
+ }, i);
65
+ })
66
+ });
67
+ };
@@ -0,0 +1 @@
1
+ export { FxToggleButtons } from './FxToggleButtons';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxToggleButtons", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _FxToggleButtons.FxToggleButtons;
9
+ }
10
+ });
11
+ const _FxToggleButtons = require("./FxToggleButtons");
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export { FxStaticDropdown, StaticDropdownStylesOptions, StaticDropdownPropsType
21
21
  export { FxStatisticsBar, StatisticsPropsType } from './FxStatisticsBar';
22
22
  export { FxStyledButton } from './FxStyledButton';
23
23
  export { FxStatusBar, StatusBarPropsType, Options } from './FxStatusBar';
24
- export { FxTabs } from './FxTabs';
24
+ export { FxToggleButtons } from './FxToggleButtons';
25
25
  export { FxTag, TagPropsType } from './FxTag';
26
26
  export { FxTextField, TextFieldPropsType } from './FxTextField';
27
27
  export { FxTodo, TodoItemType, TodoPropsType } from './FxTodo';
package/dist/index.js CHANGED
@@ -114,9 +114,6 @@ _export(exports, {
114
114
  FxStyledButton: function() {
115
115
  return _FxStyledButton.FxStyledButton;
116
116
  },
117
- FxTabs: function() {
118
- return _FxTabs.FxTabs;
119
- },
120
117
  FxTag: function() {
121
118
  return _FxTag.FxTag;
122
119
  },
@@ -126,6 +123,9 @@ _export(exports, {
126
123
  FxTodo: function() {
127
124
  return _FxTodo.FxTodo;
128
125
  },
126
+ FxToggleButtons: function() {
127
+ return _FxToggleButtons.FxToggleButtons;
128
+ },
129
129
  FxWizard: function() {
130
130
  return _FxWizard.FxWizard;
131
131
  },
@@ -240,7 +240,7 @@ const _FxStaticDropdown = require("./FxStaticDropdown");
240
240
  const _FxStatisticsBar = require("./FxStatisticsBar");
241
241
  const _FxStyledButton = require("./FxStyledButton");
242
242
  const _FxStatusBar = require("./FxStatusBar");
243
- const _FxTabs = require("./FxTabs");
243
+ const _FxToggleButtons = require("./FxToggleButtons");
244
244
  const _FxTag = require("./FxTag");
245
245
  const _FxTextField = require("./FxTextField");
246
246
  const _FxTodo = require("./FxTodo");
package/package.json CHANGED
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.3.10"
68
+ "version": "0.3.12"
69
69
  }