Create a component definition, which will be loaded in both the parent and child windows.
A tag-name for the component, used for:
- Logging
- Auto-generating an angular directive
tag: 'my-component-tag'The full url that will be loaded when your component is rendered, or an object mapping different urls for different environments.
url: 'https://www.my-site.com/mycomponent'url: {
local: 'http://localhost:8000/mycomponent',
dev: 'http://my-dev-site.com:8000/mycomponent',
live: 'https://my-live-site.com/mycomponent'
}The default logging level required for this component. Options are:
'debug''info''warn''error'
defaultLogLevel: 'error'Note that this value can be overriden by passing 'logLevel' as a prop when rendering the component.
The dimensions for your component, in css-style units, with support for px or %.
dimensions: {
width: '300px',
height: '200px'
}dimensions: {
width: '80%',
height: '90%'
}A string, array of strings or reqular expresions to be used to validate parent domain. If parent domain doesn't match any item, communication from child to parent will be prevented. The default value is '*' which match any domain.
allowedParentDomains: [
"http://localhost",
/^http:\/\/www\.mydomain\.com$/
]A mapping of prop name to prop settings. Used to do run-time validation and prop normalization.
props: {
prefilledEmail: {
type: 'string',
required: false
},
onLogin: {
type: 'function',
required: true
}
}-
type
stringThe data-type expected for the prop
'string''number''boolean''object''function'
-
required
booleanWhether or not the prop is mandatory
-
def
function()A function returning the default value for the prop, if none is passed
-
childDef
anyA function returning the default value for the prop, if none is passed, but called in the child window
-
validate
function(value, props)A function to validate the passed value. Should throw an appopriate error if invalid.
-
queryParam
boolean | stringShould a prop be passed in the url. If a string, this specifies the url param name which will be used.
-
value
anyThe value for the prop, if it should be statically defined at component creation time
-
decorate
function(value)A function used to decorate the prop at render-time. Called with the value of the prop, should return the new value.
-
promisify
booleanShould a function prop be turned into a promise-returning function
-
noop
booleanShould a function prop default to noop
-
once
booleanShould a function prop be turned into a one-time function
-
memoize
booleanShould a function prop be turned into a memoizing function
-
serialization
stringIf
'json', the prop will be JSON stringified before being inserted into the url, otherwise the prop will be converted to dot-notation. -
alias
stringAn aliased name for the prop