@ulu/frontend-vue 0.6.1 → 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/index.js +44 -42
- package/dist/mcp-data.json +4149 -4117
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/modals/index.d.ts +2 -0
- package/dist/plugins/modals/index.d.ts.map +1 -1
- package/dist/plugins/modals/useModals.js +10 -0
- 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/index.js +1 -1
- package/lib/plugins/modals/index.js +7 -1
- package/lib/plugins/popovers/UluPopover.vue +38 -0
- package/package.json +1 -1
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as corePlugin } from './core/index.js';
|
|
2
|
-
export { default as modalsPlugin } from './modals/index.js';
|
|
3
2
|
export { default as toastPlugin } from './toast/index.js';
|
|
4
3
|
export { default as breakpointsPlugin } from './breakpoints/index.js';
|
|
5
4
|
export { default as popoversPlugin, useTooltip, useTooltipFollow } from './popovers/index.js';
|
|
5
|
+
export { default as modalsPlugin, useModals } from './modals/index.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { useModals } from './useModals.js';
|
|
1
2
|
/**
|
|
2
3
|
* Modals Vue Plugin
|
|
3
4
|
* @param {Object} App Vue app instance passed to plugin
|
|
4
5
|
* @param {UluModalsPluginOptions} userOptions Options to change (see defaults)
|
|
5
6
|
*/
|
|
6
7
|
export default function install(app: any, userOptions: UluModalsPluginOptions): void;
|
|
8
|
+
export { useModals };
|
|
7
9
|
/**
|
|
8
10
|
* Default plugin options
|
|
9
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/index.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,uDAFW,sBAAsB,QA8BhC;;;;;;;;;;;;;kBAxCa,eAAe;;0BANH,gBAAgB"}
|
|
@@ -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
|
}
|
package/lib/plugins/index.js
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
export { default as corePlugin } from './core/index.js';
|
|
9
9
|
export { default as popoversPlugin, useTooltip, useTooltipFollow } from './popovers/index.js';
|
|
10
|
-
export { default as modalsPlugin } from './modals/index.js';
|
|
10
|
+
export { default as modalsPlugin, useModals } from './modals/index.js';
|
|
11
11
|
export { default as toastPlugin } from './toast/index.js';
|
|
12
12
|
export { default as breakpointsPlugin } from './breakpoints/index.js';
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import UluModalsDisplay from "./UluModalsDisplay.vue";
|
|
8
8
|
import UluModal from "../../components/collapsible/UluModal.vue";
|
|
9
9
|
import { createApi, modalsState } from "./api.js";
|
|
10
|
+
import { useModals } from "./useModals.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Default plugin options
|
|
@@ -52,4 +53,9 @@ export default function install(app, userOptions) {
|
|
|
52
53
|
// Global property for modals component to access state
|
|
53
54
|
// and for debugging logging if needed
|
|
54
55
|
app.config.globalProperties.$uluModalsState = modalsState;
|
|
55
|
-
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Public export for composable function
|
|
60
|
+
*/
|
|
61
|
+
export { useModals };
|
|
@@ -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