@flozy/editor 8.0.4 → 8.0.6
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/Elements/DataView/Layouts/ColumnView.js +4 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +6 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +17 -2
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +21 -6
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- package/package.json +1 -1
@@ -16,7 +16,10 @@ const ColumnView = props => {
|
|
16
16
|
selected,
|
17
17
|
readOnly
|
18
18
|
} = props;
|
19
|
-
const
|
19
|
+
const {
|
20
|
+
type
|
21
|
+
} = property;
|
22
|
+
const DataType = DataTypes[type] || DataTypes["text"];
|
20
23
|
const anchorRef = useRef(null);
|
21
24
|
const [anchorEl, setAnchorEl] = useState(null);
|
22
25
|
const [popperRefresh, setPopperRefresh] = useState(new Date().getTime());
|
@@ -153,11 +153,9 @@ 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,
|
156
157
|
sx: {
|
157
|
-
background: option.color || appTheme?.palette?.editor?.tv_border1
|
158
|
-
"& .MuiChip-label": {
|
159
|
-
paddingLeft: "12px !important"
|
160
|
-
}
|
158
|
+
background: option.color || appTheme?.palette?.editor?.tv_border1
|
161
159
|
},
|
162
160
|
avatar: /*#__PURE__*/_jsx(AvatarIcon, {
|
163
161
|
option: option,
|
@@ -172,6 +170,7 @@ export default function Select(props) {
|
|
172
170
|
fullWidth: true,
|
173
171
|
renderInput: params => {
|
174
172
|
return /*#__PURE__*/_jsx(TextField, {
|
173
|
+
fullWidth: true,
|
175
174
|
size: "small",
|
176
175
|
...params,
|
177
176
|
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,6 +63,11 @@ const useCompStyles = (theme, appTheme) => ({
|
|
63
63
|
}
|
64
64
|
}
|
65
65
|
}
|
66
|
+
},
|
67
|
+
chipText: {
|
68
|
+
"& .MuiChip-label": {
|
69
|
+
paddingLeft: "12px !important"
|
70
|
+
}
|
66
71
|
}
|
67
72
|
});
|
68
73
|
export default useCompStyles;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import DatePicker from "react-datepicker";
|
3
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
4
3
|
import { Grid } from "@mui/material";
|
4
|
+
import { useDataView } from "../../Providers/DataViewProvider";
|
5
5
|
import useCommonStyle from "../../../../commonStyle";
|
6
6
|
import { useEditorContext } from "../../../../hooks/useMouseMove";
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -10,7 +10,10 @@ 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%",
|
13
15
|
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
16
|
+
tableLayout: "fixed",
|
14
17
|
"& thead": {
|
15
18
|
background: appTheme?.palette?.editor?.tv_header,
|
16
19
|
height: "40px"
|
@@ -28,6 +31,8 @@ const useTableStyles = (theme, appTheme) => ({
|
|
28
31
|
},
|
29
32
|
"& td": {
|
30
33
|
height: "40px",
|
34
|
+
maxWidth: "0px !important",
|
35
|
+
minWidth: "0px !important",
|
31
36
|
"& input": {
|
32
37
|
color: appTheme?.palette?.editor?.tv_text_primary,
|
33
38
|
background: "transparent",
|
@@ -40,6 +45,11 @@ const useTableStyles = (theme, appTheme) => ({
|
|
40
45
|
"& th, tr, td": {
|
41
46
|
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`
|
42
47
|
},
|
48
|
+
"& th, & td": {
|
49
|
+
overflowX: "clip",
|
50
|
+
textOverflow: "ellipsis",
|
51
|
+
whiteSpace: "nowrap"
|
52
|
+
},
|
43
53
|
"& .tv-act-btn": {
|
44
54
|
color: appTheme?.palette?.editor?.tv_text,
|
45
55
|
textTransform: "none",
|
@@ -86,13 +96,18 @@ const useTableStyles = (theme, appTheme) => ({
|
|
86
96
|
paddingTop: "3px",
|
87
97
|
paddingBottom: "3px",
|
88
98
|
paddingLeft: "3px",
|
89
|
-
maxWidth: "250px",
|
99
|
+
// maxWidth: "250px",
|
90
100
|
overflow: "hidden",
|
91
101
|
position: "relative",
|
92
102
|
"& .tv-ms-tag-wrpr": {
|
93
103
|
display: "flex",
|
94
104
|
flexWrap: "nowrap",
|
95
|
-
overflow: "auto"
|
105
|
+
overflow: "auto",
|
106
|
+
minWidth: "58px",
|
107
|
+
"& .MuiChip-deleteIcon": {
|
108
|
+
minWidth: "22px",
|
109
|
+
minHeight: "22px"
|
110
|
+
}
|
96
111
|
},
|
97
112
|
"&.Mui-disabled": {
|
98
113
|
"& input": {
|
@@ -60,6 +60,7 @@ const SortIcon = props => {
|
|
60
60
|
};
|
61
61
|
const THead = props => {
|
62
62
|
const thRef = useRef(null);
|
63
|
+
const [headerTextWidth, setHeaderTextWidth] = useState(200);
|
63
64
|
const {
|
64
65
|
iconType,
|
65
66
|
isSort,
|
@@ -77,6 +78,13 @@ const THead = props => {
|
|
77
78
|
minWidth: 30
|
78
79
|
}
|
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]);
|
80
88
|
useEffect(() => {
|
81
89
|
if (isDone) {
|
82
90
|
handleResize({
|
@@ -87,9 +95,9 @@ const THead = props => {
|
|
87
95
|
}, [isDone]);
|
88
96
|
return /*#__PURE__*/_jsxs("th", {
|
89
97
|
style: {
|
90
|
-
minWidth:
|
91
|
-
maxWidth:
|
92
|
-
width:
|
98
|
+
minWidth: finalWidth,
|
99
|
+
maxWidth: finalWidth,
|
100
|
+
width: finalWidth
|
93
101
|
},
|
94
102
|
ref: thRef,
|
95
103
|
children: [/*#__PURE__*/_jsx(Box, {
|
@@ -107,7 +115,10 @@ const THead = props => {
|
|
107
115
|
}),
|
108
116
|
fullWidth: true,
|
109
117
|
onClick: onEditProperty(m),
|
110
|
-
children:
|
118
|
+
children: /*#__PURE__*/_jsx("span", {
|
119
|
+
className: "dht-text",
|
120
|
+
children: m.label
|
121
|
+
})
|
111
122
|
})
|
112
123
|
}), /*#__PURE__*/_jsx(Resizer, {
|
113
124
|
classes: classes,
|
@@ -277,7 +288,9 @@ const TableView = props => {
|
|
277
288
|
children: [/*#__PURE__*/_jsx("th", {
|
278
289
|
className: "tv-act-btn ico",
|
279
290
|
style: {
|
280
|
-
|
291
|
+
maxWidth: "80px",
|
292
|
+
minWidth: "80px",
|
293
|
+
width: "auto"
|
281
294
|
},
|
282
295
|
children: /*#__PURE__*/_jsx(Button, {
|
283
296
|
onClick: onAddClick,
|
@@ -287,7 +300,9 @@ const TableView = props => {
|
|
287
300
|
}), /*#__PURE__*/_jsx("th", {
|
288
301
|
className: "tv-act-btn ico",
|
289
302
|
style: {
|
290
|
-
|
303
|
+
maxWidth: "80px",
|
304
|
+
minWidth: "80px",
|
305
|
+
width: "auto"
|
291
306
|
},
|
292
307
|
children: /*#__PURE__*/_jsx(Button, {
|
293
308
|
onClick: onSettings,
|
@@ -58,17 +58,17 @@ const ViewData = props => {
|
|
58
58
|
}
|
59
59
|
},
|
60
60
|
children: [rows?.map((row, i) => {
|
61
|
-
return /*#__PURE__*/
|
61
|
+
return /*#__PURE__*/_jsxs(Box, {
|
62
62
|
component: "tr",
|
63
63
|
className: "tv-act-row",
|
64
|
-
children: /*#__PURE__*/_jsx(RenderRow, {
|
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
|
+
}), /*#__PURE__*/_jsx("td", {}), /*#__PURE__*/_jsx("td", {})]
|
72
72
|
}, i);
|
73
73
|
}), /*#__PURE__*/_jsx("tr", {
|
74
74
|
style: {
|