pixel-react 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/AddButton/AddButton.d.ts +5 -0
  3. package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
  4. package/lib/components/AddButton/index.d.ts +1 -0
  5. package/lib/components/AddButton/types.d.ts +4 -0
  6. package/lib/components/Editor/Editor.d.ts +5 -0
  7. package/lib/components/Editor/Editor.stories.d.ts +6 -0
  8. package/lib/components/Editor/VariableDropdown.d.ts +5 -0
  9. package/lib/components/Editor/constants.d.ts +3 -0
  10. package/lib/components/Editor/index.d.ts +1 -0
  11. package/lib/components/Editor/types.d.ts +71 -0
  12. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
  13. package/lib/components/ExcelFile/ColorBarselector/ColorBarSelector.d.ts +8 -0
  14. package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +4 -0
  15. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
  16. package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
  17. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
  18. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
  19. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
  20. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
  21. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
  22. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
  23. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
  24. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
  25. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
  26. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
  27. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +81 -0
  28. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
  29. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +130 -0
  30. package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
  31. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
  32. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
  33. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
  34. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
  35. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
  36. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
  37. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
  38. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
  39. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
  40. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
  41. package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
  42. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
  43. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
  44. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +215 -0
  45. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
  46. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
  47. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +45 -0
  48. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +3 -0
  49. package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
  50. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +15 -0
  51. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +3 -0
  52. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
  53. package/lib/components/ExcelFile/Types.d.ts +176 -0
  54. package/lib/components/ExcelFile/index.d.ts +1 -0
  55. package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
  56. package/lib/components/InputWithDropdown/types.d.ts +3 -1
  57. package/lib/components/Select/Select.d.ts +3 -2
  58. package/lib/components/Select/components/Dropdown.d.ts +5 -0
  59. package/lib/components/Select/components/types.d.ts +18 -0
  60. package/lib/components/Select/types.d.ts +2 -42
  61. package/lib/index.d.ts +7 -12
  62. package/lib/index.esm.js +200 -330
  63. package/lib/index.esm.js.map +1 -1
  64. package/lib/index.js +199 -329
  65. package/lib/index.js.map +1 -1
  66. package/lib/tsconfig.tsbuildinfo +1 -1
  67. package/lib/utils/find/findAndInsert.d.ts +7 -0
  68. package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
  69. package/package.json +3 -3
  70. package/src/assets/Themes/BaseTheme.scss +1 -0
  71. package/src/assets/Themes/DarkTheme.scss +2 -0
  72. package/src/components/Icon/Icons.scss +4 -0
  73. package/src/components/InputWithDropdown/InputWithDropdown.scss +30 -1
  74. package/src/components/InputWithDropdown/InputWithDropdown.tsx +45 -16
  75. package/src/components/InputWithDropdown/types.ts +5 -1
  76. package/src/components/Select/Select.scss +121 -188
  77. package/src/components/Select/Select.stories.tsx +4 -1
  78. package/src/components/Select/Select.tsx +140 -296
  79. package/src/components/Select/components/Dropdown.scss +50 -0
  80. package/src/components/Select/components/Dropdown.tsx +94 -0
  81. package/src/components/Select/components/types.ts +20 -0
  82. package/src/components/Select/types.ts +15 -39
  83. package/src/utils/getSelectOptionValue/getSelectOptionValue.ts +1 -1
