pixel-react-excel-sheet 1.0.23 → 1.0.25

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 (63) hide show
  1. package/lib/components/Charts/LineChart/types.d.ts +1 -0
  2. package/lib/components/DownloadClient/type.d.ts +19 -27
  3. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  4. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
  5. package/lib/components/MultiSelect/dropdownTypes.d.ts +1 -0
  6. package/lib/components/PhoneInput/PhoneInput.d.ts +0 -1
  7. package/lib/components/PhoneInput/types.d.ts +6 -0
  8. package/lib/components/SequentialConnectingBranch/components/Branches/Branches.d.ts +1 -1
  9. package/lib/components/SequentialConnectingBranch/components/Branches/types.d.ts +4 -1
  10. package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.d.ts +1 -1
  11. package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/types.d.ts +4 -1
  12. package/lib/components/SequentialConnectingBranch/types.d.ts +7 -1
  13. package/lib/index.d.ts +36 -29
  14. package/lib/index.esm.js +298 -189
  15. package/lib/index.esm.js.map +1 -1
  16. package/lib/index.js +298 -189
  17. package/lib/index.js.map +1 -1
  18. package/lib/utils/getSequentialPayload/types.d.ts +1 -0
  19. package/package.json +1 -1
  20. package/src/assets/Themes/BaseTheme.scss +1 -1
  21. package/src/assets/Themes/DarkTheme.scss +2 -0
  22. package/src/assets/icons/auto_save_icon.svg +4 -0
  23. package/src/components/Charts/LineChart/LineChart.stories.tsx +7 -3
  24. package/src/components/Charts/LineChart/LineChart.tsx +10 -1
  25. package/src/components/Charts/LineChart/types.ts +1 -0
  26. package/src/components/ConditionalDropdown/ConditionalDropdown.tsx +1 -1
  27. package/src/components/DownloadClient/DownloadClient.scss +51 -64
  28. package/src/components/DownloadClient/DownloadClient.stories.tsx +6 -6
  29. package/src/components/DownloadClient/DownloadClient.tsx +60 -51
  30. package/src/components/DownloadClient/type.ts +32 -40
  31. package/src/components/Excel/ExcelFile/ExcelFile.scss +46 -53
  32. package/src/components/Excel/ExcelFile/ExcelFile.tsx +7 -7
  33. package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +4 -1
  34. package/src/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.tsx +8 -7
  35. package/src/components/Excel/ExcelFile/ExcelFileComponents/HeaderRow.tsx +1 -1
  36. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +4 -1
  37. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +118 -106
  38. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +1 -2
  39. package/src/components/FileDropzone/FileDropzone.stories.tsx +5 -19
  40. package/src/components/FileDropzone/FileDropzone.tsx +24 -4
  41. package/src/components/Icon/iconList.ts +2 -0
  42. package/src/components/MachineInputField/MachineInputField.stories.tsx +5 -4
  43. package/src/components/MachineInputField/MachineInputField.tsx +12 -15
  44. package/src/components/MachineInputField/types.ts +1 -0
  45. package/src/components/MultiSelect/Dropdown.tsx +30 -4
  46. package/src/components/MultiSelect/MultiSelect.tsx +2 -0
  47. package/src/components/MultiSelect/MultiSelectTypes.ts +3 -1
  48. package/src/components/MultiSelect/dropdownTypes.ts +2 -0
  49. package/src/components/PhoneInput/PhoneInput.stories.tsx +16 -41
  50. package/src/components/PhoneInput/PhoneInput.tsx +10 -2
  51. package/src/components/PhoneInput/phoneInput.scss +898 -0
  52. package/src/components/PhoneInput/types.ts +6 -0
  53. package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.tsx +13 -2
  54. package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +34 -19
  55. package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +113 -33
  56. package/src/components/SequentialConnectingBranch/components/Branches/types.ts +7 -1
  57. package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.tsx +6 -0
  58. package/src/components/SequentialConnectingBranch/components/ConnectingBranches/types.ts +7 -1
  59. package/src/components/SequentialConnectingBranch/types.ts +7 -5
  60. package/src/components/TableTree/TableTree.tsx +1 -3
  61. package/src/components/TableTree/data.ts +0 -45
  62. package/src/components/TableTree/types.ts +3 -3
  63. package/src/utils/getSequentialPayload/types.ts +1 -0
