@flozy/editor 5.5.6 → 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.
Files changed (210) hide show
  1. package/dist/Editor/ChatEditor.js +34 -25
  2. package/dist/Editor/CommonEditor.js +16 -33
  3. package/dist/Editor/Editor.css +20 -105
  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/PopoverAIInput.js +53 -59
  7. package/dist/Editor/Elements/AI/Styles.js +6 -24
  8. package/dist/Editor/Elements/Accordion/Accordion.js +1 -8
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
  10. package/dist/Editor/Elements/Button/EditorButton.js +2 -9
  11. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -11
  12. package/dist/Editor/Elements/Color Picker/ColorButtons.js +5 -7
  13. package/dist/Editor/Elements/Color Picker/Styles.js +3 -8
  14. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  15. package/dist/Editor/Elements/Divider/Divider.js +20 -36
  16. package/dist/Editor/Elements/Embed/Image.js +16 -51
  17. package/dist/Editor/Elements/Embed/Video.js +3 -26
  18. package/dist/Editor/Elements/Form/Form.js +2 -39
  19. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +1 -7
  20. package/dist/Editor/Elements/Form/FormElements/FormDate.js +1 -7
  21. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +1 -7
  22. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +1 -7
  23. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +1 -7
  24. package/dist/Editor/Elements/Form/FormElements/FormText.js +1 -7
  25. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +1 -6
  26. package/dist/Editor/Elements/Form/FormPopup.js +9 -12
  27. package/dist/Editor/Elements/Form/Workflow/Styles.js +0 -2
  28. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  29. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -4
  30. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
  31. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
  32. package/dist/Editor/Elements/FreeGrid/styles.js +1 -2
  33. package/dist/Editor/Elements/Grid/GridButton.js +2 -2
  34. package/dist/Editor/Elements/Grid/GridItem.js +36 -47
  35. package/dist/Editor/Elements/Grid/Styles.js +0 -50
  36. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  37. package/dist/Editor/Elements/List/CheckList.js +1 -2
  38. package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
  39. package/dist/Editor/Elements/Search/SearchButton.js +0 -1
  40. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  41. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  42. package/dist/Editor/Elements/Signature/SignaturePopup.js +52 -17
  43. package/dist/Editor/Elements/SimpleText/index.js +3 -11
  44. package/dist/Editor/Elements/SimpleText/style.js +1 -20
  45. package/dist/Editor/Elements/Table/Styles.js +78 -88
  46. package/dist/Editor/Elements/Table/Table.js +140 -263
  47. package/dist/Editor/Elements/Table/TableCell.js +111 -365
  48. package/dist/Editor/Elements/Table/TablePopup.js +3 -9
  49. package/dist/Editor/Elements/Table/TableRow.js +2 -10
  50. package/dist/Editor/Elements/TopBanner/TopBanner.js +1 -2
  51. package/dist/Editor/MiniEditor.js +2 -21
  52. package/dist/Editor/Styles/EditorStyles.js +4 -13
  53. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
  54. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +12 -7
  55. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -26
  56. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
  57. package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -5
  58. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +8 -8
  59. package/dist/Editor/Toolbar/Mini/Styles.js +1 -9
  60. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/InfinityAITool.js +3 -7
  61. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -6
  62. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +15 -19
  63. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +58 -557
  64. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +16 -73
  65. package/dist/Editor/Toolbar/PopupTool/index.js +5 -3
  66. package/dist/Editor/Toolbar/Toolbar.js +0 -6
  67. package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
  68. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  69. package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
  70. package/dist/Editor/common/ColorPickerButton.js +45 -85
  71. package/dist/Editor/common/DnD/Draggable.js +1 -2
  72. package/dist/Editor/common/FontLoader/FontLoader.js +6 -12
  73. package/dist/Editor/common/Icon.js +21 -54
  74. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -2
  75. package/dist/Editor/common/ImageSelector/Styles.js +6 -47
  76. package/dist/Editor/common/ImageSelector/UploadStyles.js +6 -18
  77. package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
  78. package/dist/Editor/common/LinkSettings/index.js +1 -2
  79. package/dist/Editor/common/MentionsPopup/Styles.js +8 -143
  80. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  81. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -108
  82. package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
  83. package/dist/Editor/common/RnD/ShadowElement.js +1 -1
  84. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  85. package/dist/Editor/common/RnD/Utils/gridDropItem.js +6 -9
  86. package/dist/Editor/common/RnD/VirtualElement/index.js +1 -5
  87. package/dist/Editor/common/RnD/index.js +3 -4
  88. package/dist/Editor/common/Section/index.js +3 -3
  89. package/dist/Editor/common/Section/styles.js +1 -5
  90. package/dist/Editor/common/Shorthands/elements.js +1 -13
  91. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -2
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -9
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -35
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +2 -15
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +1 -2
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +0 -2
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  100. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +11 -11
  101. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +6 -22
  102. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -21
  103. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -20
  104. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -12
  105. package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
  106. package/dist/Editor/common/StyleBuilder/index.js +20 -101
  107. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  108. package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
  109. package/dist/Editor/common/SwipeableDrawer/style.js +4 -15
  110. package/dist/Editor/common/ToolbarIcon.js +1 -1
  111. package/dist/Editor/common/Uploader.js +36 -46
  112. package/dist/Editor/common/iconListV2.js +74 -598
  113. package/dist/Editor/common/iconslist.js +19 -25
  114. package/dist/Editor/commonStyle.js +15 -421
  115. package/dist/Editor/helper/deserialize/index.js +2 -31
  116. package/dist/Editor/helper/index.js +4 -17
  117. package/dist/Editor/helper/theme.js +2 -39
  118. package/dist/Editor/hooks/useBreakpoints.js +1 -1
  119. package/dist/Editor/hooks/useMouseMove.js +2 -5
  120. package/dist/Editor/plugins/withCustomDeleteBackward.js +104 -100
  121. package/dist/Editor/plugins/withEmbeds.js +26 -30
  122. package/dist/Editor/plugins/withHTML.js +12 -100
  123. package/dist/Editor/plugins/withLayout.js +0 -1
  124. package/dist/Editor/utils/SlateUtilityFunctions.js +12 -39
  125. package/dist/Editor/utils/brains.js +1 -1
  126. package/dist/Editor/utils/button.js +4 -4
  127. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +6 -75
  128. package/dist/Editor/utils/customHooks/useResize.js +4 -7
  129. package/dist/Editor/utils/customHooks/useTableResize.js +2 -6
  130. package/dist/Editor/utils/embed.js +1 -2
  131. package/dist/Editor/utils/events.js +1 -0
  132. package/dist/Editor/utils/font.js +4 -11
  133. package/dist/Editor/utils/formfield.js +4 -8
  134. package/dist/Editor/utils/helper.js +2 -103
  135. package/dist/Editor/utils/insertNewLine.js +1 -19
  136. package/dist/Editor/utils/pageSettings.js +2 -14
  137. package/dist/Editor/utils/serializeToText.js +0 -2
  138. package/dist/Editor/utils/table.js +24 -228
  139. package/package.json +2 -2
  140. package/dist/Editor/Elements/DataView/DataView.js +0 -124
  141. package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
  142. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -83
  143. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -33
  144. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -180
  145. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -62
  146. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -68
  147. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -35
  148. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -39
  149. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
  150. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
  151. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
  152. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
  153. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
  154. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
  155. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
  156. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -86
  157. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -71
  158. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -138
  159. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -213
  160. package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
  161. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
  162. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -44
  163. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -146
  164. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -79
  165. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -57
  166. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
  167. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -174
  168. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -241
  169. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -45
  170. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -32
  171. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
  172. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -217
  173. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -131
  174. package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -253
  175. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -85
  176. package/dist/Editor/Elements/DataView/Layouts/colStyles.js +0 -10
  177. package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
  178. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -277
  179. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
  180. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -88
  181. package/dist/Editor/Elements/DataView/styles.js +0 -169
  182. package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
  183. package/dist/Editor/Elements/Table/DragButton.js +0 -142
  184. package/dist/Editor/Elements/Table/DragStyles.js +0 -70
  185. package/dist/Editor/Elements/Table/Draggable.js +0 -25
  186. package/dist/Editor/Elements/Table/Droppable.js +0 -53
  187. package/dist/Editor/Elements/Table/TableTool.js +0 -101
  188. package/dist/Editor/Elements/Table/tableHelper.js +0 -71
  189. package/dist/Editor/assets/svg/ArrowDownIcon.js +0 -25
  190. package/dist/Editor/assets/svg/ArrowUpIcon.js +0 -25
  191. package/dist/Editor/assets/svg/CalenderIconTick.js +0 -64
  192. package/dist/Editor/assets/svg/ChervDown.js +0 -18
  193. package/dist/Editor/assets/svg/ChervUp.js +0 -18
  194. package/dist/Editor/assets/svg/DataTableIcon.js +0 -50
  195. package/dist/Editor/assets/svg/DuplicateIcon.js +0 -23
  196. package/dist/Editor/assets/svg/EyeIcon.js +0 -23
  197. package/dist/Editor/assets/svg/EyeSlash.js +0 -43
  198. package/dist/Editor/assets/svg/HashtagIcon.js +0 -33
  199. package/dist/Editor/assets/svg/PlusIcon.js +0 -23
  200. package/dist/Editor/assets/svg/SelectRoundedIcon.js +0 -24
  201. package/dist/Editor/assets/svg/SortByIcon.js +0 -33
  202. package/dist/Editor/assets/svg/TableIcons.js +0 -220
  203. package/dist/Editor/assets/svg/TickOutlined.js +0 -23
  204. package/dist/Editor/assets/svg/TrashCanIcon.js +0 -38
  205. package/dist/Editor/common/Select/index.js +0 -20
  206. package/dist/Editor/common/Select/styles.js +0 -17
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  208. package/dist/Editor/helper/enforceDateFormat.js +0 -41
  209. package/dist/Editor/hooks/useTable.js +0 -210
  210. package/dist/Editor/utils/dataView.js +0 -43
