@sheetxl/utils-react 0.7.8 → 0.7.9
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/browser/cjs/BR8g9GwalrjWsdSk.cjs +6 -0
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/B5G0So8kDpXm7CIT.mjs +12 -0
- package/browser/esm/index.mjs +1084 -1062
- package/licenses/dependencies.txt +34 -34
- package/node/assets/style.css +1 -1
- package/node/esm/BNz6KrxO7ANRIJQq.mjs +12 -0
- package/node/esm/index.mjs +1154 -1131
- package/package.json +2 -2
- package/types/index.d.ts +33 -16
- package/browser/cjs/Do5J-zhfZVIT3kKP.cjs +0 -6
- package/browser/esm/B27ko2fZev5DB4Gu.mjs +0 -12
- package/node/esm/evajGyufL7MJX0Wg.mjs +0 -12
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-react",
|
|
3
3
|
"description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.9",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sheetxl/utils": "^0.7.
|
|
43
|
+
"@sheetxl/utils": "^0.7.9",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"detect-it": "^4.0.1",
|
|
46
46
|
"react-merge-refs": "^3.0.2",
|
package/types/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare type BaseGlyph = {
|
|
|
19
19
|
rtlMirror?: boolean;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
declare function boundPixel(
|
|
22
|
+
declare function boundPixel(cssPoint: number, _increase?: boolean, _absOffset?: number): number;
|
|
23
23
|
|
|
24
24
|
export declare interface BusyNotifierOptions {
|
|
25
25
|
icon?: default_2.ReactNode;
|
|
@@ -268,7 +268,7 @@ export declare function createDynamicIconService(): {
|
|
|
268
268
|
|
|
269
269
|
declare const createSyntheticEvent: <T extends Element, E extends Event>(event: E) => React.SyntheticEvent<T, E>;
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
declare const defaultCreateScrollbar: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => JSX.Element;
|
|
272
272
|
|
|
273
273
|
export declare const defaultCreateScrollCorner: ({ width, height }: {
|
|
274
274
|
width: any;
|
|
@@ -281,7 +281,8 @@ export declare const defaultCreateScrollCorner: ({ width, height }: {
|
|
|
281
281
|
export declare const defaultCreateScrollEdgeButton: (props: ScrollButtonProps) => default_2.ReactElement;
|
|
282
282
|
|
|
283
283
|
/**
|
|
284
|
-
* Relies on external styling. Follows the styling of scrollbars pattern.
|
|
284
|
+
* Relies on external styling. Follows the styling of scrollbars pattern.
|
|
285
|
+
* @see https://css-tricks.com/custom-scrollbars-in-webkit/
|
|
285
286
|
* class of scrollbar-button, vertical or horizontal, end
|
|
286
287
|
*/
|
|
287
288
|
export declare const defaultCreateScrollEndButton: (props: ScrollButtonProps) => default_2.ReactElement;
|
|
@@ -878,6 +879,13 @@ export declare interface IsContentfulCell {
|
|
|
878
879
|
(coords: CellCoords): boolean;
|
|
879
880
|
}
|
|
880
881
|
|
|
882
|
+
export declare interface IScrollbarAttributes extends HTMLDivElement {
|
|
883
|
+
isScrollbar: () => true;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
export declare interface IScrollbarElement extends IScrollbarAttributes, HTMLDivElement {
|
|
887
|
+
}
|
|
888
|
+
|
|
881
889
|
export declare interface IScrollPaneElement extends HTMLDivElement, ScrollPaneAttributes {
|
|
882
890
|
}
|
|
883
891
|
|
|
@@ -1170,7 +1178,7 @@ export declare type ScrollableViewport = {
|
|
|
1170
1178
|
totalHeight: number;
|
|
1171
1179
|
};
|
|
1172
1180
|
|
|
1173
|
-
export declare const Scrollbar: default_2.NamedExoticComponent<ScrollbarProps & default_2.RefAttributes<
|
|
1181
|
+
export declare const Scrollbar: default_2.NamedExoticComponent<ScrollbarProps & default_2.RefAttributes<IScrollbarElement>>;
|
|
1174
1182
|
|
|
1175
1183
|
export declare const ScrollbarOrientation: {
|
|
1176
1184
|
readonly Horizontal: "horizontal";
|
|
@@ -1181,8 +1189,8 @@ export declare type ScrollbarOrientation = typeof ScrollbarOrientation[keyof typ
|
|
|
1181
1189
|
|
|
1182
1190
|
export declare interface ScrollbarProps extends default_2.HTMLAttributes<HTMLElement> {
|
|
1183
1191
|
offset: number;
|
|
1184
|
-
totalSize: number;
|
|
1185
1192
|
viewportSize: number;
|
|
1193
|
+
totalSize: number;
|
|
1186
1194
|
orientation: ScrollbarOrientation;
|
|
1187
1195
|
onScrollOffset: (offset: number, viewportSize: number, totalSize: number) => void;
|
|
1188
1196
|
/**
|
|
@@ -1196,21 +1204,28 @@ export declare interface ScrollbarProps extends default_2.HTMLAttributes<HTMLEle
|
|
|
1196
1204
|
* @defaultValue false
|
|
1197
1205
|
*/
|
|
1198
1206
|
showCustomScrollButtons?: boolean;
|
|
1199
|
-
|
|
1207
|
+
/**
|
|
1208
|
+
* The minimum size of the thumb in pixels.
|
|
1209
|
+
*
|
|
1210
|
+
* @defaultValue 24
|
|
1211
|
+
*/
|
|
1212
|
+
minThumbSize?: number;
|
|
1213
|
+
/**
|
|
1214
|
+
* The amount to increment the scroll position when the scroll button is clicked.
|
|
1215
|
+
* This can be a fixed number or a function that takes the current offset, viewport size,
|
|
1216
|
+
* and total size and returns the increment amount.
|
|
1217
|
+
*/
|
|
1218
|
+
scrollButtonIncrement?: number | ((offset: number, viewport: number, totalSize: number) => number);
|
|
1200
1219
|
scrollButtonInitialRepeatDelay?: number;
|
|
1201
1220
|
scrollButtonAdditionalRepeatDelay?: number;
|
|
1202
|
-
createScrollStartButton?: (props: ScrollButtonProps) => default_2.ReactElement;
|
|
1203
|
-
createScrollEndButton?: (props: ScrollButtonProps) => default_2.ReactElement;
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
export declare interface ScrollbarRefProps extends ScrollbarProps {
|
|
1207
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
1221
|
+
createScrollStartButton?: (props: ScrollButtonProps, ref?: default_2.Ref<HTMLElement>) => default_2.ReactElement;
|
|
1222
|
+
createScrollEndButton?: (props: ScrollButtonProps, ref?: default_2.Ref<HTMLElement>) => default_2.ReactElement;
|
|
1208
1223
|
}
|
|
1209
1224
|
|
|
1210
1225
|
export declare interface ScrollButtonProps {
|
|
1211
1226
|
style?: default_2.CSSProperties;
|
|
1212
1227
|
orientation?: ScrollbarOrientation;
|
|
1213
|
-
disabled
|
|
1228
|
+
disabled?: boolean;
|
|
1214
1229
|
onMouseUp: (e: default_2.MouseEvent<HTMLElement>) => void;
|
|
1215
1230
|
onMouseLeave: (e: default_2.MouseEvent<HTMLElement>) => void;
|
|
1216
1231
|
onMouseDown: (e: default_2.MouseEvent<HTMLElement>) => void;
|
|
@@ -1231,8 +1246,8 @@ export declare interface ScrollPaneProps extends React.HTMLAttributes<HTMLDivEle
|
|
|
1231
1246
|
showHorizontalScrollbar?: boolean;
|
|
1232
1247
|
showVerticalScrollbar?: boolean;
|
|
1233
1248
|
createScrollCorner?: (size: Size) => React.ReactNode;
|
|
1234
|
-
createHorizontalScrollbar?: (props:
|
|
1235
|
-
createVerticalScrollbar?: (props:
|
|
1249
|
+
createHorizontalScrollbar?: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => React.ReactNode;
|
|
1250
|
+
createVerticalScrollbar?: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => React.ReactNode;
|
|
1236
1251
|
/**
|
|
1237
1252
|
* By default the ScrollPane will listen for events on all of the children of the ScrollPane but this
|
|
1238
1253
|
* allows for a custom element to be specified. Useful when the ScrollPane has some elements
|
|
@@ -1253,7 +1268,8 @@ export declare interface ScrollState extends TopLeft {
|
|
|
1253
1268
|
|
|
1254
1269
|
export declare namespace ScrollUtils {
|
|
1255
1270
|
export {
|
|
1256
|
-
getScrollTo
|
|
1271
|
+
getScrollTo,
|
|
1272
|
+
defaultCreateScrollbar
|
|
1257
1273
|
}
|
|
1258
1274
|
}
|
|
1259
1275
|
|
|
@@ -1614,6 +1630,7 @@ export declare interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onS
|
|
|
1614
1630
|
* @defaultValue 50
|
|
1615
1631
|
*/
|
|
1616
1632
|
precisionFactor?: number;
|
|
1633
|
+
createScrollbar?: (props: ScrollbarProps, ref?: default_2.Ref<HTMLElement>) => default_2.ReactNode;
|
|
1617
1634
|
}
|
|
1618
1635
|
|
|
1619
1636
|
export declare function WalkingIcon(props: WalkingIconProps): JSX.Element;
|