@fixefy/fixefy-ui-components 0.2.9 → 0.2.11
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/FxAsyncDropdown/FxAsyncDropdown.d.ts +1 -0
- package/dist/FxAsyncDropdown/FxAsyncDropdown.js +2 -2
- package/dist/FxChip/FxChip.d.ts +1 -6
- package/dist/FxChip/FxChip.js +30 -20
- package/dist/FxChip/styles/chip.styles.d.ts +1 -0
- package/dist/FxChip/styles/chip.styles.js +21 -0
- package/package.json +1 -1
|
@@ -26,5 +26,6 @@ export type AsyncDropdownPropsType = {
|
|
|
26
26
|
modal_type?: string;
|
|
27
27
|
query: string;
|
|
28
28
|
isInitialOpen?: boolean;
|
|
29
|
+
placeholder?: string;
|
|
29
30
|
};
|
|
30
31
|
export declare const FxAsyncDropdown: React.ForwardRefExoticComponent<Omit<AsyncDropdownPropsType, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -120,7 +120,7 @@ const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox,
|
|
|
120
120
|
fontSize: "small"
|
|
121
121
|
});
|
|
122
122
|
const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
123
|
-
const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen } = props;
|
|
123
|
+
const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder } = props;
|
|
124
124
|
const ref = (0, _react.useRef)(null);
|
|
125
125
|
const theme = (0, _material.useTheme)();
|
|
126
126
|
const [displayed, setDisplayed] = (0, _react.useState)(multiple ? [] : '');
|
|
@@ -555,7 +555,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
555
555
|
children: [
|
|
556
556
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
557
557
|
autoFocus: true,
|
|
558
|
-
placeholder:
|
|
558
|
+
placeholder: placeholder || 'Select an option...',
|
|
559
559
|
onChange: (e)=>{
|
|
560
560
|
handleSearch(e);
|
|
561
561
|
},
|
package/dist/FxChip/FxChip.d.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EntityStatusType, ChargeStateType, InvoiceStateType, RecoStateType } from '@fixefy/fixefy-ui-utils';
|
|
3
|
-
type ChipType = {
|
|
4
|
-
score: string;
|
|
5
|
-
status: EntityStatusType | ChargeStateType | InvoiceStateType | RecoStateType;
|
|
6
|
-
};
|
|
7
3
|
export interface ChipPropsType {
|
|
8
4
|
status?: EntityStatusType | ChargeStateType | InvoiceStateType | RecoStateType;
|
|
9
5
|
label: string | number;
|
|
10
6
|
variant?: 'outlined' | 'filled';
|
|
11
|
-
type?:
|
|
7
|
+
type?: 'status' | 'priority' | 'score';
|
|
12
8
|
scoreValue?: number;
|
|
13
9
|
minimized?: boolean;
|
|
14
10
|
[x: string]: any;
|
|
@@ -16,4 +12,3 @@ export interface ChipPropsType {
|
|
|
16
12
|
onDelete?: (e: any) => void;
|
|
17
13
|
}
|
|
18
14
|
export declare const FxChip: (props: ChipPropsType) => React.JSX.Element;
|
|
19
|
-
export {};
|
package/dist/FxChip/FxChip.js
CHANGED
|
@@ -22,24 +22,34 @@ const FxChip = (props)=>{
|
|
|
22
22
|
const { status, label, type = 'status', scoreValue = 0, minimized = false, variant = 'outlined', onClick, onDelete } = props;
|
|
23
23
|
const newStatus = status ? status.split(' ').join('_') : status;
|
|
24
24
|
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
|
-
|
|
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
|
+
});
|
|
54
|
+
}
|
|
45
55
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const ScoreChipStyled: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
2
2
|
export declare const StatusChipStyled: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
3
|
+
export declare const PriorityChipStyled: StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
@@ -9,6 +9,9 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
PriorityChipStyled: function() {
|
|
13
|
+
return PriorityChipStyled;
|
|
14
|
+
},
|
|
12
15
|
ScoreChipStyled: function() {
|
|
13
16
|
return ScoreChipStyled;
|
|
14
17
|
},
|
|
@@ -59,3 +62,21 @@ const StatusChipStyled = (0, _styles.styled)(_material.Chip)(({ theme, status, v
|
|
|
59
62
|
border: `1px solid ${border}`
|
|
60
63
|
};
|
|
61
64
|
});
|
|
65
|
+
const PriorityChipStyled = (0, _styles.styled)(_material.Chip)(({ theme, status })=>{
|
|
66
|
+
const backgroundColor = theme.palette.chipPriority[status].background;
|
|
67
|
+
const labelColor = theme.palette.chipPriority[status].label;
|
|
68
|
+
const border = theme.palette.chipPriority[status].border;
|
|
69
|
+
return {
|
|
70
|
+
height: 20,
|
|
71
|
+
minWidth: 80,
|
|
72
|
+
maxWidth: 120,
|
|
73
|
+
['& .MuiChip-label']: {
|
|
74
|
+
fontSize: 9,
|
|
75
|
+
fontWeight: 600,
|
|
76
|
+
lineHeight: '12px',
|
|
77
|
+
color: labelColor ? labelColor : theme.palette.statistics.label
|
|
78
|
+
},
|
|
79
|
+
backgroundColor,
|
|
80
|
+
border: `1px solid ${border}`
|
|
81
|
+
};
|
|
82
|
+
});
|
package/package.json
CHANGED