pixel-react 1.2.7 → 1.2.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 (172) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/Drawer/Types.d.ts +23 -12
  3. package/lib/components/{ExcelFile → Excel}/ExcelFile/ExcelFile.d.ts +1 -0
  4. package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.d.ts +39 -10
  5. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.d.ts +4 -0
  6. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +40 -0
  7. package/lib/components/{ExcelFile → Excel}/ExcelToolBar/ExcelToolBar.d.ts +7 -3
  8. package/lib/components/MenuOption/MenuOption.d.ts +1 -1
  9. package/lib/components/MenuOption/types.d.ts +4 -0
  10. package/lib/components/Select/Select.stories.d.ts +1 -0
  11. package/lib/components/Toastify/Toastify.d.ts +5 -4
  12. package/lib/components/Toastify/types.d.ts +1 -0
  13. package/lib/index.d.ts +68 -18
  14. package/lib/index.esm.js +1512 -1089
  15. package/lib/index.esm.js.map +1 -1
  16. package/lib/index.js +1513 -1089
  17. package/lib/index.js.map +1 -1
  18. package/lib/tsconfig.tsbuildinfo +1 -1
  19. package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -0
  20. package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
  21. package/lib/utils/getSequentialPayload/types.d.ts +30 -0
  22. package/package.json +3 -3
  23. package/src/assets/Themes/BaseTheme.scss +4 -0
  24. package/src/assets/icons/maximize_icon.svg +5 -0
  25. package/src/assets/styles/_fonts.scss +1 -1
  26. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +15 -6
  27. package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +0 -5
  28. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +20 -10
  29. package/src/components/Drawer/Drawer.scss +1 -0
  30. package/src/components/Drawer/Types.ts +24 -13
  31. package/src/components/Excel/ExcelFile/ExcelFile.scss +62 -0
  32. package/src/components/Excel/ExcelFile/ExcelFile.tsx +312 -0
  33. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.tsx +2 -2
  34. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.tsx +3 -3
  35. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.tsx +4 -4
  36. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.tsx +2 -2
  37. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.tsx +1 -1
  38. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.tsx +3 -3
  39. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.tsx +4 -4
  40. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.tsx +4 -4
  41. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.scss +26 -24
  42. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.tsx +13 -45
  43. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.tsx +1 -1
  44. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.ts +88 -20
  45. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +495 -0
  46. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +758 -0
  47. package/src/components/{ExcelFile → Excel}/ExcelFile.stories.tsx +45 -0
  48. package/src/components/Excel/ExcelToolBar/ExcelToolBar.scss +36 -0
  49. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +346 -0
  50. package/src/components/Form/Form.scss +54 -35
  51. package/src/components/Form/Form.stories.tsx +264 -225
  52. package/src/components/Icon/iconList.ts +2 -1
  53. package/src/components/Input/Input.tsx +0 -1
  54. package/src/components/MenuOption/MenuOption.scss +0 -1
  55. package/src/components/MenuOption/MenuOption.stories.tsx +3 -0
  56. package/src/components/MenuOption/MenuOption.tsx +5 -4
  57. package/src/components/MenuOption/types.ts +4 -0
  58. package/src/components/MultiSelect/MultiSelect.scss +5 -1
  59. package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
  60. package/src/components/MultiSelect/MultiSelect.tsx +27 -14
  61. package/src/components/Select/Select.stories.tsx +161 -18
  62. package/src/components/Select/Select.tsx +41 -33
  63. package/src/components/Table/Table.scss +6 -5
  64. package/src/components/Table/Table.stories.tsx +0 -9
  65. package/src/components/Table/Table.tsx +2 -2
  66. package/src/components/TableTree/TableTree.scss +1 -1
  67. package/src/components/TableTree/TableTree.tsx +3 -1
  68. package/src/components/Toastify/Toastify.stories.tsx +29 -10
  69. package/src/components/Toastify/Toastify.tsx +42 -16
  70. package/src/components/Toastify/types.ts +2 -0
  71. package/src/index.ts +4 -2
  72. package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +75 -0
  73. package/src/utils/getSequentialPayload/getSequentialPayload.ts +29 -0
  74. package/src/utils/getSequentialPayload/types.ts +35 -0
  75. package/lib/components/AddButton/AddButton.d.ts +0 -5
  76. package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
  77. package/lib/components/AddButton/index.d.ts +0 -1
  78. package/lib/components/AddButton/types.d.ts +0 -4
  79. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +0 -14
  80. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +0 -27
  81. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -12
  82. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +0 -24
  83. package/lib/utils/find/findAndInsert.d.ts +0 -7
  84. package/lib/utils/find/findAndInsert.stories.d.ts +0 -7
  85. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +0 -952
  86. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -24
  87. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +0 -162
  88. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +0 -16
  89. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +0 -68
  90. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -19
  91. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +0 -291
  92. package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
  93. package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  94. package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
  95. package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
  96. package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
  97. package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  98. package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  99. package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  100. package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  101. package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  102. package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
  103. package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
  104. package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  105. package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  106. package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  107. package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
  108. package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  109. /package/lib/components/{ExcelFile → Excel}/ColorBarSelector/ColorBarSelector.d.ts +0 -0
  110. /package/lib/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.d.ts +0 -0
  111. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.d.ts +0 -0
  112. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.d.ts +0 -0
  113. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.d.ts +0 -0
  114. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.d.ts +0 -0
  115. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.d.ts +0 -0
  116. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.d.ts +0 -0
  117. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.d.ts +0 -0
  118. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.d.ts +0 -0
  119. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.d.ts +0 -0
  120. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.d.ts +0 -0
  121. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.d.ts +0 -0
  122. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.d.ts +0 -0
  123. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.d.ts +0 -0
  124. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.d.ts +0 -0
  125. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.d.ts +0 -0
  126. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.d.ts +0 -0
  127. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.d.ts +0 -0
  128. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.d.ts +0 -0
  129. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.d.ts +0 -0
  130. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.d.ts +0 -0
  131. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.d.ts +0 -0
  132. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.d.ts +0 -0
  133. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.d.ts +0 -0
  134. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.d.ts +0 -0
  135. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.d.ts +0 -0
  136. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.d.ts +0 -0
  137. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.d.ts +0 -0
  138. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.d.ts +0 -0
  139. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.d.ts +0 -0
  140. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.d.ts +0 -0
  141. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.d.ts +0 -0
  142. /package/lib/components/{ExcelFile → Excel}/ExcelFile.stories.d.ts +0 -0
  143. /package/lib/components/{ExcelFile → Excel}/Types.d.ts +0 -0
  144. /package/lib/components/{ExcelFile → Excel}/index.d.ts +0 -0
  145. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.scss +0 -0
  146. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.tsx +0 -0
  147. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.scss +0 -0
  148. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.tsx +0 -0
  149. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.tsx +0 -0
  150. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.tsx +0 -0
  151. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.tsx +0 -0
  152. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.tsx +0 -0
  153. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.ts +0 -0
  154. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.ts +0 -0
  155. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.ts +0 -0
  156. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.ts +0 -0
  157. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.ts +0 -0
  158. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.ts +0 -0
  159. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.ts +0 -0
  160. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.ts +0 -0
  161. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.ts +0 -0
  162. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.ts +0 -0
  163. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.ts +0 -0
  164. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.ts +0 -0
  165. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.ts +0 -0
  166. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.ts +0 -0
  167. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/typings/fast-formula-parser.d.ts +0 -0
  168. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.ts +0 -0
  169. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.ts +0 -0
  170. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.ts +0 -0
  171. /package/src/components/{ExcelFile → Excel}/Types.ts +0 -0
  172. /package/src/components/{ExcelFile → Excel}/index.ts +0 -0