@@ -0,0 +1,176 @@
1
+ interface ExcelFileProps {
2
+ /** The Excel data containing sheets and their content */
3
+ excelData: {
4
+ sheets: WorkSheet[];
5
+ };
6
+ /** Optional: Provide context menu options for actions like right-click */
7
+ contextOption?: {
8
+ name: string;
9
+ title: React.ReactNode;
10
+ action: () => void;
11
+ }[];
12
+ /** Controls whether the toolbar is shown, disabled, or hidden */
13
+ toolbar?: 'show' | 'disable' | 'hide';
14
+ /** Callback function to save the Excel data */
15
+ onSave?: (excelData?: any) => void;
16
+ }
17
+ interface WorkSheet {
18
+ /** The name of the worksheet */
19
+ sheetName: string;
20
+ /** 2D array of worksheet data (cells) */
21
+ data: WorkData[][];
22
+ }
23
+ interface WorkData {
24
+ /** Value of the cell */
25
+ value: string;
26
+ /** Styling options for the cell */
27
+ style: CellStyle;
28
+ type?: boolean;
29
+ }
30
+ interface CellStyle {
31
+ /** Font name for the cell text */
32
+ name?: string;
33
+ /** Font size of the cell text */
34
+ size?: number;
35
+ position?: string;
36
+ /** Whether the text is bold */
37
+ bold?: boolean;
38
+ fontSize?: string;
39
+ fontFamily?: string;
40
+ /** Whether the text is italicized */
41
+ italic?: boolean;
42
+ /** Text color in the cell (hex code) */
43
+ color?: string;
44
+ /** Background color of the cell (hex code) */
45
+ backgroundColor?: string;
46
+ /** Border color of the cell (hex code) */
47
+ borderColor?: string;
48
+ /** Border styles for each side of the cell */
49
+ border?: {
50
+ /** Border style for the top side of the cell */
51
+ top: string;
52
+ /** Border style for the bottom side of the cell */
53
+ bottom: string;
54
+ /** Border style for the left side of the cell */
55
+ left: string;
56
+ /** Border style for the right side of the cell */
57
+ right: string;
58
+ };
59
+ /** Text alignment and wrapping properties */
60
+ alignment?: {
61
+ /** Horizontal text alignment ('left', 'center', or 'right') */
62
+ horizontal: string;
63
+ /** Vertical text alignment ('top', 'middle', or 'bottom') */
64
+ vertical: string;
65
+ /** Whether the text is wrapped within the cell */
66
+ wrapText: boolean;
67
+ };
68
+ }
69
+ /** A generic type to represent a 2D matrix of any type (or undefined values) */
70
+ type Matrix<T> = (T | undefined)[][];
71
+ interface ContextAction {
72
+ /** Name of the right-click option */
73
+ name: string;
74
+ /** Display title of the right-click menu option */
75
+ title: React.ReactNode;
76
+ /** The action that occurs when the right-click menu option is selected */
77
+ action: () => void;
78
+ }
79
+ interface ContextOption {
80
+ /** Type of the context option ('cell', 'row', 'column') */
81
+ name: string;
82
+ /** Array of context menu actions for right-click options */
83
+ value: ContextAction[];
84
+ }
85
+ interface ContextMenuState {
86
+ /** Whether the context menu is visible */
87
+ visible: boolean;
88
+ /** X-coordinate position for the context menu */
89
+ x: number;
90
+ /** Y-coordinate position for the context menu */
91
+ y: number;
92
+ /** Type of the context menu ('cell', 'row', 'column', or 'sheet_options') */
93
+ type: 'cell' | 'row' | 'column' | 'sheet_options' | null;
94
+ }
95
+ interface SelectedCell {
96
+ /** The row index of the selected cell */
97
+ row: number;
98
+ /** The column index of the selected cell */
99
+ column: number;
100
+ }
101
+ interface ColorContainer {
102
+ /** The color used for the text (hex code) */
103
+ color: string;
104
+ /** The background color used for the cell (hex code) */
105
+ backgroundColor: string;
106
+ /** The border color used for the cell (hex code) */
107
+ borderColor: string;
108
+ }
109
+ interface SelectedValue {
110
+ /** The value inside the selected cell */
111
+ value: string;
112
+ /** The row index of the selected cell */
113
+ row: number;
114
+ /** The column index of the selected cell */
115
+ column: number;
116
+ /** The column represented as an alphabetical string ('A', 'B') */
117
+ alphaCol: string;
118
+ /** The style applied to the selected cell */
119
+ style: CellStyle;
120
+ /** The sheet name where the cell is located */
121
+ sheet: string;
122
+ }
123
+ interface ExcelToolBarProps {
124
+ /** use this to hide/show/disable the toolbar */
125
+ toolbar?: 'show' | 'disable' | 'hide';
126
+ /** function to apply styles */
127
+ applyStyle: (styleType: string, value: any) => void;
128
+ /** function to trigger format painter */
129
+ formatePaint: () => void;
130
+ }
131
+ interface ExcelSheetBarProps {
132
+ /** Object containing details about the file, including sheet names */
133
+ fileDetails: {
134
+ sheetNames: string[];
135
+ };
136
+ /** Function to handle sheet change events */
137
+ handleSheetChange: (name: string, index: number) => void;
138
+ /** Function to open the context menu on a sheet */
139
+ contextMenu: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, name: string, index: number) => void;
140
+ /** Function to add a new sheet */
141
+ addSheet: () => void;
142
+ /** Object representing the currently selected sheet */
143
+ selectedSheet: {
144
+ name: string;
145
+ index: number;
146
+ };
147
+ /** Function to update the context Type */
148
+ contextSelect: (event: React.MouseEvent) => void;
149
+ }
150
+ interface ContextMenuProps {
151
+ /** Custom context menu options */
152
+ customContext: {
153
+ name: string;
154
+ title: React.ReactNode;
155
+ action: () => void;
156
+ }[];
157
+ /** Object that holds different context actions based on the type (cell, row, column, sheet_options) */
158
+ contextAction: {
159
+ /** Function to add a row */
160
+ addRow: () => void;
161
+ /** Function to delete a row */
162
+ deleteRow: () => void;
163
+ /** Function to add a column */
164
+ addColumn: () => void;
165
+ /** Function to delete a column */
166
+ deleteColumn: () => void;
167
+ /** Function to add a new sheet */
168
+ addSheet: () => void;
169
+ /** Function to delete a sheet */
170
+ deleteSheet: () => void;
171
+ };
172
+ /** The state of the context menu, controlling its visibility and position */
173
+ contextData: ContextMenuState;
174
+ /** Function to update the context menu state */
175
+ setContextData: React.Dispatch<React.SetStateAction<ContextMenuState>>;
176
+ }
@@ -0,0 +1 @@
1
+ export { default } from './ExcelFile/ExcelFile';
@@ -1,4 +1,4 @@
1
1
  import './InputWithDropdown.scss';
