Skip to content

Commit bd036c2

Browse files
committed
- BsTooltip: improve arrow positioning when activator width greater than tooltip width.
- AxiosPlugin: expose `$http.patch` method and Detect form object for data provided to the `$http.post`, `$http.patch`, `$http.put` methods - Update CHANGELOG.md - Bump to version 2.1.5
1 parent da51177 commit bd036c2

File tree

6 files changed

+43
-3
lines changed

6 files changed

+43
-3
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
> All notable changes to this project will be documented in this file.
44
55

6+
## v2.1.5
7+
8+
Released: December 30, 2024
9+
10+
### Features & Improvements
11+
12+
- **BsTooltip**: improve arrow positioning when activator width greater than tooltip width.
13+
- **AxiosPlugin**:
14+
- Expose `$http.patch` method.
15+
- Detect form object for data provided to the `$http.post`, `$http.patch`, `$http.put`
16+
methods and execute appropriate axios method.
17+
18+
619
## v2.1.4
720

821
Released: December 28, 2024

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-mdbootstrap",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"description": "Bootstrap5 Material Design Components for Vue.js",
55
"author": {
66
"name": "Ahmad Fajar",

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.1.4
2+
* Vue MDBootstrap v2.1.5
33
* Released under the BSD-3 License.
44
* Copyright Ahmad Fajar (https://ahmadfajar.github.io).
55
*/

src/components/Tooltip/mixins/tooltipApi.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ function getArrowLeftPosition(
109109
const arrow = 13 / 2;
110110

111111
if (placement === 'top' || placement === 'bottom') {
112-
return domRect.left - tooltipRect.left + domWidth - arrow;
112+
if (domRect.width < tooltipRect.width) {
113+
return domRect.left - tooltipRect.left + domWidth - arrow;
114+
}
113115
}
114116

115117
return 0;

src/utils/AxiosPlugin.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,25 @@ function _axiosPlugin(options?: RawAxiosRequestConfig) {
5757

5858
return service.get(url, config);
5959
},
60+
patch: (url: string, data: TRecord | FormData, options?: RawAxiosRequestConfig) => {
61+
if (data instanceof FormData) {
62+
return service.patchForm(url, data, options);
63+
}
64+
65+
return service.patch(url, data, options);
66+
},
6067
post: (url: string, data: TRecord | FormData, options?: RawAxiosRequestConfig) => {
68+
if (data instanceof FormData) {
69+
return service.postForm(url, data, options);
70+
}
71+
6172
return service.post(url, data, options);
6273
},
6374
put: (url: string, data: TRecord | FormData, options?: RawAxiosRequestConfig) => {
75+
if (data instanceof FormData) {
76+
return service.putForm(url, data, options);
77+
}
78+
6479
return service.put(url, data, options);
6580
},
6681
delete: (url: string, data?: TRecord, options?: RawAxiosRequestConfig) => {

src/utils/types/AxiosPlugin.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ export declare interface IHttpService {
1313
*/
1414
get(url: string, data?: TRecord, options?: RawAxiosRequestConfig): AxiosPromise;
1515

16+
/**
17+
* Send HTTP PATCH to the remote server.
18+
*
19+
* @param url API url
20+
* @param data The data to be sent
21+
* @param options Additional options
22+
* @returns Promise instance
23+
*/
24+
patch(url: string, data: TRecord | FormData, options?: RawAxiosRequestConfig): AxiosPromise;
25+
1626
/**
1727
* Send HTTP POST to the remote server.
1828
*

0 commit comments

Comments
 (0)