@flozy/editor 5.5.7 → 5.5.8
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 +34 -25
- package/dist/Editor/CommonEditor.js +13 -26
- package/dist/Editor/Editor.css +19 -102
- package/dist/Editor/Elements/AI/AIInput.js +1 -0
- package/dist/Editor/Elements/AI/CustomSelect.js +10 -17
- package/dist/Editor/Elements/AI/PopoverAIInput.js +53 -59
- package/dist/Editor/Elements/AI/Styles.js +6 -24
- package/dist/Editor/Elements/Accordion/Accordion.js +1 -8
- package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
- package/dist/Editor/Elements/Button/EditorButton.js +1 -6
- package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -11
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +5 -7
- package/dist/Editor/Elements/Color Picker/Styles.js +3 -8
- package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
- package/dist/Editor/Elements/Divider/Divider.js +20 -36
- package/dist/Editor/Elements/Embed/Image.js +16 -51
- package/dist/Editor/Elements/Embed/Video.js +3 -26
- package/dist/Editor/Elements/Form/Form.js +2 -38
- package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +1 -7
- package/dist/Editor/Elements/Form/FormElements/FormDate.js +1 -7
- package/dist/Editor/Elements/Form/FormElements/FormEmail.js +1 -7
- package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +1 -7
- package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +1 -7
- package/dist/Editor/Elements/Form/FormElements/FormText.js +1 -7
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +1 -6
- package/dist/Editor/Elements/Form/FormPopup.js +9 -12
- package/dist/Editor/Elements/Form/Workflow/Styles.js +0 -2
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -4
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +1 -1
- package/dist/Editor/Elements/Grid/GridButton.js +2 -2
- package/dist/Editor/Elements/Grid/GridItem.js +36 -47
- package/dist/Editor/Elements/Grid/Styles.js +0 -50
- package/dist/Editor/Elements/Link/LinkButton.js +1 -1
- package/dist/Editor/Elements/Search/SearchButton.js +0 -1
- package/dist/Editor/Elements/Signature/Signature.css +1 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +52 -17
- package/dist/Editor/Elements/SimpleText/style.js +0 -15
- package/dist/Editor/Elements/Table/Styles.js +78 -88
- package/dist/Editor/Elements/Table/Table.js +140 -263
- package/dist/Editor/Elements/Table/TableCell.js +111 -365
- package/dist/Editor/Elements/Table/TablePopup.js +3 -9
- package/dist/Editor/Elements/Table/TableRow.js +2 -10
- package/dist/Editor/Elements/TopBanner/TopBanner.js +1 -2
- package/dist/Editor/MiniEditor.js +2 -21
- package/dist/Editor/Styles/EditorStyles.js +4 -13
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +12 -7
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -26
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -5
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +8 -8
- package/dist/Editor/Toolbar/Mini/Styles.js +1 -9
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/InfinityAITool.js +3 -7
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -6
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +15 -19
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +58 -547
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +16 -28
- package/dist/Editor/Toolbar/PopupTool/index.js +5 -3
- package/dist/Editor/Toolbar/Toolbar.js +0 -6
- package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
- package/dist/Editor/assets/svg/BrainIcon.js +2 -2
- package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
- package/dist/Editor/common/ColorPickerButton.js +45 -85
- package/dist/Editor/common/DnD/Draggable.js +1 -2
- package/dist/Editor/common/FontLoader/FontLoader.js +2 -2
- package/dist/Editor/common/Icon.js +21 -54
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -2
- package/dist/Editor/common/ImageSelector/Styles.js +6 -47
- package/dist/Editor/common/ImageSelector/UploadStyles.js +6 -18
- package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
- package/dist/Editor/common/LinkSettings/index.js +1 -2
- package/dist/Editor/common/MentionsPopup/Styles.js +8 -142
- package/dist/Editor/common/MentionsPopup/index.js +1 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -107
- package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
- package/dist/Editor/common/RnD/ShadowElement.js +1 -1
- package/dist/Editor/common/RnD/VirtualElement/index.js +1 -5
- package/dist/Editor/common/RnD/index.js +3 -4
- package/dist/Editor/common/Section/index.js +3 -3
- package/dist/Editor/common/Section/styles.js +1 -5
- package/dist/Editor/common/Shorthands/elements.js +1 -13
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -35
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +2 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +1 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +0 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +11 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +6 -22
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -21
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -20
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -12
- package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
- package/dist/Editor/common/StyleBuilder/index.js +20 -101
- package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
- package/dist/Editor/common/SwipeableDrawer/style.js +4 -15
- package/dist/Editor/common/ToolbarIcon.js +1 -1
- package/dist/Editor/common/Uploader.js +37 -39
- package/dist/Editor/common/iconListV2.js +74 -598
- package/dist/Editor/common/iconslist.js +19 -25
- package/dist/Editor/commonStyle.js +15 -421
- package/dist/Editor/helper/deserialize/index.js +2 -31
- package/dist/Editor/helper/index.js +2 -15
- package/dist/Editor/helper/theme.js +1 -15
- package/dist/Editor/hooks/useBreakpoints.js +1 -1
- package/dist/Editor/plugins/withCustomDeleteBackward.js +1 -1
- package/dist/Editor/plugins/withEmbeds.js +26 -30
- package/dist/Editor/plugins/withHTML.js +12 -100
- package/dist/Editor/plugins/withLayout.js +0 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +11 -31
- package/dist/Editor/utils/brains.js +1 -1
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +1 -26
- package/dist/Editor/utils/customHooks/useResize.js +4 -7
- package/dist/Editor/utils/customHooks/useTableResize.js +2 -6
- package/dist/Editor/utils/embed.js +1 -2
- package/dist/Editor/utils/events.js +1 -0
- package/dist/Editor/utils/font.js +4 -11
- package/dist/Editor/utils/formfield.js +4 -8
- package/dist/Editor/utils/helper.js +2 -100
- package/dist/Editor/utils/insertNewLine.js +1 -19
- package/dist/Editor/utils/serializeToText.js +0 -2
- package/dist/Editor/utils/table.js +24 -228
- package/package.json +2 -2
- package/dist/Editor/Elements/DataView/DataView.js +0 -124
- package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -83
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -33
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -180
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -62
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -68
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -35
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -39
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -86
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -71
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -138
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -213
- package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -44
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -146
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -79
- package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -57
- package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -174
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -241
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -45
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -32
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
- package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -217
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -131
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -253
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -85
- package/dist/Editor/Elements/DataView/Layouts/colStyles.js +0 -10
- package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -277
- package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
- package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -88
- package/dist/Editor/Elements/DataView/styles.js +0 -169
- package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
- package/dist/Editor/Elements/Table/DragButton.js +0 -142
- package/dist/Editor/Elements/Table/DragStyles.js +0 -70
- package/dist/Editor/Elements/Table/Draggable.js +0 -25
- package/dist/Editor/Elements/Table/Droppable.js +0 -53
- package/dist/Editor/Elements/Table/TableTool.js +0 -101
- package/dist/Editor/Elements/Table/tableHelper.js +0 -71
- package/dist/Editor/assets/svg/ArrowDownIcon.js +0 -25
- package/dist/Editor/assets/svg/ArrowUpIcon.js +0 -25
- package/dist/Editor/assets/svg/CalenderIconTick.js +0 -64
- package/dist/Editor/assets/svg/ChervDown.js +0 -18
- package/dist/Editor/assets/svg/ChervUp.js +0 -18
- package/dist/Editor/assets/svg/DataTableIcon.js +0 -50
- package/dist/Editor/assets/svg/DuplicateIcon.js +0 -23
- package/dist/Editor/assets/svg/EyeIcon.js +0 -23
- package/dist/Editor/assets/svg/EyeSlash.js +0 -43
- package/dist/Editor/assets/svg/HashtagIcon.js +0 -33
- package/dist/Editor/assets/svg/PlusIcon.js +0 -23
- package/dist/Editor/assets/svg/SelectRoundedIcon.js +0 -24
- package/dist/Editor/assets/svg/SortByIcon.js +0 -33
- package/dist/Editor/assets/svg/TableIcons.js +0 -220
- package/dist/Editor/assets/svg/TickOutlined.js +0 -23
- package/dist/Editor/assets/svg/TrashCanIcon.js +0 -38
- package/dist/Editor/common/Select/index.js +0 -20
- package/dist/Editor/common/Select/styles.js +0 -17
- package/dist/Editor/helper/enforceDateFormat.js +0 -41
- package/dist/Editor/hooks/useTable.js +0 -210
- package/dist/Editor/utils/dataView.js +0 -43
@@ -1,23 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import ToolbarIcon from "../../common/ToolbarIcon";
|
3
|
-
import Icon from "../../common/Icon";
|
4
|
-
import { insertDataView } from "../../utils/dataView";
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
-
const DataViewButton = props => {
|
7
|
-
const {
|
8
|
-
editor,
|
9
|
-
icoBtnType
|
10
|
-
} = props;
|
11
|
-
const onClick = () => {
|
12
|
-
insertDataView(editor);
|
13
|
-
};
|
14
|
-
return /*#__PURE__*/_jsx(ToolbarIcon, {
|
15
|
-
title: "Dynamic Table",
|
16
|
-
onClick: onClick,
|
17
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
18
|
-
icon: "dataView"
|
19
|
-
}),
|
20
|
-
icoBtnType: icoBtnType
|
21
|
-
});
|
22
|
-
};
|
23
|
-
export default DataViewButton;
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import React, { useEffect, useRef, useState } from "react";
|
2
|
-
import { Box, Checkbox, Popper, useTheme } from "@mui/material";
|
3
|
-
import DataTypes from "./DataTypes";
|
4
|
-
import useColumnStyles from "./colStyles";
|
5
|
-
import Icon from "../../../common/Icon";
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
-
const ColumnView = props => {
|
9
|
-
const theme = useTheme();
|
10
|
-
const {
|
11
|
-
needAnchor,
|
12
|
-
rowIndex,
|
13
|
-
row,
|
14
|
-
property,
|
15
|
-
onSelect,
|
16
|
-
selected,
|
17
|
-
readOnly
|
18
|
-
} = props;
|
19
|
-
const DataType = DataTypes[property?.type] || DataTypes["text"];
|
20
|
-
const anchorRef = useRef(null);
|
21
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
22
|
-
const [popperRefresh, setPopperRefresh] = useState(new Date().getTime());
|
23
|
-
const open = Boolean(anchorEl);
|
24
|
-
const classes = useColumnStyles(theme);
|
25
|
-
const parentRef = useRef(null);
|
26
|
-
useEffect(() => {
|
27
|
-
if (!anchorRef?.current) return;
|
28
|
-
setAnchorEl(anchorRef?.current);
|
29
|
-
parentRef.current = anchorRef?.current.closest(".tv-d-wrapper");
|
30
|
-
const resizeObserver = new ResizeObserver(() => {
|
31
|
-
if (parentRef?.current) {
|
32
|
-
setPopperRefresh(new Date().getTime());
|
33
|
-
}
|
34
|
-
});
|
35
|
-
resizeObserver.observe(parentRef.current);
|
36
|
-
return () => {
|
37
|
-
resizeObserver.disconnect();
|
38
|
-
};
|
39
|
-
}, [anchorRef?.current]);
|
40
|
-
const handleSelect = id => e => {
|
41
|
-
onSelect(id, e.target.checked);
|
42
|
-
};
|
43
|
-
return /*#__PURE__*/_jsxs(Box, {
|
44
|
-
component: "td",
|
45
|
-
children: [needAnchor ? /*#__PURE__*/_jsx("span", {
|
46
|
-
ref: anchorRef,
|
47
|
-
style: {
|
48
|
-
position: "absolute",
|
49
|
-
width: "1px"
|
50
|
-
}
|
51
|
-
}) : null, /*#__PURE__*/_jsx(DataType, {
|
52
|
-
options: property?.options,
|
53
|
-
property: property?.key,
|
54
|
-
value: row[property?.key] || "",
|
55
|
-
rowIndex: rowIndex,
|
56
|
-
label: property?.label,
|
57
|
-
readOnly: readOnly
|
58
|
-
}), needAnchor && !readOnly ? /*#__PURE__*/_jsx(Popper, {
|
59
|
-
sx: classes.root,
|
60
|
-
open: open,
|
61
|
-
anchorEl: anchorEl,
|
62
|
-
placement: "left",
|
63
|
-
className: `tv-tr-pop ${selected ? "active" : ""}`,
|
64
|
-
disablePortal: true,
|
65
|
-
children: /*#__PURE__*/_jsx(Checkbox, {
|
66
|
-
onClick: handleSelect(row?.id),
|
67
|
-
size: "small",
|
68
|
-
className: "tv-ck-box",
|
69
|
-
sx: {
|
70
|
-
mr: 0
|
71
|
-
},
|
72
|
-
checked: selected,
|
73
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
74
|
-
icon: "uncheckedIcon"
|
75
|
-
}),
|
76
|
-
checkedIcon: /*#__PURE__*/_jsx(Icon, {
|
77
|
-
icon: "checkedIcon"
|
78
|
-
})
|
79
|
-
})
|
80
|
-
}, popperRefresh) : null]
|
81
|
-
});
|
82
|
-
};
|
83
|
-
export default ColumnView;
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Checkbox from "@mui/material/Checkbox";
|
4
|
-
import Icon from "../../../../common/Icon";
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
-
const CheckType = props => {
|
7
|
-
const {
|
8
|
-
rowIndex,
|
9
|
-
property,
|
10
|
-
value,
|
11
|
-
readOnly
|
12
|
-
} = props;
|
13
|
-
const {
|
14
|
-
onChange
|
15
|
-
} = useDataView();
|
16
|
-
const handleChange = e => {
|
17
|
-
onChange(rowIndex, {
|
18
|
-
[property]: e?.target?.checked
|
19
|
-
});
|
20
|
-
};
|
21
|
-
return /*#__PURE__*/_jsx(Checkbox, {
|
22
|
-
checked: value || false,
|
23
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
24
|
-
icon: "checkListButton"
|
25
|
-
}),
|
26
|
-
checkedIcon: /*#__PURE__*/_jsx(Icon, {
|
27
|
-
icon: "checkListButtonActive"
|
28
|
-
}),
|
29
|
-
onChange: handleChange,
|
30
|
-
disabled: readOnly
|
31
|
-
}, rowIndex);
|
32
|
-
};
|
33
|
-
export default CheckType;
|
@@ -1,180 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import TextField from "@mui/material/TextField";
|
3
|
-
import Autocomplete from "@mui/material/Autocomplete";
|
4
|
-
import { Avatar, Box, Chip, useTheme } from "@mui/material";
|
5
|
-
import { useEditorContext } from "../../../../../hooks/useMouseMove";
|
6
|
-
import useCompStyles from "./styles";
|
7
|
-
import { CloseIcon } from "../../../../../common/iconslist";
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
-
const AvatarIcon = props => {
|
10
|
-
const {
|
11
|
-
option,
|
12
|
-
avatar
|
13
|
-
} = props;
|
14
|
-
const nameIndex = option.label || option.value;
|
15
|
-
return avatar && nameIndex ? /*#__PURE__*/_jsx(Avatar, {
|
16
|
-
alt: option.label || option.value,
|
17
|
-
src: option.avatar || null,
|
18
|
-
children: nameIndex[0] || ""
|
19
|
-
}) : null;
|
20
|
-
};
|
21
|
-
const filter = (opt, params, selectedOpt) => {
|
22
|
-
const selectedVals = selectedOpt?.map(m => m?.value);
|
23
|
-
const fv = opt?.filter(f => !selectedVals.includes(f.value));
|
24
|
-
if (params?.inputValue) {
|
25
|
-
return fv.filter(f => f?.value?.toLowerCase().indexOf(params?.inputValue?.toLowerCase()) >= 0);
|
26
|
-
}
|
27
|
-
return fv;
|
28
|
-
};
|
29
|
-
export default function Select(props) {
|
30
|
-
const theme = useTheme();
|
31
|
-
const {
|
32
|
-
theme: appTheme
|
33
|
-
} = useEditorContext();
|
34
|
-
const classes = useCompStyles(theme, appTheme);
|
35
|
-
const {
|
36
|
-
value: pValue,
|
37
|
-
onChange,
|
38
|
-
options: selectOptions,
|
39
|
-
multiple = false,
|
40
|
-
limitTags = 2,
|
41
|
-
placeholder = "",
|
42
|
-
disabled = false,
|
43
|
-
optionAvatar = false
|
44
|
-
} = props;
|
45
|
-
const value = Array.isArray(pValue) ? pValue : [];
|
46
|
-
const options = selectOptions?.length ? selectOptions.filter(s => s.value) : [];
|
47
|
-
return /*#__PURE__*/_jsx(Autocomplete, {
|
48
|
-
disabled: disabled,
|
49
|
-
className: "tv-ac-field",
|
50
|
-
multiple: true,
|
51
|
-
limitTags: limitTags,
|
52
|
-
placeholder: placeholder,
|
53
|
-
value: value || "",
|
54
|
-
onChange: (event, newValue) => {
|
55
|
-
const fv = [];
|
56
|
-
newValue?.forEach(m => {
|
57
|
-
if (multiple) {
|
58
|
-
fv.push({
|
59
|
-
value: m.inputValue || m.value
|
60
|
-
});
|
61
|
-
} else {
|
62
|
-
fv[0] = {
|
63
|
-
value: m.inputValue || m.value
|
64
|
-
};
|
65
|
-
}
|
66
|
-
});
|
67
|
-
onChange(fv);
|
68
|
-
},
|
69
|
-
filterOptions: (options, params) => {
|
70
|
-
const filtered = filter(options, params, value);
|
71
|
-
|
72
|
-
// const { inputValue } = params;
|
73
|
-
// Suggest the creation of a new value
|
74
|
-
// const isExisting = options.some(
|
75
|
-
// (option) => inputValue?.toLowerCase() === option.value?.toLowerCase()
|
76
|
-
// );
|
77
|
-
// no need of new val now
|
78
|
-
// if (inputValue !== "" && !isExisting) {
|
79
|
-
// filtered.push({
|
80
|
-
// inputValue,
|
81
|
-
// value: `Add "${inputValue}"`,
|
82
|
-
// });
|
83
|
-
// }
|
84
|
-
|
85
|
-
return filtered;
|
86
|
-
},
|
87
|
-
selectOnFocus: true,
|
88
|
-
clearOnBlur: true,
|
89
|
-
handleHomeEndKeys: true,
|
90
|
-
options: options || [],
|
91
|
-
getOptionLabel: option => {
|
92
|
-
// Value selected with enter, right from the input
|
93
|
-
if (typeof option === "string") {
|
94
|
-
return option;
|
95
|
-
}
|
96
|
-
// Add "xxx" option created dynamically
|
97
|
-
if (option.inputValue) {
|
98
|
-
return option.inputValue;
|
99
|
-
}
|
100
|
-
// Regular option
|
101
|
-
return option.value || "";
|
102
|
-
},
|
103
|
-
renderTags: (value, getTagProps) => {
|
104
|
-
return /*#__PURE__*/_jsx(Box, {
|
105
|
-
className: "tv-ms-tag-wrpr",
|
106
|
-
sx: {
|
107
|
-
'& svg': {
|
108
|
-
marginRight: '5px',
|
109
|
-
'& path': {
|
110
|
-
stroke: "#000"
|
111
|
-
}
|
112
|
-
}
|
113
|
-
},
|
114
|
-
children: value?.map((option, index) => {
|
115
|
-
const {
|
116
|
-
key,
|
117
|
-
...tagProps
|
118
|
-
} = getTagProps({
|
119
|
-
index
|
120
|
-
}) || {};
|
121
|
-
return option?.value ? /*#__PURE__*/_jsx(Chip, {
|
122
|
-
variant: "outlined",
|
123
|
-
label: option?.label || option?.value,
|
124
|
-
...tagProps,
|
125
|
-
sx: {
|
126
|
-
background: option?.color || appTheme?.palette?.editor?.tv_border1,
|
127
|
-
border: "none",
|
128
|
-
'& .MuiChip-label': {
|
129
|
-
paddingLeft: '12px !important'
|
130
|
-
}
|
131
|
-
},
|
132
|
-
avatar: /*#__PURE__*/_jsx(AvatarIcon, {
|
133
|
-
option: option,
|
134
|
-
avatar: optionAvatar
|
135
|
-
}),
|
136
|
-
deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {})
|
137
|
-
}, key) : null;
|
138
|
-
})
|
139
|
-
});
|
140
|
-
},
|
141
|
-
renderOption: (props, option) => {
|
142
|
-
const {
|
143
|
-
key,
|
144
|
-
...optionProps
|
145
|
-
} = props;
|
146
|
-
return /*#__PURE__*/_jsx("li", {
|
147
|
-
...optionProps,
|
148
|
-
children: /*#__PURE__*/_jsx(Chip, {
|
149
|
-
label: option.label || option.value || "",
|
150
|
-
sx: {
|
151
|
-
background: option.color || appTheme?.palette?.editor?.tv_border1,
|
152
|
-
'& .MuiChip-label': {
|
153
|
-
paddingLeft: '12px !important'
|
154
|
-
}
|
155
|
-
},
|
156
|
-
avatar: /*#__PURE__*/_jsx(AvatarIcon, {
|
157
|
-
option: option,
|
158
|
-
avatar: optionAvatar
|
159
|
-
}),
|
160
|
-
deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {})
|
161
|
-
})
|
162
|
-
}, key);
|
163
|
-
},
|
164
|
-
freeSolo: true,
|
165
|
-
size: "small",
|
166
|
-
fullWidth: true,
|
167
|
-
renderInput: params => {
|
168
|
-
return /*#__PURE__*/_jsx(TextField, {
|
169
|
-
size: "small",
|
170
|
-
...params,
|
171
|
-
placeholder: placeholder
|
172
|
-
});
|
173
|
-
},
|
174
|
-
slotProps: {
|
175
|
-
paper: {
|
176
|
-
sx: classes.autocomplete
|
177
|
-
}
|
178
|
-
}
|
179
|
-
});
|
180
|
-
}
|
@@ -1,62 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { MenuItem, Select, useTheme } from "@mui/material";
|
3
|
-
import { useEditorContext } from "../../../../../hooks/useMouseMove";
|
4
|
-
import useCompStyles from "./styles";
|
5
|
-
import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
const SimpleSelect = props => {
|
8
|
-
const theme = useTheme();
|
9
|
-
const {
|
10
|
-
theme: appTheme
|
11
|
-
} = useEditorContext();
|
12
|
-
const classes = useCompStyles(theme, appTheme);
|
13
|
-
const {
|
14
|
-
value,
|
15
|
-
options,
|
16
|
-
handleChange,
|
17
|
-
disabled = false
|
18
|
-
} = props;
|
19
|
-
return /*#__PURE__*/_jsx(Select, {
|
20
|
-
disabled: disabled,
|
21
|
-
value: value,
|
22
|
-
onChange: handleChange,
|
23
|
-
IconComponent: KeyboardArrowDownRoundedIcon,
|
24
|
-
fullWidth: true,
|
25
|
-
size: "small",
|
26
|
-
sx: {
|
27
|
-
color: appTheme?.palette?.editor?.tv_text,
|
28
|
-
fontSize: '14px !important',
|
29
|
-
marginTop: '4px !important',
|
30
|
-
padding: '3px 0px !important',
|
31
|
-
background: 'transparent !important',
|
32
|
-
'& .MuiOutlinedInput-root': {
|
33
|
-
height: '34px !important',
|
34
|
-
background: 'transparent !important'
|
35
|
-
},
|
36
|
-
'& .MuiOutlinedInput-notchedOutline': {
|
37
|
-
border: `1px solid ${appTheme?.palette?.editor?.inputFieldBorder} !important`,
|
38
|
-
boxShadow: '0px 4px 18px 0px #0000000D !important',
|
39
|
-
background: 'transparent !important'
|
40
|
-
},
|
41
|
-
"&:hover .MuiOutlinedInput-notchedOutline": {
|
42
|
-
border: `1px solid ${appTheme?.palette?.editor?.inputFieldBorder} !important`,
|
43
|
-
boxShadow: '0px 4px 18px 0px #0000000D !important',
|
44
|
-
background: 'transparent !important'
|
45
|
-
}
|
46
|
-
},
|
47
|
-
MenuProps: {
|
48
|
-
PaperProps: {
|
49
|
-
sx: classes.simpleselect,
|
50
|
-
className: "tv-cf-opt-wrpr"
|
51
|
-
}
|
52
|
-
},
|
53
|
-
children: options?.map((m, i) => {
|
54
|
-
return /*#__PURE__*/_jsx(MenuItem, {
|
55
|
-
value: m.key,
|
56
|
-
className: "tv-cf-opt-wrpr",
|
57
|
-
children: m.label
|
58
|
-
}, i);
|
59
|
-
})
|
60
|
-
});
|
61
|
-
};
|
62
|
-
export default SimpleSelect;
|
@@ -1,68 +0,0 @@
|
|
1
|
-
const useCompStyles = (theme, appTheme) => ({
|
2
|
-
simpleselect: {
|
3
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
4
|
-
background: appTheme?.palette?.editor?.tv_pop_bg,
|
5
|
-
color: appTheme?.palette?.editor?.tv_text,
|
6
|
-
fontSize: '14px',
|
7
|
-
borderRadius: "8px",
|
8
|
-
[theme?.breakpoints?.between("xs", "md")]: {},
|
9
|
-
"& ul": {
|
10
|
-
padding: "4px",
|
11
|
-
"& li": {
|
12
|
-
padding: "4px 6px",
|
13
|
-
borderRadius: "8px",
|
14
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
15
|
-
fontSize: "14px",
|
16
|
-
marginTop: "4px",
|
17
|
-
"&.Mui-selected": {
|
18
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
19
|
-
color: appTheme?.palette?.editor?.tv_hover_text,
|
20
|
-
"&:hover": {
|
21
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
22
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
23
|
-
}
|
24
|
-
},
|
25
|
-
"&:hover": {
|
26
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
27
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
28
|
-
}
|
29
|
-
}
|
30
|
-
}
|
31
|
-
},
|
32
|
-
autocomplete: {
|
33
|
-
border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
|
34
|
-
background: appTheme?.palette?.editor?.tv_pop_bg,
|
35
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
36
|
-
borderRadius: "8px",
|
37
|
-
"& ul": {
|
38
|
-
padding: "4px",
|
39
|
-
"& .MuiAutocomplete-option": {
|
40
|
-
padding: "4px 6px",
|
41
|
-
borderRadius: "8px",
|
42
|
-
color: appTheme?.palette?.editor?.tv_text_primary,
|
43
|
-
fontSize: "14px",
|
44
|
-
"& .MuiAvatar-root": {
|
45
|
-
width: "20px",
|
46
|
-
height: "20px",
|
47
|
-
marginLeft: "8px",
|
48
|
-
fontSize: "16px",
|
49
|
-
padding: "2px",
|
50
|
-
textTransform: "capitalize"
|
51
|
-
},
|
52
|
-
"&.Mui-selected": {
|
53
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
54
|
-
color: appTheme?.palette?.editor?.tv_hover_text,
|
55
|
-
"&:hover": {
|
56
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
57
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
58
|
-
}
|
59
|
-
},
|
60
|
-
"&:hover": {
|
61
|
-
background: appTheme?.palette?.editor?.tv_hover_bg,
|
62
|
-
color: appTheme?.palette?.editor?.tv_hover_text
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
});
|
68
|
-
export default useCompStyles;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import DatePicker from "react-datepicker";
|
3
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
function isValidDate(dateString) {
|
6
|
-
const date = new Date(dateString);
|
7
|
-
return !isNaN(date.getTime());
|
8
|
-
}
|
9
|
-
const DateType = props => {
|
10
|
-
const {
|
11
|
-
rowIndex,
|
12
|
-
property,
|
13
|
-
value,
|
14
|
-
readOnly
|
15
|
-
} = props;
|
16
|
-
const {
|
17
|
-
onChange
|
18
|
-
} = useDataView();
|
19
|
-
const handleChange = date => {
|
20
|
-
onChange(rowIndex, {
|
21
|
-
[property]: date
|
22
|
-
});
|
23
|
-
};
|
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"
|
33
|
-
});
|
34
|
-
};
|
35
|
-
export default DateType;
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Select from "./Components/Select";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const MultiSelectType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value: pValue,
|
10
|
-
options,
|
11
|
-
label = "",
|
12
|
-
readOnly
|
13
|
-
} = props;
|
14
|
-
const {
|
15
|
-
onChange
|
16
|
-
} = useDataView();
|
17
|
-
const value = Array.isArray(pValue) ? pValue : [];
|
18
|
-
const coloredValues = [...(value || [])]?.map(m => {
|
19
|
-
return {
|
20
|
-
...m,
|
21
|
-
color: options?.find(f => f.value === m.value)?.color || "#FFF"
|
22
|
-
};
|
23
|
-
});
|
24
|
-
const handleChange = data => {
|
25
|
-
onChange(rowIndex, {
|
26
|
-
[property]: data?.filter(f => f?.value)
|
27
|
-
});
|
28
|
-
};
|
29
|
-
return /*#__PURE__*/_jsx(Select, {
|
30
|
-
value: coloredValues,
|
31
|
-
onChange: handleChange,
|
32
|
-
options: options,
|
33
|
-
multiple: true,
|
34
|
-
limitTags: 2,
|
35
|
-
placeholder: label,
|
36
|
-
disabled: readOnly
|
37
|
-
});
|
38
|
-
};
|
39
|
-
export default MultiSelectType;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { TextField } from "@mui/material";
|
3
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const NumberType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
readOnly
|
11
|
-
} = props;
|
12
|
-
const {
|
13
|
-
onChange
|
14
|
-
} = useDataView();
|
15
|
-
const handleChange = e => {
|
16
|
-
onChange(rowIndex, {
|
17
|
-
[property]: e?.target?.value
|
18
|
-
});
|
19
|
-
};
|
20
|
-
return /*#__PURE__*/_jsx(TextField, {
|
21
|
-
type: "number",
|
22
|
-
fullWidth: true,
|
23
|
-
className: "fe-tv-type_text",
|
24
|
-
value: value,
|
25
|
-
size: "small",
|
26
|
-
onChange: handleChange,
|
27
|
-
disabled: readOnly
|
28
|
-
});
|
29
|
-
};
|
30
|
-
export default NumberType;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Select from "./Components/Select";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const PersonType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
readOnly
|
11
|
-
} = props;
|
12
|
-
const {
|
13
|
-
onChange,
|
14
|
-
users
|
15
|
-
} = useDataView();
|
16
|
-
const handleChange = data => {
|
17
|
-
onChange(rowIndex, {
|
18
|
-
[property]: data?.filter(f => f?.value)
|
19
|
-
});
|
20
|
-
};
|
21
|
-
return /*#__PURE__*/_jsx(Select, {
|
22
|
-
value: value || [],
|
23
|
-
onChange: handleChange,
|
24
|
-
options: users || [],
|
25
|
-
multiple: false,
|
26
|
-
disabled: readOnly,
|
27
|
-
optionAvatar: true
|
28
|
-
});
|
29
|
-
};
|
30
|
-
export default PersonType;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
3
|
-
import Select from "./Components/Select";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const SelectType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
options,
|
11
|
-
readOnly
|
12
|
-
} = props;
|
13
|
-
const {
|
14
|
-
onChange
|
15
|
-
} = useDataView();
|
16
|
-
const coloredValues = [...(value || [])]?.map(m => {
|
17
|
-
return {
|
18
|
-
...m,
|
19
|
-
color: options?.find(f => f.value === m.value)?.color
|
20
|
-
};
|
21
|
-
});
|
22
|
-
const handleChange = data => {
|
23
|
-
onChange(rowIndex, {
|
24
|
-
[property]: data?.filter(f => f?.value)
|
25
|
-
});
|
26
|
-
};
|
27
|
-
return /*#__PURE__*/_jsx(Select, {
|
28
|
-
value: coloredValues,
|
29
|
-
onChange: handleChange,
|
30
|
-
options: options,
|
31
|
-
multiple: false,
|
32
|
-
disabled: readOnly
|
33
|
-
});
|
34
|
-
};
|
35
|
-
export default SelectType;
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { TextField } from "@mui/material";
|
3
|
-
import { useDataView } from "../../Providers/DataViewProvider";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const TextType = props => {
|
6
|
-
const {
|
7
|
-
rowIndex,
|
8
|
-
property,
|
9
|
-
value,
|
10
|
-
readOnly
|
11
|
-
} = props;
|
12
|
-
const {
|
13
|
-
onChange
|
14
|
-
} = useDataView();
|
15
|
-
const handleChange = e => {
|
16
|
-
onChange(rowIndex, {
|
17
|
-
[property]: e?.target?.value
|
18
|
-
});
|
19
|
-
};
|
20
|
-
const formatValue = () => {
|
21
|
-
if (typeof value === "string") {
|
22
|
-
return value;
|
23
|
-
} else if (value[0]) {
|
24
|
-
return value?.map(m => m.value).join(", ");
|
25
|
-
}
|
26
|
-
};
|
27
|
-
return /*#__PURE__*/_jsx(TextField, {
|
28
|
-
fullWidth: true,
|
29
|
-
className: "fe-tv-type_text",
|
30
|
-
value: formatValue(value),
|
31
|
-
size: "small",
|
32
|
-
onChange: handleChange,
|
33
|
-
disabled: readOnly
|
34
|
-
});
|
35
|
-
};
|
36
|
-
export default TextType;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import TextType from "./TextType";
|
2
|
-
import DateType from "./DateType";
|
3
|
-
import SelectType from "./SelectType";
|
4
|
-
import MultiSelectType from "./MultiSelectType";
|
5
|
-
import NumberType from "./NumberType";
|
6
|
-
import CheckType from "./CheckType";
|
7
|
-
import PersonType from "./PersonType";
|
8
|
-
const DataTypes = {
|
9
|
-
text: TextType,
|
10
|
-
date: DateType,
|
11
|
-
select: SelectType,
|
12
|
-
"multi-select": MultiSelectType,
|
13
|
-
number: NumberType,
|
14
|
-
check: CheckType,
|
15
|
-
person: PersonType
|
16
|
-
};
|
17
|
-
export default DataTypes;
|