pixel-react-excel-sheet 1.0.31 → 1.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/lib/components/Accordion/Accordion.d.ts +1 -1
  2. package/lib/components/Accordion/types.d.ts +4 -0
  3. package/lib/components/AllProjectsDropdown/types.d.ts +2 -0
  4. package/lib/components/Button/Button.d.ts +2 -2
  5. package/lib/components/Button/types.d.ts +17 -0
  6. package/lib/components/Charts/DashboardDonutChart/types.d.ts +2 -0
  7. package/lib/components/Charts/MultiRadialChart/types.d.ts +3 -0
  8. package/lib/components/ChooseFile/ChooseFile.d.ts +3 -0
  9. package/lib/components/ChooseFile/types.d.ts +68 -0
  10. package/lib/components/ConditionalDropdown/ConditionalDropdown.d.ts +1 -2
  11. package/lib/components/ConditionalDropdown/types.d.ts +4 -4
  12. package/lib/components/ConnectingBranch/ConnectingBranch.d.ts +2 -1
  13. package/lib/components/ConnectingBranch/data.d.ts +19 -33
  14. package/lib/components/ConnectingBranch/types.d.ts +10 -0
  15. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +7 -1
  16. package/lib/components/FileDropzone/types.d.ts +12 -4
  17. package/lib/components/LabelEditTextField/types.d.ts +3 -1
  18. package/lib/components/MachineInputField/MachineInputField.d.ts +4 -1
  19. package/lib/components/ScriptSwitchButton/ScriptSwitchButton.d.ts +9 -0
  20. package/lib/components/ScriptSwitchButton/index.d.ts +1 -0
  21. package/lib/components/Select/types.d.ts +1 -1
  22. package/lib/components/StatusCard/types.d.ts +2 -0
  23. package/lib/components/TableTree/Components/TableCell.d.ts +1 -1
  24. package/lib/components/TableTree/Components/TableRow.d.ts +1 -1
  25. package/lib/components/TableTree/data.d.ts +115 -1
  26. package/lib/components/TableTree/types.d.ts +4 -0
  27. package/lib/components/TextArea/Textarea.d.ts +1 -1
  28. package/lib/components/TextArea/Types.d.ts +1 -0
  29. package/lib/components/ThemeProvider/types.d.ts +1 -1
  30. package/lib/index.d.ts +250 -75
  31. package/lib/index.esm.js +863 -489
  32. package/lib/index.esm.js.map +1 -1
  33. package/lib/index.js +909 -488
  34. package/lib/index.js.map +1 -1
  35. package/lib/tsconfig.tsbuildinfo +1 -1
  36. package/lib/utils/validateFile/validateFile.d.ts +2 -0
  37. package/lib/validations/regex.d.ts +46 -0
  38. package/package.json +2 -2
  39. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +5 -0
  40. package/src/assets/Themes/BaseTheme.scss +2 -1
  41. package/src/assets/Themes/BlueTheme.scss +279 -0
  42. package/src/assets/Themes/DarkTheme.scss +2 -1
  43. package/src/assets/Themes/Theme.scss +5 -0
  44. package/src/assets/icons/failed_status_icon.svg +1 -1
  45. package/src/assets/icons/flaky_status_icon.svg +1 -1
  46. package/src/assets/icons/settings.svg +3 -0
  47. package/src/assets/icons/skipped_status_icon.svg +1 -1
  48. package/src/assets/icons/warning_status_icon.svg +1 -1
  49. package/src/components/Accordion/Accordion.stories.tsx +13 -0
  50. package/src/components/Accordion/Accordion.tsx +2 -1
  51. package/src/components/Accordion/types.ts +4 -0
  52. package/src/components/AllProjectsDropdown/types.ts +2 -0
  53. package/src/components/AppHeader/AppHeader.scss +6 -2
  54. package/src/components/AppHeader/AppHeader.tsx +4 -2
  55. package/src/components/Button/Button.scss +12 -0
  56. package/src/components/Button/Button.tsx +29 -11
  57. package/src/components/Button/types.ts +21 -0
  58. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.scss +83 -30
  59. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +3 -0
  60. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +39 -16
  61. package/src/components/Charts/DashboardDonutChart/types.ts +2 -0
  62. package/src/components/Charts/MultiRadialChart/MultiRadialChart.scss +0 -1
  63. package/src/components/Charts/MultiRadialChart/MultiRadialChart.stories.tsx +2 -1
  64. package/src/components/Charts/MultiRadialChart/MultiRadialChart.tsx +18 -4
  65. package/src/components/Charts/MultiRadialChart/types.ts +4 -1
  66. package/src/components/ChooseFile/ChooseFile.stories.tsx +190 -0
  67. package/src/components/ChooseFile/ChooseFile.tsx +46 -0
  68. package/src/components/ChooseFile/types.ts +78 -0
  69. package/src/components/ConditionalDropdown/ConditionalDropdown.stories.tsx +8 -5
  70. package/src/components/ConditionalDropdown/ConditionalDropdown.tsx +133 -135
  71. package/src/components/ConditionalDropdown/types.ts +8 -8
  72. package/src/components/ConnectingBranch/BranchComponents/MachineInstances.tsx +94 -79
  73. package/src/components/ConnectingBranch/ConnectingBranch.scss +183 -195
  74. package/src/components/ConnectingBranch/ConnectingBranch.stories.tsx +33 -1
  75. package/src/components/ConnectingBranch/ConnectingBranch.tsx +121 -107
  76. package/src/components/ConnectingBranch/{data.ts → data.tsx} +106 -17
  77. package/src/components/ConnectingBranch/types.ts +21 -0
  78. package/src/components/DatePicker/DatePicker.scss +310 -0
  79. package/src/components/Excel/ExcelFile/ExcelFile.tsx +4 -4
  80. package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +22 -10
  81. package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +2 -2
  82. package/src/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.tsx +4 -1
  83. package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +6 -1
  84. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +2 -2
  85. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +30 -11
  86. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +65 -19
  87. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +14 -0
  88. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +16 -0
  89. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +77 -10
  90. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +6 -5
  91. package/src/components/FileDropzone/Dropzone.tsx +3 -0
  92. package/src/components/FileDropzone/FileDropzone.scss +18 -0
  93. package/src/components/FileDropzone/FileDropzone.stories.tsx +75 -7
  94. package/src/components/FileDropzone/FileDropzone.tsx +2 -0
  95. package/src/components/FileDropzone/RadioFilePreview.tsx +7 -3
  96. package/src/components/FileDropzone/types.ts +13 -4
  97. package/src/components/Icon/iconList.ts +4 -2
  98. package/src/components/InputWithDropdown/InputWithDropdown.tsx +1 -1
  99. package/src/components/LabelEditTextField/LabelEditTextField.scss +4 -0
  100. package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +8 -3
  101. package/src/components/LabelEditTextField/LabelEditTextField.tsx +42 -18
  102. package/src/components/LabelEditTextField/types.ts +3 -1
  103. package/src/components/MachineInputField/MachineInputField.tsx +67 -70
  104. package/src/components/NLPInput/components/NlpDropDown/NlpDropdown.scss +1 -1
  105. package/src/components/ScriptSwitchButton/ScriptSwitchButton.scss +33 -0
  106. package/src/components/ScriptSwitchButton/ScriptSwitchButton.stories.tsx +48 -0
  107. package/src/components/ScriptSwitchButton/ScriptSwitchButton.tsx +65 -0
  108. package/src/components/ScriptSwitchButton/index.ts +1 -0
  109. package/src/components/Search/Search.tsx +3 -1
  110. package/src/components/Select/Select.tsx +4 -4
  111. package/src/components/Select/types.ts +1 -1
  112. package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +1 -0
  113. package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +2 -8
  114. package/src/components/StatusCard/StatusCard.scss +2 -1
  115. package/src/components/StatusCard/StatusCard.stories.tsx +59 -1
  116. package/src/components/StatusCard/StatusCard.tsx +10 -2
  117. package/src/components/StatusCard/types.ts +2 -0
  118. package/src/components/TableTree/Components/TableBody.tsx +20 -16
  119. package/src/components/TableTree/Components/TableCell.tsx +47 -31
  120. package/src/components/TableTree/Components/TableRow.tsx +4 -0
  121. package/src/components/TableTree/TableTree.scss +121 -109
  122. package/src/components/TableTree/data.ts +48 -2
  123. package/src/components/TableTree/types.ts +4 -0
  124. package/src/components/TextArea/Textarea.tsx +2 -0
  125. package/src/components/TextArea/Types.ts +3 -0
  126. package/src/components/ThemeProvider/types.ts +1 -1
  127. package/src/index.ts +97 -0
  128. package/src/utils/validateFile/validateFile.stories.tsx +49 -0
  129. package/src/utils/validateFile/validateFile.ts +39 -0
  130. package/src/validations/regex.stories.tsx +362 -0
  131. package/src/validations/regex.ts +194 -0
  132. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.scss +0 -51
  133. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.tsx +0 -107
  134. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/types.ts +0 -5
  135. package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.scss +0 -31
  136. package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.tsx +0 -85
  137. package/src/components/SequentialConnectingBranch/components/DatasetListModal/types.ts +0 -4
  138. /package/src/assets/icons/{impactList.svg → impact_list.svg} +0 -0
