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
package/lib/index.js
CHANGED
|
@@ -31816,7 +31816,7 @@ const Copied = () => {
|
|
|
31816
31816
|
});
|
|
31817
31817
|
};
|
|
31818
31818
|
|
|
31819
|
-
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
|
|
31819
|
+
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}";
|
|
31820
31820
|
styleInject(css_248z$m);
|
|
31821
31821
|
|
|
31822
31822
|
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}";
|
|
@@ -32021,7 +32021,11 @@ const ExcelToolBar = ({
|
|
|
32021
32021
|
const [underLine, setUnderLine] = React.useState('underline');
|
|
32022
32022
|
const [selectedFontFamily, setSelectedFontFamily] = React.useState({
|
|
32023
32023
|
label: 'Times New Roman',
|
|
32024
|
-
value: '
|
|
32024
|
+
value: 'Times New Roman'
|
|
32025
|
+
});
|
|
32026
|
+
const [selectedFontSize, setSelectedFontSize] = React.useState({
|
|
32027
|
+
label: '11',
|
|
32028
|
+
value: '11'
|
|
32025
32029
|
});
|
|
32026
32030
|
const [colorContainer, setColorPicker] = React.useState({
|
|
32027
32031
|
color: 'var(--error-light)',
|
|
@@ -32154,10 +32158,12 @@ const ExcelToolBar = ({
|
|
|
32154
32158
|
className: "ff-excel-toolbar-font-family",
|
|
32155
32159
|
children: jsxRuntime.jsx(Select$1, {
|
|
32156
32160
|
showLabel: false,
|
|
32161
|
+
optionZIndex: 1000,
|
|
32157
32162
|
onChange: e => {
|
|
32163
|
+
console.log(e);
|
|
32158
32164
|
setSelectedFontFamily({
|
|
32159
32165
|
label: e.label,
|
|
32160
|
-
value: e.
|
|
32166
|
+
value: e.label
|
|
32161
32167
|
});
|
|
32162
32168
|
setFontFamily(data, e.label);
|
|
32163
32169
|
},
|
|
@@ -32173,13 +32179,17 @@ const ExcelToolBar = ({
|
|
|
32173
32179
|
className: "ff-excel-toolbar-font-size",
|
|
32174
32180
|
children: jsxRuntime.jsx(Select$1, {
|
|
32175
32181
|
showLabel: false,
|
|
32182
|
+
optionZIndex: 1000,
|
|
32176
32183
|
required: false,
|
|
32177
|
-
onChange: e =>
|
|
32184
|
+
onChange: e => {
|
|
32185
|
+
setSelectedFontSize({
|
|
32186
|
+
label: e.label,
|
|
32187
|
+
value: e.value
|
|
32188
|
+
});
|
|
32189
|
+
setFontSize(data, e.value);
|
|
32190
|
+
},
|
|
32178
32191
|
optionsList: fontSize,
|
|
32179
|
-
selectedOption:
|
|
32180
|
-
label: '11',
|
|
32181
|
-
value: '11'
|
|
32182
|
-
}
|
|
32192
|
+
selectedOption: selectedFontSize
|
|
32183
32193
|
})
|
|
32184
32194
|
})
|
|
32185
32195
|
})]
|
|
@@ -32255,6 +32265,7 @@ const ExcelToolBar = ({
|
|
|
32255
32265
|
name: getUnderlineIcon()
|
|
32256
32266
|
}), jsxRuntime.jsx(MenuOption, {
|
|
32257
32267
|
iconName: "arrow_down",
|
|
32268
|
+
zIndex: 1000,
|
|
32258
32269
|
iconSize: 12,
|
|
32259
32270
|
options: underlineTypeIcon,
|
|
32260
32271
|
tooltipPlacement: "top",
|
|
@@ -32337,6 +32348,7 @@ const ExcelToolBar = ({
|
|
|
32337
32348
|
}), jsxRuntime.jsx(MenuOption, {
|
|
32338
32349
|
iconName: "arrow_down",
|
|
32339
32350
|
iconSize: 12,
|
|
32351
|
+
zIndex: 1000,
|
|
32340
32352
|
options: borderTypeIcon,
|
|
32341
32353
|
tooltipPlacement: "top",
|
|
32342
32354
|
variant: "light",
|
|
@@ -32377,6 +32389,7 @@ const Spreadsheet = props => {
|
|
|
32377
32389
|
onKeyDown,
|
|
32378
32390
|
Table: Table$1 = Table,
|
|
32379
32391
|
Row: Row$1 = Row,
|
|
32392
|
+
sheetHeight,
|
|
32380
32393
|
HeaderRow: HeaderRow$1 = HeaderRow,
|
|
32381
32394
|
DataEditor: DataEditor$1 = DataEditor,
|
|
32382
32395
|
DataViewer: DataViewer$1 = DataViewer,
|
|
@@ -32598,6 +32611,9 @@ const Spreadsheet = props => {
|
|
|
32598
32611
|
})
|
|
32599
32612
|
}), jsxRuntime.jsxs("div", {
|
|
32600
32613
|
ref: rootRef,
|
|
32614
|
+
style: {
|
|
32615
|
+
height: sheetHeight
|
|
32616
|
+
},
|
|
32601
32617
|
className: classNames('ff-spreadsheet', className),
|
|
32602
32618
|
onKeyDown: handleKeyDown,
|
|
32603
32619
|
onMouseMove: handleMouseMove,
|
|
@@ -32613,7 +32629,7 @@ const Spreadsheet = props => {
|
|
|
32613
32629
|
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}";
|
|
32614
32630
|
styleInject(css_248z$j);
|
|
32615
32631
|
|
|
32616
|
-
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:
|
|
32632
|
+
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}";
|
|
32617
32633
|
styleInject(css_248z$i);
|
|
32618
32634
|
|
|
32619
32635
|
const ExcelContextMenu = ({
|
|
@@ -32645,6 +32661,7 @@ const ExcelContextMenu = ({
|
|
|
32645
32661
|
|
|
32646
32662
|
const ExcelFile = ({
|
|
32647
32663
|
excelData,
|
|
32664
|
+
sheetHeight = '100%',
|
|
32648
32665
|
onSave = saveData => {
|
|
32649
32666
|
saveData();
|
|
32650
32667
|
}
|
|
@@ -32988,8 +33005,8 @@ const ExcelFile = ({
|
|
|
32988
33005
|
setContextMenu({
|
|
32989
33006
|
open: true,
|
|
32990
33007
|
position: {
|
|
32991
|
-
x: event.pageX -
|
|
32992
|
-
y: event.pageY -
|
|
33008
|
+
x: event.pageX - 0,
|
|
33009
|
+
y: event.pageY - 50
|
|
32993
33010
|
},
|
|
32994
33011
|
options: options
|
|
32995
33012
|
});
|
|
@@ -33003,6 +33020,7 @@ const ExcelFile = ({
|
|
|
33003
33020
|
ref: sheetRef,
|
|
33004
33021
|
className: "ff-excel-sheet",
|
|
33005
33022
|
children: jsxRuntime.jsx(Spreadsheet, {
|
|
33023
|
+
sheetHeight: sheetHeight,
|
|
33006
33024
|
setContextMenu: setContextMenu,
|
|
33007
33025
|
data: selectedSheetData,
|
|
33008
33026
|
onEvaluatedDataChange: onEvaluateChange
|