Skip to content

Commit 4ce95e8

Browse files
committed
- BsLightbox: add z-index property to control component stacking within HTML layers.
- BsTooltip: improve UI performance. - Update CHANGELOG.md - Bump to version 2.0.14
1 parent 48de3b6 commit 4ce95e8

File tree

8 files changed

+53
-34
lines changed

8 files changed

+53
-34
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
> All notable changes to this project will be documented in this file.
44
55

6+
## v2.0.14
7+
8+
Released: November 14, 2024
9+
10+
### Features & Improvements
11+
12+
- **BsLightbox**: add `z-index` property to control component stacking within HTML layers.
13+
- **BsPopover**: improve UI display positioning.
14+
- **BsTooltip**: improve UI performance.
15+
16+
### Bug Fixes
17+
18+
- **BsArrayStore**: fixed bug loading state was not updated when method _load_
19+
was called without argument.
20+
21+
622
## v2.0.13
723

824
Released: September 27, 2024
@@ -26,7 +42,7 @@ Released: September 20, 2024
2642

2743
### Features & Improvements
2844

29-
- **BsLightbox**: improve image loading using preloader
45+
- **BsLightbox**: improve image loading using preloader.
3046
- **BsSideDrawer**: improve collapse animation if used together with `<BsAppbar>`.
3147

