Skip to content

Commit

Permalink
Release 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smolenski-mikolaj committed May 4, 2023
1 parent 89ee40e commit a162f1d
Show file tree
Hide file tree
Showing 19 changed files with 81 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MDB 5 Vue

Version: FREE 3.2.0
Version: FREE 4.0.0

Documentation:
https://mdbootstrap.com/docs/b5/vue/
Expand Down
6 changes: 3 additions & 3 deletions css/mdb.dark.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/mdb.dark.min.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions css/mdb.dark.rtl.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions css/mdb.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/mdb.min.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions css/mdb.rtl.min.css

Large diffs are not rendered by default.

45 changes: 30 additions & 15 deletions js/mdb.es.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/mdb.es.min.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion js/mdb.umd.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/mdb.umd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdb-vue-ui-kit",
"version": "3.2.0",
"version": "4.0.0",
"type": "module",
"main": "js/mdb.umd.min.js",
"module": "js/mdb.es.min.js",
Expand Down
19 changes: 13 additions & 6 deletions src/components/free/components/MDBDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
import MDBPopper from "../../utils/MDBPopper";
import { on, off } from "../../utils/MDBEventHandlers";
import { handleBreakpoints } from "../../utils/MDBBreakpointHandler";
import { useMotionReduced } from "../../../composables/free/useMotionReduced";
const props = defineProps({
tag: {
Expand Down Expand Up @@ -111,19 +112,25 @@ watch(
isActive.value = props.modelValue;
canUpdate.value = false;
}
syncValuesTimeout.value = setTimeout(() => {
isActive.value = props.modelValue;
}, 300);
syncValuesTimeout.value = setTimeout(
() => {
isActive.value = props.modelValue;
},
useMotionReduced() ? 0 : 300
);
}
);
watch(
() => canUpdate.value,
(curr) => {
if (!curr) {
canUpdateTimeout.value = setTimeout(() => {
canUpdate.value = true;
}, 200);
canUpdateTimeout.value = setTimeout(
() => {
canUpdate.value = true;
},
useMotionReduced() ? 0 : 200
);
}
}
);
Expand Down
12 changes: 8 additions & 4 deletions src/components/free/components/MDBDropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default {
import { MDBInput } from "../../../index.free";
import { computed, inject, onMounted, Ref, ref, watch } from "vue";
import { on, off } from "../../utils/MDBEventHandlers";
import { useMotionReduced } from "../../../composables/free/useMotionReduced";
const props = defineProps({
tag: {
Expand Down Expand Up @@ -88,7 +89,7 @@ const props = defineProps({
},
});
const animationDuration = 550;
const animationDuration = useMotionReduced() ? 0 : 550;
const className = computed(() => {
return [
Expand Down Expand Up @@ -137,9 +138,12 @@ if (isActive) {
() => isActive.value,
(cur) => {
if (cur) {
setTimeout(() => {
setMenuMountedState(true, root.value as HTMLElement);
}, 100);
setTimeout(
() => {
setMenuMountedState(true, root.value as HTMLElement);
},
useMotionReduced() ? 0 : 100
);
} else if (!cur && isPopperActive) {
setInactive();
Expand Down
2 changes: 1 addition & 1 deletion src/components/free/forms/MDBInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const inputClassName = computed(() => {
: props.inputGroup &&
props.inputGroup !== true &&
`form-control-${props.inputGroup}`,
inputValue.value && "active",
(inputValue.value || inputValue.value === 0) && "active",
showPlaceholder.value && "placeholder-active",
isInputValidated.value && isInputValid.value && "is-valid",
isInputValidated.value && !isInputValid.value && "is-invalid",
Expand Down
6 changes: 6 additions & 0 deletions src/composables/free/useMotionReduced.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const useMotionReduced = (): boolean => {
if (typeof window !== "undefined" && window.matchMedia) {
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
return false; // default to false if not supported
};
3 changes: 3 additions & 0 deletions src/scss/free/_scrollspy.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.nav-pills.menu-sidebar .nav-link {
border-left: 0 solid transparent;
}
1 change: 1 addition & 0 deletions src/scss/index.free.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@import "./free/navbar";
@import "./free/tooltips";
@import "./free/popovers";
@import "./free/scrollspy";
@import "./free/validation";
@import "./free/tabs";
@import "./free/input-group";
Expand Down
1 change: 1 addition & 0 deletions types/composables/free/useMotionReduced.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const useMotionReduced: () => boolean;

0 comments on commit a162f1d

Please sign in to comment.