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.
@@ -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) || 10;
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;
@@ -151,6 +151,7 @@ function getTextWidth(input: HTMLInputElement, fauxContainer: HTMLSpanElement, r
151
151
 
152
152
 
153
153
  export {
154
+ getElCSS,
154
155
  getTextTop,
155
156
  actualPropertyValue,
156
157
  getTextWidth
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.12",
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",