@flozy/editor 5.0.4 → 5.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +6 -4
- package/dist/Editor/Editor.css +19 -1
- package/dist/Editor/Elements/Button/EditorButton.js +71 -53
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +4 -2
- package/dist/Editor/Elements/DataView/DataView.js +101 -0
- package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +59 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +128 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +25 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +26 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +38 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +35 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +36 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +17 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +28 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +37 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +74 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +59 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +66 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +174 -0
- package/dist/Editor/Elements/DataView/Layouts/Formula.js +29 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +113 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +37 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +111 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +62 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +36 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +101 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +158 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +190 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +42 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +110 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +176 -0
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +94 -0
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +214 -0
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +83 -0
- package/dist/Editor/Elements/DataView/Layouts/index.js +25 -0
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +288 -0
- package/dist/Editor/Elements/DataView/Utils/globalSearch.js +15 -0
- package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +72 -0
- package/dist/Editor/Elements/DataView/styles.js +133 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +2 -1
- package/dist/Editor/Elements/Grid/GridItem.js +2 -1
- package/dist/Editor/Elements/Search/SearchAttachment.js +3 -2
- package/dist/Editor/Elements/Search/SearchButton.js +7 -2
- package/dist/Editor/Elements/Search/SearchList.js +51 -17
- package/dist/Editor/Elements/Signature/Signature.css +1 -1
- package/dist/Editor/Elements/Table/AddRowCol.js +1 -1
- package/dist/Editor/Elements/Table/DragButton.js +71 -68
- package/dist/Editor/Elements/Table/Styles.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +10 -7
- package/dist/Editor/Elements/Table/TableCell.js +21 -21
- package/dist/Editor/Elements/Table/tableHelper.js +4 -16
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
- package/dist/Editor/Toolbar/Toolbar.js +6 -0
- package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
- package/dist/Editor/assets/svg/OpenLinkIcon.js +3 -3
- package/dist/Editor/common/Icon.js +7 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +12 -4
- package/dist/Editor/common/MentionsPopup/index.js +1 -1
- package/dist/Editor/common/Shorthands/elements.js +13 -1
- package/dist/Editor/common/StyleBuilder/tableStyle.js +1 -1
- package/dist/Editor/common/SwipeableDrawer/style.js +1 -1
- package/dist/Editor/common/iconslist.js +6 -3
- package/dist/Editor/hooks/useTable.js +4 -5
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +18 -2
- package/dist/Editor/plugins/withLayout.js +48 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +16 -0
- package/dist/Editor/utils/dataView.js +43 -0
- package/dist/Editor/utils/embed.js +2 -1
- package/dist/Editor/utils/helper.js +19 -1
- package/dist/Editor/utils/insertNewLine.js +19 -1
- package/package.json +1 -1
@@ -0,0 +1,133 @@
|
|
1
|
+
const useDataViewStyles = (theme, appTheme) => ({
|
2
|
+
root: {
|
3
|
+
width: "100%",
|
4
|
+
overflowX: "auto",
|
5
|
+
marginTop: "8px",
|
6
|
+
"& table": {
|
7
|
+
width: "100%",
|
8
|
+
"& th.fe-tv-ap-ico": {
|
9
|
+
width: "50px"
|
10
|
+
}
|
11
|
+
},
|
12
|
+
"& table th": {
|
13
|
+
cursor: "pointer",
|
14
|
+
width: "200px"
|
15
|
+
},
|
16
|
+
"& table, th, td": {
|
17
|
+
border: "1px solid black",
|
18
|
+
borderCollapse: "collapse"
|
19
|
+
},
|
20
|
+
"& .react-datepicker-wrapper": {
|
21
|
+
width: "100%",
|
22
|
+
"& input": {
|
23
|
+
padding: "6px 12px"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"& .MuiInputBase-root": {
|
27
|
+
"& fieldset": {
|
28
|
+
border: "none"
|
29
|
+
}
|
30
|
+
},
|
31
|
+
// filter view
|
32
|
+
"& .fe-tv-fv": {
|
33
|
+
marginBottom: "8px",
|
34
|
+
"& .mr": {
|
35
|
+
marginRight: "4px"
|
36
|
+
},
|
37
|
+
[theme.breakpoints.between("xs", "md")]: {
|
38
|
+
display: "flex",
|
39
|
+
flexDirection: "column"
|
40
|
+
}
|
41
|
+
},
|
42
|
+
"& .tv-act-row": {
|
43
|
+
"& .tv-tr-pop": {
|
44
|
+
opacity: 0,
|
45
|
+
"&.active": {
|
46
|
+
opacity: 1
|
47
|
+
}
|
48
|
+
},
|
49
|
+
"&:hover": {
|
50
|
+
"& .tv-tr-pop": {
|
51
|
+
opacity: 1
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
},
|
56
|
+
filterView: {
|
57
|
+
display: "flex",
|
58
|
+
justifyContent: "space-between",
|
59
|
+
alignItems: "center",
|
60
|
+
"& .MuiButtonBase-root": {
|
61
|
+
padding: "6px",
|
62
|
+
width: "24px",
|
63
|
+
height: "24px",
|
64
|
+
"&.active": {
|
65
|
+
color: "rgba(37, 99, 235, 1)"
|
66
|
+
}
|
67
|
+
},
|
68
|
+
"& .tv-sb": {
|
69
|
+
display: "flex",
|
70
|
+
border: "1px solid transparent",
|
71
|
+
width: "24px",
|
72
|
+
transition: "width 1s",
|
73
|
+
"&.open": {
|
74
|
+
width: "fit-content",
|
75
|
+
border: "1px solid rgba(236, 236, 236, 1)",
|
76
|
+
borderRadius: "8px"
|
77
|
+
},
|
78
|
+
"& input": {
|
79
|
+
paddingBottom: "0px",
|
80
|
+
fontSize: "14px"
|
81
|
+
}
|
82
|
+
},
|
83
|
+
"& .tv-title-wrpr, .tv-fi-wrpr": {
|
84
|
+
display: "flex",
|
85
|
+
"& button": {
|
86
|
+
color: appTheme?.palette?.editor?.tv_text
|
87
|
+
},
|
88
|
+
"& input": {
|
89
|
+
color: appTheme?.palette?.editor?.tv_text
|
90
|
+
}
|
91
|
+
},
|
92
|
+
"& .tv-title-wrpr": {
|
93
|
+
width: "80%",
|
94
|
+
marginRight: "8px",
|
95
|
+
"& .MuiInputBase-root": {
|
96
|
+
width: "100%"
|
97
|
+
},
|
98
|
+
[theme.breakpoints.between("xs", "md")]: {
|
99
|
+
width: "100%",
|
100
|
+
marginRight: "0px"
|
101
|
+
}
|
102
|
+
},
|
103
|
+
"& .tv-fi-wrpr": {
|
104
|
+
[theme.breakpoints.between("xs", "md")]: {
|
105
|
+
width: "100%",
|
106
|
+
justifyContent: "end"
|
107
|
+
}
|
108
|
+
}
|
109
|
+
},
|
110
|
+
basicMenu: {
|
111
|
+
"& .MuiPaper-root": {
|
112
|
+
padding: "0px 6px",
|
113
|
+
width: "150px",
|
114
|
+
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
115
|
+
borderRadius: "8px",
|
116
|
+
background: appTheme?.palette?.editor?.tv_pop_bg,
|
117
|
+
color: appTheme?.palette?.editor?.tv_text_primary,
|
118
|
+
"& .MuiButtonBase-root": {
|
119
|
+
fontSize: "14px",
|
120
|
+
"& svg": {
|
121
|
+
width: "16px",
|
122
|
+
height: "16px"
|
123
|
+
},
|
124
|
+
"&:hover": {
|
125
|
+
background: appTheme?.palette?.editor?.tv_hover_bg,
|
126
|
+
borderRadius: "8px",
|
127
|
+
color: appTheme?.palette?.editor?.tv_hover_text
|
128
|
+
}
|
129
|
+
}
|
130
|
+
}
|
131
|
+
}
|
132
|
+
});
|
133
|
+
export default useDataViewStyles;
|
@@ -17,6 +17,7 @@ import { useGrid, getChildCount } from "./Providers/GridProvider";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
18
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
|
+
let TT = null;
|
20
21
|
const Resizer = ({
|
21
22
|
classes,
|
22
23
|
onMouseDown,
|
@@ -138,7 +139,7 @@ const GridItem = props => {
|
|
138
139
|
try {
|
139
140
|
if (columnRef?.current && (!parentDOM?.parentDOM || !minWidth || lastChild)) {
|
140
141
|
initDoms(lastChild);
|
141
|
-
if (lastChild) {
|
142
|
+
if (lastChild && childCount <= 2) {
|
142
143
|
Transforms.setNodes(editor, {
|
143
144
|
minWidth: null
|
144
145
|
}, {
|
@@ -41,13 +41,14 @@ const SearchAttachment = props => {
|
|
41
41
|
justifyContent: "flex-start",
|
42
42
|
alignItems: "flex-end",
|
43
43
|
width: "fit-content",
|
44
|
-
maxWidth: '
|
44
|
+
maxWidth: '250px',
|
45
45
|
padding: "0px 10px",
|
46
46
|
boxShadow: "none",
|
47
47
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
|
48
48
|
borderRadius: "7px !important",
|
49
49
|
background: theme?.palette?.containers?.slashBrainCardBg,
|
50
50
|
cursor: 'pointer',
|
51
|
+
margin: '4px 0px',
|
51
52
|
"&.MuiPaper-root.MuiPaper-rounded": {
|
52
53
|
borderRadius: "7px !important",
|
53
54
|
paddingTop: '0px !important'
|
@@ -91,7 +92,7 @@ const SearchAttachment = props => {
|
|
91
92
|
whiteSpace: 'nowrap',
|
92
93
|
overflow: 'hidden',
|
93
94
|
wordBreak: "break-word",
|
94
|
-
maxWidth: '
|
95
|
+
maxWidth: '210px',
|
95
96
|
lineHeight: 1.43,
|
96
97
|
"&::selection": {
|
97
98
|
WebkitTextFillColor: "#000"
|
@@ -113,7 +113,7 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
113
113
|
sx: {
|
114
114
|
width: '100%',
|
115
115
|
background: theme?.palette?.editor?.miniToolBarBackground,
|
116
|
-
|
116
|
+
boxShadow: 'none'
|
117
117
|
},
|
118
118
|
children: /*#__PURE__*/_jsx(SearchAndDocList, {
|
119
119
|
mapData: mapData,
|
@@ -149,8 +149,13 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
149
149
|
border: '1px solid',
|
150
150
|
borderColor: theme?.palette?.type === 'dark' ? theme?.palette?.editor?.popUpBorderColor : 'transparent',
|
151
151
|
borderRadius: '12px',
|
152
|
+
boxShadow: theme?.palette?.type === 'dark' ? 'transparent' : '0px 4px 10px 0px #00000029',
|
152
153
|
'&.MuiPaper-root-MuiPopover-paper': {
|
153
|
-
borderRadius: '12px !important'
|
154
|
+
borderRadius: '12px !important',
|
155
|
+
boxShadow: theme?.palette?.type === 'dark' ? 'transparent' : '0px 4px 10px 0px #00000029'
|
156
|
+
},
|
157
|
+
'@media only screen and (min-width: 350px) and (max-width: 599px)': {
|
158
|
+
width: '100%'
|
154
159
|
}
|
155
160
|
},
|
156
161
|
children: /*#__PURE__*/_jsx(SearchAndDocList, {
|
@@ -13,6 +13,7 @@ const SearchAndDocList = ({
|
|
13
13
|
theme,
|
14
14
|
handleClose
|
15
15
|
}) => {
|
16
|
+
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
16
17
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
17
18
|
children: [/*#__PURE__*/_jsxs(Box, {
|
18
19
|
display: "flex",
|
@@ -28,25 +29,29 @@ const SearchAndDocList = ({
|
|
28
29
|
color: theme?.palette?.primary?.main
|
29
30
|
},
|
30
31
|
children: "Brains"
|
31
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
32
|
+
}), !isMobile ? /*#__PURE__*/_jsx(IconButton, {
|
32
33
|
onClick: e => {
|
33
34
|
e.stopPropagation();
|
34
35
|
handleClose();
|
35
36
|
},
|
36
37
|
sx: {
|
37
38
|
borderRadius: "6px",
|
38
|
-
backgroundColor: theme?.palette?.editor?.
|
39
|
-
|
40
|
-
padding: "5px",
|
39
|
+
backgroundColor: theme?.palette.type === 'dark' ? theme?.palette?.editor?.sectionSettingIconHover : theme?.palette?.editor?.sectionSettingIconHover,
|
40
|
+
padding: "3px",
|
41
41
|
"&:hover": {
|
42
42
|
backgroundColor: theme?.palette?.editor?.sectionSettingIconHover,
|
43
43
|
background: theme?.palette?.editor?.sectionSettingIconHover
|
44
|
+
},
|
45
|
+
'& svg': {
|
46
|
+
'& path': {
|
47
|
+
stroke: theme?.palette?.editor?.closeButtonSvgStroke
|
48
|
+
}
|
44
49
|
}
|
45
50
|
},
|
46
51
|
children: /*#__PURE__*/_jsx(Icon, {
|
47
52
|
icon: "closeIcon"
|
48
53
|
})
|
49
|
-
})]
|
54
|
+
}) : null]
|
50
55
|
}), /*#__PURE__*/_jsx(Box, {
|
51
56
|
sx: {
|
52
57
|
padding: '0px 16px'
|
@@ -70,34 +75,48 @@ const SearchAndDocList = ({
|
|
70
75
|
startAdornment: /*#__PURE__*/_jsx(InputAdornment, {
|
71
76
|
position: "start",
|
72
77
|
children: /*#__PURE__*/_jsx(SearchIcon, {})
|
73
|
-
})
|
78
|
+
}),
|
79
|
+
sx: {
|
80
|
+
color: theme?.palette?.text?.secondary2,
|
81
|
+
fontSize: '14px'
|
82
|
+
}
|
74
83
|
},
|
75
84
|
sx: {
|
76
85
|
borderRadius: "8px",
|
86
|
+
fontSize: '14px',
|
87
|
+
color: theme?.palette?.text?.secondary2,
|
77
88
|
"& .MuiOutlinedInput-root": {
|
78
|
-
color: theme?.palette?.
|
89
|
+
color: `${theme?.palette?.text?.secondary2} !important`,
|
79
90
|
boxShadow: theme?.palette?.shadows?.shadow12,
|
80
|
-
backgroundColor: theme?.palette?.editor?.
|
91
|
+
backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
|
92
|
+
fontSize: '14px',
|
81
93
|
"&:hover .MuiOutlinedInput-notchedOutline": {
|
82
94
|
borderRadius: "8px",
|
83
95
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
|
84
96
|
borderColor: theme?.palette?.primary?.slashBrainBorder
|
85
97
|
},
|
86
98
|
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
99
|
+
color: theme?.palette?.text?.secondary2,
|
87
100
|
borderRadius: "8px",
|
88
101
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
|
89
102
|
borderColor: `${theme?.palette?.primary?.slashBrainBorder} !important`
|
90
103
|
}
|
91
104
|
},
|
92
105
|
'& .MuiOutlinedInput-notchedOutline': {
|
106
|
+
color: theme?.palette?.text?.secondary2,
|
93
107
|
borderRadius: "8px",
|
94
108
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
|
95
|
-
borderColor: theme?.palette?.primary?.slashBrainBorder
|
109
|
+
borderColor: theme?.palette?.primary?.slashBrainBorder,
|
110
|
+
fontSize: '14px'
|
96
111
|
},
|
97
112
|
'& .MuiInputBase-root': {
|
98
|
-
|
113
|
+
color: theme?.palette?.text?.secondary2,
|
114
|
+
borderRadius: '8px',
|
115
|
+
fontSize: '14px'
|
99
116
|
},
|
100
117
|
"& svg": {
|
118
|
+
width: '16px',
|
119
|
+
height: '16px',
|
101
120
|
"& path": {
|
102
121
|
stroke: theme?.palette?.text?.text6
|
103
122
|
}
|
@@ -116,23 +135,25 @@ const SearchAndDocList = ({
|
|
116
135
|
padding: '0px 16px 8px',
|
117
136
|
marginBottom: '20px',
|
118
137
|
scrollbarWidth: "thin",
|
119
|
-
scrollbarColor: `${theme?.palette?.
|
138
|
+
scrollbarColor: `${theme?.palette?.editor?.brainPopupScroll} transparent`,
|
120
139
|
"&::-webkit-scrollbar": {
|
121
|
-
width: "3px",
|
140
|
+
width: "3px !important",
|
122
141
|
height: "3px !important",
|
123
142
|
borderRadius: "10px !important"
|
124
143
|
},
|
125
144
|
"&::-webkit-scrollbar-thumb": {
|
126
|
-
backgroundColor: theme?.palette?.
|
145
|
+
backgroundColor: theme?.palette?.editor?.brainPopupScroll,
|
127
146
|
borderRadius: "10px !important",
|
128
147
|
width: "3px !important"
|
129
148
|
},
|
130
149
|
"&::-webkit-scrollbar-thumb:hover": {
|
131
|
-
backgroundColor: theme?.palette?.
|
150
|
+
backgroundColor: theme?.palette?.editor?.brainPopupScroll,
|
151
|
+
width: "3px !important"
|
132
152
|
},
|
133
153
|
"&::-webkit-scrollbar-track": {
|
134
154
|
background: "transparent",
|
135
|
-
borderRadius: "10px !important"
|
155
|
+
borderRadius: "10px !important",
|
156
|
+
width: "3px !important"
|
136
157
|
}
|
137
158
|
},
|
138
159
|
children: [mapData?.map((doc, index) => {
|
@@ -145,19 +166,29 @@ const SearchAndDocList = ({
|
|
145
166
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
|
146
167
|
borderRadius: '8px',
|
147
168
|
padding: '6px 10px',
|
148
|
-
cursor: 'pointer'
|
169
|
+
cursor: 'pointer',
|
170
|
+
backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
|
171
|
+
'@media only screen and (min-width: 350px) and (max-width: 599px)': {
|
172
|
+
overflow: 'hidden'
|
173
|
+
}
|
149
174
|
},
|
150
175
|
onClick: () => handleClick(doc),
|
151
176
|
children: /*#__PURE__*/_jsxs(Grid, {
|
152
177
|
container: true,
|
153
178
|
alignItems: "center",
|
154
179
|
justifyContent: 'space-between',
|
180
|
+
sx: {
|
181
|
+
flexWrap: 'nowrap'
|
182
|
+
},
|
155
183
|
gap: 1,
|
156
184
|
children: [/*#__PURE__*/_jsx(Grid, {
|
157
185
|
item: true,
|
158
186
|
children: /*#__PURE__*/_jsxs(Grid, {
|
159
187
|
container: true,
|
160
188
|
alignItems: "center",
|
189
|
+
sx: {
|
190
|
+
flexWrap: 'nowrap'
|
191
|
+
},
|
161
192
|
gap: 1,
|
162
193
|
children: [/*#__PURE__*/_jsx(Grid, {
|
163
194
|
item: true,
|
@@ -184,7 +215,10 @@ const SearchAndDocList = ({
|
|
184
215
|
overflow: 'hidden',
|
185
216
|
wordBreak: "break-word",
|
186
217
|
maxWidth: '230px',
|
187
|
-
textAlign: 'left'
|
218
|
+
textAlign: 'left',
|
219
|
+
'@media only screen and (min-width: 350px) and (max-width: 899px)': {
|
220
|
+
maxWidth: '100%'
|
221
|
+
}
|
188
222
|
},
|
189
223
|
children: title
|
190
224
|
})
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Box, Fade, IconButton, Paper,
|
1
|
+
import { Box, ClickAwayListener, Fade, IconButton, Paper, Popper } from "@mui/material";
|
2
2
|
import DragStyles from "./DragStyles";
|
3
3
|
import { DragIcon } from "../../common/iconListV2";
|
4
4
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
@@ -19,7 +19,8 @@ function DragButton({
|
|
19
19
|
className = "",
|
20
20
|
customProps,
|
21
21
|
dndProps,
|
22
|
-
resetSelection
|
22
|
+
resetSelection,
|
23
|
+
show
|
23
24
|
}) {
|
24
25
|
const {
|
25
26
|
theme
|
@@ -31,8 +32,8 @@ function DragButton({
|
|
31
32
|
isMobile
|
32
33
|
} = customProps || {};
|
33
34
|
const onDragClick = () => {
|
34
|
-
setShowTool(true);
|
35
35
|
onDrag();
|
36
|
+
setShowTool(true);
|
36
37
|
};
|
37
38
|
const onDragClose = () => {
|
38
39
|
setShowTool(false);
|
@@ -61,78 +62,80 @@ function DragButton({
|
|
61
62
|
handleAction(value, option, dragType);
|
62
63
|
}
|
63
64
|
};
|
64
|
-
return /*#__PURE__*/
|
65
|
-
children:
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
65
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
66
|
+
children: show || showTool ? /*#__PURE__*/_jsxs(_Fragment, {
|
67
|
+
children: [/*#__PURE__*/_jsx(Popper, {
|
68
|
+
sx: classes.popper,
|
69
|
+
open: Boolean(anchorEl),
|
70
|
+
anchorEl: anchorEl,
|
71
|
+
placement: placement || "left",
|
72
|
+
transition: true,
|
73
|
+
contentEditable: false,
|
74
|
+
ref: dragElement,
|
75
|
+
modifiers: [{
|
76
|
+
name: "offset",
|
77
|
+
options: {
|
78
|
+
offset: [0, -12]
|
79
|
+
}
|
80
|
+
}, {
|
81
|
+
name: "flip",
|
82
|
+
enabled: false // Disable dynamic flipping
|
83
|
+
}],
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
},
|
101
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
102
|
-
onClick: () => {
|
103
|
-
onDragClick();
|
85
|
+
disablePortal: dragType !== "row",
|
86
|
+
className: `${className}`,
|
87
|
+
children: ({
|
88
|
+
TransitionProps
|
89
|
+
}) => /*#__PURE__*/_jsx(Fade, {
|
90
|
+
...TransitionProps,
|
91
|
+
timeout: 350,
|
92
|
+
children: /*#__PURE__*/_jsx("div", {
|
93
|
+
children: /*#__PURE__*/_jsx(Draggable, {
|
94
|
+
...dragProps,
|
95
|
+
children: /*#__PURE__*/_jsx(Paper, {
|
96
|
+
sx: dragType === "row" ? {
|
97
|
+
transform: "rotate(90deg)"
|
98
|
+
} : {},
|
99
|
+
className: `${showTool ? "active" : ""}`,
|
100
|
+
style: {
|
101
|
+
lineHeight: 0
|
104
102
|
},
|
105
|
-
children: /*#__PURE__*/_jsx(
|
103
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
104
|
+
onClick: () => {
|
105
|
+
onDragClick();
|
106
|
+
},
|
107
|
+
children: /*#__PURE__*/_jsx(DragIcon, {})
|
108
|
+
})
|
106
109
|
})
|
107
110
|
})
|
108
111
|
})
|
109
112
|
})
|
110
|
-
})
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
}), isMobile ? /*#__PURE__*/_jsx(SwipeableDrawerComponent, {
|
114
|
+
open: showTool,
|
115
|
+
onClose: onDragClose,
|
116
|
+
swipeableDrawer: true,
|
117
|
+
children: /*#__PURE__*/_jsx(Box, {
|
118
|
+
sx: classes.mobileToolDrawer,
|
119
|
+
children: /*#__PURE__*/_jsx(TableToolOnDrag, {
|
120
|
+
...commonToolProps
|
121
|
+
})
|
122
|
+
})
|
123
|
+
}) : /*#__PURE__*/_jsx(Popper, {
|
124
|
+
open: showTool,
|
125
|
+
anchorEl: dragElement?.current,
|
126
|
+
contentEditable: false,
|
127
|
+
sx: classes.toolPopper,
|
128
|
+
placement: dragType === "row" ? "bottom-start" : "right-start",
|
129
|
+
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
130
|
+
onClickAway: onDragClose,
|
131
|
+
children: /*#__PURE__*/_jsx("div", {
|
132
|
+
children: /*#__PURE__*/_jsx(TableToolOnDrag, {
|
133
|
+
...commonToolProps
|
134
|
+
})
|
135
|
+
})
|
119
136
|
})
|
120
|
-
})
|
121
|
-
}) :
|
122
|
-
open: showTool,
|
123
|
-
anchorEl: dragElement?.current,
|
124
|
-
transition: true,
|
125
|
-
contentEditable: false,
|
126
|
-
sx: classes.toolPopper,
|
127
|
-
anchorOrigin: {
|
128
|
-
vertical: dragType === "row" ? "bottom" : "top",
|
129
|
-
horizontal: dragType === "row" ? "left" : "right"
|
130
|
-
},
|
131
|
-
onClose: onDragClose,
|
132
|
-
children: /*#__PURE__*/_jsx(TableToolOnDrag, {
|
133
|
-
...commonToolProps
|
134
|
-
})
|
135
|
-
})]
|
137
|
+
})]
|
138
|
+
}) : null
|
136
139
|
});
|
137
140
|
}
|
138
141
|
export default DragButton;
|
@@ -112,7 +112,7 @@ const Table = props => {
|
|
112
112
|
}
|
113
113
|
};
|
114
114
|
const handleExpand = e => {
|
115
|
-
setExpandTools(e.currentTarget);
|
115
|
+
setExpandTools(prev => prev ? false : e.currentTarget);
|
116
116
|
};
|
117
117
|
useEffect(() => {
|
118
118
|
if (!selected) {
|
@@ -179,13 +179,14 @@ const Table = props => {
|
|
179
179
|
hideRowDragBtns("", dragRowBtnCls);
|
180
180
|
}
|
181
181
|
};
|
182
|
-
const handleScrollStop = useDebouncedCallback(() => {
|
183
|
-
containerRef?.current?.classList.add("hideScroll");
|
184
|
-
}, 200);
|
185
182
|
const handleScroll = () => {
|
186
183
|
handleRowDragBtns();
|
184
|
+
};
|
185
|
+
const onMouseOver = () => {
|
187
186
|
containerRef?.current?.classList.remove("hideScroll");
|
188
|
-
|
187
|
+
};
|
188
|
+
const onMouseLeave = () => {
|
189
|
+
containerRef?.current?.classList.add("hideScroll");
|
189
190
|
};
|
190
191
|
const commonAddBtnProps = {
|
191
192
|
tableRef,
|
@@ -211,7 +212,9 @@ const Table = props => {
|
|
211
212
|
},
|
212
213
|
ref: containerRef,
|
213
214
|
onScroll: handleScroll,
|
214
|
-
|
215
|
+
onMouseOver: onMouseOver,
|
216
|
+
onMouseLeave: onMouseLeave,
|
217
|
+
className: "custom-scroll",
|
215
218
|
children: [/*#__PURE__*/_jsx(TableComp, {
|
216
219
|
className: readOnly ? "readOnly" : "",
|
217
220
|
sx: {
|
@@ -256,7 +259,7 @@ const Table = props => {
|
|
256
259
|
sx: {
|
257
260
|
zIndex: 2000
|
258
261
|
},
|
259
|
-
placement: "
|
262
|
+
placement: "bottom-start",
|
260
263
|
children: ({
|
261
264
|
TransitionProps
|
262
265
|
}) => /*#__PURE__*/_jsx(Fade, {
|