@maas/vue-equipment 0.25.1 → 0.25.2
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/nuxt/module.json
CHANGED
|
@@ -154,6 +154,15 @@ const {
|
|
|
154
154
|
removeScrollLockPadding,
|
|
155
155
|
} = drawerApi
|
|
156
156
|
|
|
157
|
+
// Make sure this is reactive
|
|
158
|
+
const disabled = computed(() => {
|
|
159
|
+
if (props.options.disabled === undefined) {
|
|
160
|
+
return defaultOptions.disabled
|
|
161
|
+
} else {
|
|
162
|
+
return props.options.disabled
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
|
|
157
166
|
const { onPointerdown, onClick, style, hasDragged } = useDrawerDrag({
|
|
158
167
|
id: props.id,
|
|
159
168
|
isActive,
|
|
@@ -171,6 +180,7 @@ const { initializeWheelListener, destroyWheelListener } = useDrawerWheel({
|
|
|
171
180
|
id: props.id,
|
|
172
181
|
elRef,
|
|
173
182
|
position,
|
|
183
|
+
disabled,
|
|
174
184
|
})
|
|
175
185
|
|
|
176
186
|
const { findState } = useDrawerState(props.id)
|
|
@@ -225,15 +235,6 @@ const contentTransition = computed(() => {
|
|
|
225
235
|
: mappedOptions.transitions?.content
|
|
226
236
|
})
|
|
227
237
|
|
|
228
|
-
// Make sure this is reactive
|
|
229
|
-
const disabled = computed(() => {
|
|
230
|
-
if (props.options.disabled === undefined) {
|
|
231
|
-
return defaultOptions.disabled
|
|
232
|
-
} else {
|
|
233
|
-
return props.options.disabled
|
|
234
|
-
}
|
|
235
|
-
})
|
|
236
|
-
|
|
237
238
|
// Private functions
|
|
238
239
|
function convertToPixels(value: string) {
|
|
239
240
|
const regex = /^(\d*\.?\d+)\s*(rem|px)$/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type Ref, type MaybeRef } from 'vue';
|
|
1
|
+
import { type Ref, type MaybeRef, type ComputedRef } from 'vue';
|
|
2
2
|
import { type DefaultOptions } from '../../utils/defaultOptions.js';
|
|
3
3
|
type UseDrawerWheelArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
5
|
elRef: Ref<HTMLElement | undefined>;
|
|
6
6
|
position: MaybeRef<DefaultOptions['position']>;
|
|
7
|
+
disabled: ComputedRef<boolean>;
|
|
7
8
|
};
|
|
8
9
|
export declare function useDrawerWheel(args: UseDrawerWheelArgs): {
|
|
9
10
|
initializeWheelListener: () => void;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toValue
|
|
4
|
+
} from "vue";
|
|
2
5
|
import { unrefElement } from "@vueuse/core";
|
|
3
6
|
import WheelGestures from "wheel-gestures";
|
|
4
7
|
import { useDrawerState } from "./useDrawerState.mjs";
|
|
5
8
|
export function useDrawerWheel(args) {
|
|
6
|
-
const { id, elRef, position } = args;
|
|
9
|
+
const { id, elRef, position, disabled } = args;
|
|
7
10
|
const { findState } = useDrawerState(toValue(id));
|
|
8
11
|
const { dragging, wheeling } = findState();
|
|
9
12
|
let startEvent;
|
|
@@ -18,7 +21,7 @@ export function useDrawerWheel(args) {
|
|
|
18
21
|
}
|
|
19
22
|
});
|
|
20
23
|
const wheelGestures = WheelGestures({
|
|
21
|
-
preventWheelAction: axis.value,
|
|
24
|
+
preventWheelAction: disabled ? false : axis.value,
|
|
22
25
|
reverseSign: [true, true, false]
|
|
23
26
|
// Reverse scroll direction for x and y axis
|
|
24
27
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maas/vue-equipment",
|
|
3
3
|
"description": "A magic collection of Vue composables, plugins, components and directives",
|
|
4
|
-
"version": "0.25.
|
|
4
|
+
"version": "0.25.2",
|
|
5
5
|
"author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@antfu/ni": "^0.21.12",
|