@tempots/ui 4.3.7 → 5.0.0
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/index.cjs +1 -1
- package/index.js +601 -579
- package/package.json +1 -1
- package/renderables/pop-over.d.ts +46 -44
package/package.json
CHANGED
|
@@ -6,69 +6,71 @@ import { TNode, Value, Signal } from '@tempots/dom';
|
|
|
6
6
|
*/
|
|
7
7
|
export type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
8
8
|
/**
|
|
9
|
-
* Represents
|
|
9
|
+
* Represents all possible placements for a pop-over.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export declare const allPlacements: Placement[];
|
|
14
|
+
/**
|
|
15
|
+
* Represents the options for the arrow of a pop-over.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export type PopOverArrowOptions = {
|
|
20
|
+
x?: number;
|
|
21
|
+
y?: number;
|
|
22
|
+
centerOffset: number;
|
|
23
|
+
alignmentOffset?: number;
|
|
24
|
+
placement: Placement;
|
|
25
|
+
containerWidth: number;
|
|
26
|
+
containerHeight: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Represents the properties for a pop-over.
|
|
10
30
|
*
|
|
11
31
|
* @public
|
|
12
32
|
*/
|
|
13
33
|
export type PopOverOptions = {
|
|
14
|
-
/**
|
|
15
|
-
* Specifies whether the PopOver is open or closed.
|
|
16
|
-
*/
|
|
17
|
-
open: Value<boolean>;
|
|
18
34
|
/**
|
|
19
35
|
* Specifies the content of the PopOver.
|
|
20
36
|
* This should be a function that returns a TNode.
|
|
21
37
|
*/
|
|
22
|
-
content:
|
|
38
|
+
content: TNode;
|
|
23
39
|
/**
|
|
24
40
|
* Specifies the placement of the PopOver.
|
|
25
41
|
* This is an optional property.
|
|
26
42
|
*/
|
|
27
43
|
placement?: Value<Placement>;
|
|
28
44
|
/**
|
|
29
|
-
* Specifies the offset
|
|
30
|
-
* This is an optional property.
|
|
45
|
+
* Specifies the offset on the main axis.
|
|
31
46
|
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Specifies the offset on the main axis.
|
|
35
|
-
*/
|
|
36
|
-
mainAxis?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Specifies the offset on the cross axis.
|
|
39
|
-
*/
|
|
40
|
-
crossAxis?: number;
|
|
41
|
-
}>;
|
|
47
|
+
mainAxisOffset?: Value<number>;
|
|
42
48
|
/**
|
|
43
|
-
* Specifies the
|
|
44
|
-
* When provided, an arrow element will be created and positioned.
|
|
45
|
-
* This is an optional property.
|
|
49
|
+
* Specifies the offset on the cross axis.
|
|
46
50
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
centerOffset: number;
|
|
62
|
-
alignmentOffset?: number;
|
|
63
|
-
placement: Placement;
|
|
64
|
-
containerWidth: number;
|
|
65
|
-
containerHeight: number;
|
|
51
|
+
crossAxisOffset?: Value<number>;
|
|
52
|
+
/**
|
|
53
|
+
* Specifies the padding between the arrow and the edges of the floating element.
|
|
54
|
+
*/
|
|
55
|
+
arrowPadding?: Value<number>;
|
|
56
|
+
/**
|
|
57
|
+
* Specifies the content of the arrow.
|
|
58
|
+
*/
|
|
59
|
+
arrow?: (signal: Signal<PopOverArrowOptions>) => TNode;
|
|
60
|
+
/**
|
|
61
|
+
* Specifies the target element for the PopOver. If not provided, the PopOver will be
|
|
62
|
+
* positioned relative to the parent element.
|
|
63
|
+
*/
|
|
64
|
+
target?: string | HTMLElement;
|
|
66
65
|
};
|
|
67
66
|
/**
|
|
68
|
-
*
|
|
67
|
+
* Creates a pop-over component.
|
|
69
68
|
*
|
|
70
|
-
* @param
|
|
71
|
-
* @
|
|
69
|
+
* @param fn - A function that returns the content of the pop-over.
|
|
70
|
+
* @param options - The options for the pop-over.
|
|
71
|
+
* @returns The pop-over component.
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
export declare const PopOver: (
|
|
74
|
+
export declare const PopOver: (fn: (open: (options: PopOverOptions) => void, close: () => void) => TNode, options?: {
|
|
75
|
+
isOpen: Value<boolean>;
|
|
76
|
+
}) => import('@tempots/dom').Renderable<import('@tempots/dom').DOMContext>;
|