@flozy/editor 5.2.8 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/ChatEditor.js +34 -25
- package/dist/Editor/CommonEditor.js +11 -17
- package/dist/Editor/Editor.css +16 -14
- package/dist/Editor/Elements/AI/AIInput.js +3 -0
- package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
- package/dist/Editor/Elements/Button/EditorButton.js +2 -8
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +2 -4
- package/dist/Editor/Elements/Form/Form.js +0 -1
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +1 -2
- package/dist/Editor/Elements/List/CheckList.js +1 -2
- package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
- package/dist/Editor/Elements/SimpleText/index.js +1 -8
- package/dist/Editor/Elements/SimpleText/style.js +1 -10
- package/dist/Editor/Elements/Table/Table.js +1 -1
- package/dist/Editor/Elements/TopBanner/TopBanner.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +0 -10
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -45
- package/dist/Editor/Toolbar/Toolbar.js +0 -6
- package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
- package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
- package/dist/Editor/common/Icon.js +0 -6
- package/dist/Editor/common/MentionsPopup/Styles.js +5 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
- package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
- package/dist/Editor/common/RnD/ShadowElement.js +1 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +6 -9
- package/dist/Editor/common/Shorthands/elements.js +1 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
- package/dist/Editor/common/Uploader.js +0 -8
- package/dist/Editor/common/iconListV2.js +53 -53
- package/dist/Editor/common/iconslist.js +3 -6
- package/dist/Editor/commonStyle.js +0 -9
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +1 -24
- package/dist/Editor/hooks/useMouseMove.js +2 -5
- package/dist/Editor/plugins/withEmbeds.js +26 -30
- package/dist/Editor/plugins/withHTML.js +2 -42
- package/dist/Editor/plugins/withLayout.js +0 -42
- package/dist/Editor/utils/SlateUtilityFunctions.js +1 -24
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +1 -26
- package/dist/Editor/utils/events.js +1 -0
- package/dist/Editor/utils/helper.js +1 -51
- package/dist/Editor/utils/pageSettings.js +2 -14
- package/dist/Editor/utils/serializeToText.js +0 -2
- package/package.json +1 -1
- package/dist/Editor/Elements/DataView/DataView.js +0 -124
- package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -68
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -33
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -162
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -40
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -67
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -35
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -39
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -74
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -64
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -106
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -174
- package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -37
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -111
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -60
- package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -36
- package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -160
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -190
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -42
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -30
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
- package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -179
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -112
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -227
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -81
- package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -273
- package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
- package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -74
- package/dist/Editor/Elements/DataView/styles.js +0 -154
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
- package/dist/Editor/helper/enforceDateFormat.js +0 -41
- package/dist/Editor/utils/dataView.js +0 -43
@@ -1,33 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Checkbox from "@mui/material/Checkbox";
|
4
|
-
import Icon from "../../../../common/Icon";
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
-
const CheckType = props => {
|
7
|
-
const {
|
8
|
-
rowIndex,
|
9
|
-
property,
|
10
|
-
value,
|
11
|
-
readOnly
|
12
|
-
} = props;
|
13
|
-
const {
|
14
|
-
onChange
|
15
|
-
} = useDataView();
|
16
|
-
const handleChange = e => {
|
17
|
-
onChange(rowIndex, {
|
18
|
-
[property]: e?.target?.checked
|
19
|
-
});
|
20
|
-
};
|
21
|
-
return /*#__PURE__*/_jsx(Checkbox, {
|
22
|
-
checked: value || false,
|
23
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
24
|
-
icon: "checkListButton"
|
25
|
-
}),
|
26
|
-
checkedIcon: /*#__PURE__*/_jsx(Icon, {
|
27
|
-
icon: "checkListButtonActive"
|
28
|
-
}),
|
29
|
-
onChange: handleChange,
|
30
|
-
disabled: readOnly
|
31
|
-
}, rowIndex);
|
32
|
-
};
|
33
|
-
export default CheckType;
|
@@ -1,162 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import TextField from "@mui/material/TextField";
|
3
|
-
import Autocomplete from "@mui/material/Autocomplete";
|
4
|
-
import { Avatar, Box, Chip, useTheme } from "@mui/material";
|
5
|
-
import { useEditorContext } from "../../../../../hooks/useMouseMove";
|
6
|
-
import useCompStyles from "./styles";
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
-
const AvatarIcon = props => {
|
9
|
-
const {
|
10
|
-
option,
|
11
|
-
avatar
|
12
|
-
} = props;
|
13
|
-
const nameIndex = option.label || option.value;
|
14
|
-
return avatar && nameIndex ? /*#__PURE__*/_jsx(Avatar, {
|
15
|
-
alt: option.label || option.value,
|
16
|
-
src: option.avatar || null,
|
17
|
-
children: nameIndex[0] || ""
|
18
|
-
}) : null;
|
19
|
-
};
|
20
|
-
const filter = (opt, params, selectedOpt) => {
|
21
|
-
const selectedVals = selectedOpt?.map(m => m?.value);
|
22
|
-
const fv = opt?.filter(f => !selectedVals.includes(f.value));
|
23
|
-
if (params?.inputValue) {
|
24
|
-
return fv.filter(f => f?.value?.toLowerCase().indexOf(params?.inputValue?.toLowerCase()) >= 0);
|
25
|
-
}
|
26
|
-
return fv;
|
27
|
-
};
|
28
|
-
export default function Select(props) {
|
29
|
-
const theme = useTheme();
|
30
|
-
const {
|
31
|
-
theme: appTheme
|
32
|
-
} = useEditorContext();
|
33
|
-
const classes = useCompStyles(theme, appTheme);
|
34
|
-
const {
|
35
|
-
value: pValue,
|
36
|
-
onChange,
|
37
|
-
options,
|
38
|
-
multiple = false,
|
39
|
-
limitTags = 2,
|
40
|
-
placeholder = "",
|
41
|
-
disabled = false,
|
42
|
-
optionAvatar = false
|
43
|
-
} = props;
|
44
|
-
const value = Array.isArray(pValue) ? pValue : [];
|
45
|
-
return /*#__PURE__*/_jsx(Autocomplete, {
|
46
|
-
disabled: disabled,
|
47
|
-
className: "tv-ac-field",
|
48
|
-
multiple: true,
|
49
|
-
limitTags: limitTags,
|
50
|
-
placeholder: placeholder,
|
51
|
-
value: value || "",
|
52
|
-
onChange: (event, newValue) => {
|
53
|
-
const fv = [];
|
54
|
-
newValue?.forEach(m => {
|
55
|
-
if (multiple) {
|
56
|
-
fv.push({
|
57
|
-
value: m.inputValue || m.value
|
58
|
-
});
|
59
|
-
} else {
|
60
|
-
fv[0] = {
|
61
|
-
value: m.inputValue || m.value
|
62
|
-
};
|
63
|
-
}
|
64
|
-
});
|
65
|
-
onChange(fv);
|
66
|
-
},
|
67
|
-
filterOptions: (options, params) => {
|
68
|
-
const filtered = filter(options, params, value);
|
69
|
-
|
70
|
-
// const { inputValue } = params;
|
71
|
-
// Suggest the creation of a new value
|
72
|
-
// const isExisting = options.some(
|
73
|
-
// (option) => inputValue?.toLowerCase() === option.value?.toLowerCase()
|
74
|
-
// );
|
75
|
-
// no need of new val now
|
76
|
-
// if (inputValue !== "" && !isExisting) {
|
77
|
-
// filtered.push({
|
78
|
-
// inputValue,
|
79
|
-
// value: `Add "${inputValue}"`,
|
80
|
-
// });
|
81
|
-
// }
|
82
|
-
|
83
|
-
return filtered;
|
84
|
-
},
|
85
|
-
selectOnFocus: true,
|
86
|
-
clearOnBlur: true,
|
87
|
-
handleHomeEndKeys: true,
|
88
|
-
options: options || [],
|
89
|
-
getOptionLabel: option => {
|
90
|
-
// Value selected with enter, right from the input
|
91
|
-
if (typeof option === "string") {
|
92
|
-
return option;
|
93
|
-
}
|
94
|
-
// Add "xxx" option created dynamically
|
95
|
-
if (option.inputValue) {
|
96
|
-
return option.inputValue;
|
97
|
-
}
|
98
|
-
// Regular option
|
99
|
-
return option.value || "";
|
100
|
-
},
|
101
|
-
renderTags: (value, getTagProps) => {
|
102
|
-
return /*#__PURE__*/_jsx(Box, {
|
103
|
-
className: "tv-ms-tag-wrpr",
|
104
|
-
children: value?.map((option, index) => {
|
105
|
-
const {
|
106
|
-
key,
|
107
|
-
...tagProps
|
108
|
-
} = getTagProps({
|
109
|
-
index
|
110
|
-
}) || {};
|
111
|
-
return option?.value ? /*#__PURE__*/_jsx(Chip, {
|
112
|
-
variant: "outlined",
|
113
|
-
label: option?.label || option?.value,
|
114
|
-
...tagProps,
|
115
|
-
sx: {
|
116
|
-
background: option?.color || "#CCC",
|
117
|
-
border: "none"
|
118
|
-
},
|
119
|
-
avatar: /*#__PURE__*/_jsx(AvatarIcon, {
|
120
|
-
option: option,
|
121
|
-
avatar: optionAvatar
|
122
|
-
})
|
123
|
-
}, key) : null;
|
124
|
-
})
|
125
|
-
});
|
126
|
-
},
|
127
|
-
renderOption: (props, option) => {
|
128
|
-
const {
|
129
|
-
key,
|
130
|
-
...optionProps
|
131
|
-
} = props;
|
132
|
-
return /*#__PURE__*/_jsx("li", {
|
133
|
-
...optionProps,
|
134
|
-
children: /*#__PURE__*/_jsx(Chip, {
|
135
|
-
label: option.label || option.value || "",
|
136
|
-
sx: {
|
137
|
-
background: option.color || "#CCC"
|
138
|
-
},
|
139
|
-
avatar: /*#__PURE__*/_jsx(AvatarIcon, {
|
140
|
-
option: option,
|
141
|
-
avatar: optionAvatar
|
142
|
-
})
|
143
|
-
})
|
144
|
-
}, key);
|
145
|
-
},
|
146
|
-
freeSolo: true,
|
147
|
-
size: "small",
|
148
|
-
fullWidth: true,
|
149
|
-
renderInput: params => {
|
150
|
-
return /*#__PURE__*/_jsx(TextField, {
|
151
|
-
size: "small",
|
152
|
-
...params,
|
153
|
-
placeholder: placeholder
|
154
|
-
});
|
155
|
-
},
|
156
|
-
slotProps: {
|
157
|
-
paper: {
|
158
|
-
sx: classes.autocomplete
|
159
|
-
}
|
160
|
-
}
|
161
|
-
});
|
162
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { MenuItem, Select, useTheme } from "@mui/material";
|
3
|
-
import { useEditorContext } from "../../../../../hooks/useMouseMove";
|
4
|
-
import useCompStyles from "./styles";
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
-
const SimpleSelect = props => {
|
7
|
-
const theme = useTheme();
|
8
|
-
const {
|
9
|
-
theme: appTheme
|
10
|
-
} = useEditorContext();
|
11
|
-
const classes = useCompStyles(theme, appTheme);
|
12
|
-
const {
|
13
|
-
value,
|
14
|
-
options,
|
15
|
-
handleChange,
|
16
|
-
disabled = false
|
17
|
-
} = props;
|
18
|
-
console.log(classes);
|
19
|
-
return /*#__PURE__*/_jsx(Select, {
|
20
|
-
disabled: disabled,
|
21
|
-
value: value,
|
22
|
-
onChange: handleChange,
|
23
|
-
fullWidth: true,
|
24
|
-
size: "small",
|
25
|
-
MenuProps: {
|
26
|
-
PaperProps: {
|
27
|
-
sx: classes.simpleselect,
|
28
|
-
className: "tv-cf-opt-wrpr"
|
29
|
-
}
|
30
|
-
},
|
31
|
-
children: options?.map((m, i) => {
|
32
|
-
return /*#__PURE__*/_jsx(MenuItem, {
|
33
|
-
value: m.key,
|
34
|
-
className: "tv-cf-opt-wrpr",
|
35
|
-
children: m.label
|
36
|
-
}, i);
|
37
|
-
})
|
38
|
-
});
|
39
|
-
};
|
40
|
-
export default SimpleSelect;
|
@@ -1,67 +0,0 @@
|
|
1
|
-
const useCompStyles = (theme, appTheme) => ({
|
2
|
-
simpleselect: {
|
3
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
4
|
-
background: appTheme?.palette?.editor?.tv_pop_bg,
|
5
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
6
|
-
borderRadius: "8px",
|
7
|
-
[theme?.breakpoints?.between("xs", "md")]: {},
|
8
|
-
"& ul": {
|
9
|
-
padding: "4px",
|
10
|
-
"& li": {
|
11
|
-
padding: "4px 6px",
|
12
|
-
borderRadius: "8px",
|
13
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
14
|
-
fontSize: "14px",
|
15
|
-
marginTop: "4px",
|
16
|
-
"&.Mui-selected": {
|
17
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
18
|
-
color: appTheme?.palette?.editor?.tv_hover_text,
|
19
|
-
"&:hover": {
|
20
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
21
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
22
|
-
}
|
23
|
-
},
|
24
|
-
"&:hover": {
|
25
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
26
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
},
|
31
|
-
autocomplete: {
|
32
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
33
|
-
background: appTheme?.palette?.editor?.tv_pop_bg,
|
34
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
35
|
-
borderRadius: "8px",
|
36
|
-
"& ul": {
|
37
|
-
padding: "4px",
|
38
|
-
"& .MuiAutocomplete-option": {
|
39
|
-
padding: "4px 6px",
|
40
|
-
borderRadius: "8px",
|
41
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
42
|
-
fontSize: "14px",
|
43
|
-
"& .MuiAvatar-root": {
|
44
|
-
width: "20px",
|
45
|
-
height: "20px",
|
46
|
-
marginLeft: "8px",
|
47
|
-
fontSize: "16px",
|
48
|
-
padding: "2px",
|
49
|
-
textTransform: "capitalize"
|
50
|
-
},
|
51
|
-
"&.Mui-selected": {
|
52
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
53
|
-
color: appTheme?.palette?.editor?.tv_hover_text,
|
54
|
-
"&:hover": {
|
55
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
56
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
57
|
-
}
|
58
|
-
},
|
59
|
-
"&:hover": {
|
60
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
61
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
|
-
});
|
67
|
-
export default useCompStyles;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import DatePicker from "react-datepicker";
|
3
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
function isValidDate(dateString) {
|
6
|
-
const date = new Date(dateString);
|
7
|
-
return !isNaN(date.getTime());
|
8
|
-
}
|
9
|
-
const DateType = props => {
|
10
|
-
const {
|
11
|
-
rowIndex,
|
12
|
-
property,
|
13
|
-
value,
|
14
|
-
readOnly
|
15
|
-
} = props;
|
16
|
-
const {
|
17
|
-
onChange
|
18
|
-
} = useDataView();
|
19
|
-
const handleChange = date => {
|
20
|
-
onChange(rowIndex, {
|
21
|
-
[property]: date
|
22
|
-
});
|
23
|
-
};
|
24
|
-
return /*#__PURE__*/_jsx(DatePicker, {
|
25
|
-
disabled: readOnly,
|
26
|
-
selected: isValidDate(value) ? new Date(value) : "",
|
27
|
-
onChange: handleChange,
|
28
|
-
onKeyDown: e => {
|
29
|
-
e.preventDefault();
|
30
|
-
console.log(e?.target.value);
|
31
|
-
},
|
32
|
-
placeholderText: "MM/DD/YYYY"
|
33
|
-
});
|
34
|
-
};
|
35
|
-
export default DateType;
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Select from "./Components/Select";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const MultiSelectType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value: pValue,
|
10
|
-
options,
|
11
|
-
label = "",
|
12
|
-
readOnly
|
13
|
-
} = props;
|
14
|
-
const {
|
15
|
-
onChange
|
16
|
-
} = useDataView();
|
17
|
-
const value = Array.isArray(pValue) ? pValue : [];
|
18
|
-
const coloredValues = [...(value || [])]?.map(m => {
|
19
|
-
return {
|
20
|
-
...m,
|
21
|
-
color: options?.find(f => f.value === m.value)?.color || "#FFF"
|
22
|
-
};
|
23
|
-
});
|
24
|
-
const handleChange = data => {
|
25
|
-
onChange(rowIndex, {
|
26
|
-
[property]: data?.filter(f => f?.value)
|
27
|
-
});
|
28
|
-
};
|
29
|
-
return /*#__PURE__*/_jsx(Select, {
|
30
|
-
value: coloredValues,
|
31
|
-
onChange: handleChange,
|
32
|
-
options: options,
|
33
|
-
multiple: true,
|
34
|
-
limitTags: 2,
|
35
|
-
placeholder: label,
|
36
|
-
disabled: readOnly
|
37
|
-
});
|
38
|
-
};
|
39
|
-
export default MultiSelectType;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { TextField } from "@mui/material";
|
3
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const NumberType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
readOnly
|
11
|
-
} = props;
|
12
|
-
const {
|
13
|
-
onChange
|
14
|
-
} = useDataView();
|
15
|
-
const handleChange = e => {
|
16
|
-
onChange(rowIndex, {
|
17
|
-
[property]: e?.target?.value
|
18
|
-
});
|
19
|
-
};
|
20
|
-
return /*#__PURE__*/_jsx(TextField, {
|
21
|
-
type: "number",
|
22
|
-
fullWidth: true,
|
23
|
-
className: "fe-tv-type_text",
|
24
|
-
value: value,
|
25
|
-
size: "small",
|
26
|
-
onChange: handleChange,
|
27
|
-
disabled: readOnly
|
28
|
-
});
|
29
|
-
};
|
30
|
-
export default NumberType;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Select from "./Components/Select";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const PersonType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
readOnly
|
11
|
-
} = props;
|
12
|
-
const {
|
13
|
-
onChange,
|
14
|
-
users
|
15
|
-
} = useDataView();
|
16
|
-
const handleChange = data => {
|
17
|
-
onChange(rowIndex, {
|
18
|
-
[property]: data?.filter(f => f?.value)
|
19
|
-
});
|
20
|
-
};
|
21
|
-
return /*#__PURE__*/_jsx(Select, {
|
22
|
-
value: value || [],
|
23
|
-
onChange: handleChange,
|
24
|
-
options: users || [],
|
25
|
-
multiple: false,
|
26
|
-
disabled: readOnly,
|
27
|
-
optionAvatar: true
|
28
|
-
});
|
29
|
-
};
|
30
|
-
export default PersonType;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Select from "./Components/Select";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const SelectType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
options,
|
11
|
-
readOnly
|
12
|
-
} = props;
|
13
|
-
const {
|
14
|
-
onChange
|
15
|
-
} = useDataView();
|
16
|
-
const coloredValues = [...(value || [])]?.map(m => {
|
17
|
-
return {
|
18
|
-
...m,
|
19
|
-
color: options?.find(f => f.value === m.value)?.color
|
20
|
-
};
|
21
|
-
});
|
22
|
-
const handleChange = data => {
|
23
|
-
onChange(rowIndex, {
|
24
|
-
[property]: data?.filter(f => f?.value)
|
25
|
-
});
|
26
|
-
};
|
27
|
-
return /*#__PURE__*/_jsx(Select, {
|
28
|
-
value: coloredValues,
|
29
|
-
onChange: handleChange,
|
30
|
-
options: options,
|
31
|
-
multiple: false,
|
32
|
-
disabled: readOnly
|
33
|
-
});
|
34
|
-
};
|
35
|
-
export default SelectType;
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { TextField } from "@mui/material";
|
3
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const TextType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
readOnly
|
11
|
-
} = props;
|
12
|
-
const {
|
13
|
-
onChange
|
14
|
-
} = useDataView();
|
15
|
-
const handleChange = e => {
|
16
|
-
onChange(rowIndex, {
|
17
|
-
[property]: e?.target?.value
|
18
|
-
});
|
19
|
-
};
|
20
|
-
const formatValue = () => {
|
21
|
-
if (typeof value === "string") {
|
22
|
-
return value;
|
23
|
-
} else if (value[0]) {
|
24
|
-
return value?.map(m => m.value).join(", ");
|
25
|
-
}
|
26
|
-
};
|
27
|
-
return /*#__PURE__*/_jsx(TextField, {
|
28
|
-
fullWidth: true,
|
29
|
-
className: "fe-tv-type_text",
|
30
|
-
value: formatValue(value),
|
31
|
-
size: "small",
|
32
|
-
onChange: handleChange,
|
33
|
-
disabled: readOnly
|
34
|
-
});
|
35
|
-
};
|
36
|
-
export default TextType;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import TextType from "./TextType";
|
2
|
-
import DateType from "./DateType";
|
3
|
-
import SelectType from "./SelectType";
|
4
|
-
import MultiSelectType from "./MultiSelectType";
|
5
|
-
import NumberType from "./NumberType";
|
6
|
-
import CheckType from "./CheckType";
|
7
|
-
import PersonType from "./PersonType";
|
8
|
-
const DataTypes = {
|
9
|
-
text: TextType,
|
10
|
-
date: DateType,
|
11
|
-
select: SelectType,
|
12
|
-
"multi-select": MultiSelectType,
|
13
|
-
number: NumberType,
|
14
|
-
check: CheckType,
|
15
|
-
person: PersonType
|
16
|
-
};
|
17
|
-
export default DataTypes;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Box } from "@mui/material";
|
3
|
-
import SimpleSelect from "../../DataTypes/Components/SimpleSelect";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const ChooseField = props => {
|
6
|
-
const {
|
7
|
-
sort,
|
8
|
-
properties,
|
9
|
-
onChange
|
10
|
-
} = props;
|
11
|
-
const handleChange = e => {
|
12
|
-
onChange(sort, {
|
13
|
-
newKey: e?.target?.value
|
14
|
-
});
|
15
|
-
};
|
16
|
-
return /*#__PURE__*/_jsx(Box, {
|
17
|
-
sx: {
|
18
|
-
width: "120px",
|
19
|
-
mr: 1
|
20
|
-
},
|
21
|
-
className: "tv-cf",
|
22
|
-
children: /*#__PURE__*/_jsx(SimpleSelect, {
|
23
|
-
value: sort?.key,
|
24
|
-
options: properties,
|
25
|
-
handleChange: handleChange
|
26
|
-
})
|
27
|
-
});
|
28
|
-
};
|
29
|
-
export default ChooseField;
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Box } from "@mui/material";
|
3
|
-
import SimpleSelect from "../../DataTypes/Components/SimpleSelect";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const SORT_LABELS = {
|
6
|
-
asc: "Ascending",
|
7
|
-
desc: "Descending"
|
8
|
-
};
|
9
|
-
const SORT_OPTIONS = [{
|
10
|
-
key: "asc",
|
11
|
-
label: SORT_LABELS.asc
|
12
|
-
}, {
|
13
|
-
key: "desc",
|
14
|
-
label: SORT_LABELS.desc
|
15
|
-
}];
|
16
|
-
const ChooseSort = props => {
|
17
|
-
const {
|
18
|
-
sort,
|
19
|
-
onChange
|
20
|
-
} = props;
|
21
|
-
const handleChange = e => {
|
22
|
-
onChange(sort, {
|
23
|
-
operator: e?.target?.value
|
24
|
-
});
|
25
|
-
};
|
26
|
-
return /*#__PURE__*/_jsx(Box, {
|
27
|
-
sx: {
|
28
|
-
width: "120px"
|
29
|
-
},
|
30
|
-
className: "tv-cf",
|
31
|
-
children: /*#__PURE__*/_jsx(SimpleSelect, {
|
32
|
-
value: sort?.operator,
|
33
|
-
options: SORT_OPTIONS,
|
34
|
-
handleChange: handleChange
|
35
|
-
})
|
36
|
-
});
|
37
|
-
};
|
38
|
-
export default ChooseSort;
|
@@ -1,74 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Box, List, ListItem, ListItemButton, ListItemIcon, ListItemText } from "@mui/material";
|
3
|
-
import { useDataView } from "../../../Providers/DataViewProvider";
|
4
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
5
|
-
import ChooseSort from "./ChooseSort";
|
6
|
-
import ChooseField from "./ChooseField";
|
7
|
-
import ColumnsList from "../../Options/ColumnsList";
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
-
const SortOptions = props => {
|
11
|
-
const {
|
12
|
-
onClose
|
13
|
-
} = props;
|
14
|
-
const {
|
15
|
-
properties,
|
16
|
-
sort,
|
17
|
-
onUpdateSort
|
18
|
-
} = useDataView();
|
19
|
-
const handleSortChange = (currentSortData, data = {}) => {
|
20
|
-
onUpdateSort({
|
21
|
-
...currentSortData,
|
22
|
-
...data
|
23
|
-
});
|
24
|
-
};
|
25
|
-
const handleDelete = () => {
|
26
|
-
onClose();
|
27
|
-
onUpdateSort({}, false, true);
|
28
|
-
};
|
29
|
-
const onSelect = s => () => {
|
30
|
-
onUpdateSort({
|
31
|
-
...s,
|
32
|
-
newKey: s.key,
|
33
|
-
operator: "asc"
|
34
|
-
}, false, false);
|
35
|
-
onClose();
|
36
|
-
};
|
37
|
-
return sort?.length > 0 ? /*#__PURE__*/_jsxs(List, {
|
38
|
-
className: "tv-opt-list",
|
39
|
-
sx: {
|
40
|
-
p: 0
|
41
|
-
},
|
42
|
-
children: [sort?.map((m, i) => {
|
43
|
-
return /*#__PURE__*/_jsx(ListItem, {
|
44
|
-
sx: {
|
45
|
-
justifyContent: "space-between"
|
46
|
-
},
|
47
|
-
children: /*#__PURE__*/_jsxs(Box, {
|
48
|
-
sx: {
|
49
|
-
display: "flex"
|
50
|
-
},
|
51
|
-
children: [/*#__PURE__*/_jsx(ChooseField, {
|
52
|
-
sort: m,
|
53
|
-
properties: properties,
|
54
|
-
onChange: handleSortChange
|
55
|
-
}), /*#__PURE__*/_jsx(ChooseSort, {
|
56
|
-
sort: m,
|
57
|
-
onChange: handleSortChange
|
58
|
-
})]
|
59
|
-
})
|
60
|
-
}, i);
|
61
|
-
}), /*#__PURE__*/_jsxs(ListItemButton, {
|
62
|
-
onClick: handleDelete,
|
63
|
-
children: [/*#__PURE__*/_jsx(ListItemIcon, {
|
64
|
-
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
65
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
66
|
-
children: "Delete Sort"
|
67
|
-
})]
|
68
|
-
})]
|
69
|
-
}) : /*#__PURE__*/_jsx(ColumnsList, {
|
70
|
-
properties: properties,
|
71
|
-
onSelect: onSelect
|
72
|
-
});
|
73
|
-
};
|
74
|
-
export default SortOptions;
|