@@ -1,8 +1,12 @@
1
1
  import { useState, useRef } from 'react';
2
2
  import Toaster from '../Toast/Toast';
3
- import { Variant, ToastProps } from './types';
3
+ import { Variant, ToastProps, AcceptedType } from './types';
4
4
 
5
- let openToast: (variant: Variant, message: string) => void;
5
+ let openToast: (
6
+ variant: Variant,
7
+ arg1: AcceptedType,
8
+ arg2?: AcceptedType
9
+ ) => void;
6
10
 
7
11
  export const Toastify = () => {
8
12
  const [toastProps, setToastProps] = useState<ToastProps>({
@@ -14,28 +18,46 @@ export const Toastify = () => {
14
18
 
15
19
  const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
16
20
 
17
- openToast = (variant: Variant, message: string) => {
21
+ openToast = (variant: Variant, arg1: AcceptedType, arg2?: AcceptedType) => {
18
22
  // Clear the previous timeout if it exists
19
23
  if (timeoutRef.current) {
20
24
  clearTimeout(timeoutRef.current);
21
25
  timeoutRef.current = null;
22
26
  }
23
27
 
24
- const title =
25
- variant === 'danger'
26
- ? 'Error!'
27
- : variant.charAt(0).toUpperCase() + variant.slice(1);
28
+ // Set the title and message based on the arguments
29
+ let title = '';
30
+ let message = '';
31
+
32
+ // Function to format message
33
+ const formatMessage = (input: AcceptedType) => {
34
+ if (input && typeof input === 'object') {
35
+ return JSON.stringify(input, null, 2);
36
+ } else if (typeof input === 'function') {
37
+ return input.toString();
38
+ }
39
+ return String(input);
40
+ };
41
+
42
+ // If arg2 exists, use it as the message
43
+ if (arg2 !== undefined) {
44
+ title = formatMessage(arg1);
45
+ message = formatMessage(arg2);
46
+ } else {
47
+ title = formatMessage(arg1);
48
+ message = '';
49
+ }
50
+
51
+ const formattedTitle = title.charAt(0).toUpperCase() + title.slice(1);
52
+
28
53
  // Close the existing toast if open, and then immediately show the new one
29
- setToastProps((prev) => ({
30
- ...prev,
31
- isOpen: false,
32
- }));
54
+ setToastProps((prev) => ({ ...prev, isOpen: false }));
33
55
 
34
56
  setTimeout(() => {
35
57
  setToastProps({
36
58
  isOpen: true,
37
59
  variant,
38
- toastTitle: `${title}!`,
60
+ toastTitle: formattedTitle,
39
61
  toastMessage: message,
40
62
  });
41
63
  }, 10);
@@ -59,8 +81,12 @@ export default Toastify;
59
81
 
60
82
  // Utility to trigger toast messages outside of the Toastify component
61
83
  export const toast = {
62
- success: (message: string) => openToast('success', message),
63
- error: (message: string) => openToast('danger', message),
64
- warning: (message: string) => openToast('warning', message),
65
- info: (message: string) => openToast('info', message),
84
+ success: (arg1: AcceptedType, arg2?: AcceptedType) =>
85
+ openToast('success', arg1, arg2),
86
+ error: (arg1: AcceptedType, arg2?: AcceptedType) =>
87
+ openToast('danger', arg1, arg2),
88
+ warning: (arg1: AcceptedType, arg2?: AcceptedType) =>
89
+ openToast('warning', arg1, arg2),
90
+ info: (arg1: AcceptedType, arg2?: AcceptedType) =>
91
+ openToast('info', arg1, arg2),
66
92
  };
@@ -6,3 +6,5 @@ export interface ToastProps {
6
6
  toastTitle: string;
7
7
  toastMessage: string;
8
8
  }
9
+
10
+ export type AcceptedType = string | (() => void) | Record<string, unknown> | unknown[];
package/src/index.ts CHANGED
@@ -53,7 +53,7 @@ import AttachmentButton from './components/AttachmentButton';
53
53
  import { Toastify, toast } from './components/Toastify/Toastify';
54
54
 
55
55
  import LabelEditTextField from './components/LabelEditTextField';
56
- import ExcelFile from './components/ExcelFile';
56
+ import Excel from './components/Excel';
57
57
  import ModuleChip from './components/ModulesChip/ModuleChip';
58
58
 
59
59
  // Utils imports
@@ -70,6 +70,7 @@ import { compareObjects } from './utils/compareObjects/compareObjects';
70
70
  import { getEncryptedData } from './utils/getEncryptedData/getEncryptedData';
71
71
  import { throttle } from './utils/throttle/throttle';
72
72
  import { truncateText } from './utils/truncateText/truncateText';
73
+ import { getSequentialPayload } from './utils/getSequentialPayload/getSequentialPayload';
73
74
 
74
75
  export {
75
76
  Button,
@@ -126,7 +127,7 @@ export {
126
127
  SequentialConnectingBranch,
127
128
  AttachmentButton,
128
129
  LabelEditTextField,
129
- ExcelFile,
130
+ Excel,
130
131
  IconRadioGroup,
131
132
  Toastify,
132
133
  toast,
@@ -144,4 +145,5 @@ export {
144
145
  throttle,
145
146
  getEncryptedData,
146
147
  truncateText,
148
+ getSequentialPayload,
147
149
  };
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { getSequentialPayload } from './getSequentialPayload';
4
+ import {
5
+ SequentialMachineInstance,
6
+ MachineExecutionInstanceDataSet,
7
+ } from './types';
8
+ import { ffid } from '../ffID/ffid';
9
+
10
+ const SequentialPayloadComponent: React.FC<{
11
+ machineInstances: MachineExecutionInstanceDataSet[];
12
+ }> = ({ machineInstances }) => {
13
+ const payload: SequentialMachineInstance[] =
14
+ getSequentialPayload(machineInstances);
15
+
16
+ return (
17
+ <div>
18
+ <h3>Converted Payload</h3>
19
+ <pre>{JSON.stringify(payload, null, 2)}</pre>
20
+ </div>
21
+ );
22
+ };
23
+
24
+ const meta: Meta<typeof SequentialPayloadComponent> = {
25
+ title: 'Utils/getSequentialPayload',
26
+ component: SequentialPayloadComponent,
27
+ parameters: {
28
+ layout: 'centered',
29
+ },
30
+ tags: ['autodocs'],
31
+ };
32
+
33
+ type Story = StoryObj<typeof SequentialPayloadComponent>;
34
+
35
+ export const Primary: Story = {
36
+ args: {
37
+ machineInstances: [
38
+ {
39
+ id: ffid(),
40
+ clientId: 'flinko-client-win-daa67320-d70c-438e-b417-62d76669e7a2',
41
+ numberOfRuns: '3',
42
+ executionEnv: 'Local',
43
+ browserName: 'Google Chrome',
44
+ browserVersion: '107.0.5304.88',
45
+ systemUrl: '',
46
+ machineInfo: {
47
+ osName: 'Windows 11 Home Single Language',
48
+ osVersion: '10.0.22000',
49
+ hostName: 'LAPTOP-T793RVQN',
50
+ },
51
+ deviceInfo: [],
52
+ headless: false,
53
+ runLevelExecutionDataSets: [
54
+ {
55
+ peVariableSetId: 'UUID',
56
+ globalVariableSetId: 'UUID',
57
+ testDataSetId: 'UUID',
58
+ },
59
+ {
60
+ peVariableSetId: 'UUID',
61
+ globalVariableSetId: 'UUID',
62
+ testDataSetId: 'UUID',
63
+ },
64
+ {
65
+ peVariableSetId: 'UUID',
66
+ globalVariableSetId: 'UUID',
67
+ testDataSetId: 'UUID',
68
+ },
69
+ ],
70
+ },
71
+ ],
72
+ },
73
+ };
74
+
75
+ export default meta;
@@ -0,0 +1,29 @@
1
+ import {
2
+ SequentialMachineInstance,
3
+ MachineExecutionInstanceDataSet,
4
+ } from './types';
5
+
6
+ export const getSequentialPayload = (
7
+ machineInstances: MachineExecutionInstanceDataSet[] = []
8
+ ): SequentialMachineInstance[] => {
9
+ return machineInstances.flatMap(
10
+ (machineInstance: MachineExecutionInstanceDataSet) =>
11
+ machineInstance.runLevelExecutionDataSets.map(
12
+ (runLevelExecutionDataSet) => ({
13
+ id: machineInstance.id,
14
+ clientId: machineInstance.clientId,
15
+ numberOfRuns: machineInstance.numberOfRuns,
16
+ executionEnv: machineInstance.executionEnv,
17
+ browserName: machineInstance.browserName,
18
+ browserVersion: machineInstance.browserVersion,
19
+ systemUrl: machineInstance.systemUrl,
20
+ machineInfo: machineInstance.machineInfo,
21
+ deviceInfo: machineInstance.deviceInfo,
22
+ headless: machineInstance.headless,
23
+ peVariableSetId: runLevelExecutionDataSet.peVariableSetId,
24
+ globalVariableSetId: runLevelExecutionDataSet.globalVariableSetId,
25
+ testDataSetId: runLevelExecutionDataSet.testDataSetId,
26
+ })
27
+ )
28
+ );
29
+ };
@@ -0,0 +1,35 @@
1
+ export interface OperatingSystemInfo {
2
+ osName: string;
3
+ osVersion: string;
4
+ hostName: string;
5
+ }
6
+
7
+ export interface RunLevelExecutionDataSet {
8
+ peVariableSetId: string;
9
+ globalVariableSetId: string;
10
+ testDataSetId: string;
11
+ }
12
+
13
+ export interface MachineExecutionInstance {
14
+ id: string;
15
+ clientId: string;
16
+ numberOfRuns: string | number;
17
+ executionEnv: string;
18
+ browserName: string;
19
+ browserVersion: string;
20
+ systemUrl: string;
21
+ machineInfo: OperatingSystemInfo;
22
+ deviceInfo: any[];
23
+ headless: boolean;
24
+ }
25
+
26
+ export interface MachineExecutionInstanceDataSet
27
+ extends MachineExecutionInstance {
28
+ runLevelExecutionDataSets: RunLevelExecutionDataSet[];
29
+ }
30
+
31
+ export interface SequentialMachineInstance extends MachineExecutionInstance {
32
+ peVariableSetId: string;
33
+ globalVariableSetId: string;
34
+ testDataSetId: string;
35
+ }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import './AddButton.scss';
3
- import { AddButtonProps } from './types';
4
- declare const AddButton: React.FC<AddButtonProps>;
5
- export default AddButton;
@@ -1,6 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import AddButton from './AddButton';
3
- declare const meta: Meta<typeof AddButton>;
4
- type Story = StoryObj<typeof AddButton>;
5
- export declare const PrimaryAddButton: Story;
6
- export default meta;
@@ -1 +0,0 @@
1
- export { default } from './AddButton';
@@ -1,4 +0,0 @@
1
- export interface AddButtonProps {
2
- name: string;
3
- onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
4
- }
@@ -1,14 +0,0 @@
1
- import { CellBase } from "./ExcelFile/Excel";
2
- interface ChangeExcelStylesOptions {
3
- sheetName: string;
4
- styleType: string;
5
- value: string;
6
- selectedCell: {
7
- row: number;
8
- column: number;
9
- }[];
10
- }
11
- export default function ChangeExcelStyles(setWorksheetsData: React.Dispatch<React.SetStateAction<{
12
- [key: string]: Matrix<CellBase>;
13
- }>>, options: ChangeExcelStylesOptions): void;
14
- export {};
@@ -1,27 +0,0 @@
1
- import * as Matrix from './matrix';
2
- import * as Types from './types';
3
- import * as Point from './point';
4
- import { Selection, RangeSelection, EntireColumnsSelection, EntireRowsSelection } from './selection';
5
- import * as Actions from './actions';
6
- export declare const INITIAL_STATE: Types.StoreState;
7
- export default function reducer(state: Types.StoreState, action: Actions.Action): Types.StoreState;
8
- export declare const go: (rowDelta: number, columnDelta: number) => KeyDownHandler;
9
- export type KeyDownHandler = (state: Types.StoreState, event: React.KeyboardEvent) => Types.StoreState | void;
10
- export declare enum Direction {
11
- Left = "Left",
12
- Right = "Right",
13
- Top = "Top",
14
- Bottom = "Bottom"
15
- }
16
- export declare function getKeyDownHandler(state: Types.StoreState, event: React.KeyboardEvent): KeyDownHandler | undefined;
17
- /** Returns whether the reducer has a handler for the given keydown event */
18
- export declare function hasKeyDownHandler(state: Types.StoreState, event: React.KeyboardEvent): boolean;
19
- /** Returns whether the active cell is read only */
20
- export declare function isActiveReadOnly(state: Types.StoreState): boolean;
21
- /** Gets active cell from given state */
22
- export declare function getActive(state: Types.StoreState): Types.CellBase | null;
23
- /** Modify given edge according to given active point and data */
24
- export declare function modifyEdge<T extends Selection>(selection: T, active: Point.Point | null, data: Matrix.Matrix<unknown>, direction: Direction): T;
25
- export declare function modifyRangeSelectionEdge(rangeSelection: RangeSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): RangeSelection;
26
- export declare function modifyEntireRowsSelection(selection: EntireRowsSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): EntireRowsSelection;
27
- export declare function modifyEntireColumnsSelection(selection: EntireColumnsSelection, active: Point.Point, data: Matrix.Matrix<unknown>, edge: Direction): EntireColumnsSelection;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- interface ExcelSheetBarProps {
3
- fileDetails: {
4
- sheetNames: string[];
5
- };
6
- handleSheetChange: (name: string, index: number) => void;
7
- selectedSheet: {
8
- name: string;
9
- };
10
- }
11
- declare const ExcelSheetBar: React.FC<ExcelSheetBarProps>;
12
- export default ExcelSheetBar;
@@ -1,24 +0,0 @@
1
- interface CellStyle {
2
- color?: string;
3
- backgroundColor?: string;
4
- bold?: boolean;
5
- italic?: boolean;
6
- name?: string;
7
- border: {
8
- top: string;
9
- bottom: string;
10
- left: string;
11
- right: string;
12
- };
13
- alignment: {
14
- horizontal?: string;
15
- vertical?: string;
16
- wrapText?: boolean;
17
- };
18
- }
19
- interface CellData {
20
- style?: CellStyle;
21
- }
22
- type ImportExcelStylesData = Array<Array<CellData>>;
23
- export default function ImportExcelStyles(data: ImportExcelStylesData | null): void;
24
- export {};
@@ -1,7 +0,0 @@
1
- export type AnyObject = {
2
- id: number;
3
- [key: string]: any;
4
- };
5
- export declare function findAndInsert<T extends AnyObject>(data: T[], key: keyof T, targetId: number, newEntry: T, insertPosition: 'above' | 'below' | 'replace', childrenKey?: string): {
6
- updatedArray: T[];
7
- } | null;
@@ -1,7 +0,0 @@
1
- import { findAndInsert } from './findAndInsert';
2
- declare const _default: {
3
- title: string;
4
- component: typeof findAndInsert;
5
- };
6
- export default _default;
7
- export declare const InteractivePlayground: () => import("react/jsx-runtime").JSX.Element;