0.1.41 • Published 6 years ago

react-another-dialog v0.1.41

Weekly downloads
23
License
MIT
Repository
github
Last release
6 years ago

react-another-dialog documentation

Build upon (https://github.com/yogaboll/react-npm-component-starter)

Modal dialog component aiming for API simplicity but still covering common more complex use cases.

  • package name: react-another-dialog
  • main: lib/AnotherDialog.js
  • version: 0.1.41
  • date: 2018/06/18 15:33:45
  • license: MIT
  • author: tapsaman

WORK IN PROGRESS undefined


In file AnotherDialog.jsx

class AnotherDialog

React-component for building your dialog element in.

Properties

NameTypeDefaultDescription
titlestringn/aShown title (optional).
subtitlestringn/aShown subtitle. Included HTML will be rendered (optional).
queryArrayn/aArray of properties to render AnotherDialogInput-objects with OR ready-made input components (extending AnotherDialogInput)
verificationbool/stringfalseIf true, verificate response before onSuccess, after onPostValidation. Give a string to define the verification question (default: "Are you sure to proceed?").
animateInfunctionn/aFunction to animate in the dialog the way you wish.Run as animateIn(formElement, maskElement)
animateOutfunctionn/aFunction to animate out the dialog the way you wish.Run as animateOut(formElement, maskElement, after)Note: Run the 'after'-function when done!

onSuccess onCancel onFinish onPostValidate | function | n/a | Run with parameters dialogOutput and afterPostValidate callback.Response object: { pass: _bool_, message: _string_ }Must either return the response object or run afterPostValidate with it as the first parameter. options | array | { type:"submit", value:"OK" },{ type:"cancel", value:"Cancel" } | Customize the main buttons. Additionals can be included:{type: "button", value: "Example", onClick: function() {...}} closeOnMaskClick | bool | true | If true, cancel dialog on click outside the form (on .a-dialog-mask) noMask | bool | false | floating | bool | true | If true, float form in the screen center

Given React-children are rendered after title, before subtitle and query.

onPostValidate response properties

Common for inputs and form. Name | Type | Default | Description -----|------|---------|------------ message | string | - | Output as main message, pass | bool | - | True if validation passes, false if fails. Undefined if no change (e.g. with a "Loading..." message).

Only for forms. Name | Type | Default | Description -----|------|---------|------------ verificate | bool | - | If true, verificate response with OK / Cancel (verification message is given as message). afterVerificate | function | - | If defined, run after verification. Otherwise runs onSuccess.

undefined


In file AnotherDialogInput.jsx

class AnotherDialogInput

Base class for AnotherDialog-input React-components.

Properties

NameTypeDefaultDescription
titlestringn/aQuestion header (optional).
namestringn/aName of output value
typestring"hidden""text"/"password"/"check"/"number"/"radio"/"select"/"date"/"daterange"/"group"/"addable"/"hidden"
kindstring"hidden"alias of type
initstring/numbern/ainitial value or child amount for "addable"
maxnumbern/amax value for "num", length for "text"/"password" or child amount for "addable"
minnumbern/amin value for "num", length for "text"/"password" or child amount for "addable"
minDiffnumber0minimum start/end date difference for "daterange"
titlesarray"Start date", "End date"titles of each date input for "daterange"
rangestringn/arange string, overrides min/max (e.g. "0-5")
testfunctionn/atest "text"/"password" value with
optarrayn/aoption values for "radio"/"select" (use null for disabled options / option headers)
optTitlesarrayn/aoption titles for "radio"/"select"
childrenarrayn/ainputs for "addable"/"group"
0.1.41

6 years ago

0.1.40

6 years ago

0.1.39

6 years ago

0.1.38

6 years ago

0.1.37

6 years ago

0.1.35

6 years ago

0.1.34

6 years ago

0.1.33

6 years ago

0.1.32

6 years ago

0.1.30

6 years ago

0.1.29

6 years ago

0.1.28

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.0.5

6 years ago