@use-ui/bootstrap3
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -5,3 +5,5 @@ export { ActionResult } from "./ActionResult"; | ||
export { Static } from "./Static"; | ||
export { Checkbox } from "./Checkbox"; | ||
export { FormGroup, setFormGroupClassNames, FormGroupProps } from "./FormGroup"; | ||
export { InlineEdit } from "./inlineEdit/InlineEdit"; | ||
export { highlight } from "./utils"; |
@@ -11,2 +11,4 @@ "use strict"; | ||
exports.Static = Static_1.Static; | ||
var Checkbox_1 = require("./Checkbox"); | ||
exports.Checkbox = Checkbox_1.Checkbox; | ||
var FormGroup_1 = require("./FormGroup"); | ||
@@ -17,1 +19,3 @@ exports.FormGroup = FormGroup_1.FormGroup; | ||
exports.InlineEdit = InlineEdit_1.InlineEdit; | ||
var utils_1 = require("./utils"); | ||
exports.highlight = utils_1.highlight; |
@@ -19,4 +19,5 @@ /// <reference types="react" /> | ||
indicatorSeparator?: boolean; | ||
multi?: boolean; | ||
} | ||
export declare function Select<D, P>({ label, field, topic, params, map, options, right, placeholder, clear, indicatorSeparator, ...other }: Props<D, P>): JSX.Element; | ||
export declare function Select<D, P>({ label, field, topic, params, map, options, right, placeholder, clear, indicatorSeparator, multi, ...other }: Props<D, P>): JSX.Element; | ||
export {}; |
@@ -68,3 +68,3 @@ "use strict"; | ||
function Select(_a) { | ||
var label = _a.label, field = _a.field, topic = _a.topic, params = _a.params, _b = _a.map, map = _b === void 0 ? function (i) { return i; } : _b, options = _a.options, right = _a.right, placeholder = _a.placeholder, clear = _a.clear, indicatorSeparator = _a.indicatorSeparator, other = __rest(_a, ["label", "field", "topic", "params", "map", "options", "right", "placeholder", "clear", "indicatorSeparator"]); | ||
var label = _a.label, field = _a.field, topic = _a.topic, params = _a.params, _b = _a.map, map = _b === void 0 ? function (i) { return i; } : _b, options = _a.options, right = _a.right, placeholder = _a.placeholder, clear = _a.clear, indicatorSeparator = _a.indicatorSeparator, multi = _a.multi, other = __rest(_a, ["label", "field", "topic", "params", "map", "options", "right", "placeholder", "clear", "indicatorSeparator", "multi"]); | ||
if (!options && !topic) { | ||
@@ -109,3 +109,4 @@ throw new Error("Either options or topic is required for Select"); | ||
var value = field.getValue(); | ||
var selected = cachedOptions.filter(function (o) { return o.value == value; }); | ||
var selectedValues = value ? (multi ? value.split(",") : [value]) : []; | ||
var selected = cachedOptions.filter(function (o) { return selectedValues.indexOf(o.value) >= 0; }); | ||
setSelected(selected); | ||
@@ -118,5 +119,11 @@ }, [cachedOptions, field.getValue()]); | ||
} | ||
field.setValue(val ? val.value : ""); | ||
if (!val) { | ||
field.setValue(""); | ||
} | ||
else { | ||
field.setValue(val.map(function (v) { return v.value; }).join(",")); | ||
} | ||
} | ||
field.setFieldElement({ | ||
type: multi ? "stringList" : "string", | ||
constraint: other, | ||
@@ -133,3 +140,3 @@ focus: function () { return ref.current && ref.current.focus(); }, | ||
Option: function (props) { return React.createElement(HighlightingOption, __assign({}, props, { inputValue: inputValue })); }, | ||
}, isLoading: loading, value: selected, loadOptions: loadOptions, onInputChange: function (val) { return setInputValue(val); }, onBlur: field.onBlur, onFocus: field.onFocus, onChange: onChange, placeholder: placeholder, isClearable: clear != null || !other.required }), | ||
}, isLoading: loading, value: selected, loadOptions: loadOptions, onInputChange: function (val) { return setInputValue(val); }, onBlur: field.onBlur, onFocus: field.onFocus, onChange: onChange, placeholder: placeholder, isClearable: clear != null || !other.required, isMulti: multi }), | ||
right)); | ||
@@ -136,0 +143,0 @@ } |
{ | ||
"name": "@use-ui/bootstrap3", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"main": "dist/index.js", | ||
@@ -13,3 +13,3 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@use-ui/hooks": "^1.0.5", | ||
"@use-ui/hooks": "^1.0.9", | ||
"classnames": "^2.2.6", | ||
@@ -16,0 +16,0 @@ "push-rpc": "^1.0.4", |
@@ -5,3 +5,5 @@ export {ActionResult} from "./ActionResult" | ||
export {Static} from "./Static" | ||
export {Checkbox} from "./Checkbox" | ||
export {FormGroup, setFormGroupClassNames, FormGroupProps} from "./FormGroup" | ||
export {InlineEdit} from "./inlineEdit/InlineEdit" | ||
export {highlight} from "./utils" |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67272
40
1165
Updated@use-ui/hooks@^1.0.9