@flozy/editor 5.1.3 → 5.1.4

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 (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,140 +0,0 @@
1
- import React from "react";
2
- import TextField from "@mui/material/TextField";
3
- import Autocomplete from "@mui/material/Autocomplete";
4
- import { Box, Chip, useTheme } from "@mui/material";
5
- import { useEditorContext } from "../../../../../hooks/useMouseMove";
6
- import useCompStyles from "./styles";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- const filter = (opt, params, selectedOpt) => {
9
- const selectedVals = selectedOpt?.map(m => m?.value);
10
- const fv = opt?.filter(f => !selectedVals.includes(f.value));
11
- if (params?.inputValue) {
12
- fv.filter(f => f?.value?.toLowerCase().indexOf(params?.inputValue?.toLowerCase()) >= 0);
13
- }
14
- return fv;
15
- };
16
- export default function Select(props) {
17
- const theme = useTheme();
18
- const {
19
- theme: appTheme
20
- } = useEditorContext();
21
- const classes = useCompStyles(theme, appTheme);
22
- const {
23
- value,
24
- onChange,
25
- options,
26
- multiple = false,
27
- limitTags = 2,
28
- placeholder = "",
29
- disabled = false
30
- } = props;
31
- return /*#__PURE__*/_jsx(Autocomplete, {
32
- disabled: disabled,
33
- className: "tv-ac-field",
34
- multiple: true,
35
- limitTags: limitTags,
36
- placeholder: placeholder,
37
- value: value || "",
38
- onChange: (event, newValue) => {
39
- const fv = [];
40
- newValue?.forEach(m => {
41
- if (multiple) {
42
- fv.push({
43
- value: m.inputValue || m.value
44
- });
45
- } else {
46
- fv[0] = {
47
- value: m.inputValue || m.value
48
- };
49
- }
50
- });
51
- onChange(fv);
52
- },
53
- filterOptions: (options, params) => {
54
- const filtered = filter(options, params, value);
55
-
56
- // const { inputValue } = params;
57
- // Suggest the creation of a new value
58
- // const isExisting = options.some(
59
- // (option) => inputValue?.toLowerCase() === option.value?.toLowerCase()
60
- // );
61
- // no need of new val now
62
- // if (inputValue !== "" && !isExisting) {
63
- // filtered.push({
64
- // inputValue,
65
- // value: `Add "${inputValue}"`,
66
- // });
67
- // }
68
-
69
- return filtered;
70
- },
71
- selectOnFocus: true,
72
- clearOnBlur: true,
73
- handleHomeEndKeys: true,
74
- options: options || [],
75
- getOptionLabel: option => {
76
- // Value selected with enter, right from the input
77
- if (typeof option === "string") {
78
- return option;
79
- }
80
- // Add "xxx" option created dynamically
81
- if (option.inputValue) {
82
- return option.inputValue;
83
- }
84
- // Regular option
85
- return option.value || "";
86
- },
87
- renderTags: (value, getTagProps) => {
88
- return /*#__PURE__*/_jsx(Box, {
89
- className: "tv-ms-tag-wrpr",
90
- children: value?.map((option, index) => {
91
- const {
92
- key,
93
- ...tagProps
94
- } = getTagProps({
95
- index
96
- }) || {};
97
- return option?.value ? /*#__PURE__*/_jsx(Chip, {
98
- variant: "outlined",
99
- label: option?.label || option?.value,
100
- ...tagProps,
101
- sx: {
102
- background: option?.color || "#CCC",
103
- border: "none"
104
- }
105
- }, key) : null;
106
- })
107
- });
108
- },
109
- renderOption: (props, option) => {
110
- const {
111
- key,
112
- ...optionProps
113
- } = props;
114
- return /*#__PURE__*/_jsx("li", {
115
- ...optionProps,
116
- children: /*#__PURE__*/_jsx(Chip, {
117
- label: option.label || option.value || "",
118
- sx: {
119
- backgroundColor: option.color || "#CCC"
120
- }
121
- })
122
- }, key);
123
- },
124
- freeSolo: true,
125
- size: "small",
126
- fullWidth: true,
127
- renderInput: params => {
128
- return /*#__PURE__*/_jsx(TextField, {
129
- size: "small",
130
- ...params,
131
- placeholder: placeholder
132
- });
133
- },
134
- slotProps: {
135
- paper: {
136
- sx: classes.autocomplete
137
- }
138
- }
139
- });
140
- }
@@ -1,40 +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 { jsx as _jsx } from "react/jsx-runtime";
6
- const SimpleSelect = props => {
7
- const theme = useTheme();
8
- const {
9
- theme: appTheme
10
- } = useEditorContext();
11
- const classes = useCompStyles(theme, appTheme);
12
- const {
13
- value,
14
- options,
15
- handleChange,
16
- disabled = false
17
- } = props;
18
- console.log(classes);
19
- return /*#__PURE__*/_jsx(Select, {
20
- disabled: disabled,
21
- value: value,
22
- onChange: handleChange,
23
- fullWidth: true,
24
- size: "small",
25
- MenuProps: {
26
- PaperProps: {
27
- sx: classes.simpleselect,
28
- className: "tv-cf-opt-wrpr"
29
- }
30
- },
31
- children: options?.map((m, i) => {
32
- return /*#__PURE__*/_jsx(MenuItem, {
33
- value: m.key,
34
- className: "tv-cf-opt-wrpr",
35
- children: m.label
36
- }, i);
37
- })
38
- });
39
- };
40
- export default SimpleSelect;
@@ -1,59 +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_primary,
6
- borderRadius: "8px",
7
- [theme.breakpoints.between("xs", "md")]: {},
8
- "& ul": {
9
- padding: "4px",
10
- "& li": {
11
- padding: "4px 6px",
12
- borderRadius: "8px",
13
- color: appTheme?.palette?.editor?.tv_text_primary,
14
- fontSize: "14px",
15
- marginTop: "4px",
16
- "&.Mui-selected": {
17
- background: appTheme?.palette?.editor?.tv_hover_bg,
18
- color: appTheme?.palette?.editor?.tv_hover_text,
19
- "&:hover": {
20
- background: appTheme?.palette?.editor?.tv_hover_bg,
21
- color: appTheme?.palette?.editor?.tv_hover_text
22
- }
23
- },
24
- "&:hover": {
25
- background: appTheme?.palette?.editor?.tv_hover_bg,
26
- color: appTheme?.palette?.editor?.tv_hover_text
27
- }
28
- }
29
- }
30
- },
31
- autocomplete: {
32
- border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
33
- background: appTheme?.palette?.editor?.tv_pop_bg,
34
- color: appTheme?.palette?.editor?.tv_text_primary,
35
- borderRadius: "8px",
36
- "& ul": {
37
- padding: "4px",
38
- "& .MuiAutocomplete-option": {
39
- padding: "4px 6px",
40
- borderRadius: "8px",
41
- color: appTheme?.palette?.editor?.tv_text_primary,
42
- fontSize: "14px",
43
- "&.Mui-selected": {
44
- background: appTheme?.palette?.editor?.tv_hover_bg,
45
- color: appTheme?.palette?.editor?.tv_hover_text,
46
- "&:hover": {
47
- background: appTheme?.palette?.editor?.tv_hover_bg,
48
- color: appTheme?.palette?.editor?.tv_hover_text
49
- }
50
- },
51
- "&:hover": {
52
- background: appTheme?.palette?.editor?.tv_hover_bg,
53
- color: appTheme?.palette?.editor?.tv_hover_text
54
- }
55
- }
56
- }
57
- }
58
- });
59
- export default useCompStyles;
@@ -1,26 +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
- const DateType = props => {
6
- const {
7
- rowIndex,
8
- property,
9
- value,
10
- readOnly
11
- } = props;
12
- const {
13
- onChange
14
- } = useDataView();
15
- const handleChange = date => {
16
- onChange(rowIndex, {
17
- [property]: date
18
- });
19
- };
20
- return /*#__PURE__*/_jsx(DatePicker, {
21
- disabled: readOnly,
22
- selected: value ? new Date(value) : "",
23
- onChange: handleChange
24
- });
25
- };
26
- export default DateType;
@@ -1,38 +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,
10
- options,
11
- label = "",
12
- readOnly
13
- } = props;
14
- const {
15
- onChange
16
- } = useDataView();
17
- const coloredValues = [...(value || [])]?.map(m => {
18
- return {
19
- ...m,
20
- color: options?.find(f => f.value === m.value)?.color || "#FFF"
21
- };
22
- });
23
- const handleChange = data => {
24
- onChange(rowIndex, {
25
- [property]: data?.filter(f => f?.value)
26
- });
27
- };
28
- return /*#__PURE__*/_jsx(Select, {
29
- value: coloredValues,
30
- onChange: handleChange,
31
- options: options,
32
- multiple: true,
33
- limitTags: 2,
34
- placeholder: label,
35
- disabled: readOnly
36
- });
37
- };
38
- 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
- console.log(users);
17
- const handleChange = data => {
18
- onChange(rowIndex, {
19
- [property]: data?.filter(f => f?.value)
20
- });
21
- };
22
- return /*#__PURE__*/_jsx(Select, {
23
- value: value || [],
24
- onChange: handleChange,
25
- options: users,
26
- multiple: false,
27
- disabled: readOnly
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,74 +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 DeleteIcon from "@mui/icons-material/Delete";
5
- import ChooseSort from "./ChooseSort";
6
- import ChooseField from "./ChooseField";
7
- import ColumnsList from "../../Options/ColumnsList";
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
- p: 0
41
- },
42
- children: [sort?.map((m, i) => {
43
- return /*#__PURE__*/_jsx(ListItem, {
44
- sx: {
45
- justifyContent: "space-between"
46
- },
47
- children: /*#__PURE__*/_jsxs(Box, {
48
- sx: {
49
- display: "flex"
50
- },
51
- children: [/*#__PURE__*/_jsx(ChooseField, {
52
- sort: m,
53
- properties: properties,
54
- onChange: handleSortChange
55
- }), /*#__PURE__*/_jsx(ChooseSort, {
56
- sort: m,
57
- onChange: handleSortChange
58
- })]
59
- })
60
- }, i);
61
- }), /*#__PURE__*/_jsxs(ListItemButton, {
62
- onClick: handleDelete,
63
- children: [/*#__PURE__*/_jsx(ListItemIcon, {
64
- children: /*#__PURE__*/_jsx(DeleteIcon, {})
65
- }), /*#__PURE__*/_jsx(ListItemText, {
66
- children: "Delete Sort"
67
- })]
68
- })]
69
- }) : /*#__PURE__*/_jsx(ColumnsList, {
70
- properties: properties,
71
- onSelect: onSelect
72
- });
73
- };
74
- export default SortOptions;
@@ -1,64 +0,0 @@
1
- import React from "react";
2
- import { Box, Popover, SwipeableDrawer, IconButton, useTheme } from "@mui/material";
3
- import CloseIcon from "@mui/icons-material/Close";
4
- import useFilterSortStyles from "./styles";
5
- import SortOptions from "./SortOptions";
6
- import { useEditorContext } from "../../../../hooks/useMouseMove";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
- const FilterSort = props => {
10
- const {
11
- theme: appTheme
12
- } = useEditorContext();
13
- const theme = useTheme();
14
- const {
15
- open,
16
- mode,
17
- anchorEl,
18
- onClose
19
- } = props;
20
- const classes = useFilterSortStyles(theme, appTheme);
21
- const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
22
- const PoperComponent = isMobile ? SwipeableDrawer : Popover;
23
- const renderMode = () => {
24
- if (mode?.type === "filter") {
25
- return "Filter Mode will be availbele soon";
26
- } else if (mode?.type === "sort") {
27
- return /*#__PURE__*/_jsx(SortOptions, {
28
- onClose: onClose
29
- });
30
- } else {
31
- return "Unknown Filter / Sort Mode";
32
- }
33
- };
34
- return /*#__PURE__*/_jsx(PoperComponent, {
35
- open: open,
36
- sx: classes.root,
37
- anchorEl: anchorEl,
38
- anchorOrigin: {
39
- vertical: "bottom",
40
- horizontal: "right"
41
- },
42
- transformOrigin: {
43
- vertical: "top",
44
- horizontal: "right"
45
- },
46
- onClose: onClose,
47
- anchor: "bottom",
48
- children: /*#__PURE__*/_jsxs(Box, {
49
- sx: classes.contentWrapper,
50
- children: [/*#__PURE__*/_jsxs(Box, {
51
- className: "fe-dv-ap-title",
52
- children: [/*#__PURE__*/_jsx("span", {
53
- children: "Sort By"
54
- }), /*#__PURE__*/_jsx(IconButton, {
55
- className: "tv-act-ico bg",
56
- size: "small",
57
- onClick: onClose,
58
- children: /*#__PURE__*/_jsx(CloseIcon, {})
59
- })]
60
- }), renderMode()]
61
- })
62
- });
63
- };
64
- export default FilterSort;