linear-react-components-ui 1.1.20-beta.43 → 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.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { IPopUpProps } from './types.js';
2
+ import { IPopupProps } from './types.js';
3
3
 
4
- declare const DropdownPopup: ({ id, customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, targetRef, ...props }: IPopUpProps) => React.ReactPortal;
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 };
@@ -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)()}`;
@@ -22,7 +22,7 @@ interface GetDisplayNameParams {
22
22
  interface WithDropdownContextProps {
23
23
  handleDropdownClose: () => void;
24
24
  }
25
- interface IPopUpProps {
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, IPopUpProps, WithDropdownContextProps, WithDropdownProps, WrappedComponentProps };
48
+ export { GetDisplayNameParams, GetDropdownStyleParams, IPopupProps, WithDropdownContextProps, WithDropdownProps, WrappedComponentProps };
@@ -28,6 +28,7 @@ const InputTextBase = props => {
28
28
  const {
29
29
  textAlign = 'left',
30
30
  value,
31
+ defaultValue,
31
32
  type = 'text',
32
33
  readOnly = false,
33
34
  placeHolder,
@@ -98,6 +99,7 @@ const InputTextBase = props => {
98
99
  const disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
99
100
  propsInput = {
100
101
  value: hideContent ? '' : value,
102
+ defaultValue,
101
103
  accept,
102
104
  type,
103
105
  readOnly: shouldBeReadOnly(),
@@ -96,6 +96,7 @@ interface IBaseProps {
96
96
  themePopover?: 'light' | 'dark';
97
97
  popoverAlign?: 'right' | 'left';
98
98
  tabIndex?: number;
99
+ defaultValue?: string | string[];
99
100
  }
100
101
 
101
102
  export { CustomInputEvent, IBaseProps, InputLabelProps };
@@ -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?: "right" | "left" | undefined;
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?: "right" | "left" | undefined;
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.20-beta.43",
3
+ "version": "1.1.20-beta.45",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",