Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const schema = ValueSchema.objOf([
FieldSchema.strict('fields'),
// Used for when datafields are present.
FieldSchema.defaulted('maxFieldIndex', rawSpec.fields.length - 1),
FieldSchema.strict('onExecute'),
FieldSchema.strict('getInitialValue'),
FieldSchema.state('state', function () {
return {
dialogSwipeState: Singleton.value(),
currentScreen: Cell(0)
};
})
]);
const spec = ValueSchema.asRawOrDie('SerialisedDialog', schema, rawSpec);
const navigationButton = function (direction, directionName, enabled) {
return Button.sketch({
dom: UiDomFactory.dom('<span class="${prefix}-icon-' + directionName + ' ${prefix}-icon"></span>'),
action (button) {
AlloyTriggers.emitWith(button, navigateEvent, { direction });
},
buttonBehaviours: Behaviour.derive([
Disabling.config({
disableClass: Styles.resolve('toolbar-navigation-disabled'),
disabled: !enabled
})
])
});
};
memCollection.getOpt(everything).each((collection) => {
Representing.setValue(collection,
ValueSchema.asRawOrDie('dialogComponentsDemo.collection', Types.Collection.collectionDataProcessor, [
{
value: 'a',
text: 'A',
icon: 'a'
},
{
value: 'b',
text: 'B',
icon: 'b'
},
{
value: 'c',
text: 'C',
icon: 'c'
},
{
const createModes = (data: BehaviourModeSpec): AlloyBehaviour => {
const value: BehaviourModeSpec = ValueSchema.asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data);
return CommonBehaviour.createModes(
ValueSchema.choose(value.branchKey, value.branches),
value.name, value.active, value.apis, value.extra, value.state
);
};
const create = (data: AlloyBehaviourConfig): AlloyBehaviour => {
const value = ValueSchema.asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data);
return CommonBehaviour.create(value.fields, value.name, value.active, value.apis, value.extra, value.state);
};