@@ -411,3 +411,313 @@
411
411
  }
412
412
  }
413
413
  }
414
+
415
+
416
+
417
+
418
+ // Adding react day picker library node modules css here to get the css style available in platform
419
+
420
+ /* Variables declaration */
421
+ /* prettier-ignore */
422
+ .rdp-root {
423
+ --rdp-accent-color: blue; /* The accent color used for selected days and UI elements. */
424
+ --rdp-accent-background-color: #f0f0ff; /* The accent background color used for selected days and UI elements. */
425
+ --rdp-font-family: system-ui; /* The font family used by the calendar. Note that `inherit`does not work here. */
426
+
427
+ --rdp-day-font: inherit; /* The font used for the day cells. */
428
+ --rdp-day-height: 2.75rem; /* The height of the day cells. */
429
+ --rdp-day-width: 2.75rem; /* The width of the day cells. */
430
+
431
+ --rdp-day_button-border-radius: 100%; /* The border radius of the day cells. */
432
+ --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */
433
+ --rdp-day_button-height: var(--rdp-day-height); /* The height of the day cells. */
434
+ --rdp-day_button-width: var(--rdp-day-width); /* The width of the day cells. */
435
+
436
+ --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */
437
+ --rdp-selected-font: bold large var(--rdp-font-family); /* The font of the selected days. */
438
+ --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */
439
+ --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */
440
+ --rdp-today-color: var(--rdp-accent-color); /* The color of the today's date. */
441
+
442
+ --rdp-dropdown-gap: 0.5rem;/* The gap between the dropdowns used in the month captons. */
443
+
444
+ --rdp-month_caption-font: bold larger var(--rdp-font-family); /* The font of the month caption. */
445
+ --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */
446
+
447
+ --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */
448
+ --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */
449
+ --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */
450
+ --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */
451
+
452
+ --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */
453
+ --rdp-range_middle-font: normal medium var(--rdp-font-family); /* The font for days in the middle of a range. */
454
+ --rdp-range_middle-foreground-color: white; /* The font for days in the middle of a range. */
455
+ --rdp-range_middle-color: inherit;/* The color of the range text. */
456
+
457
+ --rdp-range_start-color: white; /* The color of the range text. */
458
+ --rdp-range_start-background: linear-gradient(var(--rdp-gradient-direction), transparent 50%, var(--rdp-range_middle-background-color) 50%); /* Used for the background of the start of the selected range. */
459
+ --rdp-range_start-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the start of the selected range. */
460
+
461
+ --rdp-range_end-background: linear-gradient(var(--rdp-gradient-direction), var(--rdp-range_middle-background-color) 50%, transparent 50%); /* Used for the background of the end of the selected range. */
462
+ --rdp-range_end-color: white;/* The color of the range text. */
463
+ --rdp-range_end-date-background-color: var(--rdp-accent-color); /* The background color of the date when at the end of the selected range. */
464
+
465
+ --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */
466
+ --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */
467
+ --rdp-week_number-font: 400 small var(--rdp-font-family); /* The font of the week number cells. */
468
+ --rdp-week_number-height: var(--rdp-day-height); /* The height of the week number cells. */
469
+ --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */
470
+ --rdp-week_number-width: var(--rdp-day-width); /* The width of the week number cells. */
471
+ --rdp-weeknumber-text-align: center; /* The text alignment of the weekday cells. */
472
+
473
+ --rdp-weekday-font: 500 smaller var(--rdp-font-family); /* The font of the weekday. */
474
+ --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */
475
+ --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */
476
+ --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */
477
+
478
+ --rdp-gradient-direction: 90deg;
479
+ }
480
+
481
+ .rdp-root[dir="rtl"] {
482
+ --rdp-gradient-direction: -90deg;
483
+ }
484
+
485
+ /* Root of the component. */
486
+ .rdp-root {
487
+ position: relative; /* Required to position the navigation toolbar. */
488
+ box-sizing: border-box;
489
+ }
490
+
491
+ .rdp-root * {
492
+ box-sizing: border-box;
493
+ }
494
+
495
+ .rdp-day {
496
+ width: var(--rdp-day-width);
497
+ height: var(--rdp-day-height);
498
+ font: var(--rdp-day-font);
499
+ text-align: center;
500
+ }
501
+
502
+ .rdp-day_button {
503
+ background: none;
504
+ padding: 0;
505
+ margin: 0;
506
+ cursor: pointer;
507
+ font: inherit;
508
+ color: inherit;
509
+ justify-content: center;
510
+ align-items: center;
511
+ display: flex;
512
+
513
+ width: var(--rdp-day_button-width);
514
+ height: var(--rdp-day_button-height);
515
+ border: var(--rdp-day_button-border);
516
+ border-radius: var(--rdp-day_button-border-radius);
517
+ }
518
+
519
+ .rdp-day_button:disabled {
520
+ cursor: revert;
521
+ }
522
+
523
+ .rdp-caption_label {
524
+ z-index: 1;
525
+
526
+ position: relative;
527
+ display: inline-flex;
528
+ align-items: center;
529
+
530
+ white-space: nowrap;
531
+ border: 0;
532
+ }
533
+
534
+ .rdp-button_next,
535
+ .rdp-button_previous {
536
+ border: none;
537
+ background: none;
538
+ padding: 0;
539
+ margin: 0;
540
+ cursor: pointer;
541
+ font: inherit;
542
+ color: inherit;
543
+ -moz-appearance: none;
544
+ -webkit-appearance: none;
545
+ display: inline-flex;
546
+ align-items: center;
547
+ justify-content: center;
548
+ position: relative;
549
+ appearance: none;
550
+
551
+ width: var(--rdp-nav_button-width);
552
+ height: var(--rdp-nav_button-height);
553
+ }
554
+
555
+ .rdp-button_next:disabled,
556
+ .rdp-button_previous:disabled {
557
+ cursor: revert;
558
+
559
+ opacity: var(--rdp-nav_button-disabled-opacity);
560
+ }
561
+
562
+ .rdp-chevron {
563
+ display: inline-block;
564
+ fill: var(--rdp-accent-color);
565
+ }
566
+
567
+ .rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
568
+ transform: rotate(180deg);
569
+ }
570
+
571
+ .rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
572
+ transform: rotate(180deg);
573
+ transform-origin: 50%;
574
+ }
575
+
576
+ .rdp-dropdowns {
577
+ position: relative;
578
+ display: inline-flex;
579
+ align-items: center;
580
+ gap: var(--rdp-dropdown-gap);
581
+ }
582
+ .rdp-dropdown {
583
+ z-index: 2;
584
+
585
+ /* Reset */
586
+ opacity: 0;
587
+ appearance: none;
588
+ position: absolute;
589
+ inset-block-start: 0;
590
+ inset-block-end: 0;
591
+ inset-inline-start: 0;
592
+ width: 100%;
593
+ margin: 0;
594
+ padding: 0;
595
+ cursor: inherit;
596
+ border: none;
597
+ line-height: inherit;
598
+ }
599
+
600
+ .rdp-dropdown_root {
601
+ position: relative;
602
+ display: inline-flex;
603
+ align-items: center;
604
+ }
605
+
606
+ .rdp-dropdown_root[data-disabled="true"] .rdp-chevron {
607
+ opacity: var(--rdp-disabled-opacity);
608
+ }
609
+
610
+ .rdp-month_caption {
611
+ display: flex;
612
+ align-content: center;
613
+ height: var(--rdp-nav-height);
614
+ font: var(--rdp-month_caption-font);
615
+ }
616
+
617
+ .rdp-months {
618
+ position: relative;
619
+ display: flex;
620
+ flex-wrap: wrap;
621
+ gap: var(--rdp-months-gap);
622
+ max-width: fit-content;
623
+ }
624
+
625
+ .rdp-month_grid {
626
+ border-collapse: collapse;
627
+ }
628
+
629
+ .rdp-nav {
630
+ position: absolute;
631
+ inset-block-start: 0;
632
+ inset-inline-end: 0;
633
+
634
+ display: flex;
635
+ align-items: center;
636
+
637
+ height: var(--rdp-nav-height);
638
+ }
639
+
640
+ .rdp-weekday {
641
+ opacity: var(--rdp-weekday-opacity);
642
+ padding: var(--rdp-weekday-padding);
643
+ font: var(--rdp-weekday-font);
644
+ text-align: var(--rdp-weekday-text-align);
645
+ text-transform: var(--rdp-weekday-text-transform);
646
+ }
647
+
648
+ .rdp-week_number {
649
+ opacity: var(--rdp-week_number-opacity);
650
+ font: var(--rdp-week_number-font);
651
+ height: var(--rdp-week_number-height);
652
+ width: var(--rdp-week_number-width);
653
+ border: var(--rdp-week_number-border);
654
+ border-radius: var(--rdp-week_number-border-radius);
655
+ text-align: var(--rdp-weeknumber-text-align);
656
+ }
657
+
658
+ /* DAY MODIFIERS */
659
+ .rdp-today:not(.rdp-outside) {
660
+ color: var(--rdp-today-color);
661
+ }
662
+
663
+ .rdp-selected {
664
+ font: var(--rdp-selected-font);
665
+ }
666
+
667
+ .rdp-selected .rdp-day_button {
668
+ border: var(--rdp-selected-border);
669
+ }
670
+
671
+ .rdp-outside {
672
+ opacity: var(--rdp-outside-opacity);
673
+ }
674
+
675
+ .rdp-disabled {
676
+ opacity: var(--rdp-disabled-opacity);
677
+ }
678
+
679
+ .rdp-hidden {
680
+ visibility: hidden;
681
+ color: var(--rdp-range_start-color);
682
+ }
683
+
684
+ .rdp-range_start {
685
+ background: var(--rdp-range_start-background);
686
+ }
687
+
688
+ .rdp-range_start .rdp-day_button {
689
+ background-color: var(--rdp-range_start-date-background-color);
690
+ color: var(--rdp-range_start-color);
691
+ }
692
+
693
+ .rdp-range_middle {
694
+ background-color: var(--rdp-range_middle-background-color);
695
+ font: var(--rdp-range_middle-font);
696
+ }
697
+
698
+ .rdp-range_middle .rdp-day_button {
699
+ border-color: transparent;
700
+ border: unset;
701
+ border-radius: unset;
702
+ color: var(--rdp-range_middle-color);
703
+ }
704
+
705
+ .rdp-range_end {
706
+ background: var(--rdp-range_end-background);
707
+ color: var(--rdp-range_end-color);
708
+ }
709
+
710
+ .rdp-range_end .rdp-day_button {
711
+ color: var(--rdp-range_start-color);
712
+ background-color: var(--rdp-range_end-date-background-color);
713
+ }
714
+
715
+ .rdp-range_start.rdp-range_end {
716
+ background: revert;
717
+ }
718
+
719
+ .rdp-focusable {
720
+ cursor: pointer;
721
+ }
722
+
723
+
@@ -430,8 +430,8 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
430
430
  setContextMenu({
431
431
  open: true,
432
432
  position: {
433
- x: event.pageX - 50,
434
- y: event.pageY - 250,
433
+ x: event.pageX,
434
+ y: event.pageY,
435
435
  },
436
436
  options: options,
437
437
  });
