react-widgets
Advanced tools
Comparing version
import React from 'react'; | ||
import { RenderProp, WidgetHandle } from './types'; | ||
import { RenderProp, Value, WidgetHandle } from './types'; | ||
import { DataKeyAccessorFn, TextAccessorFn } from './util/dataHelpers'; | ||
export declare type RenderValueProp<TDataItem> = RenderProp<{ | ||
item: TDataItem; | ||
dataKey: Value; | ||
text: string; | ||
}>; | ||
@@ -7,0 +9,0 @@ export declare type DropdownInputHandle = WidgetHandle; |
@@ -50,3 +50,5 @@ "use strict"; | ||
let strValue = String(dataKeyAccessor(value)); | ||
let dataKey = dataKeyAccessor(value); | ||
let text = textAccessor(value); | ||
let strValue = String(dataKey); | ||
if (strValue === String({})) strValue = ''; | ||
@@ -56,4 +58,6 @@ const inputValue = !value && placeholder ? _react.default.createElement("span", { | ||
}, placeholder) : renderValue ? renderValue({ | ||
item: value | ||
}) : textAccessor(value); | ||
item: value, | ||
dataKey, | ||
text | ||
}) : text; | ||
(0, _react.useImperativeHandle)(ref, () => ({ | ||
@@ -60,0 +64,0 @@ focus() { |
@@ -197,3 +197,3 @@ "use strict"; | ||
onKeyDown: handleKeyDown, | ||
className: (0, _classnames.default)(className, bordered && 'rw-widget-container'), | ||
className: (0, _classnames.default)(className, bordered && 'rw-listbox rw-widget-container'), | ||
emptyListMessage: emptyList() | ||
@@ -200,0 +200,0 @@ }), flatData.map((item, idx) => { |
{ | ||
"name": "react-widgets", | ||
"version": "5.0.0-beta.3", | ||
"version": "5.0.0-beta.4", | ||
"description": "An à la carte set of polished, extensible, and accessible inputs built for React", | ||
@@ -101,3 +101,3 @@ "main": "lib/index.js", | ||
"readme": "ERROR: No README data found!", | ||
"_id": "react-widgets@5.0.0-beta.2" | ||
"_id": "react-widgets@5.0.0-beta.3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
406206
0.02%7328
0.08%