@fixefy/fixefy-ui-components 0.3.11 → 0.3.13
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,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, onChange, }: {
|
|
10
|
+
activeTab: string;
|
|
11
|
+
tabsData: Tab[];
|
|
12
|
+
onChange: any;
|
|
13
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,65 @@
|
|
|
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, onChange })=>{
|
|
20
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButtonGroup, {
|
|
21
|
+
sx: {
|
|
22
|
+
height: '40px',
|
|
23
|
+
backgroundColor: '#fff'
|
|
24
|
+
},
|
|
25
|
+
color: "primary",
|
|
26
|
+
value: activeTab,
|
|
27
|
+
exclusive: true,
|
|
28
|
+
onChange: (e, val)=>{
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
setTimeout(()=>{
|
|
31
|
+
onChange(val);
|
|
32
|
+
}, 500);
|
|
33
|
+
},
|
|
34
|
+
children: tabsData.map((tab, i)=>{
|
|
35
|
+
const { value, show, label, maxWidth, minWidth } = tab;
|
|
36
|
+
return show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.ToggleButton, {
|
|
37
|
+
disabled: activeTab === value,
|
|
38
|
+
//@ts-ignore
|
|
39
|
+
sx: {
|
|
40
|
+
'&.Mui-disabled': {
|
|
41
|
+
border: '1px solid #568793 !important'
|
|
42
|
+
},
|
|
43
|
+
'&.MuiToggleButtonGroup-grouped': {
|
|
44
|
+
borderRadius: 'inherit',
|
|
45
|
+
maxWidth: maxWidth || '161px',
|
|
46
|
+
minWidth: minWidth || '161px'
|
|
47
|
+
},
|
|
48
|
+
'&.Mui-selected': {
|
|
49
|
+
backgroundColor: '#F1FBFE',
|
|
50
|
+
border: '1px solid #568793'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
value: value,
|
|
54
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
55
|
+
lineHeight: '24px',
|
|
56
|
+
fontSize: '12px',
|
|
57
|
+
fontWeight: 500,
|
|
58
|
+
color: 'primary',
|
|
59
|
+
variant: "button",
|
|
60
|
+
children: label
|
|
61
|
+
})
|
|
62
|
+
}, i);
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
};
|
|
@@ -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 {
|
|
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
|
|
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