@veritree/ui 0.47.0 → 0.48.1
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/mixins/floating-ui.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { computePosition, flip, shift, offset, size } from '@floating-ui/dom';
|
|
2
2
|
|
|
3
3
|
export const floatingUiMixin = {
|
|
4
|
+
props: {
|
|
5
|
+
offset: {
|
|
6
|
+
type: [Number, String],
|
|
7
|
+
default: 5,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
|
|
4
11
|
data() {
|
|
5
12
|
return {
|
|
6
13
|
component: null,
|
|
@@ -40,7 +47,7 @@ export const floatingUiMixin = {
|
|
|
40
47
|
computePosition(trigger, content, {
|
|
41
48
|
placement: this.placement,
|
|
42
49
|
middleware: [
|
|
43
|
-
offset(
|
|
50
|
+
offset(Number(this.offset)),
|
|
44
51
|
flip(),
|
|
45
52
|
shift({ padding: 5 }),
|
|
46
53
|
size({
|
package/package.json
CHANGED
|
@@ -18,18 +18,30 @@ export default {
|
|
|
18
18
|
type: [String, Number],
|
|
19
19
|
default: 500,
|
|
20
20
|
},
|
|
21
|
+
/**
|
|
22
|
+
* Determines whether the button will use its default atomic style (tailwind) or its default class
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
* @values
|
|
25
|
+
* - true: The button will have no default style and can be fully customized with a custom class
|
|
26
|
+
* - false: The button will use its default atomic style (tailwind) and can be further customized with additional classes
|
|
27
|
+
* @default null
|
|
28
|
+
*/
|
|
29
|
+
headless: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* The placement of the component relative to its trigger element.
|
|
35
|
+
* @type {string}
|
|
36
|
+
* @values 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'
|
|
37
|
+
* @default 'bottom-start'
|
|
38
|
+
*/
|
|
21
39
|
placement: {
|
|
22
40
|
type: String,
|
|
23
41
|
default: 'bottom',
|
|
24
42
|
},
|
|
25
43
|
},
|
|
26
44
|
|
|
27
|
-
data() {
|
|
28
|
-
return {
|
|
29
|
-
floatingUiMinWidth: 0,
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
|
|
33
45
|
provide() {
|
|
34
46
|
return {
|
|
35
47
|
apiTooltip: () => {
|
|
@@ -59,6 +71,7 @@ export default {
|
|
|
59
71
|
data() {
|
|
60
72
|
return {
|
|
61
73
|
componentId: genId(),
|
|
74
|
+
floatingUiMinWidth: 0,
|
|
62
75
|
};
|
|
63
76
|
},
|
|
64
77
|
};
|