pixel-react 1.4.2 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/AddResourceButton/type.d.ts +1 -1
  3. package/lib/components/Drawer/Types.d.ts +4 -0
  4. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.d.ts +13 -0
  5. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +0 -13
  6. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +29 -1
  7. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +3 -9
  8. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +2 -10
  9. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +0 -1
  10. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +27 -2
  11. package/lib/components/Form/Forms.d.ts +4 -2
  12. package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
  13. package/lib/components/MenuOption/MenuOption.d.ts +1 -1
  14. package/lib/components/MenuOption/types.d.ts +49 -15
  15. package/lib/components/MiniModal/types.d.ts +1 -1
  16. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  17. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +4 -5
  18. package/lib/components/MultiSelect/dropdownTypes.d.ts +2 -0
  19. package/lib/components/RadioButton/RadioButton.d.ts +1 -0
  20. package/lib/components/RadioButton/radioButtonTypes.d.ts +3 -1
  21. package/lib/components/Select/components/types.d.ts +4 -2
  22. package/lib/components/Table/Table.d.ts +1 -1
  23. package/lib/components/ToggleSwitch/ToggleSwitch.d.ts +10 -0
  24. package/lib/components/ToggleSwitch/index.d.ts +1 -0
  25. package/lib/index.d.ts +110 -24
  26. package/lib/index.esm.js +5732 -648
  27. package/lib/index.esm.js.map +1 -1
  28. package/lib/index.js +5728 -642
  29. package/lib/index.js.map +1 -1
  30. package/lib/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +11 -11
  32. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
  33. package/src/assets/Themes/BaseTheme.scss +17 -23
  34. package/src/assets/Themes/DarkTheme.scss +25 -38
  35. package/src/assets/icons/apk_file_type.svg +4 -0
  36. package/src/assets/icons/compressed_file_type.svg +4 -0
  37. package/src/assets/icons/csv_file_type.svg +4 -0
  38. package/src/assets/icons/excel_corner_menu.svg +3 -0
  39. package/src/assets/icons/formula_icon.svg +3 -0
  40. package/src/assets/icons/gif_file_type.svg +4 -0
  41. package/src/assets/icons/html_file_type.svg +4 -0
  42. package/src/assets/icons/ipk_file_type.svg +4 -0
  43. package/src/assets/icons/jpg_file_type.svg +4 -0
  44. package/src/assets/icons/json_file_type.svg +4 -0
  45. package/src/assets/icons/pdf_file_type.svg +4 -0
  46. package/src/assets/icons/png_file_type.svg +4 -0
  47. package/src/assets/icons/quick_run_setting_icon.svg +5 -0
  48. package/src/assets/icons/run_automation_scripts_icon.svg +33 -0
  49. package/src/assets/icons/run_manual_testcase_icon.svg +4 -0
  50. package/src/assets/icons/search.svg +2 -2
  51. package/src/assets/icons/txt_file_type.svg +4 -0
  52. package/src/assets/icons/xls_file_type.svg +4 -0
  53. package/src/assets/icons/xlsx_file_type.svg +4 -0
  54. package/src/assets/icons/xml_file_type.svg +4 -0
  55. package/src/assets/styles/_fonts.scss +32 -2
  56. package/src/components/AddResourceButton/AddButton.tsx +7 -7
  57. package/src/components/AddResourceButton/type.ts +1 -1
  58. package/src/components/AttachmentButton/AttachmentButton.scss +1 -1
  59. package/src/components/AttachmentButton/AttachmentButton.stories.tsx +1 -0
  60. package/src/components/Button/Button.scss +22 -20
  61. package/src/components/Button/Button.tsx +8 -1
  62. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -2
  63. package/src/components/Drawer/Drawer.scss +4 -3
  64. package/src/components/Drawer/Drawer.tsx +14 -18
  65. package/src/components/Drawer/Types.ts +4 -0
  66. package/src/components/Editor/Editor.tsx +9 -11
  67. package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.scss +39 -0
  68. package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.tsx +51 -0
  69. package/src/components/Excel/ExcelFile/ExcelFile.tsx +7 -8
  70. package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +35 -0
  71. package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +44 -7
  72. package/src/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.tsx +8 -1
  73. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +45 -6
  74. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +37 -2
  75. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +69 -24
  76. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +59 -0
  77. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.ts +18 -65
  78. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.ts +5 -110
  79. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.ts +0 -2
  80. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +105 -1
  81. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +670 -673
  82. package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +38 -2
  83. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +0 -4
  84. package/src/components/FileDropzone/FileDropzone.scss +4 -2
  85. package/src/components/FileDropzone/FileDropzone.tsx +1 -1
  86. package/src/components/FileDropzone/FilePreview.tsx +3 -1
  87. package/src/components/Form/Form.scss +2 -0
  88. package/src/components/Form/Form.stories.tsx +195 -6
  89. package/src/components/Form/Forms.tsx +15 -8
  90. package/src/components/Icon/iconList.ts +46 -0
  91. package/src/components/IconRadioGroup/IconRadioGroup.scss +3 -0
  92. package/src/components/IconRadioGroup/IconRadioGroup.tsx +20 -17
  93. package/src/components/Input/Input.scss +14 -15
  94. package/src/components/Input/Input.stories.tsx +2 -1
  95. package/src/components/InputWithDropdown/InputWithDropdown.scss +12 -13
  96. package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +3 -2
  97. package/src/components/InputWithDropdown/InputWithDropdown.tsx +22 -19
  98. package/src/components/MenuOption/MenuOption.scss +11 -10
  99. package/src/components/MenuOption/MenuOption.stories.tsx +51 -232
  100. package/src/components/MenuOption/MenuOption.tsx +131 -52
  101. package/src/components/MenuOption/types.ts +55 -14
  102. package/src/components/MiniModal/MiniModal.stories.tsx +7 -6
  103. package/src/components/MiniModal/MiniModal.tsx +29 -23
  104. package/src/components/MiniModal/types.ts +1 -1
  105. package/src/components/MultiSelect/Dropdown.tsx +11 -12
  106. package/src/components/MultiSelect/MultiSelect.scss +1 -0
  107. package/src/components/MultiSelect/MultiSelect.stories.tsx +45 -10
  108. package/src/components/MultiSelect/MultiSelect.tsx +29 -13
  109. package/src/components/MultiSelect/MultiSelectTypes.ts +7 -5
  110. package/src/components/MultiSelect/dropdownTypes.ts +2 -0
  111. package/src/components/RadioButton/RadioButton.scss +3 -1
  112. package/src/components/RadioButton/RadioButton.tsx +3 -1
  113. package/src/components/RadioButton/radioButtonTypes.tsx +5 -1
  114. package/src/components/Search/Search.scss +25 -6
  115. package/src/components/Search/Search.tsx +45 -24
  116. package/src/components/Select/Select.scss +12 -12
  117. package/src/components/Select/Select.stories.tsx +2 -0
  118. package/src/components/Select/Select.tsx +11 -5
  119. package/src/components/Select/components/Dropdown.scss +2 -0
  120. package/src/components/Select/components/Dropdown.tsx +19 -4
  121. package/src/components/Select/components/types.ts +4 -2
  122. package/src/components/StatusButton/StatusButton.tsx +26 -20
  123. package/src/components/Table/Table.scss +1 -3
  124. package/src/components/Table/Table.stories.tsx +1 -0
  125. package/src/components/Table/Table.tsx +7 -3
  126. package/src/components/ToggleSwitch/ToggleSwitch.scss +59 -0
  127. package/src/components/ToggleSwitch/ToggleSwitch.stories.tsx +52 -0
  128. package/src/components/ToggleSwitch/ToggleSwitch.tsx +30 -0
  129. package/src/components/ToggleSwitch/index.ts +1 -0
  130. package/src/components/Typography/Typography.scss +32 -2
  131. package/src/hooks/useFileDropzone.tsx +1 -0
  132. package/src/index.ts +4 -2
  133. package/src/components/Excel/ContextMenu/ContextMenu.scss +0 -99
  134. package/src/components/Excel/ContextMenu/ContextMenu.tsx +0 -103
