@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,179 +0,0 @@
|
|
1
|
-
const useOptionsStyles = (theme, appTheme) => ({
|
2
|
-
popover: {
|
3
|
-
"& .MuiPaper-root": {
|
4
|
-
boxShadow: "0px 4px 10px 0px rgba(0, 0, 0, 0.16)",
|
5
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
6
|
-
borderRadius: "12px",
|
7
|
-
background: appTheme?.palette?.editor?.tv_pop_bg,
|
8
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
9
|
-
[theme?.breakpoints?.between("xs", "md")]: {
|
10
|
-
borderRadius: "16px 16px 0px 0px",
|
11
|
-
maxHeight: "50%"
|
12
|
-
},
|
13
|
-
"& .tv-act-ico": {
|
14
|
-
color: appTheme?.palette?.editor?.tv_text,
|
15
|
-
"&.br1": {
|
16
|
-
borderRadius: "6px"
|
17
|
-
},
|
18
|
-
"&.bg": {
|
19
|
-
background: appTheme?.palette?.editor?.tv_ico_bg,
|
20
|
-
"&:hover": {
|
21
|
-
background: "rgba(100, 116, 139, 0.12)"
|
22
|
-
}
|
23
|
-
},
|
24
|
-
"& svg": {
|
25
|
-
width: "16px",
|
26
|
-
height: "16px"
|
27
|
-
}
|
28
|
-
},
|
29
|
-
"& .MuiInputBase-root": {
|
30
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
31
|
-
fontSize: "14px",
|
32
|
-
background: appTheme?.palette?.editor?.tv_input_bg,
|
33
|
-
borderRadius: "8px"
|
34
|
-
},
|
35
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
36
|
-
borderRadius: "8px",
|
37
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`
|
38
|
-
},
|
39
|
-
"& .MuiList-root": {
|
40
|
-
padding: "4px 2px",
|
41
|
-
"& .MuiListItemButton-root": {
|
42
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
43
|
-
padding: "2px 4px",
|
44
|
-
borderRadius: "8px",
|
45
|
-
"& .MuiListItemIcon-root": {
|
46
|
-
minWidth: "38px",
|
47
|
-
"&.needBg": {
|
48
|
-
minWidth: "20px",
|
49
|
-
width: "20px",
|
50
|
-
height: "20px",
|
51
|
-
alignItems: "center",
|
52
|
-
justifyContent: "center",
|
53
|
-
borderRadius: "4px",
|
54
|
-
marginRight: "12px",
|
55
|
-
background: appTheme?.palette?.editor?.tv_ico_bg
|
56
|
-
},
|
57
|
-
color: `${appTheme?.palette?.editor?.tv_text} !important`,
|
58
|
-
"& svg": {
|
59
|
-
width: "16px"
|
60
|
-
}
|
61
|
-
},
|
62
|
-
"& .MuiTypography-root": {
|
63
|
-
fontSize: "14px"
|
64
|
-
},
|
65
|
-
"&:hover": {
|
66
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
67
|
-
color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
|
68
|
-
"& .MuiListItemIcon-root": {
|
69
|
-
color: `${appTheme?.palette?.editor?.tv_hover_text} !important`
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
},
|
74
|
-
"& .st": {
|
75
|
-
borderTop: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
76
|
-
marginTop: "8px",
|
77
|
-
paddingTop: "8px"
|
78
|
-
},
|
79
|
-
"& .sb": {
|
80
|
-
borderBottom: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
81
|
-
marginBottom: "8px",
|
82
|
-
paddingBottom: "8px"
|
83
|
-
},
|
84
|
-
"& .mt": {
|
85
|
-
marginTop: "8px"
|
86
|
-
},
|
87
|
-
"& .mt-1": {
|
88
|
-
marginTop: "12px"
|
89
|
-
},
|
90
|
-
"& .mb": {
|
91
|
-
marginBottom: "8px"
|
92
|
-
},
|
93
|
-
"& .mb-1": {
|
94
|
-
marginBottom: "12px"
|
95
|
-
},
|
96
|
-
"& .ml": {
|
97
|
-
marginLeft: "8px"
|
98
|
-
},
|
99
|
-
"& .mb-0": {
|
100
|
-
marginBottom: "0px"
|
101
|
-
},
|
102
|
-
"& .ml-0": {
|
103
|
-
marginLeft: "0px !important"
|
104
|
-
},
|
105
|
-
"& .pl-0": {
|
106
|
-
paddingLeft: "0px"
|
107
|
-
},
|
108
|
-
"& .label-desc": {},
|
109
|
-
"& .MuiFormControlLabel-root": {
|
110
|
-
alignItems: "flex-start",
|
111
|
-
margin: "0px 0px 0px 0px",
|
112
|
-
width: "100%",
|
113
|
-
"& .MuiFormControlLabel-label": {
|
114
|
-
marginBottom: "8px",
|
115
|
-
fontSize: "14px"
|
116
|
-
}
|
117
|
-
},
|
118
|
-
"& .label-tp": {
|
119
|
-
fontFamily: '"Roboto","Helvetica","Arial",sans-serif',
|
120
|
-
fontSize: "14px"
|
121
|
-
},
|
122
|
-
"& .MuiInputBase-input": {
|
123
|
-
height: "32px",
|
124
|
-
padding: "4px 8px"
|
125
|
-
},
|
126
|
-
"& .more-btn-cbs": {
|
127
|
-
color: appTheme?.palette?.editor?.tv_text_primary
|
128
|
-
}
|
129
|
-
}
|
130
|
-
},
|
131
|
-
addProperty: {
|
132
|
-
padding: "12px",
|
133
|
-
width: "253px",
|
134
|
-
"& .fe-dv-ap-title": {
|
135
|
-
display: "flex",
|
136
|
-
fontWeight: "bold",
|
137
|
-
padding: "0px 0px 12px 0px",
|
138
|
-
justifyContent: "space-between",
|
139
|
-
fontSize: "14px",
|
140
|
-
alignItems: "center",
|
141
|
-
borderBottom: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
142
|
-
marginBottom: "8px",
|
143
|
-
"& span": {
|
144
|
-
display: "flex",
|
145
|
-
alignItems: "center"
|
146
|
-
}
|
147
|
-
},
|
148
|
-
"& .fe-dv-ap-desc": {
|
149
|
-
fontSize: "12px",
|
150
|
-
color: "rgba(148, 163, 184, 1)"
|
151
|
-
},
|
152
|
-
"& .fe-dv-ap-opt-list": {
|
153
|
-
margin: "12px 0px"
|
154
|
-
},
|
155
|
-
"& .fe-tv-addopt": {
|
156
|
-
marginTop: "8px",
|
157
|
-
paddingLeft: "4px",
|
158
|
-
"& .MuiList-root": {
|
159
|
-
maxHeight: "200px",
|
160
|
-
overflowY: "auto"
|
161
|
-
},
|
162
|
-
"& .MuiFormHelperText-root": {
|
163
|
-
color: "red",
|
164
|
-
marginLeft: "2px",
|
165
|
-
marginTop: "4px"
|
166
|
-
}
|
167
|
-
},
|
168
|
-
"& .fe-tv-opt-sub-title": {
|
169
|
-
display: "flex",
|
170
|
-
alignItems: "center",
|
171
|
-
justifyContent: "space-between",
|
172
|
-
marginBottom: "8px"
|
173
|
-
},
|
174
|
-
[theme?.breakpoints?.between("xs", "md")]: {
|
175
|
-
width: "calc(100% - 24px)"
|
176
|
-
}
|
177
|
-
}
|
178
|
-
});
|
179
|
-
export default useOptionsStyles;
|
@@ -1,112 +0,0 @@
|
|
1
|
-
const useTableStyles = (theme, appTheme) => ({
|
2
|
-
root: {
|
3
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
4
|
-
borderRadius: "7px 7px 0px 0px",
|
5
|
-
overflowX: "auto",
|
6
|
-
[theme?.breakpoints?.between("xs", "md")]: {}
|
7
|
-
},
|
8
|
-
table: {
|
9
|
-
borderCollapse: "separate",
|
10
|
-
borderSpacing: 0,
|
11
|
-
borderRadius: "7px 7px 0px 0px",
|
12
|
-
overflow: "hidden",
|
13
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
14
|
-
"& thead": {
|
15
|
-
background: appTheme?.palette?.editor?.tv_header,
|
16
|
-
height: "40px"
|
17
|
-
},
|
18
|
-
"& th": {
|
19
|
-
"& svg": {
|
20
|
-
"& .fillStroke": {
|
21
|
-
stroke: appTheme?.palette?.editor?.tv_stroke
|
22
|
-
}
|
23
|
-
}
|
24
|
-
},
|
25
|
-
"& td": {
|
26
|
-
height: "40px",
|
27
|
-
"& input": {
|
28
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
29
|
-
background: "transparent"
|
30
|
-
}
|
31
|
-
},
|
32
|
-
"& th, tr, td": {
|
33
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`
|
34
|
-
},
|
35
|
-
"& .tv-act-btn": {
|
36
|
-
color: appTheme?.palette?.editor?.tv_text,
|
37
|
-
textTransform: "none",
|
38
|
-
"&.ico": {
|
39
|
-
"& svg": {
|
40
|
-
color: appTheme?.palette?.editor?.tv_text
|
41
|
-
}
|
42
|
-
},
|
43
|
-
"&:hover": {
|
44
|
-
color: "rgba(37, 99, 235, 1)",
|
45
|
-
"& svg": {
|
46
|
-
color: "rgba(37, 99, 235, 1)"
|
47
|
-
}
|
48
|
-
}
|
49
|
-
},
|
50
|
-
"& .la": {
|
51
|
-
justifyContent: "start"
|
52
|
-
},
|
53
|
-
"& .react-datepicker__input-container": {
|
54
|
-
"& input": {
|
55
|
-
border: "0px solid transparent"
|
56
|
-
}
|
57
|
-
},
|
58
|
-
"& .tv-ac-field": {
|
59
|
-
"&.MuiAutocomplete-root": {
|
60
|
-
"& .MuiAutocomplete-inputRoot": {
|
61
|
-
display: "flex",
|
62
|
-
flexWrap: "nowrap",
|
63
|
-
paddingTop: "3px",
|
64
|
-
paddingBottom: "3px",
|
65
|
-
paddingLeft: "3px",
|
66
|
-
maxWidth: "250px",
|
67
|
-
overflow: "hidden",
|
68
|
-
position: "relative",
|
69
|
-
"& .tv-ms-tag-wrpr": {
|
70
|
-
display: "flex",
|
71
|
-
flexWrap: "nowrap",
|
72
|
-
overflow: "auto"
|
73
|
-
},
|
74
|
-
"&.Mui-disabled": {
|
75
|
-
"& input": {
|
76
|
-
display: "none"
|
77
|
-
},
|
78
|
-
"& .tv-ms-tag-wrpr": {
|
79
|
-
"& .MuiSvgIcon-root": {
|
80
|
-
display: "none"
|
81
|
-
}
|
82
|
-
}
|
83
|
-
}
|
84
|
-
},
|
85
|
-
"& .MuiAutocomplete-clearIndicator": {
|
86
|
-
"& svg": {
|
87
|
-
color: appTheme?.palette?.editor?.tv_text
|
88
|
-
}
|
89
|
-
},
|
90
|
-
"& .MuiAvatar-root": {
|
91
|
-
width: "20px",
|
92
|
-
height: "20px",
|
93
|
-
marginLeft: "8px",
|
94
|
-
fontSize: "16px",
|
95
|
-
padding: "2px",
|
96
|
-
textTransform: "capitalize"
|
97
|
-
},
|
98
|
-
"& .MuiChip-label": {
|
99
|
-
paddingLeft: "6px",
|
100
|
-
paddingRight: "8px"
|
101
|
-
}
|
102
|
-
}
|
103
|
-
},
|
104
|
-
"& .Mui-disabled": {
|
105
|
-
WebkitTextFillColor: "#000 !important",
|
106
|
-
"& .MuiChip-root": {
|
107
|
-
opacity: 1
|
108
|
-
}
|
109
|
-
}
|
110
|
-
}
|
111
|
-
});
|
112
|
-
export default useTableStyles;
|
@@ -1,227 +0,0 @@
|
|
1
|
-
import React, { useState } from "react";
|
2
|
-
import { Box, Button, useTheme } from "@mui/material";
|
3
|
-
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
4
|
-
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
5
|
-
import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
|
6
|
-
import { useDataView } from "../Providers/DataViewProvider";
|
7
|
-
import PropertySettings from "./Options";
|
8
|
-
import { PROPERTY_TYPES } from "./Options/Constants";
|
9
|
-
import useTableStyles from "./TableStyles";
|
10
|
-
import { GridSettingsIcon, GridAddSectionIcon } from "../../../common/iconslist";
|
11
|
-
import { useEditorContext } from "../../../hooks/useMouseMove";
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
13
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
14
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
|
-
const SortIcon = props => {
|
16
|
-
const {
|
17
|
-
sortBy
|
18
|
-
} = props;
|
19
|
-
return sortBy ? sortBy === "asc" ? /*#__PURE__*/_jsx(KeyboardArrowUpIcon, {
|
20
|
-
sx: {
|
21
|
-
color: "rgba(37, 99, 235, 1)"
|
22
|
-
}
|
23
|
-
}) : /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {
|
24
|
-
sx: {
|
25
|
-
color: "rgba(37, 99, 235, 1)"
|
26
|
-
}
|
27
|
-
}) : null;
|
28
|
-
};
|
29
|
-
const TableView = props => {
|
30
|
-
const {
|
31
|
-
theme: appTheme
|
32
|
-
} = useEditorContext();
|
33
|
-
const {
|
34
|
-
children,
|
35
|
-
readOnly
|
36
|
-
} = props;
|
37
|
-
const theme = useTheme();
|
38
|
-
const classes = useTableStyles(theme, appTheme);
|
39
|
-
const {
|
40
|
-
properties,
|
41
|
-
onAddProperty,
|
42
|
-
onUpdateProperty,
|
43
|
-
onUpdateSort,
|
44
|
-
sort,
|
45
|
-
onAddRow
|
46
|
-
} = useDataView();
|
47
|
-
const [sortBy] = sort || [];
|
48
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
49
|
-
const [mode, setMode] = useState({
|
50
|
-
mode: null,
|
51
|
-
edit: null
|
52
|
-
});
|
53
|
-
const open = Boolean(anchorEl);
|
54
|
-
const shownProperties = properties?.filter(f => f.visible);
|
55
|
-
const onAddClick = e => {
|
56
|
-
setMode({
|
57
|
-
type: "addProperty"
|
58
|
-
});
|
59
|
-
setAnchorEl(e.currentTarget);
|
60
|
-
};
|
61
|
-
const onEvent = (type, data, navToEdit = true) => {
|
62
|
-
switch (type) {
|
63
|
-
case "addProperty":
|
64
|
-
const np = onAddProperty({
|
65
|
-
type: data?.type
|
66
|
-
}, data?.overrides || {});
|
67
|
-
if (navToEdit) {
|
68
|
-
setMode({
|
69
|
-
type: "editProperty",
|
70
|
-
edit: {
|
71
|
-
...np
|
72
|
-
}
|
73
|
-
});
|
74
|
-
}
|
75
|
-
break;
|
76
|
-
case "editProperty":
|
77
|
-
setMode({
|
78
|
-
type: "editProperty",
|
79
|
-
edit: {
|
80
|
-
...data?.edit
|
81
|
-
}
|
82
|
-
});
|
83
|
-
break;
|
84
|
-
case "changeProperty":
|
85
|
-
setMode({
|
86
|
-
type: "changeProperty",
|
87
|
-
edit: {
|
88
|
-
...(data?.edit || {})
|
89
|
-
}
|
90
|
-
});
|
91
|
-
break;
|
92
|
-
case "updateProperty":
|
93
|
-
const up = onUpdateProperty(data);
|
94
|
-
if (navToEdit) {
|
95
|
-
setMode({
|
96
|
-
type: "editProperty",
|
97
|
-
edit: {
|
98
|
-
...(up || {})
|
99
|
-
}
|
100
|
-
});
|
101
|
-
}
|
102
|
-
break;
|
103
|
-
case "deleteProperty":
|
104
|
-
onUpdateProperty(data, true);
|
105
|
-
break;
|
106
|
-
case "allProperties":
|
107
|
-
setMode({
|
108
|
-
type: "allProperties",
|
109
|
-
edit: null
|
110
|
-
});
|
111
|
-
break;
|
112
|
-
case "editOption":
|
113
|
-
setMode({
|
114
|
-
type: "editOption",
|
115
|
-
edit: {
|
116
|
-
...(data?.edit || {})
|
117
|
-
}
|
118
|
-
});
|
119
|
-
break;
|
120
|
-
case "addSort":
|
121
|
-
onUpdateSort(data);
|
122
|
-
break;
|
123
|
-
case "close":
|
124
|
-
onClose();
|
125
|
-
break;
|
126
|
-
default:
|
127
|
-
return;
|
128
|
-
}
|
129
|
-
};
|
130
|
-
const onEditProperty = data => e => {
|
131
|
-
if (!readOnly) {
|
132
|
-
setAnchorEl(e?.currentTarget);
|
133
|
-
onEvent("editProperty", {
|
134
|
-
edit: {
|
135
|
-
...data
|
136
|
-
}
|
137
|
-
});
|
138
|
-
} else {
|
139
|
-
const currentSort = sortBy?.key === data?.key ? sortBy : null;
|
140
|
-
onUpdateSort({
|
141
|
-
...(sortBy || data),
|
142
|
-
newKey: data.key,
|
143
|
-
operator: currentSort?.operator === "asc" ? "desc" : "asc"
|
144
|
-
}, false, false);
|
145
|
-
}
|
146
|
-
};
|
147
|
-
const onSettings = e => {
|
148
|
-
setAnchorEl(e?.currentTarget);
|
149
|
-
onEvent("allProperties", {});
|
150
|
-
};
|
151
|
-
const onClose = () => {
|
152
|
-
setMode({});
|
153
|
-
setAnchorEl(null);
|
154
|
-
};
|
155
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
156
|
-
children: [/*#__PURE__*/_jsx(Box, {
|
157
|
-
component: "div",
|
158
|
-
className: `tv-d-wrapper ${readOnly ? "readOnly" : ""}`,
|
159
|
-
sx: classes.root,
|
160
|
-
contentEditable: false,
|
161
|
-
children: /*#__PURE__*/_jsxs(Box, {
|
162
|
-
component: "table",
|
163
|
-
sx: classes.table,
|
164
|
-
children: [/*#__PURE__*/_jsx("thead", {
|
165
|
-
children: /*#__PURE__*/_jsxs("tr", {
|
166
|
-
children: [shownProperties?.map((m, i) => {
|
167
|
-
const {
|
168
|
-
Icon
|
169
|
-
} = PROPERTY_TYPES?.find(f => f.type === m.type) || {};
|
170
|
-
const isSort = sortBy?.key === m.key ? sortBy?.operator : null;
|
171
|
-
return /*#__PURE__*/_jsx("th", {
|
172
|
-
style: {
|
173
|
-
minWidth: "200px"
|
174
|
-
},
|
175
|
-
children: /*#__PURE__*/_jsx(Button, {
|
176
|
-
className: "tv-act-btn la",
|
177
|
-
startIcon: /*#__PURE__*/_jsx(Icon, {}),
|
178
|
-
endIcon: /*#__PURE__*/_jsx(SortIcon, {
|
179
|
-
sortBy: isSort
|
180
|
-
}),
|
181
|
-
fullWidth: true,
|
182
|
-
onClick: onEditProperty(m),
|
183
|
-
children: m.label
|
184
|
-
})
|
185
|
-
}, i);
|
186
|
-
}), !readOnly ? /*#__PURE__*/_jsxs(_Fragment, {
|
187
|
-
children: [/*#__PURE__*/_jsx("th", {
|
188
|
-
className: "tv-act-btn ico",
|
189
|
-
children: /*#__PURE__*/_jsx(Button, {
|
190
|
-
onClick: onAddClick,
|
191
|
-
fullWidth: true,
|
192
|
-
children: /*#__PURE__*/_jsx(GridAddSectionIcon, {})
|
193
|
-
})
|
194
|
-
}), /*#__PURE__*/_jsx("th", {
|
195
|
-
className: "tv-act-btn ico",
|
196
|
-
children: /*#__PURE__*/_jsx(Button, {
|
197
|
-
onClick: onSettings,
|
198
|
-
fullWidth: true,
|
199
|
-
children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
|
200
|
-
})
|
201
|
-
})]
|
202
|
-
}) : null]
|
203
|
-
})
|
204
|
-
}), children]
|
205
|
-
})
|
206
|
-
}), !readOnly ? /*#__PURE__*/_jsx(Button, {
|
207
|
-
contentEditable: false,
|
208
|
-
className: "tv-act-btn la",
|
209
|
-
fullWidth: true,
|
210
|
-
onClick: onAddRow,
|
211
|
-
sx: {
|
212
|
-
textTransform: "none",
|
213
|
-
justifyContent: "start"
|
214
|
-
},
|
215
|
-
startIcon: /*#__PURE__*/_jsx(AddCircleOutlineIcon, {}),
|
216
|
-
children: "Add new row"
|
217
|
-
}) : null, open && !readOnly ? /*#__PURE__*/_jsx(PropertySettings, {
|
218
|
-
open: open,
|
219
|
-
anchorEl: anchorEl,
|
220
|
-
mode: mode,
|
221
|
-
properties: properties,
|
222
|
-
onClose: onClose,
|
223
|
-
onEvent: onEvent
|
224
|
-
}) : null]
|
225
|
-
});
|
226
|
-
};
|
227
|
-
export default TableView;
|
@@ -1,81 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Box } from "@mui/material";
|
3
|
-
import { useDataView } from "../Providers/DataViewProvider";
|
4
|
-
import ColumnView from "./ColumnView";
|
5
|
-
// import Formula from "./Formula";
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
-
const RenderRow = props => {
|
9
|
-
const {
|
10
|
-
rowIndex,
|
11
|
-
row,
|
12
|
-
properties,
|
13
|
-
onSelect,
|
14
|
-
selected,
|
15
|
-
readOnly
|
16
|
-
} = props;
|
17
|
-
const showProperties = properties?.filter(f => f.visible);
|
18
|
-
return showProperties?.map((property, i) => {
|
19
|
-
return /*#__PURE__*/_jsx(ColumnView, {
|
20
|
-
needAnchor: i === 0,
|
21
|
-
row: row,
|
22
|
-
rowIndex: rowIndex,
|
23
|
-
property: property,
|
24
|
-
onSelect: onSelect,
|
25
|
-
selected: selected,
|
26
|
-
readOnly: readOnly
|
27
|
-
}, `${property.key}_${i}`);
|
28
|
-
});
|
29
|
-
};
|
30
|
-
const ViewData = props => {
|
31
|
-
const {
|
32
|
-
attributes,
|
33
|
-
children,
|
34
|
-
customProps
|
35
|
-
} = props;
|
36
|
-
const {
|
37
|
-
readOnly
|
38
|
-
} = customProps || {};
|
39
|
-
const {
|
40
|
-
properties,
|
41
|
-
rows,
|
42
|
-
selectedRows,
|
43
|
-
setSelectedRows
|
44
|
-
} = useDataView();
|
45
|
-
const onSelect = (id, checked) => {
|
46
|
-
if (checked) {
|
47
|
-
setSelectedRows([...selectedRows, id]);
|
48
|
-
} else {
|
49
|
-
setSelectedRows([...selectedRows?.filter(f => f !== id)]);
|
50
|
-
}
|
51
|
-
};
|
52
|
-
return /*#__PURE__*/_jsxs(Box, {
|
53
|
-
component: "tbody",
|
54
|
-
...attributes,
|
55
|
-
contentEditable: false,
|
56
|
-
children: [rows?.map((row, i) => {
|
57
|
-
return /*#__PURE__*/_jsx(Box, {
|
58
|
-
component: "tr",
|
59
|
-
className: "tv-act-row",
|
60
|
-
children: /*#__PURE__*/_jsx(RenderRow, {
|
61
|
-
rowIndex: row?.id,
|
62
|
-
row: row,
|
63
|
-
properties: properties,
|
64
|
-
onSelect: onSelect,
|
65
|
-
selected: selectedRows?.includes(row?.id),
|
66
|
-
readOnly: readOnly
|
67
|
-
})
|
68
|
-
}, i);
|
69
|
-
}), /*#__PURE__*/_jsx("tr", {
|
70
|
-
style: {
|
71
|
-
visibility: "hidden",
|
72
|
-
display: "none"
|
73
|
-
},
|
74
|
-
"aria-hidden": "true",
|
75
|
-
children: /*#__PURE__*/_jsx("td", {
|
76
|
-
children: children
|
77
|
-
})
|
78
|
-
})]
|
79
|
-
});
|
80
|
-
};
|
81
|
-
export default ViewData;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import TableView from "./TableView";
|
3
|
-
import { useDataView } from "../Providers/DataViewProvider";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
6
|
-
const LAYOUT_COMPONENT = {
|
7
|
-
table: TableView
|
8
|
-
};
|
9
|
-
const LayoutView = props => {
|
10
|
-
const {
|
11
|
-
readOnly,
|
12
|
-
children
|
13
|
-
} = props;
|
14
|
-
const {
|
15
|
-
layoutType
|
16
|
-
} = useDataView();
|
17
|
-
const Layout = LAYOUT_COMPONENT[layoutType] || LAYOUT_COMPONENT["table"];
|
18
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
19
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
20
|
-
readOnly: readOnly,
|
21
|
-
children: children
|
22
|
-
})
|
23
|
-
});
|
24
|
-
};
|
25
|
-
export default LayoutView;
|