kahuna-base-react-components 1.2.6 → 1.2.8
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/dist/components/KDropdown/KDropdown.d.ts +2 -0
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/assets/search.svg +3 -0
- package/src/components/KDropdown/KDropdown.tsx +10 -1
- package/src/main.css +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -160,6 +160,7 @@ interface KDropdownProps {
|
|
|
160
160
|
label?: string;
|
|
161
161
|
textColor?: string;
|
|
162
162
|
shadowDisabled?: boolean;
|
|
163
|
+
closeMenuOnSelect?: boolean;
|
|
163
164
|
menuBackground?: string;
|
|
164
165
|
padding?: string;
|
|
165
166
|
gap?: string;
|
|
@@ -175,6 +176,7 @@ interface KDropdownProps {
|
|
|
175
176
|
allowContainerShrink?: boolean;
|
|
176
177
|
border?: string;
|
|
177
178
|
activeBorder?: string;
|
|
179
|
+
onInputChange?: (text: string) => void;
|
|
178
180
|
}
|
|
179
181
|
declare const KDropdown: React.FC<KDropdownProps>;
|
|
180
182
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.65751 14 10.7315 13.6424 11.6176 13.0317L15.2929 16.7071C15.6834 17.0976 16.3166 17.0976 16.7071 16.7071C17.0976 16.3165 17.0976 15.6834 16.7071 15.2928L13.0318 11.6175C13.6424 10.7315 14 9.65749 14 8.5C14 5.46243 11.5376 3 8.5 3ZM5 8.5C5 6.567 6.567 5 8.5 5C10.433 5 12 6.567 12 8.5C12 10.433 10.433 12 8.5 12C6.567 12 5 10.433 5 8.5Z" fill="black"/>
|
|
3
|
+
</svg>
|
|
@@ -36,6 +36,7 @@ export interface KDropdownProps {
|
|
|
36
36
|
label?: string
|
|
37
37
|
textColor?: string
|
|
38
38
|
shadowDisabled?: boolean
|
|
39
|
+
closeMenuOnSelect?: boolean
|
|
39
40
|
menuBackground?: string
|
|
40
41
|
padding?: string
|
|
41
42
|
gap?: string
|
|
@@ -51,6 +52,7 @@ export interface KDropdownProps {
|
|
|
51
52
|
allowContainerShrink?: boolean // allows container to shrink if label is smaller than width, width should be fixed value
|
|
52
53
|
border?: string
|
|
53
54
|
activeBorder?: string
|
|
55
|
+
onInputChange?: (text: string) => void
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
@@ -71,7 +73,6 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
71
73
|
|
|
72
74
|
setBackground(background)
|
|
73
75
|
setBorder(border)
|
|
74
|
-
|
|
75
76
|
}, [props.selected])
|
|
76
77
|
|
|
77
78
|
const width = props.width || "100%"
|
|
@@ -93,6 +94,10 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
93
94
|
const placeholderColor = props.placeholderColor || "#848484"
|
|
94
95
|
const enableIndicator = props.enableIndicator || false
|
|
95
96
|
const allowContainerShrink = props.allowContainerShrink || false
|
|
97
|
+
let closeMenuOnSelect = true
|
|
98
|
+
if (props.closeMenuOnSelect === false) {
|
|
99
|
+
closeMenuOnSelect = false
|
|
100
|
+
}
|
|
96
101
|
|
|
97
102
|
let defaultValue = props.defaultValue
|
|
98
103
|
if (!defaultValue && props.defaultValuePrimitive) {
|
|
@@ -225,9 +230,13 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
225
230
|
defaultValue={defaultValue}
|
|
226
231
|
isMulti={isMulti}
|
|
227
232
|
name={props.label || ""}
|
|
233
|
+
closeMenuOnSelect={closeMenuOnSelect}
|
|
228
234
|
placeholder={props.placeholder || ""}
|
|
229
235
|
options={props.options}
|
|
230
236
|
className={"k-dropdown"}
|
|
237
|
+
onInputChange={(text) => {
|
|
238
|
+
if (props.onInputChange) props.onInputChange(text)
|
|
239
|
+
}}
|
|
231
240
|
onBlur={() => {
|
|
232
241
|
if (props.onBlur) props.onBlur(selectedOption)
|
|
233
242
|
}}
|
package/src/main.css
CHANGED