2
2
  import { InputWithDropdownProps } from './types';
3
- declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, dropdownPosition, type, }: InputWithDropdownProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default InputWithDropdown;
@@ -15,7 +15,8 @@ export interface InputWithDropdownProps {
15
15
  /**
16
16
  * value | input field value
17
17
  */
18
- value?: number;
18
+ value?: string | number;
19
+ type?: 'text' | 'password' | 'number' | 'email' | 'url' | 'time';
19
20
  /**
20
21
  * variants to set color/style of the input field
21
22
  */
@@ -85,4 +86,5 @@ export interface InputWithDropdownProps {
85
86
  * optionsRequired:false prop removes options from dropdown & shows static label only
86
87
  */
87
88
  optionsRequired?: boolean;
89
+ dropdownPosition?: 'left' | 'right';
88
90
  }
@@ -1,4 +1,5 @@
1
- import { SelectProps } from './types';
1
+ import { FC } from 'react';
2
2
  import './Select.scss';
3
- declare const Select: ({ label, showLabel, optionsList, selectedOption, onChange, errorMsg, className, optionZIndex, disabled, borderRadius, showBorder, required, optionsRequired, selectedOptionColor, labelAccessor, valueAccessor, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
3
+ import { SelectProps } from './types';
4
+ declare const Select: FC<SelectProps>;
4
5
  export default Select;
@@ -0,0 +1,5 @@
1
+ import { type FC } from 'react';
2
+ import { DropdownProps } from './types';
3
+ import './Dropdown.scss';
4
+ declare const Dropdown: FC<DropdownProps>;
5
+ export default Dropdown;
@@ -0,0 +1,18 @@
1
+ import { DrowdownPosition, Option } from '../types';
2
+ export interface DropdownProps {
3
+ options: Option[];
4
+ dropdownPosition: DrowdownPosition;
5
+ optionZIndex: number;
6
+ labelAccessor?: string;
7
+ valueAccessor?: string;
8
+ onSelectBlur: () => void;
9
+ onSelectOptionSelector: (option: Option) => void;
10
+ inputRef?: React.RefObject<HTMLInputElement>;
11
+ selectArrowRef?: React.RefObject<HTMLDivElement>;
12
+ }
13
+ export declare const dropdownDefaultCSSData: {
14
+ margin: number;
15
+ optionHeight: number;
16
+ selectInputHeight: number;
17
+ dropDownWrapperPadding: number;
18
+ };
@@ -15,18 +15,11 @@ export interface SelectProps {
15
15
  * optionsRequired:false prop removes options from dropdown & shows static label only
16
16
  */
17
17
  optionsRequired?: boolean;
18
- /**
19
- * selectedOptionColor prop provides the custom color for the selected option
20
- */
21
18
  selectedOptionColor?: string;
22
- /**
23
- * Label accessor
24
- */
25
19
  labelAccessor?: string;
26
- /**
27
- * Value accessor
28
- */
29
20
  valueAccessor?: string;
21
+ height?: number;
22
+ width?: number;
30
23
  }
31
24
  export interface DrowdownPosition {
32
25
  positionX: number;
@@ -43,39 +36,6 @@ export interface SelectState {
43
36
  option: string;
44
37
  dropdownPosition: DrowdownPosition;
45
38
  }
46
- export type SelectAction = {
47
- type: 'FOCUS_INPUT';
48
- } | {
49
- type: 'BLUR_INPUT';
50
- payload: {
51
- optionsList: Option[];
52
- option: Option['value'];
53
- };
54
- } | {
55
- type: 'MOUSE_ENTER';
56
- } | {
57
- type: 'MOUSE_LEAVE';
58
- } | {
59
- type: 'UPDATE_DROPDOWN_POSITION';
60
- payload: {
61
- positionX: number;
62
- positionY: number;
63
- width: number;
64
- fromBottom: number;
65
- };
66
- } | {
67
- type: 'UPDATE_OPTION';
68
- payload: string;
69
- } | {
70
- type: 'UPDATE_OPTION_LIST';
71
- payload: Option[];
72
- } | {
73
- type: 'SHOW_ERROR';
74
- payload: {
75
- optionsList: Option[];
76
- option: Option['value'];
77
- };
78
- };
79
39
  type OptionValue = any;
80
40
  export interface Option {
81
41
  [key: string]: OptionValue;
package/lib/index.d.ts CHANGED
@@ -638,25 +638,18 @@ interface SelectProps$1 {
638
638
  * optionsRequired:false prop removes options from dropdown & shows static label only
639
639
  */
640
640
  optionsRequired?: boolean;
641
- /**
642
- * selectedOptionColor prop provides the custom color for the selected option
643
- */
644
641
  selectedOptionColor?: string;
645
- /**
646
- * Label accessor
647
- */
648
642
  labelAccessor?: string;
649
- /**
650
- * Value accessor
651
- */
652
643
  valueAccessor?: string;
644
+ height?: number;
645
+ width?: number;
653
646
  }
654
647
  type OptionValue = any;
655
648
  interface Option$2 {
656
649
  [key: string]: OptionValue;
657
650
  }
658
651
 
659
- declare const Select: ({ label, showLabel, optionsList, selectedOption, onChange, errorMsg, className, optionZIndex, disabled, borderRadius, showBorder, required, optionsRequired, selectedOptionColor, labelAccessor, valueAccessor, }: SelectProps$1) => react_jsx_runtime.JSX.Element;
652
+ declare const Select: FC<SelectProps$1>;
660
653
 
661
654
  interface TextareaProps {
662
655
  /**
@@ -1177,7 +1170,8 @@ interface InputWithDropdownProps {
1177
1170
  /**
1178
1171
  * value | input field value
1179
1172
  */
1180
- value?: number;
1173
+ value?: string | number;
1174
+ type?: 'text' | 'password' | 'number' | 'email' | 'url' | 'time';
1181
1175
  /**
1182
1176
  * variants to set color/style of the input field
1183
1177
  */
@@ -1247,9 +1241,10 @@ interface InputWithDropdownProps {
1247
1241
  * optionsRequired:false prop removes options from dropdown & shows static label only
1248
1242
  */
1249
1243
  optionsRequired?: boolean;
1244
+ dropdownPosition?: 'left' | 'right';
1250
1245
  }
1251
1246
 
1252
- declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, }: InputWithDropdownProps) => react_jsx_runtime.JSX.Element;
1247
+ declare const InputWithDropdown: ({ name, label, value, disabled, required, placeholder, error, helperText, optionsList, selectedOption, onDropdownChangeHandler, onInputChangeHandler, onInputBlurHandler, optionsRequired, dropdownPosition, type, }: InputWithDropdownProps) => react_jsx_runtime.JSX.Element;
1253
1248
 
1254
1249
  declare const RadioButton: React__default.FC<RadioButtonProps>;
1255
1250