@@ -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;
@@ -1,29 +0,0 @@
1
- import React from "react";
2
- import { Box } from "@mui/material";
3
- import SimpleSelect from "../../DataTypes/Components/SimpleSelect";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- const ChooseField = props => {
6
- const {
7
- sort,
8
- properties,
9
- onChange
10
- } = props;
11
- const handleChange = e => {
12
- onChange(sort, {
13
- newKey: e?.target?.value
14
- });
15
- };
16
- return /*#__PURE__*/_jsx(Box, {
17
- sx: {
18
- width: "120px",
19
- mr: 1
20
- },
21
- className: "tv-cf",
22
- children: /*#__PURE__*/_jsx(SimpleSelect, {
23
- value: sort?.key,
24
- options: properties,
25
- handleChange: handleChange
26
- })
27
- });
28
- };
29
- export default ChooseField;
@@ -1,38 +0,0 @@
1
- import React from "react";
2
- import { Box } from "@mui/material";
3
- import SimpleSelect from "../../DataTypes/Components/SimpleSelect";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- const SORT_LABELS = {
6
- asc: "Ascending",
7
- desc: "Descending"
8
- };
9
- const SORT_OPTIONS = [{
10
- key: "asc",
11
- label: SORT_LABELS.asc
12
- }, {
13
- key: "desc",
14
- label: SORT_LABELS.desc
15
- }];
16
- const ChooseSort = props => {
17
- const {
18
- sort,
19
- onChange
20
- } = props;
21
- const handleChange = e => {
22
- onChange(sort, {
23
- operator: e?.target?.value
24
- });
25
- };
26
- return /*#__PURE__*/_jsx(Box, {
27
- sx: {
28
- width: "120px"
29
- },
30
- className: "tv-cf",
31
- children: /*#__PURE__*/_jsx(SimpleSelect, {
32
- value: sort?.operator,
33
- options: SORT_OPTIONS,
34
- handleChange: handleChange
35
- })
36
- });
37
- };
38
- export default ChooseSort;
@@ -1,86 +0,0 @@
1
- import React from "react";
2
- import { Box, List, ListItem, ListItemButton, ListItemIcon, ListItemText } from "@mui/material";
3
- import { useDataView } from "../../../Providers/DataViewProvider";
4
- import ChooseSort from "./ChooseSort";
5
- import ChooseField from "./ChooseField";
6
- import ColumnsList from "../../Options/ColumnsList";
7
- import Icon from "../../../../../common/Icon";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const SortOptions = props => {
11
- const {
12
- onClose
13
- } = props;
14
- const {
15
- properties,
16
- sort,
17
- onUpdateSort
18
- } = useDataView();
19
- const handleSortChange = (currentSortData, data = {}) => {
20
- onUpdateSort({
21
- ...currentSortData,
22
- ...data
23
- });
24
- };
25
- const handleDelete = () => {
26
- onClose();
27
- onUpdateSort({}, false, true);
28
- };
29
- const onSelect = s => () => {
30
- onUpdateSort({
31
- ...s,
32
- newKey: s.key,
33
- operator: "asc"
34
- }, false, false);
35
- onClose();
36
- };
37
- return sort?.length > 0 ? /*#__PURE__*/_jsxs(List, {
38
- className: "tv-opt-list",
39
- sx: {
40
- padding: '0px !important'
41
- },
42
- children: [sort?.map((m, i) => {
43
- return /*#__PURE__*/_jsx(ListItem, {
44
- sx: {
45
- justifyContent: "space-between",
46
- paddingLeft: 0,
47
- paddingRight: 0
48
- },
49
- children: /*#__PURE__*/_jsxs(Box, {
50
- sx: {
51
- display: "flex",
52
- padding: 0
53
- },
54
- children: [/*#__PURE__*/_jsx(ChooseField, {
55
- sort: m,
56
- properties: properties,
57
- onChange: handleSortChange
58
- }), /*#__PURE__*/_jsx(ChooseSort, {
59
- sort: m,
60
- onChange: handleSortChange
61
- })]
62
- })
63
- }, i);
64
- }), /*#__PURE__*/_jsxs(ListItemButton, {
65
- onClick: handleDelete,
66
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
67
- sx: {
68
- minWidth: '25px !important',
69
- '& svg': {
70
- background: 'transparent !important',
71
- padding: '0 !important'
72
- }
73
- },
74
- children: /*#__PURE__*/_jsx(Icon, {
75
- icon: 'trashIcon'
76
- })
77
- }), /*#__PURE__*/_jsx(ListItemText, {
78
- children: "Delete Sort"
79
- })]
80
- })]
81
- }) : /*#__PURE__*/_jsx(ColumnsList, {
82
- properties: properties,
83
- onSelect: onSelect
84
- });
85
- };
86
- export default SortOptions;