pixel-react-excel-sheet 1.0.22 → 1.0.24

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 (64) 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 +295 -208
  15. package/lib/index.esm.js.map +1 -1
  16. package/lib/index.js +295 -208
  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 +5 -2
  37. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +117 -106
  38. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +0 -29
  39. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +1 -2
  40. package/src/components/FileDropzone/FileDropzone.stories.tsx +5 -19
  41. package/src/components/FileDropzone/FileDropzone.tsx +24 -4
  42. package/src/components/Icon/iconList.ts +2 -0
  43. package/src/components/MachineInputField/MachineInputField.stories.tsx +5 -4
  44. package/src/components/MachineInputField/MachineInputField.tsx +12 -15
  45. package/src/components/MachineInputField/types.ts +1 -0
  46. package/src/components/MultiSelect/Dropdown.tsx +30 -4
  47. package/src/components/MultiSelect/MultiSelect.tsx +2 -0
  48. package/src/components/MultiSelect/MultiSelectTypes.ts +3 -1
  49. package/src/components/MultiSelect/dropdownTypes.ts +2 -0
  50. package/src/components/PhoneInput/PhoneInput.stories.tsx +16 -41
  51. package/src/components/PhoneInput/PhoneInput.tsx +10 -2
  52. package/src/components/PhoneInput/phoneInput.scss +898 -0
  53. package/src/components/PhoneInput/types.ts +6 -0
  54. package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.tsx +13 -2
  55. package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +34 -19
  56. package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +113 -33
  57. package/src/components/SequentialConnectingBranch/components/Branches/types.ts +7 -1
  58. package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.tsx +6 -0
  59. package/src/components/SequentialConnectingBranch/components/ConnectingBranches/types.ts +7 -1
  60. package/src/components/SequentialConnectingBranch/types.ts +7 -5
  61. package/src/components/TableTree/TableTree.tsx +1 -3
  62. package/src/components/TableTree/data.ts +0 -45
  63. package/src/components/TableTree/types.ts +3 -3
  64. package/src/utils/getSequentialPayload/types.ts +1 -0
@@ -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
  )}
@@ -41,7 +41,9 @@ interface MultiSelectProps {
41
41
 
42
42
  valueAccessor?: string;
43
43
 
44
- onEnter?:(newOption:string)=>void
44
+ onEnter?:(newOption:string)=>void;
45
+
46
+ loadMoreOptions?: () =>void;
45
47
  }
46
48
 
47
49
  export { Option, MultiSelectProps };
@@ -16,4 +16,6 @@ export interface DropdownProps {
16
16
  onSelect?: () => void;
17
17
  labelAccessor?: string;
18
18
  valueAccessor?: string;
19
+ loadMoreOptions?: () => void;
20
+
19
21
  }
@@ -15,7 +15,11 @@ const Template = ({
15
15
  placeholder,
16
16
  onFocus,
17
17
  onBlur,
18
- isValid,
18
+ international,
19
+ enableAreaCodeStretch,
20
+ defaultCountry,
21
+ disabled,
22
+ id,
19
23
  }: PhoneInputProps) => {
20
24
  const [phone, setPhone] = useState<string>(value || '');
21
25
  const [valid, setValid] = useState(true);
@@ -38,6 +42,11 @@ const Template = ({
38
42
  onFocus={onFocus}
39
43
  onBlur={onBlur}
40
44
  isValid={valid}
45
+ international={international}
46
+ enableAreaCodeStretch={enableAreaCodeStretch}
47
+ defaultCountry={defaultCountry}
48
+ disabled={disabled}
49
+ id={id}
41
50
  />
42
51
  );
43
52
  };
@@ -46,50 +55,16 @@ const Template = ({
46
55
  export const Default = Template.bind({});
47
56
  Default.args = {
48
57
  country: 'IN',
49
- value: '9134567890',
58
+ value: '91',
50
59
  width: '400px',
51
60
  placeholder: 'Enter phone number',
52
61
  onChange: () => {},
53
62
  onFocus: () => {},
54
63
  onBlur: () => {},
55
64
  isValid: true,
56
- };
57
-
58
- // Story with initial value
59
- export const WithInitialValue = Template.bind({});
60
- WithInitialValue.args = {
61
- country: 'IN',
62
- value: '9176543210',
63
- width: '300px',
64
- onChange: () => {},
65
- placeholder: 'Enter phone number',
66
- onFocus: () => {},
67
- onBlur: () => {},
68
- isValid: true,
69
- };
70
-
71
- // Story with a custom country
72
- export const WithCustomCountry = Template.bind({});
73
- WithCustomCountry.args = {
74
- country: 'IN',
75
- value: '9176543210',
76
- width: '300px',
77
- onChange: () => {},
78
- placeholder: 'Enter phone number',
79
- onFocus: () => {},
80
- onBlur: () => {},
81
- isValid: true,
82
- };
83
-
84
- // Story with empty value
85
- export const EmptyValue = Template.bind({});
86
- EmptyValue.args = {
87
- country: 'IN',
88
- value: '91',
89
- width: '500px',
90
- onChange: () => {},
91
- placeholder: 'Enter phone number',
92
- onFocus: () => {},
93
- onBlur: () => {},
94
- isValid: false,
65
+ international: true,
66
+ enableAreaCodeStretch: true,
67
+ defaultCountry: 'IN',
68
+ disabled: false,
69
+ id: 'addPrimaryNumberId',
95
70
  };
@@ -1,6 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import PhoneInput from 'react-phone-input-2';
3
- import 'react-phone-input-2/lib/style.css';
4
3
  import { PhoneInputProps } from './types';
5
4
  import Typography from '../Typography';
6
5
  import './PhoneInput.scss';
@@ -13,6 +12,10 @@ const PhoneInputField: React.FC<PhoneInputProps> = ({
13
12
  placeholder = 'Enter phone number',
14
13
  onFocus,
15
14
  onBlur,
15
+ id,
16
+ dropdownStyle = {},
17
+ enableAreaCodeStretch = false,
18
+ disabled = false,
16
19
  }) => {
17
20
  const [phone, setPhone] = useState<string>(value);
18
21
  const [isFocused, setIsFocused] = useState(false);
@@ -57,8 +60,10 @@ const PhoneInputField: React.FC<PhoneInputProps> = ({
57
60
  };
58
61
 
59
62
  return (
60
- <div>
63
+ <div id={id}>
61
64
  <PhoneInput
65
+ specialLabel=""
66
+ countryCodeEditable={false}
62
67
  country={country}
63
68
  value={phone}
64
69
  onChange={handlePhoneChange}
@@ -77,6 +82,9 @@ const PhoneInputField: React.FC<PhoneInputProps> = ({
77
82
  placeholder={placeholder}
78
83
  onFocus={handleFocus}
79
84
  onBlur={handleBlur}
85
+ dropdownStyle={dropdownStyle}
86
+ enableAreaCodeStretch={enableAreaCodeStretch}
87
+ disabled={disabled}
80
88
  />
81
89
  {error && !isFocused && (
82
90
  <Typography color={'var(--error_light)'} className="error">