Sha256: c6734a33796b434153a6dd5877440597e0cb6cd5075102c22668bb183b45630f

Contents?: true

Size: 1.71 KB

Versions: 27

Compression:

Stored size: 1.71 KB

Contents

'use strict'

define 'aura/extensions/widget/flowable', ->

  # The purpose of this extension is have a formalized widget type to
  # put domain comunication logic between other widgets
  (application) ->

    instantiation =
      composite_with: ->

        stampit  = require 'stampit/stampit'

        # TODO Move each composable to its file
        eventable  = stampit().enclose ->
          @on       = @sandbox.on
          @off      = @sandbox.off
          @once     = @sandbox.once
          @many     = @sandbox.many
          @emit     = @sandbox.emit
          @unlisten = @sandbox.removeAllListeners

          @

        filterable = stampit()

        routeable  = stampit()

        stateable  = stampit(transit: (state) -> application.state = state).enclose ->
          Object.defineProperty @, 'state',
            set: @transit
            get: -> application.state
            configurable: false

          @stateless()

        elementless = stampit ->
          marker  = " #{@name}.#{@identifier} flow "
          node    = document.createComment marker
          @$el.replaceWith node
          @$el    = $ node

        stampit.compose filterable, routeable, eventable, stateable, elementless

      create_widget_type: (flowable, application) ->
        {core: {Widgets}}   = application

        Widgets.Flow  = Widgets.composable Widgets.Default.prototype, null, (options) -> Widgets.Default.call @, options
        Widgets.Flow.compose flowable

    version: '0.1.0'

    initialize: (application) ->
      flowable = instantiation.composite_with application
      instantiation.create_widget_type flowable, application

    afterAppStart: (application) ->
      application.components.addSource 'flow', 'flows'







Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ende-0.5.22 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.21 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.20 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.19 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.18 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.17 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.16 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.15 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.14 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.13 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.12 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.10 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.9 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.8 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.7 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.6 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.4.25 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.5 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.4 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee
ende-0.5.3 lib/assets/javascripts/aura/extensions/widget/flowable.js.coffee