@flozy/editor 9.0.7 → 9.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/ChatEditor.js +2 -2
- package/dist/Editor/CommonEditor.js +11 -41
- package/dist/Editor/Editor.css +1 -15
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +1 -0
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +1 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +1 -6
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +9 -19
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +2 -32
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +29 -126
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
- package/dist/Editor/Elements/DataView/styles.js +8 -8
- package/dist/Editor/Elements/Grid/GridItem.js +2 -1
- package/dist/Editor/Elements/Link/Link.js +43 -70
- package/dist/Editor/Elements/SimpleText/index.js +1 -0
- package/dist/Editor/Elements/Variables/Style.js +2 -28
- package/dist/Editor/Elements/Variables/VariableButton.js +3 -7
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -0
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +8 -9
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +6 -3
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +14 -38
- package/dist/Editor/common/DnD/Draggable.js +1 -0
- package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -0
- package/dist/Editor/common/MentionsPopup/Styles.js +3 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
- package/dist/Editor/commonStyle.js +4 -59
- package/dist/Editor/plugins/withHTML.js +1 -1
- package/dist/Editor/utils/helper.js +1 -13
- package/dist/Editor/utils/link.js +1 -1
- package/package.json +2 -5
- package/dist/Editor/common/CustomDialog/index.js +0 -90
- package/dist/Editor/common/CustomDialog/styles.js +0 -80
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useCallback, useMemo, useRef, useState, useImperativeHandle, forwardRef } from "react";
|
1
|
+
import React, { useCallback, useMemo, useRef, useState, useEffect, useImperativeHandle, forwardRef } from "react";
|
2
2
|
import { Editable, Slate, ReactEditor } from 'slate-react';
|
3
3
|
import { createEditor, Transforms, Editor } from 'slate';
|
4
4
|
import withCommon from "./hooks/withCommon";
|
@@ -41,7 +41,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
41
41
|
}]
|
42
42
|
}]
|
43
43
|
});
|
44
|
-
const [value] = useState(convertedContent);
|
44
|
+
const [value, setValue] = useState(convertedContent);
|
45
45
|
const debouncedValue = useRef(value);
|
46
46
|
const debounced = useDebouncedCallback(
|
47
47
|
// function
|
@@ -27,7 +27,7 @@ import DragAndDrop from "./common/DnD";
|
|
27
27
|
import Section from "./common/Section";
|
28
28
|
import decorators from "./utils/Decorators";
|
29
29
|
import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
|
30
|
-
import { getInitialValue, handleInsertLastElement,
|
30
|
+
import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
|
31
31
|
import useWindowResize from "./hooks/useWindowResize";
|
32
32
|
import PopoverAIInput from "./Elements/AI/PopoverAIInput";
|
33
33
|
import RnDCopy from "./common/RnD/RnDCopy";
|
@@ -37,7 +37,6 @@ import "./font.css";
|
|
37
37
|
import "./Editor.css";
|
38
38
|
import "animate.css";
|
39
39
|
import FontLoader from "./common/FontLoader/FontLoader";
|
40
|
-
import { CustomDialogComponent } from "./common/CustomDialog";
|
41
40
|
import { jsx as _jsx } from "react/jsx-runtime";
|
42
41
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
43
42
|
const Item = /*#__PURE__*/forwardRef(({
|
@@ -115,7 +114,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
115
114
|
const [breakpoint, setBreakpoint] = useState("");
|
116
115
|
const [topBanner, setTopBanner] = useState();
|
117
116
|
const debouncedValue = useRef(value);
|
118
|
-
const dialogRef = useRef(null);
|
119
117
|
const [size] = useWindowResize();
|
120
118
|
const {
|
121
119
|
needDotsBG,
|
@@ -357,15 +355,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
357
355
|
...partialState
|
358
356
|
}));
|
359
357
|
};
|
360
|
-
const handleDeleteAll = () => {
|
361
|
-
const {
|
362
|
-
selection
|
363
|
-
} = editor;
|
364
|
-
if (selection) {
|
365
|
-
editor.deleteFragment();
|
366
|
-
dialogRef.current?.handleClose();
|
367
|
-
}
|
368
|
-
};
|
369
358
|
const onKeyDown = useCallback(event => {
|
370
359
|
const isMetaKey = event.metaKey && event.keyCode >= 65 && event.keyCode <= 90;
|
371
360
|
const isCtrlKey = event.ctrlKey || isMetaKey;
|
@@ -412,27 +401,16 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
412
401
|
const {
|
413
402
|
selection
|
414
403
|
} = editor;
|
415
|
-
const everythingSelect = isEverythingSelected(editor);
|
416
404
|
event.preventDefault();
|
417
|
-
if (
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
}
|
424
|
-
editor.deleteBackward({
|
425
|
-
unit: "character"
|
426
|
-
});
|
427
|
-
}
|
405
|
+
if (selection) {
|
406
|
+
if (!Range.isCollapsed(selection)) {
|
407
|
+
editor.deleteFragment();
|
408
|
+
} else {
|
409
|
+
editor.deleteBackward({
|
410
|
+
unit: "character"
|
411
|
+
});
|
428
412
|
}
|
429
413
|
}
|
430
|
-
} else if (event.key === "Delete") {
|
431
|
-
const everythingSelect = isEverythingSelected(editor);
|
432
|
-
if (everythingSelect) {
|
433
|
-
event.preventDefault();
|
434
|
-
dialogRef.current?.handleOpen();
|
435
|
-
}
|
436
414
|
}
|
437
415
|
}, [chars, target, mentions, setMentions, search, type, mentionsRef]);
|
438
416
|
const Overlay = collaborativeEditor && !isReadOnly ? RemoteCursorOverlay : React.Fragment;
|
@@ -511,10 +489,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
511
489
|
console.log("handleCursorScroll", err);
|
512
490
|
}
|
513
491
|
};
|
514
|
-
return /*#__PURE__*/
|
492
|
+
return /*#__PURE__*/_jsx(EditorProvider, {
|
515
493
|
theme: theme,
|
516
494
|
editor: editor,
|
517
|
-
children:
|
495
|
+
children: /*#__PURE__*/_jsx(DialogWrapper, {
|
518
496
|
classes: classes,
|
519
497
|
...props,
|
520
498
|
fullScreen: fullScreen,
|
@@ -638,15 +616,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
638
616
|
readOnly: readOnly
|
639
617
|
})]
|
640
618
|
})
|
641
|
-
})
|
642
|
-
ref: dialogRef,
|
643
|
-
content: "Are you sure you want to delete All the content?",
|
644
|
-
confirmText: "Delete",
|
645
|
-
cancelText: "Cancel",
|
646
|
-
onConfirm: () => {
|
647
|
-
handleDeleteAll();
|
648
|
-
}
|
649
|
-
})]
|
619
|
+
})
|
650
620
|
});
|
651
621
|
});
|
652
622
|
CommonEditor.displayName = "CommonEditor";
|
package/dist/Editor/Editor.css
CHANGED
@@ -1339,18 +1339,4 @@ code.markcode {
|
|
1339
1339
|
display: block;
|
1340
1340
|
background-color: #f3f3f3;
|
1341
1341
|
font-family: 'Source Code Pro' !important;
|
1342
|
-
}
|
1343
|
-
/* Hide the popper when the reference is hidden */
|
1344
|
-
.hide-popper-on-overlap[data-popper-escaped],
|
1345
|
-
.hide-popper-on-overlap[data-popper-reference-hidden] {
|
1346
|
-
visibility: hidden;
|
1347
|
-
pointer-events: none;
|
1348
|
-
}
|
1349
|
-
code.markcode {
|
1350
|
-
border-radius: 4px;
|
1351
|
-
padding: 6px 8px;
|
1352
|
-
margin: 8px 0px;
|
1353
|
-
display: block;
|
1354
|
-
background-color: #f3f3f3;
|
1355
|
-
font-family: 'Source Code Pro' !important;
|
1356
|
-
}
|
1342
|
+
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { ReactEditor } from "slate-react";
|
3
|
+
import { Transforms } from "slate";
|
3
4
|
import ColorPickerTool from "react-gcolor-picker";
|
4
5
|
import { IconButton, Tooltip, Box, Popover } from "@mui/material";
|
5
6
|
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions";
|
@@ -16,10 +16,7 @@ const ColumnView = props => {
|
|
16
16
|
selected,
|
17
17
|
readOnly
|
18
18
|
} = props;
|
19
|
-
const
|
20
|
-
type
|
21
|
-
} = property;
|
22
|
-
const DataType = DataTypes[type] || DataTypes["text"];
|
19
|
+
const DataType = DataTypes[property?.type] || DataTypes["text"];
|
23
20
|
const anchorRef = useRef(null);
|
24
21
|
const [anchorEl, setAnchorEl] = useState(null);
|
25
22
|
const [popperRefresh, setPopperRefresh] = useState(new Date().getTime());
|
@@ -153,9 +153,11 @@ export default function Select(props) {
|
|
153
153
|
...optionProps,
|
154
154
|
children: /*#__PURE__*/_jsx(Chip, {
|
155
155
|
label: option.label || option.value || "",
|
156
|
-
classes: classes.chipText,
|
157
156
|
sx: {
|
158
|
-
background: option.color || appTheme?.palette?.editor?.tv_border1
|
157
|
+
background: option.color || appTheme?.palette?.editor?.tv_border1,
|
158
|
+
"& .MuiChip-label": {
|
159
|
+
paddingLeft: "12px !important"
|
160
|
+
}
|
159
161
|
},
|
160
162
|
avatar: /*#__PURE__*/_jsx(AvatarIcon, {
|
161
163
|
option: option,
|
@@ -170,7 +172,6 @@ export default function Select(props) {
|
|
170
172
|
fullWidth: true,
|
171
173
|
renderInput: params => {
|
172
174
|
return /*#__PURE__*/_jsx(TextField, {
|
173
|
-
fullWidth: true,
|
174
175
|
size: "small",
|
175
176
|
...params,
|
176
177
|
placeholder: placeholder
|
@@ -3,7 +3,7 @@ const useCompStyles = (theme, appTheme) => ({
|
|
3
3
|
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
4
4
|
background: appTheme?.palette?.editor?.tv_pop_bg,
|
5
5
|
color: appTheme?.palette?.editor?.tv_text,
|
6
|
-
fontSize:
|
6
|
+
fontSize: '14px',
|
7
7
|
borderRadius: "8px",
|
8
8
|
[theme?.breakpoints?.between("xs", "md")]: {},
|
9
9
|
"& ul": {
|
@@ -63,11 +63,6 @@ const useCompStyles = (theme, appTheme) => ({
|
|
63
63
|
}
|
64
64
|
}
|
65
65
|
}
|
66
|
-
},
|
67
|
-
chipText: {
|
68
|
-
"& .MuiChip-label": {
|
69
|
-
paddingLeft: "12px !important"
|
70
|
-
}
|
71
66
|
}
|
72
67
|
});
|
73
68
|
export default useCompStyles;
|
@@ -1,9 +1,6 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import DatePicker from "react-datepicker";
|
3
|
-
import { Grid } from "@mui/material";
|
4
3
|
import { useDataView } from "../../Providers/DataViewProvider";
|
5
|
-
import useCommonStyle from "../../../../commonStyle";
|
6
|
-
import { useEditorContext } from "../../../../hooks/useMouseMove";
|
7
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
5
|
function isValidDate(dateString) {
|
9
6
|
const date = new Date(dateString);
|
@@ -19,27 +16,20 @@ const DateType = props => {
|
|
19
16
|
const {
|
20
17
|
onChange
|
21
18
|
} = useDataView();
|
22
|
-
const {
|
23
|
-
theme
|
24
|
-
} = useEditorContext();
|
25
|
-
const classes = useCommonStyle(theme);
|
26
19
|
const handleChange = date => {
|
27
20
|
onChange(rowIndex, {
|
28
21
|
[property]: date
|
29
22
|
});
|
30
23
|
};
|
31
|
-
return /*#__PURE__*/_jsx(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
},
|
41
|
-
placeholderText: "MM/DD/YYYY"
|
42
|
-
})
|
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"
|
43
33
|
});
|
44
34
|
};
|
45
35
|
export default DateType;
|
@@ -10,16 +10,12 @@ const useTableStyles = (theme, appTheme) => ({
|
|
10
10
|
borderSpacing: 0,
|
11
11
|
borderRadius: "7px 7px 0px 0px",
|
12
12
|
overflow: "hidden",
|
13
|
-
width: "auto !important",
|
14
|
-
minWidth: "100%",
|
15
13
|
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
16
|
-
tableLayout: "fixed",
|
17
14
|
"& thead": {
|
18
15
|
background: appTheme?.palette?.editor?.tv_header,
|
19
16
|
height: "40px"
|
20
17
|
},
|
21
18
|
"& th": {
|
22
|
-
position: "relative",
|
23
19
|
"& svg": {
|
24
20
|
"& .fillStroke": {
|
25
21
|
stroke: appTheme?.palette?.editor?.tv_stroke
|
@@ -31,8 +27,6 @@ const useTableStyles = (theme, appTheme) => ({
|
|
31
27
|
},
|
32
28
|
"& td": {
|
33
29
|
height: "40px",
|
34
|
-
maxWidth: "0px !important",
|
35
|
-
minWidth: "0px !important",
|
36
30
|
"& input": {
|
37
31
|
color: appTheme?.palette?.editor?.tv_text_primary,
|
38
32
|
background: "transparent",
|
@@ -45,11 +39,6 @@ const useTableStyles = (theme, appTheme) => ({
|
|
45
39
|
"& th, tr, td": {
|
46
40
|
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`
|
47
41
|
},
|
48
|
-
"& th, & td": {
|
49
|
-
overflowX: "clip",
|
50
|
-
textOverflow: "ellipsis",
|
51
|
-
whiteSpace: "nowrap"
|
52
|
-
},
|
53
42
|
"& .tv-act-btn": {
|
54
43
|
color: appTheme?.palette?.editor?.tv_text,
|
55
44
|
textTransform: "none",
|
@@ -96,18 +85,13 @@ const useTableStyles = (theme, appTheme) => ({
|
|
96
85
|
paddingTop: "3px",
|
97
86
|
paddingBottom: "3px",
|
98
87
|
paddingLeft: "3px",
|
99
|
-
|
88
|
+
maxWidth: "250px",
|
100
89
|
overflow: "hidden",
|
101
90
|
position: "relative",
|
102
91
|
"& .tv-ms-tag-wrpr": {
|
103
92
|
display: "flex",
|
104
93
|
flexWrap: "nowrap",
|
105
|
-
overflow: "auto"
|
106
|
-
minWidth: "58px",
|
107
|
-
"& .MuiChip-deleteIcon": {
|
108
|
-
minWidth: "22px",
|
109
|
-
minHeight: "22px"
|
110
|
-
}
|
94
|
+
overflow: "auto"
|
111
95
|
},
|
112
96
|
"&.Mui-disabled": {
|
113
97
|
"& input": {
|
@@ -145,20 +129,6 @@ const useTableStyles = (theme, appTheme) => ({
|
|
145
129
|
opacity: 1
|
146
130
|
}
|
147
131
|
}
|
148
|
-
},
|
149
|
-
cellResizer: {
|
150
|
-
position: "absolute",
|
151
|
-
cursor: "col-resize",
|
152
|
-
right: "0px",
|
153
|
-
top: 0,
|
154
|
-
width: "3px",
|
155
|
-
borderRadius: "0px",
|
156
|
-
zIndex: 1,
|
157
|
-
background: "transparent",
|
158
|
-
height: "100%",
|
159
|
-
"&:hover, &.active": {
|
160
|
-
background: "#2563EB"
|
161
|
-
}
|
162
132
|
}
|
163
133
|
});
|
164
134
|
export default useTableStyles;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from "react";
|
2
2
|
import { Box, Button, useTheme } from "@mui/material";
|
3
3
|
import { useDataView } from "../Providers/DataViewProvider";
|
4
4
|
import PropertySettings from "./Options";
|
@@ -7,127 +7,37 @@ import useTableStyles from "./TableStyles";
|
|
7
7
|
import { GridSettingsIcon, GridAddSectionIcon } from "../../../common/iconslist";
|
8
8
|
import { useEditorContext } from "../../../hooks/useMouseMove";
|
9
9
|
import Icon from "../../../common/Icon";
|
10
|
-
import useTableResize from "../../../utils/customHooks/useTableResize";
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
12
11
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
13
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
|
-
const Resizer = ({
|
15
|
-
classes,
|
16
|
-
onMouseDown,
|
17
|
-
height,
|
18
|
-
resizing
|
19
|
-
}) => {
|
20
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
21
|
-
children: /*#__PURE__*/_jsx(Box, {
|
22
|
-
component: "div",
|
23
|
-
className: `cell-resizer ${resizing ? "active" : ""}`,
|
24
|
-
contentEditable: false,
|
25
|
-
onPointerDown: onMouseDown,
|
26
|
-
sx: classes.cellResizer,
|
27
|
-
style: {
|
28
|
-
height: `${height}px`
|
29
|
-
}
|
30
|
-
})
|
31
|
-
});
|
32
|
-
};
|
33
13
|
const SortIcon = props => {
|
34
14
|
const {
|
35
15
|
sortBy
|
36
16
|
} = props;
|
37
17
|
return sortBy ? sortBy === "asc" ? /*#__PURE__*/_jsx(Box, {
|
38
18
|
sx: {
|
39
|
-
|
40
|
-
|
19
|
+
'& svg': {
|
20
|
+
'& path': {
|
41
21
|
stroke: "rgba(37, 99, 235, 1) !important"
|
42
22
|
}
|
43
23
|
}
|
44
24
|
},
|
45
25
|
children: /*#__PURE__*/_jsx(Icon, {
|
46
|
-
icon:
|
26
|
+
icon: 'chervUp'
|
47
27
|
})
|
48
28
|
}) : /*#__PURE__*/_jsx(Box, {
|
49
29
|
sx: {
|
50
|
-
|
51
|
-
|
30
|
+
'& svg': {
|
31
|
+
'& path': {
|
52
32
|
stroke: "rgba(37, 99, 235, 1) !important"
|
53
33
|
}
|
54
34
|
}
|
55
35
|
},
|
56
36
|
children: /*#__PURE__*/_jsx(Icon, {
|
57
|
-
icon:
|
37
|
+
icon: 'chervDown'
|
58
38
|
})
|
59
39
|
}) : null;
|
60
40
|
};
|
61
|
-
const THead = props => {
|
62
|
-
const thRef = useRef(null);
|
63
|
-
const [headerTextWidth, setHeaderTextWidth] = useState(200);
|
64
|
-
const {
|
65
|
-
iconType,
|
66
|
-
isSort,
|
67
|
-
classes,
|
68
|
-
onEditProperty,
|
69
|
-
m,
|
70
|
-
tableRef,
|
71
|
-
handleResize
|
72
|
-
} = props;
|
73
|
-
// do not remove extra coma it will lead to swap of variable
|
74
|
-
const [size, onMouseDown, resizing,, isDone] = useTableResize({
|
75
|
-
parentDOM: thRef?.current,
|
76
|
-
size: m?.size,
|
77
|
-
minMaxProps: {
|
78
|
-
minWidth: 30
|
79
|
-
}
|
80
|
-
});
|
81
|
-
const finalWidth = size?.width < headerTextWidth ? headerTextWidth : size?.width || 200;
|
82
|
-
useEffect(() => {
|
83
|
-
if (thRef?.current) {
|
84
|
-
const tw = (thRef?.current?.querySelectorAll(".dht-text")[0]?.getBoundingClientRect()?.width || 0) + 16 + 30;
|
85
|
-
setHeaderTextWidth(tw);
|
86
|
-
}
|
87
|
-
}, [thRef?.current, m?.label]);
|
88
|
-
useEffect(() => {
|
89
|
-
if (isDone) {
|
90
|
-
handleResize({
|
91
|
-
...m,
|
92
|
-
size: size
|
93
|
-
});
|
94
|
-
}
|
95
|
-
}, [isDone]);
|
96
|
-
return /*#__PURE__*/_jsxs("th", {
|
97
|
-
style: {
|
98
|
-
minWidth: finalWidth,
|
99
|
-
maxWidth: finalWidth,
|
100
|
-
width: finalWidth
|
101
|
-
},
|
102
|
-
ref: thRef,
|
103
|
-
children: [/*#__PURE__*/_jsx(Box, {
|
104
|
-
sx: {
|
105
|
-
maxWidth: "100%",
|
106
|
-
overflow: "hidden"
|
107
|
-
},
|
108
|
-
children: /*#__PURE__*/_jsx(Button, {
|
109
|
-
className: "tv-act-btn la",
|
110
|
-
startIcon: /*#__PURE__*/_jsx(Icon, {
|
111
|
-
icon: iconType
|
112
|
-
}),
|
113
|
-
endIcon: /*#__PURE__*/_jsx(SortIcon, {
|
114
|
-
sortBy: isSort
|
115
|
-
}),
|
116
|
-
fullWidth: true,
|
117
|
-
onClick: onEditProperty(m),
|
118
|
-
children: /*#__PURE__*/_jsx("span", {
|
119
|
-
className: "dht-text",
|
120
|
-
children: m.label
|
121
|
-
})
|
122
|
-
})
|
123
|
-
}), /*#__PURE__*/_jsx(Resizer, {
|
124
|
-
classes: classes,
|
125
|
-
onMouseDown: onMouseDown,
|
126
|
-
height: tableRef?.current?.getBoundingClientRect()?.height,
|
127
|
-
resizing: resizing
|
128
|
-
})]
|
129
|
-
});
|
130
|
-
};
|
131
41
|
const TableView = props => {
|
132
42
|
const {
|
133
43
|
theme: appTheme
|
@@ -138,7 +48,6 @@ const TableView = props => {
|
|
138
48
|
} = props;
|
139
49
|
const theme = useTheme();
|
140
50
|
const classes = useTableStyles(theme, appTheme);
|
141
|
-
const tableRef = useRef(null);
|
142
51
|
const {
|
143
52
|
properties,
|
144
53
|
onAddProperty,
|
@@ -255,9 +164,6 @@ const TableView = props => {
|
|
255
164
|
setMode({});
|
256
165
|
setAnchorEl(null);
|
257
166
|
};
|
258
|
-
const handleResize = data => {
|
259
|
-
onUpdateProperty(data);
|
260
|
-
};
|
261
167
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
262
168
|
children: [/*#__PURE__*/_jsx(Box, {
|
263
169
|
component: "div",
|
@@ -267,7 +173,6 @@ const TableView = props => {
|
|
267
173
|
children: /*#__PURE__*/_jsxs(Box, {
|
268
174
|
component: "table",
|
269
175
|
sx: classes.table,
|
270
|
-
ref: tableRef,
|
271
176
|
children: [/*#__PURE__*/_jsx("thead", {
|
272
177
|
children: /*#__PURE__*/_jsxs("tr", {
|
273
178
|
children: [shownProperties?.map((m, i) => {
|
@@ -275,23 +180,26 @@ const TableView = props => {
|
|
275
180
|
Icon: iconType
|
276
181
|
} = PROPERTY_TYPES?.find(f => f.type === m.type) || {};
|
277
182
|
const isSort = sortBy?.key === m.key ? sortBy?.operator : null;
|
278
|
-
return /*#__PURE__*/_jsx(
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
183
|
+
return /*#__PURE__*/_jsx("th", {
|
184
|
+
style: {
|
185
|
+
minWidth: "200px"
|
186
|
+
},
|
187
|
+
children: /*#__PURE__*/_jsx(Button, {
|
188
|
+
className: "tv-act-btn la",
|
189
|
+
startIcon: /*#__PURE__*/_jsx(Icon, {
|
190
|
+
icon: iconType
|
191
|
+
}),
|
192
|
+
endIcon: /*#__PURE__*/_jsx(SortIcon, {
|
193
|
+
sortBy: isSort
|
194
|
+
}),
|
195
|
+
fullWidth: true,
|
196
|
+
onClick: onEditProperty(m),
|
197
|
+
children: m.label
|
198
|
+
})
|
286
199
|
}, i);
|
287
200
|
}), !readOnly ? /*#__PURE__*/_jsxs(_Fragment, {
|
288
201
|
children: [/*#__PURE__*/_jsx("th", {
|
289
202
|
className: "tv-act-btn ico",
|
290
|
-
style: {
|
291
|
-
maxWidth: "80px",
|
292
|
-
minWidth: "80px",
|
293
|
-
width: "auto"
|
294
|
-
},
|
295
203
|
children: /*#__PURE__*/_jsx(Button, {
|
296
204
|
onClick: onAddClick,
|
297
205
|
fullWidth: true,
|
@@ -299,11 +207,6 @@ const TableView = props => {
|
|
299
207
|
})
|
300
208
|
}), /*#__PURE__*/_jsx("th", {
|
301
209
|
className: "tv-act-btn ico",
|
302
|
-
style: {
|
303
|
-
maxWidth: "80px",
|
304
|
-
minWidth: "80px",
|
305
|
-
width: "auto"
|
306
|
-
},
|
307
210
|
children: /*#__PURE__*/_jsx(Button, {
|
308
211
|
onClick: onSettings,
|
309
212
|
fullWidth: true,
|
@@ -323,18 +226,18 @@ const TableView = props => {
|
|
323
226
|
textTransform: "none",
|
324
227
|
justifyContent: "start",
|
325
228
|
color: appTheme?.palette?.editor?.activeColor,
|
326
|
-
|
327
|
-
width:
|
328
|
-
height:
|
229
|
+
'& svg': {
|
230
|
+
width: '18px',
|
231
|
+
height: '18px',
|
329
232
|
strokeWidth: 1.2,
|
330
|
-
|
233
|
+
'& path': {
|
331
234
|
stroke: appTheme?.palette?.editor?.activeColor
|
332
235
|
}
|
333
236
|
},
|
334
|
-
fontFamily:
|
237
|
+
fontFamily: 'inter'
|
335
238
|
},
|
336
239
|
startIcon: /*#__PURE__*/_jsx(Icon, {
|
337
|
-
icon:
|
240
|
+
icon: 'addRounded'
|
338
241
|
}),
|
339
242
|
children: "Add new row"
|
340
243
|
}) : null, open && !readOnly ? /*#__PURE__*/_jsx(PropertySettings, {
|
@@ -58,17 +58,17 @@ const ViewData = props => {
|
|
58
58
|
}
|
59
59
|
},
|
60
60
|
children: [rows?.map((row, i) => {
|
61
|
-
return /*#__PURE__*/
|
61
|
+
return /*#__PURE__*/_jsx(Box, {
|
62
62
|
component: "tr",
|
63
63
|
className: "tv-act-row",
|
64
|
-
children:
|
64
|
+
children: /*#__PURE__*/_jsx(RenderRow, {
|
65
65
|
rowIndex: row?.id,
|
66
66
|
row: row,
|
67
67
|
properties: properties,
|
68
68
|
onSelect: onSelect,
|
69
69
|
selected: selectedRows?.includes(row?.id),
|
70
70
|
readOnly: readOnly
|
71
|
-
})
|
71
|
+
})
|
72
72
|
}, i);
|
73
73
|
}), /*#__PURE__*/_jsx("tr", {
|
74
74
|
style: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { createContext, useContext, useEffect, useState } from "react";
|
2
|
-
import { Transforms, Node } from "slate";
|
2
|
+
import { Editor, Transforms, Node } from "slate";
|
3
3
|
import { PROPERTY_DEFAULTS } from "../Layouts/Options/Constants";
|
4
4
|
import multiSortRows from "../Utils/multiSortRows";
|
5
5
|
import globalSearch from "../Utils/globalSearch";
|
@@ -11,7 +11,7 @@ const useDataViewStyles = (theme, appTheme) => ({
|
|
11
11
|
},
|
12
12
|
"& table th": {
|
13
13
|
cursor: "pointer",
|
14
|
-
|
14
|
+
width: "200px"
|
15
15
|
},
|
16
16
|
"& table, th, td": {
|
17
17
|
border: "1px solid black",
|
@@ -48,7 +48,7 @@ const useDataViewStyles = (theme, appTheme) => ({
|
|
48
48
|
"& .tv-ck-box": {
|
49
49
|
"& svg": {
|
50
50
|
color: appTheme?.palette?.editor?.tv_border,
|
51
|
-
|
51
|
+
'& rect': {
|
52
52
|
fill: appTheme?.palette?.editor?.tv_chk_box_fill,
|
53
53
|
stroke: appTheme?.palette?.editor?.tv_chk_box_stroke
|
54
54
|
}
|
@@ -56,9 +56,9 @@ const useDataViewStyles = (theme, appTheme) => ({
|
|
56
56
|
"&.Mui-checked": {
|
57
57
|
"& svg": {
|
58
58
|
color: "rgba(37, 99, 235, 1)",
|
59
|
-
|
59
|
+
'& rect': {
|
60
60
|
fill: appTheme?.palette?.editor?.activeColor,
|
61
|
-
stroke:
|
61
|
+
stroke: 'none'
|
62
62
|
}
|
63
63
|
}
|
64
64
|
}
|
@@ -94,7 +94,7 @@ const useDataViewStyles = (theme, appTheme) => ({
|
|
94
94
|
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
95
95
|
boxShadow: "0px 4px 18px 0px #0000000D",
|
96
96
|
borderRadius: "8px",
|
97
|
-
minWidth:
|
97
|
+
minWidth: '148px'
|
98
98
|
},
|
99
99
|
"& input": {
|
100
100
|
paddingBottom: "0px",
|
@@ -140,12 +140,12 @@ const useDataViewStyles = (theme, appTheme) => ({
|
|
140
140
|
width: "150px",
|
141
141
|
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
142
142
|
borderRadius: "8px",
|
143
|
-
fontFamily:
|
143
|
+
fontFamily: 'Inter !important',
|
144
144
|
background: appTheme?.palette?.editor?.tv_pop_bg,
|
145
145
|
color: appTheme?.palette?.editor?.tv_text_primary,
|
146
146
|
"& .MuiButtonBase-root": {
|
147
147
|
fontSize: "14px",
|
148
|
-
padding:
|
148
|
+
padding: '6px 8px',
|
149
149
|
"& svg": {
|
150
150
|
width: "16px",
|
151
151
|
height: "16px",
|
@@ -157,7 +157,7 @@ const useDataViewStyles = (theme, appTheme) => ({
|
|
157
157
|
color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
|
158
158
|
"& svg": {
|
159
159
|
color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
|
160
|
-
|
160
|
+
'& path': {
|
161
161
|
stroke: `${appTheme?.palette?.editor?.tv_hover_text} !important`
|
162
162
|
}
|
163
163
|
}
|
@@ -50,7 +50,8 @@ const GridItemToolbar = props => {
|
|
50
50
|
open: true,
|
51
51
|
placement: "top-end",
|
52
52
|
sx: classes.popTools,
|
53
|
-
className: "gi-tool-pp
|
53
|
+
className: "gi-tool-pp",
|
54
|
+
disablePortal: true,
|
54
55
|
contentEditable: false,
|
55
56
|
children: /*#__PURE__*/_jsxs(Box, {
|
56
57
|
className: "ico-grp-ss",
|