@@ -13,6 +13,7 @@
13
13
  &::-webkit-scrollbar {
14
14
  width: 4px;
15
15
  height: 12px;
16
+
16
17
  &-thumb {
17
18
  background-color: var(--ff-select-scroll-thumb-color);
18
19
  border-radius: 4px;
@@ -34,6 +35,7 @@
34
35
  text-overflow: ellipsis;
35
36
  overflow: hidden;
36
37
 
38
+ &__selected,
37
39
  &:hover {
38
40
  background-color: var(--ff-select-option-hover-color);
39
41
  }
@@ -1,4 +1,4 @@
1
- import { useContext, useRef, type FC } from 'react';
1
+ import { type FC, useContext, useRef } from 'react';
2
2
  import { dropdownDefaultCSSData, DropdownProps } from './types';
3
3
  import './Dropdown.scss';
4
4
  import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
@@ -6,7 +6,10 @@ import Typography from '../../Typography';
6
6
  import { ffid } from '../../../utils/ffID/ffid';
7
7
  import { ThemeContext } from '../../ThemeProvider/ThemeProvider';
8
8
  import classNames from 'classnames';
9
- import { getLabel } from '../../../utils/getSelectOptionValue/getSelectOptionValue';
9
+ import {
10
+ getLabel,
11
+ getValue,
12
+ } from '../../../utils/getSelectOptionValue/getSelectOptionValue';
10
13
  import useClickOutside from '../../../hooks/useClickOutside';
11
14
 
12
15
  const Dropdown: FC<DropdownProps> = ({
@@ -19,6 +22,8 @@ const Dropdown: FC<DropdownProps> = ({
19
22
  inputRef,
20
23
  selectArrowRef,
21
24
  heightFromTop,
25
+ selectedOption,
26
+ valueAccessor,
22
27
  }) => {
23
28
  const themeContext = useContext(ThemeContext);
24
29
  const currentTheme = themeContext?.currentTheme;
@@ -72,9 +77,19 @@ const Dropdown: FC<DropdownProps> = ({
72
77
  key={ffid()}
73
78
  as="div"
74
79
  lineHeight="30px"
75
- className={classNames('ff-select-dropdown-option', currentTheme)}
80
+ className={classNames(
81
+ 'ff-select-dropdown-option',
82
+ {
83
+ 'ff-select-dropdown-option__selected':
84
+ getValue(option, valueAccessor) === selectedOption,
85
+ },
86
+ currentTheme
87
+ )}
76
88
  color="var(--ff-select-text-color)"
77
- onClick={() => onSelectOptionSelector(option)}
89
+ onClick={() => {
90
+ if ('disable' in option && option['disable']) return;
91
+ onSelectOptionSelector(option);
92
+ }}
78
93
  >
79
94
  {getLabel(option, labelAccessor)}
80
95
  </Typography>
@@ -1,4 +1,5 @@
1
1
  import { DrowdownPosition, Option } from '../types';
2
+ import { RefObject } from 'react';
2
3
 
3
4
  export interface DropdownProps {
4
5
  options: Option[];
@@ -8,9 +9,10 @@ export interface DropdownProps {
8
9
  valueAccessor?: string;
9
10
  onSelectBlur: () => void;
10
11
  onSelectOptionSelector: (option: Option) => void;
11
- inputRef?: React.RefObject<HTMLInputElement>;
12
- selectArrowRef?: React.RefObject<HTMLDivElement>;
12
+ inputRef?: RefObject<HTMLInputElement>;
13
+ selectArrowRef?: RefObject<HTMLDivElement>;
13
14
  heightFromTop: number;
15
+ selectedOption?: Option;
14
16
  }
15
17
 
16
18
  export const dropdownDefaultCSSData = {
@@ -2,6 +2,7 @@ import classNames from 'classnames';
2
2
  import './StatusButton.scss';
3
3
  import { StatusButtonProps } from './types';
4
4
  import Typography from '../Typography';
5
+ import Tooltip from '../Tooltip';
5
6
 
6
7
  const StatusButton = ({
7
8
  status = 'passed',
@@ -12,28 +13,33 @@ const StatusButton = ({
12
13
  disabled = false,
13
14
  ...props
14
15
  }: StatusButtonProps) => {
16
+ const hasTooltip =
17
+ status === 'partially-executed' || status === 'not-executed';
18
+
15
19
  return (
16
- <button
17
- className={classNames(
18
- 'ff-status-button',
19
- `ff-status-button--${status}`,
20
- className
21
- )}
22
- style={style}
23
- onClick={onClick}
24
- disabled={disabled}
25
- {...props}
26
- >
27
- <Typography
28
- as="div"
29
- fontWeight="semi-bold"
30
- lineHeight="16px"
31
- textAlign="center"
32
- className="ff-status-button__text"
20
+ <Tooltip title={hasTooltip ? label : ''} placement="bottom">
21
+ <button
22
+ className={classNames(
23
+ 'ff-status-button',
24
+ `ff-status-button--${status}`,
25
+ className
26
+ )}
27
+ style={style}
28
+ onClick={onClick}
29
+ disabled={disabled}
30
+ {...props}
33
31
  >
34
- {label}
35
- </Typography>
36
- </button>
32
+ <Typography
33
+ as="div"
34
+ fontWeight="semi-bold"
35
+ lineHeight="16px"
36
+ textAlign="center"
37
+ className="ff-status-button__text"
38
+ >
39
+ {label}
40
+ </Typography>
41
+ </button>
42
+ </Tooltip>
37
43
  );
38
44
  };
39
45
 
@@ -1,4 +1,4 @@
1
- @use '../../assets/styles/_fonts';
1
+
2
2
 
3
3
  .ff-fixed-header-table {
4
4
  overflow-y: auto;
@@ -22,7 +22,6 @@
22
22
  thead {
23
23
  tr {
24
24
  th {
25
- @extend .fontMd;
26
25
  border-bottom: 1px solid var(--slider-table-color);
27
26
  }
28
27
  th{
@@ -60,7 +59,6 @@
60
59
  td {
61
60
  position: relative;
62
61
  color: var(--table-column-text-color);
63
- @extend .fontSm;
64
62
 
65
63
  &.clickable-cell {
66
64
  cursor: pointer;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { useEffect, useState } from 'react';
2
3
  import { StoryObj, Meta } from '@storybook/react';
3
4
  import Table from './Table';
@@ -48,7 +48,6 @@ const Table = ({
48
48
  onSelect(e, item);
49
49
  }
50
50
  };
51
- if (!(data.length >= 0)) return null;
52
51
 
53
52
  return (
54
53
  <div
@@ -88,7 +87,12 @@ const Table = ({
88
87
  key={column.header}
89
88
  style={{ width: column?.width }}
90
89
  >
91
- <div className="ff-label-checkbox-container">
90
+ <Typography
91
+ as="div"
92
+ fontSize={12}
93
+ fontWeight="semi-bold"
94
+ className="ff-label-checkbox-container"
95
+ >
92
96
  {index === 0 && withCheckbox && (
93
97
  <span className="ff-table-checkbox">
94
98
  <Checkbox
@@ -105,7 +109,7 @@ const Table = ({
105
109
  )}
106
110
 
107
111
  {column.header}
108
- </div>
112
+ </Typography>
109
113
  </th>
110
114
  ))}
111
115
  </tr>
@@ -0,0 +1,59 @@
1
+ /* Container Styling */
2
+ .toggle-container {
3
+ display: flex;
4
+ background-color: var(--base-bg-color);
5
+ height: 24px;
6
+ border-radius: 6px;
7
+ padding: 4px 2px;
8
+ overflow: hidden;
9
+ width: fit-content;
10
+ box-shadow: 1px 1px 2px 0px var(--base-bg-color),
11
+ inset -1px -1px 2px var(--base-bg-color),
12
+ inset 1px -1px 2px var(--ff-toggle-switch-shadow-color),
13
+ inset -1px 2px 0px var(--ff-toggle-switch-shadow-color);
14
+ align-items: center;
15
+ justify-content: center;
16
+ gap: 4px;
17
+ }
18
+
19
+ /* Button Styling */
20
+ .toggle-button {
21
+ padding: 4px 2px;
22
+ font-size: 10px;
23
+ font-weight: 500;
24
+ border: none;
25
+ border-radius: 4px;
26
+ cursor: pointer;
27
+ background-color: var(--base-bg-color);
28
+ color: var(--ff-toggle-switch-off-color);
29
+ outline: none;
30
+ transition: all 0.3s ease;
31
+ min-width: 24px;
32
+ height: 20px;
33
+ text-align: center;
34
+ box-shadow:
35
+ inset 1px 1px 2px 0 var(--base-bg-color),
36
+ 1px 1px 3px 0 var(--ff-chips-blur-color),
37
+ -1px -1px 2px 0 var(--base-bg-color),
38
+ 1px -1px 2px 0 var(--ff-chips-blur-color),
39
+ -1px 1px 2px 0 var(--ff-chips-blur-color)
40
+ }
41
+
42
+ /* Active Button */
43
+ .toggle-button.active {
44
+ background-color: var(--ff-line-number-bg);
45
+ color: var(--base-bg-color);
46
+ box-shadow:
47
+ inset -1px -1px 2px 0 var(--ff-chips-blur-color),
48
+ 1px 1px 3px 0 var(--ff-chips-blur-color),
49
+ -1px -1px 2px 0 var(--base-bg-color),
50
+ -1px 1px 2px 0 var(--ff-chips-blur-color);
51
+ }
52
+
53
+ /* Button Hover Effect */
54
+ .toggle-button:hover {
55
+ background-color: var(--hover-color);
56
+ color: var(--brand-color);
57
+ }
58
+
59
+
@@ -0,0 +1,52 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import ToggleSwitch from "./ToggleSwitch";
3
+ import React, { useState } from "react";
4
+
5
+
6
+ const meta: Meta<typeof ToggleSwitch> = {
7
+ title: "Components/ToggleSwitch",
8
+ component: ToggleSwitch,
9
+ tags: ["autodocs"],
10
+ argTypes: {
11
+ selected: {
12
+ control: { type: "radio" },
13
+ options: ["Automation", "Manual"],
14
+ },
15
+ },
16
+ };
17
+
18
+ export default meta;
19
+
20
+ type Story = StoryObj<typeof ToggleSwitch>;
21
+
22
+ export const Default: Story = {
23
+ args: {
24
+ selected: "Automation",
25
+ firstButton: "Automation",
26
+ secondButton: "Manual",
27
+ handleClick: () => {},
28
+ },
29
+ };
30
+
31
+ export const Switch: Story = {
32
+ render: () => {
33
+ const ToggleSwitchWrapper = () => {
34
+ const [selected, setSelected] = useState<string>("Automation");
35
+
36
+ const handleChange = (selectedSwitch: string) => {
37
+ setSelected(selectedSwitch);
38
+ };
39
+
40
+ return (
41
+ <ToggleSwitch
42
+ selected={selected}
43
+ firstButton="Automation"
44
+ secondButton="Manual"
45
+ handleClick={handleChange}
46
+ />
47
+ );
48
+ };
49
+
50
+ return <ToggleSwitchWrapper />;
51
+ },
52
+ };
@@ -0,0 +1,30 @@
1
+ import React, { type JSX } from "react";
2
+ import "./ToggleSwitch.scss";
3
+
4
+ interface ToggleSwitchProps {
5
+ firstButton:string,
6
+ secondButton:string,
7
+ handleClick:(selected:string)=>void,
8
+ selected:string
9
+ }
10
+
11
+ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({ selected = "text",firstButton='File',secondButton='File',handleClick}):JSX.Element => {
12
+ return (
13
+ <div className="toggle-container">
14
+ <button
15
+ className={`toggle-button ${selected === firstButton ? "active" : ""}`}
16
+ onClick={() => handleClick(firstButton)}
17
+ >
18
+ {firstButton}
19
+ </button>
20
+ <button
21
+ className={`toggle-button ${selected === secondButton ? "active" : ""}`}
22
+ onClick={() => handleClick(secondButton)}
23
+ >
24
+ {secondButton}
25
+ </button>
26
+ </div>
27
+ );
28
+ };
29
+
30
+ export default ToggleSwitch;
@@ -0,0 +1 @@
1
+ export {default} from './ToggleSwitch'
@@ -1,10 +1,40 @@
1
- @import url('https://fonts.cdnfonts.com/css/poppins');
2
-
3
1
  @mixin fontPoppins($size: 16px) {
4
2
  font-family: 'Poppins';
5
3
  font-size: $size;
6
4
  }
7
5
 
6
+ @font-face {
7
+ font-family: 'Poppins';
8
+ font-weight: 400;
9
+ src:
10
+ local('Poppins-Regular'),
11
+ url(../../fonts/Poppins/Poppins-Regular.ttf) format('truetype');
12
+ }
13
+
14
+ @font-face {
15
+ font-family: 'Poppins';
16
+ font-weight: 500;
17
+ src:
18
+ local('Poppins-Medium'),
19
+ url(../../fonts/Poppins/Poppins-Medium.ttf) format('truetype');
20
+ }
21
+
22
+ @font-face {
23
+ font-family: 'Poppins';
24
+ font-weight: 600;
25
+ src:
26
+ local('Poppins-SemiBold'),
27
+ url(../../fonts/Poppins/Poppins-SemiBold.ttf) format('truetype');
28
+ }
29
+
30
+ @font-face {
31
+ font-family: 'Poppins';
32
+ font-weight: 700;
33
+ src:
34
+ local('Poppins-Bold'),
35
+ url(../../fonts/Poppins/Poppins-Bold.ttf) format('truetype');
36
+ }
37
+
8
38
  .ff-text {
9
39
  @include fontPoppins();
10
40
 
@@ -167,6 +167,7 @@ const useFileDropzone = (options: DropzoneOptions): DropzoneState => {
167
167
  ) => {
168
168
  event.preventDefault();
169
169
  event.stopPropagation();
170
+ setIsDragActive(false);
170
171
 
171
172
  const droppedFiles =
172
173
  'dataTransfer' in event
package/src/index.ts CHANGED
@@ -51,10 +51,11 @@ import MachineInputField from './components/MachineInputField';
51
51
  import SequentialConnectingBranch from './components/SequentialConnectingBranch';
52
52
  import AttachmentButton from './components/AttachmentButton';
53
53
  import { Toastify, toast } from './components/Toastify/Toastify';
54
+ import ToggleSwitch from './components/ToggleSwitch/ToggleSwitch';
54
55
 
55
56
  import LabelEditTextField from './components/LabelEditTextField';
56
57
  import EditTextField from './components/EditTextField';
57
- // import Excel from './components/Excel';
58
+ import Excel from './components/Excel';
58
59
  import ModuleChip from './components/ModulesChip/ModuleChip';
59
60
  import IconRadialChart from './components/Charts/IconRadialChart';
60
61
  import AttachImage from './components/AttachImage';
@@ -138,7 +139,7 @@ export {
138
139
  Editor,
139
140
  AttachmentButton,
140
141
  LabelEditTextField,
141
- // Excel,
142
+ Excel,
142
143
  IconRadioGroup,
143
144
  Toastify,
144
145
  toast,
@@ -151,6 +152,7 @@ export {
151
152
  StatusCard,
152
153
  EditTextField,
153
154
  AttachImage,
155
+ ToggleSwitch,
154
156
  // utils exports
155
157
  checkEmpty,
156
158
  getExtension,
@@ -1,99 +0,0 @@
1
- @use '../../assets/styles/fonts';
2
-
3
- .context-menu {
4
- position: absolute;
5
- z-index: 1;
6
- outline: none;
7
- background-color: var(--brand-color);
8
- border-radius: 5px;
9
- opacity: 1;
10
- padding: 16px 0;
11
- .menu-options {
12
- overflow: auto;
13
- min-height: 20px;
14
- max-height: 175px;
15
- min-width: 250px;
16
- opacity: 1;
17
- .options {
18
- cursor: pointer;
19
- display: flex;
20
- align-items: center;
21
- padding: 0 8px;
22
- line-height: 35px;
23
- gap: 16px;
24
- .sheet-context-menu {
25
- display: flex;
26
- align-items: center;
27
- justify-content: center;
28
- }
29
- &:hover {
30
- .options-label {
31
- background: var(--option-card-bg-color);
32
- }
33
- }
34
- }
35
- }
36
- }
37
-
38
- .ff-icon-label {
39
- display: flex;
40
- align-items: center;
41
- gap: 4px;
42
- .ff-menuicon-container {
43
- display: flex;
44
- justify-content: center;
45
- align-items: center;
46
- cursor: pointer;
47
- &:hover {
48
- background-color: var(--brand-color);
49
- }
50
- }
51
-
52
- .ff-menuicon-container-clicked {
53
- display: flex;
54
- justify-content: center;
55
- align-items: center;
56
- background-color: var(--brand-color);
57
- cursor: pointer;
58
- &:hover {
59
- background-color: var(--brand-color);
60
- }
61
- }
62
- }
63
-
64
- .ff-option-card {
65
- position: absolute;
66
- border: 1px solid var(--option-card-border-color);
67
- background: var(--option-card-bg-color);
68
- border-radius: 4px;
69
- margin: 2px;
70
- min-height: 32px;
71
- min-width: 111px;
72
- z-index: 100000;
73
- white-space: nowrap;
74
-
75
- .ff-options {
76
- @extend .fontSm;
77
- cursor: pointer;
78
- border-radius: 4px;
79
- display: flex;
80
- align-items: center;
81
- padding: 8px;
82
- line-height: 16px;
83
- gap: 8px;
84
- &:hover {
85
- background-color: var(--hover-color);
86
- }
87
- label {
88
- cursor: pointer;
89
- }
90
- }
91
-
92
- .ff-disable-option {
93
- opacity: 0.5;
94
- cursor: no-drop;
95
- label {
96
- cursor: no-drop;
97
- }
98
- }
99
- }
@@ -1,103 +0,0 @@
1
- import React from 'react';
2
- import './ContextMenu.scss';
3
- import Icon from '../../Icon';
4
-
5
- const ContextMenu: React.FC<ContextMenuProps> = ({
6
- customContext,
7
- contextAction,
8
- contextData,
9
- setContextData,
10
- }) => {
11
- const contextOptions: ContextOption[] = [
12
- {
13
- name: 'cell',
14
- value: customContext || [],
15
- },
16
- {
17
- name: 'row',
18
- value: [
19
- { name: 'Add Row', title: 'Add Row', action: contextAction.addRow },
20
- {
21
- name: 'Delete Row',
22
- title: 'Delete Row',
23
- action: contextAction.deleteRow,
24
- },
25
- ],
26
- },
27
- {
28
- name: 'column',
29
- value: [
30
- {
31
- name: 'Add Column',
32
- title: 'Add Column',
33
- action: contextAction.addColumn,
34
- },
35
- {
36
- name: 'Delete Column',
37
- title: 'Delete Column',
38
- action: contextAction.deleteColumn,
39
- },
40
- ],
41
- },
42
- {
43
- name: 'sheet_options',
44
- value: [
45
- {
46
- name: 'Add Sheet',
47
- title: (
48
- <span className="sheet-context-menu">
49
- <Icon name="plus_icon" /> Add
50
- Sheet
51
- </span>
52
- ),
53
- action: contextAction.addSheet,
54
- },
55
- {
56
- name: 'Delete Sheet',
57
- title: (
58
- <span className="sheet-context-menu">
59
- <Icon name="delete" /> Delete Sheet
60
- </span>
61
- ),
62
- action: contextAction.deleteSheet,
63
- },
64
- ],
65
- },
66
- ];
67
-
68
- return (
69
- contextData.visible &&
70
- contextOptions.some(
71
- (contextType) =>
72
- contextType.name === contextData.type && contextType.value.length > 0
73
- ) && (
74
- <div
75
- className="context-menu"
76
- style={{ top: contextData.y, left: contextData.x }}
77
- >
78
- <div className="menu-options">
79
- {contextOptions
80
- .filter((contextType) => contextType.name === contextData.type)
81
- .map((contextType) =>
82
- contextType.value.length > 0
83
- ? contextType.value.map((item) => (
84
- <div
85
- className="options"
86
- key={item.name}
87
- onClick={() => {
88
- item.action();
89
- setContextData((prev) => ({ ...prev, visible: false }));
90
- }}
91
- >
92
- <label className="options-label">{item.title}</label>
93
- </div>
94
- ))
95
- : null
96
- )}
97
- </div>
98
- </div>
99
- )
100
- );
101
- };
102
-
103
- export default ContextMenu;