@ulu/frontend-vue 0.6.2 → 0.6.3
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/composables/useUluFloating.d.ts +18 -8
- package/dist/composables/useUluFloating.d.ts.map +1 -1
- package/dist/composables/useUluFloating.js +25 -25
- package/dist/mcp-data.json +3453 -3421
- package/dist/plugins/popovers/UluPopover.vue.d.ts.map +1 -1
- package/dist/plugins/popovers/UluPopover.vue.js +38 -0
- package/lib/composables/useUluFloating.js +9 -7
- package/lib/plugins/popovers/UluPopover.vue +38 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluPopover.vue.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/UluPopover.vue"],"names":[],"mappings":"AAuDA;
|
|
1
|
+
{"version":3,"file":"UluPopover.vue.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/UluPopover.vue"],"names":[],"mappings":"AAuDA;wBAwfqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAZjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QASG"}
|
|
@@ -10,29 +10,67 @@ const Q = ["id", "disabled", "aria-expanded", "aria-controls", "aria-label"], W
|
|
|
10
10
|
}, ie = {
|
|
11
11
|
__name: "UluPopover",
|
|
12
12
|
props: {
|
|
13
|
+
/**
|
|
14
|
+
* Text for popover button
|
|
15
|
+
*/
|
|
13
16
|
triggerText: String,
|
|
17
|
+
/**
|
|
18
|
+
* Add optional aria-label to button for icons/etc
|
|
19
|
+
*/
|
|
14
20
|
triggerAlt: String,
|
|
21
|
+
/**
|
|
22
|
+
* Disable trigger button
|
|
23
|
+
*/
|
|
15
24
|
disabled: Boolean,
|
|
25
|
+
/**
|
|
26
|
+
* Tooltip text for trigger button
|
|
27
|
+
*/
|
|
16
28
|
tooltip: String,
|
|
29
|
+
/**
|
|
30
|
+
* Popover size (ie large, etc)
|
|
31
|
+
*/
|
|
17
32
|
size: String,
|
|
33
|
+
/**
|
|
34
|
+
* No padding on popover content
|
|
35
|
+
*/
|
|
18
36
|
noPadding: Boolean,
|
|
37
|
+
/**
|
|
38
|
+
* Floating UI config (merged with defaults for popover)
|
|
39
|
+
* - See useUluFloating() composable for config API
|
|
40
|
+
*/
|
|
19
41
|
config: {
|
|
20
42
|
type: Object,
|
|
21
43
|
default: () => ({})
|
|
22
44
|
},
|
|
45
|
+
/**
|
|
46
|
+
* Mount this component already open state
|
|
47
|
+
*/
|
|
23
48
|
startOpen: Boolean,
|
|
49
|
+
/**
|
|
50
|
+
* Active class for trigger button
|
|
51
|
+
*/
|
|
24
52
|
activeClass: {
|
|
25
53
|
type: String,
|
|
26
54
|
default: "is-active"
|
|
27
55
|
},
|
|
56
|
+
/**
|
|
57
|
+
* Add custom classes to specific elements
|
|
58
|
+
* { trigger, content }
|
|
59
|
+
*/
|
|
28
60
|
classes: {
|
|
29
61
|
type: Object,
|
|
30
62
|
default: () => ({})
|
|
31
63
|
},
|
|
64
|
+
/**
|
|
65
|
+
* Close popover when click is outside
|
|
66
|
+
*/
|
|
32
67
|
clickOutsideCloses: {
|
|
33
68
|
type: Boolean,
|
|
34
69
|
default: !0
|
|
35
70
|
},
|
|
71
|
+
/**
|
|
72
|
+
* Direct focus when open/closing popover
|
|
73
|
+
*/
|
|
36
74
|
directFocus: {
|
|
37
75
|
type: Function,
|
|
38
76
|
default: ({ isOpen: e, content: g }) => {
|
|
@@ -19,10 +19,12 @@ import {
|
|
|
19
19
|
/**
|
|
20
20
|
* @typedef {object} UluFloatingConfig
|
|
21
21
|
* @property {Placement} placement - The placement of the floating element.
|
|
22
|
-
* @property {
|
|
23
|
-
* @property {
|
|
24
|
-
* @property {
|
|
25
|
-
* @property {
|
|
22
|
+
* @property {Boolean|Object} inline - Whether the floating element is inline. If object is passed will be passed as configuration for the floating ui "inline" plugin.
|
|
23
|
+
* @property {Number|Object} offset - The offset of the floating element. If object is passed will be passed as configuration for the floating ui "offset" plugin.
|
|
24
|
+
* @property {Object} flip - This plugin is always added, if object is passed will be passed as configuration for the floating ui "flip" plugin.
|
|
25
|
+
* @property {Object} shift - This plugin is always added, if object is passed will be passed as configuration for the floating ui "shift" plugin.
|
|
26
|
+
* @property {Boolean} arrow - Whether the floating element has an arrow.
|
|
27
|
+
* @property {Function} onReady - Callback function when the floating element is ready.
|
|
26
28
|
*/
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -54,10 +56,10 @@ export function useUluFloating(trigger, content, config) {
|
|
|
54
56
|
([configValue, arrowEl]) => {
|
|
55
57
|
const mw = [];
|
|
56
58
|
if (!configValue) return;
|
|
57
|
-
if (configValue.inline) mw.push(inline());
|
|
59
|
+
if (configValue.inline) mw.push(inline(configValue.inline));
|
|
58
60
|
if (configValue.offset) mw.push(offset(configValue.offset));
|
|
59
|
-
mw.push(flip());
|
|
60
|
-
mw.push(shift());
|
|
61
|
+
mw.push(flip(configValue.flip));
|
|
62
|
+
mw.push(shift(configValue.shift));
|
|
61
63
|
if (configValue.arrow && arrowEl) {
|
|
62
64
|
mw.push(arrow({ element: arrowEl }));
|
|
63
65
|
}
|
|
@@ -63,29 +63,67 @@
|
|
|
63
63
|
|
|
64
64
|
const emit = defineEmits(["toggle"]);
|
|
65
65
|
const props = defineProps({
|
|
66
|
+
/**
|
|
67
|
+
* Text for popover button
|
|
68
|
+
*/
|
|
66
69
|
triggerText: String,
|
|
70
|
+
/**
|
|
71
|
+
* Add optional aria-label to button for icons/etc
|
|
72
|
+
*/
|
|
67
73
|
triggerAlt: String,
|
|
74
|
+
/**
|
|
75
|
+
* Disable trigger button
|
|
76
|
+
*/
|
|
68
77
|
disabled: Boolean,
|
|
78
|
+
/**
|
|
79
|
+
* Tooltip text for trigger button
|
|
80
|
+
*/
|
|
69
81
|
tooltip: String,
|
|
82
|
+
/**
|
|
83
|
+
* Popover size (ie large, etc)
|
|
84
|
+
*/
|
|
70
85
|
size: String,
|
|
86
|
+
/**
|
|
87
|
+
* No padding on popover content
|
|
88
|
+
*/
|
|
71
89
|
noPadding: Boolean,
|
|
90
|
+
/**
|
|
91
|
+
* Floating UI config (merged with defaults for popover)
|
|
92
|
+
* - See useUluFloating() composable for config API
|
|
93
|
+
*/
|
|
72
94
|
config: {
|
|
73
95
|
type: Object,
|
|
74
96
|
default: () => ({})
|
|
75
97
|
},
|
|
98
|
+
/**
|
|
99
|
+
* Mount this component already open state
|
|
100
|
+
*/
|
|
76
101
|
startOpen: Boolean,
|
|
102
|
+
/**
|
|
103
|
+
* Active class for trigger button
|
|
104
|
+
*/
|
|
77
105
|
activeClass: {
|
|
78
106
|
type: String,
|
|
79
107
|
default: "is-active"
|
|
80
108
|
},
|
|
109
|
+
/**
|
|
110
|
+
* Add custom classes to specific elements
|
|
111
|
+
* { trigger, content }
|
|
112
|
+
*/
|
|
81
113
|
classes: {
|
|
82
114
|
type: Object,
|
|
83
115
|
default: () => ({})
|
|
84
116
|
},
|
|
117
|
+
/**
|
|
118
|
+
* Close popover when click is outside
|
|
119
|
+
*/
|
|
85
120
|
clickOutsideCloses: {
|
|
86
121
|
type: Boolean,
|
|
87
122
|
default: true
|
|
88
123
|
},
|
|
124
|
+
/**
|
|
125
|
+
* Direct focus when open/closing popover
|
|
126
|
+
*/
|
|
89
127
|
directFocus: {
|
|
90
128
|
type: Function,
|
|
91
129
|
default: ({ isOpen, content }) => {
|
package/package.json
CHANGED