@@ -440,7 +440,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
440
440
  return (
441
441
  <>
442
442
  {sheetNames.length > 0 && (
443
- <>
443
+ <div style={{position:"relative"}}>
444
444
  <div ref={sheetRef} className="ff-excel-sheet">
445
445
  <Spreadsheet
446
446
  sheetHeight={sheetHeight}
@@ -503,7 +503,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
503
503
  </div>
504
504
  {contextMenu.open && <ExcelContextMenu contextMenu={contextMenu} />}
505
505
  <Toastify />
506
- </>
506
+ </div>
507
507
  )}
508
508
  </>
509
509
  );
@@ -20,6 +20,10 @@ const ActiveCell: React.FC<Props> = (props) => {
20
20
  dispatch(Actions.setCellData(active, data)),
21
21
  [dispatch]
22
22
  );
23
+ const activate = React.useCallback(
24
+ (point: Point.Point) => dispatch(Actions.activate(point)),
25
+ [dispatch]
26
+ );
23
27
  const edit = React.useCallback(() => dispatch(Actions.edit()), [dispatch]);
24
28
  const autoFill = React.useCallback(
25
29
  (value: boolean) => dispatch(Actions.autoFill(value)),
@@ -38,11 +42,19 @@ const ActiveCell: React.FC<Props> = (props) => {
38
42
  const cell = useSelector((state) =>
39
43
  state.active ? Matrix.get(state.active, state.model.data) : undefined
40
44
  );
41
- const dimensions = useSelector((state) =>
42
- active
45
+ const dimensions = useSelector((state) => {
46
+ let dimensionValue = active
43
47
  ? getCellDimensions(active, state.rowDimensions, state.columnDimensions)
44
- : undefined
45
- );
48
+ : undefined;
49
+ dimensionValue = {
50
+ top: dimensionValue?.top ?? 0,
51
+ height: (dimensionValue?.height ?? 0) + 1,
52
+ left: dimensionValue?.left ?? 0,
53
+ width: (dimensionValue?.width ?? 0) + 1,
54
+ };
55
+ return dimensionValue;
56
+ });
57
+
46
58
  const hidden = React.useMemo(
47
59
  () => !active || !dimensions,
48
60
  [active, dimensions]
@@ -108,8 +120,11 @@ const ActiveCell: React.FC<Props> = (props) => {
108
120
  const readOnly = cell && cell.readOnly;
109
121
 
110
122
  const handleMouseDown = React.useCallback(() => {
111
- mode === 'view' ? autoFill(true) : autoFill(false);
112
- }, [mode, autoFill]);
123
+ if (active) {
124
+ autoFill(true);
125
+ activate(active);
126
+ }
127
+ }, [activate, autoFill, active]);
113
128
 
114
129
  return hidden ? null : (
115
130
  <div
@@ -132,10 +147,7 @@ const ActiveCell: React.FC<Props> = (props) => {
132
147
  exitEditMode={view}
133
148
  />
134
149
  )}
135
- <div
136
- onMouseDown={handleMouseDown}
137
- className="select_dot"
138
- ></div>
150
+ <div onMouseDown={handleMouseDown} className="select_dot"></div>
139
151
  </div>
140
152
  );
141
153
  };
