@flozy/editor 5.5.9 → 5.6.0

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.
Files changed (199) hide show
  1. package/dist/Editor/ChatEditor.js +25 -34
  2. package/dist/Editor/CommonEditor.js +26 -13
  3. package/dist/Editor/Editor.css +106 -20
  4. package/dist/Editor/Elements/AI/AIInput.js +0 -1
  5. package/dist/Editor/Elements/AI/CustomSelect.js +17 -10
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +59 -53
  7. package/dist/Editor/Elements/AI/Styles.js +24 -6
  8. package/dist/Editor/Elements/Accordion/Accordion.js +8 -1
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
  10. package/dist/Editor/Elements/Button/EditorButton.js +6 -1
  11. package/dist/Editor/Elements/Carousel/CarouselItem.js +11 -3
  12. package/dist/Editor/Elements/Color Picker/ColorButtons.js +7 -5
  13. package/dist/Editor/Elements/Color Picker/Styles.js +8 -3
  14. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  15. package/dist/Editor/Elements/DataView/DataView.js +124 -0
  16. package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
  17. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +83 -0
  18. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +33 -0
  19. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +180 -0
  20. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +62 -0
  21. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +68 -0
  22. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +35 -0
  23. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +39 -0
  24. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +30 -0
  25. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +30 -0
  26. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +35 -0
  27. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +36 -0
  28. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +17 -0
  29. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +29 -0
  30. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +38 -0
  31. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +86 -0
  32. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +71 -0
  33. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +138 -0
  34. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +213 -0
  35. package/dist/Editor/Elements/DataView/Layouts/Formula.js +29 -0
  36. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +113 -0
  37. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +44 -0
  38. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +146 -0
  39. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +79 -0
  40. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +57 -0
  41. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +101 -0
  42. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +174 -0
  43. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +241 -0
  44. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +45 -0
  45. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +32 -0
  46. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +110 -0
  47. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +217 -0
  48. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +131 -0
  49. package/dist/Editor/Elements/DataView/Layouts/TableView.js +253 -0
  50. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +85 -0
  51. package/dist/Editor/Elements/DataView/Layouts/colStyles.js +10 -0
  52. package/dist/Editor/Elements/DataView/Layouts/index.js +25 -0
  53. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +277 -0
  54. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +15 -0
  55. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +88 -0
  56. package/dist/Editor/Elements/DataView/styles.js +169 -0
  57. package/dist/Editor/Elements/Divider/Divider.js +36 -20
  58. package/dist/Editor/Elements/Embed/Image.js +51 -16
  59. package/dist/Editor/Elements/Embed/Video.js +26 -3
  60. package/dist/Editor/Elements/Form/Form.js +38 -2
  61. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +7 -1
  62. package/dist/Editor/Elements/Form/FormElements/FormDate.js +7 -1
  63. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +7 -1
  64. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +7 -1
  65. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +7 -1
  66. package/dist/Editor/Elements/Form/FormElements/FormText.js +7 -1
  67. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +6 -1
  68. package/dist/Editor/Elements/Form/FormPopup.js +12 -9
  69. package/dist/Editor/Elements/Form/Workflow/Styles.js +2 -0
  70. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  71. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -2
  72. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +20 -1
  73. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
  74. package/dist/Editor/Elements/FreeGrid/styles.js +1 -1
  75. package/dist/Editor/Elements/Grid/GridButton.js +2 -2
  76. package/dist/Editor/Elements/Grid/GridItem.js +47 -36
  77. package/dist/Editor/Elements/Grid/Styles.js +50 -0
  78. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  79. package/dist/Editor/Elements/Search/SearchButton.js +1 -0
  80. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  81. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  82. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -52
  83. package/dist/Editor/Elements/SimpleText/index.js +3 -2
  84. package/dist/Editor/Elements/SimpleText/style.js +15 -0
  85. package/dist/Editor/Elements/Table/AddRowCol.js +77 -0
  86. package/dist/Editor/Elements/Table/DragButton.js +142 -0
  87. package/dist/Editor/Elements/Table/DragStyles.js +70 -0
  88. package/dist/Editor/Elements/Table/Draggable.js +25 -0
  89. package/dist/Editor/Elements/Table/Droppable.js +53 -0
  90. package/dist/Editor/Elements/Table/Styles.js +88 -78
  91. package/dist/Editor/Elements/Table/Table.js +263 -140
  92. package/dist/Editor/Elements/Table/TableCell.js +365 -111
  93. package/dist/Editor/Elements/Table/TablePopup.js +9 -3
  94. package/dist/Editor/Elements/Table/TableRow.js +10 -2
  95. package/dist/Editor/Elements/Table/TableTool.js +101 -0
  96. package/dist/Editor/Elements/Table/tableHelper.js +71 -0
  97. package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -1
  98. package/dist/Editor/MiniEditor.js +21 -2
  99. package/dist/Editor/Styles/EditorStyles.js +13 -4
  100. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +10 -0
  101. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +7 -12
  102. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +26 -4
  103. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +3 -0
  104. package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -5
  105. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +8 -8
  106. package/dist/Editor/Toolbar/Mini/Styles.js +9 -1
  107. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/InfinityAITool.js +7 -3
  108. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +6 -4
  109. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +19 -15
  110. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +547 -58
  111. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +28 -16
  112. package/dist/Editor/Toolbar/PopupTool/index.js +3 -5
  113. package/dist/Editor/Toolbar/Toolbar.js +6 -0
  114. package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
  115. package/dist/Editor/assets/svg/ArrowDownIcon.js +25 -0
  116. package/dist/Editor/assets/svg/ArrowUpIcon.js +25 -0
  117. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  118. package/dist/Editor/assets/svg/CalenderIconTick.js +64 -0
  119. package/dist/Editor/assets/svg/ChervDown.js +18 -0
  120. package/dist/Editor/assets/svg/ChervUp.js +18 -0
  121. package/dist/Editor/assets/svg/DataTableIcon.js +50 -0
  122. package/dist/Editor/assets/svg/DuplicateIcon.js +23 -0
  123. package/dist/Editor/assets/svg/EyeIcon.js +23 -0
  124. package/dist/Editor/assets/svg/EyeSlash.js +43 -0
  125. package/dist/Editor/assets/svg/HashtagIcon.js +33 -0
  126. package/dist/Editor/assets/svg/PlusIcon.js +23 -0
  127. package/dist/Editor/assets/svg/SelectRoundedIcon.js +24 -0
  128. package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
  129. package/dist/Editor/assets/svg/SortByIcon.js +33 -0
  130. package/dist/Editor/assets/svg/TableIcons.js +220 -0
  131. package/dist/Editor/assets/svg/TickOutlined.js +23 -0
  132. package/dist/Editor/assets/svg/TrashCanIcon.js +38 -0
  133. package/dist/Editor/common/ColorPickerButton.js +85 -45
  134. package/dist/Editor/common/DnD/Draggable.js +2 -1
  135. package/dist/Editor/common/FontLoader/FontLoader.js +2 -2
  136. package/dist/Editor/common/Icon.js +54 -21
  137. package/dist/Editor/common/ImageSelector/Options/Upload.js +2 -1
  138. package/dist/Editor/common/ImageSelector/Styles.js +47 -6
  139. package/dist/Editor/common/ImageSelector/UploadStyles.js +18 -6
  140. package/dist/Editor/common/LinkSettings/NavComponents.js +2 -1
  141. package/dist/Editor/common/LinkSettings/index.js +2 -1
  142. package/dist/Editor/common/MentionsPopup/Styles.js +142 -8
  143. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  144. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +107 -12
  145. package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
  146. package/dist/Editor/common/RnD/ShadowElement.js +1 -1
  147. package/dist/Editor/common/RnD/VirtualElement/index.js +5 -1
  148. package/dist/Editor/common/RnD/index.js +4 -3
  149. package/dist/Editor/common/Section/index.js +3 -3
  150. package/dist/Editor/common/Section/styles.js +5 -1
  151. package/dist/Editor/common/Select/index.js +20 -0
  152. package/dist/Editor/common/Select/styles.js +17 -0
  153. package/dist/Editor/common/Shorthands/elements.js +13 -1
  154. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -1
  155. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +4 -3
  156. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +35 -7
  157. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -2
  158. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +2 -1
  159. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
  160. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -0
  161. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +11 -11
  162. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +22 -6
  163. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +21 -2
  164. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +20 -4
  165. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +12 -2
  166. package/dist/Editor/common/StyleBuilder/formStyle.js +268 -149
  167. package/dist/Editor/common/StyleBuilder/index.js +101 -20
  168. package/dist/Editor/common/StyleBuilder/tableStyle.js +69 -25
  169. package/dist/Editor/common/SwipeableDrawer/style.js +15 -4
  170. package/dist/Editor/common/ToolbarIcon.js +1 -1
  171. package/dist/Editor/common/Uploader.js +39 -37
  172. package/dist/Editor/common/iconListV2.js +598 -74
  173. package/dist/Editor/common/iconslist.js +25 -19
  174. package/dist/Editor/commonStyle.js +421 -15
  175. package/dist/Editor/helper/deserialize/index.js +31 -2
  176. package/dist/Editor/helper/enforceDateFormat.js +41 -0
  177. package/dist/Editor/helper/index.js +15 -2
  178. package/dist/Editor/helper/theme.js +15 -1
  179. package/dist/Editor/hooks/useBreakpoints.js +1 -1
  180. package/dist/Editor/hooks/useTable.js +210 -0
  181. package/dist/Editor/plugins/withCustomDeleteBackward.js +34 -3
  182. package/dist/Editor/plugins/withEmbeds.js +30 -26
  183. package/dist/Editor/plugins/withHTML.js +100 -12
  184. package/dist/Editor/plugins/withLayout.js +1 -0
  185. package/dist/Editor/utils/SlateUtilityFunctions.js +31 -11
  186. package/dist/Editor/utils/brains.js +1 -1
  187. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +75 -6
  188. package/dist/Editor/utils/customHooks/useResize.js +7 -4
  189. package/dist/Editor/utils/customHooks/useTableResize.js +6 -2
  190. package/dist/Editor/utils/dataView.js +43 -0
  191. package/dist/Editor/utils/embed.js +2 -1
  192. package/dist/Editor/utils/events.js +0 -1
  193. package/dist/Editor/utils/font.js +11 -4
  194. package/dist/Editor/utils/formfield.js +8 -4
  195. package/dist/Editor/utils/helper.js +100 -2
  196. package/dist/Editor/utils/insertNewLine.js +19 -1
  197. package/dist/Editor/utils/serializeToText.js +2 -0
  198. package/dist/Editor/utils/table.js +228 -24
  199. package/package.json +2 -2
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { Box, IconButton } from "@mui/material";
3
+ import CloseIcon from "@mui/icons-material/Close";
4
+ import PropertyList from "./PropertyList";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ const AddProperty = props => {
8
+ const {
9
+ classes,
10
+ onClose,
11
+ onEvent
12
+ } = props;
13
+ const onSelect = type => () => {
14
+ onEvent("addProperty", type);
15
+ };
16
+ return /*#__PURE__*/_jsxs(Box, {
17
+ sx: classes.addProperty,
18
+ children: [/*#__PURE__*/_jsxs(Box, {
19
+ className: "fe-dv-ap-title",
20
+ children: ["Add Property", /*#__PURE__*/_jsx(IconButton, {
21
+ className: "tv-act-ico bg br1",
22
+ size: "small",
23
+ onClick: onClose,
24
+ sx: {
25
+ '& svg': {
26
+ '& path': {
27
+ strokeWidth: 0
28
+ }
29
+ }
30
+ },
31
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
32
+ })]
33
+ }), /*#__PURE__*/_jsx(Box, {
34
+ className: "fe-dv-ap-opt-content mt",
35
+ children: /*#__PURE__*/_jsx(PropertyList, {
36
+ onSelect: onSelect
37
+ })
38
+ })]
39
+ });
40
+ };
41
+ AddProperty.defaultProps = {
42
+ onEvent: () => {}
43
+ };
44
+ export default AddProperty;
@@ -0,0 +1,146 @@
1
+ import React from "react";
2
+ import { Box, IconButton, List, ListItemButton, ListItemText, ListItemIcon, Divider } from "@mui/material";
3
+ import CloseIcon from "@mui/icons-material/Close";
4
+ import { PROPERTY_TYPES, TYPE_ICONS } from "./Constants";
5
+ import { useDataView } from "../../Providers/DataViewProvider";
6
+ import Icon from "../../../../common/Icon";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
10
+ const AllProperties = props => {
11
+ const {
12
+ classes,
13
+ onClose,
14
+ onEvent
15
+ } = props;
16
+ const {
17
+ properties,
18
+ onAddProperty
19
+ } = useDataView();
20
+ const shownProperties = properties?.filter(f => f.visible === true);
21
+ const hiddenProperties = properties?.filter(f => f.visible === false);
22
+ const onEditProperty = data => () => {
23
+ onEvent("editProperty", {
24
+ edit: {
25
+ ...data
26
+ }
27
+ });
28
+ };
29
+ const onAdd = () => {
30
+ const np = onAddProperty({
31
+ type: "text"
32
+ });
33
+ onEvent("editProperty", {
34
+ edit: {
35
+ ...np
36
+ }
37
+ });
38
+ };
39
+ return /*#__PURE__*/_jsxs(Box, {
40
+ sx: classes.addProperty,
41
+ children: [/*#__PURE__*/_jsxs(Box, {
42
+ className: "fe-dv-ap-title",
43
+ children: ["Properties", /*#__PURE__*/_jsx(IconButton, {
44
+ className: "tv-act-ico bg br1",
45
+ size: "small",
46
+ onClick: onClose,
47
+ sx: {
48
+ '& svg': {
49
+ '& path': {
50
+ strokeWidth: 0
51
+ }
52
+ }
53
+ },
54
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
55
+ })]
56
+ }), /*#__PURE__*/_jsx(Box, {
57
+ className: "fe-dv-ap-desc",
58
+ children: "Displayed Properties"
59
+ }), /*#__PURE__*/_jsxs(Box, {
60
+ className: "fe-dv-ap-opt-content",
61
+ children: [/*#__PURE__*/_jsx(List, {
62
+ className: "fe-dv-opt-list",
63
+ children: shownProperties?.map((m, i) => {
64
+ const {
65
+ Icon: iconType
66
+ } = PROPERTY_TYPES?.find(f => f.type === m.type) || {};
67
+ return /*#__PURE__*/_jsxs(ListItemButton, {
68
+ onClick: onEditProperty(m),
69
+ children: [/*#__PURE__*/_jsx(ListItemIcon, {
70
+ className: "needBg",
71
+ sx: {
72
+ '& svg': {
73
+ width: '14px !important',
74
+ height: '14px !important'
75
+ }
76
+ },
77
+ children: /*#__PURE__*/_jsx(Icon, {
78
+ icon: iconType
79
+ })
80
+ }), /*#__PURE__*/_jsx(ListItemText, {
81
+ children: m?.label
82
+ }), /*#__PURE__*/_jsx(ListItemIcon, {
83
+ sx: {
84
+ justifyContent: "end"
85
+ },
86
+ children: /*#__PURE__*/_jsx(Icon, {
87
+ icon: 'rightArrow'
88
+ })
89
+ })]
90
+ }, i);
91
+ })
92
+ }), hiddenProperties?.length > 0 ? /*#__PURE__*/_jsxs(_Fragment, {
93
+ children: [/*#__PURE__*/_jsx(Box, {
94
+ className: "fe-dv-ap-desc",
95
+ children: "Hidden Properties"
96
+ }), /*#__PURE__*/_jsx(List, {
97
+ className: "fe-dv-opt-list",
98
+ children: hiddenProperties?.map((m, i) => {
99
+ return /*#__PURE__*/_jsxs(ListItemButton, {
100
+ onClick: onEditProperty(m),
101
+ children: [/*#__PURE__*/_jsx(ListItemIcon, {
102
+ className: "needBg",
103
+ sx: {
104
+ alignItems: "center",
105
+ '& svg': {
106
+ width: '14px !important',
107
+ height: '14px !important'
108
+ }
109
+ },
110
+ children: /*#__PURE__*/_jsx(Icon, {
111
+ icon: TYPE_ICONS[m?.type]
112
+ })
113
+ }), /*#__PURE__*/_jsx(ListItemText, {
114
+ children: m?.label
115
+ }), /*#__PURE__*/_jsx(ListItemIcon, {
116
+ sx: {
117
+ alignItems: "center",
118
+ justifyContent: 'flex-end'
119
+ },
120
+ children: /*#__PURE__*/_jsx(Icon, {
121
+ icon: 'rightArrow'
122
+ })
123
+ })]
124
+ }, i);
125
+ })
126
+ })]
127
+ }) : null, /*#__PURE__*/_jsx(Divider, {
128
+ className: "divider_sty"
129
+ }), /*#__PURE__*/_jsx(List, {
130
+ className: "fe-dv-opt-list",
131
+ children: /*#__PURE__*/_jsxs(ListItemButton, {
132
+ onClick: onAdd,
133
+ children: [/*#__PURE__*/_jsx(ListItemIcon, {
134
+ children: /*#__PURE__*/_jsx(Icon, {
135
+ icon: 'plusIcon'
136
+ })
137
+ }), /*#__PURE__*/_jsx(ListItemText, {
138
+ children: "Add New Property"
139
+ })]
140
+ })
141
+ })]
142
+ })]
143
+ });
144
+ };
145
+ AllProperties.defaultProps = {};
146
+ export default AllProperties;
@@ -0,0 +1,79 @@
1
+ import React from "react";
2
+ import { Box, IconButton } from "@mui/material";
3
+ import CloseIcon from "@mui/icons-material/Close";
4
+ import PropertyList from "./PropertyList";
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 ChangeProperty = props => {
9
+ const {
10
+ classes,
11
+ onClose,
12
+ onEvent,
13
+ mode
14
+ } = props;
15
+ const onSelect = property => () => {
16
+ onEvent("updateProperty", {
17
+ ...(mode?.edit || {}),
18
+ type: property?.type
19
+ });
20
+ };
21
+ const onBack = () => {
22
+ onEvent("editProperty", {
23
+ edit: {
24
+ ...(mode?.edit || {})
25
+ }
26
+ });
27
+ };
28
+ return /*#__PURE__*/_jsxs(Box, {
29
+ sx: classes.addProperty,
30
+ children: [/*#__PURE__*/_jsxs(Box, {
31
+ className: "fe-dv-ap-title",
32
+ children: [/*#__PURE__*/_jsxs("span", {
33
+ children: [/*#__PURE__*/_jsx(IconButton, {
34
+ className: "tv-act-ico",
35
+ size: "small",
36
+ onClick: onBack,
37
+ sx: {
38
+ paddingLeft: '0px',
39
+ '&:hover': {
40
+ background: 'transparent !important'
41
+ },
42
+ '& svg': {
43
+ width: '14px !important',
44
+ height: '14px !important'
45
+ }
46
+ },
47
+ children: /*#__PURE__*/_jsx(Icon, {
48
+ icon: 'leftArrow'
49
+ })
50
+ }), "Change Property"]
51
+ }), /*#__PURE__*/_jsx(IconButton, {
52
+ className: "tv-act-ico bg br1",
53
+ size: "small",
54
+ onClick: onClose,
55
+ sx: {
56
+ '& svg': {
57
+ '& path': {
58
+ strokeWidth: 0
59
+ }
60
+ }
61
+ },
62
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
63
+ })]
64
+ }), /*#__PURE__*/_jsx(Box, {
65
+ className: "fe-dv-ap-desc",
66
+ children: "Select Property Type"
67
+ }), /*#__PURE__*/_jsx(Box, {
68
+ className: "fe-dv-ap-opt-content mt",
69
+ children: /*#__PURE__*/_jsx(PropertyList, {
70
+ onSelect: onSelect,
71
+ selected: mode?.edit
72
+ })
73
+ })]
74
+ });
75
+ };
76
+ ChangeProperty.defaultProps = {
77
+ onEvent: () => {}
78
+ };
79
+ export default ChangeProperty;
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import { List, ListItemButton, ListItemIcon, ListItemText, Box } from "@mui/material";
3
+ import { PROPERTY_TYPES } from "./Constants";
4
+ import Icon from "../../../../common/Icon";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ const ColumnsList = props => {
8
+ const {
9
+ properties
10
+ } = props;
11
+ const {
12
+ onSelect,
13
+ selected
14
+ } = props;
15
+ return /*#__PURE__*/_jsx(Box, {
16
+ className: "opt-wrpr",
17
+ children: /*#__PURE__*/_jsx(List, {
18
+ className: "tv-opt-list",
19
+ children: properties?.map((m, i) => {
20
+ const {
21
+ Icon: iconType
22
+ } = PROPERTY_TYPES?.find(f => f.type === m.type) || {};
23
+ return /*#__PURE__*/_jsxs(ListItemButton, {
24
+ className: selected?.type === m?.type ? "active" : "",
25
+ onClick: onSelect(m),
26
+ children: [/*#__PURE__*/_jsx(ListItemIcon, {
27
+ sx: {
28
+ background: 'none'
29
+ },
30
+ children: /*#__PURE__*/_jsx(Box, {
31
+ className: "bgic",
32
+ sx: {
33
+ marginRight: '5px',
34
+ borderRadius: '4px',
35
+ display: 'flex',
36
+ alignItems: 'center',
37
+ padding: '2px',
38
+ '& svg': {
39
+ width: '16px',
40
+ height: '16px',
41
+ padding: '0px !important'
42
+ }
43
+ },
44
+ children: /*#__PURE__*/_jsx(Icon, {
45
+ icon: iconType
46
+ })
47
+ })
48
+ }), /*#__PURE__*/_jsx(ListItemText, {
49
+ primary: m?.label
50
+ })]
51
+ }, i);
52
+ })
53
+ })
54
+ });
55
+ };
56
+ ColumnsList.defaultProps = {};
57
+ export default ColumnsList;
@@ -0,0 +1,101 @@
1
+ // import FilterListIcon from "@mui/icons-material/FilterList";
2
+
3
+ export const TYPE_LABELS = {
4
+ text: "Text",
5
+ number: "Number",
6
+ select: "Select",
7
+ "multi-select": "Multi Select",
8
+ date: "Date",
9
+ person: "Person",
10
+ check: "Checkbox"
11
+ };
12
+ export const TYPE_ICONS = {
13
+ text: 'text',
14
+ number: 'hashtagIcon',
15
+ select: 'selectRounded',
16
+ "multi-select": 'check-list-item',
17
+ date: 'calenderNewIcon',
18
+ person: 'userIcon',
19
+ check: 'tickOutline'
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: 'text'
55
+ }, {
56
+ type: "number",
57
+ label: TYPE_LABELS.number,
58
+ Icon: 'hashtagIcon'
59
+ }, {
60
+ type: "select",
61
+ label: TYPE_LABELS.select,
62
+ Icon: 'selectRounded'
63
+ }, {
64
+ type: "multi-select",
65
+ label: TYPE_LABELS["multi-select"],
66
+ Icon: 'check-list-item'
67
+ }, {
68
+ type: "date",
69
+ label: TYPE_LABELS.date,
70
+ Icon: 'calenderNewIcon'
71
+ }, {
72
+ type: "person",
73
+ label: TYPE_LABELS.person,
74
+ Icon: 'userIcon'
75
+ }, {
76
+ type: "check",
77
+ label: TYPE_LABELS.check,
78
+ Icon: 'tickOutline'
79
+ }];
80
+ export const FILTER_TYPES = [{
81
+ type: "sort",
82
+ operator: "asc",
83
+ label: "Sort Ascending",
84
+ value: "",
85
+ Icon: 'arrowUp'
86
+ }, {
87
+ type: "sort",
88
+ operator: "desc",
89
+ label: "Sort Descending",
90
+ Icon: 'arrowDown'
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)"];
@@ -0,0 +1,174 @@
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 ColorButtons from "../../../Color Picker/ColorButtons";
5
+ import ColorPickerStyles from "../../../Color Picker/Styles";
6
+ import { DEFAULT_OPTION_COLORS } from "./Constants";
7
+ import Icon from "../../../../common/Icon";
8
+ import { useEditorContext } from "../../../../hooks/useMouseMove";
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
+ theme
26
+ } = useEditorContext();
27
+ const {
28
+ optionIndex
29
+ } = edit;
30
+ const selectedOption = edit?.options[optionIndex] || {};
31
+ const pickerStyles = ColorPickerStyles(theme);
32
+ useEffect(() => {
33
+ return () => {
34
+ // on un-mount update the option change
35
+ if (editData?.current) {
36
+ delete editData?.current?.edited;
37
+ onEvent("updateProperty", {
38
+ ...editData?.current
39
+ });
40
+ }
41
+ };
42
+ }, []);
43
+ const onChange = e => {
44
+ const updatedOptions = edit?.options.map((m, i) => {
45
+ if (i === edit?.optionIndex) {
46
+ return {
47
+ ...m,
48
+ [e.target.name]: e?.target?.value
49
+ };
50
+ }
51
+ return m;
52
+ });
53
+
54
+ // for delete
55
+ if (edit?.optionIndex > -1 && e?.target?.delete) {
56
+ updatedOptions.splice(edit?.optionIndex, 1);
57
+ }
58
+ const latest = {
59
+ ...edit,
60
+ options: [...updatedOptions]
61
+ };
62
+ setEdit({
63
+ ...latest
64
+ });
65
+ editData.current = {
66
+ ...latest,
67
+ edited: true
68
+ };
69
+
70
+ // if delete go back
71
+ if (e?.target?.delete) {
72
+ onEvent("editProperty", {
73
+ edit: {
74
+ ...latest
75
+ }
76
+ });
77
+ }
78
+ };
79
+ const onBack = () => {
80
+ onEvent("editProperty", {
81
+ edit: {
82
+ ...edit
83
+ }
84
+ });
85
+ };
86
+ const onDeleteOption = () => {
87
+ onChange({
88
+ target: {
89
+ delete: true
90
+ }
91
+ });
92
+ };
93
+ const onColorChange = color => {
94
+ onChange({
95
+ target: {
96
+ name: "color",
97
+ value: color
98
+ }
99
+ });
100
+ };
101
+ return /*#__PURE__*/_jsxs(Box, {
102
+ sx: classes.addProperty,
103
+ children: [/*#__PURE__*/_jsxs(Box, {
104
+ className: "fe-dv-ap-title",
105
+ children: [/*#__PURE__*/_jsxs("span", {
106
+ children: [/*#__PURE__*/_jsx(IconButton, {
107
+ className: "tv-act-ico",
108
+ size: "small",
109
+ onClick: onBack,
110
+ children: /*#__PURE__*/_jsx(Icon, {
111
+ icon: 'leftArrow'
112
+ })
113
+ }), "Edit Option"]
114
+ }), /*#__PURE__*/_jsx(IconButton, {
115
+ className: "tv-act-ico bg br1",
116
+ size: "small",
117
+ sx: {
118
+ '& svg': {
119
+ '& path': {
120
+ strokeWidth: 0
121
+ }
122
+ }
123
+ },
124
+ onClick: onClose,
125
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
126
+ })]
127
+ }), /*#__PURE__*/_jsx(Box, {
128
+ className: "fe-dv-ap-opt-content mt-1 mb",
129
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
130
+ className: "ml-0",
131
+ label: "Option Name",
132
+ control: /*#__PURE__*/_jsx(TextField, {
133
+ size: "small",
134
+ name: "value",
135
+ value: selectedOption?.value,
136
+ onChange: onChange,
137
+ fullWidth: true,
138
+ placeholder: "Option Name"
139
+ }),
140
+ labelPlacement: "top"
141
+ })
142
+ }), /*#__PURE__*/_jsxs(Box, {
143
+ className: "label-desc mt-1",
144
+ children: [/*#__PURE__*/_jsx(Box, {
145
+ className: "label-tp mb",
146
+ children: "Choose Color"
147
+ }), /*#__PURE__*/_jsx(Box, {
148
+ className: "ml",
149
+ children: /*#__PURE__*/_jsx(ColorButtons, {
150
+ classes: pickerStyles,
151
+ onSelect: onColorChange,
152
+ activeColor: selectedOption?.color,
153
+ defaultColors: DEFAULT_OPTION_COLORS
154
+ })
155
+ })]
156
+ }), /*#__PURE__*/_jsx(List, {
157
+ className: "fe-dv-opt-list st",
158
+ children: /*#__PURE__*/_jsxs(ListItemButton, {
159
+ onClick: onDeleteOption,
160
+ children: [/*#__PURE__*/_jsx(ListItemIcon, {
161
+ children: /*#__PURE__*/_jsx(Icon, {
162
+ icon: 'trashIcon'
163
+ })
164
+ }), /*#__PURE__*/_jsx(ListItemText, {
165
+ children: "Delete Option"
166
+ })]
167
+ })
168
+ })]
169
+ });
170
+ };
171
+ EditOption.defaultProps = {
172
+ onEvent: () => {}
173
+ };
174
+ export default EditOption;