1.0.0 • Published 4 years ago

@softledger/form-components v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Checkbox

From src/Checkbox.jsx

Checkbox component using react-switch

proptypedefaultrequireddescription
disabledBooleanfalse:x:true to disable toggling
onChangeFunction:white_check_mark:callback when toggled
valueBoolean:x:value of the component

ErrorFormFeedback

From src/ErrorFormFeedback.jsx

Display errors underneath an input component

proptypedefaultrequireddescription
errorsUnion<Array \| String>:x:List of errors to display, can be an array or string

FileUploadList

From src/FileUploadList.jsx

Displays a dropzone for files Dropped files are displayed as a table with option to remove them individually

proptypedefaultrequireddescription
dropTextUnion<String \| Object>'Drag Here to upload':x:Text or JSX to display in the dropzone
filesArray:x:list of files to display, can leave blank to not have table shown
onDropFunction:white_check_mark:callback for when a file is dropped
onRemoveFunction:x:Callback for when a file is removed required if files prop is not blank

Input

From src/Input.jsx

Thing wrapper on input tag Displays errors below input

proptypedefaultrequireddescription
classNameString:x:additional classnames to add to input tag
disabledBooleanfalse:x:true to disable input
errorTextUnion<String \| Array>:x:Errors to display, should be a string or array of strings @type {type}
onChangeFunction:white_check_mark:Callback when updated
styleObject:x:Addition styles
typeString'text':x:type of input
value*:x:value of component

SLDate

From src/SLDate.jsx

Date Input component

proptypedefaultrequireddescription
disabledBooleanfalse:x:true to disable toggling
formatString'MM/DD/YYYY':x:How to Format the Presented Date
inputPropsObject:x:Additional props to add to the input
onChangeFunction:white_check_mark:callback when date is selected
openLeftBooleanfalse:x:offset to display calendar in pixels
timezoneString:x:Timezone to use for for display
valueUnion<String \| Object>:x:Current date to display should be a string, Date(), or moment()

SLDateRange

From src/SLDateRange.jsx

Input which allows user to pick a range of dates wrapper on react-dates

proptypedefaultrequireddescription
buttonTextString'Filter':x:Text for button
disabledBooleanfalse:x:true to disable toggling
endDateUnion<String \| Object>:x:value to use as end date
idString:white_check_mark:Unique ID required
onChangeFunction:white_check_mark:callback when start or end date changes
startDateUnion<String \| Object>:x:value to use as startDate

SLDateTime

From src/SLDateTime.jsx

proptypedefaultrequireddescription
dateFormatString'MM/DD/YYYY':x:How to Format the Presented Date
disabledBooleanfalse:x:true to disable toggling
inputPropsObject:x:Additional props to add to the input
onChangeFunction:white_check_mark:callback when date is selected
openLeftUnknownfalse:x:
timeFormatUnknown'HH:mm:ss':x:
timezoneString:x:Timezone to use for for display
valueUnion<String \| Object>:x:Current date to display should be a string, Date(), or moment()

SLForm

From src/SLForm.jsx

Form Component to display as a modal or not

proptypedefaultrequireddescription
ButtonFunction:x:Function that returns a button * this is passed a cb for the buttons onclick method toggle => Btn
fieldsObject:white_check_mark:Form fields to display, should be JSX * recommended to use SLFormGroup wrapped components for best presentation
formInValidBoolean:x:Set to true if the form is not valid this will disable the submit button
headerString:x:Header Text for Modal *required if notModal={false}
notModalBoolean:x:Set true if the form should not be a modal
onSubmitFunction:white_check_mark:Callback when form is submitted, expected to return Promise
onToggleFunction:x:callback for when the modal is toggled open
sizeEnum('sm','md','lg','xl'):x:size of the modal
submitButtonFunction:x:If notModal={true} a custom submit button may be used * this is passed a callback for submit and formInvalid (submit, invalid) => submit

SLFormGroup

From src/SLFormGroup.jsx

Wrapper for a form input which will display labels and align elements nicely in an SLForm

proptypedefaultrequireddescription
checkBooleanfalse:x:Set to true if the input is a check or radio to display label correctly
helpTextString:x:Help text to display when hovering over help icon * useful for giving context to an input value
hideLabelBooleanfalse:x:Set true to hide the label component
inputObject:white_check_mark:Form Input JSX
labelString:x:Input Label Text

SelectCountry

From src/SelectCountry.jsx

Select a country code in a dropdown

proptypedefaultrequireddescription
disabledBooleanfalse:x:true to disable toggling
onChangeFunction:white_check_mark:callback when a country is selected
valueString:x:current selected country

SimpleSelect

From src/SimpleSelect.jsx

Simplified wrapper of react-select

proptypedefaultrequireddescription
disabledBooleanfalse:x:true to disable toggling
errorTextUnion<String \| Array>:x:Errors to display, should be a string or array of strings @type {type}
labelFieldString'label':x:object key to use as the label
onChangeFunction:white_check_mark:callback when option selected
optionsArray:white_check_mark:array of objects to choose from should have keys with value of valueField and labelField props
valueFieldString'_id':x:object key to use for the value

TextArea

From src/TextArea.jsx

Thing wrapper on textarea tag Displays errors below input

proptypedefaultrequireddescription
classNameString:x:additional classnames to add to input tag
disabledBooleanfalse:x:true to disable toggling
onChangeFunction:white_check_mark:Callback when updated
value*:x:value of component
1.0.0

4 years ago

0.5.15

5 years ago

0.5.14

5 years ago

0.5.13

5 years ago

0.5.12

5 years ago

0.5.11

5 years ago

0.5.10

5 years ago

0.5.9

5 years ago

0.5.8

5 years ago

0.5.7

5 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago