forked from floating-ui/floating-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation.json
More file actions
637 lines (637 loc) · 28.3 KB
/
Copy pathdocumentation.json
File metadata and controls
637 lines (637 loc) · 28.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
{
"classes": [
{
"name": "Popper",
"description": "",
"extends": [],
"access": "",
"virtual": false,
"fires": "",
"constructor": {
"name": "Popper",
"description": "Create a new Popper.js instance",
"parameters": [
{
"name": "trigger",
"type": [
"HTMLElement"
],
"description": "The reference element used to position the popper",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "popper",
"type": [
"HTMLElement",
"Object"
],
"description": "The HTML element used as popper, or a configuration used to generate the popper.",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "popper.tagName",
"type": [
"String"
],
"description": "The tag name of the generated popper.",
"default": "'div'",
"optional": true,
"nullable": ""
},
{
"name": "popper.classNames",
"type": [
"Array"
],
"description": "Array of classes to apply to the generated popper.",
"default": "['popper']",
"optional": true,
"nullable": ""
},
{
"name": "popper.attributes",
"type": [
"Array"
],
"description": "Array of attributes to apply, specify `attr:value` to assign a value to it.",
"default": "",
"optional": true,
"nullable": ""
},
{
"name": "popper.parent",
"type": [
"HTMLElement",
"String"
],
"description": "The parent element, given as HTMLElement or as query string.",
"default": "window.document.body",
"optional": true,
"nullable": ""
},
{
"name": "popper.content",
"type": [
"String"
],
"description": "The content of the popper, it can be text or HTML, in case of HTML, enable `allowHtml`.",
"default": "''",
"optional": true,
"nullable": ""
},
{
"name": "popper.allowHtml",
"type": [
"Boolean"
],
"description": "If set to true, the `content` will be parsed as HTML.",
"default": "false",
"optional": true,
"nullable": ""
},
{
"name": "popper.arrow.tagName",
"type": [
"String"
],
"description": "Same as `popper.tagName` but for the arrow element.",
"default": "'div'",
"optional": true,
"nullable": ""
},
{
"name": "popper.arrow.classNames",
"type": [
"Array"
],
"description": "Same as `popper.classNames` but for the arrow element.",
"default": "'popper__arrow'",
"optional": true,
"nullable": ""
},
{
"name": "popper.arrow.attributes",
"type": [
"String"
],
"description": "Same as `popper.attributes` but for the arrow element.",
"default": "['x-arrow']",
"optional": true,
"nullable": ""
},
{
"name": "options",
"type": [
"Object"
],
"description": "",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "options.placement",
"type": [
"String"
],
"description": "Placement of the popper accepted values: `top(-left, -right), right(-left, -right), bottom(-left, -right),\n left(-left, -right)`",
"default": "bottom",
"optional": true,
"nullable": ""
},
{
"name": "options.gpuAcceleration",
"type": [
"Boolean"
],
"description": "When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the\n browser to use the GPU to accelerate the rendering.\n If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.",
"default": "true",
"optional": true,
"nullable": ""
},
{
"name": "options.offset",
"type": [
"Number"
],
"description": "Amount of pixels the popper will be shifted (can be negative).",
"default": "0",
"optional": true,
"nullable": ""
},
{
"name": "options.boundariesElement",
"type": [
"String",
"Element"
],
"description": "The element which will define the boundaries of the popper position, the popper will never be placed outside\n of the defined boundaries (except if `keepTogether` is enabled)",
"default": "'viewport'",
"optional": true,
"nullable": ""
},
{
"name": "options.boundariesPadding",
"type": [
"Number"
],
"description": "Additional padding for the boundaries",
"default": "5",
"optional": true,
"nullable": ""
},
{
"name": "options.preventOverflowOrder",
"type": [
"Array"
],
"description": "Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,\n this means that the last ones will never overflow",
"default": "['left', 'right', 'top', 'bottom']",
"optional": true,
"nullable": ""
},
{
"name": "options.flipBehavior",
"type": [
"String",
"Array"
],
"description": "The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to\n overlap its trigger element. Defining `flip` as value, the placement will be flipped on\n its axis (`right - left`, `top - bottom`).\n You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify\n how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,\n then, if even in its new placement, the popper is overlapping its trigger, it will be moved to top)",
"default": "'flip'",
"optional": true,
"nullable": ""
},
{
"name": "options.modifiers",
"type": [
"Array"
],
"description": "List of functions used to modify the data before they are applied to the popper, add your custom functions\n to this array to edit the offsets and placement.\n The function should reflect the @params and @returns of preventOverflow",
"default": "[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']",
"optional": true,
"nullable": ""
},
{
"name": "options.modifiersIgnored",
"type": [
"Array"
],
"description": "Put here any built-in modifier name you want to exclude from the modifiers list\n The function should reflect the @params and @returns of preventOverflow",
"default": "[]",
"optional": true,
"nullable": ""
}
],
"examples": []
},
"functions": [
{
"name": "destroy",
"access": "",
"virtual": false,
"description": "Destroy the popper",
"parameters": [],
"examples": []
},
{
"name": "update",
"access": "",
"virtual": false,
"description": "Updates the position of the popper, computing the new offsets and applying the new style",
"parameters": [],
"examples": []
},
{
"name": "onCreate",
"access": "",
"virtual": false,
"description": "If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.",
"parameters": [
{
"name": "callback",
"type": [
"function"
],
"description": "",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": []
},
{
"name": "onUpdate",
"access": "",
"virtual": false,
"description": "If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations\nused to style popper and its arrow.",
"parameters": [
{
"name": "callback",
"type": [
"function"
],
"description": "",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": []
},
{
"name": "parse",
"access": "",
"virtual": false,
"description": "Helper used to generate poppers from a configuration file",
"parameters": [],
"examples": [],
"returns": {
"type": [
"HTMLElement"
],
"description": "popper"
}
},
{
"name": "_getOffsets",
"access": "private",
"virtual": false,
"description": "Get offsets to the popper",
"parameters": [
{
"name": "popper",
"type": [
"Element"
],
"description": "the popper element",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "trigger",
"type": [
"Element"
],
"description": "the trigger element (the popper will be relative to this)",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "An object containing the offsets which will be applied to the popper"
}
},
{
"name": "_setupEventListeners",
"access": "private",
"virtual": false,
"description": "Setup needed event listeners used to update the popper position",
"parameters": [],
"examples": []
},
{
"name": "_removeEventListeners",
"access": "private",
"virtual": false,
"description": "Remove event listeners used to update the popper position",
"parameters": [],
"examples": []
},
{
"name": "_getBoundaries",
"access": "private",
"virtual": false,
"description": "Computed the boundaries limits and return them",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "Object containing the property \"offsets\" generated by `_getOffsets`",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "padding",
"type": [
"Number"
],
"description": "Boundaries padding",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "boundariesElement",
"type": [
"Element"
],
"description": "Element used to define the boundaries",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "Coordinates of the boundaries"
}
},
{
"name": "runModifiers",
"access": "public",
"virtual": false,
"description": "Loop trough the list of modifiers and run them in order, each of them will then edit the data object",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "modifiers",
"type": [
"Array"
],
"description": "",
"default": "",
"optional": "",
"nullable": ""
},
{
"name": "ends",
"type": [
"function"
],
"description": "",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": []
},
{
"name": "isModifierRequired",
"access": "",
"virtual": false,
"description": "Helper used to know if the given modifier depends from another one.",
"parameters": [],
"examples": [],
"returns": {
"type": [
"Boolean"
],
"description": ""
}
}
],
"namespaces": [
{
"name": "modifiers",
"description": "Modifiers list",
"access": "",
"virtual": false,
"functions": [
{
"name": "Popper#modifiers.applyStyle",
"access": "",
"virtual": false,
"description": "Apply the computed styles to the popper element",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "The data object generated by `update` method",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "The same data object"
}
},
{
"name": "Popper#modifiers.shift",
"access": "",
"virtual": false,
"description": "Modifier used to shift the popper on the start or end of its reference element side",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "The data object generated by `update` method",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "The data object, properly modified"
}
},
{
"name": "Popper#modifiers.preventOverflow",
"access": "",
"virtual": false,
"description": "Modifier used to make sure the popper does not overflows from it's boundaries",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "The data object generated by `update` method",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "The data object, properly modified"
}
},
{
"name": "Popper#modifiers.keepTogether",
"access": "",
"virtual": false,
"description": "Modifier used to make sure the popper is always near its trigger",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "The data object generated by _update method",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "The data object, properly modified"
}
},
{
"name": "Popper#modifiers.flip",
"access": "",
"virtual": false,
"description": "Modifier used to flip the placement of the popper when the latter is starting overlapping its trigger.\nRequires the `preventOverflow` modifier before it in order to work.\n**NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "The data object generated by _update method",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "The data object, properly modified"
}
},
{
"name": "Popper#modifiers.offset",
"access": "",
"virtual": false,
"description": "Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.\nThe offsets will shift the popper on the side of its trigger element.",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "The data object generated by _update method",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "The data object, properly modified"
}
},
{
"name": "Popper#modifiers.arrow",
"access": "",
"virtual": false,
"description": "Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the trigger\nIt will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed",
"parameters": [
{
"name": "data",
"type": [
"Object"
],
"description": "The data object generated by _update method",
"default": "",
"optional": "",
"nullable": ""
}
],
"examples": [],
"returns": {
"type": [
"Object"
],
"description": "The data object, properly modified"
}
}
]
}
]
}
]
}