armstrong-react
Advanced tools
Comparing version
@@ -39,3 +39,2 @@ "use strict"; | ||
}; | ||
; | ||
/** convert from data value to element property value */ | ||
@@ -42,0 +41,0 @@ FormBinderBase.prototype.convert = function (data) { |
@@ -10,2 +10,3 @@ /// <reference types="react" /> | ||
import { IAutoCompleteInputProps, IAutoCompleteOption } from "./inputs/autoCompleteInput"; | ||
import { ITagInputProps } from "./inputs/tagInput"; | ||
/** An input FormBinder that sets native 'value' and 'onChange: (e) => void' properties */ | ||
@@ -52,2 +53,8 @@ export declare class InputFormBinder<TDataPropValue, TComponentPropValue> extends FormBinderBase<React.DOMAttributes<{}>, TDataPropValue, TComponentPropValue> { | ||
} | ||
export declare class TagInputFormBinder implements IFormBinder<ITagInputProps, any> { | ||
dataPath: string; | ||
constructor(dataPath: string); | ||
setElementProperty(props: IAutoCompleteInputProps, dataBinder: IDataBinder<any>): void; | ||
handleValueChanged(props: ITagInputProps, dataBinder: IDataBinder<any>, notifyChanged: () => void): void; | ||
} | ||
/** Form Binder helpers */ | ||
@@ -66,2 +73,4 @@ export declare class FormBinder { | ||
autoCompleteInput(dataName: string, getItemFromId?: (id: string) => IAutoCompleteOption): IFormBinderInjector<IAutoCompleteInputProps>; | ||
/** bind a 'value' string array property to a TagInput (e.g. ["cool", "guys", "only"]) */ | ||
tagInput(dataName: string): IFormBinderInjector<IAutoCompleteInputProps>; | ||
/** bind a 'date' string property to a CalendarInput (e.g. YYYY-MM-DD) */ | ||
@@ -68,0 +77,0 @@ calendarInput(dataName: string): IFormBinderInjector<ICalendarInputProps>; |
@@ -173,2 +173,19 @@ "use strict"; | ||
exports.AutoCompleteFormBinder = AutoCompleteFormBinder; | ||
var TagInputFormBinder = /** @class */ (function () { | ||
function TagInputFormBinder(dataPath) { | ||
this.dataPath = dataPath; | ||
} | ||
TagInputFormBinder.prototype.setElementProperty = function (props, dataBinder) { | ||
var value = dataBinder.getValue(this.dataPath); | ||
props.value = value; | ||
}; | ||
TagInputFormBinder.prototype.handleValueChanged = function (props, dataBinder, notifyChanged) { | ||
var _this = this; | ||
props.onChange = function (tags) { | ||
dataBinder.setValue(_this.dataPath, tags); | ||
}; | ||
}; | ||
return TagInputFormBinder; | ||
}()); | ||
exports.TagInputFormBinder = TagInputFormBinder; | ||
/** Form Binder helpers */ | ||
@@ -201,2 +218,6 @@ var FormBinder = /** @class */ (function () { | ||
}; | ||
/** bind a 'value' string array property to a TagInput (e.g. ["cool", "guys", "only"]) */ | ||
FormBinder.prototype.tagInput = function (dataName) { | ||
return this.custom(new TagInputFormBinder(dataName)); | ||
}; | ||
/** bind a 'date' string property to a CalendarInput (e.g. YYYY-MM-DD) */ | ||
@@ -203,0 +224,0 @@ FormBinder.prototype.calendarInput = function (dataName) { |
@@ -1,2 +0,2 @@ | ||
export { IInputValueConverter, IValueConverter } from './components/form/formValueConverters'; | ||
export { IInputValueConverter, IValueConverter } from "./components/form/formValueConverters"; | ||
/*********************************************************************************** | ||
@@ -15,2 +15,3 @@ ARMSTRONG TSX COMPONENT EXPORTS | ||
export { CalendarInput, ICalendarInputProps } from "./components/form/inputs/calendarInput"; | ||
export { TagInput, ITagInputProps } from "./components/form/inputs/tagInput"; | ||
export { ITextInputProps, TextInput } from "./components/form/inputs/textInput"; | ||
@@ -30,4 +31,4 @@ export { IAutoCompleteInputProps, AutoCompleteInput, IAutoCompleteOption } from "./components/form/inputs/autoCompleteInput"; | ||
import * as ArmstrongConfig from "./config/config"; | ||
export { ClassHelpers } from './utilities/classNames'; | ||
export { ClassHelpers } from "./utilities/classNames"; | ||
export { ValidationLabel, ValidationWrapper } from "./components/form/validationWrapper"; | ||
export { ArmstrongConfig }; |
@@ -27,2 +27,4 @@ "use strict"; | ||
exports.CalendarInput = calendarInput_1.CalendarInput; | ||
var tagInput_1 = require("./components/form/inputs/tagInput"); | ||
exports.TagInput = tagInput_1.TagInput; | ||
var textInput_1 = require("./components/form/inputs/textInput"); | ||
@@ -29,0 +31,0 @@ exports.TextInput = textInput_1.TextInput; |
{ | ||
"name": "armstrong-react", | ||
"version": "2.3.24", | ||
"version": "2.4.0", | ||
"description": "Rocketmakers Armstrong library of React components", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -1,2 +0,2 @@ | ||
export {IInputValueConverter, IValueConverter} from './components/form/formValueConverters'; | ||
export { IInputValueConverter, IValueConverter } from "./components/form/formValueConverters"; | ||
/*********************************************************************************** | ||
@@ -19,2 +19,3 @@ ARMSTRONG TSX COMPONENT EXPORTS | ||
export { CalendarInput, ICalendarInputProps } from "./components/form/inputs/calendarInput"; | ||
export { TagInput, ITagInputProps } from "./components/form/inputs/tagInput"; | ||
export { ITextInputProps, TextInput } from "./components/form/inputs/textInput"; | ||
@@ -45,5 +46,5 @@ export { IAutoCompleteInputProps, AutoCompleteInput, IAutoCompleteOption } from "./components/form/inputs/autoCompleteInput"; | ||
import * as ArmstrongConfig from "./config/config" | ||
export { ClassHelpers } from './utilities/classNames'; | ||
import * as ArmstrongConfig from "./config/config"; | ||
export { ClassHelpers } from "./utilities/classNames"; | ||
export { ValidationLabel, ValidationWrapper } from "./components/form/validationWrapper"; | ||
export { ArmstrongConfig }; |
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
Sorry, the diff of this file is not supported yet
720687
1.82%145
2.84%14451
1.85%