Sha256: 6c7e07d906d7ca684f078f503ed1b563857ae2183423cf09fc7797f92678bc8a

Contents?: true

Size: 719 Bytes

Versions: 6

Compression:

Stored size: 719 Bytes

Contents

class FakeNumberEvent
    constructor: (value) ->
        value = if _.isNull(value) then 0 else value
        @target = {value}
    isDefaultPrevented: -> false

class Lanes.Components.NumberInput extends Lanes.React.Component

    mixins: [
        Lanes.Components.Form.InputFieldMixin
    ]

    handleNumberChange: (n) ->
        @fieldMixinSetValue( new FakeNumberEvent(n) )

    renderInputField: (props, handlers) ->

        props.format ||= '#,###.00'
        props = _.omit(props, 'label')

        <Lanes.Vendor.ReactWidgets.NumberPicker
            ref="select"

            {...handlers}
            {...props}
            onChange={@handleNumberChange}
            value={Number(props.value)}
        />

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lanes-0.7.0 client/lanes/components/shared/NumberInput.cjsx
lanes-0.6.1 client/lanes/components/shared/NumberInput.cjsx
lanes-0.6.0 client/lanes/components/shared/NumberInput.cjsx
lanes-0.5.6 client/lanes/components/shared/NumberInput.cjsx
lanes-0.5.5 client/lanes/components/shared/NumberInput.cjsx
lanes-0.5.0 client/lanes/components/shared/NumberInput.cjsx