react-frontend-common-components 0.0.57 → 0.0.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-frontend-common-components",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "description": "Reusable frontend library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1,13 +1,14 @@
1
- import React from "react";
1
+ import React, { useEffect, useRef } from "react";
2
2
  import "react-phone-input-2/lib/style.css";
3
- import "./app-phone-input.css";
4
3
  import PhoneInput, { CountryData } from "react-phone-input-2";
4
+ import "./app-phone-input.css";
5
5
 
6
6
  interface AppPhoneInputProps {
7
7
  value: string;
8
8
  countryCode?: string;
9
9
  handleChange: (phone: string, countryCode: string, uniCode: string) => void;
10
- className:string;
10
+ className: string;
11
+ id: string;
11
12
  }
12
13
 
13
14
  const AppPhoneInput = ({
@@ -15,10 +16,21 @@ const AppPhoneInput = ({
15
16
  handleChange,
16
17
  countryCode,
17
18
  className,
19
+ id,
18
20
  }: AppPhoneInputProps) => {
21
+ const wrapperRef = useRef<HTMLDivElement>(null);
22
+
23
+ useEffect(() => {
24
+ if (wrapperRef.current) {
25
+ const inputElement = wrapperRef.current.querySelector("input");
26
+ if (inputElement) {
27
+ inputElement.id = id;
28
+ }
29
+ }
30
+ }, [id]);
19
31
  return (
20
32
  <div className={className}>
21
- <div className={"inputContainer"}>
33
+ <div className={"inputContainer"} ref={wrapperRef}>
22
34
  <PhoneInput
23
35
  value={value}
24
36
  country={"ae"}
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { Select } from "antd";
2
+ import { Select, SelectProps } from "antd";
3
3
  import { MouseEventHandler } from "react";
4
4
  import "./app-select.css";
5
5
 
6
- interface AppSelectProps {
6
+ interface AppSelectProps extends SelectProps {
7
7
  className?: string;
8
8
  value?: string | null;
9
9
  dataTestId?: string;
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- import { Layout, Menu, SelectProps } from "antd";
2
+ import { Layout, Menu } from "antd";
3
3
  import "./app-sidebar.css";
4
4
 
5
5
  const { Sider } = Layout;
6
6
 
7
- interface SidebarProps extends SelectProps {
7
+ interface SidebarProps {
8
8
  links: {
9
9
  onClick?: () => void;
10
10
  label: string;