Skip to content

Commit a162f1d

Browse files
Release 4.0.0
1 parent 89ee40e commit a162f1d

19 files changed

+81
-41
lines changed

README.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MDB 5 Vue
22

3-
Version: FREE 3.2.0
3+
Version: FREE 4.0.0
44

55
Documentation:
66
https://mdbootstrap.com/docs/b5/vue/

css/mdb.dark.min.css

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/mdb.dark.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/mdb.dark.rtl.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/mdb.min.css

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/mdb.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/mdb.rtl.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/mdb.es.min.js

+30-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/mdb.es.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/mdb.umd.min.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/mdb.umd.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mdb-vue-ui-kit",
3-
"version": "3.2.0",
3+
"version": "4.0.0",
44
"type": "module",
55
"main": "js/mdb.umd.min.js",
66
"module": "js/mdb.es.min.js",

src/components/free/components/MDBDropdown.vue

+13-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
import MDBPopper from "../../utils/MDBPopper";
2424
import { on, off } from "../../utils/MDBEventHandlers";
2525
import { handleBreakpoints } from "../../utils/MDBBreakpointHandler";
26+
import { useMotionReduced } from "../../../composables/free/useMotionReduced";
2627
2728
const props = defineProps({
2829
tag: {
@@ -111,19 +112,25 @@ watch(
111112
isActive.value = props.modelValue;
112113
canUpdate.value = false;
113114
}
114-
syncValuesTimeout.value = setTimeout(() => {
115-
isActive.value = props.modelValue;
116-
}, 300);
115+
syncValuesTimeout.value = setTimeout(
116+
() => {
117+
isActive.value = props.modelValue;
118+
},
119+
useMotionReduced() ? 0 : 300
120+
);
117121
}
118122
);
119123
120124
watch(
121125
() => canUpdate.value,
122126
(curr) => {
123127
if (!curr) {
124-
canUpdateTimeout.value = setTimeout(() => {
125-
canUpdate.value = true;
126-
}, 200);
128+
canUpdateTimeout.value = setTimeout(
129+
() => {
130+
canUpdate.value = true;
131+
},
132+
useMotionReduced() ? 0 : 200
133+
);
127134
}
128135
}
129136
);

src/components/free/components/MDBDropdownMenu.vue

+8-4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default {
5656
import { MDBInput } from "../../../index.free";
5757
import { computed, inject, onMounted, Ref, ref, watch } from "vue";
5858
import { on, off } from "../../utils/MDBEventHandlers";
59+
import { useMotionReduced } from "../../../composables/free/useMotionReduced";
5960
6061
const props = defineProps({
6162
tag: {
@@ -88,7 +89,7 @@ const props = defineProps({
8889
},
8990
});
9091
91-
const animationDuration = 550;
92+
const animationDuration = useMotionReduced() ? 0 : 550;
9293
9394
const className = computed(() => {
9495
return [
@@ -137,9 +138,12 @@ if (isActive) {
137138
() => isActive.value,
138139
(cur) => {
139140
if (cur) {
140-
setTimeout(() => {
141-
setMenuMountedState(true, root.value as HTMLElement);
142-
}, 100);
141+
setTimeout(
142+
() => {
143+
setMenuMountedState(true, root.value as HTMLElement);
144+
},
145+
useMotionReduced() ? 0 : 100
146+
);
143147
} else if (!cur && isPopperActive) {
144148
setInactive();
145149

src/components/free/forms/MDBInput.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const inputClassName = computed(() => {
174174
: props.inputGroup &&
175175
props.inputGroup !== true &&
176176
`form-control-${props.inputGroup}`,
177-
inputValue.value && "active",
177+
(inputValue.value || inputValue.value === 0) && "active",
178178
showPlaceholder.value && "placeholder-active",
179179
isInputValidated.value && isInputValid.value && "is-valid",
180180
isInputValidated.value && !isInputValid.value && "is-invalid",
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const useMotionReduced = (): boolean => {
2+
if (typeof window !== "undefined" && window.matchMedia) {
3+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
4+
}
5+
return false; // default to false if not supported
6+
};

src/scss/free/_scrollspy.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.nav-pills.menu-sidebar .nav-link {
2+
border-left: 0 solid transparent;
3+
}

src/scss/index.free.scss

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@import "./free/navbar";
1414
@import "./free/tooltips";
1515
@import "./free/popovers";
16+
@import "./free/scrollspy";
1617
@import "./free/validation";
1718
@import "./free/tabs";
1819
@import "./free/input-group";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare const useMotionReduced: () => boolean;

0 commit comments

Comments
 (0)