@flozy/editor 10.7.2 → 10.7.3

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.
@@ -6,6 +6,7 @@ import { useEditorContext } from "../../../../../hooks/useMouseMove";
6
6
  import useCompStyles from "./styles";
7
7
  import { CloseIcon } from "../../../../../common/iconslist";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const AvatarIcon = props => {
10
11
  const {
11
12
  option,
@@ -41,7 +42,8 @@ export default function Select(props) {
41
42
  placeholder = "",
42
43
  disabled = false,
43
44
  optionAvatar = false,
44
- className = ""
45
+ className = "",
46
+ wrapColumn = false
45
47
  } = props;
46
48
  const value = Array.isArray(pValue) ? pValue : [];
47
49
  const options = selectOptions?.length ? selectOptions.filter(s => s.value) : [];
@@ -57,7 +59,8 @@ export default function Select(props) {
57
59
  newValue?.forEach(m => {
58
60
  if (multiple) {
59
61
  fv.push({
60
- value: m.inputValue || m.value
62
+ value: m.inputValue || m.value,
63
+ ...m
61
64
  });
62
65
  } else {
63
66
  fv[0] = {
@@ -100,51 +103,51 @@ export default function Select(props) {
100
103
  }
101
104
  // Regular option
102
105
  return option.value || "";
103
- },
104
- renderTags: (value, getTagProps) => {
105
- return /*#__PURE__*/_jsx(Box, {
106
- className: `tv-ms-tag-wrpr ${className}`,
107
- sx: {
108
- "& svg": {
109
- marginRight: "5px",
110
- "& path": {
111
- stroke: "#000"
112
- }
113
- }
114
- },
115
- children: value?.map((option, index) => {
116
- const {
117
- key,
118
- ...tagProps
119
- } = getTagProps({
120
- index
121
- }) || {};
122
- return option?.value ? /*#__PURE__*/_jsx(Chip, {
123
- variant: "outlined",
124
- label: option?.label || option?.value,
125
- ...tagProps,
126
- sx: {
127
- background: option?.color || appTheme?.palette?.editor?.tv_border1,
128
- border: "none",
129
- "& .MuiChip-label": {
130
- paddingLeft: "12px !important",
131
- paddingRight: disabled ? "12px !important" : ""
132
- }
133
- },
134
- avatar: /*#__PURE__*/_jsx(AvatarIcon, {
135
- option: option,
136
- avatar: optionAvatar
137
- }),
138
- deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {
139
- style: {
140
- cursor: "pointer",
141
- display: disabled ? "none" : ""
142
- }
143
- })
144
- }, key) : null;
145
- })
146
- });
147
- },
106
+ }
107
+ // renderTags={(value, getTagProps) => {
108
+ // return (
109
+ // <Box
110
+ // className={`tv-ms-tag-wrpr ${className}`}
111
+ // sx={{
112
+ // "& svg": { marginRight: "5px", "& path": { stroke: "#000" } },
113
+ // flexWrap: wrapColumn ? "wrap" : "nowrap",
114
+ // overflowX: wrapColumn ? "hidden" : "auto",
115
+ // }}
116
+ // >
117
+ // {value?.map((option, index) => {
118
+ // const { key, ...tagProps } = getTagProps({ index }) || {};
119
+ // return option?.value ? (
120
+ // <Chip
121
+ // variant="outlined"
122
+ // label={option?.label || option?.value}
123
+ // key={key}
124
+ // {...tagProps}
125
+ // sx={{
126
+ // background:
127
+ // option?.color || appTheme?.palette?.editor?.tv_border1,
128
+ // border: "none",
129
+ // "& .MuiChip-label": {
130
+ // paddingLeft: "12px !important",
131
+ // paddingRight: disabled ? "12px !important" : "",
132
+ // },
133
+ // }}
134
+ // avatar={<AvatarIcon option={option} avatar={optionAvatar} />}
135
+ // deleteIcon={
136
+ // <CloseIcon
137
+ // style={{
138
+ // cursor: "pointer",
139
+ // display: disabled ? "none" : "",
140
+ // }}
141
+ // />
142
+ // }
143
+ // />
144
+ // ) : null;
145
+ // })}
146
+ // </Box>
147
+ // );
148
+ // }}
149
+ ,
150
+ renderTags: () => null,
148
151
  renderOption: (props, option) => {
149
152
  const {
150
153
  key,
@@ -168,13 +171,76 @@ export default function Select(props) {
168
171
  },
169
172
  freeSolo: true,
170
173
  size: "small",
171
- fullWidth: true,
174
+ fullWidth: true
175
+ // renderInput={(params) => {
176
+ // return (
177
+ // <TextField
178
+ // fullWidth
179
+ // size="small"
180
+ // {...params}
181
+ // placeholder={placeholder}
182
+ // />
183
+ // );
184
+ // }}
185
+ ,
172
186
  renderInput: params => {
173
- return /*#__PURE__*/_jsx(TextField, {
174
- fullWidth: true,
175
- size: "small",
176
- ...params,
177
- placeholder: placeholder
187
+ const {
188
+ InputProps,
189
+ ...rest
190
+ } = params;
191
+ return /*#__PURE__*/_jsxs(Box, {
192
+ className: `tv-ms-tag-wrpr ${className}`,
193
+ sx: {
194
+ display: "flex",
195
+ flexWrap: wrapColumn ? "wrap" : "nowrap",
196
+ alignItems: "center",
197
+ minHeight: "40px",
198
+ padding: "2px",
199
+ gap: "4px",
200
+ "& .MuiChip-root": {
201
+ margin: "2px"
202
+ }
203
+ },
204
+ children: [value?.map((option, index) => /*#__PURE__*/_jsx(Chip, {
205
+ variant: "outlined",
206
+ label: option?.label || option?.value,
207
+ sx: {
208
+ background: option?.color || appTheme?.palette?.editor?.tv_border1,
209
+ border: "none",
210
+ "& .MuiChip-label": {
211
+ paddingLeft: "12px !important",
212
+ paddingRight: disabled ? "12px !important" : ""
213
+ }
214
+ },
215
+ avatar: /*#__PURE__*/_jsx(AvatarIcon, {
216
+ option: option,
217
+ avatar: optionAvatar
218
+ }),
219
+ deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {
220
+ style: {
221
+ cursor: "pointer",
222
+ display: disabled ? "none" : ""
223
+ }
224
+ }),
225
+ ...InputProps?.startAdornment?.[index]?.props
226
+ }, index)), /*#__PURE__*/_jsx(TextField, {
227
+ ...rest,
228
+ InputProps: {
229
+ ...InputProps,
230
+ disableUnderline: true,
231
+ sx: {
232
+ minWidth: 120,
233
+ flexGrow: 1,
234
+ input: {
235
+ padding: "4px 8px"
236
+ }
237
+ }
238
+ },
239
+ size: "small",
240
+ placeholder: placeholder,
241
+ disabled: disabled,
242
+ variant: "standard"
243
+ })]
178
244
  });
179
245
  },
180
246
  slotProps: {
@@ -7,8 +7,12 @@ const PersonType = props => {
7
7
  rowIndex,
8
8
  property,
9
9
  value,
10
- readOnly
10
+ readOnly,
11
+ settings
11
12
  } = props;
13
+ const {
14
+ wrapColumn
15
+ } = settings;
12
16
  const {
13
17
  onChange,
14
18
  users
@@ -22,9 +26,10 @@ const PersonType = props => {
22
26
  value: value || [],
23
27
  onChange: handleChange,
24
28
  options: users || [],
25
- multiple: false,
29
+ multiple: true,
26
30
  disabled: readOnly,
27
- optionAvatar: true
31
+ optionAvatar: true,
32
+ wrapColumn: wrapColumn
28
33
  });
29
34
  };
30
35
  export default PersonType;
@@ -7,7 +7,7 @@ import Icon from "../../../../common/Icon";
7
7
  import CloseIcon from "@mui/icons-material/Close";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const NEED_WRAPS = ["text", "multi-select"];
10
+ const NEED_WRAPS = ["text", "multi-select", "person"];
11
11
  const EditProperty = props => {
12
12
  const {
13
13
  classes,
@@ -101,7 +101,7 @@ const useTableStyles = (theme, appTheme) => ({
101
101
  position: "relative",
102
102
  "& .tv-ms-tag-wrpr": {
103
103
  display: "flex",
104
- flexWrap: "nowrap",
104
+ // flexWrap: "nowrap",
105
105
  overflow: "auto",
106
106
  minWidth: "58px",
107
107
  "& .MuiChip-deleteIcon": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "10.7.2",
3
+ "version": "10.7.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"