@flozy/editor 5.1.3 → 5.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. package/dist/Editor/ChatEditor.js +34 -25
  2. package/dist/Editor/CommonEditor.js +7 -13
  3. package/dist/Editor/Editor.css +10 -52
  4. package/dist/Editor/Elements/AI/AIInput.js +1 -0
  5. package/dist/Editor/Elements/AI/CustomSelect.js +10 -17
  6. package/dist/Editor/Elements/AI/Styles.js +1 -7
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +5 -7
  8. package/dist/Editor/Elements/Color Picker/Styles.js +3 -7
  9. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  10. package/dist/Editor/Elements/Form/Form.js +2 -38
  11. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +1 -7
  12. package/dist/Editor/Elements/Form/FormElements/FormDate.js +1 -7
  13. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +1 -7
  14. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +1 -7
  15. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +1 -7
  16. package/dist/Editor/Elements/Form/FormElements/FormText.js +1 -7
  17. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +1 -6
  18. package/dist/Editor/Elements/Form/FormPopup.js +9 -12
  19. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  20. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
  21. package/dist/Editor/Elements/Grid/GridButton.js +1 -2
  22. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  23. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  24. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  25. package/dist/Editor/Elements/Signature/SignaturePopup.js +48 -13
  26. package/dist/Editor/Elements/SimpleText/index.js +1 -8
  27. package/dist/Editor/Elements/SimpleText/style.js +1 -8
  28. package/dist/Editor/Elements/Table/Styles.js +43 -25
  29. package/dist/Editor/Elements/Table/Table.js +138 -206
  30. package/dist/Editor/Elements/Table/TableCell.js +102 -355
  31. package/dist/Editor/Elements/Table/TablePopup.js +3 -9
  32. package/dist/Editor/Elements/Table/TableRow.js +2 -10
  33. package/dist/Editor/Styles/EditorStyles.js +1 -3
  34. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
  35. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +11 -7
  36. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -10
  37. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
  38. package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -0
  39. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +6 -3
  40. package/dist/Editor/Toolbar/Mini/Styles.js +1 -4
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -3
  42. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +11 -16
  43. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +49 -416
  44. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +8 -62
  45. package/dist/Editor/Toolbar/PopupTool/index.js +6 -5
  46. package/dist/Editor/Toolbar/Toolbar.js +0 -6
  47. package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
  48. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  49. package/dist/Editor/common/ColorPickerButton.js +2 -3
  50. package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
  51. package/dist/Editor/common/Icon.js +23 -24
  52. package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
  53. package/dist/Editor/common/LinkSettings/index.js +1 -2
  54. package/dist/Editor/common/MentionsPopup/Styles.js +3 -151
  55. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  56. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -108
  57. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  58. package/dist/Editor/common/Shorthands/elements.js +1 -13
  59. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  60. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  61. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  62. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -5
  63. package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
  64. package/dist/Editor/common/StyleBuilder/index.js +11 -84
  65. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  66. package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
  67. package/dist/Editor/common/Uploader.js +0 -8
  68. package/dist/Editor/common/iconListV2.js +40 -378
  69. package/dist/Editor/common/iconslist.js +5 -8
  70. package/dist/Editor/commonStyle.js +9 -117
  71. package/dist/Editor/helper/deserialize/index.js +1 -4
  72. package/dist/Editor/helper/index.js +2 -2
  73. package/dist/Editor/helper/theme.js +1 -24
  74. package/dist/Editor/hooks/useMouseMove.js +2 -5
  75. package/dist/Editor/plugins/withCustomDeleteBackward.js +2 -3
  76. package/dist/Editor/plugins/withHTML.js +1 -17
  77. package/dist/Editor/plugins/withLayout.js +1 -48
  78. package/dist/Editor/utils/SlateUtilityFunctions.js +0 -18
  79. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -21
  80. package/dist/Editor/utils/embed.js +1 -2
  81. package/dist/Editor/utils/events.js +1 -0
  82. package/dist/Editor/utils/font.js +4 -11
  83. package/dist/Editor/utils/formfield.js +4 -8
  84. package/dist/Editor/utils/helper.js +1 -34
  85. package/dist/Editor/utils/insertNewLine.js +1 -19
  86. package/dist/Editor/utils/pageSettings.js +2 -14
  87. package/dist/Editor/utils/serializeToText.js +0 -2
  88. package/dist/Editor/utils/table.js +24 -228
  89. package/package.json +1 -1
  90. package/dist/Editor/Elements/DataView/DataView.js +0 -101
  91. package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
  92. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -59
  93. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -30
  94. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -140
  95. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -40
  96. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -59
  97. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -26
  98. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -38
  99. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
  100. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
  101. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
  102. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
  103. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
  104. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
  105. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
  106. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -74
  107. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -64
  108. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -106
  109. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -174
  110. package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
  111. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
  112. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -37
  113. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -111
  114. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -62
  115. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -36
  116. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
  117. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -160
  118. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -190
  119. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -42
  120. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -30
  121. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
  122. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -179
  123. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -100
  124. package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -227
  125. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -70
  126. package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
  127. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -288
  128. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
  129. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -72
  130. package/dist/Editor/Elements/DataView/styles.js +0 -143
  131. package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
  132. package/dist/Editor/Elements/Table/DragButton.js +0 -141
  133. package/dist/Editor/Elements/Table/DragStyles.js +0 -69
  134. package/dist/Editor/Elements/Table/Draggable.js +0 -25
  135. package/dist/Editor/Elements/Table/Droppable.js +0 -53
  136. package/dist/Editor/Elements/Table/TableTool.js +0 -101
  137. package/dist/Editor/Elements/Table/tableHelper.js +0 -71
  138. package/dist/Editor/assets/svg/TableIcons.js +0 -220
  139. package/dist/Editor/common/Select/index.js +0 -20
  140. package/dist/Editor/common/Select/styles.js +0 -17
  141. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  142. package/dist/Editor/hooks/useTable.js +0 -175
  143. package/dist/Editor/utils/dataView.js +0 -43