@@ -5,6 +5,7 @@ import * as Point from './point';
5
5
  import * as Actions from './actions';
6
6
  import useDispatch from './use-dispatch';
7
7
  import useSelector from './use-selector';
8
+ import Typography from '../../../Typography';
8
9
 
9
10
  const ColumnIndicator: Types.ColumnIndicatorComponent = ({
10
11
  column,
@@ -104,7 +105,7 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
104
105
 
105
106
  return (
106
107
  <th
107
- style={{ minWidth: `${columnWidth}px`, position: 'relative' }}
108
+ style={{ minWidth: `${columnWidth}px`, position: 'sticky' }} //Dynamic value, Inline Styling required
108
109
  className={classNames('ff-spreadsheet-header', {
109
110
  'ff-spreadsheet-header--selected': selected,
110
111
  })}
@@ -117,7 +118,9 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
117
118
  onContextMenu={contextClick}
118
119
  tabIndex={0}>
119
120
  </div>
121
+ <Typography fontWeight='medium'>
120
122
  {label !== undefined ? label : columnIndexToLabel(column)}
123
+ </Typography>
121
124
  <div
122
125
  onMouseDown={onMouseDown}
123
126
  onClick={() => activate({ row: -1, column })}
@@ -16,16 +16,17 @@ const CornerIndicator: Types.CornerIndicatorComponent = ({
16
16
  }, [onSelect]);
17
17
  return (
18
18
  <th
19
- className={classNames('ff-spreadsheet-header ff-spreadsheet-corner-header', {
20
- 'ff-spreadsheet-header--selected': selected,
21
- })}
19
+ className={'ff-spreadsheet-corner-header'}
22
20
  onClick={handleClick}
23
21
  tabIndex={0}
24
22
  >
25
- <Icon
26
- variant={selected ? 'dark' : 'light'}
27
- name="excel_corner_menu"
28
- />
23
+ <div
24
+ className={classNames('corner-header', {
25
+ 'ff-spreadsheet-header--selected': selected,
26
+ })}
27
+ >
28
+ <Icon variant={selected ? 'dark' : 'light'} name="excel_corner_menu" />
29
+ </div>
29
30
  </th>
30
31
  );
31
32
  };
@@ -1,5 +1,5 @@
1
1
  import * as Types from './types';
2
2
 
3
- const HeaderRow: Types.HeaderRowComponent = (props) => <tr {...props} />;
3
+ const HeaderRow: Types.HeaderRowComponent = (props) => <tr style={{position:'relative',height:"34px"}} {...props} />;
4
4
 
5
5
  export default HeaderRow;
@@ -5,6 +5,7 @@ import * as Point from './point';
5
5
  import * as Types from './types';
6
6
  import useDispatch from './use-dispatch';
7
7
  import useSelector from './use-selector';
8
+ import Typography from '../../../Typography';
8
9
 
9
10
  const RowIndicator: Types.RowIndicatorComponent = ({
10
11
  row,
@@ -114,7 +115,9 @@ const RowIndicator: Types.RowIndicatorComponent = ({
114
115
  onContextMenu={contextClick}
115
116
  tabIndex={0}
116
117
  >
117
- {label !== undefined ? label : row + 1}
118
+ <Typography fontWeight="medium">
119
+ {label !== undefined ? label : row + 1}
120
+ </Typography>
118
121
  <div
119
122
  onMouseDown={onMouseDown}
120
123
  onClick={() => activate({ row, column: -1 })}
@@ -4,32 +4,31 @@
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
 
7
- .ff-excel-toolbar-container{
8
- position: static;
7
+ .ff-excel-toolbar-container {
8
+ position: relative;
9
9
  top: 0;
10
- background-color:var( --excel-toolbar-bg);
10
+ background-color: var(--excel-toolbar-bg);
11
11
  padding: 4px 8px;
12
12
  margin-bottom: 20px;
13
13
  }
14
14
 
15
- .ff-spreadsheet {
16
- --background-color: var(--drawer-footer-bg);
17
- --text-color: var(--text-color);
18
- --readonly-text-color: var(--toggle-strip-active);
19
- --outline-color: var(--toggle-strip-active);
20
- --outline-background-color: var(--overlay-bg);
21
- --border-color: var(--excel-sheet-border);
22
- --header-background-color: var(--excel-header-bg);
23
- --elevation: var(--brand-color);
15
+ .ff-spreadsheet {
16
+ --background-color: var(--drawer-footer-bg);
17
+ --text-color: var(--text-color);
18
+ --readonly-text-color: var(--toggle-strip-active);
19
+ --outline-color: var(--toggle-strip-active);
20
+ --outline-background-color: var(--overlay-bg);
21
+ --border-color: var(--excel-sheet-border);
22
+ --header-background-color: var(--excel-header-bg);
23
+ --elevation: var(--brand-color);
24
24
 
25
25
  position: relative;
26
26
  overflow: scroll;
27
+ left: 0;
28
+ top: 0;
27
29
  background: var(--background-color);
28
30
  color: var(--text-color);
29
31
  scrollbar-width: none;
30
- &::-webkit-scrollbar {
31
- height: 0px;
32
- }
33
32
  display: inline-block;
34
33
  }
35
34
 
@@ -55,113 +54,126 @@
55
54
  }
56
55
  border-collapse: collapse;
57
56
  table-layout: fixed;
58
- }
59
57
 
60
- .ff-spreadsheet-cell {
61
- outline: none;
62
- position: relative;
63
- z-index: 0;
64
- }
58
+ .ff-spreadsheet-cell {
59
+ outline: none;
60
+ position: relative;
61
+ z-index: 0;
62
+ }
65
63
 
66
- .ff-spreadsheet-active-cell .select_dot {
67
- background-color: var(--elevation);
68
- height: 10px;
69
- width: 10px;
70
- border-radius: 50%;
71
- position: absolute;
72
- bottom: -5px;
73
- right: -5px;
74
- cursor: crosshair;
75
- z-index: 1000;
76
- }
64
+ .ff-spreadsheet-active-cell .select_dot {
65
+ background-color: var(--elevation);
66
+ height: 10px;
67
+ width: 10px;
68
+ border-radius: 50%;
69
+ position: absolute;
70
+ bottom: -5px;
71
+ right: -5px;
72
+ cursor: crosshair;
73
+ z-index: 1000;
74
+ }
77
75
 
78
- .ff-spreadsheet-cell--readonly {
79
- color: var(--readonly-text-color);
80
- }
76
+ .ff-spreadsheet-cell--readonly {
77
+ color: var(--readonly-text-color);
78
+ }
81
79
 
82
- .ff-spreadsheet-cell,
83
- .ff-spreadsheet-header {
84
- border: 0.1px solid var(--border-color);
85
- overflow: hidden;
86
- word-break: keep-all;
87
- white-space: nowrap;
88
- text-align: left;
89
- box-sizing: border-box;
90
- user-select: none;
91
- }
80
+ .ff-spreadsheet-cell,
81
+ .ff-spreadsheet-header {
82
+ border: 0.1px solid var(--border-color);
83
+ overflow: hidden;
84
+ word-break: keep-all;
85
+ white-space: nowrap;
86
+ text-align: left;
87
+ box-sizing: border-box;
88
+ user-select: none;
89
+ }
92
90
 
93
- .ff-spreadsheet-header {
94
- border: 0.1px solid var(--border-color);
95
- background-color: var(--header-background-color);
96
- color: var(--readonly-text-color);
97
- text-align: center;
98
- z-index: 1000;
99
- font-weight: 500;
100
- font-size: 12px;
101
- }
91
+ .ff-spreadsheet-header {
92
+ border: 0.1px solid var(--border-color);
93
+ background-color: var(--header-background-color);
94
+ color: var(--readonly-text-color);
95
+ text-align: center;
96
+ z-index: 1000;
97
+ position: sticky;
98
+ }
102
99
 
103
- .ff-spreadsheet-corner-header{
104
- padding-left: 20px;
105
- z-index: 1100;
106
- }
100
+ .ff-spreadsheet-corner-header {
101
+ position: fixed;
102
+ z-index: 2000;
103
+ }
107
104
 
108
- .ff-spreadsheet-header--selected {
109
- background: var(--brand-color);
110
- color: var(--tooltip-text-color);
111
- }
105
+ .corner-header {
106
+ border: 0.1px solid var(--border-color);
107
+ background-color: var(--header-background-color);
108
+ position: absolute;
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: center;
112
+ z-index: 1100;
113
+ top: -1px;
114
+ width: 60px;
115
+ height: 34px;
116
+ left: -1px;
117
+ }
112
118
 
113
- .ff-spreadsheet-data-viewer,
114
- .ff-spreadsheet-data-editor input {
115
- padding: 4px;
116
- box-sizing: border-box;
117
- }
118
- .ff-spreadsheet-header{
119
- box-sizing: border-box;
120
- }
119
+ .ff-spreadsheet-header--selected {
120
+ background: var(--brand-color);
121
+ color: var(--tooltip-text-color);
122
+ }
121
123
 
122
- .ff-spreadsheet-data-viewer--preserve-breaks {
123
- white-space: pre-wrap;
124
- }
124
+ .ff-spreadsheet-data-viewer,
125
+ .ff-spreadsheet-data-editor input {
126
+ padding: 4px;
127
+ box-sizing: border-box;
128
+ }
129
+ .ff-spreadsheet-header {
130
+ box-sizing: border-box;
131
+ }
125
132
 
126
- .ff-spreadsheet-data-editor,
127
- .ff-spreadsheet-data-editor input {
128
- width: 100%;
129
- height: 100%;
130
- }
133
+ .ff-spreadsheet-data-viewer--preserve-breaks {
134
+ white-space: pre-wrap;
135
+ }
131
136
 
132
- .ff-spreadsheet-data-editor input {
133
- font: inherit;
134
- color: inherit;
135
- background: none;
136
- border: none;
137
- outline: none;
138
- margin: 0;
139
- }
137
+ .ff-spreadsheet-data-editor,
138
+ .ff-spreadsheet-data-editor input {
139
+ width: 100%;
140
+ height: 100%;
141
+ }
140
142
 
141
- .ff-spreadsheet-data-viewer--boolean {
142
- text-align: center;
143
- }
143
+ .ff-spreadsheet-data-editor input {
144
+ font: inherit;
145
+ color: inherit;
146
+ background: none;
147
+ border: none;
148
+ outline: none;
149
+ margin: 0;
150
+ }
144
151
 
145
- .ff-spreadsheet-floating-rect {
146
- position: absolute;
147
- pointer-events: none;
148
- box-sizing: border-box;
149
- }
152
+ .ff-spreadsheet-data-viewer--boolean {
153
+ text-align: center;
154
+ }
150
155
 
151
- .ff-spreadsheet-floating-rect--hidden {
152
- display: none;
153
- }
156
+ .ff-spreadsheet-floating-rect {
157
+ position: absolute;
158
+ pointer-events: none;
159
+ box-sizing: border-box;
160
+ }
154
161
 
155
- .ff-spreadsheet-floating-rect--selected {
156
- background: var(--outline-background-color);
157
- border: 2px var(--outline-color) solid;
158
- }
162
+ .ff-spreadsheet-floating-rect--hidden {
163
+ display: none;
164
+ }
159
165
 
160
- .ff-spreadsheet-floating-rect--dragging {
161
- border: none;
162
- }
166
+ .ff-spreadsheet-floating-rect--selected {
167
+ background: var(--outline-background-color);
168
+ border: 2px var(--outline-color) solid;
169
+ }
163
170
 
164
- .ff-spreadsheet-floating-rect--copied {
165
- border: 2px var(--outline-color) dashed;
171
+ .ff-spreadsheet-floating-rect--dragging {
172
+ border: none;
173
+ }
174
+
175
+ .ff-spreadsheet-floating-rect--copied {
176
+ border: 2px var(--outline-color) dashed;
177
+ }
166
178
  }
167
179
  }
@@ -228,9 +228,8 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
228
228
  showLabel={false}
229
229
  optionZIndex={1000}
230
230
  onChange={(e) => {
231
- console.log(e);
232
231
  setSelectedFontFamily({ label: e.label, value: e.label });
233
- setFontFamily(data, e.label);
232
+ setFontFamily(data, e.value);
234
233
  }}
235
234
  required={false}
236
235
  optionsList={fontFamily}
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef } from 'react';
1
+ import React from 'react';
2
2
  import { StoryObj, Meta } from '@storybook/react';
3
3
  import FileDropzone from './FileDropzone';
4
4
  import Toaster from '../Toast';
@@ -109,7 +109,6 @@ export const WithRadioButton: Story = {
109
109
  useState<RadioOption>();
110
110
  const [selectedFile, setSelectedFile] = useState<File | null>(null);
111
111
 
112
- const fileInputRef = useRef<HTMLInputElement | null>(null);
113
112
 
114
113
  const drawerArgs = {
115
114
  primaryButtonProps: {
@@ -126,12 +125,6 @@ export const WithRadioButton: Story = {
126
125
  },
127
126
  };
128
127
 
129
- useEffect(() => {
130
- if (selectedRadioOption?.value === 'Local File' && fileInputRef.current) {
131
- fileInputRef.current.click();
132
- }
133
- }, [selectedRadioOption]);
134
-
135
128
  const radioOptions: RadioOption[] = [
136
129
  { value: 'Test Data', label: 'Test Data' },
137
130
  { value: 'Local File', label: 'Local File' },
@@ -146,10 +139,11 @@ export const WithRadioButton: Story = {
146
139
  };
147
140
  const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
148
141
  const file = event.target.files?.[0];
142
+
149
143
  if (file) {
150
144
  setSelectedFile(file);
151
145
  }
152
- };
146
+ };
153
147
 
154
148
  const handleRemoveFile = () => {
155
149
  setSelectedFile(null);
@@ -191,15 +185,7 @@ export const WithRadioButton: Story = {
191
185
  toastMessage={'Max 5 files can be uploaded'}
192
186
  />
193
187
  )}
194
- {selectedRadioOption?.value === 'Local File' ? (
195
- <input
196
- ref={fileInputRef}
197
- type="file"
198
- className='ff-input-ref'
199
- onChange={handleFileChange}
200
- accept="image/png, image/jpeg, application/x-zip-compressed, application/zip"
201
- />
202
- ) : (
188
+ {selectedRadioOption?.value === 'Local File' &&
203
189
  <Drawer
204
190
  {...drawerArgs}
205
191
  isOpen={showModal}
@@ -210,7 +196,7 @@ export const WithRadioButton: Story = {
210
196
  >
211
197
  <Typography>Upload TestData Files Here</Typography>
212
198
  </Drawer>
213
- )}
199
+ }
214
200
  </>
215
201
  );
216
202
  },
@@ -3,7 +3,7 @@ import { FileDropzoneProps } from './types';
3
3
  import './FileDropzone.scss';
4
4
  import Icon from '../Icon';
5
5
  import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
6
- import { useEffect, useMemo } from 'react';
6
+ import { useEffect, useMemo, useRef } from 'react';
7
7
  import Dropzone from './Dropzone';
8
8
  import FilePreview from './FilePreview';
9
9
  import classNames from 'classnames';
@@ -39,6 +39,7 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
39
39
  isApiResponseError = false,
40
40
  isDisable = false,
41
41
  }) => {
42
+ const fileInputRef = useRef<HTMLInputElement | null>(null);
42
43
  const {
43
44
  getRootProps,
44
45
  getInputProps,
@@ -77,6 +78,12 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
77
78
  [acceptedFiles, handleRemoveClick, handleReplaceClick]
78
79
  );
79
80
 
81
+ useEffect(() => {
82
+ if (selectedRadioOption?.value === 'Local File' && fileInputRef.current) {
83
+ fileInputRef.current.click();
84
+ }
85
+ }, [selectedRadioOption]);
86
+
80
87
  useEffect(() => {
81
88
  if (!checkEmpty(acceptedFiles) && setSelectedFile) {
82
89
  setSelectedFile(acceptedFiles[0] || null);
@@ -98,9 +105,12 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
98
105
  );
99
106
 
100
107
  return (
101
- <div className={classNames('ff-file-dropzone-wrapper',
102
- {'ff-disable-file-dropzone-wrapper': isDisable,}
103
- )} style={{ width: `${width}px` }}>
108
+ <div
109
+ className={classNames('ff-file-dropzone-wrapper', {
110
+ 'ff-disable-file-dropzone-wrapper': isDisable,
111
+ })}
112
+ style={{ width: `${width}px` }}
113
+ >
104
114
  <Dropzone
105
115
  icon={icon}
106
116
  primaryLabel={primaryLabel}
@@ -123,6 +133,16 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
123
133
  isDisable={isDisable}
124
134
  />
125
135
 
136
+ {isWebServiceFileDropZone && (
137
+ <input
138
+ ref={fileInputRef}
139
+ type="file"
140
+ className="ff-input-ref"
141
+ onChange={handleFileChange}
142
+ accept={accept.join(',')}
143
+ />
144
+ )}
145
+
126
146
  {isWebServiceFileDropZone ? null : (
127
147
  <div
128
148
  className={'ff-file-details-wrapper'}
@@ -66,6 +66,7 @@ import TextColor from '../../assets/icons/text_color.svg?react';
66
66
  import FillColor from '../../assets/icons/fill_color.svg?react';
67
67
  import FormulaIcon from '../../assets/icons/formula_icon.svg?react';
68
68
  import ExcelCornerMenu from '../../assets/icons/excel_corner_menu.svg?react';
69
+ import AutoSaveIcon from '../../assets/icons/auto_save_icon.svg?react';
69
70
 
70
71
  import ApkFileType from '../../assets/icons/apk_file_type.svg?react';
71
72
  import CsvFileType from '../../assets/icons/csv_file_type.svg?react';
@@ -318,6 +319,7 @@ Components['text_color'] = TextColor;
318
319
  Components['fill_color'] = FillColor;
319
320
  Components['formula_icon'] = FormulaIcon;
320
321
  Components['excel_corner_menu'] = ExcelCornerMenu;
322
+ Components['auto_save_icon'] = AutoSaveIcon;
321
323
  Components['export'] = Export;
322
324
  Components['apk_file_type'] = ApkFileType;
323
325
  Components['csv_file_type'] = CsvFileType;
@@ -15,10 +15,11 @@ type Story = StoryObj<typeof MachineInputField>;
15
15
 
16
16
  // Sample data for the MachineInputField
17
17
  const sampleOptions: MachineType[] = [
18
- { label: 'Local Environment', type: 'Local' },
19
- { label: '121.25.333.344.2', type: 'Google Chrome' },
20
- { label: '17, iPhone 15 pro max', type: 'mac' },
21
- { label: 'Samsung Galaxy S23', type: 'android' },
18
+ { label: 'Local Environment', type: 'local' },
19
+ { label: '10.100.233.23', type: 'windows' },
20
+ { label: '121.25.333.344.2', type: 'Browserstack' },
21
+ { label: 'iphone 17 pro max', type: 'mac' },
22
+ { label: 'samsung galaxy s23', type: 'android' },
22
23
  ];
23
24
 
24
25
  export const Primary: Story = {
@@ -7,18 +7,15 @@ import classNames from 'classnames';
7
7
  import { truncateText } from '../../utils/truncateText/truncateText';
8
8
 
9
9
  const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
10
- (
11
- {
12
- width = '',
13
- options = [],
14
- runCount = 0,
15
- className = '',
16
- contentReverse = false,
17
- onClick = () => {},
18
- modalId = '',
19
- },
20
- ref
21
- ) => {
10
+ ({
11
+ width = '',
12
+ options = [],
13
+ runCount = 0,
14
+ className = '',
15
+ contentReverse = false,
16
+ onClick = () => {},
17
+ modalId = '',
18
+ }) => {
22
19
  const getIcon: Record<MachineType['type'], string> = {
23
20
  Local: 'local',
24
21
  Browserstack: 'browserstack_icon',
@@ -33,15 +30,15 @@ const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
33
30
  'Internet Explorer': 'internet_explorer',
34
31
  Safari: 'safari_icon',
35
32
  Opera: 'opera',
33
+ windows: 'windows',
36
34
  };
37
35
 
38
36
  return (
39
37
  <div
40
- ref={ref}
41
- id={modalId}
38
+ ref={modalId}
42
39
  style={{ width: width }}
43
40
  className={classNames('ff-machine-input-field-wrapper', className)}
44
- onClick={onClick}
41
+ onClick={() => onClick()}
45
42
  >
46
43
  <Typography
47
44
  as="span"
@@ -1,3 +1,4 @@
1
+
1
2
  export interface MachineType {
2
3
  type: string;
3
4
  label: string;
@@ -10,6 +10,7 @@ import Checkbox from '../Checkbox';
10
10
  import Tooltip from '../Tooltip';
11
11
  import { truncateText } from '../../utils/truncateText/truncateText';
12
12
  import { getLabel, getValue } from '../../utils/getSelectOptionValue/getSelectOptionValue';
13
+ import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
13
14
 
14
15
  const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
15
16
  (
@@ -21,11 +22,12 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
21
22
  zIndex,
22
23
  withSelectButton,
23
24
  labelAccessor='label',
24
- valueAccessor='value'
25
+ valueAccessor='value',
26
+ loadMoreOptions,
25
27
  },
26
28
  ref
27
29
  ) => {
28
- const filteredOptions = options
30
+ const filteredOptions = options
29
31
  ? options.filter((option) =>
30
32
  getValue(option, valueAccessor)
31
33
  ?.toLowerCase()
@@ -70,6 +72,22 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
70
72
 
71
73
  const themeContext = useContext(ThemeContext);
72
74
  const currentTheme = themeContext?.currentTheme;
75
+
76
+ useIntersectionObserver(['ff-multiselect-pagination'], {
77
+ root: document.getElementById('ff-multiselect-options-wrapper'),
78
+ rootMargin: '0px',
79
+ threshold: 0.1,
80
+ onIntersect: (entry, _observer) => {
81
+ if (entry.isIntersecting) {
82
+ if (loadMoreOptions) {
83
+ loadMoreOptions();
84
+ }
85
+
86
+
87
+ }
88
+ },
89
+ });
90
+
73
91
  return (
74
92
  <div
75
93
  role="listbox"
@@ -87,6 +105,8 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
87
105
  <div
88
106
  className="ff-multiselect-options-wrapper"
89
107
  style={{ maxHeight: withSelectButton ? '128px' : '160px' }}
108
+
109
+ id="ff-multiselect-options-wrapper"
90
110
  >
91
111
  {filteredOptions.length === 0 ? (
92
112
  <Typography textAlign='center' as='p' className='no-options'>
@@ -94,7 +114,8 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
94
114
  </Typography>
95
115
 
96
116
  ) : (
97
- filteredOptions.map((info) => (
117
+ <>
118
+ { filteredOptions.map((info) => (
98
119
  <div
99
120
  role="option"
100
121
  className={`dropdown-option-container`}
@@ -127,7 +148,12 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
127
148
  }
128
149
  />
129
150
  </div>
130
- ))
151
+ ))}
152
+
153
+ <div id="ff-multiselect-pagination" >
154
+ </div>
155
+ </>
156
+
131
157
  )}
132
158
  </div>
133
159
  {withSelectButton && filteredOptions.length > 0 && (
@@ -78,6 +78,7 @@ const MultiSelect = ({
78
78
  labelAccessor = 'label',
79
79
  valueAccessor = 'value',
80
80
  withSelectButton = variant === 'machines' ? true : false,
81
+ loadMoreOptions = () => { },
81
82
  onEnter = () => { },
82
83
  }: MultiSelectProps) => {
83
84
  const [isOpen, setIsOpen] = useState<boolean>(false);
@@ -464,6 +465,7 @@ const MultiSelect = ({
464
465
  withSelectButton={withSelectButton}
465
466
  labelAccessor={labelAccessor}
466
467
  valueAccessor={valueAccessor}
468
+ loadMoreOptions={loadMoreOptions}
467
469
  />,
468
470
  document.body
469
471
  )}