pixel-react-excel-sheet 1.0.31 → 1.0.33

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 (138) hide show
  1. package/lib/components/Accordion/Accordion.d.ts +1 -1
  2. package/lib/components/Accordion/types.d.ts +4 -0
  3. package/lib/components/AllProjectsDropdown/types.d.ts +2 -0
  4. package/lib/components/Button/Button.d.ts +2 -2
  5. package/lib/components/Button/types.d.ts +17 -0
  6. package/lib/components/Charts/DashboardDonutChart/types.d.ts +2 -0
  7. package/lib/components/Charts/MultiRadialChart/types.d.ts +3 -0
  8. package/lib/components/ChooseFile/ChooseFile.d.ts +3 -0
  9. package/lib/components/ChooseFile/types.d.ts +68 -0
  10. package/lib/components/ConditionalDropdown/ConditionalDropdown.d.ts +1 -2
  11. package/lib/components/ConditionalDropdown/types.d.ts +4 -4
  12. package/lib/components/ConnectingBranch/ConnectingBranch.d.ts +2 -1
  13. package/lib/components/ConnectingBranch/data.d.ts +19 -33
  14. package/lib/components/ConnectingBranch/types.d.ts +10 -0
  15. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +7 -1
  16. package/lib/components/FileDropzone/types.d.ts +12 -4
  17. package/lib/components/LabelEditTextField/types.d.ts +3 -1
  18. package/lib/components/MachineInputField/MachineInputField.d.ts +4 -1
  19. package/lib/components/ScriptSwitchButton/ScriptSwitchButton.d.ts +9 -0
  20. package/lib/components/ScriptSwitchButton/index.d.ts +1 -0
  21. package/lib/components/Select/types.d.ts +1 -1
  22. package/lib/components/StatusCard/types.d.ts +2 -0
  23. package/lib/components/TableTree/Components/TableCell.d.ts +1 -1
  24. package/lib/components/TableTree/Components/TableRow.d.ts +1 -1
  25. package/lib/components/TableTree/data.d.ts +115 -1
  26. package/lib/components/TableTree/types.d.ts +4 -0
  27. package/lib/components/TextArea/Textarea.d.ts +1 -1
  28. package/lib/components/TextArea/Types.d.ts +1 -0
  29. package/lib/components/ThemeProvider/types.d.ts +1 -1
  30. package/lib/index.d.ts +250 -75
  31. package/lib/index.esm.js +863 -489
  32. package/lib/index.esm.js.map +1 -1
  33. package/lib/index.js +909 -488
  34. package/lib/index.js.map +1 -1
  35. package/lib/tsconfig.tsbuildinfo +1 -1
  36. package/lib/utils/validateFile/validateFile.d.ts +2 -0
  37. package/lib/validations/regex.d.ts +46 -0
  38. package/package.json +2 -2
  39. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +5 -0
  40. package/src/assets/Themes/BaseTheme.scss +2 -1
  41. package/src/assets/Themes/BlueTheme.scss +279 -0
  42. package/src/assets/Themes/DarkTheme.scss +2 -1
  43. package/src/assets/Themes/Theme.scss +5 -0
  44. package/src/assets/icons/failed_status_icon.svg +1 -1
  45. package/src/assets/icons/flaky_status_icon.svg +1 -1
  46. package/src/assets/icons/settings.svg +3 -0
  47. package/src/assets/icons/skipped_status_icon.svg +1 -1
  48. package/src/assets/icons/warning_status_icon.svg +1 -1
  49. package/src/components/Accordion/Accordion.stories.tsx +13 -0
  50. package/src/components/Accordion/Accordion.tsx +2 -1
  51. package/src/components/Accordion/types.ts +4 -0
  52. package/src/components/AllProjectsDropdown/types.ts +2 -0
  53. package/src/components/AppHeader/AppHeader.scss +6 -2
  54. package/src/components/AppHeader/AppHeader.tsx +4 -2
  55. package/src/components/Button/Button.scss +12 -0
  56. package/src/components/Button/Button.tsx +29 -11
  57. package/src/components/Button/types.ts +21 -0
  58. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.scss +83 -30
  59. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +3 -0
  60. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +39 -16
  61. package/src/components/Charts/DashboardDonutChart/types.ts +2 -0
  62. package/src/components/Charts/MultiRadialChart/MultiRadialChart.scss +0 -1
  63. package/src/components/Charts/MultiRadialChart/MultiRadialChart.stories.tsx +2 -1
  64. package/src/components/Charts/MultiRadialChart/MultiRadialChart.tsx +18 -4
  65. package/src/components/Charts/MultiRadialChart/types.ts +4 -1
  66. package/src/components/ChooseFile/ChooseFile.stories.tsx +190 -0
  67. package/src/components/ChooseFile/ChooseFile.tsx +46 -0
  68. package/src/components/ChooseFile/types.ts +78 -0
  69. package/src/components/ConditionalDropdown/ConditionalDropdown.stories.tsx +8 -5
  70. package/src/components/ConditionalDropdown/ConditionalDropdown.tsx +133 -135
  71. package/src/components/ConditionalDropdown/types.ts +8 -8
  72. package/src/components/ConnectingBranch/BranchComponents/MachineInstances.tsx +94 -79
  73. package/src/components/ConnectingBranch/ConnectingBranch.scss +183 -195
  74. package/src/components/ConnectingBranch/ConnectingBranch.stories.tsx +33 -1
  75. package/src/components/ConnectingBranch/ConnectingBranch.tsx +121 -107
  76. package/src/components/ConnectingBranch/{data.ts → data.tsx} +106 -17
  77. package/src/components/ConnectingBranch/types.ts +21 -0
  78. package/src/components/DatePicker/DatePicker.scss +310 -0
  79. package/src/components/Excel/ExcelFile/ExcelFile.tsx +4 -4
  80. package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +22 -10
  81. package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +2 -2
  82. package/src/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.tsx +4 -1
  83. package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +6 -1
  84. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +2 -2
  85. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +30 -11
  86. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +65 -19
  87. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +14 -0
  88. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +16 -0
  89. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +77 -10
  90. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +6 -5
  91. package/src/components/FileDropzone/Dropzone.tsx +3 -0
  92. package/src/components/FileDropzone/FileDropzone.scss +18 -0
  93. package/src/components/FileDropzone/FileDropzone.stories.tsx +75 -7
  94. package/src/components/FileDropzone/FileDropzone.tsx +2 -0
  95. package/src/components/FileDropzone/RadioFilePreview.tsx +7 -3
  96. package/src/components/FileDropzone/types.ts +13 -4
  97. package/src/components/Icon/iconList.ts +4 -2
  98. package/src/components/InputWithDropdown/InputWithDropdown.tsx +1 -1
  99. package/src/components/LabelEditTextField/LabelEditTextField.scss +4 -0
  100. package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +8 -3
  101. package/src/components/LabelEditTextField/LabelEditTextField.tsx +42 -18
  102. package/src/components/LabelEditTextField/types.ts +3 -1
  103. package/src/components/MachineInputField/MachineInputField.tsx +67 -70
  104. package/src/components/NLPInput/components/NlpDropDown/NlpDropdown.scss +1 -1
  105. package/src/components/ScriptSwitchButton/ScriptSwitchButton.scss +33 -0
  106. package/src/components/ScriptSwitchButton/ScriptSwitchButton.stories.tsx +48 -0
  107. package/src/components/ScriptSwitchButton/ScriptSwitchButton.tsx +65 -0
  108. package/src/components/ScriptSwitchButton/index.ts +1 -0
  109. package/src/components/Search/Search.tsx +3 -1
  110. package/src/components/Select/Select.tsx +4 -4
  111. package/src/components/Select/types.ts +1 -1
  112. package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +1 -0
  113. package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +2 -8
  114. package/src/components/StatusCard/StatusCard.scss +2 -1
  115. package/src/components/StatusCard/StatusCard.stories.tsx +59 -1
  116. package/src/components/StatusCard/StatusCard.tsx +10 -2
  117. package/src/components/StatusCard/types.ts +2 -0
  118. package/src/components/TableTree/Components/TableBody.tsx +20 -16
  119. package/src/components/TableTree/Components/TableCell.tsx +47 -31
  120. package/src/components/TableTree/Components/TableRow.tsx +4 -0
  121. package/src/components/TableTree/TableTree.scss +121 -109
  122. package/src/components/TableTree/data.ts +48 -2
  123. package/src/components/TableTree/types.ts +4 -0
  124. package/src/components/TextArea/Textarea.tsx +2 -0
  125. package/src/components/TextArea/Types.ts +3 -0
  126. package/src/components/ThemeProvider/types.ts +1 -1
  127. package/src/index.ts +97 -0
  128. package/src/utils/validateFile/validateFile.stories.tsx +49 -0
  129. package/src/utils/validateFile/validateFile.ts +39 -0
  130. package/src/validations/regex.stories.tsx +362 -0
  131. package/src/validations/regex.ts +194 -0
  132. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.scss +0 -51
  133. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.tsx +0 -107
  134. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/types.ts +0 -5
  135. package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.scss +0 -31
  136. package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.tsx +0 -85
  137. package/src/components/SequentialConnectingBranch/components/DatasetListModal/types.ts +0 -4
  138. /package/src/assets/icons/{impactList.svg → impact_list.svg} +0 -0
