kahuna-base-react-components 1.2.7 → 1.2.9

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/types.d.ts CHANGED
@@ -176,6 +176,7 @@ interface KDropdownProps {
176
176
  allowContainerShrink?: boolean;
177
177
  border?: string;
178
178
  activeBorder?: string;
179
+ onInputChange?: (text: string) => void;
179
180
  }
180
181
  declare const KDropdown: React.FC<KDropdownProps>;
181
182
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kahuna-base-react-components",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "Kahuna Base React Components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -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>
@@ -79,6 +79,7 @@ KDropdownSingle.args = {
79
79
  placeholder: "Select single...",
80
80
  isClearable: true,
81
81
  isEllipsis: true,
82
+ selected: {label: "1", value: 1},
82
83
  allowContainerShrink: true,
83
84
  hideChosenOptionIcon: true,
84
85
  onBlur: (value: any) => {
@@ -52,6 +52,7 @@ export interface KDropdownProps {
52
52
  allowContainerShrink?: boolean // allows container to shrink if label is smaller than width, width should be fixed value
53
53
  border?: string
54
54
  activeBorder?: string
55
+ onInputChange?: (text: string) => void
55
56
  }
56
57
 
57
58
  const KDropdown: React.FC<KDropdownProps> = (props) => {
@@ -72,7 +73,7 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
72
73
 
73
74
  setBackground(background)
74
75
  setBorder(border)
75
-
76
+ setSelectedOption(props.selected)
76
77
  }, [props.selected])
77
78
 
78
79
  const width = props.width || "100%"
@@ -234,11 +235,15 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
234
235
  placeholder={props.placeholder || ""}
235
236
  options={props.options}
236
237
  className={"k-dropdown"}
238
+ onInputChange={(text) => {
239
+ if (props.onInputChange) props.onInputChange(text)
240
+ }}
237
241
  onBlur={() => {
238
242
  if (props.onBlur) props.onBlur(selectedOption)
239
243
  }}
240
244
  filterOption={customFilterOption}
241
245
  isClearable={isClearable}
246
+ value={selectedOption}
242
247
  hideSelectedOptions={!isMulti ? false : showOnlyIconsInMulti ? false : true}
243
248
  styles={{
244
249
  control: (baseStyles, state) => ({
package/src/main.css CHANGED
@@ -253,4 +253,4 @@
253
253
  .k-code-input-character-container:disabled {
254
254
  background: #F7F7F7 !important;
255
255
  border: none !important;
256
- }
256
+ }