@@ -1,106 +1,121 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import { Editor, Transforms } from "slate";
3
- import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
4
- import { Box, IconButton, Tooltip, Table as TableComp, TableBody, useTheme, Popper, Fade } from "@mui/material";
1
+ import React, { useState } from "react";
2
+ import { Transforms } from "slate";
3
+ import { useSelected, useSlateStatic } from "slate-react";
4
+ import { Box, IconButton, Tooltip, Table as TableComp, TableBody, useTheme } from "@mui/material";
5
+ import AlignHorizontalLeftIcon from "@mui/icons-material/AlignHorizontalLeft";
6
+ import AlignHorizontalRightIcon from "@mui/icons-material/AlignHorizontalRight";
7
+ import AlignVerticalTopIcon from "@mui/icons-material/AlignVerticalTop";
8
+ import AlignVerticalBottomIcon from "@mui/icons-material/AlignVerticalBottom";
9
+ import DeleteForeverIcon from "@mui/icons-material/DeleteForever";
10
+ import MoreVertIcon from "@mui/icons-material/MoreVert";
11
+ import SettingsIcon from "@mui/icons-material/Settings";
12
+ import DeleteCellIcon from "./DeleteCellIcon";
13
+ import DeleteRowIcon from "./DeleteRowIcon";
5
14
  import { TableUtil } from "../../utils/table";
6
15
  import TablePopup from "./TablePopup";
7
- import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
16
+ import { useEditorSelection } from "../../hooks/useMouseMove";
8
17
  import TableStyles from "./Styles";
9
18
  import "./table.css";
10
19
  import { groupByBreakpoint } from "../../helper/theme";
11
- import useTable, { TableProvider } from "../../hooks/useTable";
12
- import AddRowCol from "./AddRowCol";
13
- import TableTool from "./TableTool";
14
- import { useDebouncedCallback } from "use-debounce";
15
- import { MoreIcon, SettingsIcon } from "../../assets/svg/TableIcons";
16
20
  import { jsx as _jsx } from "react/jsx-runtime";
