@fixefy/fixefy-ui-components 0.3.5 → 0.3.7

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,10 @@
1
+ import React from 'react';
2
+ export interface Tab {
3
+ value: string | number | boolean;
4
+ label: string;
5
+ show: boolean;
6
+ }
7
+ export declare const FxTabs: ({ tabsData, handleClickPOV }: {
8
+ tabsData: Tab[];
9
+ handleClickPOV: any;
10
+ }) => React.JSX.Element;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxTabs", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxTabs;
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 FxTabs = ({ tabsData, handleClickPOV })=>{
56
+ const [activeTab, setActiveTab] = (0, _react.useState)(tabsData[0].value);
57
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButtonGroup, {
58
+ sx: {
59
+ height: '40px',
60
+ backgroundColor: '#fff'
61
+ },
62
+ color: "primary",
63
+ value: activeTab,
64
+ exclusive: true,
65
+ onChange: (e, val)=>{
66
+ e.preventDefault();
67
+ setTimeout(()=>{
68
+ setActiveTab(val);
69
+ handleClickPOV(val);
70
+ }, 500);
71
+ },
72
+ children: tabsData.map((tab, i)=>{
73
+ const { value, show, label } = tab;
74
+ return show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
75
+ disabled: activeTab === value,
76
+ //@ts-ignore
77
+ sx: {
78
+ '&.Mui-disabled': {
79
+ border: '1px solid #568793 !important'
80
+ },
81
+ '&.MuiToggleButtonGroup-grouped': {
82
+ borderRadius: 'inherit',
83
+ maxWidth: '161px',
84
+ minWidth: '161px'
85
+ },
86
+ '&.Mui-selected': {
87
+ backgroundColor: '#F1FBFE',
88
+ border: '1px solid #568793'
89
+ }
90
+ },
91
+ value: value,
92
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
93
+ lineHeight: '24px',
94
+ fontSize: '12px',
95
+ fontWeight: 500,
96
+ color: 'primary',
97
+ variant: "button",
98
+ children: label
99
+ })
100
+ }, i);
101
+ })
102
+ });
103
+ };
@@ -0,0 +1 @@
1
+ export { FxTabs } from './FxTabs';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxTabs", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _FxTabs.FxTabs;
9
+ }
10
+ });
11
+ const _FxTabs = require("./FxTabs");
package/dist/index.d.ts CHANGED
@@ -21,6 +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
25
  export { FxTag, TagPropsType } from './FxTag';
25
26
  export { FxTextField, TextFieldPropsType } from './FxTextField';
26
27
  export { FxTodo, TodoItemType, TodoPropsType } from './FxTodo';
package/dist/index.js CHANGED
@@ -114,6 +114,9 @@ _export(exports, {
114
114
  FxStyledButton: function() {
115
115
  return _FxStyledButton.FxStyledButton;
116
116
  },
117
+ FxTabs: function() {
118
+ return _FxTabs.FxTabs;
119
+ },
117
120
  FxTag: function() {
118
121
  return _FxTag.FxTag;
119
122
  },
@@ -237,6 +240,7 @@ const _FxStaticDropdown = require("./FxStaticDropdown");
237
240
  const _FxStatisticsBar = require("./FxStatisticsBar");
238
241
  const _FxStyledButton = require("./FxStyledButton");
239
242
  const _FxStatusBar = require("./FxStatusBar");
243
+ const _FxTabs = require("./FxTabs");
240
244
  const _FxTag = require("./FxTag");
241
245
  const _FxTextField = require("./FxTextField");
242
246
  const _FxTodo = require("./FxTodo");
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@apollo/client": "3.10.4",
8
- "@fixefy/fixefy-ui-utils": "0.2.44",
8
+ "@fixefy/fixefy-ui-utils": "0.2.45",
9
9
  "@mui/icons-material": "5.16.7",
10
10
  "@mui/material": "5.16.7",
11
11
  "@mui/styled-engine": "5.15.14",
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.3.5"
68
+ "version": "0.3.7"
69
69
  }