@flozy/editor 8.0.4 → 8.0.5

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.
@@ -16,7 +16,10 @@ const ColumnView = props => {
16
16
  selected,
17
17
  readOnly
18
18
  } = props;
19
- const DataType = DataTypes[property?.type] || DataTypes["text"];
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: '14px',
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";
@@ -11,6 +11,7 @@ const useTableStyles = (theme, appTheme) => ({
11
11
  borderRadius: "7px 7px 0px 0px",
12
12
  overflow: "hidden",
13
13
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
14
+ tableLayout: "fixed",
14
15
  "& thead": {
15
16
  background: appTheme?.palette?.editor?.tv_header,
16
17
  height: "40px"
@@ -40,6 +41,11 @@ const useTableStyles = (theme, appTheme) => ({
40
41
  "& th, tr, td": {
41
42
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`
42
43
  },
44
+ "& th, & td": {
45
+ overflowX: "clip",
46
+ textOverflow: "ellipsis",
47
+ whiteSpace: "nowrap"
48
+ },
43
49
  "& .tv-act-btn": {
44
50
  color: appTheme?.palette?.editor?.tv_text,
45
51
  textTransform: "none",
@@ -86,13 +92,18 @@ const useTableStyles = (theme, appTheme) => ({
86
92
  paddingTop: "3px",
87
93
  paddingBottom: "3px",
88
94
  paddingLeft: "3px",
89
- maxWidth: "250px",
95
+ // maxWidth: "250px",
90
96
  overflow: "hidden",
91
97
  position: "relative",
92
98
  "& .tv-ms-tag-wrpr": {
93
99
  display: "flex",
94
100
  flexWrap: "nowrap",
95
- overflow: "auto"
101
+ overflow: "auto",
102
+ minWidth: "58px",
103
+ "& .MuiChip-deleteIcon": {
104
+ minWidth: "22px",
105
+ minHeight: "22px"
106
+ }
96
107
  },
97
108
  "&.Mui-disabled": {
98
109
  "& 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: size?.width || 200,
91
- maxWidth: size?.width || 200,
92
- width: size?.width || 200
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: m.label
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "8.0.4",
3
+ "version": "8.0.5",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"