17
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
- const hideRowDragBtns = (hide, dragRowBtnCls) => {
19
- const rowDragBtns = document.querySelectorAll(`.${dragRowBtnCls}`);
20
- if (rowDragBtns?.length) {
21
- rowDragBtns?.forEach(btn => btn.style.display = hide);
22
+ const TABLE_MENUS = [{
23
+ Icon: AlignHorizontalRightIcon,
24
+ text: "Insert Columns to the Right",
25
+ action: {
26
+ type: "insertColumn",
27
+ position: "after"
22
28
  }
23
- };
24
- const ToolBar = props => {
25
- const {
26
- selected,
27
- showTool,
28
- classes,
29
- handleExpand,
30
- handleAction,
31
- exandTools
32
- } = props;
33
- const {
34
- getSelectedCells
35
- } = useTable();
36
- const viewTool = selected && !showTool && getSelectedCells()?.length <= 1;
37
- return viewTool ? /*#__PURE__*/_jsxs(Box, {
38
- component: "div",
39
- contentEditable: false,
40
- className: `tableToolBar ${exandTools ? "active" : ""}`,
41
- sx: classes.tableToolBar,
42
- children: [/*#__PURE__*/_jsx(Tooltip, {
43
- title: "Settings",
44
- arrow: true,
45
- onClick: () => handleAction("settings"),
46
- children: /*#__PURE__*/_jsx(IconButton, {
47
- className: "toolbtn toggle",
48
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
49
- })
50
- }), /*#__PURE__*/_jsx(Tooltip, {
51
- title: "Show Tools",
52
- arrow: true,
53
- onClick: handleExpand,
54
- children: /*#__PURE__*/_jsx(IconButton, {
55
- className: "toolbtn toggle",
56
- children: /*#__PURE__*/_jsx(MoreIcon, {})
57
- })
58
- })]
59
- }) : null;
60
- };
29
+ }, {
30
+ Icon: AlignHorizontalLeftIcon,
31
+ text: "Insert Columns to the Left",
32
+ action: {
33
+ type: "insertColumn",
34
+ position: "at"
35
+ }
36
+ }, {
37
+ Icon: AlignVerticalTopIcon,
38
+ text: "Insert Row Above",
39
+ action: {
40
+ type: "insertRow",
41
+ positon: "at"
42
+ }
43
+ }, {
44
+ Icon: AlignVerticalBottomIcon,
45
+ text: "Insert Row Below",
46
+ action: {
47
+ type: "insertRow",
48
+ position: "after"
49
+ }
50
+ }, {
51
+ Icon: DeleteRowIcon,
52
+ text: "Delete Row",
53
+ action: {
54
+ type: "deleteRow"
55
+ }
56
+ }, {
57
+ Icon: DeleteCellIcon,
58
+ text: "Delete Column",
59
+ action: {
60
+ type: "deleteColumn"
61
+ }
62
+ }, {
63
+ Icon: SettingsIcon,
64
+ text: "Settings",
65
+ action: {
66
+ type: "settings"
67
+ }
68
+ }, {
69
+ Icon: DeleteForeverIcon,
70
+ text: "Remove Table",
71
+ action: {
72
+ type: "remove"
73
+ }
74
+ }];
61
75
  const Table = props => {
62
76
  const theme = useTheme();
63
- const {
64
- theme: editorTheme
65
- } = useEditorContext();
66
77
  const {
67
78
  element,
68
79
  attributes,
69
80
  children,
70
81
  customProps
71
82
  } = props;
72
- const classes = TableStyles(editorTheme);
83
+ const classes = TableStyles();
73
84
  const {
74
85
  readOnly
75
86
  } = customProps;
76
87
  const [openSetttings, setOpenSettings] = useState(false);
77
- const [exandTools, setExpandTools] = useState(null);
88
+ const [exandTools, setExpandTools] = useState(false);
78
89
  const {
79
90
  bgColor,
80
91
  borderColor,
81
- xsHidden,
82
- fontFamily,
83
- fontWeight,
84
- textSize,
85
- textColor
92
+ xsHidden
86
93
  } = element;
87
94
  const editor = useSlateStatic();
88
95
  const selected = useSelected();
89
96
  const table = new TableUtil(editor);
90
97
  const tableProps = table.getTableProps();
91
98
  const [showTool] = useEditorSelection(editor);
92
- const tableRef = useRef(null);
93
- const containerRef = useRef(null);
94
- const path = ReactEditor.findPath(editor, element);
95
- const dragRowBtnCls = `table-${path?.toString()?.replaceAll(",", "-")}-row-drag-btn`;
96
- const handleAction = type => {
99
+ const handleAction = ({
100
+ type,
101
+ position
102
+ }) => () => {
97
103
  Transforms.select(editor, editor.selection);
98
104
  switch (type) {
99
- case "delete":
100
- table.removeTable();
105
+ case "insertRow":
106
+ table.insertRow(position);
107
+ break;
108
+ case "insertColumn":
109
+ table.insertColumn(position);
110
+ break;
111
+ case "deleteRow":
112
+ table.deleteRow();
101
113
  break;
102
- case "duplicate":
103
- table.duplicateTable();
114
+ case "deleteColumn":
115
+ table.deleteColumn();
116
+ break;
117
+ case "remove":
118
+ table.removeTable();
104
119
  break;
105
120
  case "settings":
106
121
  if (tableProps) {
@@ -111,16 +126,42 @@ const Table = props => {
111
126
  return;
112
127
  }
113
128
  };
114
- const handleExpand = e => {
115
- setExpandTools(prev => prev ? false : e.currentTarget);
129
+ const handleExpand = () => {
130
+ setExpandTools(!exandTools);
131
+ };
132
+ const ToolBar = () => {
133
+ return selected && !showTool ? /*#__PURE__*/_jsxs(Box, {
134
+ component: "div",
135
+ contentEditable: false,
136
+ className: `tableToolBar ${exandTools ? "active" : ""}`,
137
+ sx: classes.tableToolBar,
138
+ children: [/*#__PURE__*/_jsx(Tooltip, {
139
+ title: "Show Tools",
140
+ arrow: true,
141
+ onClick: handleExpand,
142
+ children: /*#__PURE__*/_jsx(IconButton, {
143
+ className: "toolbtn toggle",
144
+ children: /*#__PURE__*/_jsx(MoreVertIcon, {})
145
+ })
146
+ }), TABLE_MENUS.map(({
147
+ Icon,
148
+ text,
149
+ action
150
+ }) => {
151
+ return /*#__PURE__*/_jsx(Tooltip, {
152
+ title: text,
153
+ arrow: true,
154
+ children: /*#__PURE__*/_jsx(IconButton, {
155
+ className: `toolbtn ${action?.type}`,
156
+ onClick: handleAction(action),
157
+ children: /*#__PURE__*/_jsx(Icon, {})
158
+ })
159
+ }, text);
160
+ })]
161
+ }) : null;
116
162
  };
117
- useEffect(() => {
118
- if (!selected) {
119
- setExpandTools(false);
120
- }
121
- }, [selected]);
122
163
  const onSettings = () => {
123
- setOpenSettings(!openSetttings);
164
+ setOpenSettings(true);
124
165
  };
125
166
  const onSave = data => {
126
167
  const updateData = {
@@ -142,137 +183,28 @@ const Table = props => {
142
183
  lg: "inline-block"
143
184
  }
144
185
  }, theme);
145
- const addRow = () => {
146
- const lastRow = element?.rows - 1;
147
- const firstCol = 0;
148
- const lastRowPath = [...path, lastRow, firstCol];
149
- const position = Editor.start(editor, lastRowPath);
150
- const selection = {
151
- anchor: position,
152
- focus: position
153
- };
154
-
155
- // select the last row first col to insert row below
156
- Transforms.select(editor, selection);
157
- table.insertRow("after");
158
- Transforms.deselect(editor);
159
- };
160
- const addCol = () => {
161
- const lastCol = element?.columns - 1;
162
- const firstRow = 0;
163
- const lastColumnPath = [...path, firstRow, lastCol];
164
- const position = Editor.start(editor, lastColumnPath);
165
- const selection = {
166
- anchor: position,
167
- focus: position
168
- };
169
-
170
- // select the last row first col to insert row below
171
- Transforms.select(editor, selection);
172
- table.insertColumn("after");
173
- Transforms.deselect(editor);
174
- };
175
- const handleRowDragBtns = () => {
176
- if (containerRef?.current?.scrollLeft > 0) {
177
- hideRowDragBtns("none", dragRowBtnCls);
178
- } else {
179
- hideRowDragBtns("", dragRowBtnCls);
180
- }
181
- };
182
- const handleScroll = () => {
183
- handleRowDragBtns();
184
- };
185
- const onMouseOver = () => {
186
- containerRef?.current?.classList.remove("hideScroll");
187
- };
188
- const onMouseLeave = () => {
189
- containerRef?.current?.classList.add("hideScroll");
190
- };
191
- const commonAddBtnProps = {
192
- tableRef,
193
- containerRef,
194
- readOnly,
195
- tableNode: element
196
- };
197
- return /*#__PURE__*/_jsxs(TableProvider, {
198
- editor: editor,
199
- otherProps: {
200
- dragRowBtnCls,
201
- tablePath: path,
202
- openSetttings
186
+ return /*#__PURE__*/_jsxs("div", {
187
+ style: {
188
+ minWidth: "100%",
189
+ maxWidth: "100%",
190
+ position: "relative"
203
191
  },
204
- children: [/*#__PURE__*/_jsxs("div", {
205
- style: {
206
- minWidth: "100%",
207
- maxWidth: "100%",
208
- position: "relative",
209
- overflowX: "auto",
210
- display: "flex",
211
- paddingTop: "10px"
212
- },
213
- ref: containerRef,
214
- onScroll: handleScroll,
215
- onMouseOver: onMouseOver,
216
- onMouseLeave: onMouseLeave,
217
- className: "custom-scroll",
218
- children: [/*#__PURE__*/_jsx(TableComp, {
219
- className: readOnly ? "readOnly" : "",
220
- sx: {
221
- ...classes.table,
222
- ...tableSX
223
- },
224
- style: {
225
- background: bgColor,
226
- border: borderColor ? `1px solid ${borderColor}` : "",
227
- width: "auto",
228
- fontFamily,
229
- fontWeight,
230
- fontSize: textSize,
231
- color: textColor
232
- },
233
- ref: tableRef,
234
- children: /*#__PURE__*/_jsx(TableBody, {
235
- ...attributes,
236
- children: children
237
- })
238
- }), /*#__PURE__*/_jsx(AddRowCol, {
239
- ...commonAddBtnProps,
240
- addType: "col",
241
- onAdd: addCol
242
- })]
243
- }), /*#__PURE__*/_jsx(AddRowCol, {
244
- ...commonAddBtnProps,
245
- addType: "row",
246
- onAdd: addRow
247
- }), !readOnly && /*#__PURE__*/_jsx(ToolBar, {
248
- selected: selected,
249
- showTool: showTool,
250
- classes: classes,
251
- handleExpand: handleExpand,
252
- handleAction: handleAction,
253
- exandTools: exandTools
254
- }), /*#__PURE__*/_jsx(Popper, {
255
- open: Boolean(exandTools),
256
- anchorEl: exandTools,
257
- transition: true,
258
- contentEditable: false,
192
+ children: [/*#__PURE__*/_jsx(TableComp, {
193
+ className: readOnly ? "readOnly" : "",
259
194
  sx: {
260
- zIndex: 2000
195
+ ...classes.table,
196
+ ...tableSX
261
197
  },
262
- placement: "bottom-start",
263
- children: ({
264
- TransitionProps
265
- }) => /*#__PURE__*/_jsx(Fade, {
266
- ...TransitionProps,
267
- timeout: 350,
268
- children: /*#__PURE__*/_jsx("div", {
269
- children: /*#__PURE__*/_jsx(TableTool, {
270
- theme: editorTheme,
271
- handleToolAction: handleAction
272
- })
273
- })
198
+ style: {
199
+ background: bgColor,
200
+ border: borderColor ? `1px solid ${borderColor}` : "",
201
+ width: "auto"
202
+ },
203
+ children: /*#__PURE__*/_jsx(TableBody, {
204
+ ...attributes,
205
+ children: children
274
206
  })
275
- }), openSetttings ? /*#__PURE__*/_jsx(TablePopup, {
207
+ }), !readOnly && /*#__PURE__*/_jsx(ToolBar, {}), openSetttings ? /*#__PURE__*/_jsx(TablePopup, {
276
208
  element: tableProps?.styleProps || {},
277
209
  onSave: onSave,
278
210
  onClose: onClose,