ende 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/build/build.css +112 -0
  5. data/build/build.js +36465 -0
  6. data/component.json +11 -15
  7. data/components/chaijs/assertion-error/1.0.0/component.json +18 -0
  8. data/components/chaijs/chai/1.9.1/.gitignore +22 -0
  9. data/components/chaijs/chai/1.9.1/.mailmap +1 -0
  10. data/components/chaijs/chai/1.9.1/.npmignore +14 -0
  11. data/components/chaijs/chai/1.9.1/.travis.yml +14 -0
  12. data/components/chaijs/chai/1.9.1/CONTRIBUTING.md +173 -0
  13. data/components/chaijs/chai/1.9.1/History.md +895 -0
  14. data/components/chaijs/chai/1.9.1/Makefile +93 -0
  15. data/components/chaijs/chai/1.9.1/README.md +99 -0
  16. data/components/chaijs/chai/1.9.1/ReleaseNotes.md +482 -0
  17. data/components/chaijs/chai/1.9.1/bower.json +27 -0
  18. data/components/chaijs/chai/1.9.1/chai.js +4782 -0
  19. data/components/chaijs/chai/1.9.1/component.json +50 -0
  20. data/components/chaijs/chai/1.9.1/karma.conf.js +28 -0
  21. data/components/chaijs/chai/1.9.1/karma.sauce.js +41 -0
  22. data/components/chaijs/chai/1.9.1/lib/chai/assertion.js +130 -0
  23. data/components/chaijs/chai/1.9.1/lib/chai/config.js +50 -0
  24. data/components/chaijs/chai/1.9.1/lib/chai/core/assertions.js +1314 -0
  25. data/components/chaijs/chai/1.9.1/lib/chai/interface/assert.js +1056 -0
  26. data/components/chaijs/chai/1.9.1/lib/chai/interface/expect.js +12 -0
  27. data/components/chaijs/chai/1.9.1/lib/chai/interface/should.js +78 -0
  28. data/components/chaijs/chai/1.9.1/lib/chai/utils/addChainableMethod.js +111 -0
  29. data/components/chaijs/chai/1.9.1/lib/chai/utils/addMethod.js +43 -0
  30. data/components/chaijs/chai/1.9.1/lib/chai/utils/addProperty.js +40 -0
  31. data/components/chaijs/chai/1.9.1/lib/chai/utils/flag.js +32 -0
  32. data/components/chaijs/chai/1.9.1/lib/chai/utils/getActual.js +18 -0
  33. data/components/chaijs/chai/1.9.1/lib/chai/utils/getEnumerableProperties.js +25 -0
  34. data/components/chaijs/chai/1.9.1/lib/chai/utils/getMessage.js +49 -0
  35. data/components/chaijs/chai/1.9.1/lib/chai/utils/getName.js +20 -0
  36. data/components/chaijs/chai/1.9.1/lib/chai/utils/getPathValue.js +102 -0
  37. data/components/chaijs/chai/1.9.1/lib/chai/utils/getProperties.js +35 -0
  38. data/components/chaijs/chai/1.9.1/lib/chai/utils/index.js +114 -0
  39. data/components/chaijs/chai/1.9.1/lib/chai/utils/objDisplay.js +49 -0
  40. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteChainableMethod.js +53 -0
  41. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteMethod.js +51 -0
  42. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteProperty.js +54 -0
  43. data/components/chaijs/chai/1.9.1/lib/chai/utils/test.js +26 -0
  44. data/components/chaijs/chai/1.9.1/lib/chai/utils/transferFlags.js +44 -0
  45. data/components/chaijs/chai/1.9.1/lib/chai/utils/type.js +45 -0
  46. data/components/chaijs/chai/1.9.1/lib/chai.js +87 -0
  47. data/components/chaijs/chai/1.9.1/package.json +42 -0
  48. data/components/chaijs/chai/1.9.1/sauce.browsers.js +128 -0
  49. data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_block.sh +7 -0
  50. data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_setup.sh +53 -0
  51. data/components/chaijs/chai/1.9.1/test/assert.js +638 -0
  52. data/components/chaijs/chai/1.9.1/test/bootstrap/index.js +22 -0
  53. data/components/chaijs/chai/1.9.1/test/bootstrap/karma.js +22 -0
  54. data/components/chaijs/chai/1.9.1/test/configuration.js +133 -0
  55. data/components/chaijs/chai/1.9.1/test/display/errors.js +14 -0
  56. data/components/chaijs/chai/1.9.1/test/display/message.js +47 -0
  57. data/components/chaijs/chai/1.9.1/test/expect.js +814 -0
  58. data/components/chaijs/chai/1.9.1/test/globalShould.js +15 -0
  59. data/components/chaijs/chai/1.9.1/test/plugins.js +24 -0
  60. data/components/chaijs/chai/1.9.1/test/should.js +744 -0
  61. data/components/chaijs/chai/1.9.1/test/utilities.js +309 -0
  62. data/components/chaijs/deep-eql/0.1.3/component.json +20 -0
  63. data/components/chaijs/deep-eql/0.1.3/lib/eql.js +257 -0
  64. data/components/chaijs/type-detect/0.1.1/component.json +18 -0
  65. data/components/chaijs/type-detect/0.1.1/lib/type.js +142 -0
  66. data/{vendor/components/indefinido-indemma/components/component-bind → components/component/bind/0.0.1}/component.json +1 -1
  67. data/{vendor/components/component-classes → components/component/classes/1.1.2}/component.json +1 -1
  68. data/components/component/classes/1.2.1/component.json +19 -0
  69. data/components/component/classes/1.2.1/index.js +184 -0
  70. data/{vendor/components/component-css → components/component/css/0.0.2}/component.json +2 -2
  71. data/{vendor/components/component-delegate → components/component/delegate/0.1.0}/component.json +2 -2
  72. data/components/component/dialog/0.2.0/component.json +35 -0
  73. data/{vendor/components/component-dialog → components/component/dialog/0.2.0}/index.js +74 -40
  74. data/components/component/dialog/0.2.0/template.html +9 -0
  75. data/{vendor/components/component-dom → components/component/dom/0.7.1}/component.json +6 -4
  76. data/{vendor/components/component-domify → components/component/domify/1.0.0}/component.json +6 -4
  77. data/components/component/domify/1.2.2/component.json +22 -0
  78. data/components/component/domify/1.2.2/index.js +87 -0
  79. data/{vendor/components/component-emitter → components/component/emitter/1.0.0}/component.json +1 -1
  80. data/{vendor/components/component-event → components/component/event/0.1.0}/component.json +3 -3
  81. data/components/component/event/0.1.0/index.js +40 -0
  82. data/components/component/event/0.1.3/component.json +13 -0
  83. data/{vendor/components/component-event → components/component/event/0.1.3}/index.js +3 -5
  84. data/{vendor/components/component-indexof → components/component/indexof/0.0.1}/component.json +1 -1
  85. data/{vendor/components/indefinido-indemma/components/component-jquery → components/component/jquery/1.9.1}/component.json +1 -1
  86. data/{vendor/components/component-matches-selector → components/component/matches-selector/0.1.2}/component.json +6 -4
  87. data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/component.json +1 -1
  88. data/{vendor/components/component-query → components/component/query/0.0.1}/component.json +6 -4
  89. data/components/component/query/0.0.3/component.json +23 -0
  90. data/components/component/query/0.0.3/index.js +21 -0
  91. data/{vendor/components/component-querystring → components/component/querystring/1.3.0}/component.json +4 -3
  92. data/{vendor/components/component-querystring → components/component/querystring/1.3.0}/index.js +26 -2
  93. data/{vendor/components/component-sort → components/component/sort/0.0.3}/component.json +2 -2
  94. data/{vendor/components/component-trim → components/component/trim/0.0.1}/component.json +1 -1
  95. data/{vendor/components/indefinido-indemma/components/component-type → components/component/type/1.0.0}/component.json +4 -2
  96. data/{vendor/components/component-value → components/component/value/1.1.0}/component.json +6 -4
  97. data/{vendor/components/components-modernizr → components/components/modernizr/2.6.2}/component.json +2 -3
  98. data/{vendor/components/indefinido-indemma/components/indefinido-advisable → components/indefinido/advisable/master}/component.json +2 -2
  99. data/components/indefinido/indemma/master/History.md +0 -0
  100. data/components/indefinido/indemma/master/build/build.js +26288 -0
  101. data/components/indefinido/indemma/master/build/development.js +22200 -0
  102. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/build/release.js +264 -273
  103. data/components/indefinido/indemma/master/build/test.js +22200 -0
  104. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/component.json +6 -6
  105. data/components/indefinido/indemma/master/components/chaijs-assertion-error/index.js +110 -0
  106. data/components/indefinido/indemma/master/components/chaijs-chai/index.js +1 -0
  107. data/components/indefinido/indemma/master/components/chaijs-chai/lib/chai/utils/inspect.js +320 -0
  108. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/associable.js +2 -14
  109. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/rest.js +2 -7
  110. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/restfulable.js +9 -33
  111. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/scopable.js +45 -16
  112. data/components/indefinido/indemma/master/lib/record/validatable.js +1100 -0
  113. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/associable_spec.js +2 -3
  114. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/scopable_spec.js +53 -83
  115. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/cpf_spec.js +6 -5
  116. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/associable.coffee +0 -6
  117. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/persistable.coffee +0 -2
  118. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/queryable.coffee +2 -1
  119. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/resource.coffee +2 -3
  120. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/rest.coffee +1 -7
  121. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/restfulable.coffee +8 -34
  122. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/scopable.coffee +31 -32
  123. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validatable.coffee +1 -12
  124. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/associable_spec.coffee +2 -3
  125. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/scopable_spec.coffee +43 -76
  126. data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/cpf_spec.coffee +4 -3
  127. data/{vendor/components/mikeric-rivets → components/mikeric/rivets/v0.5.12}/component.json +2 -2
  128. data/{vendor/components/paulmillr-es6-shim → components/paulmillr/es6-shim/0.10.1}/component.json +11 -4
  129. data/components/paulmillr/es6-shim/0.10.1/es6-shim.js +1833 -0
  130. data/{vendor/components/pluma-assimilate → components/pluma/assimilate/0.3.0}/component.json +3 -3
  131. data/{vendor/components/segmentio-extend → components/segmentio/extend/1.0.0}/component.json +3 -3
  132. data/lib/assets/javascripts/aura/extensions/models.js.coffee.erb +14 -14
  133. data/lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee +1 -1
  134. data/lib/assets/javascripts/aura/extensions/rivets.js.coffee +3 -3
  135. data/lib/assets/javascripts/aura/extensions/stamps/stampit.js +568 -242
  136. data/lib/assets/javascripts/aura/extensions/widget/#composable.js.coffee# +135 -0
  137. data/lib/assets/javascripts/aura/extensions/widget/composable.js.coffee +2 -2
  138. data/lib/assets/javascripts/config/load_components.js.coffee +10 -10
  139. data/lib/assets/javascripts/ende.js.coffee +21 -18
  140. data/lib/assets/javascripts/widgets/support/adapters/olark.js +1 -4
  141. data/lib/assets/javascripts/widgets/viewer/main.js.coffee +8 -4
  142. data/lib/assets/javascripts/widgets/viewer/plugins/scopable.js.coffee +6 -7
  143. data/lib/ende/version.rb +1 -1
  144. data/vendor/assets/components/build.css +4 -3
  145. data/vendor/assets/components/ende_build.js +29772 -21943
  146. metadata +284 -217
  147. data/vendor/components/KapIT-observe-utils/component.json +0 -16
  148. data/vendor/components/KapIT-observe-utils/lib/observe-utils.js +0 -780
  149. data/vendor/components/component-dialog/component.json +0 -23
  150. data/vendor/components/component-dialog/template.js +0 -1
  151. data/vendor/components/indefinido-indemma/build/development.js +0 -343
  152. data/vendor/components/indefinido-indemma/build/test.js +0 -343
  153. data/vendor/components/indefinido-indemma/lib/record/validatable.js +0 -224
  154. data/vendor/components/indefinido-observable/component.json +0 -24
  155. data/vendor/components/indefinido-observable/index.js +0 -1
  156. data/vendor/components/indefinido-observable/lib/adapters/rivets.js +0 -28
  157. data/vendor/components/indefinido-observable/lib/observable.js +0 -390
  158. data/vendor/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
  159. data/vendor/components/indefinido-observable/vendor/shims/accessors.js +0 -248
  160. data/vendor/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
  161. data/vendor/components/indefinido-observable/vendor/shims/object.create.js +0 -77
  162. data/vendor/components/paulmillr-es6-shim/es6-shim.js +0 -996
  163. /data/{vendor/components/indefinido-indemma/components/chaijs-assertion-error → components/chaijs/assertion-error/1.0.0}/index.js +0 -0
  164. /data/{vendor/components/indefinido-indemma/components/chaijs-chai → components/chaijs/chai/1.9.1}/index.js +0 -0
  165. /data/{vendor/components/indefinido-indemma/components/chaijs-chai → components/chaijs/chai/1.9.1}/lib/chai/utils/inspect.js +0 -0
  166. /data/{vendor/components/indefinido-indemma/History.md → components/chaijs/chai/1.9.1/test/auth/.gitkeep} +0 -0
  167. /data/{vendor/components/component-bind → components/component/bind/0.0.1}/index.js +0 -0
  168. /data/{vendor/components/component-classes → components/component/classes/1.1.2}/index.js +0 -0
  169. /data/{vendor/components/component-css → components/component/css/0.0.2}/index.js +0 -0
  170. /data/{vendor/components/component-delegate → components/component/delegate/0.1.0}/index.js +0 -0
  171. /data/{vendor/components/component-dialog → components/component/dialog/0.2.0}/dialog.css +0 -0
  172. /data/{vendor/components/component-dom → components/component/dom/0.7.1}/index.js +0 -0
  173. /data/{vendor/components/component-domify → components/component/domify/1.0.0}/index.js +0 -0
  174. /data/{vendor/components/component-emitter → components/component/emitter/1.0.0}/index.js +0 -0
  175. /data/{vendor/components/component-indexof → components/component/indexof/0.0.1}/index.js +0 -0
  176. /data/{vendor/components/component-jquery → components/component/jquery/1.9.1}/index.js +0 -0
  177. /data/{vendor/components/component-matches-selector → components/component/matches-selector/0.1.2}/index.js +0 -0
  178. /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/index.js +0 -0
  179. /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/overlay.css +0 -0
  180. /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/template.js +0 -0
  181. /data/{vendor/components/component-query → components/component/query/0.0.1}/index.js +0 -0
  182. /data/{vendor/components/component-sort → components/component/sort/0.0.3}/index.js +0 -0
  183. /data/{vendor/components/component-trim → components/component/trim/0.0.1}/index.js +0 -0
  184. /data/{vendor/components/component-type → components/component/type/1.0.0}/index.js +0 -0
  185. /data/{vendor/components/component-value → components/component/value/1.1.0}/index.js +0 -0
  186. /data/{vendor/components/components-modernizr → components/components/modernizr/2.6.2}/modernizr.js +0 -0
  187. /data/{vendor/components/indefinido-advisable → components/indefinido/advisable/master}/index.js +0 -0
  188. /data/{vendor/components/indefinido-advisable → components/indefinido/advisable/master}/lib/advisable.js +0 -0
  189. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.gitignore +0 -0
  190. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.ruby-gemset +0 -0
  191. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.ruby-version +0 -0
  192. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Gemfile +0 -0
  193. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Guardfile +0 -0
  194. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Readme.md +0 -0
  195. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-assertion-error/component.json +0 -0
  196. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/component.json +0 -0
  197. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/assertion.js +0 -0
  198. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/core/assertions.js +0 -0
  199. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/assert.js +0 -0
  200. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/expect.js +0 -0
  201. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/should.js +0 -0
  202. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -0
  203. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -0
  204. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -0
  205. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/eql.js +0 -0
  206. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/flag.js +0 -0
  207. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getActual.js +0 -0
  208. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -0
  209. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -0
  210. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getName.js +0 -0
  211. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -0
  212. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -0
  213. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/index.js +0 -0
  214. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -0
  215. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -0
  216. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -0
  217. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/test.js +0 -0
  218. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -0
  219. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/type.js +0 -0
  220. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai.js +0 -0
  221. /data/{vendor → components/indefinido/indemma/master}/components/component-bind/component.json +0 -0
  222. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-bind/index.js +0 -0
  223. /data/{vendor → components/indefinido/indemma/master}/components/component-jquery/component.json +0 -0
  224. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-jquery/index.js +0 -0
  225. /data/{vendor → components/indefinido/indemma/master}/components/component-type/component.json +0 -0
  226. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-type/index.js +0 -0
  227. /data/{vendor → components/indefinido/indemma/master}/components/indefinido-advisable/component.json +0 -0
  228. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-advisable/index.js +0 -0
  229. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-advisable/lib/advisable.js +0 -0
  230. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/component.json +0 -0
  231. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -0
  232. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/index.js +0 -0
  233. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/lib/adapters/rivets.js +0 -0
  234. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/lib/observable.js +0 -0
  235. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -0
  236. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/accessors.js +0 -0
  237. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -0
  238. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/object.create.js +0 -0
  239. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/kapit-observe-utils/component.json +0 -0
  240. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/paulmillr-es6-shim/component.json +0 -0
  241. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/paulmillr-es6-shim/es6-shim.js +0 -0
  242. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/pluma-assimilate/component.json +0 -0
  243. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/pluma-assimilate/dist/assimilate.js +0 -0
  244. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/index.js +0 -0
  245. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/karma.conf.js +0 -0
  246. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/extensions/rivets.js +0 -0
  247. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/errors.js +0 -0
  248. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/maid.js +0 -0
  249. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/persistable.js +0 -0
  250. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/queryable.js +0 -0
  251. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/resource.js +0 -0
  252. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/storable.js +0 -0
  253. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/translationable.js +0 -0
  254. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/associated.js +0 -0
  255. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/confirmation.js +0 -0
  256. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/cpf.js +0 -0
  257. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/presence.js +0 -0
  258. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/remote.js +0 -0
  259. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/type.js +0 -0
  260. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/validatorable.js +0 -0
  261. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record.js +0 -0
  262. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/package.json +0 -0
  263. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/persistable_spec.js +0 -0
  264. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/queryable_spec.js +0 -0
  265. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/resource_spec.js +0 -0
  266. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/rest_spec.js +0 -0
  267. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/restfulable_spec.js +0 -0
  268. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/storable_spec.js +0 -0
  269. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/translationable.js +0 -0
  270. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validatable_spec.js +0 -0
  271. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/associated_spec.js +0 -0
  272. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/confirmation_spec.js +0 -0
  273. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/presence_spec.js +0 -0
  274. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/remote_spec.js +0 -0
  275. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/type_spec.js +0 -0
  276. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record_spec.js +0 -0
  277. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/spec_helper.js +0 -0
  278. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/support/value_objects/phone.js +0 -0
  279. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/extensions/rivets.coffee +0 -0
  280. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/errors.coffee +0 -0
  281. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/maid.coffee +0 -0
  282. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/storable.coffee +0 -0
  283. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/translationable.coffee +0 -0
  284. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/associated.coffee +0 -0
  285. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/confirmation.coffee +0 -0
  286. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/cpf.coffee +0 -0
  287. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/presence.coffee +0 -0
  288. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/remote.coffee +0 -0
  289. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/type.coffee +0 -0
  290. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/validatorable.coffee +0 -0
  291. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record.coffee +0 -0
  292. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/persistable_spec.coffee +0 -0
  293. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/queryable_spec.coffee +0 -0
  294. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/resource_spec.coffee +0 -0
  295. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/rest_spec.coffee +0 -0
  296. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/restfulable_spec.coffee +0 -0
  297. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/storable_spec.coffee +0 -0
  298. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/translationable.coffee +0 -0
  299. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validatable_spec.coffee +0 -0
  300. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/associated_spec.coffee +0 -0
  301. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/confirmation_spec.coffee +0 -0
  302. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/presence_spec.coffee +0 -0
  303. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/remote_spec.coffee +0 -0
  304. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/type_spec.coffee +0 -0
  305. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record_spec.coffee +0 -0
  306. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/spec_helper.coffee +0 -0
  307. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/support/value_objects/phone.coffee +0 -0
  308. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/object/mixin.js +0 -0
  309. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/owl/pluralize.js +0 -0
  310. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/sinon.js +0 -0
  311. /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/stampit.js +0 -0
  312. /data/{vendor/components/mikeric-rivets → components/mikeric/rivets/v0.5.12}/dist/rivets.js +0 -0
  313. /data/{vendor/components/pluma-assimilate → components/pluma/assimilate/0.3.0}/dist/assimilate.js +0 -0
  314. /data/{vendor/components/segmentio-extend → components/segmentio/extend/1.0.0}/index.js +0 -0
