linear-react-components-ui 1.1.20-beta.44 → 1.1.20-beta.45
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/lib/dropdown/Popup.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IPopupProps } from './types.js';
|
|
3
3
|
|
|
4
|
-
declare const DropdownPopup: ({ id, customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, targetRef, ...props }:
|
|
4
|
+
declare const DropdownPopup: ({ id, customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, targetRef, ...props }: IPopupProps) => React.ReactPortal;
|
|
5
5
|
|
|
6
6
|
export { DropdownPopup as default };
|
package/lib/dropdown/Popup.js
CHANGED
|
@@ -19,6 +19,7 @@ const getDropdownStyles = _ref => {
|
|
|
19
19
|
container,
|
|
20
20
|
target
|
|
21
21
|
} = _ref;
|
|
22
|
+
console.log('passou dali', container, target);
|
|
22
23
|
if (!container || !target) return '';
|
|
23
24
|
const targetDimensions = target.getBoundingClientRect();
|
|
24
25
|
const rightPosition = !isFloatMenu ? window.innerWidth - targetDimensions.x - targetDimensions.width - 4 : undefined;
|
|
@@ -68,6 +69,7 @@ const DropdownPopup = _ref2 => {
|
|
|
68
69
|
const lastModalContainer = modalContainers[modalContainers.length - 1];
|
|
69
70
|
popup.current.style.zIndex = `${modalContainers.length ? Number(lastModalContainer.style.zIndex) + 1 : 99999}`;
|
|
70
71
|
}
|
|
72
|
+
console.log('target >>>', targetRef);
|
|
71
73
|
(0, _react.useEffect)(() => {
|
|
72
74
|
body.appendChild(popup.current);
|
|
73
75
|
popup.current.id = id || `dropdown-component-${(0, _uuid.v1)()}`;
|
package/lib/dropdown/types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ interface GetDisplayNameParams {
|
|
|
22
22
|
interface WithDropdownContextProps {
|
|
23
23
|
handleDropdownClose: () => void;
|
|
24
24
|
}
|
|
25
|
-
interface
|
|
25
|
+
interface IPopupProps {
|
|
26
26
|
id?: string;
|
|
27
27
|
children?: ReactNode;
|
|
28
28
|
customClassForDropdown?: string;
|
|
@@ -32,7 +32,7 @@ interface IPopUpProps {
|
|
|
32
32
|
leftPosition?: number;
|
|
33
33
|
rightPosition?: number;
|
|
34
34
|
minWidth?: number;
|
|
35
|
-
targetRef?: HTMLElement;
|
|
35
|
+
targetRef?: HTMLElement | HTMLInputElement | null;
|
|
36
36
|
}
|
|
37
37
|
interface GetDropdownStyleParams {
|
|
38
38
|
align: 'left' | 'right';
|
|
@@ -42,7 +42,7 @@ interface GetDropdownStyleParams {
|
|
|
42
42
|
leftPosition: number;
|
|
43
43
|
rightPosition: number;
|
|
44
44
|
container?: HTMLDivElement;
|
|
45
|
-
target?: HTMLElement;
|
|
45
|
+
target?: HTMLElement | HTMLInputElement | null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export { GetDisplayNameParams, GetDropdownStyleParams,
|
|
48
|
+
export { GetDisplayNameParams, GetDropdownStyleParams, IPopupProps, WithDropdownContextProps, WithDropdownProps, WrappedComponentProps };
|
|
@@ -37,13 +37,13 @@ declare const getMaskOptions: ({ isDateField, placeholderChar, min, max, lazy, p
|
|
|
37
37
|
required?: boolean | undefined;
|
|
38
38
|
returnFormattedValueOnBlur?: boolean | undefined;
|
|
39
39
|
returnFormattedValueOnKeyDown?: boolean | undefined;
|
|
40
|
-
autoCompleteMask?: "
|
|
40
|
+
autoCompleteMask?: "left" | "right" | undefined;
|
|
41
41
|
definitions?: any;
|
|
42
42
|
mask?: any;
|
|
43
43
|
hint?: string | string[] | undefined;
|
|
44
44
|
hintPosition?: "below" | "onLabelRight" | undefined;
|
|
45
45
|
themePopover?: "dark" | "light" | undefined;
|
|
46
|
-
popoverAlign?: "
|
|
46
|
+
popoverAlign?: "left" | "right" | undefined;
|
|
47
47
|
placeholderChar: string;
|
|
48
48
|
min: any;
|
|
49
49
|
max: any;
|
|
@@ -37,7 +37,8 @@ const Dropdown = props => {
|
|
|
37
37
|
searchOnDropdown,
|
|
38
38
|
handleOnKeydown,
|
|
39
39
|
searchNotFoundText,
|
|
40
|
-
idKey
|
|
40
|
+
idKey,
|
|
41
|
+
selectFieldRef
|
|
41
42
|
} = props;
|
|
42
43
|
const [dropdownDynamicStyles, setDropdownDynamicStyles] = (0, _react.useState)(helper.returnDropdownDynamicStyles(_objectSpread({}, props)));
|
|
43
44
|
(0, _react.useEffect)(() => {
|
|
@@ -48,7 +49,8 @@ const Dropdown = props => {
|
|
|
48
49
|
return /*#__PURE__*/_react.default.createElement(_Popup.default, {
|
|
49
50
|
align: "left",
|
|
50
51
|
leftPosition: dropdownDynamicStyles.left,
|
|
51
|
-
topPosition: dropdownDynamicStyles.top
|
|
52
|
+
topPosition: dropdownDynamicStyles.top,
|
|
53
|
+
targetRef: selectFieldRef?.current
|
|
52
54
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
53
55
|
className: "select-dropdown",
|
|
54
56
|
ref: dropdownRef,
|