@sheinx/hooks 3.8.6-beta.4 → 3.8.6-beta.5
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/cjs/common/use-position-style/get-sizing-style.d.ts +4 -1
- package/cjs/common/use-position-style/get-sizing-style.d.ts.map +1 -1
- package/cjs/common/use-position-style/get-sizing-style.js +3 -1
- package/cjs/common/use-position-style/index.d.ts +1 -1
- package/cjs/common/use-position-style/index.d.ts.map +1 -1
- package/esm/common/use-position-style/get-sizing-style.d.ts +4 -1
- package/esm/common/use-position-style/get-sizing-style.d.ts.map +1 -1
- package/esm/common/use-position-style/get-sizing-style.js +3 -1
- package/esm/common/use-position-style/index.d.ts +1 -1
- package/esm/common/use-position-style/index.d.ts.map +1 -1
- package/package.json +1 -1
@@ -1,8 +1,11 @@
|
|
1
1
|
interface Options {
|
2
2
|
parentRect: DOMRect;
|
3
|
-
boundary: HTMLElement;
|
3
|
+
boundary: () => HTMLElement | null;
|
4
4
|
}
|
5
5
|
export declare const getSizingStyle: (position: string, { boundary, parentRect }: Options) => {
|
6
|
+
maxHeight?: undefined;
|
7
|
+
overflowY?: undefined;
|
8
|
+
} | {
|
6
9
|
maxHeight: number | undefined;
|
7
10
|
overflowY: "auto";
|
8
11
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-sizing-style.d.ts","sourceRoot":"","sources":["get-sizing-style.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;
|
1
|
+
{"version":3,"file":"get-sizing-style.d.ts","sourceRoot":"","sources":["get-sizing-style.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CACpC;AAID,eAAO,MAAO,cAAc,aAAc,MAAM,4BAA2B,OAAO;;;;;;CAYjF,CAAA"}
|
@@ -9,7 +9,9 @@ exports.getSizingStyle = void 0;
|
|
9
9
|
var getSizingStyle = exports.getSizingStyle = function getSizingStyle(position, _ref) {
|
10
10
|
var boundary = _ref.boundary,
|
11
11
|
parentRect = _ref.parentRect;
|
12
|
-
var
|
12
|
+
var boundaryEl = boundary();
|
13
|
+
if (!boundaryEl) return {};
|
14
|
+
var boundaryRect = boundaryEl.getBoundingClientRect();
|
13
15
|
var maxHeight;
|
14
16
|
if (position.endsWith('-top')) {
|
15
17
|
maxHeight = boundaryRect.bottom - parentRect.top;
|
@@ -18,7 +18,7 @@ export interface PositionStyleConfig {
|
|
18
18
|
onAdjust?: (position: HorizontalPosition | VerticalPosition) => void;
|
19
19
|
checkPosition?: boolean;
|
20
20
|
offset?: [number, number];
|
21
|
-
boundary?: HTMLElement | null;
|
21
|
+
boundary?: () => HTMLElement | null;
|
22
22
|
}
|
23
23
|
export declare const usePositionStyle: (config: PositionStyleConfig) => {
|
24
24
|
style: React.CSSProperties;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAWpE,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,GACX,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,KAAK,GACL,QAAQ,CAAC;AAYb,KAAK,YAAY,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,OAAO,CAAC;AACpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IAEd,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAE1C,UAAU,EAAE,KAAK,CAAC,SAAS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AAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,GAAG,gBAAgB,KAAK,IAAI,CAAC;IACrE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CACrC;AAsBD,eAAO,MAAM,gBAAgB,WAAY,mBAAmB;;CA4V3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
interface Options {
|
2
2
|
parentRect: DOMRect;
|
3
|
-
boundary: HTMLElement;
|
3
|
+
boundary: () => HTMLElement | null;
|
4
4
|
}
|
5
5
|
export declare const getSizingStyle: (position: string, { boundary, parentRect }: Options) => {
|
6
|
+
maxHeight?: undefined;
|
7
|
+
overflowY?: undefined;
|
8
|
+
} | {
|
6
9
|
maxHeight: number | undefined;
|
7
10
|
overflowY: "auto";
|
8
11
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-sizing-style.d.ts","sourceRoot":"","sources":["get-sizing-style.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;
|
1
|
+
{"version":3,"file":"get-sizing-style.d.ts","sourceRoot":"","sources":["get-sizing-style.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CACpC;AAID,eAAO,MAAO,cAAc,aAAc,MAAM,4BAA2B,OAAO;;;;;;CAYjF,CAAA"}
|
@@ -3,7 +3,9 @@
|
|
3
3
|
export var getSizingStyle = function getSizingStyle(position, _ref) {
|
4
4
|
var boundary = _ref.boundary,
|
5
5
|
parentRect = _ref.parentRect;
|
6
|
-
var
|
6
|
+
var boundaryEl = boundary();
|
7
|
+
if (!boundaryEl) return {};
|
8
|
+
var boundaryRect = boundaryEl.getBoundingClientRect();
|
7
9
|
var maxHeight;
|
8
10
|
if (position.endsWith('-top')) {
|
9
11
|
maxHeight = boundaryRect.bottom - parentRect.top;
|
@@ -18,7 +18,7 @@ export interface PositionStyleConfig {
|
|
18
18
|
onAdjust?: (position: HorizontalPosition | VerticalPosition) => void;
|
19
19
|
checkPosition?: boolean;
|
20
20
|
offset?: [number, number];
|
21
|
-
boundary?: HTMLElement | null;
|
21
|
+
boundary?: () => HTMLElement | null;
|
22
22
|
}
|
23
23
|
export declare const usePositionStyle: (config: PositionStyleConfig) => {
|
24
24
|
style: React.CSSProperties;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAWpE,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,UAAU,GACV,cAAc,GACd,WAAW,GACX,MAAM,GACN,OAAO,CAAC;AACZ,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,UAAU,GACV,WAAW,GACX,KAAK,GACL,QAAQ,CAAC;AAYb,KAAK,YAAY,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,OAAO,CAAC;AACpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB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