@@ -94,8 +94,8 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
94
94
  setContextMenu({
95
95
  open: true,
96
96
  position: {
97
- x: event.pageX - 50,
98
- y: event.pageY - 260,
97
+ x: event.pageX,
98
+ y: event.pageY,
99
99
  },
100
100
  options: options,
101
101
  });
@@ -22,7 +22,10 @@ const DataEditor: React.FC<Types.DataEditorProps> = ({ onChange, cell }) => {
22
22
  const value = cell?.value ?? '';
23
23
 
24
24
  return (
25
- <div className="ff-spreadsheet-data-editor">
25
+ <div
26
+ className="ff-spreadsheet-data-editor"
27
+ style={{ ...cell?.style, border: 'none' }} //Inline Styling needed for border:none
28
+ >
26
29
  <input
27
30
  ref={inputRef}
28
31
  type="text"
@@ -48,7 +48,12 @@ const FloatingRect: React.FC<Props> = ({
48
48
  'ff-spreadsheet-floating-rect--dragging': dragging,
49
49
  'ff-spreadsheet-floating-rect--hidden': hidden,
50
50
  })}
51
- style={{ width: adjustedWidth, height: adjustedHeight, top, left }}
51
+ style={{
52
+ width: (adjustedWidth ?? 0) + 1,
53
+ height: (adjustedHeight ?? 0) + 1,
54
+ top,
55
+ left,
56
+ }}
52
57
  />
53
58
  );
