pixel-react-excel-sheet 1.0.14 → 1.0.16
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/lib/components/Excel/ExcelFile/ExcelFile.d.ts +2 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.esm.js +29 -11
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +29 -11
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.scss +1 -1
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +8 -3
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +0 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +4 -1
- package/src/components/Excel/ExcelFile.stories.tsx +1 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +19 -7
|
@@ -15,6 +15,8 @@ interface ExcelFileProps {
|
|
|
15
15
|
toolbar?: 'show' | 'disable' | 'hide';
|
|
16
16
|
/** Callback function to save the Excel data */
|
|
17
17
|
onSave?: (saveData: any) => void;
|
|
18
|
+
/** Set your dynamic sheet Height*/
|
|
19
|
+
sheetHeight?: string;
|
|
18
20
|
}
|
|
19
21
|
declare const ExcelFile: React.FC<ExcelFileProps>;
|
|
20
22
|
export default ExcelFile;
|
|
@@ -60,6 +60,8 @@ export type Props<CellType extends Types.CellBase> = {
|
|
|
60
60
|
/** Callback called when the Spreadsheet's evaluated data changes. */
|
|
61
61
|
onEvaluatedDataChange?: (data: Matrix.Matrix<CellType>) => void;
|
|
62
62
|
setContextMenu: React.Dispatch<React.SetStateAction<Types.ContextMenuState>>;
|
|
63
|
+
/** Set your dynamic sheet Height*/
|
|
64
|
+
sheetHeight: string;
|
|
63
65
|
};
|
|
64
66
|
/**
|
|
65
67
|
* The Spreadsheet component
|
package/lib/index.d.ts
CHANGED
|
@@ -2378,6 +2378,8 @@ interface ExcelFileProps {
|
|
|
2378
2378
|
toolbar?: 'show' | 'disable' | 'hide';
|
|
2379
2379
|
/** Callback function to save the Excel data */
|
|
2380
2380
|
onSave?: (saveData: any) => void;
|
|
2381
|
+
/** Set your dynamic sheet Height*/
|
|
2382
|
+
sheetHeight?: string;
|
|
2381
2383
|
}
|
|
2382
2384
|
declare const ExcelFile: React__default.FC<ExcelFileProps>;
|
|
2383
2385
|
|
package/lib/index.esm.js
CHANGED
|
@@ -31796,7 +31796,7 @@ const Copied = () => {
|
|
|
31796
31796
|
});
|
|
31797
31797
|
};
|
|
31798
31798
|
|
|
31799
|
-
var css_248z$m = ".fontXs {\n font-family: \"Poppins\";\n font-size: 10px;\n}\n\n.fontSm {\n font-family: \"Poppins\";\n font-size: 12px;\n}\n\n.fontMd {\n font-family: \"Poppins\";\n font-size: 14px;\n}\n\n.fontLg {\n font-family: \"Poppins\";\n font-size: 16px;\n}\n\n.fontXL {\n font-family: \"Poppins\";\n font-size: 18px;\n}\n\n.font2Xl {\n font-family: \"Poppins\";\n font-size: 24px;\n}\n\n.font-size-8 {\n font-family: \"Poppins\";\n font-size: 8px;\n}\n\n.font-size-20 {\n font-family: \"Poppins\";\n font-size: 20px;\n}\n\n.font-size-32 {\n font-family: \"Poppins\";\n font-size: 32px;\n}\n\n.font-size-80 {\n font-family: \"Poppins\";\n font-size: 80px;\n}\n\n.ff-excel {\n display: flex;\n flex-direction: column;\n}\n.ff-excel .ff-excel-toolbar-container {\n position: static;\n top: 0;\n background-color: var(--excel-toolbar-bg);\n padding: 4px 8px;\n margin-bottom: 20px;\n}\n.ff-excel .ff-spreadsheet {\n --background-color: var(--drawer-footer-bg);\n --text-color: var(--text-color);\n --readonly-text-color: var(--toggle-strip-active);\n --outline-color: var(--toggle-strip-active);\n --outline-background-color: var(--overlay-bg);\n --border-color: var(--excel-sheet-border);\n --header-background-color: var(--pop-up-background-blur);\n --elevation: var(--brand-color);\n position: relative;\n overflow: scroll;\n
|
|
31799
|
+
var css_248z$m = ".fontXs {\n font-family: \"Poppins\";\n font-size: 10px;\n}\n\n.fontSm {\n font-family: \"Poppins\";\n font-size: 12px;\n}\n\n.fontMd {\n font-family: \"Poppins\";\n font-size: 14px;\n}\n\n.fontLg {\n font-family: \"Poppins\";\n font-size: 16px;\n}\n\n.fontXL {\n font-family: \"Poppins\";\n font-size: 18px;\n}\n\n.font2Xl {\n font-family: \"Poppins\";\n font-size: 24px;\n}\n\n.font-size-8 {\n font-family: \"Poppins\";\n font-size: 8px;\n}\n\n.font-size-20 {\n font-family: \"Poppins\";\n font-size: 20px;\n}\n\n.font-size-32 {\n font-family: \"Poppins\";\n font-size: 32px;\n}\n\n.font-size-80 {\n font-family: \"Poppins\";\n font-size: 80px;\n}\n\n.ff-excel {\n display: flex;\n flex-direction: column;\n}\n.ff-excel .ff-excel-toolbar-container {\n position: static;\n top: 0;\n background-color: var(--excel-toolbar-bg);\n padding: 4px 8px;\n margin-bottom: 20px;\n}\n.ff-excel .ff-spreadsheet {\n --background-color: var(--drawer-footer-bg);\n --text-color: var(--text-color);\n --readonly-text-color: var(--toggle-strip-active);\n --outline-color: var(--toggle-strip-active);\n --outline-background-color: var(--overlay-bg);\n --border-color: var(--excel-sheet-border);\n --header-background-color: var(--pop-up-background-blur);\n --elevation: var(--brand-color);\n position: relative;\n overflow: scroll;\n background: var(--background-color);\n color: var(--text-color);\n scrollbar-width: none;\n display: inline-block;\n}\n.ff-excel .ff-spreadsheet::-webkit-scrollbar {\n height: 0px;\n}\n.ff-excel .ff-spreadsheet-active-cell {\n position: absolute;\n border: 2px solid var(--outline-color);\n box-sizing: border-box;\n}\n.ff-excel .ff-spreadsheet-active-cell--edit {\n background: var(--background-color);\n box-shadow: var(--elevation);\n}\n.ff-excel .ff-spreadsheet-table {\n overflow: scroll;\n border-collapse: collapse;\n table-layout: fixed;\n}\n.ff-excel .ff-spreadsheet-table::-webkit-scrollbar {\n height: 0px;\n}\n.ff-excel .ff-spreadsheet-cell {\n outline: none;\n position: relative;\n z-index: 0;\n}\n.ff-excel .ff-spreadsheet-active-cell .select_dot {\n background-color: var(--elevation);\n height: 10px;\n width: 10px;\n border-radius: 50%;\n position: absolute;\n bottom: -5px;\n right: -5px;\n cursor: crosshair;\n z-index: 1000;\n}\n.ff-excel .ff-spreadsheet-cell--readonly {\n color: var(--readonly-text-color);\n}\n.ff-excel .ff-spreadsheet-cell,\n.ff-excel .ff-spreadsheet-header {\n border: 0.1px solid var(--border-color);\n overflow: hidden;\n word-break: keep-all;\n white-space: nowrap;\n text-align: left;\n box-sizing: border-box;\n user-select: none;\n}\n.ff-excel .ff-spreadsheet-header {\n border: 0.1px solid var(--border-color);\n background-color: var(--header-background-color);\n color: var(--readonly-text-color);\n text-align: center;\n z-index: 100;\n font-weight: 500;\n font-size: 12px;\n}\n.ff-excel .corner_indicator {\n padding-left: 20px;\n}\n.ff-excel .ff-spreadsheet-header--selected {\n background: var(--brand-color);\n color: var(--tooltip-text-color);\n}\n.ff-excel .ff-spreadsheet-header,\n.ff-excel .ff-spreadsheet-data-viewer,\n.ff-excel .ff-spreadsheet-data-editor input {\n padding: 4px;\n box-sizing: border-box;\n}\n.ff-excel .ff-spreadsheet-data-viewer--preserve-breaks {\n white-space: pre-wrap;\n}\n.ff-excel .ff-spreadsheet-data-editor,\n.ff-excel .ff-spreadsheet-data-editor input {\n width: 100%;\n height: 100%;\n}\n.ff-excel .ff-spreadsheet-data-editor input {\n font: inherit;\n color: inherit;\n background: none;\n border: none;\n outline: none;\n margin: 0;\n}\n.ff-excel .ff-spreadsheet-data-viewer--boolean {\n text-align: center;\n}\n.ff-excel .ff-spreadsheet-floating-rect {\n position: absolute;\n pointer-events: none;\n box-sizing: border-box;\n}\n.ff-excel .ff-spreadsheet-floating-rect--hidden {\n display: none;\n}\n.ff-excel .ff-spreadsheet-floating-rect--selected {\n background: var(--outline-background-color);\n border: 2px var(--outline-color) solid;\n}\n.ff-excel .ff-spreadsheet-floating-rect--dragging {\n border: none;\n}\n.ff-excel .ff-spreadsheet-floating-rect--copied {\n border: 2px var(--outline-color) dashed;\n}";
|
|
31800
31800
|
styleInject(css_248z$m);
|
|
31801
31801
|
|
|
31802
31802
|
var css_248z$l = ".ff-excel-toolbar {\n display: flex;\n height: 32px;\n align-items: center;\n}\n.ff-excel-toolbar .ff-excel-toolbar-divider {\n width: 1px;\n height: 24px;\n background-color: var(--excel-toolbar-divider);\n margin: 0 24px;\n border-radius: 1px;\n z-index: 1000;\n}\n.ff-excel-toolbar .ff-excel-toolbar-font {\n display: flex;\n gap: 8px;\n justify-content: space-between;\n}\n.ff-excel-toolbar .ff-excel-toolbar-font .ff-excel-toolbar-font-family {\n width: 120px;\n}\n.ff-excel-toolbar .ff-excel-toolbar-font .ff-excel-toolbar-font-size {\n width: 56px;\n}\n.ff-excel-toolbar .ff-excel-toolbar-text {\n width: 100px;\n height: 24px;\n display: flex;\n gap: 8px;\n justify-content: space-between;\n}\n.ff-excel-toolbar .ff-excel-toolbar-text .ff-excel-toolbar-icon-underline {\n display: flex;\n align-items: center;\n}\n.ff-excel-toolbar .ff-excel-toolbar-icon {\n width: 88px;\n height: 24px;\n display: flex;\n gap: 8px;\n justify-content: space-between;\n}\n.ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color:hover {\n border-radius: 4px;\n background-color: var(--icon-hover-color);\n}\n.ff-icon-dark .ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color {\n background-color: var(--brand-color);\n}\n.ff-icon-dark .ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color.ff-icon-click:hover {\n background-color: var(--primary-button-text-color);\n}\n.ff-icon-dark .ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color.ff-icon-click:hover svg path {\n fill: var(--brand-color);\n}\n.ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color:hover {\n border-radius: 4px;\n background-color: var(--icon-hover-color);\n}\n.ff-icon-dark .ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color {\n background-color: var(--brand-color);\n}\n.ff-icon-dark .ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color.ff-icon-click:hover {\n background-color: var(--primary-button-text-color);\n}\n.ff-icon-dark .ff-excel-toolbar .ff-excel-toolbar-icon .ff-excel-toolbar-icon-color.ff-icon-click:hover svg path {\n fill: var(--brand-color);\n}\n.ff-excel-toolbar .ff-excel-toolbar-menu {\n display: flex;\n align-items: center;\n width: 36px;\n height: 24px;\n}\n.ff-excel-toolbar .ff-excel-toolbar-menu .ff-excel-toolbar-menu-option {\n display: flex;\n align-items: center;\n}";
|
|
@@ -32001,7 +32001,11 @@ const ExcelToolBar = ({
|
|
|
32001
32001
|
const [underLine, setUnderLine] = useState('underline');
|
|
32002
32002
|
const [selectedFontFamily, setSelectedFontFamily] = useState({
|
|
32003
32003
|
label: 'Times New Roman',
|
|
32004
|
-
value: '
|
|
32004
|
+
value: 'Times New Roman'
|
|
32005
|
+
});
|
|
32006
|
+
const [selectedFontSize, setSelectedFontSize] = useState({
|
|
32007
|
+
label: '11',
|
|
32008
|
+
value: '11'
|
|
32005
32009
|
});
|
|
32006
32010
|
const [colorContainer, setColorPicker] = useState({
|
|
32007
32011
|
color: 'var(--error-light)',
|
|
@@ -32134,10 +32138,12 @@ const ExcelToolBar = ({
|
|
|
32134
32138
|
className: "ff-excel-toolbar-font-family",
|
|
32135
32139
|
children: jsx(Select$1, {
|
|
32136
32140
|
showLabel: false,
|
|
32141
|
+
optionZIndex: 1000,
|
|
32137
32142
|
onChange: e => {
|
|
32143
|
+
console.log(e);
|
|
32138
32144
|
setSelectedFontFamily({
|
|
32139
32145
|
label: e.label,
|
|
32140
|
-
value: e.
|
|
32146
|
+
value: e.label
|
|
32141
32147
|
});
|
|
32142
32148
|
setFontFamily(data, e.label);
|
|
32143
32149
|
},
|
|
@@ -32153,13 +32159,17 @@ const ExcelToolBar = ({
|
|
|
32153
32159
|
className: "ff-excel-toolbar-font-size",
|
|
32154
32160
|
children: jsx(Select$1, {
|
|
32155
32161
|
showLabel: false,
|
|
32162
|
+
optionZIndex: 1000,
|
|
32156
32163
|
required: false,
|
|
32157
|
-
onChange: e =>
|
|
32164
|
+
onChange: e => {
|
|
32165
|
+
setSelectedFontSize({
|
|
32166
|
+
label: e.label,
|
|
32167
|
+
value: e.value
|
|
32168
|
+
});
|
|
32169
|
+
setFontSize(data, e.value);
|
|
32170
|
+
},
|
|
32158
32171
|
optionsList: fontSize,
|
|
32159
|
-
selectedOption:
|
|
32160
|
-
label: '11',
|
|
32161
|
-
value: '11'
|
|
32162
|
-
}
|
|
32172
|
+
selectedOption: selectedFontSize
|
|
32163
32173
|
})
|
|
32164
32174
|
})
|
|
32165
32175
|
})]
|
|
@@ -32235,6 +32245,7 @@ const ExcelToolBar = ({
|
|
|
32235
32245
|
name: getUnderlineIcon()
|
|
32236
32246
|
}), jsx(MenuOption, {
|
|
32237
32247
|
iconName: "arrow_down",
|
|
32248
|
+
zIndex: 1000,
|
|
32238
32249
|
iconSize: 12,
|
|
32239
32250
|
options: underlineTypeIcon,
|
|
32240
32251
|
tooltipPlacement: "top",
|
|
@@ -32317,6 +32328,7 @@ const ExcelToolBar = ({
|
|
|
32317
32328
|
}), jsx(MenuOption, {
|
|
32318
32329
|
iconName: "arrow_down",
|
|
32319
32330
|
iconSize: 12,
|
|
32331
|
+
zIndex: 1000,
|
|
32320
32332
|
options: borderTypeIcon,
|
|
32321
32333
|
tooltipPlacement: "top",
|
|
32322
32334
|
variant: "light",
|
|
@@ -32357,6 +32369,7 @@ const Spreadsheet = props => {
|
|
|
32357
32369
|
onKeyDown,
|
|
32358
32370
|
Table: Table$1 = Table,
|
|
32359
32371
|
Row: Row$1 = Row,
|
|
32372
|
+
sheetHeight,
|
|
32360
32373
|
HeaderRow: HeaderRow$1 = HeaderRow,
|
|
32361
32374
|
DataEditor: DataEditor$1 = DataEditor,
|
|
32362
32375
|
DataViewer: DataViewer$1 = DataViewer,
|
|
@@ -32578,6 +32591,9 @@ const Spreadsheet = props => {
|
|
|
32578
32591
|
})
|
|
32579
32592
|
}), jsxs("div", {
|
|
32580
32593
|
ref: rootRef,
|
|
32594
|
+
style: {
|
|
32595
|
+
height: sheetHeight
|
|
32596
|
+
},
|
|
32581
32597
|
className: classNames('ff-spreadsheet', className),
|
|
32582
32598
|
onKeyDown: handleKeyDown,
|
|
32583
32599
|
onMouseMove: handleMouseMove,
|
|
@@ -32593,7 +32609,7 @@ const Spreadsheet = props => {
|
|
|
32593
32609
|
var css_248z$j = ".ff-excel-book {\n z-index: 1000;\n}\n.ff-excel-book .ff-excel-sheet {\n position: static;\n top: 0;\n}\n.ff-excel-book .ff-excel-sheet-bar {\n position: static;\n max-width: 100%;\n margin-left: 60px;\n display: flex;\n height: 36px;\n align-items: center;\n color: var(--brand2-color);\n box-shadow: 0px 0px 4px -1px var(--toggle-strip-shadow);\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-add-sheet-icon {\n position: fixed;\n margin-top: 4px;\n padding: 0px 6px;\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-tab-container {\n padding-left: 40px;\n height: 36px;\n display: flex;\n overflow-x: auto;\n align-items: center;\n scrollbar-width: none;\n scrollbar-color: var(--hover-color) transparent;\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-tab-container::-webkit-scrollbar-track {\n background-color: transparent;\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-tab-container::-webkit-scrollbar-thumb {\n border-radius: 5px;\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-tab-container::-webkit-scrollbar {\n height: 0px;\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-tab-container .ff-excel-tab-list {\n margin-top: 2px;\n padding: 10px 9px;\n min-width: max-content;\n cursor: pointer;\n display: flex;\n background-color: var(--hover-color);\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-tab-container .ff-excel-tab-list.active {\n background-color: var(--excel-sheet-button-color);\n}\n.ff-excel-book .ff-excel-sheet-bar .ff-excel-tab-container .ff-excel-tab-list:focus {\n outline: none;\n text-decoration: none;\n}";
|
|
32594
32610
|
styleInject(css_248z$j);
|
|
32595
32611
|
|
|
32596
|
-
var css_248z$i = ".ff-excel-menu {\n position: absolute;\n border: 1px solid var(--option-card-border-color);\n background: var(--option-card-bg-color);\n border-radius: 4px;\n margin: 2px;\n min-height: 32px;\n min-width: 111px;\n white-space: nowrap;\n z-index:
|
|
32612
|
+
var css_248z$i = ".ff-excel-menu {\n position: absolute;\n border: 1px solid var(--option-card-border-color);\n background: var(--option-card-bg-color);\n border-radius: 4px;\n margin: 2px;\n min-height: 32px;\n min-width: 111px;\n white-space: nowrap;\n z-index: 2000;\n}\n.ff-excel-menu .ff-excel-menu-options {\n color: var(--text-color);\n cursor: pointer;\n border-radius: 3px;\n display: flex;\n align-items: center;\n padding: 4px;\n gap: 8px;\n}\n.ff-excel-menu .ff-excel-menu-options:hover {\n background-color: var(--hover-color);\n}\n.ff-excel-menu .ff-excel-menu-options label {\n cursor: pointer;\n}";
|
|
32597
32613
|
styleInject(css_248z$i);
|
|
32598
32614
|
|
|
32599
32615
|
const ExcelContextMenu = ({
|
|
@@ -32625,6 +32641,7 @@ const ExcelContextMenu = ({
|
|
|
32625
32641
|
|
|
32626
32642
|
const ExcelFile = ({
|
|
32627
32643
|
excelData,
|
|
32644
|
+
sheetHeight = '100%',
|
|
32628
32645
|
onSave = saveData => {
|
|
32629
32646
|
saveData();
|
|
32630
32647
|
}
|
|
@@ -32968,8 +32985,8 @@ const ExcelFile = ({
|
|
|
32968
32985
|
setContextMenu({
|
|
32969
32986
|
open: true,
|
|
32970
32987
|
position: {
|
|
32971
|
-
x: event.pageX -
|
|
32972
|
-
y: event.pageY -
|
|
32988
|
+
x: event.pageX - 0,
|
|
32989
|
+
y: event.pageY - 50
|
|
32973
32990
|
},
|
|
32974
32991
|
options: options
|
|
32975
32992
|
});
|
|
@@ -32983,6 +33000,7 @@ const ExcelFile = ({
|
|
|
32983
33000
|
ref: sheetRef,
|
|
32984
33001
|
className: "ff-excel-sheet",
|
|
32985
33002
|
children: jsx(Spreadsheet, {
|
|
33003
|
+
sheetHeight: sheetHeight,
|
|
32986
33004
|
setContextMenu: setContextMenu,
|
|
32987
33005
|
data: selectedSheetData,
|
|
32988
33006
|
onEvaluatedDataChange: onEvaluateChange
|