pixel-react-excel-sheet 1.0.11 → 1.0.13
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.
- package/.yarn/install-state.gz +0 -0
- package/lib/1fb4472b34e4fe07.css +1 -0
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/types.d.ts +12 -0
- package/lib/components/AddVariables/AddVariables.d.ts +5 -0
- package/lib/components/AddVariables/index.d.ts +1 -0
- package/lib/components/AddVariables/types.d.ts +35 -0
- package/lib/components/AppHeader/types.d.ts +2 -0
- package/lib/components/AttachImage/AttachImage.d.ts +1 -6
- package/lib/components/AttachImage/types.d.ts +8 -0
- package/lib/components/Avatar/types.d.ts +9 -1
- package/lib/components/Charts/BarChart/BarChart.d.ts +1 -0
- package/lib/components/Charts/DashboardDonutChart/types.d.ts +6 -0
- package/lib/components/Checkbox/types.d.ts +4 -0
- package/lib/components/Comment/Comments.d.ts +4 -0
- package/lib/components/Comment/comment/Comment.d.ts +11 -0
- package/lib/components/Comment/comment/useNode.d.ts +7 -0
- package/lib/components/Comment/index.d.ts +1 -0
- package/lib/components/Comment/type.d.ts +25 -0
- package/lib/components/CreateVariable/CreateVariableSlider.d.ts +5 -0
- package/lib/components/CreateVariable/index.d.ts +1 -0
- package/lib/components/CreateVariable/types.d.ts +56 -0
- package/lib/components/Drawer/Types.d.ts +13 -0
- package/lib/components/Editor/constants.d.ts +1 -1
- package/lib/components/Editor/types.d.ts +10 -2
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +8 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +2 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +13 -6
- package/lib/components/FileDropzone/RadioFilePreview.d.ts +4 -0
- package/lib/components/FileDropzone/types.d.ts +61 -0
- package/lib/components/IconButton/IconButton.d.ts +1 -2
- package/lib/components/IconButton/types.d.ts +1 -0
- package/lib/components/Input/Input.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +3 -2
- package/lib/components/MiniModal/types.d.ts +7 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/PhoneInput/PhoneInput.d.ts +6 -0
- package/lib/components/PhoneInput/index.d.ts +1 -0
- package/lib/components/PhoneInput/types.d.ts +10 -0
- package/lib/components/PopUpModal/types.d.ts +1 -0
- package/lib/components/Search/Search.d.ts +1 -1
- package/lib/components/Search/types.d.ts +4 -0
- package/lib/components/Select/components/types.d.ts +1 -0
- package/lib/components/Select/types.d.ts +2 -0
- package/lib/components/Table/Types.d.ts +1 -1
- package/lib/components/TableTree/Components/TableBody.d.ts +4 -0
- package/lib/components/TableTree/Components/TableCell.d.ts +4 -0
- package/lib/components/TableTree/Components/TableHead.d.ts +4 -0
- package/lib/components/TableTree/Components/TableRow.d.ts +4 -0
- package/lib/components/TableTree/Utils/getAllChildIds.d.ts +1 -0
- package/lib/components/TableTree/types.d.ts +38 -5
- package/lib/components/TableWithAccordion/TableWithAccordion.d.ts +5 -0
- package/lib/components/TableWithAccordion/data.d.ts +8 -0
- package/lib/components/TableWithAccordion/index.d.ts +1 -0
- package/lib/components/TableWithAccordion/types.d.ts +67 -0
- package/lib/components/Tabs/types.d.ts +1 -0
- package/lib/index.d.ts +395 -39
- package/lib/index.esm.js +3859 -1017
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3866 -1016
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/FormatString/FormatString.d.ts +1 -0
- package/lib/utils/checkDuplicates/checkDuplicates.d.ts +1 -0
- package/package.json +2 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +15 -0
- package/src/assets/Themes/BaseTheme.scss +16 -0
- package/src/assets/Themes/DarkTheme.scss +71 -42
- package/src/assets/icons/add_file.svg +4 -17
- package/src/assets/icons/add_variable.svg +11 -0
- package/src/assets/icons/authorization.svg +4 -0
- package/src/assets/icons/authorization_icon.svg +1 -0
- package/src/assets/icons/backward.svg +10 -0
- package/src/assets/icons/capture_icon.svg +3 -0
- package/src/assets/icons/depends_on_script.svg +7 -0
- package/src/assets/icons/download_file_icon.svg +2 -9
- package/src/assets/icons/email_group.svg +3 -0
- package/src/assets/icons/executions_icon.svg +3 -0
- package/src/assets/icons/forward.svg +3 -0
- package/src/assets/icons/labels.svg +8 -0
- package/src/assets/icons/machine_disable_icon.svg +18 -0
- package/src/assets/icons/machine_enable_icon.svg +10 -0
- package/src/assets/icons/parameters.svg +3 -0
- package/src/assets/icons/pre_post_condition.svg +8 -0
- package/src/assets/icons/program_element.svg +8 -0
- package/src/assets/icons/project_status_icon.svg +10 -0
- package/src/assets/icons/refresh_icon.svg +4 -0
- package/src/assets/icons/rotate_icon.svg +10 -0
- package/src/assets/icons/suites_icon.svg +3 -0
- package/src/assets/icons/swipe_icon.svg +9 -0
- package/src/assets/icons/tap_icon.svg +4 -0
- package/src/assets/icons/test_data.svg +5 -0
- package/src/assets/icons/test_data_set.svg +7 -0
- package/src/assets/icons/variable_set.svg +5 -0
- package/src/assets/icons/window_maximize.svg +1 -2
- package/src/assets/icons/window_restore.svg +4 -0
- package/src/assets/styles/_colors.scss +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/Accordion/Accordion.tsx +7 -1
- package/src/components/Accordion/types.ts +12 -0
- package/src/components/AddVariables/AddVariables.scss +14 -0
- package/src/components/AddVariables/AddVariables.stories.tsx +44 -0
- package/src/components/AddVariables/AddVariables.tsx +113 -0
- package/src/components/AddVariables/index.ts +1 -0
- package/src/components/AddVariables/types.ts +36 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +1 -1
- package/src/components/AppHeader/AppHeader.scss +40 -1
- package/src/components/AppHeader/AppHeader.stories.tsx +133 -5
- package/src/components/AppHeader/AppHeader.tsx +111 -112
- package/src/components/AppHeader/types.ts +10 -9
- package/src/components/AttachImage/AttachImage.stories.tsx +2 -0
- package/src/components/AttachImage/AttachImage.tsx +5 -9
- package/src/components/AttachImage/types.ts +25 -18
- package/src/components/Avatar/Avatar.scss +4 -0
- package/src/components/Avatar/Avatar.stories.tsx +38 -18
- package/src/components/Avatar/Avatar.tsx +19 -3
- package/src/components/Avatar/types.ts +9 -1
- package/src/components/Charts/BarChart/BarChart.scss +4 -1
- package/src/components/Charts/BarChart/BarChart.tsx +23 -9
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.scss +10 -3
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +2 -1
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +54 -25
- package/src/components/Charts/DashboardDonutChart/types.ts +7 -1
- package/src/components/Charts/DonutChart/DonutChart.tsx +8 -3
- package/src/components/Charts/LineChart/LineChart.scss +13 -9
- package/src/components/Charts/LineChart/LineChart.tsx +6 -2
- package/src/components/Charts/RadialChart/RadialChart.scss +4 -0
- package/src/components/Charts/RadialChart/RadialChart.tsx +51 -45
- package/src/components/Checkbox/Checkbox.scss +57 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +91 -15
- package/src/components/Checkbox/Checkbox.tsx +4 -1
- package/src/components/Checkbox/types.ts +4 -0
- package/src/components/Comment/Comments.scss +166 -0
- package/src/components/Comment/Comments.stories.tsx +212 -0
- package/src/components/Comment/Comments.tsx +51 -0
- package/src/components/Comment/comment/Comment.tsx +206 -0
- package/src/components/Comment/comment/useNode.ts +51 -0
- package/src/components/Comment/index.ts +1 -0
- package/src/components/Comment/type.ts +36 -0
- package/src/components/CreateVariable/CreateVariableSlider.scss +18 -0
- package/src/components/CreateVariable/CreateVariableSlider.stories.tsx +66 -0
- package/src/components/CreateVariable/CreateVariableSlider.tsx +95 -0
- package/src/components/CreateVariable/index.ts +1 -0
- package/src/components/CreateVariable/types.ts +58 -0
- package/src/components/DatePicker/DatePicker.scss +11 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +19 -0
- package/src/components/DatePicker/DatePicker.tsx +73 -22
- package/src/components/Drawer/Drawer.scss +3 -2
- package/src/components/Drawer/Drawer.stories.tsx +0 -1
- package/src/components/Drawer/Drawer.tsx +4 -1
- package/src/components/Drawer/Types.ts +13 -0
- package/src/components/Editor/Editor.stories.tsx +2 -2
- package/src/components/Editor/Editor.tsx +4 -2
- package/src/components/Editor/VariableDropdown.scss +8 -2
- package/src/components/Editor/VariableDropdown.tsx +15 -7
- package/src/components/Editor/constants.ts +1 -1
- package/src/components/Editor/types.ts +12 -2
- package/src/components/Excel/ExcelFile/ExcelFile.scss +0 -1
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +41 -25
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +12 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +2 -34
- package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +26 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +24 -22
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +1 -3
- package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +13 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +53 -26
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +81 -14
- package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +17 -6
- package/src/components/Excel/ExcelFile.stories.tsx +4 -4
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +36 -19
- package/src/components/Excel/dataConversion.ts +43 -20
- package/src/components/FieldSet/FieldSet.scss +2 -1
- package/src/components/FieldSet/FieldSet.stories.tsx +2 -1
- package/src/components/FileDropzone/Dropzone.tsx +76 -28
- package/src/components/FileDropzone/FileDropzone.scss +30 -3
- package/src/components/FileDropzone/FileDropzone.stories.tsx +125 -4
- package/src/components/FileDropzone/FileDropzone.tsx +46 -13
- package/src/components/FileDropzone/RadioFilePreview.tsx +76 -0
- package/src/components/FileDropzone/types.ts +73 -0
- package/src/components/Icon/iconList.ts +47 -2
- package/src/components/IconButton/IconButton.scss +11 -11
- package/src/components/IconButton/IconButton.stories.tsx +1 -0
- package/src/components/IconButton/IconButton.tsx +6 -8
- package/src/components/IconButton/types.ts +2 -1
- package/src/components/IconRadioGroup/IconRadioGroup.scss +2 -1
- package/src/components/Input/Input.scss +137 -125
- package/src/components/Input/Input.tsx +110 -93
- package/src/components/InputWithDropdown/InputWithDropdown.scss +9 -2
- package/src/components/InputWithDropdown/types.ts +3 -3
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +1 -1
- package/src/components/MenuOption/MenuOption.stories.tsx +4 -3
- package/src/components/MenuOption/MenuOption.tsx +1 -1
- package/src/components/MenuOption/types.ts +4 -2
- package/src/components/MiniModal/MiniModal.scss +0 -4
- package/src/components/MiniModal/MiniModal.stories.tsx +3 -2
- package/src/components/MiniModal/MiniModal.tsx +28 -10
- package/src/components/MiniModal/types.ts +7 -0
- package/src/components/Modal/Modal.stories.tsx +2 -1
- package/src/components/ModulesChip/ModuleChip.scss +21 -8
- package/src/components/ModulesChip/ModuleChip.stories.tsx +2 -2
- package/src/components/ModulesChip/ModuleChip.tsx +6 -9
- package/src/components/MultiSelect/Dropdown.tsx +12 -5
- package/src/components/MultiSelect/MultiSelect.scss +29 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +31 -14
- package/src/components/MultiSelect/MultiSelect.tsx +32 -21
- package/src/components/PhoneInput/PhoneInput.d.ts +3 -0
- package/src/components/PhoneInput/PhoneInput.stories.tsx +95 -0
- package/src/components/PhoneInput/PhoneInput.tsx +90 -0
- package/src/components/PhoneInput/index.ts +1 -0
- package/src/components/PhoneInput/phoneInput.scss +3 -0
- package/src/components/PhoneInput/types.ts +10 -0
- package/src/components/PopUpModal/PopUpModal.stories.tsx +14 -13
- package/src/components/PopUpModal/PopUpModal.tsx +2 -1
- package/src/components/PopUpModal/types.ts +14 -13
- package/src/components/Search/Search.stories.tsx +28 -9
- package/src/components/Search/Search.tsx +32 -29
- package/src/components/Search/types.ts +4 -0
- package/src/components/Select/Select.scss +20 -0
- package/src/components/Select/Select.stories.tsx +50 -1
- package/src/components/Select/Select.tsx +34 -7
- package/src/components/Select/components/Dropdown.scss +9 -0
- package/src/components/Select/components/Dropdown.tsx +20 -6
- package/src/components/Select/components/types.ts +1 -0
- package/src/components/Select/types.ts +12 -2
- package/src/components/Table/Table.scss +6 -5
- package/src/components/Table/Types.ts +1 -1
- package/src/components/TableTree/Components/TableBody.tsx +35 -0
- package/src/components/TableTree/Components/TableCell.tsx +59 -0
- package/src/components/TableTree/Components/TableHead.tsx +39 -0
- package/src/components/TableTree/Components/TableRow.tsx +37 -0
- package/src/components/TableTree/TableTree.scss +8 -5
- package/src/components/TableTree/TableTree.tsx +16 -46
- package/src/components/TableTree/Utils/getAllChildIds.ts +12 -0
- package/src/components/TableTree/Utils/renderSpaces.ts +0 -0
- package/src/components/TableTree/types.ts +43 -5
- package/src/components/TableWithAccordion/TableWithAccordion.scss +54 -0
- package/src/components/TableWithAccordion/TableWithAccordion.stories.tsx +94 -0
- package/src/components/TableWithAccordion/TableWithAccordion.tsx +174 -0
- package/src/components/TableWithAccordion/data.ts +37 -0
- package/src/components/TableWithAccordion/index.ts +1 -0
- package/src/components/TableWithAccordion/types.ts +70 -0
- package/src/components/Tabs/Tabs.scss +58 -5
- package/src/components/Tabs/Tabs.stories.tsx +31 -12
- package/src/components/Tabs/Tabs.tsx +27 -18
- package/src/components/Tabs/types.ts +1 -1
- package/src/components/TextArea/Textarea.stories.tsx +1 -1
- package/src/hooks/useFileDropzone.tsx +2 -1
- package/src/index.ts +18 -1
- package/src/utils/FormatString/FormatString.stories.tsx +58 -0
- package/src/utils/FormatString/FormatString.tsx +41 -0
- package/src/utils/checkDuplicates/CheckDuplicates.stories.tsx +40 -0
- package/src/utils/checkDuplicates/checkDuplicates.ts +13 -0
|
@@ -217,6 +217,40 @@ const CustomDatePicker: React.FC<DatePickerProps> = ({
|
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
+
const isDisabledDate = (
|
|
221
|
+
year: number | null,
|
|
222
|
+
month: number | null,
|
|
223
|
+
minDate?: Date,
|
|
224
|
+
maxDate?: Date
|
|
225
|
+
): boolean => {
|
|
226
|
+
const isMinDateValid = minDate instanceof Date && !isNaN(minDate.getTime());
|
|
227
|
+
const isMaxDateValid = maxDate instanceof Date && !isNaN(maxDate.getTime());
|
|
228
|
+
|
|
229
|
+
if (isMinDateValid) {
|
|
230
|
+
if (year !== null && year < minDate.getFullYear()) return true;
|
|
231
|
+
if (
|
|
232
|
+
year !== null &&
|
|
233
|
+
month !== null &&
|
|
234
|
+
year === minDate.getFullYear() &&
|
|
235
|
+
month < minDate.getMonth()
|
|
236
|
+
)
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (isMaxDateValid) {
|
|
241
|
+
if (year !== null && year > maxDate.getFullYear()) return true;
|
|
242
|
+
if (
|
|
243
|
+
year !== null &&
|
|
244
|
+
month !== null &&
|
|
245
|
+
year === maxDate.getFullYear() &&
|
|
246
|
+
month > maxDate.getMonth()
|
|
247
|
+
)
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return false;
|
|
252
|
+
};
|
|
253
|
+
|
|
220
254
|
useEffect(() => {
|
|
221
255
|
if (isPickerOpen && view === 'years') {
|
|
222
256
|
const currentYear =
|
|
@@ -255,17 +289,28 @@ const CustomDatePicker: React.FC<DatePickerProps> = ({
|
|
|
255
289
|
const CustomMonthGrid: React.FC = () => {
|
|
256
290
|
return (
|
|
257
291
|
<div className="ff-custom-month_grid">
|
|
258
|
-
{months.map((month: string, index: number) =>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
292
|
+
{months.map((month: string, index: number) => {
|
|
293
|
+
const isDisabled = isDisabledDate(
|
|
294
|
+
selectedMonth?.getFullYear() || null,
|
|
295
|
+
index,
|
|
296
|
+
minDate,
|
|
297
|
+
maxDate
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
return (
|
|
301
|
+
<div
|
|
302
|
+
key={index}
|
|
303
|
+
onClick={() => !isDisabled && handleMonthSelect(index)}
|
|
304
|
+
className={classNames('ff-custom-month', {
|
|
305
|
+
'ff-custom-month--selected':
|
|
306
|
+
index === selectedMonth?.getMonth(),
|
|
307
|
+
'ff-custom-month--disabled': isDisabled,
|
|
308
|
+
})}
|
|
309
|
+
>
|
|
310
|
+
<Typography>{month}</Typography>
|
|
311
|
+
</div>
|
|
312
|
+
);
|
|
313
|
+
})}
|
|
269
314
|
</div>
|
|
270
315
|
);
|
|
271
316
|
};
|
|
@@ -303,17 +348,23 @@ const CustomDatePicker: React.FC<DatePickerProps> = ({
|
|
|
303
348
|
const CustomYearGrid: React.FC = () => {
|
|
304
349
|
return (
|
|
305
350
|
<div className="ff-custom-year_grid">
|
|
306
|
-
{years.map((year: number) =>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
351
|
+
{years.map((year: number) => {
|
|
352
|
+
const isDisabled = isDisabledDate(year, null, minDate, maxDate);
|
|
353
|
+
|
|
354
|
+
return (
|
|
355
|
+
<div
|
|
356
|
+
key={year}
|
|
357
|
+
onClick={() => !isDisabled && handleYearSelect(year)}
|
|
358
|
+
className={classNames('ff-custom-year', {
|
|
359
|
+
'ff-custom-year--selected':
|
|
360
|
+
year === selectedMonth?.getFullYear(),
|
|
361
|
+
'ff-custom-year--disabled': isDisabled,
|
|
362
|
+
})}
|
|
363
|
+
>
|
|
364
|
+
<Typography>{year}</Typography>
|
|
365
|
+
</div>
|
|
366
|
+
);
|
|
367
|
+
})}
|
|
317
368
|
</div>
|
|
318
369
|
);
|
|
319
370
|
};
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
right: 0;
|
|
20
20
|
bottom: 0;
|
|
21
21
|
top: 87px;
|
|
22
|
-
min-width: 450px;
|
|
23
22
|
background-color: var(--primary-button-text-color);
|
|
24
23
|
z-index: 999;
|
|
25
24
|
transform: translateX(100%);
|
|
@@ -78,7 +77,7 @@
|
|
|
78
77
|
display: flex;
|
|
79
78
|
align-items: center;
|
|
80
79
|
justify-content: space-between;
|
|
81
|
-
gap:
|
|
80
|
+
gap: 8px;
|
|
82
81
|
height: 24px;
|
|
83
82
|
|
|
84
83
|
.ff-action-button {
|
|
@@ -101,6 +100,7 @@
|
|
|
101
100
|
.ff-custom-header {
|
|
102
101
|
background-color: var(--drawer-footer-bg);
|
|
103
102
|
padding: 4px 8px;
|
|
103
|
+
width: 100%;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
z-index: 1000;
|
|
124
124
|
background-color: var(--base-bg-color);
|
|
125
125
|
transform: translateY(3px);
|
|
126
|
+
border-radius: 0 0 4px 4px;
|
|
126
127
|
|
|
127
128
|
.button-container {
|
|
128
129
|
display: flex;
|
|
@@ -36,6 +36,9 @@ const Drawer: FC<DrawerProps> = ({
|
|
|
36
36
|
zIndex = 999,
|
|
37
37
|
secondLayerZIndex = false,
|
|
38
38
|
top,
|
|
39
|
+
height,
|
|
40
|
+
width,
|
|
41
|
+
right = 0,
|
|
39
42
|
}: DrawerProps) => {
|
|
40
43
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
41
44
|
|
|
@@ -85,7 +88,7 @@ const Drawer: FC<DrawerProps> = ({
|
|
|
85
88
|
className={classNames('ff-drawer', `ff-drawer--${drawerSize}`, {
|
|
86
89
|
'ff-drawer--open': isOpen,
|
|
87
90
|
})}
|
|
88
|
-
style={{ zIndex, top }}
|
|
91
|
+
style={{ zIndex, top, height, width, right }}
|
|
89
92
|
>
|
|
90
93
|
{showHeader && (
|
|
91
94
|
<div
|
|
@@ -141,4 +141,17 @@ export interface DrawerProps {
|
|
|
141
141
|
* Custom top for the drawer
|
|
142
142
|
*/
|
|
143
143
|
top?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Height of the drawer
|
|
146
|
+
*/
|
|
147
|
+
height?: string;
|
|
148
|
+
/**
|
|
149
|
+
*
|
|
150
|
+
* width of the drawer
|
|
151
|
+
*/
|
|
152
|
+
width?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Position from right
|
|
155
|
+
*/
|
|
156
|
+
right?: string | number;
|
|
144
157
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import Editor from './Editor';
|
|
4
4
|
import { EditorProps } from './types';
|
|
5
|
-
import {
|
|
5
|
+
import { variableList } from './constants';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
|
|
8
8
|
const meta: Meta<EditorProps> = {
|
|
@@ -49,6 +49,6 @@ export const Default: Story = {
|
|
|
49
49
|
width: '100%',
|
|
50
50
|
height: '90vh',
|
|
51
51
|
readOnly: false,
|
|
52
|
-
variableOptionsList:
|
|
52
|
+
variableOptionsList: variableList,
|
|
53
53
|
},
|
|
54
54
|
};
|
|
@@ -115,8 +115,8 @@ const Editor = forwardRef<any, EditorProps>(
|
|
|
115
115
|
option?.type === 'GLOBAL'
|
|
116
116
|
? 'GV'
|
|
117
117
|
: option?.type === 'LOCAL'
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
? 'LV'
|
|
119
|
+
: 'PEV'
|
|
120
120
|
);
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -235,6 +235,8 @@ const Editor = forwardRef<any, EditorProps>(
|
|
|
235
235
|
/>
|
|
236
236
|
{showDropdown && dropdownPosition && (
|
|
237
237
|
<VariableDropdown
|
|
238
|
+
position="absolute"
|
|
239
|
+
width="300px"
|
|
238
240
|
optionsList={variableOptionsList}
|
|
239
241
|
onSelectVariable={handleSelectVariable}
|
|
240
242
|
dropdownPosition={dropdownPosition}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
.ff-variable-dropdown {
|
|
2
|
-
position: absolute;
|
|
3
|
-
width: 200px;
|
|
4
2
|
height: 300px;
|
|
5
3
|
display: flex;
|
|
6
4
|
flex-direction: column;
|
|
@@ -8,6 +6,14 @@
|
|
|
8
6
|
border: 1px solid var(--border-color);
|
|
9
7
|
border-radius: 3px;
|
|
10
8
|
z-index: 9999;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
&.absolute {
|
|
12
|
+
position: absolute;
|
|
13
|
+
}
|
|
14
|
+
&.relative {
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
11
17
|
}
|
|
12
18
|
.ff-variable-option {
|
|
13
19
|
display: flex;
|
|
@@ -3,19 +3,27 @@ import { VariableDropdownProps, DyanamicObj } from './types';
|
|
|
3
3
|
import Icon from '../Icon';
|
|
4
4
|
import './VariableDropdown.scss';
|
|
5
5
|
import Typography from '../Typography';
|
|
6
|
+
import cx from 'classnames';
|
|
6
7
|
|
|
7
8
|
const VariableDropdown: FC<VariableDropdownProps> = ({
|
|
8
9
|
optionsList = [],
|
|
9
10
|
onSelectVariable,
|
|
10
11
|
dropdownPosition,
|
|
12
|
+
position = 'relative',
|
|
13
|
+
width = '300px',
|
|
11
14
|
}): ReactNode => {
|
|
12
15
|
return (
|
|
13
16
|
<div
|
|
14
|
-
className=
|
|
15
|
-
style={
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
className={cx('ff-variable-dropdown', position)}
|
|
18
|
+
style={
|
|
19
|
+
dropdownPosition
|
|
20
|
+
? {
|
|
21
|
+
top: dropdownPosition.top + 30,
|
|
22
|
+
left: dropdownPosition.left - 30,
|
|
23
|
+
width,
|
|
24
|
+
}
|
|
25
|
+
: { width }
|
|
26
|
+
}
|
|
19
27
|
>
|
|
20
28
|
{optionsList?.map((option: DyanamicObj): ReactNode => {
|
|
21
29
|
return (
|
|
@@ -32,8 +40,8 @@ const VariableDropdown: FC<VariableDropdownProps> = ({
|
|
|
32
40
|
option?.type === 'LOCAL'
|
|
33
41
|
? 'local_variable_icon'
|
|
34
42
|
: option?.type === 'GLOBAL'
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
? 'global_variable_icon'
|
|
44
|
+
: 'project_env_variable_icon'
|
|
37
45
|
}
|
|
38
46
|
height={16}
|
|
39
47
|
width={16}
|
|
@@ -58,10 +58,20 @@ export interface dropdownPositionType {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export interface VariableDropdownProps {
|
|
61
|
+
/**
|
|
62
|
+
* Position whether absoloute or relative
|
|
63
|
+
*/
|
|
64
|
+
position: 'absolute' | 'relative';
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Dropdown width
|
|
68
|
+
*/
|
|
69
|
+
width: string;
|
|
70
|
+
|
|
61
71
|
/**
|
|
62
72
|
* List of variables
|
|
63
73
|
*/
|
|
64
|
-
optionsList:
|
|
74
|
+
optionsList: DyanamicObj[];
|
|
65
75
|
|
|
66
76
|
/**
|
|
67
77
|
* Function to handle click on variable
|
|
@@ -71,7 +81,7 @@ export interface VariableDropdownProps {
|
|
|
71
81
|
/**
|
|
72
82
|
* Dropdown postion used for dropdown placement
|
|
73
83
|
*/
|
|
74
|
-
dropdownPosition
|
|
84
|
+
dropdownPosition?: dropdownPositionType;
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
export interface option {
|
|
@@ -9,7 +9,10 @@ import { toast } from '../../Toastify/Toastify';
|
|
|
9
9
|
import { ContextMenuState } from './ExcelFileComponents/types';
|
|
10
10
|
import ExcelContextMenu from '../ExcelContextMenu/ExcelContextMenu';
|
|
11
11
|
import Typography from '../../Typography';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
convertStyleToBackend,
|
|
14
|
+
convertStyleToFrontend,
|
|
15
|
+
} from '../dataConversion';
|
|
13
16
|
import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
|
|
14
17
|
|
|
15
18
|
interface ExcelFileProps {
|
|
@@ -34,7 +37,9 @@ interface ExcelFileProps {
|
|
|
34
37
|
|
|
35
38
|
const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
36
39
|
excelData,
|
|
37
|
-
onSave = (saveData) => {
|
|
40
|
+
onSave = (saveData) => {
|
|
41
|
+
saveData();
|
|
42
|
+
},
|
|
38
43
|
}) => {
|
|
39
44
|
const [sheetNames, setSheetNames] = useState<string[]>([]);
|
|
40
45
|
const [contextMenu, setContextMenu] = React.useState<ContextMenuState>({
|
|
@@ -46,11 +51,19 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
46
51
|
const EmptyRow: CellBase = {
|
|
47
52
|
value: '',
|
|
48
53
|
style: {
|
|
49
|
-
color: 'var(--
|
|
54
|
+
color: 'var(--input-hover-border-color)',
|
|
50
55
|
backgroundColor: 'var(--drawer-footer-bg)',
|
|
51
|
-
borderColor: 'var(--
|
|
52
|
-
textDecoration: 'none',
|
|
53
|
-
|
|
56
|
+
borderColor: 'var(--excel-sheet-border)',
|
|
57
|
+
textDecoration: 'none solid',
|
|
58
|
+
borderRight: `1px solid var(--excel-sheet-border)`,
|
|
59
|
+
borderLeft: `1px solid var(--excel-sheet-border)`,
|
|
60
|
+
borderTop: `1px solid var(--excel-sheet-border)`,
|
|
61
|
+
borderBottom: `1px solid var(--excel-sheet-border)`,
|
|
62
|
+
fontSize: '15px',
|
|
63
|
+
fontWeight: 'normal',
|
|
64
|
+
fontStyle: 'normal',
|
|
65
|
+
fontFamily: 'Times New Roman',
|
|
66
|
+
textAlign: 'center',
|
|
54
67
|
},
|
|
55
68
|
};
|
|
56
69
|
|
|
@@ -110,9 +123,9 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
110
123
|
payload.sheets.forEach((sheet) => {
|
|
111
124
|
const sheetName = sheet.sheetName;
|
|
112
125
|
const json = sheet.data;
|
|
113
|
-
const maxRows = Math.max(
|
|
126
|
+
const maxRows = Math.max(26, json.length + 2);
|
|
114
127
|
const maxCols = Math.max(
|
|
115
|
-
|
|
128
|
+
26,
|
|
116
129
|
Math.max(...json.map((row) => row.length)) + 2
|
|
117
130
|
);
|
|
118
131
|
|
|
@@ -128,7 +141,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
128
141
|
}
|
|
129
142
|
spreadsheetData[rowIndex][colIndex] = {
|
|
130
143
|
value: checkVal(cell.value),
|
|
131
|
-
style: convertStyleToFrontend(cell?.style)
|
|
144
|
+
style: convertStyleToFrontend(cell?.style),
|
|
132
145
|
type: true,
|
|
133
146
|
};
|
|
134
147
|
}
|
|
@@ -153,7 +166,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
153
166
|
},
|
|
154
167
|
[onSave]
|
|
155
168
|
);
|
|
156
|
-
|
|
169
|
+
|
|
157
170
|
React.useEffect(() => {
|
|
158
171
|
document.addEventListener('keydown', handleSave);
|
|
159
172
|
return () => {
|
|
@@ -176,18 +189,21 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
176
189
|
}, -1);
|
|
177
190
|
|
|
178
191
|
const filteredRow = row
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
.map((cell, index) => {
|
|
193
|
+
if (cell && cell.value !== null) {
|
|
194
|
+
return {
|
|
195
|
+
value: cell.value,
|
|
196
|
+
styles: convertStyleToBackend(cell.style ?? {}),
|
|
197
|
+
};
|
|
198
|
+
} else if ((cell && cell.type) || index <= lastIndex) {
|
|
199
|
+
return {
|
|
200
|
+
value: '',
|
|
201
|
+
styles: convertStyleToBackend(cell?.style ?? {}),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return null;
|
|
205
|
+
})
|
|
206
|
+
.filter((cell) => cell !== null);
|
|
191
207
|
|
|
192
208
|
return filteredRow.length > 0 ? filteredRow : [];
|
|
193
209
|
}) || [];
|
|
@@ -208,7 +224,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
208
224
|
onSave(savedData);
|
|
209
225
|
toast.success('File saved successfully!');
|
|
210
226
|
};
|
|
211
|
-
|
|
227
|
+
|
|
212
228
|
const onEvaluateChange = (data: Matrix.Matrix<CellBase>) => {
|
|
213
229
|
setWorksheetsData((prev) => ({ ...prev, [pageRef.current]: data }));
|
|
214
230
|
onSaveWorksheetData();
|
|
@@ -232,8 +248,8 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
232
248
|
const baseName = 'NewSheet';
|
|
233
249
|
const existingSheetNames = sheetNames;
|
|
234
250
|
const newSheetName = generateUniqueSheetName(baseName, existingSheetNames);
|
|
235
|
-
const newSheetData = Array.from({ length:
|
|
236
|
-
Array.from({ length:
|
|
251
|
+
const newSheetData = Array.from({ length: 26 }, () =>
|
|
252
|
+
Array.from({ length: 26 }, () => EmptyRow)
|
|
237
253
|
);
|
|
238
254
|
setSheetNames((prev) => [...prev, newSheetName]);
|
|
239
255
|
setSelectedSheet({ index: sheetNames?.length, name: newSheetName });
|
|
@@ -21,6 +21,10 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
21
21
|
[dispatch]
|
|
22
22
|
);
|
|
23
23
|
const edit = React.useCallback(() => dispatch(Actions.edit()), [dispatch]);
|
|
24
|
+
const autoFill = React.useCallback(
|
|
25
|
+
(value: boolean) => dispatch(Actions.autoFill(value)),
|
|
26
|
+
[dispatch]
|
|
27
|
+
);
|
|
24
28
|
const commit = React.useCallback(
|
|
25
29
|
(changes: Types.CommitChanges<Types.CellBase>) =>
|
|
26
30
|
dispatch(Actions.commit(changes)),
|
|
@@ -103,6 +107,10 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
103
107
|
const DataEditor = (cell && cell.DataEditor) || props.DataEditor;
|
|
104
108
|
const readOnly = cell && cell.readOnly;
|
|
105
109
|
|
|
110
|
+
const handleMouseDown = React.useCallback(() => {
|
|
111
|
+
mode === 'view' ? autoFill(true) : autoFill(false);
|
|
112
|
+
}, [mode, autoFill]);
|
|
113
|
+
|
|
106
114
|
return hidden ? null : (
|
|
107
115
|
<div
|
|
108
116
|
ref={rootRef}
|
|
@@ -124,6 +132,10 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
124
132
|
exitEditMode={view}
|
|
125
133
|
/>
|
|
126
134
|
)}
|
|
135
|
+
<div
|
|
136
|
+
onMouseDown={handleMouseDown}
|
|
137
|
+
className="select_dot"
|
|
138
|
+
></div>
|
|
127
139
|
</div>
|
|
128
140
|
);
|
|
129
141
|
};
|
|
@@ -24,8 +24,6 @@ export const Cell: React.FC<Types.CellComponentProps> = ({
|
|
|
24
24
|
setCellData,
|
|
25
25
|
setContextMenu,
|
|
26
26
|
}): React.ReactElement => {
|
|
27
|
-
const [isDotDragging, setIsDotDragging] = React.useState(false);
|
|
28
|
-
const [first, setFirst] = React.useState(true);
|
|
29
27
|
const rootRef = React.useRef<HTMLTableCellElement | null>(null);
|
|
30
28
|
const point = React.useMemo(
|
|
31
29
|
(): Point.Point => ({
|
|
@@ -69,37 +67,12 @@ export const Cell: React.FC<Types.CellComponentProps> = ({
|
|
|
69
67
|
|
|
70
68
|
const handleMouseOver = React.useCallback(
|
|
71
69
|
(event: React.MouseEvent<HTMLTableCellElement>) => {
|
|
72
|
-
if (dragging
|
|
70
|
+
if (dragging) {
|
|
73
71
|
setCellDimensions(point, getOffsetRect(event.currentTarget));
|
|
74
72
|
select(point);
|
|
75
73
|
}
|
|
76
74
|
},
|
|
77
|
-
[setCellDimensions, select, dragging, point
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const handleDotDown = React.useCallback(
|
|
81
|
-
(event: React.MouseEvent<HTMLTableCellElement>) => {
|
|
82
|
-
setIsDotDragging(true);
|
|
83
|
-
setCellDimensions(point, getOffsetRect(event.currentTarget));
|
|
84
|
-
|
|
85
|
-
if (event.shiftKey) {
|
|
86
|
-
select(point);
|
|
87
|
-
} else {
|
|
88
|
-
activate(point);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
[setCellDimensions, point, select, activate]
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const handleDotOver = React.useCallback(
|
|
95
|
-
(event: React.MouseEvent<HTMLTableCellElement>) => {
|
|
96
|
-
setFirst(false);
|
|
97
|
-
if (dragging && isDotDragging) {
|
|
98
|
-
setCellDimensions(point, getOffsetRect(event.currentTarget));
|
|
99
|
-
select(point);
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
[setCellDimensions, select, dragging, point, isDotDragging]
|
|
75
|
+
[setCellDimensions, select, dragging, point]
|
|
103
76
|
);
|
|
104
77
|
|
|
105
78
|
const contextClick = React.useCallback(
|
|
@@ -153,11 +126,6 @@ export const Cell: React.FC<Types.CellComponentProps> = ({
|
|
|
153
126
|
evaluatedCell={evaluatedData}
|
|
154
127
|
setCellData={setCellData}
|
|
155
128
|
/>
|
|
156
|
-
<div
|
|
157
|
-
// className="Selection_dot" TODO
|
|
158
|
-
onMouseOver={handleDotOver}
|
|
159
|
-
onMouseDown={handleDotDown}
|
|
160
|
-
></div>
|
|
161
129
|
</td>
|
|
162
130
|
);
|
|
163
131
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import * as Types from './types';
|
|
4
|
+
import useSelector from './use-selector';
|
|
5
|
+
import { getCellDimensions } from './util';
|
|
4
6
|
|
|
5
7
|
export type Props = {
|
|
6
8
|
variant?: string;
|
|
@@ -15,7 +17,30 @@ const FloatingRect: React.FC<Props> = ({
|
|
|
15
17
|
hidden,
|
|
16
18
|
variant,
|
|
17
19
|
}) => {
|
|
20
|
+
const active = useSelector((state) => state.active);
|
|
21
|
+
const autoFill = useSelector((state) => state.autoFill);
|
|
22
|
+
const FixedVal = useSelector((state) =>
|
|
23
|
+
active
|
|
24
|
+
? getCellDimensions(active, state.rowDimensions, state.columnDimensions)
|
|
25
|
+
: undefined
|
|
26
|
+
);
|
|
27
|
+
|
|
18
28
|
const { width, height, top, left } = dimensions || {};
|
|
29
|
+
|
|
30
|
+
let sampleHeight = FixedVal?.height ?? 0;
|
|
31
|
+
let sampleWidth = FixedVal?.width ?? 0;
|
|
32
|
+
let adjustedWidth = width;
|
|
33
|
+
let adjustedHeight = height;
|
|
34
|
+
if (autoFill.open && width && height && FixedVal) {
|
|
35
|
+
if (width - sampleWidth > height - sampleHeight) {
|
|
36
|
+
adjustedWidth = width;
|
|
37
|
+
adjustedHeight = FixedVal.height;
|
|
38
|
+
} else {
|
|
39
|
+
adjustedHeight = height;
|
|
40
|
+
adjustedWidth = FixedVal.width;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
19
44
|
return (
|
|
20
45
|
<div
|
|
21
46
|
className={classnames('ff-spreadsheet-floating-rect', {
|
|
@@ -23,7 +48,7 @@ const FloatingRect: React.FC<Props> = ({
|
|
|
23
48
|
'ff-spreadsheet-floating-rect--dragging': dragging,
|
|
24
49
|
'ff-spreadsheet-floating-rect--hidden': hidden,
|
|
25
50
|
})}
|
|
26
|
-
style={{ width, height, top, left }}
|
|
51
|
+
style={{ width: adjustedWidth, height: adjustedHeight, top, left }}
|
|
27
52
|
/>
|
|
28
53
|
);
|
|
29
54
|
};
|