funda-ui 4.5.12 → 4.5.22
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/Date/index.js +33 -29
- package/Input/index.js +6 -2
- package/RangeSlider/index.js +33 -29
- package/Select/index.js +6 -2
- package/Tabs/index.js +14 -10
- package/Textarea/index.js +6 -2
- package/Tooltip/index.js +253 -1
- package/Utils/inputsCalculation.d.ts +2 -1
- package/Utils/inputsCalculation.js +1 -0
- package/lib/cjs/Date/index.js +33 -29
- package/lib/cjs/Input/index.js +6 -2
- package/lib/cjs/RangeSlider/index.js +33 -29
- package/lib/cjs/Select/index.js +6 -2
- package/lib/cjs/Tabs/index.js +14 -10
- package/lib/cjs/Textarea/index.js +6 -2
- package/lib/cjs/Tooltip/index.js +253 -1
- package/lib/cjs/Utils/inputsCalculation.d.ts +2 -1
- package/lib/cjs/Utils/inputsCalculation.js +1 -0
- package/lib/esm/Tabs/Tabs.tsx +15 -12
- package/lib/esm/Tooltip/index.scss +0 -1
- package/lib/esm/Tooltip/index.tsx +23 -1
- package/lib/esm/Utils/libs/inputsCalculation.ts +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,9 @@ import {
|
|
|
8
8
|
getAbsolutePositionOfStage
|
|
9
9
|
} from 'funda-utils/dist/cjs/getElementProperty';
|
|
10
10
|
import { clsWrite, combinedCls } from 'funda-utils/dist/cjs/cls';
|
|
11
|
+
import { getElCSS } from 'funda-utils/dist/cjs/inputsCalculation';
|
|
12
|
+
|
|
13
|
+
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
export type TooltipProps = {
|
|
@@ -74,7 +77,7 @@ const Tooltip = (props: TooltipProps) => {
|
|
|
74
77
|
} = props;
|
|
75
78
|
|
|
76
79
|
|
|
77
|
-
const POS_OFFSET = Number(offset) ||
|
|
80
|
+
const POS_OFFSET = Number(offset) || 4;
|
|
78
81
|
const EXCEEDED_SIDE_POS_OFFSET = Number(exceededSidePosOffset) || 15;
|
|
79
82
|
const uniqueID = useComId();
|
|
80
83
|
const idRes = id || uniqueID;
|
|
@@ -152,7 +155,26 @@ const Tooltip = (props: TooltipProps) => {
|
|
|
152
155
|
const _modalBox = _modalContent.getBoundingClientRect();
|
|
153
156
|
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {
|
|
154
157
|
|
|
158
|
+
// Adjust the coordinates due to height
|
|
159
|
+
//------------------
|
|
160
|
+
const triggerEl: any = document.querySelector(`[data-overlay-id="${_modalRef.id}"]`);
|
|
161
|
+
if (triggerEl !== null) {
|
|
162
|
+
let pos = triggerEl.dataset.microtipPosition;
|
|
163
|
+
if (typeof pos === 'undefined') pos = 'top';
|
|
164
|
+
|
|
165
|
+
const _offsetY = _modalBox.height - getElCSS(_modalContent, 'font-size', true) - getElCSS(_modalContent, 'padding-top', true) - getElCSS(_modalContent, 'padding-bottom', true);
|
|
166
|
+
|
|
167
|
+
// TOP
|
|
168
|
+
//
|
|
169
|
+
if (pos.indexOf('top') >= 0) {
|
|
170
|
+
_modalRef.style.transform = `translateY(-${_offsetY}px)`;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
155
176
|
// 10 pixels is used to account for some bias in mobile devices
|
|
177
|
+
//------------------
|
|
156
178
|
if ((_modalBox.right + 10) > window.innerWidth) {
|
|
157
179
|
const _modalOffsetPosition = _modalBox.right - window.innerWidth + EXCEEDED_SIDE_POS_OFFSET;
|
|
158
180
|
_modalContent.dataset.offset = _modalOffsetPosition;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "UIUX Lab",
|
|
3
3
|
"email": "uiuxlab@gmail.com",
|
|
4
4
|
"name": "funda-ui",
|
|
5
|
-
"version": "4.5.
|
|
5
|
+
"version": "4.5.22",
|
|
6
6
|
"description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|