@@ -298,6 +298,19 @@ export type SetDataAction = BaseAction<typeof SET_DATA> & {
298
298
  };
299
299
  };
300
300
 
301
+ export type KeyPressAction = BaseAction<typeof KEY_PRESS> & {
302
+ payload: {
303
+ event: React.KeyboardEvent;
304
+ };
305
+ };
306
+
307
+ export function keyPress(event: React.KeyboardEvent): KeyPressAction {
308
+ return {
309
+ type: KEY_PRESS,
310
+ payload: { event },
311
+ };
312
+ }
313
+
301
314
  export function setData(data: Matrix<CellBase>): SetDataAction {
302
315
  return {
303
316
  type: SET_DATA,
@@ -544,6 +557,7 @@ export type Action =
544
557
  | UnderlineTypeStyle
545
558
  | FontSize
546
559
  | FontFamily
560
+ | KeyPressAction
547
561
  | TextAlignType
548
562
  | BorderType
549
563
  | ItalicStyle
@@ -582,6 +582,22 @@ export default function reducer(
582
582
  return blur(state);
583
583
  }
584
584
 
585
+ case Actions.KEY_PRESS: {
586
+ const { event } = action.payload;
587
+
588
+ if (isActiveReadOnly(state) || event.metaKey) {
589
+ return state;
590
+ }
591
+ if (state.mode === 'view' && state.active) {
592
+ const selectedRange = state.selected.toRange(state.model.data);
593
+ if (selectedRange?.size() === 1) {
594
+ return edit(clear(state));
595
+ }
596
+ return edit(state);
597
+ }
598
+ return state;
599
+ }
600
+
585
601
  case Actions.KEY_DOWN: {
586
602
  const { event } = action.payload;
587
603
  const handler = getKeyDownHandler(state, event);
@@ -190,10 +190,12 @@ export function applyBorderToCells(
190
190
  return currentData;
191
191
  }
192
192
 
193
- const { start, end } = selectedRange;
194
-
195
193
  let updatedData = currentData;
196
194
 
195
+ const { start, end } = selectedRange;
196
+ const startRow = start.row;
197
+ const startCol = start.column;
198
+
197
199
  for (let row = start.row; row <= end.row; row++) {
198
200
  for (let col = start.column; col <= end.column; col++) {
199
201
  const currentCell = Matrix.get({ row, column: col }, updatedData);
@@ -202,17 +204,47 @@ export function applyBorderToCells(
202
204
  continue;
203
205
  }
204
206
 
207
+ const adjacentCell = (
208
+ row: number,
209
+ col: number,
210
+ borderType: string,
211
+ borderColor: string
212
+ ) => {
213
+ const adjacentCell = Matrix.get({ row: row, column: col }, updatedData);
214
+ if (adjacentCell) {
215
+ let updatedCell = { ...adjacentCell };
216
+ updatedCell.style = {
217
+ ...adjacentCell.style,
218
+ [borderType]: `1px solid ${borderColor}`,
219
+ };
220
+ console.log(updatedCell);
221
+ updatedData = Matrix.set(
222
+ { row: row, column: col },
223
+ updatedCell,
224
+ updatedData
225
+ );
226
+ }
227
+ };
228
+
205
229
  let updatedCell = { ...currentCell };
206
230
 
207
231
  switch (value) {
208
232
  case 'border-all-sides':
209
233
  updatedCell.style = {
210
234
  ...currentCell.style,
211
- borderRight: `2px solid ${color}`,
212
- borderLeft: `2px solid ${color}`,
213
- borderTop: `2px solid ${color}`,
214
- borderBottom: `2px solid ${color}`,
235
+ borderRight: `1px solid ${color}`,
236
+ borderLeft: `1px solid ${color}`,
237
+ borderTop: `1px solid ${color}`,
238
+ borderBottom: `1px solid ${color}`,
215
239
  };
240
+
241
+ if (row === startRow) {
242
+ adjacentCell(row - 1, col, 'borderBottom', color);
243
+ }
244
+ if (col === startCol) {
245
+ adjacentCell(row, col - 1, 'borderRight', color);
246
+ }
247
+
216
248
  break;
217
249
  case 'border-none':
218
250
  updatedCell.style = {
@@ -222,29 +254,64 @@ export function applyBorderToCells(
222
254
  borderTop: `1px solid var(--excel-sheet-border)`,
223
255
  borderBottom: `1px solid var(--excel-sheet-border)`,
224
256
  };
257
+
258
+ if (row === startRow) {
259
+ adjacentCell(
260
+ row - 1,
261
+ col,
262
+ 'borderBottom',
263
+ 'var(--excel-sheet-border)'
264
+ );
265
+ }
266
+ if (col === startCol) {
267
+ adjacentCell(
268
+ row,
269
+ col - 1,
270
+ 'borderRight',
271
+ 'var(--excel-sheet-border)'
272
+ );
273
+ }
225
274
  break;
275
+
226
276
  case 'border-right':
227
277
  updatedCell.style = {
228
278
  ...currentCell.style,
229
- borderRight: `2px solid ${color}`,
279
+ borderRight: `1px solid ${color}`,
230
280
  };
231
281
  break;
282
+
232
283
  case 'border-left':
233
284
  updatedCell.style = {
234
285
  ...currentCell.style,
235
- borderLeft: `2px solid ${color}`,
286
+ borderLeft: `1px solid ${color}`,
236
287
  };
288
+ if (col === startCol) {
289
+ adjacentCell(
290
+ row,
291
+ col - 1,
292
+ 'borderRight',
293
+ 'var(--excel-sheet-border)'
294
+ );
295
+ }
237
296
  break;
238
297
  case 'border-top':
239
298
  updatedCell.style = {
240
299
  ...currentCell.style,
241
- borderTop: `2px solid ${color}`,
300
+ borderTop: `1px solid ${color}`,
242
301
  };
302
+ if (row === startRow) {
303
+ adjacentCell(
304
+ row - 1,
305
+ col,
306
+ 'borderBottom',
307
+ 'var(--excel-sheet-border)'
308
+ );
309
+ }
243
310
  break;
244
311
  case 'border-bottom':
245
312
  updatedCell.style = {
246
313
  ...currentCell.style,
247
- borderBottom: `2px solid ${color}`,
314
+ borderBottom: `1px solid ${color}`,
248
315
  };
249
316
  break;
250
317
  default:
@@ -123,8 +123,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
123
123
  value: 'double_border',
124
124
  label: 'Double Underline',
125
125
  icon: 'double_underline',
126
- },
127
- { value: 'line-through', label: 'Strikethrough', icon: 'strike_through' },
126
+ }
128
127
  ];
129
128
 
130
129
  const fontFamily = [
@@ -415,8 +414,10 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
415
414
  </div>
416
415
  </Tooltip>
417
416
  </div>
418
- <div className="ff-excel-toolbar-divider"></div>
419
- <div className="ff-excel-toolbar-menu">
417
+
418
+
419
+ {/* <div className="ff-excel-toolbar-divider"></div> TODO */}
420
+ {/* <div className="ff-excel-toolbar-menu">
420
421
  <Tooltip placement="top" title={'Formula'}>
421
422
  <Icon
422
423
  hoverEffect
@@ -425,7 +426,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
425
426
  name="formula_icon"
426
427
  />
427
428
  </Tooltip>
428
- </div>
429
+ </div> TODO */}
429
430
  </div>
430
431
  );
431
432
  };
@@ -24,6 +24,7 @@ const Dropzone: FC<DroppableProps> = ({
24
24
  setSelectedFile,
25
25
  handleRemoveFile,
26
26
  isDisable,
27
+ setShowDrawer,
27
28
  }) => {
28
29
  const isWebServiceFile = selectedFile?.name && isWebServiceFileDropZone;
29
30
  return (
@@ -42,6 +43,8 @@ const Dropzone: FC<DroppableProps> = ({
42
43
  onFileRemoveClick={handleRemoveFile}
43
44
  onFileReplaceClick={setSelectedFile}
44
45
  setSelectedFile={setSelectedFile}
46
+ selectedRadioOption={selectedRadioOption}
47
+ setShowDrawer={setShowDrawer}
45
48
  />
46
49
  ) : (
47
50
  <>
@@ -4,6 +4,12 @@
4
4
  gap: $gap;
5
5
  }
6
6
 
7
+ @mixin flex-center {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ }
12
+
7
13
  @mixin center {
8
14
  display: grid;
9
15
  place-items: center;
@@ -160,4 +166,16 @@
160
166
  .ff-disable-file-dropzone-wrapper {
161
167
  opacity: 0.5;
162
168
  cursor: not-allowed;
169
+ }
170
+ .footer_basic_button {
171
+ width: 100%;
172
+ position: absolute;
173
+ bottom: 0;
174
+ right: 0;
175
+ @include flex-center;
176
+ justify-content: flex-end;
177
+ gap: 16px;
178
+ border-top: 1px solid var(--border-color);
179
+ padding: 4px 8px;
180
+ background-color: var(--primary-icon-color);
163
181
  }
@@ -5,8 +5,10 @@ import Toaster from '../Toast';
5
5
  import { useState } from 'react';
6
6
  import { RadioOption } from './types';
7
7
  import Drawer from '../Drawer/Drawer';
8
- import Typography from '../Typography';
8
+ import ConditionalDropdown from '../ConditionalDropdown/ConditionalDropdown';
9
9
  import './FileDropzone.scss';
10
+ import { DynamicObj } from '../CreateVariable/types';
11
+ import Button from '../Button';
10
12
 
11
13
  const meta: Meta<typeof FileDropzone> = {
12
14
  title: 'Components/FileDropzone',
@@ -107,8 +109,12 @@ export const WithRadioButton: Story = {
107
109
 
108
110
  const [selectedRadioOption, setSelectedRadioOption] =
109
111
  useState<RadioOption>();
110
- const [selectedFile, setSelectedFile] = useState<File | null>(null);
111
-
112
+ const [selectedFile, setSelectedFile] = useState<File | DynamicObj | null>(
113
+ null
114
+ );
115
+ const [testDataSelectedFile, setTestDataSelectedFile] = useState<
116
+ DynamicObj | File | null
117
+ >(null);
112
118
 
113
119
  const drawerArgs = {
114
120
  primaryButtonProps: {
@@ -156,6 +162,42 @@ export const WithRadioButton: Story = {
156
162
  }, 2000);
157
163
  };
158
164
 
165
+ const testData = [
166
+ {
167
+ _id: '1',
168
+ name: 'File1.txt',
169
+ actualPath: '/documents/File1.txt',
170
+ searchKey: 'file1',
171
+ parentId: 'root',
172
+ },
173
+ {
174
+ _id: '2',
175
+ name: 'File2.doc',
176
+ actualPath: '/documents/File2.doc',
177
+ searchKey: 'file2',
178
+ parentId: 'root',
179
+ },
180
+ {
181
+ _id: '3',
182
+ name: 'Image1.png',
183
+ actualPath: '/images/Image1.png',
184
+ searchKey: 'image1',
185
+ parentId: 'folder1',
186
+ },
187
+ {
188
+ _id: '4',
189
+ name: 'Presentation.ppt',
190
+ actualPath: '/presentations/Presentation.ppt',
191
+ searchKey: 'presentation',
192
+ parentId: 'folder2',
193
+ },
194
+ ];
195
+
196
+ const handleSaveButton = () => {
197
+ setSelectedFile(testDataSelectedFile);
198
+ setShowModal(false);
199
+ };
200
+
159
201
  return (
160
202
  <>
161
203
  <FileDropzone
@@ -176,6 +218,7 @@ export const WithRadioButton: Story = {
176
218
  selectedFile={selectedFile}
177
219
  handleFileChange={handleFileChange}
178
220
  handleRemoveFile={handleRemoveFile}
221
+ setShowDrawer={setShowModal}
179
222
  />
180
223
  {showToaster && (
181
224
  <Toaster
@@ -185,18 +228,43 @@ export const WithRadioButton: Story = {
185
228
  toastMessage={'Max 5 files can be uploaded'}
186
229
  />
187
230
  )}
188
- {selectedRadioOption?.value === 'Local File' &&
231
+ {selectedRadioOption?.value === 'Test Data' && (
189
232
  <Drawer
190
233
  {...drawerArgs}
191
234
  isOpen={showModal}
192
235
  onClose={() => setShowModal(false)}
193
- isFooterRequired={true}
236
+ isFooterRequired={false}
194
237
  _isExpanded={false}
195
238
  size="small"
239
+
196
240
  >
197
- <Typography>Upload TestData Files Here</Typography>
241
+ <ConditionalDropdown
242
+ label="Select Path Using #"
243
+ placeholder="Enter # to search files"
244
+ isHash
245
+ dataFiles={testData}
246
+ dropdownWidth="auto"
247
+ setHashInputValue={setTestDataSelectedFile}
248
+ />
249
+ <div className="footer_basic_button">
250
+ <Button
251
+ type="button"
252
+ variant="secondary"
253
+ size="small"
254
+ onClick={() => setShowModal(false)}
255
+ label={'Cancel'}
256
+ />
257
+
258
+ <Button
259
+ type={'button'}
260
+ variant="primary"
261
+ size="small"
262
+ label={'Save'}
263
+ onClick={handleSaveButton}
264
+ />
265
+ </div>
198
266
  </Drawer>
199
- }
267
+ )}
200
268
  </>
201
269
  );
202
270
  },
@@ -38,6 +38,7 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
38
38
  handleRemoveFile,
39
39
  isApiResponseError = false,
40
40
  isDisable = false,
41
+ setShowDrawer,
41
42
  }) => {
42
43
  const fileInputRef = useRef<HTMLInputElement | null>(null);
43
44
  const {
@@ -131,6 +132,7 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
131
132
  handleRemoveFile={handleRemoveFile}
132
133
  setSelectedFile={setSelectedFile}
133
134
  isDisable={isDisable}
135
+ setShowDrawer={setShowDrawer}
134
136
  />
135
137
 
136
138
  {isWebServiceFileDropZone && (
@@ -8,14 +8,18 @@ import { useRef } from 'react';
8
8
  const RadioFilePreview: React.FC<RadioFilePreviewProps> = ({
9
9
  selectedFile,
10
10
  onFileRemoveClick,
11
- onFileReplaceClick
11
+ onFileReplaceClick,
12
+ selectedRadioOption,
13
+ setShowDrawer,
12
14
  }) => {
13
15
  const fileInputRef = useRef<HTMLInputElement | null>(null);
14
16
 
15
17
  const handleReplaceClick = () => {
16
- if (fileInputRef.current) {
17
- fileInputRef.current.click();
18
+ if (selectedRadioOption?.value === 'Test Data') {
19
+ setShowDrawer?.(true);
20
+ return;
18
21
  }
22
+ fileInputRef.current?.click();
19
23
  };
20
24
 
21
25
  const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { DynamicObj } from '../CreateVariable/types';
2
3
  export interface RadioOption {
3
4
  label: string;
4
5
  value: string;
@@ -93,12 +94,12 @@ export interface FileDropzoneProps {
93
94
  /**
94
95
  * Its the File Name of File Selected from Local File.
95
96
  **/
96
- setSelectedFile?: (file: File | null) => void;
97
+ setSelectedFile?: (file: File | DynamicObj | null) => void;
97
98
 
98
99
  /**
99
100
  * Its the File Name of File Selected from Local File.
100
101
  **/
101
- selectedFile?: File | null;
102
+ selectedFile?: File | DynamicObj | null;
102
103
 
103
104
  /**
104
105
  * Its the function which updates the Selected file from Local Directory.
@@ -120,6 +121,11 @@ export interface FileDropzoneProps {
120
121
  **/
121
122
  isDisable?: boolean;
122
123
 
124
+ /**
125
+ * Its the boolean value setted when the replace is clicked for TestData radio option .
126
+ **/
127
+ setShowDrawer?: (value: boolean | ((prevState: boolean) => boolean)) => void;
128
+
123
129
  }
124
130
  export interface FileState {
125
131
  accepted: File[];
@@ -176,11 +182,12 @@ export interface DroppableProps {
176
182
  selectedRadioOption?: Option,
177
183
  radioOptions?: RadioOption[],
178
184
  handleOptionChange?: (option: RadioOption)=> void,
179
- selectedFile?: File | null,
180
- setSelectedFile?: (file: File | null) => void;
185
+ selectedFile?: File | DynamicObj | null,
186
+ setSelectedFile?: (file: File | DynamicObj | null) => void;
181
187
  handleFileChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
182
188
  handleRemoveFile?: () => void;
183
189
  isDisable?: boolean;
190
+ setShowDrawer?: (value: boolean | ((prevState: boolean) => boolean)) => void;
184
191
  }
185
192
 
186
193
  export interface FilePreviewProps {
@@ -196,4 +203,6 @@ export interface RadioFilePreviewProps {
196
203
  onFileRemoveClick?: () => void;
197
204
  onFileReplaceClick?: (file: File | null) => void;
198
205
  setSelectedFile?: (file: File | null) => void;
206
+ selectedRadioOption?: Option,
207
+ setShowDrawer?: (value: boolean | ((prevState: boolean) => boolean)) => void
199
208
  }
@@ -45,7 +45,7 @@ import ManualLocator from '../../assets/icons/manual_locator.svg?react';
45
45
  import LicenseIcon from '../../assets/icons/active_license_icon.svg?react';
46
46
  import DeleteIcon from '../../assets/icons/delete.svg?react';
47
47
  import DetailsIcon from '../../assets/icons/details.svg?react';
48
- import ImpactListIcon from '../../assets/icons/impactList.svg?react';
48
+ import ImpactListIcon from '../../assets/icons/impact_list.svg?react';
49
49
  import Export from '../../assets/icons/export.svg?react';
50
50
  import FormatePainter from '../../assets/icons/formate_painter.svg?react';
51
51
  import Bold from '../../assets/icons/bold.svg?react';
@@ -252,6 +252,7 @@ import machineDisableIcon from '../../assets/icons/machine_disable_icon.svg?reac
252
252
  import suitesIcon from '../../assets/icons/suites_icon.svg?react';
253
253
  import executionsIcon from '../../assets/icons/executions_icon.svg?react';
254
254
  import ImportIcon from '../../assets/icons/import_icon.svg?react';
255
+ import Settings from '../../assets/icons/settings.svg?react';
255
256
 
256
257
  Components['success'] = ToastSuccessIcon;
257
258
  Components['alert'] = Alert;
@@ -295,7 +296,7 @@ Components['run_icon'] = RunIcon;
295
296
  Components['license'] = LicenseIcon;
296
297
  Components['delete'] = DeleteIcon;
297
298
  Components['details'] = DetailsIcon;
298
- Components['impactList'] = ImpactListIcon;
299
+ Components['impact_list'] = ImpactListIcon;
299
300
  Components['beautify_icon'] = BeautifyIcon;
300
301
  Components['add_variable_icon'] = AddVariable;
301
302
  Components['replace_file'] = ReplaceFile;
@@ -499,5 +500,6 @@ Components['machine_disable_icon'] = machineDisableIcon;
499
500
  Components['executions_icon'] = executionsIcon;
500
501
  Components['suites_icon'] = suitesIcon;
501
502
  Components['import_icon'] = ImportIcon;
503
+ Components['settings'] = Settings
502
504
 
503
505
  export default Components;
@@ -18,7 +18,7 @@ const InputWithDropdown = forwardRef<HTMLInputElement, InputWithDropdownProps>(
18
18
  error,
19
19
  helperText,
20
20
  optionsList,
21
- selectedOption,
21
+ selectedOption = { label: '', value: '' },
22
22
  autoComplete = 'off',
23
23
  onDropdownChangeHandler = () => {},
24
24
  onInputChangeHandler,
@@ -77,6 +77,10 @@
77
77
  .cancel-icon {
78
78
  cursor: pointer;
79
79
  }
80
+ .disabled-confirm-icon {
81
+ cursor: default;
82
+ opacity: 0.5;
83
+ }
80
84
  }
81
85
 
82
86
  .error-text {
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
3
  import LabelEditTextField from './LabelEditTextField';
4
4
  import '../../assets/styles/_colors.scss';
@@ -155,16 +155,20 @@ export const textFieldWithHighlight: Story = {
155
155
  };
156
156
  export const openLabelEditTextField: Story = {
157
157
  render: () => {
158
+ const [demoText, setDemoText] = useState('Verify The');
158
159
  const handleConfirmAction = (inputValue: string, dropdownValue: string) => {
159
160
  //DEMO: we are getting that value from LabelEditTextField
160
-
161
+ setDemoText(inputValue);
161
162
  console.info(
162
163
  'Confirmed input value and dropdown value:',
163
164
  inputValue,
164
165
  dropdownValue
165
166
  );
166
167
  };
167
- let demoText = 'Verify The';
168
+ const handleInputChange = (newInputValue: string) => {
169
+ setDemoText(newInputValue); // Update parent state
170
+ };
171
+ console.log('demoText: ', demoText);
168
172
  return (
169
173
  <LabelEditTextField
170
174
  label="Add Module"
@@ -181,6 +185,7 @@ export const openLabelEditTextField: Story = {
181
185
  width="400px"
182
186
  height="22px"
183
187
  confirmAction={handleConfirmAction}
188
+ onInputChange={handleInputChange}
184
189
  isOpen={true}
185
190
  customError="text is too long"
186
191
  customErrorCondition={demoText?.length > 10}