Methods
group(label, name, fields, …childrens) → {COMMON_FIELDS}
Create a group with other fields inside.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
label |
string | Group label |
|
name |
string | Group name (HubL variable name) |
|
fields |
BASE_FIELDS | GROUP_FIELD | Group settings |
|
childrens |
CHILDRENS |
<repeatable> |
Group children fields |
Returns:
- Type
- COMMON_FIELDS
(async) init(…fields)
Initialize and write an array of fields object from fields.js to a fields.json file
Combine all the fields and groups objects into one array and write it to fields.json file
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fields |
CHILDRENS |
<repeatable> |
Returns:
undefined
Example
import { init, group, styleGroup, moduleFields as fi } from '@resultify/hubspot-fields-js'
init(
styleGroup(
fi.alignment('Alignment', 'alignment')
),
group('Group', 'group', {},
fi.text('Text', 'text')
),
fi.link('Link', 'link')
)
styleGroup(…childrens) → {COMMON_FIELDS}
Create a group with other fields inside.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
childrens |
CHILDRENS |
<repeatable> |
Group children fields |
Returns:
- Type
- COMMON_FIELDS
Type Definitions
COMMON_FIELDS
Required module/group fields
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
label |
string | ||
type |
string | ||
tab |
string |
<optional> |
|
children |
Array.<COMMON_FIELDS> |
<optional> |
- Source:
CSS_UNIT
CSS unit
Type:
- 'px' | 'pt' | 'em' | 'rem' | '%' | 'ex' | 'ch' | 'vh' | 'vmax' | 'vmin' | 'vw'
- Source:
TEXT_STYLES
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
`text-decoration` |
'underline' | 'none' |
<optional> |
|
`font-style` |
'italic' | 'normal' |
<optional> |
|
`font-weight` |
'bold' | 'normal' |
<optional> |
- Source: