pixel-react-excel-sheet 1.0.10 → 1.0.12

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 (202) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/1fb4472b34e4fe07.css +1 -0
  3. package/lib/components/Accordion/Accordion.d.ts +1 -1
  4. package/lib/components/Accordion/types.d.ts +12 -0
  5. package/lib/components/AddVariables/AddVariables.d.ts +5 -0
  6. package/lib/components/AddVariables/index.d.ts +1 -0
  7. package/lib/components/AddVariables/types.d.ts +35 -0
  8. package/lib/components/AppHeader/types.d.ts +2 -0
  9. package/lib/components/AttachImage/AttachImage.d.ts +1 -6
  10. package/lib/components/AttachImage/types.d.ts +8 -0
  11. package/lib/components/Avatar/types.d.ts +9 -1
  12. package/lib/components/Checkbox/types.d.ts +4 -0
  13. package/lib/components/Comment/Comments.d.ts +4 -0
  14. package/lib/components/Comment/comment/Comment.d.ts +11 -0
  15. package/lib/components/Comment/comment/useNode.d.ts +7 -0
  16. package/lib/components/Comment/index.d.ts +1 -0
  17. package/lib/components/Comment/type.d.ts +25 -0
  18. package/lib/components/CreateVariable/CreateVariableSlider.d.ts +5 -0
  19. package/lib/components/CreateVariable/index.d.ts +1 -0
  20. package/lib/components/CreateVariable/types.d.ts +56 -0
  21. package/lib/components/Drawer/Types.d.ts +13 -0
  22. package/lib/components/Editor/constants.d.ts +1 -1
  23. package/lib/components/Editor/types.d.ts +10 -2
  24. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +8 -1
  25. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +2 -0
  26. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +13 -6
  27. package/lib/components/IconButton/IconButton.d.ts +1 -2
  28. package/lib/components/IconButton/types.d.ts +1 -0
  29. package/lib/components/Input/Input.d.ts +1 -1
  30. package/lib/components/MiniModal/types.d.ts +7 -0
  31. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  32. package/lib/components/PhoneInput/PhoneInput.d.ts +6 -0
  33. package/lib/components/PhoneInput/index.d.ts +1 -0
  34. package/lib/components/PhoneInput/types.d.ts +10 -0
  35. package/lib/components/PopUpModal/types.d.ts +1 -0
  36. package/lib/components/Select/components/types.d.ts +1 -0
  37. package/lib/components/Select/types.d.ts +2 -0
  38. package/lib/components/TableTree/Components/TableBody.d.ts +4 -0
  39. package/lib/components/TableTree/Components/TableCell.d.ts +4 -0
  40. package/lib/components/TableTree/Components/TableHead.d.ts +4 -0
  41. package/lib/components/TableTree/Components/TableRow.d.ts +4 -0
  42. package/lib/components/TableTree/Utils/getAllChildIds.d.ts +1 -0
  43. package/lib/components/TableTree/types.d.ts +38 -5
  44. package/lib/components/TableWithAccordion/TableWithAccordion.d.ts +5 -0
  45. package/lib/components/TableWithAccordion/data.d.ts +8 -0
  46. package/lib/components/TableWithAccordion/index.d.ts +1 -0
  47. package/lib/components/TableWithAccordion/types.d.ts +67 -0
  48. package/lib/index.d.ts +303 -17
  49. package/lib/index.esm.js +3372 -747
  50. package/lib/index.esm.js.map +1 -1
  51. package/lib/index.js +3377 -746
  52. package/lib/index.js.map +1 -1
  53. package/lib/tsconfig.tsbuildinfo +1 -1
  54. package/lib/utils/checkDuplicates/checkDuplicates.d.ts +1 -0
  55. package/package.json +2 -1
  56. package/src/assets/Themes/BaseTheme.scss +14 -0
  57. package/src/assets/Themes/DarkTheme.scss +68 -41
  58. package/src/assets/icons/add_file.svg +4 -17
  59. package/src/assets/icons/add_variable.svg +11 -0
  60. package/src/assets/icons/authorization.svg +4 -0
  61. package/src/assets/icons/authorization_icon.svg +1 -0
  62. package/src/assets/icons/backward.svg +10 -0
  63. package/src/assets/icons/capture_icon.svg +3 -0
  64. package/src/assets/icons/depends_on_script.svg +7 -0
  65. package/src/assets/icons/download_file_icon.svg +2 -9
  66. package/src/assets/icons/email_group.svg +3 -0
  67. package/src/assets/icons/executions_icon.svg +3 -0
  68. package/src/assets/icons/forward.svg +3 -0
  69. package/src/assets/icons/labels.svg +8 -0
  70. package/src/assets/icons/machine_disable_icon.svg +18 -0
  71. package/src/assets/icons/machine_enable_icon.svg +10 -0
  72. package/src/assets/icons/parameters.svg +3 -0
  73. package/src/assets/icons/pre_post_condition.svg +8 -0
  74. package/src/assets/icons/program_element.svg +8 -0
  75. package/src/assets/icons/project_status_icon.svg +10 -0
  76. package/src/assets/icons/refresh_icon.svg +4 -0
  77. package/src/assets/icons/rotate_icon.svg +10 -0
  78. package/src/assets/icons/suites_icon.svg +3 -0
  79. package/src/assets/icons/swipe_icon.svg +9 -0
  80. package/src/assets/icons/tap_icon.svg +4 -0
  81. package/src/assets/icons/test_data.svg +5 -0
  82. package/src/assets/icons/test_data_set.svg +7 -0
  83. package/src/assets/icons/variable_set.svg +5 -0
  84. package/src/assets/styles/_colors.scss +0 -1
  85. package/src/components/Accordion/Accordion.stories.tsx +4 -0
  86. package/src/components/Accordion/Accordion.tsx +7 -1
  87. package/src/components/Accordion/types.ts +12 -0
  88. package/src/components/AddVariables/AddVariables.scss +14 -0
  89. package/src/components/AddVariables/AddVariables.stories.tsx +44 -0
  90. package/src/components/AddVariables/AddVariables.tsx +113 -0
  91. package/src/components/AddVariables/index.ts +1 -0
  92. package/src/components/AddVariables/types.ts +36 -0
  93. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +1 -1
  94. package/src/components/AppHeader/AppHeader.scss +40 -1
  95. package/src/components/AppHeader/AppHeader.stories.tsx +133 -5
  96. package/src/components/AppHeader/AppHeader.tsx +111 -112
  97. package/src/components/AppHeader/types.ts +10 -9
  98. package/src/components/AttachImage/AttachImage.stories.tsx +2 -0
  99. package/src/components/AttachImage/AttachImage.tsx +5 -9
  100. package/src/components/AttachImage/types.ts +25 -18
  101. package/src/components/Avatar/Avatar.scss +4 -0
  102. package/src/components/Avatar/Avatar.stories.tsx +38 -18
  103. package/src/components/Avatar/Avatar.tsx +19 -3
  104. package/src/components/Avatar/types.ts +9 -1
  105. package/src/components/Charts/DonutChart/DonutChart.tsx +8 -3
  106. package/src/components/Charts/RadialChart/RadialChart.scss +4 -0
  107. package/src/components/Charts/RadialChart/RadialChart.tsx +51 -45
  108. package/src/components/Checkbox/Checkbox.scss +57 -0
  109. package/src/components/Checkbox/Checkbox.stories.tsx +91 -15
  110. package/src/components/Checkbox/Checkbox.tsx +4 -1
  111. package/src/components/Checkbox/types.ts +4 -0
  112. package/src/components/Comment/Comments.scss +166 -0
  113. package/src/components/Comment/Comments.stories.tsx +212 -0
  114. package/src/components/Comment/Comments.tsx +51 -0
  115. package/src/components/Comment/comment/Comment.tsx +206 -0
  116. package/src/components/Comment/comment/useNode.ts +51 -0
  117. package/src/components/Comment/index.ts +1 -0
  118. package/src/components/Comment/type.ts +36 -0
  119. package/src/components/CreateVariable/CreateVariableSlider.scss +18 -0
  120. package/src/components/CreateVariable/CreateVariableSlider.stories.tsx +66 -0
  121. package/src/components/CreateVariable/CreateVariableSlider.tsx +95 -0
  122. package/src/components/CreateVariable/index.ts +1 -0
  123. package/src/components/CreateVariable/types.ts +58 -0
  124. package/src/components/Drawer/Drawer.scss +3 -2
  125. package/src/components/Drawer/Drawer.stories.tsx +0 -1
  126. package/src/components/Drawer/Drawer.tsx +4 -1
  127. package/src/components/Drawer/Types.ts +13 -0
  128. package/src/components/Editor/Editor.stories.tsx +2 -2
  129. package/src/components/Editor/Editor.tsx +4 -2
  130. package/src/components/Editor/VariableDropdown.scss +8 -2
  131. package/src/components/Editor/VariableDropdown.tsx +15 -7
  132. package/src/components/Editor/constants.ts +1 -1
  133. package/src/components/Editor/types.ts +12 -2
  134. package/src/components/Excel/ExcelFile/ExcelFile.scss +3 -1
  135. package/src/components/Excel/ExcelFile/ExcelFile.tsx +37 -21
  136. package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +12 -0
  137. package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +2 -34
  138. package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +26 -1
  139. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +1 -1
  140. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +25 -21
  141. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +1 -3
  142. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +13 -0
  143. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +53 -26
  144. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +81 -14
  145. package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +17 -6
  146. package/src/components/Excel/ExcelFile.stories.tsx +4 -4
  147. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +36 -19
  148. package/src/components/Excel/dataConversion.ts +43 -20
  149. package/src/components/FieldSet/FieldSet.scss +2 -1
  150. package/src/components/FieldSet/FieldSet.stories.tsx +2 -1
  151. package/src/components/FileDropzone/FileDropzone.scss +0 -1
  152. package/src/components/Icon/iconList.ts +45 -2
  153. package/src/components/IconButton/IconButton.scss +11 -11
  154. package/src/components/IconButton/IconButton.stories.tsx +1 -0
  155. package/src/components/IconButton/IconButton.tsx +6 -8
  156. package/src/components/IconButton/types.ts +2 -1
  157. package/src/components/IconRadioGroup/IconRadioGroup.scss +2 -1
  158. package/src/components/Input/Input.tsx +99 -88
  159. package/src/components/LabelEditTextField/LabelEditTextField.tsx +1 -1
  160. package/src/components/MiniModal/MiniModal.scss +0 -4
  161. package/src/components/MiniModal/MiniModal.stories.tsx +3 -2
  162. package/src/components/MiniModal/MiniModal.tsx +28 -10
  163. package/src/components/MiniModal/types.ts +7 -0
  164. package/src/components/Modal/Modal.stories.tsx +2 -1
  165. package/src/components/MultiSelect/MultiSelect.scss +29 -0
  166. package/src/components/MultiSelect/MultiSelect.stories.tsx +19 -5
  167. package/src/components/MultiSelect/MultiSelect.tsx +29 -19
  168. package/src/components/PhoneInput/PhoneInput.d.ts +3 -0
  169. package/src/components/PhoneInput/PhoneInput.stories.tsx +95 -0
  170. package/src/components/PhoneInput/PhoneInput.tsx +90 -0
  171. package/src/components/PhoneInput/index.ts +1 -0
  172. package/src/components/PhoneInput/phoneInput.scss +3 -0
  173. package/src/components/PhoneInput/types.ts +10 -0
  174. package/src/components/PopUpModal/PopUpModal.stories.tsx +14 -13
  175. package/src/components/PopUpModal/PopUpModal.tsx +2 -1
  176. package/src/components/PopUpModal/types.ts +14 -13
  177. package/src/components/Select/Select.scss +20 -0
  178. package/src/components/Select/Select.stories.tsx +50 -1
  179. package/src/components/Select/Select.tsx +34 -7
  180. package/src/components/Select/components/Dropdown.scss +9 -0
  181. package/src/components/Select/components/Dropdown.tsx +20 -6
  182. package/src/components/Select/components/types.ts +1 -0
  183. package/src/components/Select/types.ts +12 -2
  184. package/src/components/TableTree/Components/TableBody.tsx +35 -0
  185. package/src/components/TableTree/Components/TableCell.tsx +59 -0
  186. package/src/components/TableTree/Components/TableHead.tsx +39 -0
  187. package/src/components/TableTree/Components/TableRow.tsx +37 -0
  188. package/src/components/TableTree/TableTree.scss +8 -5
  189. package/src/components/TableTree/TableTree.tsx +16 -46
  190. package/src/components/TableTree/Utils/getAllChildIds.ts +12 -0
  191. package/src/components/TableTree/Utils/renderSpaces.ts +0 -0
  192. package/src/components/TableTree/types.ts +43 -5
  193. package/src/components/TableWithAccordion/TableWithAccordion.scss +54 -0
  194. package/src/components/TableWithAccordion/TableWithAccordion.stories.tsx +94 -0
  195. package/src/components/TableWithAccordion/TableWithAccordion.tsx +174 -0
  196. package/src/components/TableWithAccordion/data.ts +37 -0
  197. package/src/components/TableWithAccordion/index.ts +1 -0
  198. package/src/components/TableWithAccordion/types.ts +70 -0
  199. package/src/components/Tabs/Tabs.scss +0 -1
  200. package/src/index.ts +14 -1
  201. package/src/utils/checkDuplicates/CheckDuplicates.stories.tsx +40 -0
  202. package/src/utils/checkDuplicates/checkDuplicates.ts +13 -0
