@fixefy/fixefy-ui-components 0.3.13 → 0.3.15
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.
- package/dist/FxTabs/FxTabs.d.ts +8 -8
- package/dist/FxTabs/FxTabs.js +50 -42
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/package.json +2 -1
package/dist/FxTabs/FxTabs.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export interface
|
|
3
|
-
value: string | number
|
|
2
|
+
export interface FxTab {
|
|
3
|
+
value: string | number;
|
|
4
4
|
label: string;
|
|
5
|
-
|
|
6
|
-
maxWidth?: number | string;
|
|
7
|
-
minWidth?: number | string;
|
|
5
|
+
tabContent: any;
|
|
8
6
|
}
|
|
9
|
-
export declare const FxTabs: ({ activeTab, tabsData,
|
|
7
|
+
export declare const FxTabs: ({ activeTab, tabsData, onChange, divider, adjecentComponent, }: {
|
|
10
8
|
activeTab: string;
|
|
11
|
-
tabsData:
|
|
12
|
-
|
|
9
|
+
tabsData: FxTab[];
|
|
10
|
+
onChange: any;
|
|
11
|
+
divider?: boolean;
|
|
12
|
+
adjecentComponent?: any;
|
|
13
13
|
}) => React.JSX.Element;
|
package/dist/FxTabs/FxTabs.js
CHANGED
|
@@ -10,58 +10,66 @@ Object.defineProperty(exports, "FxTabs", {
|
|
|
10
10
|
});
|
|
11
11
|
const _jsxruntime = require("react/jsx-runtime");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
13
|
+
const _lab = require("@mui/lab");
|
|
13
14
|
const _material = require("@mui/material");
|
|
15
|
+
const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
|
|
14
16
|
function _interop_require_default(obj) {
|
|
15
17
|
return obj && obj.__esModule ? obj : {
|
|
16
18
|
default: obj
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
|
-
const FxTabs = ({ activeTab, tabsData,
|
|
20
|
-
|
|
21
|
-
return /*#__PURE__*/ (0, _jsxruntime.
|
|
22
|
-
sx: {
|
|
23
|
-
height: '40px',
|
|
24
|
-
backgroundColor: '#fff'
|
|
25
|
-
},
|
|
26
|
-
color: "primary",
|
|
21
|
+
const FxTabs = ({ activeTab, tabsData, onChange, divider = false, adjecentComponent })=>{
|
|
22
|
+
const theme = (0, _material.useTheme)();
|
|
23
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_lab.TabContext, {
|
|
27
24
|
value: activeTab,
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_lab.TabList, {
|
|
41
27
|
sx: {
|
|
42
|
-
'
|
|
43
|
-
|
|
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'
|
|
28
|
+
'.MuiTabs-flexContainer': {
|
|
29
|
+
gap: '28px',
|
|
30
|
+
padding: '0 32px'
|
|
53
31
|
}
|
|
54
32
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
33
|
+
children: [
|
|
34
|
+
tabsData.map((tab, i)=>{
|
|
35
|
+
const { value, label } = tab;
|
|
36
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tab, {
|
|
37
|
+
onClick: ()=>{
|
|
38
|
+
onChange(value);
|
|
39
|
+
},
|
|
40
|
+
sx: {
|
|
41
|
+
minWidth: 'auto',
|
|
42
|
+
p: '0 4px',
|
|
43
|
+
textTransform: 'capitalize',
|
|
44
|
+
'&.Mui-selected': {
|
|
45
|
+
//@ts-ignore
|
|
46
|
+
color: theme.palette.primary[500],
|
|
47
|
+
fontWeight: 700
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
label: (0, _fixefyuiutils.titleCase)(label),
|
|
51
|
+
value: value
|
|
52
|
+
}, i);
|
|
53
|
+
}),
|
|
54
|
+
adjecentComponent
|
|
55
|
+
]
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
58
|
+
sx: {
|
|
59
|
+
borderTop: divider ? '1px solid #C5C8C9' : 'none',
|
|
60
|
+
margin: '0 32px'
|
|
61
|
+
},
|
|
62
|
+
children: tabsData.map((tab, i)=>{
|
|
63
|
+
const { value, tabContent } = tab;
|
|
64
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_lab.TabPanel, {
|
|
65
|
+
value: value,
|
|
66
|
+
sx: {
|
|
67
|
+
padding: '24px 0'
|
|
68
|
+
},
|
|
69
|
+
children: tabContent
|
|
70
|
+
}, i);
|
|
63
71
|
})
|
|
64
|
-
}
|
|
65
|
-
|
|
72
|
+
})
|
|
73
|
+
]
|
|
66
74
|
});
|
|
67
75
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { FxStatisticsBar, StatisticsPropsType } from './FxStatisticsBar';
|
|
|
22
22
|
export { FxStyledButton } from './FxStyledButton';
|
|
23
23
|
export { FxStatusBar, StatusBarPropsType, Options } from './FxStatusBar';
|
|
24
24
|
export { FxToggleButtons } from './FxToggleButtons';
|
|
25
|
+
export { FxTabs } from './FxTabs';
|
|
25
26
|
export { FxTag, TagPropsType } from './FxTag';
|
|
26
27
|
export { FxTextField, TextFieldPropsType } from './FxTextField';
|
|
27
28
|
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
|
},
|
|
@@ -241,6 +244,7 @@ const _FxStatisticsBar = require("./FxStatisticsBar");
|
|
|
241
244
|
const _FxStyledButton = require("./FxStyledButton");
|
|
242
245
|
const _FxStatusBar = require("./FxStatusBar");
|
|
243
246
|
const _FxToggleButtons = require("./FxToggleButtons");
|
|
247
|
+
const _FxTabs = require("./FxTabs");
|
|
244
248
|
const _FxTag = require("./FxTag");
|
|
245
249
|
const _FxTextField = require("./FxTextField");
|
|
246
250
|
const _FxTodo = require("./FxTodo");
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"@apollo/client": "3.10.4",
|
|
8
8
|
"@fixefy/fixefy-ui-utils": "0.2.45",
|
|
9
9
|
"@mui/icons-material": "5.16.7",
|
|
10
|
+
"@mui/lab": "6.0.0-beta.7",
|
|
10
11
|
"@mui/material": "5.16.7",
|
|
11
12
|
"@mui/styled-engine": "5.15.14",
|
|
12
13
|
"@mui/styles": "5.16.7",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"require": "./dist/index.js"
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
|
-
"version": "0.3.
|
|
69
|
+
"version": "0.3.15"
|
|
69
70
|
}
|