@fixefy/fixefy-ui-components 0.2.65 → 0.2.66
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/FxChip/FxChip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EntityStatusType, ChargeStateType, InvoiceStateType, RecoStateType } from '@fixefy/fixefy-ui-utils';
|
|
3
3
|
export interface ChipPropsType {
|
|
4
|
-
type?: 'status' | 'priority' | 'score';
|
|
4
|
+
type?: 'status' | 'priority' | 'score' | 'dimension';
|
|
5
5
|
status?: EntityStatusType | ChargeStateType | InvoiceStateType | RecoStateType;
|
|
6
6
|
label: string | number;
|
|
7
7
|
variant?: 'outlined' | 'filled';
|
|
@@ -10,5 +10,6 @@ export interface ChipPropsType {
|
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
onClick?: (e: any) => void;
|
|
12
12
|
onDelete?: (e: any) => void;
|
|
13
|
+
icon?: string;
|
|
13
14
|
}
|
|
14
15
|
export declare const FxChip: (props: ChipPropsType) => React.JSX.Element;
|
package/dist/FxChip/FxChip.js
CHANGED
|
@@ -13,43 +13,56 @@ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
|
13
13
|
const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
|
|
14
14
|
const _iconsmaterial = require("@mui/icons-material");
|
|
15
15
|
const _chipstyles = require("./styles/chip.styles");
|
|
16
|
+
const _FxIcon = require("../FxIcon");
|
|
16
17
|
function _interop_require_default(obj) {
|
|
17
18
|
return obj && obj.__esModule ? obj : {
|
|
18
19
|
default: obj
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
const FxChip = (props)=>{
|
|
22
|
-
const { status, label, type = 'status', scoreValue = 0, minimized = false, variant = 'outlined', onClick, onDelete } = props;
|
|
23
|
+
const { status, label, type = 'status', scoreValue = 0, minimized = false, variant = 'outlined', onClick, onDelete, icon } = props;
|
|
23
24
|
const newStatus = status ? status.split(' ').join('_') : status;
|
|
24
25
|
const value = typeof label === 'number' ? label.toFixed(2) : label;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
switch(type){
|
|
27
|
+
case 'status':
|
|
28
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_chipstyles.StatusChipStyled, {
|
|
29
|
+
status: newStatus,
|
|
30
|
+
label: (0, _fixefyuiutils.titleCase)(value),
|
|
31
|
+
variant: variant,
|
|
32
|
+
onClick: onClick,
|
|
33
|
+
onDelete: onDelete,
|
|
34
|
+
deleteIcon: onDelete ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CloseRounded, {
|
|
35
|
+
sx: {
|
|
36
|
+
width: 11,
|
|
37
|
+
height: 11
|
|
38
|
+
}
|
|
39
|
+
}) : null
|
|
40
|
+
});
|
|
41
|
+
case 'priority':
|
|
42
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_chipstyles.PriorityChipStyled, {
|
|
43
|
+
status: newStatus,
|
|
44
|
+
label: (0, _fixefyuiutils.titleCase)(value),
|
|
45
|
+
variant: variant
|
|
46
|
+
});
|
|
47
|
+
case 'dimension':
|
|
48
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_chipstyles.DimensionChipStyled, {
|
|
49
|
+
label: (0, _fixefyuiutils.titleCase)(value),
|
|
50
|
+
minimized: minimized,
|
|
51
|
+
variant: variant,
|
|
52
|
+
icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
53
|
+
icon: `${icon}.svg`,
|
|
54
|
+
width: 15,
|
|
55
|
+
height: 15
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
default:
|
|
59
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_chipstyles.ScoreChipStyled, {
|
|
60
|
+
score: scoreValue,
|
|
61
|
+
scoreLabel: (0, _fixefyuiutils.getScoreColor)(scoreValue),
|
|
62
|
+
label: (0, _fixefyuiutils.titleCase)(value),
|
|
63
|
+
minimized: minimized,
|
|
64
|
+
variant: variant,
|
|
65
|
+
onClick: onClick
|
|
66
|
+
});
|
|
54
67
|
}
|
|
55
68
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const ScoreChipStyled: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
2
2
|
export declare const StatusChipStyled: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
3
3
|
export declare const PriorityChipStyled: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
4
|
+
export declare const DimensionChipStyled: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
@@ -9,6 +9,9 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
DimensionChipStyled: function() {
|
|
13
|
+
return DimensionChipStyled;
|
|
14
|
+
},
|
|
12
15
|
PriorityChipStyled: function() {
|
|
13
16
|
return PriorityChipStyled;
|
|
14
17
|
},
|
|
@@ -80,3 +83,20 @@ const PriorityChipStyled = (0, _styles.styled)(_material.Chip)(({ theme, status
|
|
|
80
83
|
border: `1px solid ${border}`
|
|
81
84
|
};
|
|
82
85
|
});
|
|
86
|
+
const DimensionChipStyled = (0, _styles.styled)(_material.Chip)(({ minimized })=>{
|
|
87
|
+
return {
|
|
88
|
+
height: '36px',
|
|
89
|
+
minWidth: minimized ? 35 : 80,
|
|
90
|
+
maxWidth: 120,
|
|
91
|
+
backgroundColor: '#F6F9FA',
|
|
92
|
+
borderColor: '#C6DDE2',
|
|
93
|
+
['& .MuiChip-label']: {
|
|
94
|
+
color: '#172326',
|
|
95
|
+
fontSize: 14
|
|
96
|
+
},
|
|
97
|
+
'& .MuiChip-icon': {
|
|
98
|
+
width: 11,
|
|
99
|
+
height: 11
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
});
|
package/package.json
CHANGED