@@ -0,0 +1,54 @@
1
+ @use '../../assets/styles/fonts';
2
+ @use '../../assets/styles/colors';
3
+
4
+ .ff-accordion-table-container {
5
+ overflow-y: auto;
6
+ .ff-accordion-table {
7
+ width: 100%;
8
+ .ff-table-header,
9
+ .ff-table-cell {
10
+ text-align: left;
11
+ padding: 9px;
12
+ }
13
+ .ff-table-header {
14
+ color: var(--text-color);
15
+ border-bottom: 1px solid var(--slider-table-color);
16
+ }
17
+ .ff-table-body {
18
+ .ff-table-row:hover {
19
+ background-color: var(--hover-color);
20
+ }
21
+ }
22
+ &--primary-bg {
23
+ background-color: var(--table-with-accordion-header-primary-bg);
24
+ }
25
+ &--secondary-bg {
26
+ background-color: var(--secondary-bg);
27
+ }
28
+ &--default-bg {
29
+ background-color: var(--default-bg);
30
+ }
31
+ }
32
+ .ff-accordion-fixed-header {
33
+ position: sticky;
34
+ top: 0;
35
+ z-index: 99;
36
+ background-color: var(--file-details-bg);
37
+ }
38
+ .column-table-accordion {
39
+ width: 100%;
40
+ .accordion-header {
41
+ display: flex;
42
+ align-items: center;
43
+ .header-title {
44
+ padding: 8px;
45
+ }
46
+ .accordion-arrow {
47
+ img {
48
+ height: 30px;
49
+ width: 35px;
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,94 @@
1
+ import { StoryObj, Meta } from '@storybook/react';
2
+ import TableWithAccordion from './TableWithAccordion';
3
+ import { sampleData } from './data';
4
+
5
+ const meta: Meta<typeof TableWithAccordion> = {
6
+ title: 'Components/TableWithAccordion',
7
+ component: TableWithAccordion,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ tags: ['autodocs'],
12
+ };
13
+
14
+ type Story = StoryObj<typeof TableWithAccordion>;
15
+ const defaultArgs = {
16
+ tableMeta: [],
17
+ tableData: [],
18
+ };
19
+
20
+ const emptyData: never[] = [];
21
+ const columnsData = [
22
+ {
23
+ header: 'Description',
24
+ accessor: 'desc',
25
+ width: 100,
26
+ },
27
+ {
28
+ header: 'SUITE NAME',
29
+ accessor: 'suiteName',
30
+ width: 100,
31
+ },
32
+ {
33
+ header: 'SUITE TYPE',
34
+ accessor: 'suiteName',
35
+ width: 100,
36
+ },
37
+ {
38
+ header: 'SUITE ACCESS',
39
+ accessor: 'suiteName',
40
+ width: 100,
41
+ },
42
+ {
43
+ header: 'Modified By',
44
+ accessor: 'modifiedBy',
45
+ width: 100,
46
+ },
47
+ ];
48
+
49
+ export const TableWithRowAccordion: Story = {
50
+ args: {
51
+ ...defaultArgs,
52
+ tableMeta: columnsData,
53
+ tableData: sampleData,
54
+ accordionType: 'row',
55
+ TableAccordionStateIconWidth:4,
56
+ TableAccordionStateIconHeight:8,
57
+ },
58
+ };
59
+ export const TableWithColumnAccordion: Story = {
60
+ args: {
61
+ ...defaultArgs,
62
+ tableMeta: columnsData,
63
+ tableData: sampleData,
64
+ accordionType: 'column',
65
+ TableAccordionStateIconWidth:4,
66
+ TableAccordionStateIconHeight:8,
67
+ },
68
+ };
69
+
70
+ export const EmtptyTableWithColumnAccordion: Story = {
71
+ args: {
72
+ ...defaultArgs,
73
+ tableMeta: columnsData,
74
+ tableData: emptyData,
75
+ accordionType: 'column',
76
+ TableAccordionStateIconWidth:4,
77
+ TableAccordionStateIconHeight:8,
78
+ },
79
+ };
80
+
81
+ export const AccordionTableWithFixedHeader: Story = {
82
+ args: {
83
+ ...defaultArgs,
84
+ tableMeta: columnsData,
85
+ tableData: sampleData,
86
+ accordionType: 'row',
87
+ height: '200px',
88
+ withFixedHeader: true,
89
+ TableAccordionStateIconWidth:4,
90
+ TableAccordionStateIconHeight:8,
91
+ },
92
+ };
93
+
94
+ export default meta;
@@ -0,0 +1,174 @@
1
+ import { useState } from 'react';
2
+ import classNames from 'classnames';
3
+ import Accordion from '../Accordion';
4
+ import './TableWithAccordion.scss';
5
+ import Icon from '../Icon';
6
+ import Tooltip from '../Tooltip';
7
+ import '../../../index.scss';
8
+ import Typography from '../Typography';
9
+ import { ColumnProps, TableProps } from './types';
10
+
11
+ const TableWithAccordion = ({
12
+ tableMeta = [],
13
+ tableData = [],
14
+ accordionType = 'row',
15
+ noDataContent,
16
+ height = '100%',
17
+ withFixedHeader = false,
18
+ headerType,
19
+ TableAccordionStateIconWidth = 4,
20
+ TableAccordionStateIconHeight = 8,
21
+ }: TableProps) => {
22
+ const [expandedRowIndex, setExpandedRowIndex] = useState(-1);
23
+ const onAccordionClick = (index: number) => {
24
+ setExpandedRowIndex(index === expandedRowIndex ? -1 : index);
25
+ };
26
+ const getAccordionTableCellContent = (
27
+ dataObj: any,
28
+ columnObj: ColumnProps
29
+ ) => {
30
+ let cellData = dataObj[columnObj.accessor];
31
+ if (columnObj.cell) {
32
+ return columnObj.cell({
33
+ value: cellData,
34
+ row: dataObj,
35
+ column: columnObj.accessor,
36
+ });
37
+ } else if (columnObj.accessor) {
38
+ return cellData;
39
+ } else if (cellData && typeof cellData !== 'object') {
40
+ return cellData;
41
+ } else {
42
+ return '--';
43
+ }
44
+ };
45
+ const getAccordionTableContent = (dataArray: any) => {
46
+ const accordionSubTable = dataArray.map((rowData: any, index: number) => {
47
+ return (
48
+ <table className="ff-accordion-table" cellSpacing={0}>
49
+ <tbody className="ff-table-body">
50
+ <tr className="ff-table-row" key={rowData.id || index}>
51
+ {tableMeta.map((column, i) => {
52
+ return (
53
+ <td
54
+ className="ff-table-cell"
55
+ key={column.accessor + i}
56
+ style={{ width: column.width }}
57
+ >
58
+ {accordionType === 'column' && i === 0 ? (
59
+ ''
60
+ ) : (
61
+ <Typography>
62
+ {getAccordionTableCellContent(rowData, column)}
63
+ </Typography>
64
+ )}
65
+ </td>
66
+ );
67
+ })}
68
+ </tr>
69
+ </tbody>
70
+ </table>
71
+ );
72
+ });
73
+ return accordionSubTable;
74
+ };
75
+ return (
76
+ <div
77
+ style={{ height: height }}
78
+ className={classNames('ff-accordion-table-container', {
79
+ 'ff-accordion-fixed-header-table': withFixedHeader,
80
+ })}
81
+ >
82
+ <table
83
+ cellSpacing={0}
84
+ className={classNames('ff-accordion-table', {
85
+ 'ff-accordion-fixed-header': withFixedHeader,
86
+ })}
87
+ >
88
+ <thead>
89
+ <tr className="ff-table-row">
90
+ {tableMeta.map((column) => (
91
+ <th
92
+ key={column.header}
93
+ style={{ width: column.width }}
94
+ className={classNames(
95
+ 'ff-table-header',
96
+ headerType && `ff-accordion-table--${headerType}-bg`
97
+ )}
98
+ >
99
+ <div>
100
+ <Typography fontWeight="medium" fontSize={12}>
101
+ {column.header}
102
+ </Typography>
103
+ </div>
104
+ </th>
105
+ ))}
106
+ </tr>
107
+ </thead>
108
+ </table>
109
+ {accordionType === 'row' &&
110
+ tableData.map((row: any) => (
111
+ <Accordion
112
+ headerTitle={row.title}
113
+ color="var(--text-color)"
114
+ accordionContent={getAccordionTableContent(row.data)}
115
+ disable={row.disable}
116
+ disableInfoMessage={row.disableInfoMessage}
117
+ accordionStateIconName="arrows_down_icon"
118
+ AccordionStateIconWidth={TableAccordionStateIconWidth}
119
+ AccordionStateIconHeight={TableAccordionStateIconHeight}
120
+ />
121
+ ))}
122
+ {accordionType === 'column' &&
123
+ tableData.map((row: any, index: number) => (
124
+ <div className="column-table-accordion">
125
+ <div className="ff-display-flex">
126
+ <Tooltip title={row?.disableInfoMessage}>
127
+ <div
128
+ className={`accordion-header ${row.disable && 'ff-disabled'}`}
129
+ >
130
+ <div className="header-title">
131
+ <span>
132
+ <Typography fontWeight="regular">{row.title}</Typography>
133
+ </span>
134
+ </div>
135
+
136
+ <div
137
+ className="accordion-arrow"
138
+ onClick={() => {
139
+ !row.disable && onAccordionClick(index);
140
+ }}
141
+ >
142
+ <Icon
143
+ name={
144
+ expandedRowIndex === index
145
+ ? 'arrows_down_icon'
146
+ : 'arrows_right_icon'
147
+ }
148
+ color="var(--table-with-accordion-icon-color)"
149
+ width={TableAccordionStateIconWidth}
150
+ height={TableAccordionStateIconHeight}
151
+ hoverEffect={false}
152
+ />
153
+ </div>
154
+ </div>
155
+ </Tooltip>
156
+ </div>
157
+ {expandedRowIndex === index && (
158
+ <div>{getAccordionTableContent(row.data)}</div>
159
+ )}
160
+ </div>
161
+ ))}
162
+ {tableData.length <= 0 && (
163
+ <div
164
+ className="no-data-content"
165
+ style={{ height: `calc(${height} - 50px)` }}
166
+ >
167
+ {noDataContent}
168
+ </div>
169
+ )}
170
+ </div>
171
+ );
172
+ };
173
+
174
+ export default TableWithAccordion;
@@ -0,0 +1,37 @@
1
+ export const sampleData = [
2
+ {
3
+ title: 'Pre conditions',
4
+ data: [
5
+ {
6
+ desc: 'Open Browser',
7
+ modifiedBy: 'Ram',
8
+ suiteName: 'test',
9
+ },
10
+ ],
11
+ },
12
+ {
13
+ title: 'Steps',
14
+ data: [
15
+ {
16
+ desc: '1. SG1',
17
+ modifiedBy: 'Ram',
18
+ suiteName: 'suite1',
19
+ },
20
+ {
21
+ desc: '2. SG2',
22
+ modifiedBy: 'Laxman',
23
+ suiteName: 'suite 2',
24
+ },
25
+ ],
26
+ },
27
+ {
28
+ title: 'Post conditions',
29
+ data: [
30
+ {
31
+ desc: 'close browser',
32
+ modifiedBy: 'Krishna',
33
+ suiteName: 'test 2',
34
+ },
35
+ ],
36
+ },
37
+ ];
@@ -0,0 +1 @@
1
+ export { default } from './TableWithAccordion';
@@ -0,0 +1,70 @@
1
+ import { ReactNode } from "react";
2
+
3
+ export interface ColumnProps {
4
+ /**
5
+ * column name
6
+ */
7
+ header: string;
8
+ /**
9
+ * data key for particular column
10
+ */
11
+ accessor: string;
12
+ /**
13
+ * className for a column
14
+ */
15
+ className?: string;
16
+ /**
17
+ * width of a column
18
+ */
19
+ width?: number;
20
+ /**
21
+ * data for the column
22
+ */
23
+ cell?: (e: any) => JSX.Element | string | ReactNode;
24
+ }
25
+
26
+ export interface DataProps {
27
+ /**
28
+ * data for each row
29
+ */
30
+ [key: string]: any;
31
+ }
32
+
33
+ export interface TableProps {
34
+ /**
35
+ * Column details for table
36
+ */
37
+ tableMeta: Array<ColumnProps>;
38
+ /**
39
+ * Data for table
40
+ */
41
+ tableData: Array<DataProps>;
42
+ /**
43
+ * Table type
44
+ */
45
+ accordionType: 'row' | 'column';
46
+ /**
47
+ * Specific sentence to be displayed data not found
48
+ */
49
+ noDataContent?: string | ReactNode;
50
+ /**
51
+ * withFixedHeader prop to have non-scrollable fixed accordion table header
52
+ */
53
+ withFixedHeader?: boolean;
54
+ /**
55
+ * Height of the table in string
56
+ */
57
+ height?: string;
58
+ /**
59
+ * Header type to have different background color
60
+ */
61
+ headerType: 'default' | 'primary' | 'secondary';
62
+ /**
63
+ * Accordion collapse and expand Icon width
64
+ */
65
+ TableAccordionStateIconWidth:number,
66
+ /**
67
+ * Accordion collapse and expand Icon height
68
+ */
69
+ TableAccordionStateIconHeight:number,
70
+ }
@@ -8,7 +8,6 @@
8
8
  &--default {
9
9
  display: flex;
10
10
  gap: 8px;
11
- border: 1px solid var(--tabs-border-color);
12
11
  border-radius: 8px 8px 0 0;
13
12
  padding: 7px 8px 0;
14
13
 
package/src/index.ts CHANGED
@@ -54,7 +54,7 @@ import SequentialConnectingBranch from './components/SequentialConnectingBranch'
54
54
  import AttachmentButton from './components/AttachmentButton';
55
55
  import { Toastify, toast } from './components/Toastify/Toastify';
56
56
  import ToggleSwitch from './components/ToggleSwitch/ToggleSwitch';
57
- import Avatar from './components/Avatar/Avatar';
57
+ import Avatar from './components/Avatar';
58
58
 
59
59
  import LabelEditTextField from './components/LabelEditTextField';
60
60
  import EditTextField from './components/EditTextField';
@@ -68,6 +68,9 @@ import VariableDropdown from './components/Editor/VariableDropdown';
68
68
  import LineChart from './components/Charts/LineChart';
69
69
  import DownloadClient from './components/DownloadClient/DownloadClient';
70
70
  import FieldSet from './components/FieldSet';
71
+ import CreateVariableSlider from './components/CreateVariable/CreateVariableSlider';
72
+ import TableWithAccordion from './components/TableWithAccordion/TableWithAccordion';
73
+
71
74
  // Utils imports
72
75
  import { checkEmpty } from './utils/checkEmpty/checkEmpty';
73
76
  import {
@@ -88,8 +91,12 @@ import Editor from './components/Editor/Editor';
88
91
  import { getSequentialPayload } from './utils/getSequentialPayload/getSequentialPayload';
89
92
  import ConnectingBranch from './components/ConnectingBranch/ConnectingBranch';
90
93
  import { saveFileFromBlob } from './utils/downloadFile/saveFileFromBlob';
94
+ import Comments from './components/Comment/Comments';
91
95
  import useFileDropzone from './hooks/useFileDropzone';
92
96
  import PopUpModal from './components/PopUpModal/PopUpModal';
97
+ import AddVariables from './components/AddVariables/AddVariables';
98
+ import { hasDuplicateFile } from './utils/checkDuplicates/checkDuplicates';
99
+ import PhoneInputField from './components/PhoneInput';
93
100
 
94
101
  export {
95
102
  Button,
@@ -167,8 +174,13 @@ export {
167
174
  VariableDropdown,
168
175
  DownloadClient,
169
176
  FieldSet,
177
+ Comments,
170
178
  PopUpModal,
179
+ CreateVariableSlider,
180
+ AddVariables,
181
+ PhoneInputField,
171
182
 
183
+ TableWithAccordion,
172
184
  // utils exports
173
185
  checkEmpty,
174
186
  getExtension,
@@ -184,4 +196,5 @@ export {
184
196
  getSequentialPayload,
185
197
  saveFileFromBlob,
186
198
  useFileDropzone,
199
+ hasDuplicateFile,
187
200
  };
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+ import { hasDuplicateFile } from './checkDuplicates';
4
+
5
+ export default {
6
+ title: 'Utils/HasDuplicateFile',
7
+ argTypes: {
8
+ array: {
9
+ control: 'object',
10
+ description: 'Array of objects to check for duplicates.',
11
+ },
12
+ property: {
13
+ control: 'text',
14
+ description: 'Optional property to check for duplicates.',
15
+ },
16
+ },
17
+ } satisfies Meta;
18
+
19
+ export const Default: StoryObj = {
20
+ args: {
21
+ array: [
22
+ { id: 1, name: 'file1' },
23
+ { id: 2, name: 'file2' },
24
+ { id: 1, name: 'file1' },
25
+ ],
26
+ property: 'id',
27
+ },
28
+ render: (args) => {
29
+ const result = hasDuplicateFile(args.array, args.property);
30
+ return (
31
+ <div>
32
+ <h3>
33
+ Duplicate Check Result:{' '}
34
+ {result ? 'Duplicates Found' : 'No Duplicates'}
35
+ </h3>
36
+ <pre>{JSON.stringify(args.array, null, 2)}</pre>
37
+ </div>
38
+ );
39
+ },
40
+ };
@@ -0,0 +1,13 @@
1
+ // Will be used to find duplicate key-value pair in an array of objects.
2
+
3
+ export const hasDuplicateFile = (array: any[], property: string): boolean => {
4
+ const seen = new Set();
5
+ for (const obj of array) {
6
+ const key = property ? obj[property] : JSON.stringify(obj);
7
+ if (seen.has(key)) {
8
+ return true;
9
+ }
10
+ seen.add(key);
11
+ }
12
+ return false;
13
+ };