@rebilly/revel 6.30.36 → 6.30.37

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/CHANGELOG.md CHANGED
@@ -1 +1 @@
1
- ## [6.30.36](https://github.com/Rebilly/rebilly/compare/revel-v6.30.35...revel-v6.30.36) (2024-07-29)
1
+ ## [6.30.37](https://github.com/Rebilly/rebilly/compare/revel-v6.30.36...revel-v6.30.37) (2024-07-29)
@@ -1,259 +1,116 @@
1
- import { type PropType } from 'vue';
2
- interface State {
3
- id: string;
4
- hideTimer: Nullable<ReturnType<typeof setTimeout>>;
5
- hideDelayMs: number;
6
- isPopperVisible: boolean;
7
- activePopper: Nullable<string>;
8
- }
9
- interface Margin {
10
- top: number;
11
- bottom: number;
12
- right: number;
13
- left: number;
14
- }
15
- interface PopperAction {
16
- delay: Nullable<number>;
17
- }
18
- declare const _default: import("vue").DefineComponent<{
1
+ declare const allDirections: readonly ["horizontal", "vertical"];
2
+ declare const allPositions: readonly ["bottomStart", "bottomEnd", "topStart", "topEnd"];
3
+ type MarginsOffset = [number, number, number, number];
4
+ type Directions = (typeof allDirections)[number];
5
+ type Positions = (typeof allPositions)[number];
6
+ type SlideFrom = 'fade' | 'top' | 'bottom' | 'left' | 'right';
7
+ interface Props {
19
8
  /**
20
- * If the popper is open by parent component
9
+ * Opens popper with the parent component
21
10
  */
22
- state: {
23
- type: BooleanConstructor;
24
- default: null;
25
- };
11
+ state?: Nullable<boolean>;
26
12
  /**
27
- * Escape button to hide
13
+ * Close popper on escape key press
28
14
  */
29
- escToHide: {
30
- type: BooleanConstructor;
31
- default: boolean;
32
- };
15
+ escToHide?: boolean;
33
16
  /**
34
- * If the popper should hide automatically
17
+ * Close popper automatically
35
18
  */
36
- autoHide: {
37
- type: BooleanConstructor;
38
- default: boolean;
39
- };
19
+ autoHide?: boolean;
40
20
  /**
41
- * Global auto hide
21
+ * Close all poppers automatically
42
22
  */
43
- globalAutoHide: {
44
- type: BooleanConstructor;
45
- default: boolean;
46
- };
23
+ globalAutoHide?: boolean;
47
24
  /**
48
- * On close function
25
+ * Function to run when closing the popper
49
26
  */
50
- closeFunction: {
51
- type: FunctionConstructor;
52
- default: null;
53
- };
27
+ closeFunction?: Nullable<() => unknown>;
54
28
  /**
55
- * Open on mount
29
+ * Open popper on mount
56
30
  */
57
- openOnMount: {
58
- type: BooleanConstructor;
59
- default: boolean;
60
- };
31
+ openOnMount?: boolean;
61
32
  /**
62
- * Disabled
33
+ * Disable popper
63
34
  */
64
- disabled: {
65
- type: BooleanConstructor;
66
- default: boolean;
67
- };
35
+ disabled?: boolean;
68
36
  /**
69
- * Fluid
37
+ * Fluid popper layout
70
38
  */
71
- fluid: {
72
- type: BooleanConstructor;
73
- default: boolean;
74
- };
39
+ fluid?: boolean;
75
40
  /**
76
- * Offset in px
41
+ * Offset from the trigger element
77
42
  */
78
- offset: {
79
- type: NumberConstructor;
80
- default: number;
81
- };
43
+ offset?: number;
82
44
  /**
83
- * Additional offset ignoring popper direction
45
+ * Margin from the trigger element
84
46
  */
85
- margin: {
86
- type: PropType<number[]>;
87
- default: () => number[];
88
- };
47
+ margin?: MarginsOffset;
89
48
  /**
90
- * Direction
49
+ * Popper direction
91
50
  */
92
- direction: {
93
- type: PropType<"horizontal" | "vertical">;
94
- default: string;
95
- validator: (direction: string) => boolean;
96
- };
51
+ direction?: Directions;
97
52
  /**
98
- * Position
53
+ * Popper position
99
54
  */
100
- position: {
101
- type: PropType<"bottomEnd" | "bottomStart" | "topStart" | "topEnd">;
102
- default: string;
103
- validator: (position: string) => boolean;
104
- };
55
+ position?: Positions;
105
56
  /**
106
- * Slide from (transition options): 'fade', 'top', 'bottom', 'left', 'right'
57
+ * Slide from direction
107
58
  */
108
- slideFrom: {
109
- type: StringConstructor;
110
- default: string;
111
- validator: (slide: string) => boolean;
112
- };
59
+ slideFrom?: SlideFrom;
113
60
  /**
114
61
  * Transition duration
115
62
  */
116
- duration: {
117
- type: NumberConstructor;
118
- default: number;
119
- };
120
- }, {
121
- popperElement: import("vue").Ref<HTMLDivElement | null>;
122
- popperContentElement: import("vue").Ref<HTMLDivElement | null>;
123
- }, State, {
124
- triggerEl(): HTMLDivElement | null;
125
- contentEl(): HTMLDivElement | null;
126
- /**
127
- * The actions and properties available to the parent component.
128
- * @returns {{}} Object of functions and properties
129
- */
130
- popper(): {
63
+ duration?: number;
64
+ }
65
+ interface PopperAction {
66
+ delay: Nullable<number>;
67
+ }
68
+ declare function togglePopper(payload?: PopperAction): void;
69
+ declare function closePopper(payload?: PopperAction): Promise<void>;
70
+ declare function openPopper(payload?: PopperAction): void;
71
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
72
+ state: null;
73
+ escToHide: boolean;
74
+ autoHide: boolean;
75
+ globalAutoHide: boolean;
76
+ closeFunction: null;
77
+ openOnMount: boolean;
78
+ disabled: boolean;
79
+ fluid: boolean;
80
+ offset: number;
81
+ margin: () => number[];
82
+ direction: string;
83
+ position: string;
84
+ slideFrom: string;
85
+ duration: number;
86
+ }>, {
87
+ popper: import("vue").ComputedRef<{
131
88
  isVisible: boolean;
132
- open: (payload?: PopperAction) => void;
133
- close: (payload?: PopperAction) => Promise<void>;
134
- toggle: (payload?: PopperAction) => void;
135
- };
136
- hideTriggerHeight(): boolean;
137
- }, {
138
- setActivePopper(value: Nullable<string>): void;
139
- setPopperVisible(visible: boolean): Promise<void>;
140
- calculateContentPosition(): {
141
- top: number;
142
- left: number;
143
- } | undefined;
144
- positionContent(): void;
145
- getTriggerMargins(): Nullable<Margin>;
146
- convertPixelsToNumber(value: string): number;
147
- autoHidePopover(): void;
148
- globalAutoHidePopover(): void;
149
- escapePopper(): void;
150
- togglePopper(payload?: PopperAction): void;
151
- closePopper(payload?: PopperAction): Promise<void>;
152
- openPopper(payload?: PopperAction): void;
153
- mountPopup(): void;
154
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("toggle" | "setActivePopper" | "toggle-on" | "toggle-off")[], "toggle" | "setActivePopper" | "toggle-on" | "toggle-off", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
155
- /**
156
- * If the popper is open by parent component
157
- */
158
- state: {
159
- type: BooleanConstructor;
160
- default: null;
161
- };
162
- /**
163
- * Escape button to hide
164
- */
165
- escToHide: {
166
- type: BooleanConstructor;
167
- default: boolean;
168
- };
169
- /**
170
- * If the popper should hide automatically
171
- */
172
- autoHide: {
173
- type: BooleanConstructor;
174
- default: boolean;
175
- };
176
- /**
177
- * Global auto hide
178
- */
179
- globalAutoHide: {
180
- type: BooleanConstructor;
181
- default: boolean;
182
- };
183
- /**
184
- * On close function
185
- */
186
- closeFunction: {
187
- type: FunctionConstructor;
188
- default: null;
189
- };
190
- /**
191
- * Open on mount
192
- */
193
- openOnMount: {
194
- type: BooleanConstructor;
195
- default: boolean;
196
- };
197
- /**
198
- * Disabled
199
- */
200
- disabled: {
201
- type: BooleanConstructor;
202
- default: boolean;
203
- };
204
- /**
205
- * Fluid
206
- */
207
- fluid: {
208
- type: BooleanConstructor;
209
- default: boolean;
210
- };
211
- /**
212
- * Offset in px
213
- */
214
- offset: {
215
- type: NumberConstructor;
216
- default: number;
217
- };
218
- /**
219
- * Additional offset ignoring popper direction
220
- */
221
- margin: {
222
- type: PropType<number[]>;
223
- default: () => number[];
224
- };
225
- /**
226
- * Direction
227
- */
228
- direction: {
229
- type: PropType<"horizontal" | "vertical">;
230
- default: string;
231
- validator: (direction: string) => boolean;
232
- };
233
- /**
234
- * Position
235
- */
236
- position: {
237
- type: PropType<"bottomEnd" | "bottomStart" | "topStart" | "topEnd">;
238
- default: string;
239
- validator: (position: string) => boolean;
240
- };
241
- /**
242
- * Slide from (transition options): 'fade', 'top', 'bottom', 'left', 'right'
243
- */
244
- slideFrom: {
245
- type: StringConstructor;
246
- default: string;
247
- validator: (slide: string) => boolean;
248
- };
249
- /**
250
- * Transition duration
251
- */
252
- duration: {
253
- type: NumberConstructor;
254
- default: number;
255
- };
256
- }>> & {
89
+ open: typeof openPopper;
90
+ close: typeof closePopper;
91
+ toggle: typeof togglePopper;
92
+ }>;
93
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
94
+ toggle: (...args: any[]) => void;
95
+ setActivePopper: (...args: any[]) => void;
96
+ "toggle-on": (...args: any[]) => void;
97
+ "toggle-off": (...args: any[]) => void;
98
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
99
+ state: null;
100
+ escToHide: boolean;
101
+ autoHide: boolean;
102
+ globalAutoHide: boolean;
103
+ closeFunction: null;
104
+ openOnMount: boolean;
105
+ disabled: boolean;
106
+ fluid: boolean;
107
+ offset: number;
108
+ margin: () => number[];
109
+ direction: string;
110
+ position: string;
111
+ slideFrom: string;
112
+ duration: number;
113
+ }>>> & {
257
114
  onToggle?: ((...args: any[]) => any) | undefined;
258
115
  onSetActivePopper?: ((...args: any[]) => any) | undefined;
259
116
  "onToggle-on"?: ((...args: any[]) => any) | undefined;
@@ -264,14 +121,53 @@ declare const _default: import("vue").DefineComponent<{
264
121
  autoHide: boolean;
265
122
  position: "bottomEnd" | "bottomStart" | "topStart" | "topEnd";
266
123
  offset: number;
267
- state: boolean;
124
+ state: Nullable<boolean>;
268
125
  duration: number;
269
126
  escToHide: boolean;
270
127
  globalAutoHide: boolean;
271
- closeFunction: Function;
128
+ closeFunction: Nullable<() => unknown>;
272
129
  openOnMount: boolean;
273
- margin: number[];
130
+ margin: MarginsOffset;
274
131
  direction: "horizontal" | "vertical";
275
- slideFrom: string;
132
+ slideFrom: SlideFrom;
133
+ }>, {
134
+ trigger?(_: {
135
+ popper: {
136
+ isVisible: boolean;
137
+ open: typeof openPopper;
138
+ close: typeof closePopper;
139
+ toggle: typeof togglePopper;
140
+ };
141
+ }): any;
142
+ content?(_: {
143
+ popper: {
144
+ isVisible: boolean;
145
+ open: typeof openPopper;
146
+ close: typeof closePopper;
147
+ toggle: typeof togglePopper;
148
+ };
149
+ }): any;
276
150
  }>;
277
151
  export default _default;
152
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
153
+ type __VLS_TypePropsToRuntimeProps<T> = {
154
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
155
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
156
+ } : {
157
+ type: import('vue').PropType<T[K]>;
158
+ required: true;
159
+ };
160
+ };
161
+ type __VLS_WithDefaults<P, D> = {
162
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
163
+ default: D[K];
164
+ }> : P[K];
165
+ };
166
+ type __VLS_Prettify<T> = {
167
+ [K in keyof T]: T[K];
168
+ } & {};
169
+ type __VLS_WithTemplateSlots<T, S> = T & {
170
+ new (): {
171
+ $slots: S;
172
+ };
173
+ };