@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.
@@ -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;
@@ -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
- if (type === 'status') {
26
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_chipstyles.StatusChipStyled, {
27
- status: newStatus,
28
- label: (0, _fixefyuiutils.titleCase)(value),
29
- variant: variant,
30
- onClick: onClick,
31
- onDelete: onDelete,
32
- deleteIcon: onDelete ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CloseRounded, {
33
- sx: {
34
- width: 11,
35
- height: 11
36
- }
37
- }) : null
38
- });
39
- } else if (type === 'priority') {
40
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_chipstyles.PriorityChipStyled, {
41
- status: newStatus,
42
- label: (0, _fixefyuiutils.titleCase)(value),
43
- variant: variant
44
- });
45
- } else {
46
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_chipstyles.ScoreChipStyled, {
47
- score: scoreValue,
48
- scoreLabel: (0, _fixefyuiutils.getScoreColor)(scoreValue),
49
- label: (0, _fixefyuiutils.titleCase)(value),
50
- minimized: minimized,
51
- variant: variant,
52
- onClick: onClick
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
@@ -65,5 +65,5 @@
65
65
  "require": "./dist/index.js"
66
66
  }
67
67
  },
68
- "version": "0.2.65"
68
+ "version": "0.2.66"
69
69
  }