3248

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-mdbootstrap",
3-
"version": "2.0.13",
3+
"version": "2.0.14",
44
"description": "Bootstrap5 Material Design Components for Vue.js",
55
"author": {
66
"name": "Ahmad Fajar",
@@ -68,27 +68,27 @@
6868
"lodash": "^4.17.21",
6969
"luxon": "^3.5.0",
7070
"resize-observer-polyfill": "^1.5.1",
71-
"vue": "^3.5.8"
71+
"vue": "^3.5.12"
7272
},
7373
"devDependencies": {
7474
"@rollup/plugin-node-resolve": "^15.3.0",
7575
"@rollup/plugin-terser": "^0.4.4",
7676
"@tsconfig/node20": "^20.1.4",
7777
"@types/body-scroll-lock": "^3.1.2",
78-
"@types/lodash": "^4.17.9",
78+
"@types/lodash": "^4.17.13",
7979
"@types/luxon": "^3.4.2",
80-
"@types/node": "^22.7.0",
81-
"@vue/tsconfig": "^0.5.1",
80+
"@types/node": "^22.9.0",
81+
"@vue/tsconfig": "^0.6.0",
8282
"bootstrap": "5.2.3",
8383
"clean-css-cli": "^5.6.3",
8484
"compass-mixins": "^0.12.12",
8585
"npm-run-all": "^4.1.5",
8686
"rimraf": "^6.0.1",
8787
"rollup-plugin-dts": "^6.1.1",
88-
"sass": "^1.79.3",
89-
"terser": "^5.33.0",
90-
"typescript": "^5.6.2",
91-
"vite": "^5.4.8",
88+
"sass": "^1.80.7",
89+
"terser": "^5.36.0",
90+
"typescript": "^5.6.3",
91+
"vite": "^5.4.11",
9292
"vue-router": "^4.4.5"
9393
},
9494
"browserslist": [

scss/_banner.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue MDBootstrap v2.0.13
2+
* Vue MDBootstrap v2.0.14
33
* Released under the BSD-3 License.
44
* Copyright Ahmad Fajar (https://ahmadfajar.github.io).
55
*/

src/components/Modal/lightbox.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
--#{$prefix}lightbox-thumbnail-opacity: 0.5;
2020
--#{$prefix}lightbox-thumbnail-active-border-color: #{$red-base};
2121
--#{$prefix}lightbox-thumbnail-active-border-width: 2px;
22+
// --#{$prefix}lightbox-zindex: 1990;
2223

2324
left: 0;
2425
right: 0;
2526
top: 0;
2627
bottom: 0;
2728
position: fixed;
28-
z-index: 1032;
29+
// z-index: var(--#{$prefix}lightbox-zindex);
2930

3031
&.#{$prefix}lightbox-overlay {
3132
background-color: var(--#{$prefix}lightbox-overlay-bg);

src/components/Modal/mixins/lightboxApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export function useRenderLightbox(
8282
`${cssPrefix}lightbox-wrap`,
8383
props.overlay ? `${cssPrefix}lightbox-overlay` : '',
8484
],
85+
style: { 'z-index': props.zIndex },
8586
},
8687
[
8788
createLightboxToolbar(

src/components/Modal/mixins/lightboxProps.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,9 @@ export const lightboxProps = {
6262
default: undefined,
6363
validator: (v: string) => ['out-in', 'in-out'].includes(v),
6464
} as Prop<TTransitionMode>,
65+
zIndex: {
66+
type: [String, Number],
67+
default: 1990,
68+
validator: (v: string): boolean => !isNaN(parseInt(v, 10)),
69+
},
6570
};

src/components/Modal/types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export declare type TLightboxOptionProps = TPopupOptions & {
132132
* Available modes are: `out-in` and `in-out`.
133133
*/
134134
transitionMode?: TTransitionMode;
135+
/**
136+
* Insert inline css style `z-index` to control the component positioning on the html layers.
137+
*/
138+
zIndex?: string | number;
135139
};
136140

137141
export declare type TBsModal = ComponentObjectPropsOptions<TModalOptionProps>;

src/components/Tooltip/mixins/tooltipApi.ts

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function useSetTooltipPosition(
102102
return;
103103
}
104104

105-
const tooltipEl = <HTMLElement>tooltipRef.value;
105+
const tooltipEl = tooltipRef.value as HTMLElement;
106106

107107
if (tooltipEl && Helper.isFunction(tooltipEl.getBoundingClientRect)) {
108108
const elRect = tooltipEl.getBoundingClientRect();
@@ -125,38 +125,28 @@ export function useAddTooltipListener(
125125
return;
126126
}
127127

128-
let timer: number | undefined;
129-
const showTooltip = (e: Event) => {
130-
if (timer) {
131-
clearTimeout(timer);
132-
}
133-
134-
timer = Helper.defer(() => {
128+
const showTooltip = (_e: Event) => {
129+
window.requestAnimationFrame(() => {
135130
instance.emit('update:show', true);
136131
active.value = true;
137-
}, 200);
138-
// e.preventDefault();
139-
e.stopPropagation();
132+
})
133+
134+
// preventEventTarget(e);
140135
};
141136
const hideTooltip = () => {
142-
if (timer) {
143-
clearTimeout(timer);
144-
}
145-
146137
instance.emit('update:show', false);
147138
active.value = false;
148139
};
149140

150141
const activatorEl = findActivatorElement(instance) as IHTMLElement | null;
151142

152143
if (activatorEl) {
144+
const options = {capture: true, passive: false};
153145
(activatorEl as IBindingElement).__mouseEvents = {
154-
mouseEnter: EventListener.listen(activatorEl, 'mouseenter', showTooltip, {
155-
passive: true,
156-
}),
157-
mouseLeave: EventListener.listen(activatorEl, 'mouseleave', hideTooltip, {
158-
passive: true,
159-
}),
146+
mouseEnter: EventListener.listen(activatorEl, 'mouseenter', showTooltip, options),
147+
mouseLeave: EventListener.listen(activatorEl, 'mouseleave', hideTooltip, options),
148+
focus: EventListener.listen(activatorEl, 'focus', showTooltip),
149+
blur: EventListener.listen(activatorEl, 'blur', hideTooltip),
160150
};
161151
}
162152
}
@@ -167,9 +157,11 @@ export function useRemoveTooltipListener(instance?: ComponentInternalInstance |
167157

168158
if (activatorEl) {
169159
// @ts-ignore
170-
const { mouseEnter, mouseLeave } = activatorEl.__mouseEvents;
160+
const { mouseEnter, mouseLeave, focus, blur } = activatorEl.__mouseEvents;
171161
(mouseEnter as IEventResult).remove();
172162
(mouseLeave as IEventResult).remove();
163+
(focus as IEventResult).remove();
164+
(blur as IEventResult).remove();
173165
activatorEl.__mouseEvents = undefined;
174166
}
175167
}

0 commit comments

Comments
 (0)