@flozy/editor 5.1.5 → 5.1.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/ChatEditor.js +25 -34
- package/dist/Editor/CommonEditor.js +15 -9
- package/dist/Editor/Editor.css +56 -12
- package/dist/Editor/Elements/AI/AIInput.js +0 -1
- package/dist/Editor/Elements/AI/CustomSelect.js +17 -10
- package/dist/Editor/Elements/AI/Styles.js +7 -1
- package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
- package/dist/Editor/Elements/Button/EditorButton.js +1 -1
- package/dist/Editor/Elements/Carousel/CarouselItem.js +1 -1
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +7 -5
- package/dist/Editor/Elements/Color Picker/Styles.js +7 -3
- package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
- package/dist/Editor/Elements/DataView/DataView.js +109 -0
- package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +66 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +162 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +40 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +67 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +30 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +39 -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 +29 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +38 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +74 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +64 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +106 -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 +60 -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 +160 -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 +179 -0
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +112 -0
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +227 -0
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +70 -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 +143 -0
- package/dist/Editor/Elements/Divider/Divider.js +15 -14
- package/dist/Editor/Elements/Form/Form.js +38 -2
- package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormDate.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormEmail.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormText.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +6 -1
- package/dist/Editor/Elements/Form/FormPopup.js +12 -9
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +20 -1
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +1 -1
- package/dist/Editor/Elements/Grid/GridButton.js +2 -2
- package/dist/Editor/Elements/Grid/GridItem.js +21 -18
- package/dist/Editor/Elements/Link/LinkButton.js +1 -1
- package/dist/Editor/Elements/Signature/Signature.css +1 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +13 -48
- package/dist/Editor/Elements/SimpleText/index.js +8 -1
- package/dist/Editor/Elements/SimpleText/style.js +13 -1
- package/dist/Editor/Elements/Table/AddRowCol.js +77 -0
- package/dist/Editor/Elements/Table/DragButton.js +141 -0
- package/dist/Editor/Elements/Table/DragStyles.js +70 -0
- package/dist/Editor/Elements/Table/Draggable.js +25 -0
- package/dist/Editor/Elements/Table/Droppable.js +53 -0
- package/dist/Editor/Elements/Table/Styles.js +25 -43
- package/dist/Editor/Elements/Table/Table.js +205 -138
- package/dist/Editor/Elements/Table/TableCell.js +355 -102
- package/dist/Editor/Elements/Table/TablePopup.js +9 -3
- package/dist/Editor/Elements/Table/TableRow.js +10 -2
- package/dist/Editor/Elements/Table/TableTool.js +101 -0
- package/dist/Editor/Elements/Table/tableHelper.js +71 -0
- package/dist/Editor/Styles/EditorStyles.js +3 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +10 -0
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +7 -12
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +10 -4
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +3 -0
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +0 -2
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +3 -6
- package/dist/Editor/Toolbar/Mini/Styles.js +4 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -3
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +19 -15
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +411 -49
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +62 -8
- package/dist/Editor/Toolbar/PopupTool/index.js +5 -6
- package/dist/Editor/Toolbar/Toolbar.js +6 -0
- package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
- package/dist/Editor/assets/svg/BrainIcon.js +2 -2
- package/dist/Editor/assets/svg/TableIcons.js +220 -0
- package/dist/Editor/common/ColorPickerButton.js +3 -2
- package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
- package/dist/Editor/common/Icon.js +20 -19
- package/dist/Editor/common/LinkSettings/NavComponents.js +2 -1
- package/dist/Editor/common/LinkSettings/index.js +2 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +152 -8
- package/dist/Editor/common/MentionsPopup/index.js +1 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +108 -12
- 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 +14 -2
- package/dist/Editor/common/Select/index.js +20 -0
- package/dist/Editor/common/Select/styles.js +17 -0
- package/dist/Editor/common/Shorthands/elements.js +13 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +8 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +7 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +5 -2
- package/dist/Editor/common/StyleBuilder/formStyle.js +268 -149
- package/dist/Editor/common/StyleBuilder/index.js +84 -11
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
- package/dist/Editor/common/StyleBuilder/tableStyle.js +69 -25
- package/dist/Editor/common/SwipeableDrawer/style.js +15 -4
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/common/iconListV2.js +378 -40
- package/dist/Editor/common/iconslist.js +23 -17
- package/dist/Editor/commonStyle.js +126 -9
- package/dist/Editor/helper/deserialize/index.js +4 -1
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +24 -1
- package/dist/Editor/hooks/useMouseMove.js +5 -2
- package/dist/Editor/hooks/useTable.js +195 -0
- package/dist/Editor/plugins/withCustomDeleteBackward.js +3 -2
- package/dist/Editor/plugins/withHTML.js +17 -1
- package/dist/Editor/plugins/withLayout.js +48 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +18 -0
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +21 -0
- package/dist/Editor/utils/dataView.js +43 -0
- package/dist/Editor/utils/embed.js +2 -1
- package/dist/Editor/utils/events.js +0 -1
- package/dist/Editor/utils/font.js +11 -4
- package/dist/Editor/utils/formfield.js +8 -4
- package/dist/Editor/utils/helper.js +67 -2
- package/dist/Editor/utils/insertNewLine.js +19 -1
- package/dist/Editor/utils/pageSettings.js +14 -2
- package/dist/Editor/utils/serializeToText.js +2 -0
- package/dist/Editor/utils/table.js +228 -24
- package/package.json +1 -1
@@ -0,0 +1,77 @@
|
|
1
|
+
import { Button } from "@mui/material";
|
2
|
+
import { useMemo, useState } from "react";
|
3
|
+
import useTable from "../../hooks/useTable";
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
const showAddButton = (addType, tableNode, hoverPath) => {
|
6
|
+
const [row, col] = hoverPath && hoverPath?.length ? hoverPath.slice(-2) : [];
|
7
|
+
if (addType === "row") {
|
8
|
+
return tableNode?.rows - 1 === row;
|
9
|
+
} else {
|
10
|
+
return tableNode?.columns - 1 === col;
|
11
|
+
}
|
12
|
+
};
|
13
|
+
const ADD_COL_BTN_WIDTH = 20;
|
14
|
+
function AddRowCol(props) {
|
15
|
+
const {
|
16
|
+
tableRef,
|
17
|
+
containerRef,
|
18
|
+
addType,
|
19
|
+
tableNode,
|
20
|
+
onAdd,
|
21
|
+
readOnly
|
22
|
+
} = props;
|
23
|
+
const {
|
24
|
+
hoverPath
|
25
|
+
} = useTable();
|
26
|
+
const [hoveringAddBtn, setHoveringAddBtn] = useState(false);
|
27
|
+
const {
|
28
|
+
tableResizing
|
29
|
+
} = useTable();
|
30
|
+
const {
|
31
|
+
clientHeight,
|
32
|
+
scrollWidth
|
33
|
+
} = tableRef?.current || {};
|
34
|
+
const {
|
35
|
+
clientWidth: containerWidth
|
36
|
+
} = containerRef?.current || {};
|
37
|
+
const buttonStyle = useMemo(() => {
|
38
|
+
if (addType === "row") {
|
39
|
+
const isScrollEnabled = scrollWidth > containerWidth;
|
40
|
+
const width = isScrollEnabled ? containerWidth - ADD_COL_BTN_WIDTH : scrollWidth;
|
41
|
+
return {
|
42
|
+
width
|
43
|
+
};
|
44
|
+
} else {
|
45
|
+
return {
|
46
|
+
height: "100%",
|
47
|
+
marginLeft: "3px"
|
48
|
+
};
|
49
|
+
}
|
50
|
+
}, [scrollWidth, clientHeight, containerWidth, tableResizing]);
|
51
|
+
const showAdd = showAddButton(addType, tableNode, hoverPath);
|
52
|
+
const onMouseEnter = () => setHoveringAddBtn(true);
|
53
|
+
const onMouseLeave = () => setHoveringAddBtn(false);
|
54
|
+
const showBtn = (showAdd || hoveringAddBtn) && !tableResizing && !readOnly;
|
55
|
+
return /*#__PURE__*/_jsx("div", {
|
56
|
+
onMouseEnter: onMouseEnter,
|
57
|
+
onMouseLeave: onMouseLeave,
|
58
|
+
contentEditable: false,
|
59
|
+
children: /*#__PURE__*/_jsx(Button, {
|
60
|
+
sx: {
|
61
|
+
fontSize: "14px",
|
62
|
+
border: "1px dashed #8DA8E3",
|
63
|
+
color: "#2563EB !important",
|
64
|
+
padding: "0px 4px",
|
65
|
+
minWidth: "unset",
|
66
|
+
lineHeight: "18px",
|
67
|
+
fontWeight: "normal !important",
|
68
|
+
...buttonStyle,
|
69
|
+
opacity: showBtn ? 1 : 0
|
70
|
+
},
|
71
|
+
disabled: !showBtn,
|
72
|
+
onClick: onAdd,
|
73
|
+
children: "+"
|
74
|
+
})
|
75
|
+
});
|
76
|
+
}
|
77
|
+
export default AddRowCol;
|
@@ -0,0 +1,141 @@
|
|
1
|
+
import { Box, ClickAwayListener, Fade, IconButton, Paper, Popper } from "@mui/material";
|
2
|
+
import DragStyles from "./DragStyles";
|
3
|
+
import { DragIcon } from "../../common/iconListV2";
|
4
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
5
|
+
import { useRef, useState } from "react";
|
6
|
+
import { TableToolOnDrag } from "./TableTool";
|
7
|
+
import Draggable from "./Draggable";
|
8
|
+
import SwipeableDrawerComponent from "../../common/SwipeableDrawer";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
|
+
function DragButton({
|
13
|
+
anchorEl,
|
14
|
+
placement,
|
15
|
+
dragType,
|
16
|
+
onDrag = () => {},
|
17
|
+
handleToolAction,
|
18
|
+
hideDelete,
|
19
|
+
className = "",
|
20
|
+
customProps,
|
21
|
+
dndProps,
|
22
|
+
resetSelection,
|
23
|
+
show
|
24
|
+
}) {
|
25
|
+
const {
|
26
|
+
theme
|
27
|
+
} = useEditorContext();
|
28
|
+
const classes = DragStyles(theme);
|
29
|
+
const dragElement = useRef(null);
|
30
|
+
const [showTool, setShowTool] = useState(false);
|
31
|
+
const {
|
32
|
+
isMobile
|
33
|
+
} = customProps || {};
|
34
|
+
const onDragClick = () => {
|
35
|
+
onDrag();
|
36
|
+
setShowTool(true);
|
37
|
+
};
|
38
|
+
const onDragClose = () => {
|
39
|
+
setShowTool(false);
|
40
|
+
setTimeout(() => resetSelection(), 200);
|
41
|
+
};
|
42
|
+
const dragProps = {
|
43
|
+
...dndProps,
|
44
|
+
id: dndProps?.id + dragType,
|
45
|
+
data: {
|
46
|
+
...dndProps.data,
|
47
|
+
dragType
|
48
|
+
}
|
49
|
+
};
|
50
|
+
const handleAction = (value, option, dragType) => {
|
51
|
+
const omitValues = ["delete"];
|
52
|
+
if (!omitValues.includes(value)) {
|
53
|
+
setShowTool(false);
|
54
|
+
}
|
55
|
+
handleToolAction(value, option, dragType);
|
56
|
+
};
|
57
|
+
const commonToolProps = {
|
58
|
+
theme,
|
59
|
+
dragType,
|
60
|
+
hideDelete,
|
61
|
+
handleToolAction: (value, option, dragType) => {
|
62
|
+
handleAction(value, option, dragType);
|
63
|
+
}
|
64
|
+
};
|
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
|
+
}],
|
84
|
+
|
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
|
102
|
+
},
|
103
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
104
|
+
onClick: () => {
|
105
|
+
onDragClick();
|
106
|
+
},
|
107
|
+
children: /*#__PURE__*/_jsx(DragIcon, {})
|
108
|
+
})
|
109
|
+
})
|
110
|
+
})
|
111
|
+
})
|
112
|
+
})
|
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
|
+
})
|
136
|
+
})
|
137
|
+
})]
|
138
|
+
}) : null
|
139
|
+
});
|
140
|
+
}
|
141
|
+
export default DragButton;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
const DragStyles = theme => {
|
2
|
+
const {
|
3
|
+
containers,
|
4
|
+
editor
|
5
|
+
} = theme?.palette || {};
|
6
|
+
const {
|
7
|
+
buttonBorder,
|
8
|
+
background,
|
9
|
+
activeColor,
|
10
|
+
signaturePopUpTabButtonSelectedBg,
|
11
|
+
signaturePopUpTabButtonSelectedSvg
|
12
|
+
} = editor || {};
|
13
|
+
const onDragActive = {
|
14
|
+
outline: `1.5px solid ${activeColor || "#2563EB"}`,
|
15
|
+
background: `${signaturePopUpTabButtonSelectedBg} !important`,
|
16
|
+
"& svg ellipse": {
|
17
|
+
fill: `${signaturePopUpTabButtonSelectedSvg}`
|
18
|
+
}
|
19
|
+
};
|
20
|
+
return {
|
21
|
+
popper: {
|
22
|
+
zIndex: 1000,
|
23
|
+
"& .MuiPaper-root": {
|
24
|
+
borderRadius: "3px !important",
|
25
|
+
outline: `1.5px solid ${buttonBorder}`,
|
26
|
+
backgroundColor: `${background}`,
|
27
|
+
"&:hover": onDragActive,
|
28
|
+
"&.active": onDragActive
|
29
|
+
},
|
30
|
+
"& .MuiIconButton-root": {
|
31
|
+
padding: "4px 6px",
|
32
|
+
borderRadius: "none",
|
33
|
+
"& .dragIcon": {
|
34
|
+
width: "14px",
|
35
|
+
height: "10px"
|
36
|
+
},
|
37
|
+
"&:hover": {
|
38
|
+
background: "none"
|
39
|
+
}
|
40
|
+
}
|
41
|
+
},
|
42
|
+
toolPopper: {
|
43
|
+
zIndex: 4001,
|
44
|
+
"& .MuiPaper-root": {
|
45
|
+
borderRadius: "8px"
|
46
|
+
}
|
47
|
+
},
|
48
|
+
mobileToolDrawer: {
|
49
|
+
"& .customSelectContainer": {
|
50
|
+
border: "none !important",
|
51
|
+
padding: "0px !important",
|
52
|
+
boxShadow: "none !important"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
drawerContainer: {
|
56
|
+
"&.MuiDrawer-root": {
|
57
|
+
zIndex: 1301
|
58
|
+
},
|
59
|
+
"& .MuiDrawer-paper": {
|
60
|
+
borderTopLeftRadius: 8,
|
61
|
+
borderTopRightRadius: 8,
|
62
|
+
backgroundColor: containers?.card
|
63
|
+
},
|
64
|
+
"& .customSelectContainer": {
|
65
|
+
border: "none"
|
66
|
+
}
|
67
|
+
}
|
68
|
+
};
|
69
|
+
};
|
70
|
+
export default DragStyles;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { useDraggable } from "@dnd-kit/core";
|
2
|
+
import { Box } from "@mui/material";
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
+
function Draggable(props) {
|
5
|
+
const {
|
6
|
+
attributes,
|
7
|
+
listeners,
|
8
|
+
setNodeRef,
|
9
|
+
transform
|
10
|
+
} = useDraggable(props);
|
11
|
+
const {
|
12
|
+
dragType
|
13
|
+
} = props?.data || {};
|
14
|
+
const style = transform ? {
|
15
|
+
transform: dragType === "row" ? `translate3d(0, ${transform.y}px, 0)` : `translate3d(${transform.x}px, 0, 0)`
|
16
|
+
} : undefined;
|
17
|
+
return /*#__PURE__*/_jsx(Box, {
|
18
|
+
style: style,
|
19
|
+
ref: setNodeRef,
|
20
|
+
...listeners,
|
21
|
+
...attributes,
|
22
|
+
children: props.children
|
23
|
+
});
|
24
|
+
}
|
25
|
+
export default Draggable;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { useDroppable } from "@dnd-kit/core";
|
2
|
+
import { Box } from "@mui/material";
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
6
|
+
function getStyle(dragType, isOver, tableDOM) {
|
7
|
+
const style = {};
|
8
|
+
const borderStyle = "4px solid #2563EB";
|
9
|
+
if (isOver) {
|
10
|
+
const {
|
11
|
+
width,
|
12
|
+
height
|
13
|
+
} = tableDOM.getBoundingClientRect();
|
14
|
+
if (dragType === "row") {
|
15
|
+
style.borderTop = borderStyle;
|
16
|
+
style.width = width;
|
17
|
+
} else if (dragType === "col") {
|
18
|
+
style.borderLeft = borderStyle;
|
19
|
+
style.height = height;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
return style;
|
23
|
+
}
|
24
|
+
export function Droppable(props) {
|
25
|
+
const {
|
26
|
+
dragType,
|
27
|
+
tableDOM,
|
28
|
+
...rest
|
29
|
+
} = props;
|
30
|
+
const {
|
31
|
+
isOver,
|
32
|
+
setNodeRef
|
33
|
+
} = useDroppable(rest);
|
34
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
35
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
36
|
+
ref: setNodeRef,
|
37
|
+
sx: {
|
38
|
+
position: "absolute",
|
39
|
+
top: 0,
|
40
|
+
left: 0,
|
41
|
+
width: "100%",
|
42
|
+
height: "100%"
|
43
|
+
}
|
44
|
+
}), isOver ? /*#__PURE__*/_jsx(Box, {
|
45
|
+
sx: {
|
46
|
+
position: "absolute",
|
47
|
+
top: 0,
|
48
|
+
left: 0,
|
49
|
+
...getStyle(dragType, isOver, tableDOM)
|
50
|
+
}
|
51
|
+
}) : null]
|
52
|
+
});
|
53
|
+
}
|
@@ -1,20 +1,25 @@
|
|
1
|
-
const TableStyles =
|
1
|
+
const TableStyles = theme => ({
|
2
2
|
tableToolBar: {
|
3
3
|
position: "absolute",
|
4
|
-
top: "-
|
4
|
+
top: "-24px",
|
5
5
|
left: 0,
|
6
|
-
backgroundColor: "#FFF",
|
7
|
-
border: "1px solid rgba(37, 99, 235, 0.32)",
|
8
|
-
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
|
9
|
-
borderRadius: "0px",
|
10
|
-
width: "32px",
|
11
|
-
height: "32px",
|
12
|
-
overflow: "hidden",
|
13
6
|
transition: "all 0.3s",
|
14
7
|
"& button": {
|
8
|
+
backgroundColor: theme?.palette?.editor?.background,
|
9
|
+
border: "1px solid rgba(37, 99, 235, 0.32)",
|
10
|
+
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
|
11
|
+
borderRadius: "50%",
|
12
|
+
padding: "4px",
|
13
|
+
margin: "2px",
|
14
|
+
"&:hover": {
|
15
|
+
backgroundColor: theme?.palette?.editor?.background
|
16
|
+
},
|
15
17
|
"& svg": {
|
16
|
-
width: "
|
17
|
-
height: "
|
18
|
+
width: "18px",
|
19
|
+
height: "18px",
|
20
|
+
"& path": {
|
21
|
+
stroke: theme?.palette?.editor?.closeButtonSvgStroke
|
22
|
+
}
|
18
23
|
}
|
19
24
|
},
|
20
25
|
"&.active": {
|
@@ -31,13 +36,7 @@ const TableStyles = themeType => ({
|
|
31
36
|
},
|
32
37
|
table: {
|
33
38
|
"& td": {
|
34
|
-
padding: "8px 8px"
|
35
|
-
border: "1px solid #E0E0E0",
|
36
|
-
"&.selection": {
|
37
|
-
"& *::selection": {
|
38
|
-
background: "transparent"
|
39
|
-
}
|
40
|
-
}
|
39
|
+
padding: "8px 8px"
|
41
40
|
},
|
42
41
|
"& .selection-area-tc": {
|
43
42
|
position: "absolute",
|
@@ -45,8 +44,13 @@ const TableStyles = themeType => ({
|
|
45
44
|
height: "100%",
|
46
45
|
top: 0,
|
47
46
|
left: 0,
|
48
|
-
|
47
|
+
outline: "1px solid #2563EB",
|
49
48
|
pointerEvents: "none"
|
49
|
+
},
|
50
|
+
"& .hide-drag-btn-wrapper": {
|
51
|
+
"& .row-drag-btn": {
|
52
|
+
display: "none"
|
53
|
+
}
|
50
54
|
}
|
51
55
|
},
|
52
56
|
cellResizer: {
|
@@ -55,33 +59,11 @@ const TableStyles = themeType => ({
|
|
55
59
|
right: "-2px",
|
56
60
|
top: 0,
|
57
61
|
background: "transparent",
|
58
|
-
width: "
|
62
|
+
width: "3px",
|
59
63
|
borderRadius: "0px",
|
60
64
|
zIndex: 1,
|
61
65
|
"&:hover": {
|
62
|
-
background: "#
|
63
|
-
}
|
64
|
-
},
|
65
|
-
deleteCellsPopUp: {
|
66
|
-
backgroundColor: themeType === "dark" ? "#292C32" : "#FFFFFF",
|
67
|
-
borderRadius: "7px !important",
|
68
|
-
border: themeType === "dark" ? "1px solid #5B5E64" : "1px solid #E4E8EB",
|
69
|
-
zIndex: 100,
|
70
|
-
minWidth: "186px !important"
|
71
|
-
},
|
72
|
-
menuItemPopUp: {
|
73
|
-
padding: "5px 7px !important",
|
74
|
-
margin: "6px !important",
|
75
|
-
borderRadius: 1,
|
76
|
-
userSelect: "none",
|
77
|
-
color: themeType === "dark" ? "#2563EB" : "#0F172A",
|
78
|
-
"&:hover": {
|
79
|
-
// backgroundColor: "rgba(0, 123, 255, 0.1)",
|
80
|
-
backgroundColor: themeType === "dark" ? "#2563EB" : "#E9F3FE"
|
81
|
-
},
|
82
|
-
"&.Mui-selected": {
|
83
|
-
backgroundColor: themeType === "dark" ? "#2563EB" : "#E9F3FE",
|
84
|
-
color: themeType === "dark" ? "#F6F6F6" : "#0F172A"
|
66
|
+
background: "#2563EB"
|
85
67
|
}
|
86
68
|
}
|
87
69
|
});
|