Releases: CarbonPackages/Carbon.Eel
2.9.0
✨ Feature
AlpineJS.expression(value)
Use this to pass a javascript expression inside of the AlpineJS.object
or AlpineJS.xData
helper
Example:
AlpineJS.object({theme: AlpineJS.expression("localStorage.theme||'system'"), show: props.show})
AlpineJS.xData('themeSwitcher', {theme: AlpineJS.expression("localStorage.theme||'system'"), show: props.show})
Result will be:
{theme:localStorage.theme||'system',show:true}
themeSwitcher({theme:localStorage.theme||'system',show:true})
Full Changelog: 2.8.1...2.9.0
2.8.1
Full Changelog: 2.8.0...2.8.1
2.8.0
✨ AlpineJS Helper
AlpineJS.object(arg1, arg2, ..argN)
Generate an object for AlpineJS directive x-data
.
Supports nested arrays. You could do the same with Json.stringify()
, but this function is shorter, as AlpineJS accepts objects and easier to write and read.
Examples:
AlpineJS.object({effect: 'slide', spaceBetween: 12, loop: true, navigation: null}) == '{effect:'slide',spaceBetween:12,loop:true,navigation:null}'
AlpineJS.object({nested: {value: true, nulled: null}}) == '{nested:{value:true,nulled:null}}'
...arguments
The array
Return The JavaScript object as string
AlpineJS.xData(name, arg1, arg2, ..argN)
Generate a function call for AlpineJS. More info.
Supports nested arrays. In named arrays ({first:1,second:null}
) null
get filtered out, but in list arrays ([1,null]
) and in plain values the will stay.
Examples:
AlpineJS.xData('slider', {effect: 'slide', spaceBetween: 12, loop: true, navigation: null}) == 'slider({effect:'slide',spaceBetween:12,loop:true})'
AlpineJS.xData('slider', 'one', 1, false, null, ['string', 2, null]) == 'slider('one',1,false,null,['string',2,null])'
AlpineJS.xData('nested', {nested: {value: true}}) == 'nested({nested:{value:true}})'
name
(string) The name forAlpine.data
...arguments
(mixed) The options for the function
Return The string for the x-data function call
Full Changelog: 2.7.0...2.8.0
2.7.0
Full Changelog: 2.6.0...2.7.0
2.6.0
Full Changelog: 2.5.0...2.6.0
2.5.0
2.4.0
✨ Feature
Add Carbon.Array.isCountable(variable)
Check if the given variable is countable
Return true
or false
Full Changelog: 2.3.3...2.4.0
2.3.3
Full Changelog: 2.3.2...2.3.3
2.3.2
Full Changelog: 2.3.1...2.3.2
2.3.1
Full Changelog: 2.3.0...2.3.1