@@ -1,780 +0,0 @@
1
- // Copyright 2012 Kap IT (http://www.kapit.fr/)
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the 'License');
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an 'AS IS' BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
- // Author : François de Campredon (http://francois.de-campredon.fr/),
15
-
16
- // ObjectUtils
17
- // ===========
18
-
19
- (function (global) {
20
- 'use strict';
21
-
22
- /**
23
- * @namespace
24
- */
25
- var ObserveUtils;
26
- if (typeof exports !== 'undefined') {
27
- ObserveUtils = exports;
28
- } else {
29
- ObserveUtils = global.ObserveUtils = {};
30
- }
31
-
32
- // Utilities
33
- // ---------
34
-
35
-
36
- // borrowing some array methods
37
- var slice = Function.call.bind(Array.prototype.slice),
38
- map = Function.call.bind(Array.prototype.map);
39
-
40
- // return true if the given property descriptor contains accessor
41
- function isAccessorDescriptor(desc) {
42
- if (typeof desc === 'undefined') {
43
- return false;
44
- }
45
- return ('get' in desc || 'set' in desc);
46
- }
47
-
48
-
49
-
50
- // getPropertyDescriptor shim
51
- // copied from [es6-shim](https://github.com/paulmillr/es6-shim)
52
- function getPropertyDescriptor(target, name) {
53
- var pd = Object.getOwnPropertyDescriptor(target, name),
54
- proto = Object.getPrototypeOf(target);
55
- while (typeof pd === 'undefined' && proto !== null) {
56
- pd = Object.getOwnPropertyDescriptor(proto, name);
57
- proto = Object.getPrototypeOf(proto);
58
- }
59
- return pd;
60
- }
61
-
62
-
63
-
64
- // egal shim
65
- // copied from [the ecmascript wiki](http://wiki.ecmascript.org/doku.php?id=harmony:egal)
66
- function sameValue(x, y) {
67
- if (x === y) {
68
- // 0 === -0, but they are not identical
69
- return x !== 0 || 1 / x === 1 / y;
70
- }
71
-
72
- // NaN !== NaN, but they are identical.
73
- // NaNs are the only non-reflexive value, i.e., if x !== x,
74
- // then x is a NaN.
75
- // isNaN is broken: it converts its argument to number, so
76
- // isNaN('foo') => true
77
- return x !== x && y !== y;
78
- }
79
-
80
- // cast a value as number, and test if the obtained result
81
- // is a positive finite integer, throw an error otherwise
82
- function isPositiveFiniteInteger(value, errorMessage) {
83
- value = Number(value);
84
- if (isNaN(value) || !isFinite(value) || value < 0 || value % 1 !== 0) {
85
- throw new RangeError(errorMessage.replace('$', value));
86
- }
87
- return value;
88
- }
89
-
90
- // defineObservableProperties Implementation
91
- // ------------------------------------------
92
-
93
- // Uid generation helper
94
- var uidCounter = 0;
95
-
96
- // Define a property on an object that will call the Notifier.notify method when updated
97
- function defineObservableProperty(target, property, originalValue) {
98
-
99
- //we store the value in an non-enumerable property with generated unique name
100
- var internalPropName = '_' + (uidCounter++) + property;
101
-
102
- Object.defineProperty(target, internalPropName, {
103
- value: originalValue,
104
- writable: true,
105
- enumerable: false,
106
- configurable: true
107
- });
108
-
109
- //then we create accessor method for our 'hidden' property,
110
- // that dispatch changesRecords when the value is updated
111
- Object.defineProperty(target, property, {
112
- get: function () {
113
- return this[internalPropName];
114
- },
115
- set: function (value) {
116
- if (!sameValue(value, this[internalPropName])) {
117
- var oldValue = this[internalPropName];
118
- Object.defineProperty(target, internalPropName, {
119
- value: value,
120
- writable: true,
121
- enumerable: false,
122
- configurable: true
123
- });
124
- var notifier = Object.getNotifier(this);
125
- notifier.notify({ type: 'updated', name: property, oldValue: oldValue });
126
- }
127
- },
128
- enumerable: true,
129
- configurable: true
130
- });
131
- }
132
-
133
-
134
- // call defineObservableProperty for each property name passed as 'rest argument'
135
-
136
- /**
137
- * Define observable properties on the given object an return it.
138
- *
139
- * @param {Object} target
140
- * @param {...string} properties
141
- * @returns {Object}
142
- */
143
- ObserveUtils.defineObservableProperties = function (target, properties) {
144
- if (Object(target) !== target) {
145
- throw new TypeError('target must be an Object, given ' + target);
146
- }
147
- properties = slice(arguments, 1);
148
- while (properties.length > 0) {
149
- var property = properties.shift(),
150
- descriptor = getPropertyDescriptor(target, property);
151
-
152
- if (!descriptor || !isAccessorDescriptor(descriptor)) {
153
- var originalValue = descriptor && descriptor.value;
154
- defineObservableProperty(target, property, originalValue);
155
- }
156
- }
157
- return target;
158
- };
159
-
160
-
161
-
162
- // List Implementation
163
- // ------------------------------------------
164
-
165
- /**
166
- *
167
- * @param length
168
- * @returns {*}
169
- * @constructor
170
- * @function
171
- */
172
- function List(length) {
173
- if (arguments.length === 0) {
174
- length = 0;
175
- }
176
-
177
- // in this case we create a list with a given length
178
- if (arguments.length <= 1 && typeof length === 'number') {
179
- if (this instanceof List) {
180
- this.length = length;
181
- }
182
- else {
183
- return new List(length);
184
- }
185
- }
186
- else {
187
- //here we create a list with initial values
188
- if (!(this instanceof List)) {
189
- return List.fromArray(slice(arguments));
190
- }
191
- else {
192
- for (var i = 0, l = arguments.length ; i < l ; i++) {
193
- this[i] = arguments[i];
194
- }
195
- this.length = arguments.length;
196
- }
197
- }
198
- }
199
-
200
- /**
201
- * Observe a list
202
- * @param {List} list
203
- * @param {function} observer
204
- */
205
- List.observe = function observe(list, observer) {
206
- Object.observe(list, observer, ['new', 'updated', 'deleted', 'splice']);
207
- };
208
-
209
-
210
- /**
211
- * Unobserve a list
212
- * @param {List} list
213
- * @param {function} observer
214
- */
215
- List.unobserve = function unobserve(list, observer) {
216
- Object.unobserve(list, observer);
217
- };
218
-
219
- /**
220
- * Create a list from a given array
221
- * @param array
222
- * @returns {List}
223
- */
224
- List.fromArray = function (array) {
225
- if (!Array.isArray(array)) {
226
- throw new Error();
227
- }
228
-
229
- var list = new List();
230
- for (var i = 0, l = array.length ; i < l ; i++) {
231
- list[i] = array[i];
232
- }
233
- list.length = array.length;
234
- return list;
235
- };
236
-
237
- Object.defineProperties(List.prototype, {
238
- /**
239
- * hidden value holder for the length property
240
- * @private
241
- */
242
- '_length' : {
243
- value : 0,
244
- enumerable: false,
245
- configurable: true,
246
- writable: true
247
- },
248
- /**
249
- * the length of the list
250
- * @property {number} length
251
- */
252
- 'length' : {
253
- get : function () {
254
- return this._length;
255
- },
256
- set : function (value) {
257
- value = isPositiveFiniteInteger(value, 'Invalid list length : $');
258
- var notifier = Object.getNotifier(this),
259
- oldValue = this._length,
260
- removed = [],
261
- self = this;
262
- if (value !== oldValue) {
263
- notifier.performChange('splice', function () {
264
- Object.defineProperty(self, '_length', {
265
- value : value,
266
- enumerable: false,
267
- configurable: true,
268
- writable: true
269
- });
270
-
271
- if (oldValue > value) {
272
- //delete values if the length have been decreased
273
- for (var i = value; i < oldValue; i++) {
274
- removed.push(self[i]);
275
- self.delete(i);
276
- }
277
- }
278
-
279
- notifier.notify({ type: 'updated', name: 'length', oldValue: oldValue });
280
- });
281
- }
282
- if (oldValue > value) {
283
- notifier.notify({
284
- type: 'splice',
285
- index : value,
286
- removed : removed,
287
- addedCount: 0
288
- });
289
- } else {
290
- notifier.notify({
291
- type: 'splice',
292
- index : oldValue,
293
- removed : removed,
294
- addedCount: value - oldValue
295
- });
296
- }
297
-
298
- },
299
- enumerable: true,
300
- configurable : true
301
- }
302
- });
303
-
304
- /**
305
- * Returns an Array copy of the list
306
- * @returns {Array}
307
- */
308
- List.prototype.toArray = function () {
309
- return slice(this);
310
- };
311
-
312
- /**
313
- * Returns an string representation of the list
314
- * @returns {string}
315
- */
316
- List.prototype.toString = function () {
317
- return this.toArray().toString();
318
- };
319
-
320
-
321
- /**
322
- * Returns an json representation of the list
323
- * @returns {string}
324
- */
325
- List.prototype.toJSON = function () {
326
- return JSON.stringify(this.toArray());
327
- };
328
-
329
- /**
330
- * set the givent value at the specified index.
331
- * @param {number} index
332
- * @param {*} value
333
- * @return {*}
334
- */
335
- List.prototype.set = function (index, value) {
336
- index = isPositiveFiniteInteger(index, 'Invalid index : $');
337
-
338
- var notifier = Object.getNotifier(this),
339
- len = this.length,
340
- self = this;
341
- if (index >= len) {
342
- notifier.performChange('splice', function () {
343
- self[index] = value;
344
- notifier.notify({ type: 'new', name: index});
345
- Object.defineProperty(self, '_length', {
346
- value : index + 1,
347
- enumerable: false,
348
- configurable: true,
349
- writable: true
350
- });
351
- notifier.notify({ type: 'updated', name: 'length', oldValue: len });
352
- });
353
-
354
- notifier.notify({
355
- type: 'splice',
356
- index : len,
357
- removed : [],
358
- addedCount: this.length - len
359
- });
360
- }
361
- else if (!sameValue(value, this[index])) {
362
- var oldValue = this[index];
363
- this[index] = value;
364
- notifier.notify({ type: 'updated', name: index, oldValue: oldValue });
365
- }
366
- return value;
367
- };
368
-
369
- /**
370
- * delete the value at the specified index.
371
- * @param {number} index
372
- * @return {boolean}
373
- */
374
- List.prototype.delete = function (index) {
375
- index = isPositiveFiniteInteger(index, 'Invalid index : $');
376
- if (this.hasOwnProperty(index)) {
377
- var oldValue = this[index];
378
- if (delete this[index]) {
379
- var notifier = Object.getNotifier(this);
380
- notifier.notify({ type: 'deleted', name: index, oldValue: oldValue });
381
- return true;
382
- }
383
- }
384
- return false;
385
- };
386
-
387
- /**
388
- * create a new list resulting of the concatenation of all the List and array
389
- * passed as parameter with the addition of other values passed as parameter
390
- * @param {...*} args
391
- * @return {List}
392
- */
393
- List.prototype.concat = function (args) {
394
- args = map(arguments, function (item) {
395
- return (item instanceof List) ? item.toArray() : item;
396
- });
397
- return List.fromArray(Array.prototype.concat.apply(this.toArray(), args));
398
- };
399
-
400
- /**
401
- * Joins all elements of a List into a string.
402
- * @param {string} [separator]
403
- * @return {string}
404
- */
405
- List.prototype.join = function (separator) {
406
- return this.toArray().join(separator);
407
- };
408
-
409
-
410
- /**
411
- * Removes the last element from a List and returns that element.
412
- * @return {*}
413
- */
414
- List.prototype.pop = function () {
415
- if (Object(this) !== this) {
416
- throw new TypeError('TODO');
417
- }
418
- var len = isPositiveFiniteInteger(this.length, 'TODO');
419
- if (len === 0) {
420
- return void(0);
421
- } else {
422
- var newLen = len - 1,
423
- element = this[newLen],
424
- notifier = Object.getNotifier(this),
425
- self = this;
426
- notifier.performChange('splice', function () {
427
- delete self[newLen];
428
- notifier.notify({ type: 'deleted', name: newLen, oldValue: element });
429
- Object.defineProperty(self, '_length', {
430
- value : newLen,
431
- enumerable: false,
432
- configurable: true,
433
- writable: true
434
- });
435
- notifier.notify({ type: 'updated', name: 'length', oldValue: len });
436
- });
437
-
438
- notifier.notify({
439
- type: 'splice',
440
- index : newLen,
441
- removed : [element],
442
- addedCount: 0
443
- });
444
-
445
- return element;
446
- }
447
- };
448
-
449
- /**
450
- * Mutates a List by appending the given elements and returning the new length of the array.
451
- * @param {...*} items
452
- * @return {number}
453
- */
454
- List.prototype.push = function () {
455
- if (arguments.length > 0) {
456
- var argumentsLength = arguments.length,
457
- elements = arguments,
458
- len = this.length,
459
- notifier = Object.getNotifier(this),
460
- self = this,
461
- i, index;
462
- notifier.performChange('splice', function () {
463
- for (i = 0; i < argumentsLength; i++) {
464
- index = len + i;
465
- // avoid the usage of the set function and manually
466
- // set the value and notify the changes to avoid the notification of
467
- // multiple length modification
468
- self[index] = elements[i];
469
- notifier.notify({
470
- type : 'new',
471
- name : index
472
- });
473
- }
474
- Object.defineProperty(self, '_length', {
475
- value : len + argumentsLength,
476
- enumerable: false,
477
- configurable: true,
478
- writable: true
479
- });
480
- notifier.notify({ type: 'updated', name: 'length', oldValue: len });
481
- });
482
-
483
- notifier.notify({
484
- type: 'splice',
485
- index : len,
486
- removed : [],
487
- addedCount: argumentsLength
488
- });
489
- }
490
- return this.length;
491
- };
492
-
493
- /**
494
- * Reverses a List in place. The first List element becomes the last and the last becomes the first.
495
- * @return {List}
496
- */
497
- List.prototype.reverse = function () {
498
- var copy = this.toArray(),
499
- arr = copy.slice().reverse(),
500
- notifier = Object.getNotifier(this),
501
- self = this;
502
-
503
- notifier.performChange('splice', function () {
504
- for (var i = 0, l = arr.length; i < l; i++) {
505
- self.set(i, arr[i]);
506
- }
507
- });
508
-
509
- notifier.notify({
510
- type: 'splice',
511
- index : 0,
512
- removed : copy,
513
- addedCount: this.length
514
- });
515
-
516
- return this;
517
- };
518
-
519
- /**
520
- * Removes the first element from a List and returns that element. This method changes the length of the List.
521
- * @return {*}
522
- */
523
- List.prototype.shift = function () {
524
- if (this.length === 0) {
525
- return void(0);
526
- }
527
- var arr = this.toArray(),
528
- element = arr.shift(),
529
- notifier = Object.getNotifier(this),
530
- self = this, len = this.length;
531
- notifier.performChange('splice', function () {
532
- for (var i = 0, l = arr.length; i < l; i++) {
533
- self.set(i, arr[i]);
534
- }
535
- self.delete(len - 1);
536
-
537
- Object.defineProperty(self, '_length', {
538
- value : len - 1,
539
- enumerable: false,
540
- configurable: true,
541
- writable: true
542
- });
543
- notifier.notify({ type: 'updated', name: 'length', oldValue: len });
544
- });
545
-
546
- notifier.notify({
547
- type: 'splice',
548
- index : 0,
549
- removed : [element],
550
- addedCount: 0
551
- });
552
-
553
- return element;
554
- };
555
-
556
- /**
557
- * Returns a shallow copy of a portion of an List.
558
- * @param {number} [start]
559
- * @param {number} [end]
560
- * @return {List}
561
- */
562
- List.prototype.slice = function (start, end) {
563
- return List.fromArray(this.toArray().slice(start, end));
564
- };
565
-
566
- /**
567
- * Sorts the elements of a List in place and returns the List.
568
- * @param {function} [compareFn]
569
- * @return {List}
570
- */
571
- List.prototype.sort = function (compareFn) {
572
- var copy = this.toArray(),
573
- arr = copy.slice().sort(compareFn),
574
- notifier = Object.getNotifier(this),
575
- self = this;
576
- notifier.performChange('splice', function () {
577
- for (var i = 0, l = arr.length; i < l; i++) {
578
- self.set(i, arr[i]);
579
- }
580
- });
581
-
582
- notifier.notify({
583
- type: 'splice',
584
- index : 0,
585
- removed : copy,
586
- addedCount: this.length
587
- });
588
- return this;
589
- };
590
-
591
- /**
592
- * Changes the content of a List, adding new elements while removing old elements.
593
- * @return {List}
594
- */
595
- List.prototype.splice = function () {
596
- var returnValue = [];
597
- if (arguments.length > 0) {
598
- var arr = this.toArray(),
599
- notifier = Object.getNotifier(this),
600
- len = this.length,
601
- self = this,
602
- i, l;
603
-
604
- returnValue = Array.prototype.splice.apply(arr, arguments);
605
- notifier.performChange('splice', function () {
606
- for (i = 0, l = arr.length; i < l; i++) {
607
- var oldValue = self[i];
608
- if (!sameValue(oldValue, arr[i])) {
609
- self[i] = arr[i];
610
- notifier.notify(
611
- i >= len ?
612
- {type : 'new', name : i}:
613
- {type : 'updated', name : i, oldValue : oldValue}
614
- );
615
- }
616
- }
617
- if (len !== arr.length) {
618
- if (len > arr.length) {
619
- //delete values if the length have been decreased
620
- for (i = arr.length; i < len; i++) {
621
- self.delete(i);
622
- }
623
- }
624
- Object.defineProperty(self, '_length', {
625
- value : arr.length,
626
- enumerable: false,
627
- configurable: true,
628
- writable: true
629
- });
630
- notifier.notify({ type: 'updated', name: 'length', oldValue: len });
631
- }
632
-
633
- });
634
-
635
- if (returnValue.length > 0 || arguments.length > 2) {
636
- notifier.notify({
637
- type: 'splice',
638
- index : arguments[0],
639
- removed : returnValue,
640
- addedCount: arguments.length - 2
641
- });
642
- }
643
- }
644
- return List.fromArray(returnValue);
645
- };
646
-
647
- /**
648
- * Adds one or more elements to the beginning of a List and returns the new length of the List.
649
- * @return {number}
650
- */
651
- List.prototype.unshift = function () {
652
- if (arguments.length > 0) {
653
- var arr = this.toArray(),
654
- notifier = Object.getNotifier(this),
655
- len = this.length,
656
- self = this;
657
-
658
- Array.prototype.unshift.apply(arr, arguments);
659
- notifier.performChange('splice', function () {
660
- for (var i = 0, l = arr.length; i < l; i++) {
661
- var oldValue = self[i];
662
- if (!sameValue(oldValue, arr[i])) {
663
- // avoid the usage of the set function and manually
664
- // set the value and notify the changes to avoid the notification of
665
- // multiple length modification
666
- self[i] = arr[i];
667
- notifier.notify(
668
- i >= len ?
669
- {type : 'new', name : i}:
670
- {type : 'updated', name : i, oldValue : oldValue}
671
- );
672
- }
673
- }
674
-
675
- if (len !== arr.length) {
676
- if (len > arr.length) {
677
- //delete values if the length have been decreased
678
- for (i = arr.length; i < len; i++) {
679
- self.delete(i);
680
- }
681
- }
682
- Object.defineProperty(self, '_length', {
683
- value : arr.length,
684
- enumerable: false,
685
- configurable: true,
686
- writable: true
687
- });
688
- notifier.notify({ type: 'updated', name: 'length', oldValue: len });
689
- }
690
- });
691
-
692
- notifier.notify({
693
- type: 'splice',
694
- index : 0,
695
- removed : [],
696
- addedCount: arguments.length
697
- });
698
- }
699
- return this.length;
700
- };
701
-
702
- /**
703
- * Apply a function against an accumulator and each value of the List (from left-to-right) as to reduce it to a single value.
704
- * @param {function} callback
705
- * @param {Object} [initialValue]
706
- * @return {Object}
707
- */
708
- List.prototype.reduce = Array.prototype.reduce;
709
-
710
- /**
711
- * Apply a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value.
712
- * @param {function} callback
713
- * @param {Object} [initialValue]
714
- * @return {Object}
715
- */
716
- List.prototype.reduceRight = Array.prototype.reduceRight;
717
-
718
- /**
719
- * Returns the first index at which a given element can be found in the List, or -1 if it is not present.
720
- * @param {Object} searchElement
721
- * @param {number} [fromIndex]
722
- * @return {number}
723
- */
724
- List.prototype.indexOf = Array.prototype.indexOf;
725
-
726
- /**
727
- * Returns the last index at which a given element can be found in the List, or -1 if it is not present. The List is searched backwards, starting at fromIndex.
728
- * @param {Object} searchElement
729
- * @param {number} [fromIndex]
730
- * @return {number}
731
- */
732
- List.prototype.lastIndexOf = Array.prototype.lastIndexOf;
733
-
734
- /**
735
- * Tests whether all elements in the List pass the test implemented by the provided function.
736
- * @param {function} callback
737
- * @param {Object} [thisObject]
738
- * @return {boolean}
739
- */
740
- List.prototype.every = Array.prototype.every;
741
-
742
- /**
743
- * Creates a new List with all elements that pass the test implemented by the provided function
744
- * @param {function} callback
745
- * @param {Object} [thisObject]
746
- * @return {List}
747
- */
748
- List.prototype.filter = function (callback, thisObject) {
749
- return List.fromArray(this.toArray().filter(callback, thisObject));
750
- };
751
-
752
- /**
753
- * Executes a provided function once per List element.
754
- * @param {function} callback
755
- * @param {Object} [thisObject]
756
- * @return {void}
757
- */
758
- List.prototype.forEach = Array.prototype.forEach;
759
-
760
- /**
761
- * Creates a new List with the results of calling a provided function on every element in this List.
762
- * @param {function} callback
763
- * @param {Object} [thisObject]
764
- * @return {List}
765
- */
766
- List.prototype.map = function (callback, thisObject) {
767
- return List.fromArray(this.toArray().map(callback, thisObject));
768
- };
769
-
770
- /**
771
- * Tests whether some element in the List passes the test implemented by the provided function.
772
- * @param {function} callback
773
- * @param {Object} [thisObject]
774
- * @return {boolean}
775
- */
776
- List.prototype.some = Array.prototype.some;
777
-
778
- ObserveUtils.List = List;
779
-
780
- })(this);