indicator-ui 0.0.302 → 0.0.304
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/dist/index.js +345 -0
- package/dist/index.js.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/useSmartPosition.d.ts +46 -0
- package/dist/types/src/test/pages/UseSmartPositionPage.d.ts +1 -0
- package/dist/types/src/test/pages/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/mixins.d.ts +7 -0
- package/dist/types/src/ui/FormBuilder/lib/formBuilder.d.ts +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
type WeightTableType = [
|
|
3
|
+
[
|
|
4
|
+
number,
|
|
5
|
+
number,
|
|
6
|
+
number
|
|
7
|
+
],
|
|
8
|
+
[
|
|
9
|
+
number,
|
|
10
|
+
0,
|
|
11
|
+
number
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number
|
|
17
|
+
]
|
|
18
|
+
];
|
|
19
|
+
type PropsType = [
|
|
20
|
+
ref: RefObject<HTMLElement>,
|
|
21
|
+
options?: {
|
|
22
|
+
parentRef?: RefObject<HTMLElement>;
|
|
23
|
+
windowRef?: RefObject<HTMLElement>;
|
|
24
|
+
position?: 'absolute' | 'fixed' | 'relative';
|
|
25
|
+
offset?: number;
|
|
26
|
+
weights?: WeightTableType;
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Хук для умного позиционирования элемента.
|
|
31
|
+
*
|
|
32
|
+
* Позволяет определить оптимальное положение элемента,
|
|
33
|
+
* чтобы он не выходил за пределы видимой области.
|
|
34
|
+
*
|
|
35
|
+
* @param ref Ref на элемент, который нужно позиционировать
|
|
36
|
+
* @param [options.parentRef=undfined] Ref на контейнер, относительно которого будет происходить позиционирование. Если не задан, то будет позиционировать относительно изначального положения.
|
|
37
|
+
* @param [options.windowRef=window] Ref на контейнер, в области видимости которого будет происходить позиционирование. По умолчанию позиционирует в главном окне (`window`).
|
|
38
|
+
* @param [options.position='fixed'] Ref на контейнер, в области видимости которого будет происходить позиционирование. По умолчанию позиционирует в главном окне (`window`).
|
|
39
|
+
* @param [options.offset=4] Ref на контейнер, в области видимости которого будет происходить позиционирование. По умолчанию позиционирует в главном окне (`window`).
|
|
40
|
+
*
|
|
41
|
+
* @returns void
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
*/
|
|
45
|
+
export declare function useSmartPosition(...args: PropsType): void;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function UseSmartPositionPage(): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentType, ForwardedRef, LegacyRef } from "react";
|
|
2
|
+
type RefType<R> = [R] extends [LegacyRef<infer T> | ForwardedRef<infer T> | undefined] ? T : never;
|
|
3
|
+
export type PropsOf<C> = C extends ComponentType<infer P> ? P : C extends (...args: infer P) => any ? P : never;
|
|
4
|
+
export type ComponentRefType<R> = [
|
|
5
|
+
R
|
|
6
|
+
] extends [ComponentType<any>] ? RefType<PropsOf<R>['ref']> : RefType<R>;
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FORM_BUILDER_SCHEMA } from "../schemes";
|
|
2
2
|
import { AdditionPropsType } from "../types";
|
|
3
|
-
declare const formBuilder: (schema: FORM_BUILDER_SCHEMA, additionProps: AdditionPropsType) =>
|
|
3
|
+
declare const formBuilder: (schema: FORM_BUILDER_SCHEMA, additionProps: AdditionPropsType) => import("react").ReactNode[];
|
|
4
4
|
export default formBuilder;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "indicator-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.304",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/types/src/index.d.ts",
|
|
6
6
|
"style": "dist/index.css",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@babel/preset-typescript": "^7.26.0",
|
|
25
25
|
"@svgr/webpack": "^8.1.0",
|
|
26
26
|
"@types/jest": "^29.5.14",
|
|
27
|
+
"@types/lodash": "^4.17.20",
|
|
27
28
|
"@types/node": "^22.13.13",
|
|
28
29
|
"@types/object-hash": "^3.0.6",
|
|
29
30
|
"@types/react": "^18.2.0",
|
|
@@ -63,7 +64,8 @@
|
|
|
63
64
|
"webpack": "^5.97.1",
|
|
64
65
|
"webpack-cli": "^6.0.1",
|
|
65
66
|
"webpack-dev-server": "^5.2.0",
|
|
66
|
-
"@types/
|
|
67
|
+
"@types/mathjs": "^9.4.1",
|
|
68
|
+
"mathjs": "^14.5.3"
|
|
67
69
|
},
|
|
68
70
|
"peerDependencies": {
|
|
69
71
|
"react": ">=18.0.0",
|