l-min-components 1.0.159 → 1.0.164

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": "l-min-components",
3
- "version": "1.0.159",
3
+ "version": "1.0.164",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -12,6 +12,8 @@
12
12
  "preview": "vite preview"
13
13
  },
14
14
  "dependencies": {
15
+ "axios": "^1.4.0",
16
+ "axios-hooks": "^4.0.0",
15
17
  "chart.js": "^4.2.1",
16
18
  "classnames": "^2.3.2",
17
19
  "moment": "^2.29.4",
@@ -19,8 +19,8 @@ import styled from "styled-components";
19
19
  *
20
20
  */
21
21
  const ButtonComponent = (props) => {
22
- const handleClick = useCallback(() => {
23
- props.onClick && props.onClick();
22
+ const handleClick = useCallback((e) => {
23
+ props.onClick && props.onClick(e);
24
24
  }, []);
25
25
  // console.log(props);
26
26
  switch (props.type) {
@@ -48,25 +48,34 @@ const DropDownComponent = (props) => {
48
48
  <ControlInput
49
49
  placeholder={props?.inputPlaceHolder || "Select Dropdown"}
50
50
  type="text"
51
+ value={selected?.name}
51
52
  onChange={(e) => {
52
53
  setSearchParam(e.target.value);
53
54
  }}
55
+ onClick={() => setDropdown(true)}
54
56
  />
55
57
  ) : (
56
- <p onClick={() => setDropdown(!dropdown)}>{selected?.name}</p>
58
+ <p onClick={() => setDropdown(!dropdown)}>
59
+ {selected?.name || "Select Dropdown"}
60
+ </p>
57
61
  )}
58
62
  <DownIcon onClick={() => setDropdown(!dropdown)} />
59
63
  {searchParam && dropdown && (
60
64
  <DropDownContent>
61
65
  {props?.dropdownData?.map((dropdownItem, idx) => {
62
- if (props?.dropdownData[idx]?.name?.includes(searchParam))
66
+ if (
67
+ props?.dropdownData[idx]?.name
68
+ ?.toLowerCase()
69
+ .includes(searchParam?.toLowerCase())
70
+ )
63
71
  return (
64
72
  <DropDownItem
65
73
  key={idx}
66
74
  onClick={() => {
67
75
  setSelected(dropdownItem);
68
76
  setDropdown();
69
- }}>
77
+ }}
78
+ >
70
79
  <span>{dropdownItem?.name}</span>
71
80
  {selected === dropdownItem && <Tick />}
72
81
  </DropDownItem>
@@ -83,7 +92,8 @@ const DropDownComponent = (props) => {
83
92
  onClick={() => {
84
93
  setSelected(dropdownItem);
85
94
  setDropdown();
86
- }}>
95
+ }}
96
+ >
87
97
  <span>{dropdownItem?.name}</span>
88
98
  {selected === dropdownItem && <Tick />}
89
99
  </DropDownItem>
@@ -105,7 +115,8 @@ export const DownIcon = ({ width, height, fill, onClick }) => {
105
115
  viewBox="0 0 14 8"
106
116
  fill="none"
107
117
  xmlns="http://www.w3.org/2000/svg"
108
- onClick={onClick}>
118
+ onClick={onClick}
119
+ >
109
120
  <path
110
121
  d="M1 1L7 7L13 1"
111
122
  stroke={fill || "#18191B"}
@@ -123,7 +134,8 @@ export const Tick = ({ size, stroke }) => {
123
134
  height={size || "16"}
124
135
  viewBox="0 0 16 16"
125
136
  fill="none"
126
- xmlns="http://www.w3.org/2000/svg">
137
+ xmlns="http://www.w3.org/2000/svg"
138
+ >
127
139
  <path
128
140
  d="M12.3828 4.23828L5.82031 11.7383L3.00781 8.92578"
129
141
  stroke={stroke || "white"}
@@ -42,21 +42,24 @@ export const ControlInput = styled.input`
42
42
  outline: none;
43
43
  border: none;
44
44
  cursor: caret;
45
+ background: none;
45
46
  `;
46
47
 
47
48
  export const DropDownContent = styled.ul`
48
49
  position: absolute;
49
- top: 25px;
50
+ top: 35px;
50
51
  left: 0;
51
52
  list-style-type: none;
52
53
  padding-left: 20px;
53
54
  width: 100%;
54
- padding: 4px;
55
+ max-height: 200px;
56
+ overflow-y: scroll;
57
+ // padding: 4px 10px;
55
58
  `;
56
59
 
57
60
  export const DropDownItem = styled.li`
58
61
  font-family: "Nunito", sans-serif;
59
- padding: 4px;
62
+ padding: 4px 10px;
60
63
  font-size: 14px;
61
64
  display: flex;
62
65
  align-items: center;