ende 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/component.json +2 -1
- data/lib/assets/javascripts/aura/extensions/devise.js.coffee +3 -2
- data/lib/assets/javascripts/aura/extensions/models.js.coffee.erb +1 -2
- data/lib/assets/javascripts/aura/extensions/widget/lifecycleable.js.coffee +37 -16
- data/lib/assets/javascripts/ende.js.coffee +1 -1
- data/lib/assets/javascripts/widgets/dialog/main.js.coffee +100 -0
- data/lib/assets/javascripts/widgets/dialog/presenter.js.coffee +18 -0
- data/lib/assets/javascripts/widgets/dialog/states/default.html +2 -0
- data/lib/assets/javascripts/widgets/dialog/states/index.js.coffee +2 -0
- data/lib/assets/javascripts/widgets/list/main.js.coffee +1 -0
- data/lib/assets/stylesheets/ende.styl +1 -0
- data/lib/ende/version.rb +1 -1
- data/lib/ende.rb +6 -2
- data/vendor/assets/components/build.css +111 -0
- data/vendor/{components/indefinido-indemma/build/release.js → assets/components/build.js} +25468 -17590
- data/vendor/assets/components/ende_build.css +111 -0
- data/vendor/assets/components/ende_build.js +29571 -0
- data/vendor/assets/javascripts/ende/build.js +1962 -0
- data/vendor/components/component-classes/component.json +19 -0
- data/vendor/components/component-classes/index.js +165 -0
- data/vendor/components/component-css/component.json +18 -0
- data/vendor/components/component-css/index.js +34 -0
- data/vendor/components/component-delegate/component.json +2 -2
- data/vendor/components/component-delegate/index.js +4 -4
- data/vendor/components/component-dialog/component.json +23 -0
- data/vendor/components/component-dialog/dialog.css +92 -0
- data/vendor/components/component-dialog/index.js +292 -0
- data/vendor/components/component-dialog/template.js +1 -0
- data/vendor/components/component-dom/component.json +33 -0
- data/vendor/components/component-dom/index.js +725 -0
- data/vendor/components/component-domify/component.json +22 -0
- data/vendor/components/component-domify/index.js +71 -0
- data/vendor/components/component-emitter/component.json +13 -0
- data/vendor/components/component-emitter/index.js +156 -0
- data/vendor/components/component-event/index.js +8 -11
- data/vendor/components/component-indexof/component.json +15 -0
- data/vendor/components/component-indexof/index.js +10 -0
- data/vendor/components/component-overlay/component.json +22 -0
- data/vendor/components/component-overlay/index.js +111 -0
- data/vendor/components/component-overlay/overlay.css +19 -0
- data/vendor/components/component-overlay/template.js +1 -0
- data/vendor/components/component-query/component.json +2 -1
- data/vendor/components/component-sort/component.json +20 -0
- data/vendor/components/component-sort/index.js +43 -0
- data/vendor/components/component-value/component.json +25 -0
- data/vendor/components/component-value/index.js +95 -0
- data/vendor/components/indefinido-indemma/component.json +2 -3
- data/vendor/components/indefinido-indemma/lib/record/resource.js +2 -4
- data/vendor/components/mikeric-rivets/component.json +1 -1
- data/vendor/components/mikeric-rivets/dist/rivets.js +64 -44
- data/vendor/components/paulmillr-es6-shim/component.json +1 -1
- data/vendor/components/paulmillr-es6-shim/es6-shim.js +22 -11
- data/vendor/components/pluma-assimilate/component.json +1 -1
- data/vendor/components/pluma-assimilate/dist/assimilate.js +103 -63
- metadata +35 -246
- data/lib/tasks/component.thor +0 -63
- data/vendor/assets/components/KapIT-observe-utils/component.json +0 -16
- data/vendor/assets/components/KapIT-observe-utils/lib/observe-utils.js +0 -780
- data/vendor/assets/components/chaijs-assertion-error/component.json +0 -18
- data/vendor/assets/components/chaijs-assertion-error/index.js +0 -110
- data/vendor/assets/components/chaijs-chai/component.json +0 -47
- data/vendor/assets/components/chaijs-chai/index.js +0 -1
- data/vendor/assets/components/chaijs-chai/lib/chai/assertion.js +0 -130
- data/vendor/assets/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
- data/vendor/assets/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
- data/vendor/assets/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
- data/vendor/assets/components/chaijs-chai/lib/chai/interface/should.js +0 -76
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/index.js +0 -108
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/test.js +0 -26
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
- data/vendor/assets/components/chaijs-chai/lib/chai/utils/type.js +0 -45
- data/vendor/assets/components/chaijs-chai/lib/chai.js +0 -80
- data/vendor/assets/components/chaijs-deep-eql/component.json +0 -18
- data/vendor/assets/components/chaijs-deep-eql/lib/eql.js +0 -257
- data/vendor/assets/components/chaijs-type-detect/component.json +0 -16
- data/vendor/assets/components/chaijs-type-detect/lib/type.js +0 -142
- data/vendor/assets/components/component-bind/component.json +0 -14
- data/vendor/assets/components/component-bind/index.js +0 -24
- data/vendor/assets/components/component-delegate/component.json +0 -19
- data/vendor/assets/components/component-delegate/index.js +0 -42
- data/vendor/assets/components/component-event/component.json +0 -13
- data/vendor/assets/components/component-event/index.js +0 -40
- data/vendor/assets/components/component-jquery/component.json +0 -14
- data/vendor/assets/components/component-jquery/index.js +0 -9601
- data/vendor/assets/components/component-link-delegate/component.json +0 -23
- data/vendor/assets/components/component-link-delegate/index.js +0 -60
- data/vendor/assets/components/component-matches-selector/component.json +0 -20
- data/vendor/assets/components/component-matches-selector/index.js +0 -45
- data/vendor/assets/components/component-query/component.json +0 -21
- data/vendor/assets/components/component-query/index.js +0 -21
- data/vendor/assets/components/component-type/component.json +0 -18
- data/vendor/assets/components/component-type/index.js +0 -32
- data/vendor/assets/components/component-url/component.json +0 -17
- data/vendor/assets/components/component-url/index.js +0 -63
- data/vendor/assets/components/discore-closest/component.json +0 -14
- data/vendor/assets/components/discore-closest/index.js +0 -18
- data/vendor/assets/components/indefinido-advisable/component.json +0 -21
- data/vendor/assets/components/indefinido-advisable/index.js +0 -1
- data/vendor/assets/components/indefinido-advisable/lib/advisable.js +0 -60
- data/vendor/assets/components/indefinido-indemma/component.json +0 -40
- data/vendor/assets/components/indefinido-indemma/index.js +0 -1
- data/vendor/assets/components/indefinido-indemma/lib/extensions/rivets.js +0 -23
- data/vendor/assets/components/indefinido-indemma/lib/record/associable.js +0 -217
- data/vendor/assets/components/indefinido-indemma/lib/record/maid.js +0 -24
- data/vendor/assets/components/indefinido-indemma/lib/record/resource.js +0 -104
- data/vendor/assets/components/indefinido-indemma/lib/record/rest.js +0 -36
- data/vendor/assets/components/indefinido-indemma/lib/record/restfulable.js +0 -326
- data/vendor/assets/components/indefinido-indemma/lib/record/scopable.js +0 -279
- data/vendor/assets/components/indefinido-indemma/lib/record/translationable.js +0 -19
- data/vendor/assets/components/indefinido-indemma/lib/record/validatable.js +0 -216
- data/vendor/assets/components/indefinido-indemma/lib/record/validations/associated.js +0 -30
- data/vendor/assets/components/indefinido-indemma/lib/record/validations/confirmation.js +0 -19
- data/vendor/assets/components/indefinido-indemma/lib/record/validations/cpf.js +0 -60
- data/vendor/assets/components/indefinido-indemma/lib/record/validations/presence.js +0 -19
- data/vendor/assets/components/indefinido-indemma/lib/record/validations/remote.js +0 -71
- data/vendor/assets/components/indefinido-indemma/lib/record.js +0 -167
- data/vendor/assets/components/indefinido-indemma/vendor/sinon.js +0 -4290
- data/vendor/assets/components/indefinido-indemma/vendor/stampit.js +0 -392
- data/vendor/assets/components/indefinido-observable/component.json +0 -25
- data/vendor/assets/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -4290
- data/vendor/assets/components/indefinido-observable/index.js +0 -1
- data/vendor/assets/components/indefinido-observable/lib/adapters/rivets.js +0 -26
- data/vendor/assets/components/indefinido-observable/lib/observable.js +0 -320
- data/vendor/assets/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
- data/vendor/assets/components/indefinido-observable/vendor/shims/accessors.js +0 -173
- data/vendor/assets/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
- data/vendor/assets/components/indefinido-observable/vendor/shims/object.create.js +0 -77
- data/vendor/assets/components/mikeric-rivets/component.json +0 -15
- data/vendor/assets/components/mikeric-rivets/dist/rivets.js +0 -1020
- data/vendor/assets/components/paulmillr-es6-shim/component.json +0 -17
- data/vendor/assets/components/paulmillr-es6-shim/es6-shim.js +0 -985
- data/vendor/assets/components/pluma-assimilate/component.json +0 -25
- data/vendor/assets/components/pluma-assimilate/dist/assimilate.js +0 -87
- data/vendor/assets/components/segmentio-extend/component.json +0 -13
- data/vendor/assets/components/segmentio-extend/index.js +0 -15
- data/vendor/components/chaijs-assertion-error/component.json +0 -18
- data/vendor/components/chaijs-assertion-error/index.js +0 -110
- data/vendor/components/chaijs-chai/component.json +0 -47
- data/vendor/components/chaijs-chai/index.js +0 -1
- data/vendor/components/chaijs-chai/lib/chai/assertion.js +0 -130
- data/vendor/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
- data/vendor/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
- data/vendor/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
- data/vendor/components/chaijs-chai/lib/chai/interface/should.js +0 -76
- data/vendor/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
- data/vendor/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
- data/vendor/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
- data/vendor/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
- data/vendor/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
- data/vendor/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
- data/vendor/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
- data/vendor/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
- data/vendor/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
- data/vendor/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
- data/vendor/components/chaijs-chai/lib/chai/utils/index.js +0 -108
- data/vendor/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
- data/vendor/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
- data/vendor/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
- data/vendor/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
- data/vendor/components/chaijs-chai/lib/chai/utils/test.js +0 -26
- data/vendor/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
- data/vendor/components/chaijs-chai/lib/chai/utils/type.js +0 -45
- data/vendor/components/chaijs-chai/lib/chai.js +0 -80
- data/vendor/components/chaijs-deep-eql/component.json +0 -18
- data/vendor/components/chaijs-deep-eql/lib/eql.js +0 -257
- data/vendor/components/chaijs-type-detect/component.json +0 -16
- data/vendor/components/chaijs-type-detect/lib/type.js +0 -142
- data/vendor/components/component-link-delegate/component.json +0 -23
- data/vendor/components/component-link-delegate/index.js +0 -60
- data/vendor/components/component-url/component.json +0 -17
- data/vendor/components/component-url/index.js +0 -63
- data/vendor/components/discore-closest/component.json +0 -14
- data/vendor/components/discore-closest/index.js +0 -18
- data/vendor/components/indefinido-indemma/.gitignore +0 -14
- data/vendor/components/indefinido-indemma/.ruby-gemset +0 -1
- data/vendor/components/indefinido-indemma/.ruby-version +0 -1
- data/vendor/components/indefinido-indemma/Gemfile +0 -13
- data/vendor/components/indefinido-indemma/Guardfile +0 -39
- data/vendor/components/indefinido-indemma/History.md +0 -0
- data/vendor/components/indefinido-indemma/Readme.md +0 -443
- data/vendor/components/indefinido-indemma/build/development.js +0 -331
- data/vendor/components/indefinido-indemma/build/test.js +0 -331
- data/vendor/components/indefinido-indemma/components/chaijs-assertion-error/component.json +0 -18
- data/vendor/components/indefinido-indemma/components/chaijs-assertion-error/index.js +0 -110
- data/vendor/components/indefinido-indemma/components/chaijs-chai/component.json +0 -47
- data/vendor/components/indefinido-indemma/components/chaijs-chai/index.js +0 -1
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/assertion.js +0 -130
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/should.js +0 -76
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/eql.js +0 -129
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/index.js +0 -108
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/test.js +0 -26
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/type.js +0 -45
- data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai.js +0 -80
- data/vendor/components/indefinido-indemma/components/component-bind/component.json +0 -14
- data/vendor/components/indefinido-indemma/components/component-bind/index.js +0 -24
- data/vendor/components/indefinido-indemma/components/component-jquery/component.json +0 -14
- data/vendor/components/indefinido-indemma/components/component-jquery/index.js +0 -9601
- data/vendor/components/indefinido-indemma/components/component-type/component.json +0 -18
- data/vendor/components/indefinido-indemma/components/component-type/index.js +0 -32
- data/vendor/components/indefinido-indemma/components/indefinido-advisable/component.json +0 -21
- data/vendor/components/indefinido-indemma/components/indefinido-advisable/index.js +0 -1
- data/vendor/components/indefinido-indemma/components/indefinido-advisable/lib/advisable.js +0 -60
- data/vendor/components/indefinido-indemma/components/indefinido-observable/component.json +0 -25
- data/vendor/components/indefinido-indemma/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -4290
- data/vendor/components/indefinido-indemma/components/indefinido-observable/index.js +0 -1
- data/vendor/components/indefinido-indemma/components/indefinido-observable/lib/adapters/rivets.js +0 -26
- data/vendor/components/indefinido-indemma/components/indefinido-observable/lib/observable.js +0 -323
- data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
- data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/accessors.js +0 -173
- data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
- data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/object.create.js +0 -77
- data/vendor/components/indefinido-indemma/components/kapit-observe-utils/component.json +0 -13
- data/vendor/components/indefinido-indemma/components/pluma-assimilate/component.json +0 -25
- data/vendor/components/indefinido-indemma/components/pluma-assimilate/dist/assimilate.js +0 -87
- data/vendor/components/indefinido-indemma/karma.conf.js +0 -86
- data/vendor/components/indefinido-indemma/lib/record/errors.js +0 -1
- data/vendor/components/indefinido-indemma/spec/record/associable_spec.js +0 -76
- data/vendor/components/indefinido-indemma/spec/record/resource_spec.js +0 -90
- data/vendor/components/indefinido-indemma/spec/record/rest_spec.js +0 -32
- data/vendor/components/indefinido-indemma/spec/record/restfulable_spec.js +0 -232
- data/vendor/components/indefinido-indemma/spec/record/scopable_spec.js +0 -201
- data/vendor/components/indefinido-indemma/spec/record/translationable.js +0 -28
- data/vendor/components/indefinido-indemma/spec/record/validatable_spec.js +0 -111
- data/vendor/components/indefinido-indemma/spec/record/validations/associated_spec.js +0 -43
- data/vendor/components/indefinido-indemma/spec/record/validations/confirmation_spec.js +0 -36
- data/vendor/components/indefinido-indemma/spec/record/validations/cpf_spec.js +0 -35
- data/vendor/components/indefinido-indemma/spec/record/validations/presence_spec.js +0 -28
- data/vendor/components/indefinido-indemma/spec/record/validations/remote_spec.js +0 -86
- data/vendor/components/indefinido-indemma/spec/record/validations/type_spec.js +0 -48
- data/vendor/components/indefinido-indemma/spec/record_spec.js +0 -37
- data/vendor/components/indefinido-indemma/spec/spec_helper.js +0 -11
- data/vendor/components/indefinido-indemma/spec/support/value_objects/phone.js +0 -45
- data/vendor/components/indefinido-indemma/src/lib/extensions/rivets.coffee +0 -17
- data/vendor/components/indefinido-indemma/src/lib/record/associable.coffee +0 -173
- data/vendor/components/indefinido-indemma/src/lib/record/errors.coffee +0 -20
- data/vendor/components/indefinido-indemma/src/lib/record/maid.coffee +0 -16
- data/vendor/components/indefinido-indemma/src/lib/record/resource.coffee +0 -103
- data/vendor/components/indefinido-indemma/src/lib/record/rest.coffee +0 -28
- data/vendor/components/indefinido-indemma/src/lib/record/restfulable.coffee +0 -314
- data/vendor/components/indefinido-indemma/src/lib/record/scopable.coffee +0 -266
- data/vendor/components/indefinido-indemma/src/lib/record/translationable.coffee +0 -18
- data/vendor/components/indefinido-indemma/src/lib/record/validatable.coffee +0 -209
- data/vendor/components/indefinido-indemma/src/lib/record/validations/associated.coffee +0 -32
- data/vendor/components/indefinido-indemma/src/lib/record/validations/confirmation.coffee +0 -19
- data/vendor/components/indefinido-indemma/src/lib/record/validations/cpf.coffee +0 -58
- data/vendor/components/indefinido-indemma/src/lib/record/validations/presence.coffee +0 -19
- data/vendor/components/indefinido-indemma/src/lib/record/validations/remote.coffee +0 -65
- data/vendor/components/indefinido-indemma/src/lib/record/validations/type.coffee +0 -32
- data/vendor/components/indefinido-indemma/src/lib/record.coffee +0 -123
- data/vendor/components/indefinido-indemma/src/spec/record/associable_spec.coffee +0 -63
- data/vendor/components/indefinido-indemma/src/spec/record/resource_spec.coffee +0 -64
- data/vendor/components/indefinido-indemma/src/spec/record/rest_spec.coffee +0 -22
- data/vendor/components/indefinido-indemma/src/spec/record/restfulable_spec.coffee +0 -164
- data/vendor/components/indefinido-indemma/src/spec/record/scopable_spec.coffee +0 -181
- data/vendor/components/indefinido-indemma/src/spec/record/translationable.coffee +0 -19
- data/vendor/components/indefinido-indemma/src/spec/record/validatable_spec.coffee +0 -100
- data/vendor/components/indefinido-indemma/src/spec/record/validations/associated_spec.coffee +0 -35
- data/vendor/components/indefinido-indemma/src/spec/record/validations/confirmation_spec.coffee +0 -25
- data/vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee +0 -28
- data/vendor/components/indefinido-indemma/src/spec/record/validations/presence_spec.coffee +0 -24
- data/vendor/components/indefinido-indemma/src/spec/record/validations/remote_spec.coffee +0 -72
- data/vendor/components/indefinido-indemma/src/spec/record/validations/type_spec.coffee +0 -33
- data/vendor/components/indefinido-indemma/src/spec/record_spec.coffee +0 -23
- data/vendor/components/indefinido-indemma/src/spec/spec_helper.coffee +0 -9
- data/vendor/components/indefinido-indemma/src/spec/support/value_objects/phone.coffee +0 -30
- data/vendor/components/indefinido-indemma/vendor/owl/pluralize.js +0 -190
@@ -0,0 +1,725 @@
|
|
1
|
+
/**
|
2
|
+
* Module dependencies.
|
3
|
+
*/
|
4
|
+
|
5
|
+
var delegate = require('delegate');
|
6
|
+
var classes = require('classes');
|
7
|
+
var indexof = require('indexof');
|
8
|
+
var domify = require('domify');
|
9
|
+
var events = require('event');
|
10
|
+
var value = require('value');
|
11
|
+
var query = require('query');
|
12
|
+
var type = require('type');
|
13
|
+
var css = require('css');
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Attributes supported.
|
17
|
+
*/
|
18
|
+
|
19
|
+
var attrs = [
|
20
|
+
'id',
|
21
|
+
'src',
|
22
|
+
'rel',
|
23
|
+
'cols',
|
24
|
+
'rows',
|
25
|
+
'name',
|
26
|
+
'href',
|
27
|
+
'title',
|
28
|
+
'style',
|
29
|
+
'width',
|
30
|
+
'height',
|
31
|
+
'tabindex',
|
32
|
+
'placeholder'
|
33
|
+
];
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Expose `dom()`.
|
37
|
+
*/
|
38
|
+
|
39
|
+
exports = module.exports = dom;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Expose supported attrs.
|
43
|
+
*/
|
44
|
+
|
45
|
+
exports.attrs = attrs;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Return a dom `List` for the given
|
49
|
+
* `html`, selector, or element.
|
50
|
+
*
|
51
|
+
* @param {String|Element|List}
|
52
|
+
* @return {List}
|
53
|
+
* @api public
|
54
|
+
*/
|
55
|
+
|
56
|
+
function dom(selector, context) {
|
57
|
+
// array
|
58
|
+
if (Array.isArray(selector)) {
|
59
|
+
return new List(selector);
|
60
|
+
}
|
61
|
+
|
62
|
+
// List
|
63
|
+
if (selector instanceof List) {
|
64
|
+
return selector;
|
65
|
+
}
|
66
|
+
|
67
|
+
// node
|
68
|
+
if (selector.nodeName) {
|
69
|
+
return new List([selector]);
|
70
|
+
}
|
71
|
+
|
72
|
+
if ('string' != typeof selector) {
|
73
|
+
throw new TypeError('invalid selector');
|
74
|
+
}
|
75
|
+
|
76
|
+
// html
|
77
|
+
if ('<' == selector.charAt(0)) {
|
78
|
+
return new List([domify(selector)], selector);
|
79
|
+
}
|
80
|
+
|
81
|
+
// selector
|
82
|
+
var ctx = context
|
83
|
+
? (context.els ? context.els[0] : context)
|
84
|
+
: document;
|
85
|
+
|
86
|
+
return new List(query.all(selector, ctx), selector);
|
87
|
+
}
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Expose `List` constructor.
|
91
|
+
*/
|
92
|
+
|
93
|
+
exports.List = List;
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Initialize a new `List` with the
|
97
|
+
* given array-ish of `els` and `selector`
|
98
|
+
* string.
|
99
|
+
*
|
100
|
+
* @param {Mixed} els
|
101
|
+
* @param {String} selector
|
102
|
+
* @api private
|
103
|
+
*/
|
104
|
+
|
105
|
+
function List(els, selector) {
|
106
|
+
this.els = els || [];
|
107
|
+
this.selector = selector;
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Enumerable iterator.
|
112
|
+
*/
|
113
|
+
|
114
|
+
List.prototype.__iterate__ = function(){
|
115
|
+
var self = this;
|
116
|
+
return {
|
117
|
+
length: function(){ return self.els.length },
|
118
|
+
get: function(i){ return new List([self.els[i]]) }
|
119
|
+
}
|
120
|
+
};
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Remove elements from the DOM.
|
124
|
+
*
|
125
|
+
* @api public
|
126
|
+
*/
|
127
|
+
|
128
|
+
List.prototype.remove = function(){
|
129
|
+
for (var i = 0; i < this.els.length; i++) {
|
130
|
+
var el = this.els[i];
|
131
|
+
var parent = el.parentNode;
|
132
|
+
if (parent) parent.removeChild(el);
|
133
|
+
}
|
134
|
+
};
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Set attribute `name` to `val`, or get attr `name`.
|
138
|
+
*
|
139
|
+
* @param {String} name
|
140
|
+
* @param {String} [val]
|
141
|
+
* @return {String|List} self
|
142
|
+
* @api public
|
143
|
+
*/
|
144
|
+
|
145
|
+
List.prototype.attr = function(name, val){
|
146
|
+
// get
|
147
|
+
if (1 == arguments.length) {
|
148
|
+
return this.els[0] && this.els[0].getAttribute(name);
|
149
|
+
}
|
150
|
+
|
151
|
+
// remove
|
152
|
+
if (null == val) {
|
153
|
+
return this.removeAttr(name);
|
154
|
+
}
|
155
|
+
|
156
|
+
// set
|
157
|
+
return this.forEach(function(el){
|
158
|
+
el.setAttribute(name, val);
|
159
|
+
});
|
160
|
+
};
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Remove attribute `name`.
|
164
|
+
*
|
165
|
+
* @param {String} name
|
166
|
+
* @return {List} self
|
167
|
+
* @api public
|
168
|
+
*/
|
169
|
+
|
170
|
+
List.prototype.removeAttr = function(name){
|
171
|
+
return this.forEach(function(el){
|
172
|
+
el.removeAttribute(name);
|
173
|
+
});
|
174
|
+
};
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Set property `name` to `val`, or get property `name`.
|
178
|
+
*
|
179
|
+
* @param {String} name
|
180
|
+
* @param {String} [val]
|
181
|
+
* @return {Object|List} self
|
182
|
+
* @api public
|
183
|
+
*/
|
184
|
+
|
185
|
+
List.prototype.prop = function(name, val){
|
186
|
+
if (1 == arguments.length) {
|
187
|
+
return this.els[0] && this.els[0][name];
|
188
|
+
}
|
189
|
+
|
190
|
+
return this.forEach(function(el){
|
191
|
+
el[name] = val;
|
192
|
+
});
|
193
|
+
};
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Get the first element's value or set selected
|
197
|
+
* element values to `val`.
|
198
|
+
*
|
199
|
+
* @param {Mixed} [val]
|
200
|
+
* @return {Mixed}
|
201
|
+
* @api public
|
202
|
+
*/
|
203
|
+
|
204
|
+
List.prototype.val =
|
205
|
+
List.prototype.value = function(val){
|
206
|
+
if (0 == arguments.length) {
|
207
|
+
return this.els[0]
|
208
|
+
? value(this.els[0])
|
209
|
+
: undefined;
|
210
|
+
}
|
211
|
+
|
212
|
+
return this.forEach(function(el){
|
213
|
+
value(el, val);
|
214
|
+
});
|
215
|
+
};
|
216
|
+
|
217
|
+
/**
|
218
|
+
* Return a cloned `List` with all elements cloned.
|
219
|
+
*
|
220
|
+
* @return {List}
|
221
|
+
* @api public
|
222
|
+
*/
|
223
|
+
|
224
|
+
List.prototype.clone = function(){
|
225
|
+
var arr = [];
|
226
|
+
for (var i = 0, len = this.els.length; i < len; ++i) {
|
227
|
+
arr.push(this.els[i].cloneNode(true));
|
228
|
+
}
|
229
|
+
return new List(arr);
|
230
|
+
};
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Prepend `val`.
|
234
|
+
*
|
235
|
+
* @param {String|Element|List} val
|
236
|
+
* @return {List} new list
|
237
|
+
* @api public
|
238
|
+
*/
|
239
|
+
|
240
|
+
List.prototype.prepend = function(val){
|
241
|
+
var el = this.els[0];
|
242
|
+
if (!el) return this;
|
243
|
+
val = dom(val);
|
244
|
+
for (var i = 0; i < val.els.length; ++i) {
|
245
|
+
if (el.children.length) {
|
246
|
+
el.insertBefore(val.els[i], el.firstChild);
|
247
|
+
} else {
|
248
|
+
el.appendChild(val.els[i]);
|
249
|
+
}
|
250
|
+
}
|
251
|
+
return val;
|
252
|
+
};
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Append `val`.
|
256
|
+
*
|
257
|
+
* @param {String|Element|List} val
|
258
|
+
* @return {List} new list
|
259
|
+
* @api public
|
260
|
+
*/
|
261
|
+
|
262
|
+
List.prototype.append = function(val){
|
263
|
+
var el = this.els[0];
|
264
|
+
if (!el) return this;
|
265
|
+
val = dom(val);
|
266
|
+
for (var i = 0; i < val.els.length; ++i) {
|
267
|
+
el.appendChild(val.els[i]);
|
268
|
+
}
|
269
|
+
return val;
|
270
|
+
};
|
271
|
+
|
272
|
+
/**
|
273
|
+
* Append self's `el` to `val`
|
274
|
+
*
|
275
|
+
* @param {String|Element|List} val
|
276
|
+
* @return {List} self
|
277
|
+
* @api public
|
278
|
+
*/
|
279
|
+
|
280
|
+
List.prototype.appendTo = function(val){
|
281
|
+
dom(val).append(this);
|
282
|
+
return this;
|
283
|
+
};
|
284
|
+
|
285
|
+
/**
|
286
|
+
* Return a `List` containing the element at `i`.
|
287
|
+
*
|
288
|
+
* @param {Number} i
|
289
|
+
* @return {List}
|
290
|
+
* @api public
|
291
|
+
*/
|
292
|
+
|
293
|
+
List.prototype.at = function(i){
|
294
|
+
return new List([this.els[i]], this.selector);
|
295
|
+
};
|
296
|
+
|
297
|
+
/**
|
298
|
+
* Return a `List` containing the first element.
|
299
|
+
*
|
300
|
+
* @param {Number} i
|
301
|
+
* @return {List}
|
302
|
+
* @api public
|
303
|
+
*/
|
304
|
+
|
305
|
+
List.prototype.first = function(){
|
306
|
+
return new List([this.els[0]], this.selector);
|
307
|
+
};
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Return a `List` containing the last element.
|
311
|
+
*
|
312
|
+
* @param {Number} i
|
313
|
+
* @return {List}
|
314
|
+
* @api public
|
315
|
+
*/
|
316
|
+
|
317
|
+
List.prototype.last = function(){
|
318
|
+
return new List([this.els[this.els.length - 1]], this.selector);
|
319
|
+
};
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Return an `Element` at `i`.
|
323
|
+
*
|
324
|
+
* @param {Number} i
|
325
|
+
* @return {Element}
|
326
|
+
* @api public
|
327
|
+
*/
|
328
|
+
|
329
|
+
List.prototype.get = function(i){
|
330
|
+
return this.els[i || 0];
|
331
|
+
};
|
332
|
+
|
333
|
+
/**
|
334
|
+
* Return list length.
|
335
|
+
*
|
336
|
+
* @return {Number}
|
337
|
+
* @api public
|
338
|
+
*/
|
339
|
+
|
340
|
+
List.prototype.length = function(){
|
341
|
+
return this.els.length;
|
342
|
+
};
|
343
|
+
|
344
|
+
/**
|
345
|
+
* Return element text.
|
346
|
+
*
|
347
|
+
* @param {String} str
|
348
|
+
* @return {String|List}
|
349
|
+
* @api public
|
350
|
+
*/
|
351
|
+
|
352
|
+
List.prototype.text = function(str){
|
353
|
+
// TODO: real impl
|
354
|
+
if (1 == arguments.length) {
|
355
|
+
this.forEach(function(el){
|
356
|
+
el.textContent = str;
|
357
|
+
});
|
358
|
+
return this;
|
359
|
+
}
|
360
|
+
|
361
|
+
var str = '';
|
362
|
+
for (var i = 0; i < this.els.length; ++i) {
|
363
|
+
str += this.els[i].textContent;
|
364
|
+
}
|
365
|
+
return str;
|
366
|
+
};
|
367
|
+
|
368
|
+
/**
|
369
|
+
* Return element html.
|
370
|
+
*
|
371
|
+
* @return {String} html
|
372
|
+
* @api public
|
373
|
+
*/
|
374
|
+
|
375
|
+
List.prototype.html = function(html){
|
376
|
+
if (1 == arguments.length) {
|
377
|
+
this.forEach(function(el){
|
378
|
+
el.innerHTML = html;
|
379
|
+
});
|
380
|
+
}
|
381
|
+
// TODO: real impl
|
382
|
+
return this.els[0] && this.els[0].innerHTML;
|
383
|
+
};
|
384
|
+
|
385
|
+
/**
|
386
|
+
* Bind to `event` and invoke `fn(e)`. When
|
387
|
+
* a `selector` is given then events are delegated.
|
388
|
+
*
|
389
|
+
* @param {String} event
|
390
|
+
* @param {String} [selector]
|
391
|
+
* @param {Function} fn
|
392
|
+
* @param {Boolean} capture
|
393
|
+
* @return {List}
|
394
|
+
* @api public
|
395
|
+
*/
|
396
|
+
|
397
|
+
List.prototype.on = function(event, selector, fn, capture){
|
398
|
+
if ('string' == typeof selector) {
|
399
|
+
for (var i = 0; i < this.els.length; ++i) {
|
400
|
+
fn._delegate = delegate.bind(this.els[i], selector, event, fn, capture);
|
401
|
+
}
|
402
|
+
return this;
|
403
|
+
}
|
404
|
+
|
405
|
+
capture = fn;
|
406
|
+
fn = selector;
|
407
|
+
|
408
|
+
for (var i = 0; i < this.els.length; ++i) {
|
409
|
+
events.bind(this.els[i], event, fn, capture);
|
410
|
+
}
|
411
|
+
|
412
|
+
return this;
|
413
|
+
};
|
414
|
+
|
415
|
+
/**
|
416
|
+
* Unbind to `event` and invoke `fn(e)`. When
|
417
|
+
* a `selector` is given then delegated event
|
418
|
+
* handlers are unbound.
|
419
|
+
*
|
420
|
+
* @param {String} event
|
421
|
+
* @param {String} [selector]
|
422
|
+
* @param {Function} fn
|
423
|
+
* @param {Boolean} capture
|
424
|
+
* @return {List}
|
425
|
+
* @api public
|
426
|
+
*/
|
427
|
+
|
428
|
+
List.prototype.off = function(event, selector, fn, capture){
|
429
|
+
if ('string' == typeof selector) {
|
430
|
+
for (var i = 0; i < this.els.length; ++i) {
|
431
|
+
// TODO: add selector support back
|
432
|
+
delegate.unbind(this.els[i], event, fn._delegate, capture);
|
433
|
+
}
|
434
|
+
return this;
|
435
|
+
}
|
436
|
+
|
437
|
+
capture = fn;
|
438
|
+
fn = selector;
|
439
|
+
|
440
|
+
for (var i = 0; i < this.els.length; ++i) {
|
441
|
+
events.unbind(this.els[i], event, fn, capture);
|
442
|
+
}
|
443
|
+
return this;
|
444
|
+
};
|
445
|
+
|
446
|
+
/**
|
447
|
+
* Iterate elements and invoke `fn(list, i)`.
|
448
|
+
*
|
449
|
+
* @param {Function} fn
|
450
|
+
* @return {List} self
|
451
|
+
* @api public
|
452
|
+
*/
|
453
|
+
|
454
|
+
List.prototype.each = function(fn){
|
455
|
+
for (var i = 0; i < this.els.length; ++i) {
|
456
|
+
fn(new List([this.els[i]], this.selector), i);
|
457
|
+
}
|
458
|
+
return this;
|
459
|
+
};
|
460
|
+
|
461
|
+
/**
|
462
|
+
* Iterate elements and invoke `fn(el, i)`.
|
463
|
+
*
|
464
|
+
* @param {Function} fn
|
465
|
+
* @return {List} self
|
466
|
+
* @api public
|
467
|
+
*/
|
468
|
+
|
469
|
+
List.prototype.forEach = function(fn){
|
470
|
+
for (var i = 0; i < this.els.length; ++i) {
|
471
|
+
fn(this.els[i], i);
|
472
|
+
}
|
473
|
+
return this;
|
474
|
+
};
|
475
|
+
|
476
|
+
/**
|
477
|
+
* Map elements invoking `fn(list, i)`.
|
478
|
+
*
|
479
|
+
* @param {Function} fn
|
480
|
+
* @return {Array}
|
481
|
+
* @api public
|
482
|
+
*/
|
483
|
+
|
484
|
+
List.prototype.map = function(fn){
|
485
|
+
var arr = [];
|
486
|
+
for (var i = 0; i < this.els.length; ++i) {
|
487
|
+
arr.push(fn(new List([this.els[i]], this.selector), i));
|
488
|
+
}
|
489
|
+
return arr;
|
490
|
+
};
|
491
|
+
|
492
|
+
/**
|
493
|
+
* Filter elements invoking `fn(list, i)`, returning
|
494
|
+
* a new `List` of elements when a truthy value is returned.
|
495
|
+
*
|
496
|
+
* @param {Function} fn
|
497
|
+
* @return {List}
|
498
|
+
* @api public
|
499
|
+
*/
|
500
|
+
|
501
|
+
List.prototype.select =
|
502
|
+
List.prototype.filter = function(fn){
|
503
|
+
var el;
|
504
|
+
var list = new List([], this.selector);
|
505
|
+
for (var i = 0; i < this.els.length; ++i) {
|
506
|
+
el = this.els[i];
|
507
|
+
if (fn(new List([el], this.selector), i)) list.els.push(el);
|
508
|
+
}
|
509
|
+
return list;
|
510
|
+
};
|
511
|
+
|
512
|
+
/**
|
513
|
+
* Filter elements invoking `fn(list, i)`, returning
|
514
|
+
* a new `List` of elements when a falsey value is returned.
|
515
|
+
*
|
516
|
+
* @param {Function} fn
|
517
|
+
* @return {List}
|
518
|
+
* @api public
|
519
|
+
*/
|
520
|
+
|
521
|
+
List.prototype.reject = function(fn){
|
522
|
+
var el;
|
523
|
+
var list = new List([], this.selector);
|
524
|
+
for (var i = 0; i < this.els.length; ++i) {
|
525
|
+
el = this.els[i];
|
526
|
+
if (!fn(new List([el], this.selector), i)) list.els.push(el);
|
527
|
+
}
|
528
|
+
return list;
|
529
|
+
};
|
530
|
+
|
531
|
+
/**
|
532
|
+
* Add the given class `name`.
|
533
|
+
*
|
534
|
+
* @param {String} name
|
535
|
+
* @return {List} self
|
536
|
+
* @api public
|
537
|
+
*/
|
538
|
+
|
539
|
+
List.prototype.addClass = function(name){
|
540
|
+
var el;
|
541
|
+
for (var i = 0; i < this.els.length; ++i) {
|
542
|
+
el = this.els[i];
|
543
|
+
el._classes = el._classes || classes(el);
|
544
|
+
el._classes.add(name);
|
545
|
+
}
|
546
|
+
return this;
|
547
|
+
};
|
548
|
+
|
549
|
+
/**
|
550
|
+
* Remove the given class `name`.
|
551
|
+
*
|
552
|
+
* @param {String|RegExp} name
|
553
|
+
* @return {List} self
|
554
|
+
* @api public
|
555
|
+
*/
|
556
|
+
|
557
|
+
List.prototype.removeClass = function(name){
|
558
|
+
var el;
|
559
|
+
|
560
|
+
if ('regexp' == type(name)) {
|
561
|
+
for (var i = 0; i < this.els.length; ++i) {
|
562
|
+
el = this.els[i];
|
563
|
+
el._classes = el._classes || classes(el);
|
564
|
+
var arr = el._classes.array();
|
565
|
+
for (var j = 0; j < arr.length; j++) {
|
566
|
+
if (name.test(arr[j])) {
|
567
|
+
el._classes.remove(arr[j]);
|
568
|
+
}
|
569
|
+
}
|
570
|
+
}
|
571
|
+
return this;
|
572
|
+
}
|
573
|
+
|
574
|
+
for (var i = 0; i < this.els.length; ++i) {
|
575
|
+
el = this.els[i];
|
576
|
+
el._classes = el._classes || classes(el);
|
577
|
+
el._classes.remove(name);
|
578
|
+
}
|
579
|
+
|
580
|
+
return this;
|
581
|
+
};
|
582
|
+
|
583
|
+
/**
|
584
|
+
* Toggle the given class `name`,
|
585
|
+
* optionally a `bool` may be given
|
586
|
+
* to indicate that the class should
|
587
|
+
* be added when truthy.
|
588
|
+
*
|
589
|
+
* @param {String} name
|
590
|
+
* @param {Boolean} bool
|
591
|
+
* @return {List} self
|
592
|
+
* @api public
|
593
|
+
*/
|
594
|
+
|
595
|
+
List.prototype.toggleClass = function(name, bool){
|
596
|
+
var el;
|
597
|
+
var fn = 'toggle';
|
598
|
+
|
599
|
+
// toggle with boolean
|
600
|
+
if (2 == arguments.length) {
|
601
|
+
fn = bool ? 'add' : 'remove';
|
602
|
+
}
|
603
|
+
|
604
|
+
for (var i = 0; i < this.els.length; ++i) {
|
605
|
+
el = this.els[i];
|
606
|
+
el._classes = el._classes || classes(el);
|
607
|
+
el._classes[fn](name);
|
608
|
+
}
|
609
|
+
|
610
|
+
return this;
|
611
|
+
};
|
612
|
+
|
613
|
+
/**
|
614
|
+
* Check if the given class `name` is present.
|
615
|
+
*
|
616
|
+
* @param {String} name
|
617
|
+
* @return {Boolean}
|
618
|
+
* @api public
|
619
|
+
*/
|
620
|
+
|
621
|
+
List.prototype.hasClass = function(name){
|
622
|
+
var el;
|
623
|
+
for (var i = 0; i < this.els.length; ++i) {
|
624
|
+
el = this.els[i];
|
625
|
+
el._classes = el._classes || classes(el);
|
626
|
+
if (el._classes.has(name)) return true;
|
627
|
+
}
|
628
|
+
return false;
|
629
|
+
};
|
630
|
+
|
631
|
+
/**
|
632
|
+
* Set CSS `prop` to `val` or get `prop` value.
|
633
|
+
* Also accepts an object (`prop`: `val`)
|
634
|
+
*
|
635
|
+
* @param {String} prop
|
636
|
+
* @param {Mixed} val
|
637
|
+
* @return {List|String}
|
638
|
+
* @api public
|
639
|
+
*/
|
640
|
+
|
641
|
+
List.prototype.css = function(prop, val){
|
642
|
+
if (2 == arguments.length) {
|
643
|
+
var obj = {};
|
644
|
+
obj[prop] = val;
|
645
|
+
return this.setStyle(obj);
|
646
|
+
}
|
647
|
+
|
648
|
+
if ('object' == type(prop)) {
|
649
|
+
return this.setStyle(prop);
|
650
|
+
}
|
651
|
+
|
652
|
+
return this.getStyle(prop);
|
653
|
+
};
|
654
|
+
|
655
|
+
/**
|
656
|
+
* Set CSS `props`.
|
657
|
+
*
|
658
|
+
* @param {Object} props
|
659
|
+
* @return {List} self
|
660
|
+
* @api private
|
661
|
+
*/
|
662
|
+
|
663
|
+
List.prototype.setStyle = function(props){
|
664
|
+
for (var i = 0; i < this.els.length; ++i) {
|
665
|
+
css(this.els[i], props);
|
666
|
+
}
|
667
|
+
return this;
|
668
|
+
};
|
669
|
+
|
670
|
+
/**
|
671
|
+
* Get CSS `prop` value.
|
672
|
+
*
|
673
|
+
* @param {String} prop
|
674
|
+
* @return {String}
|
675
|
+
* @api private
|
676
|
+
*/
|
677
|
+
|
678
|
+
List.prototype.getStyle = function(prop){
|
679
|
+
var el = this.els[0];
|
680
|
+
if (el) return el.style[prop];
|
681
|
+
};
|
682
|
+
|
683
|
+
/**
|
684
|
+
* Find children matching the given `selector`.
|
685
|
+
*
|
686
|
+
* @param {String} selector
|
687
|
+
* @return {List}
|
688
|
+
* @api public
|
689
|
+
*/
|
690
|
+
|
691
|
+
List.prototype.find = function(selector){
|
692
|
+
return dom(selector, this);
|
693
|
+
};
|
694
|
+
|
695
|
+
/**
|
696
|
+
* Empty the dom list
|
697
|
+
*
|
698
|
+
* @return self
|
699
|
+
* @api public
|
700
|
+
*/
|
701
|
+
|
702
|
+
List.prototype.empty = function(){
|
703
|
+
var elem, el;
|
704
|
+
|
705
|
+
for (var i = 0; i < this.els.length; ++i) {
|
706
|
+
el = this.els[i];
|
707
|
+
while (el.firstChild) {
|
708
|
+
el.removeChild(el.firstChild);
|
709
|
+
}
|
710
|
+
}
|
711
|
+
|
712
|
+
return this;
|
713
|
+
}
|
714
|
+
|
715
|
+
/**
|
716
|
+
* Attribute accessors.
|
717
|
+
*/
|
718
|
+
|
719
|
+
attrs.forEach(function(name){
|
720
|
+
List.prototype[name] = function(val){
|
721
|
+
if (0 == arguments.length) return this.attr(name);
|
722
|
+
return this.attr(name, val);
|
723
|
+
};
|
724
|
+
});
|
725
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "domify",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "turn HTML into DOM elements",
|
5
|
+
"scripts": [
|
6
|
+
"index.js"
|
7
|
+
],
|
8
|
+
"development": {
|
9
|
+
"component/assert": "*",
|
10
|
+
"visionmedia/mocha": "*",
|
11
|
+
"visionmedia/mocha-cloud": "*"
|
12
|
+
},
|
13
|
+
"keywords": [
|
14
|
+
"dom",
|
15
|
+
"html",
|
16
|
+
"client",
|
17
|
+
"browser",
|
18
|
+
"component"
|
19
|
+
],
|
20
|
+
"license": "MIT",
|
21
|
+
"repo": "https://raw.github.com/component/domify"
|
22
|
+
}
|