@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,101 +0,0 @@
1
- import NotesIcon from "@mui/icons-material/Notes";
2
- import TagIcon from "@mui/icons-material/Tag";
3
- import ArrowDropDownCircleIcon from "@mui/icons-material/ArrowDropDownCircle";
4
- import ChecklistIcon from "@mui/icons-material/Checklist";
5
- import InsertInvitationIcon from "@mui/icons-material/InsertInvitation";
6
- import PersonIcon from "@mui/icons-material/Person";
7
- import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
8
- import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
9
- import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";
10
- // import FilterListIcon from "@mui/icons-material/FilterList";
11
-
12
- export const TYPE_LABELS = {
13
- text: "Text",
14
- number: "Number",
15
- select: "Select",
16
- "multi-select": "Multi Select",
17
- date: "Date",
18
- person: "Person",
19
- check: "Checkbox"
20
- };
21
- export const PROPERTY_DEFAULTS = {
22
- text: {
23
- label: TYPE_LABELS?.text,
24
- visible: true
25
- },
26
- number: {
27
- label: TYPE_LABELS.number,
28
- visible: true
29
- },
30
- select: {
31
- label: TYPE_LABELS.select,
32
- visible: true
33
- },
34
- "multi-select": {
35
- label: TYPE_LABELS["multi-select"],
36
- visible: true
37
- },
38
- date: {
39
- label: TYPE_LABELS.date,
40
- visible: true
41
- },
42
- check: {
43
- label: TYPE_LABELS.check,
44
- visible: true
45
- },
46
- person: {
47
- label: TYPE_LABELS.person,
48
- visible: true
49
- }
50
- };
51
- export const PROPERTY_TYPES = [{
52
- type: "text",
53
- label: TYPE_LABELS.text,
54
- Icon: NotesIcon
55
- }, {
56
- type: "number",
57
- label: TYPE_LABELS.number,
58
- Icon: TagIcon
59
- }, {
60
- type: "select",
61
- label: TYPE_LABELS.select,
62
- Icon: ArrowDropDownCircleIcon
63
- }, {
64
- type: "multi-select",
65
- label: TYPE_LABELS["multi-select"],
66
- Icon: ChecklistIcon
67
- }, {
68
- type: "date",
69
- label: TYPE_LABELS.date,
70
- Icon: InsertInvitationIcon
71
- }, {
72
- type: "check",
73
- label: TYPE_LABELS.check,
74
- Icon: CheckCircleOutlineIcon
75
- }, {
76
- type: "person",
77
- label: TYPE_LABELS.person,
78
- Icon: PersonIcon
79
- }];
80
- export const FILTER_TYPES = [{
81
- type: "sort",
82
- operator: "asc",
83
- label: "Sort Ascending",
84
- value: "",
85
- Icon: ArrowUpwardIcon
86
- }, {
87
- type: "sort",
88
- operator: "desc",
89
- label: "Sort Descending",
90
- Icon: ArrowDownwardIcon
91
- }
92
- // {
93
- // type: "filter",
94
- // operator: "contains",
95
- // label: "Filter",
96
- // value: "",
97
- // Icon: FilterListIcon,
98
- // },
99
- ];
100
-
101
- export const DEFAULT_OPTION_COLORS = ["rgba(131, 96, 253, 0.5)", "rgba(180, 180, 180, 1)", "rgba(72, 159, 248, 0.5)", "rgba(254, 122, 0, 0.5)", "rgba(214, 105, 190, 0.5)", "rgba(255, 229, 0, 0.5)"];
@@ -1,160 +0,0 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import { Box, IconButton, TextField, List, ListItemButton, ListItemIcon, ListItemText, FormControlLabel } from "@mui/material";
3
- import CloseIcon from "@mui/icons-material/Close";
4
- import ArrowBackIcon from "@mui/icons-material/ArrowBack";
5
- import DeleteIcon from "@mui/icons-material/Delete";
6
- import ColorButtons from "../../../Color Picker/ColorButtons";
7
- import ColorPickerStyles from "../../../Color Picker/Styles";
8
- import { DEFAULT_OPTION_COLORS } from "./Constants";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
- const EditOption = props => {
12
- const {
13
- classes,
14
- onClose,
15
- mode,
16
- onEvent
17
- } = props;
18
- const [edit, setEdit] = useState({
19
- ...(mode?.edit || {})
20
- });
21
- const editData = useRef({
22
- ...edit
23
- });
24
- const {
25
- optionIndex
26
- } = edit;
27
- const selectedOption = edit?.options[optionIndex] || {};
28
- const pickerStyles = ColorPickerStyles();
29
- useEffect(() => {
30
- return () => {
31
- // on un-mount update the option change
32
- if (editData?.current) {
33
- delete editData?.current?.edited;
34
- onEvent("updateProperty", {
35
- ...editData?.current
36
- });
37
- }
38
- };
39
- }, []);
40
- const onChange = e => {
41
- const updatedOptions = edit?.options.map((m, i) => {
42
- if (i === edit?.optionIndex) {
43
- return {
44
- ...m,
45
- [e.target.name]: e?.target?.value
46
- };
47
- }
48
- return m;
49
- });
50
-
51
- // for delete
52
- if (edit?.optionIndex > -1 && e?.target?.delete) {
53
- updatedOptions.splice(edit?.optionIndex, 1);
54
- }
55
- const latest = {
56
- ...edit,
57
- options: [...updatedOptions]
58
- };
59
- setEdit({
60
- ...latest
61
- });
62
- editData.current = {
63
- ...latest,
64
- edited: true
65
- };
66
-
67
- // if delete go back
68
- if (e?.target?.delete) {
69
- onEvent("editProperty", {
70
- edit: {
71
- ...latest
72
- }
73
- });
74
- }
75
- };
76
- const onBack = () => {
77
- onEvent("editProperty", {
78
- edit: {
79
- ...edit
80
- }
81
- });
82
- };
83
- const onDeleteOption = () => {
84
- onChange({
85
- target: {
86
- delete: true
87
- }
88
- });
89
- };
90
- const onColorChange = color => {
91
- onChange({
92
- target: {
93
- name: "color",
94
- value: color
95
- }
96
- });
97
- };
98
- return /*#__PURE__*/_jsxs(Box, {
99
- sx: classes.addProperty,
100
- children: [/*#__PURE__*/_jsxs(Box, {
101
- className: "fe-dv-ap-title",
102
- children: [/*#__PURE__*/_jsxs("span", {
103
- children: [/*#__PURE__*/_jsx(IconButton, {
104
- className: "tv-act-ico",
105
- size: "small",
106
- onClick: onBack,
107
- children: /*#__PURE__*/_jsx(ArrowBackIcon, {})
108
- }), "Edit Option"]
109
- }), /*#__PURE__*/_jsx(IconButton, {
110
- className: "tv-act-ico bg",
111
- size: "small",
112
- onClick: onClose,
113
- children: /*#__PURE__*/_jsx(CloseIcon, {})
114
- })]
115
- }), /*#__PURE__*/_jsx(Box, {
116
- className: "fe-dv-ap-opt-content mt-1 mb",
117
- children: /*#__PURE__*/_jsx(FormControlLabel, {
118
- className: "ml-0",
119
- label: "Option Name",
120
- control: /*#__PURE__*/_jsx(TextField, {
121
- size: "small",
122
- name: "value",
123
- value: selectedOption?.value,
124
- onChange: onChange,
125
- fullWidth: true,
126
- placeholder: "Option Name"
127
- }),
128
- labelPlacement: "top"
129
- })
130
- }), /*#__PURE__*/_jsxs(Box, {
131
- className: "label-desc mt-1",
132
- children: [/*#__PURE__*/_jsx(Box, {
133
- className: "label-tp mb",
134
- children: "Choose Color"
135
- }), /*#__PURE__*/_jsx(Box, {
136
- className: "ml",
137
- children: /*#__PURE__*/_jsx(ColorButtons, {
138
- classes: pickerStyles,
139
- onSelect: onColorChange,
140
- activeColor: selectedOption?.color,
141
- defaultColors: DEFAULT_OPTION_COLORS
142
- })
143
- })]
144
- }), /*#__PURE__*/_jsx(List, {
145
- className: "fe-dv-opt-list st sb",
146
- children: /*#__PURE__*/_jsxs(ListItemButton, {
147
- onClick: onDeleteOption,
148
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
149
- children: /*#__PURE__*/_jsx(DeleteIcon, {})
150
- }), /*#__PURE__*/_jsx(ListItemText, {
151
- children: "Delete Option"
152
- })]
153
- })
154
- })]
155
- });
156
- };
157
- EditOption.defaultProps = {
158
- onEvent: () => {}
159
- };
160
- export default EditOption;
@@ -1,190 +0,0 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import { Box, IconButton, TextField, List, ListItemButton, ListItemText, ListItemIcon, FormControlLabel } from "@mui/material";
3
- import CloseIcon from "@mui/icons-material/Close";
4
- import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight";
5
- import DeleteIcon from "@mui/icons-material/Delete";
6
- import ContentCopyIcon from "@mui/icons-material/ContentCopy";
7
- import VisibilityIcon from "@mui/icons-material/Visibility";
8
- import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
9
- import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos";
10
- import { TYPE_LABELS } from "./Constants";
11
- import AddOptions from "./AddOptions";
12
- import FilterProperty from "./FilterProperty";
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
- const EditProperty = props => {
16
- const {
17
- classes,
18
- onClose,
19
- mode,
20
- onEvent
21
- } = props;
22
- const [edit, setEdit] = useState({
23
- ...(mode?.edit || {})
24
- });
25
- const editData = useRef({
26
- ...edit
27
- });
28
- useEffect(() => {
29
- return () => {
30
- // on un-mount update the label
31
- if (edit?.label !== editData?.current?.label) {
32
- onEvent("updateProperty", {
33
- ...editData?.current
34
- }, false);
35
- }
36
- };
37
- }, []);
38
- const onChange = key => e => {
39
- const latest = {
40
- ...edit,
41
- [key]: e?.target?.value
42
- };
43
- setEdit({
44
- ...edit,
45
- [key]: e?.target?.value
46
- });
47
- editData.current = {
48
- ...latest
49
- };
50
- };
51
- const onChangeProperty = () => {
52
- onEvent("changeProperty", {
53
- edit: {
54
- ...edit
55
- }
56
- });
57
- };
58
- const onBack = () => {
59
- onEvent("allProperties", {
60
- edit: null
61
- });
62
- };
63
- const onUpdate = data => {
64
- const latest = {
65
- ...edit,
66
- ...data
67
- };
68
- setEdit({
69
- ...edit,
70
- ...data
71
- });
72
- editData.current = {
73
- ...latest
74
- };
75
- onEvent("updateProperty", {
76
- ...editData?.current
77
- });
78
- };
79
- const onAction = action => () => {
80
- switch (action) {
81
- case "Visibilty":
82
- onUpdate({
83
- visible: !edit?.visible
84
- });
85
- onEvent("close");
86
- break;
87
- case "Duplicate":
88
- onEvent("addProperty", {
89
- type: editData?.current?.type,
90
- overrides: {
91
- ...editData?.current
92
- }
93
- }, false);
94
- onEvent("close");
95
- break;
96
- case "Delete":
97
- onEvent("deleteProperty", {
98
- ...editData?.current
99
- });
100
- onEvent("close");
101
- break;
102
- default:
103
- return;
104
- }
105
- };
106
- return /*#__PURE__*/_jsxs(Box, {
107
- sx: classes.addProperty,
108
- children: [/*#__PURE__*/_jsxs(Box, {
109
- className: "fe-dv-ap-title",
110
- children: [/*#__PURE__*/_jsxs("span", {
111
- children: [/*#__PURE__*/_jsx(IconButton, {
112
- className: "tv-act-ico",
113
- size: "small",
114
- onClick: onBack,
115
- children: /*#__PURE__*/_jsx(ArrowBackIosIcon, {})
116
- }), "Edit Property"]
117
- }), /*#__PURE__*/_jsx(IconButton, {
118
- className: "tv-act-ico bg br1",
119
- size: "small",
120
- onClick: onClose,
121
- children: /*#__PURE__*/_jsx(CloseIcon, {})
122
- })]
123
- }), /*#__PURE__*/_jsxs(Box, {
124
- className: "fe-dv-ap-opt-content",
125
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
126
- label: "Field Name",
127
- labelPlacement: "top",
128
- control: /*#__PURE__*/_jsx(TextField, {
129
- size: "small",
130
- value: edit?.label,
131
- onChange: onChange("label"),
132
- fullWidth: true,
133
- placeholder: "Field Name"
134
- })
135
- }), /*#__PURE__*/_jsx(AddOptions, {
136
- edit: edit,
137
- onUpdate: onUpdate,
138
- onEvent: onEvent
139
- }), /*#__PURE__*/_jsx(FilterProperty, {
140
- edit: edit,
141
- onUpdate: onUpdate,
142
- onEvent: onEvent
143
- }), /*#__PURE__*/_jsx(List, {
144
- className: "fe-dv-opt-list st sb",
145
- children: /*#__PURE__*/_jsxs(ListItemButton, {
146
- onClick: onChangeProperty,
147
- children: [/*#__PURE__*/_jsx(ListItemText, {
148
- children: "Type"
149
- }), /*#__PURE__*/_jsxs(ListItemIcon, {
150
- sx: {
151
- alignItems: "center"
152
- },
153
- children: [/*#__PURE__*/_jsx("span", {
154
- className: "label-tp",
155
- children: TYPE_LABELS[edit?.type]
156
- }), /*#__PURE__*/_jsx(KeyboardArrowRightIcon, {})]
157
- })]
158
- })
159
- }), /*#__PURE__*/_jsxs(List, {
160
- className: "fe-dv-opt-list",
161
- children: [/*#__PURE__*/_jsxs(ListItemButton, {
162
- onClick: onAction("Visibilty"),
163
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
164
- children: edit?.visible ? /*#__PURE__*/_jsx(VisibilityOffIcon, {}) : /*#__PURE__*/_jsx(VisibilityIcon, {})
165
- }), /*#__PURE__*/_jsxs(ListItemText, {
166
- children: [edit?.visible ? "Hide" : "Show", " in View"]
167
- })]
168
- }), /*#__PURE__*/_jsxs(ListItemButton, {
169
- onClick: onAction("Duplicate"),
170
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
171
- children: /*#__PURE__*/_jsx(ContentCopyIcon, {})
172
- }), /*#__PURE__*/_jsx(ListItemText, {
173
- children: "Duplicate Property"
174
- })]
175
- }), /*#__PURE__*/_jsxs(ListItemButton, {
176
- onClick: onAction("Delete"),
177
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
178
- children: /*#__PURE__*/_jsx(DeleteIcon, {})
179
- }), /*#__PURE__*/_jsx(ListItemText, {
180
- children: "Delete Property"
181
- })]
182
- })]
183
- })]
184
- })]
185
- });
186
- };
187
- EditProperty.defaultProps = {
188
- onEvent: () => {}
189
- };
190
- export default EditProperty;
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- import { List, ListItemButton, ListItemText, ListItemIcon } from "@mui/material";
3
- import { FILTER_TYPES } from "./Constants";
4
- import { useDataView } from "../../Providers/DataViewProvider";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- const FilterProperty = props => {
8
- const {
9
- sort
10
- } = useDataView();
11
- const {
12
- edit,
13
- onEvent
14
- } = props;
15
- const handleChangeOption = m => () => {
16
- onEvent("addSort", {
17
- ...(sort[0] || {}),
18
- newKey: edit?.key,
19
- operator: m?.operator
20
- });
21
- };
22
- return /*#__PURE__*/_jsx(List, {
23
- className: "fe-dv-opt-list mt",
24
- children: FILTER_TYPES?.map(({
25
- Icon,
26
- ...m
27
- }, i) => {
28
- return /*#__PURE__*/_jsxs(ListItemButton, {
29
- onClick: handleChangeOption(m),
30
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
31
- children: /*#__PURE__*/_jsx(Icon, {})
32
- }), /*#__PURE__*/_jsx(ListItemText, {
33
- primary: m.label
34
- })]
35
- }, i);
36
- })
37
- });
38
- };
39
- FilterProperty.defaultProps = {
40
- onEvent: () => {}
41
- };
42
- export default FilterProperty;
@@ -1,30 +0,0 @@
1
- import React from "react";
2
- import { List, ListItemButton, ListItemIcon, ListItemText } from "@mui/material";
3
- import { PROPERTY_TYPES } from "./Constants";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- const PropertyList = props => {
7
- const {
8
- onSelect,
9
- selected
10
- } = props;
11
- return /*#__PURE__*/_jsx(List, {
12
- children: PROPERTY_TYPES?.map(({
13
- Icon,
14
- ...rest
15
- }, i) => {
16
- return /*#__PURE__*/_jsxs(ListItemButton, {
17
- className: selected?.type === rest?.type ? "active" : "",
18
- onClick: onSelect(rest),
19
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
20
- className: "needBg",
21
- children: /*#__PURE__*/_jsx(Icon, {})
22
- }), /*#__PURE__*/_jsx(ListItemText, {
23
- primary: rest?.label
24
- })]
25
- }, i);
26
- })
27
- });
28
- };
29
- PropertyList.defaultProps = {};
30
- export default PropertyList;
@@ -1,110 +0,0 @@
1
- import React from "react";
2
- import { Popover, SwipeableDrawer } from "@mui/material";
3
- import useOptionsStyles from "./styles";
4
- import AddProperty from "./AddProperty";
5
- import EditProperty from "./EditProperty";
6
- import ChangeProperty from "./ChangeProperty";
7
- import AllProperties from "./AllProperties";
8
- import EditOption from "./EditOption";
9
- import { useTheme } from "@emotion/react";
10
- import { useEditorContext } from "../../../../hooks/useMouseMove";
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- const POSITIONS = {
13
- addProperty: {
14
- anchorOrigin: {
15
- vertical: "bottom",
16
- horizontal: "right"
17
- },
18
- transformOrigin: {
19
- vertical: "top",
20
- horizontal: "right"
21
- }
22
- },
23
- allProperties: {
24
- anchorOrigin: {
25
- vertical: "bottom",
26
- horizontal: "right"
27
- },
28
- transformOrigin: {
29
- vertical: "top",
30
- horizontal: "right"
31
- }
32
- }
33
- };
34
- const PropertySettings = props => {
35
- const {
36
- theme: appTheme
37
- } = useEditorContext();
38
- const theme = useTheme();
39
- const {
40
- open,
41
- anchorEl,
42
- mode,
43
- onClose,
44
- onEvent
45
- } = props;
46
- const classes = useOptionsStyles(theme, appTheme);
47
- const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
48
- const PoperComponent = isMobile ? SwipeableDrawer : Popover;
49
- const renderMode = () => {
50
- switch (mode?.type) {
51
- case "addProperty":
52
- return /*#__PURE__*/_jsx(AddProperty, {
53
- classes: classes,
54
- onClose: onClose,
55
- onEvent: onEvent,
56
- mode: mode
57
- });
58
- case "editProperty":
59
- return /*#__PURE__*/_jsx(EditProperty, {
60
- classes: classes,
61
- onClose: onClose,
62
- onEvent: onEvent,
63
- mode: mode
64
- });
65
- case "changeProperty":
66
- return /*#__PURE__*/_jsx(ChangeProperty, {
67
- classes: classes,
68
- onClose: onClose,
69
- onEvent: onEvent,
70
- mode: mode
71
- });
72
- case "allProperties":
73
- return /*#__PURE__*/_jsx(AllProperties, {
74
- classes: classes,
75
- onClose: onClose,
76
- onEvent: onEvent,
77
- mode: mode
78
- });
79
- case "editOption":
80
- return /*#__PURE__*/_jsx(EditOption, {
81
- classes: classes,
82
- onClose: onClose,
83
- onEvent: onEvent,
84
- mode: mode
85
- });
86
- default:
87
- return null;
88
- }
89
- };
90
- return /*#__PURE__*/_jsx(PoperComponent, {
91
- open: open,
92
- anchorEl: anchorEl,
93
- anchorOrigin: {
94
- vertical: "top",
95
- horizontal: "right"
96
- },
97
- transformOrigin: {
98
- vertical: "top",
99
- horizontal: "left"
100
- },
101
- onClose: onClose,
102
- anchor: "bottom",
103
- sx: classes.popover
104
- // override position
105
- ,
106
- ...(POSITIONS[mode?.type] || {}),
107
- children: renderMode()
108
- });
109
- };
110
- export default PropertySettings;