54
59
  };
@@ -92,8 +92,8 @@ const RowIndicator: Types.RowIndicatorComponent = ({
92
92
  setContextMenu({
93
93
  open: true,
94
94
  position: {
95
- x: event.pageX - 50,
96
- y: event.pageY - 260,
95
+ x: event.pageX ,
96
+ y: event.pageY ,
97
97
  },
98
98
  options: options,
99
99
  });
@@ -3,6 +3,7 @@
3
3
  .ff-excel {
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ height: 100%;
6
7
 
7
8
  .ff-excel-toolbar-container {
8
9
  position: relative;
@@ -12,7 +13,7 @@
12
13
  margin-bottom: 20px;
13
14
  }
14
15
 
15
- .ff-spreadsheet {
16
+ .ff-excel-spreadsheet {
16
17
  --background-color: var(--drawer-footer-bg);
17
18
  --text-color: var(--text-color);
18
19
  --readonly-text-color: var(--toggle-strip-active);
@@ -30,10 +31,29 @@
30
31
  display: inline-block;
31
32
  }
32
33
 
34
+ .ff-excel-header-hider {
35
+ position: absolute;
36
+ background-color: var(--excel-header-border);
37
+ z-index: 500;
38
+ left: -1px;
39
+ top: 59px;
40
+ }
41
+
42
+ .ff-excel-header-column-hider {
43
+ height: 34px;
44
+ width: 100%;
45
+ }
46
+
47
+ .ff-excel-header-row-hider {
48
+ bottom: 0px;
49
+ width: 60px;
50
+ }
51
+
33
52
  .ff-spreadsheet-active-cell {
34
53
  position: absolute;
35
- border: 2px solid var(--outline-color);
54
+ border: 1px solid var(--outline-color);
36
55
  box-sizing: border-box;
56
+ z-index: 100;
37
57
  }
38
58
 
39
59
  .ff-spreadsheet-active-cell--edit {
@@ -87,7 +107,6 @@
87
107
  }
88
108
 
89
109
  .ff-spreadsheet-header {
90
- border: 0.1px solid var(--border-color);
91
110
  background-color: var(--header-background-color);
92
111
  color: var(--readonly-text-color);
93
112
  text-align: center;
@@ -99,7 +118,8 @@
99
118
 
100
119
  .ff-spreadsheet-corner-header {
101
120
  position: fixed;
102
- z-index: 3000;
121
+ z-index: 2000;
122
+ border: 2px solid var(--border-color);
103
123
  }
104
124
 
105
125
  .ff-spreadsheet-row-header {
@@ -107,16 +127,15 @@
107
127
  }
108
128
 
109
129
  .corner-header {
110
- border: 1px solid var(--border-color);
111
130
  background-color: var(--header-background-color);
112
131
  position: absolute;
113
132
  display: flex;
114
133
  align-items: center;
115
134
  justify-content: center;
116
- z-index: 1100;
117
- top: -1px;
118
- width: 60px;
119
- height: 34px;
135
+ z-index: 1500;
136
+ top: -2px;
137
+ width: 58px;
138
+ height: 32px;
120
139
  left: -1px;
121
140
  }
122
141
 
@@ -169,7 +188,7 @@
169
188
 
170
189
  .ff-spreadsheet-floating-rect--selected {
171
190
  background: var(--outline-background-color);
172
- border: 2px var(--outline-color) solid;
191
+ border: 1px var(--outline-color) solid;
173
192
  }
174
193
 
175
194
  .ff-spreadsheet-floating-rect--dragging {
@@ -177,6 +196,6 @@
177
196
  }
178
197
 
179
198
  .ff-spreadsheet-floating-rect--copied {
180
- border: 2px var(--outline-color) dashed;
199
+ border: 1px var(--outline-color) dashed;
181
200
  }
182
201
  }
@@ -15,6 +15,7 @@ import {
15
15
  calculateSpreadsheetSize,
16
16
  getCSV,
17
17
  shouldHandleClipboardEvent,
18
+ isFocusedWithin,
18
19
  } from './util';
19
20
 
20
21
  import DefaultTable from './Table';
@@ -98,7 +99,7 @@ export type Props<CellType extends Types.CellBase> = {
98
99
  /** Callback called when the Spreadsheet's evaluated data changes. */
99
100
  onEvaluatedDataChange?: (data: Matrix.Matrix<CellType>) => void;
100
101
  setContextMenu: React.Dispatch<React.SetStateAction<Types.ContextMenuState>>;
101
- /** Set your dynamic sheet Height*/
102
+ /** Set your dynamic sheet Height*/
102
103
  sheetHeight: string;
103
104
  };
104
105
 
@@ -119,6 +120,8 @@ const Spreadsheet = <CellType extends Types.CellBase>(
119
120
  HeaderRow = DefaultHeaderRow,
120
121
  DataEditor = DefaultDataEditor,
121
122
  DataViewer = DefaultDataViewer,
123
+ onSelect = () => {},
124
+ onActivate = () => {},
122
125
  onEvaluatedDataChange = () => {},
123
126
  } = props;
124
127
  type State = Types.StoreState<CellType>;
@@ -162,6 +165,7 @@ const Spreadsheet = <CellType extends Types.CellBase>(
162
165
  const copy = useAction(Actions.copy);
163
166
  const paste = useAction(Actions.paste);
164
167
  const onKeyDownAction = useAction(Actions.keyDown);
168
+ const onKeyPress = useAction(Actions.keyPress);
165
169
  const onDragStart = useAction(Actions.dragStart);
166
170
  const onDragEnd = useAction(Actions.dragEnd);
167
171
  const setData = useAction(Actions.setData);
@@ -183,6 +187,23 @@ const Spreadsheet = <CellType extends Types.CellBase>(
183
187
  const deleteRow = useAction(Actions.deleteRow);
184
188
  const deleteColumn = useAction(Actions.deleteColumn);
185
189
 
190
+ // Track active
191
+ const prevActiveRef = React.useRef<Point.Point | null>(state.active);
192
+ React.useEffect(() => {
193
+ if (state.active !== prevActiveRef.current) {
194
+ if (state.active) {
195
+ onActivate(state.active);
196
+ } else {
197
+ const root = rootRef.current;
198
+ if (root && isFocusedWithin(root) && document.activeElement) {
199
+ (document.activeElement as HTMLElement).blur();
200
+ }
201
+ }
202
+ }
203
+
204
+ prevActiveRef.current = state.active;
205
+ }, [onActivate, state.active]);
206
+
186
207
  const prevEvaluatedDataRef = React.useRef<Matrix.Matrix<CellType>>(
187
208
  state.model.evaluatedData
188
209
  );
@@ -194,6 +215,17 @@ const Spreadsheet = <CellType extends Types.CellBase>(
194
215
  prevEvaluatedDataRef.current = state.model.evaluatedData;
195
216
  }, [state?.model?.evaluatedData, onEvaluatedDataChange]);
196
217
 
218
+ const prevSelectedRef = React.useRef<Selection>(state.selected);
219
+ React.useEffect(() => {
220
+ if (!state.selected.equals(prevSelectedRef.current)) {
221
+ if (!props.selected || !state.selected.equals(props.selected)) {
222
+ onSelect(state.selected);
223
+ }
224
+ }
225
+
226
+ prevSelectedRef.current = state.selected;
227
+ }, [state.selected, onSelect, props.selected]);
228
+
197
229
  // Update selection when props.selected changes
198
230
  const prevSelectedPropRef = React.useRef<Selection | undefined>(
199
231
  props.selected
@@ -446,25 +478,32 @@ const Spreadsheet = <CellType extends Types.CellBase>(
446
478
  const rootNode = React.useMemo(
447
479
  () => (
448
480
  <div className="ff-excel">
449
- <div className="ff-excel-toolbar-container">
450
- <ExcelToolBar
451
- onBold={onBold}
452
- onItalic={onItalic}
453
- setUnderlineType={setUnderlineType}
454
- setColor={setColor}
455
- setBorderType={setBorderType}
456
- setFontSize={setFontSize}
457
- setFontFamily={setFontFamily}
458
- setTextAlign={setTextAlign}
459
- setBackgroundColor={setBackgroundColor}
460
- setFormatePainter={setFormatePainter}
461
- />
462
- </div>
481
+ <div className="ff-excel-header-hider ff-excel-header-column-hider"></div>
482
+ <div className="ff-excel-header-hider ff-excel-header-row-hider"></div>
483
+ <div className="ff-excel-toolbar-container">
484
+ <ExcelToolBar
485
+ onBold={onBold}
486
+ onItalic={onItalic}
487
+ setUnderlineType={setUnderlineType}
488
+ setColor={setColor}
489
+ setBorderType={setBorderType}
490
+ setFontSize={setFontSize}
491
+ setFontFamily={setFontFamily}
492
+ setTextAlign={setTextAlign}
493
+ setBackgroundColor={setBackgroundColor}
494
+ setFormatePainter={setFormatePainter}
495
+ />
496
+ </div>
463
497
  <div
464
498
  ref={rootRef}
465
- style={{height:sheetHeight}}
466
- className={classNames('ff-spreadsheet', className)}
467
- onKeyDown={handleKeyDown}
499
+ style={{ height: sheetHeight }}
500
+ className={classNames('ff-excel-spreadsheet', className)}
501
+ onKeyPress={(e) => {
502
+ onKeyPress(e);
503
+ }}
504
+ onKeyDown={(e) => {
505
+ handleKeyDown(e);
506
+ }}
468
507
  onMouseMove={handleMouseMove}
469
508
  >
470
509
  {tableNode}
@@ -474,7 +513,14 @@ const Spreadsheet = <CellType extends Types.CellBase>(
474
513
  </div>
475
514
  </div>
476
515
  ),
477
- [className, handleKeyDown, handleMouseMove, tableNode, activeCellNode]
516
+ [
517
+ className,
518
+ onKeyPress,
519
+ handleKeyDown,
520
+ handleMouseMove,
521
+ tableNode,
522
+ activeCellNode,
523
+ ]
478
524
  );
479
525
 
480
526
  return (