ende 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (299) hide show
  1. checksums.yaml +4 -4
  2. data/component.json +2 -1
  3. data/lib/assets/javascripts/aura/extensions/devise.js.coffee +3 -2
  4. data/lib/assets/javascripts/aura/extensions/models.js.coffee.erb +1 -2
  5. data/lib/assets/javascripts/aura/extensions/widget/lifecycleable.js.coffee +37 -16
  6. data/lib/assets/javascripts/ende.js.coffee +1 -1
  7. data/lib/assets/javascripts/widgets/dialog/main.js.coffee +100 -0
  8. data/lib/assets/javascripts/widgets/dialog/presenter.js.coffee +18 -0
  9. data/lib/assets/javascripts/widgets/dialog/states/default.html +2 -0
  10. data/lib/assets/javascripts/widgets/dialog/states/index.js.coffee +2 -0
  11. data/lib/assets/javascripts/widgets/list/main.js.coffee +1 -0
  12. data/lib/assets/stylesheets/ende.styl +1 -0
  13. data/lib/ende/version.rb +1 -1
  14. data/lib/ende.rb +6 -2
  15. data/vendor/assets/components/build.css +111 -0
  16. data/vendor/{components/indefinido-indemma/build/release.js → assets/components/build.js} +25468 -17590
  17. data/vendor/assets/components/ende_build.css +111 -0
  18. data/vendor/assets/components/ende_build.js +29571 -0
  19. data/vendor/assets/javascripts/ende/build.js +1962 -0
  20. data/vendor/components/component-classes/component.json +19 -0
  21. data/vendor/components/component-classes/index.js +165 -0
  22. data/vendor/components/component-css/component.json +18 -0
  23. data/vendor/components/component-css/index.js +34 -0
  24. data/vendor/components/component-delegate/component.json +2 -2
  25. data/vendor/components/component-delegate/index.js +4 -4
  26. data/vendor/components/component-dialog/component.json +23 -0
  27. data/vendor/components/component-dialog/dialog.css +92 -0
  28. data/vendor/components/component-dialog/index.js +292 -0
  29. data/vendor/components/component-dialog/template.js +1 -0
  30. data/vendor/components/component-dom/component.json +33 -0
  31. data/vendor/components/component-dom/index.js +725 -0
  32. data/vendor/components/component-domify/component.json +22 -0
  33. data/vendor/components/component-domify/index.js +71 -0
  34. data/vendor/components/component-emitter/component.json +13 -0
  35. data/vendor/components/component-emitter/index.js +156 -0
  36. data/vendor/components/component-event/index.js +8 -11
  37. data/vendor/components/component-indexof/component.json +15 -0
  38. data/vendor/components/component-indexof/index.js +10 -0
  39. data/vendor/components/component-overlay/component.json +22 -0
  40. data/vendor/components/component-overlay/index.js +111 -0
  41. data/vendor/components/component-overlay/overlay.css +19 -0
  42. data/vendor/components/component-overlay/template.js +1 -0
  43. data/vendor/components/component-query/component.json +2 -1
  44. data/vendor/components/component-sort/component.json +20 -0
  45. data/vendor/components/component-sort/index.js +43 -0
  46. data/vendor/components/component-value/component.json +25 -0
  47. data/vendor/components/component-value/index.js +95 -0
  48. data/vendor/components/indefinido-indemma/component.json +2 -3
  49. data/vendor/components/indefinido-indemma/lib/record/resource.js +2 -4
  50. data/vendor/components/mikeric-rivets/component.json +1 -1
  51. data/vendor/components/mikeric-rivets/dist/rivets.js +64 -44
  52. data/vendor/components/paulmillr-es6-shim/component.json +1 -1
  53. data/vendor/components/paulmillr-es6-shim/es6-shim.js +22 -11
  54. data/vendor/components/pluma-assimilate/component.json +1 -1
  55. data/vendor/components/pluma-assimilate/dist/assimilate.js +103 -63
  56. metadata +35 -246
  57. data/lib/tasks/component.thor +0 -63
  58. data/vendor/assets/components/KapIT-observe-utils/component.json +0 -16
  59. data/vendor/assets/components/KapIT-observe-utils/lib/observe-utils.js +0 -780
  60. data/vendor/assets/components/chaijs-assertion-error/component.json +0 -18
  61. data/vendor/assets/components/chaijs-assertion-error/index.js +0 -110
  62. data/vendor/assets/components/chaijs-chai/component.json +0 -47
  63. data/vendor/assets/components/chaijs-chai/index.js +0 -1
  64. data/vendor/assets/components/chaijs-chai/lib/chai/assertion.js +0 -130
  65. data/vendor/assets/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
  66. data/vendor/assets/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
  67. data/vendor/assets/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
  68. data/vendor/assets/components/chaijs-chai/lib/chai/interface/should.js +0 -76
  69. data/vendor/assets/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
  70. data/vendor/assets/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
  71. data/vendor/assets/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
  72. data/vendor/assets/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
  73. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
  74. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
  75. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
  76. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
  77. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
  78. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
  79. data/vendor/assets/components/chaijs-chai/lib/chai/utils/index.js +0 -108
  80. data/vendor/assets/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
  81. data/vendor/assets/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
  82. data/vendor/assets/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
  83. data/vendor/assets/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
  84. data/vendor/assets/components/chaijs-chai/lib/chai/utils/test.js +0 -26
  85. data/vendor/assets/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
  86. data/vendor/assets/components/chaijs-chai/lib/chai/utils/type.js +0 -45
  87. data/vendor/assets/components/chaijs-chai/lib/chai.js +0 -80
  88. data/vendor/assets/components/chaijs-deep-eql/component.json +0 -18
  89. data/vendor/assets/components/chaijs-deep-eql/lib/eql.js +0 -257
  90. data/vendor/assets/components/chaijs-type-detect/component.json +0 -16
  91. data/vendor/assets/components/chaijs-type-detect/lib/type.js +0 -142
  92. data/vendor/assets/components/component-bind/component.json +0 -14
  93. data/vendor/assets/components/component-bind/index.js +0 -24
  94. data/vendor/assets/components/component-delegate/component.json +0 -19
  95. data/vendor/assets/components/component-delegate/index.js +0 -42
  96. data/vendor/assets/components/component-event/component.json +0 -13
  97. data/vendor/assets/components/component-event/index.js +0 -40
  98. data/vendor/assets/components/component-jquery/component.json +0 -14
  99. data/vendor/assets/components/component-jquery/index.js +0 -9601
  100. data/vendor/assets/components/component-link-delegate/component.json +0 -23
  101. data/vendor/assets/components/component-link-delegate/index.js +0 -60
  102. data/vendor/assets/components/component-matches-selector/component.json +0 -20
  103. data/vendor/assets/components/component-matches-selector/index.js +0 -45
  104. data/vendor/assets/components/component-query/component.json +0 -21
  105. data/vendor/assets/components/component-query/index.js +0 -21
  106. data/vendor/assets/components/component-type/component.json +0 -18
  107. data/vendor/assets/components/component-type/index.js +0 -32
  108. data/vendor/assets/components/component-url/component.json +0 -17
  109. data/vendor/assets/components/component-url/index.js +0 -63
  110. data/vendor/assets/components/discore-closest/component.json +0 -14
  111. data/vendor/assets/components/discore-closest/index.js +0 -18
  112. data/vendor/assets/components/indefinido-advisable/component.json +0 -21
  113. data/vendor/assets/components/indefinido-advisable/index.js +0 -1
  114. data/vendor/assets/components/indefinido-advisable/lib/advisable.js +0 -60
  115. data/vendor/assets/components/indefinido-indemma/component.json +0 -40
  116. data/vendor/assets/components/indefinido-indemma/index.js +0 -1
  117. data/vendor/assets/components/indefinido-indemma/lib/extensions/rivets.js +0 -23
  118. data/vendor/assets/components/indefinido-indemma/lib/record/associable.js +0 -217
  119. data/vendor/assets/components/indefinido-indemma/lib/record/maid.js +0 -24
  120. data/vendor/assets/components/indefinido-indemma/lib/record/resource.js +0 -104
  121. data/vendor/assets/components/indefinido-indemma/lib/record/rest.js +0 -36
  122. data/vendor/assets/components/indefinido-indemma/lib/record/restfulable.js +0 -326
  123. data/vendor/assets/components/indefinido-indemma/lib/record/scopable.js +0 -279
  124. data/vendor/assets/components/indefinido-indemma/lib/record/translationable.js +0 -19
  125. data/vendor/assets/components/indefinido-indemma/lib/record/validatable.js +0 -216
  126. data/vendor/assets/components/indefinido-indemma/lib/record/validations/associated.js +0 -30
  127. data/vendor/assets/components/indefinido-indemma/lib/record/validations/confirmation.js +0 -19
  128. data/vendor/assets/components/indefinido-indemma/lib/record/validations/cpf.js +0 -60
  129. data/vendor/assets/components/indefinido-indemma/lib/record/validations/presence.js +0 -19
  130. data/vendor/assets/components/indefinido-indemma/lib/record/validations/remote.js +0 -71
  131. data/vendor/assets/components/indefinido-indemma/lib/record.js +0 -167
  132. data/vendor/assets/components/indefinido-indemma/vendor/sinon.js +0 -4290
  133. data/vendor/assets/components/indefinido-indemma/vendor/stampit.js +0 -392
  134. data/vendor/assets/components/indefinido-observable/component.json +0 -25
  135. data/vendor/assets/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -4290
  136. data/vendor/assets/components/indefinido-observable/index.js +0 -1
  137. data/vendor/assets/components/indefinido-observable/lib/adapters/rivets.js +0 -26
  138. data/vendor/assets/components/indefinido-observable/lib/observable.js +0 -320
  139. data/vendor/assets/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
  140. data/vendor/assets/components/indefinido-observable/vendor/shims/accessors.js +0 -173
  141. data/vendor/assets/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
  142. data/vendor/assets/components/indefinido-observable/vendor/shims/object.create.js +0 -77
  143. data/vendor/assets/components/mikeric-rivets/component.json +0 -15
  144. data/vendor/assets/components/mikeric-rivets/dist/rivets.js +0 -1020
  145. data/vendor/assets/components/paulmillr-es6-shim/component.json +0 -17
  146. data/vendor/assets/components/paulmillr-es6-shim/es6-shim.js +0 -985
  147. data/vendor/assets/components/pluma-assimilate/component.json +0 -25
  148. data/vendor/assets/components/pluma-assimilate/dist/assimilate.js +0 -87
  149. data/vendor/assets/components/segmentio-extend/component.json +0 -13
  150. data/vendor/assets/components/segmentio-extend/index.js +0 -15
  151. data/vendor/components/chaijs-assertion-error/component.json +0 -18
  152. data/vendor/components/chaijs-assertion-error/index.js +0 -110
  153. data/vendor/components/chaijs-chai/component.json +0 -47
  154. data/vendor/components/chaijs-chai/index.js +0 -1
  155. data/vendor/components/chaijs-chai/lib/chai/assertion.js +0 -130
  156. data/vendor/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
  157. data/vendor/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
  158. data/vendor/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
  159. data/vendor/components/chaijs-chai/lib/chai/interface/should.js +0 -76
  160. data/vendor/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
  161. data/vendor/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
  162. data/vendor/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
  163. data/vendor/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
  164. data/vendor/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
  165. data/vendor/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
  166. data/vendor/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
  167. data/vendor/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
  168. data/vendor/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
  169. data/vendor/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
  170. data/vendor/components/chaijs-chai/lib/chai/utils/index.js +0 -108
  171. data/vendor/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
  172. data/vendor/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
  173. data/vendor/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
  174. data/vendor/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
  175. data/vendor/components/chaijs-chai/lib/chai/utils/test.js +0 -26
  176. data/vendor/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
  177. data/vendor/components/chaijs-chai/lib/chai/utils/type.js +0 -45
  178. data/vendor/components/chaijs-chai/lib/chai.js +0 -80
  179. data/vendor/components/chaijs-deep-eql/component.json +0 -18
  180. data/vendor/components/chaijs-deep-eql/lib/eql.js +0 -257
  181. data/vendor/components/chaijs-type-detect/component.json +0 -16
  182. data/vendor/components/chaijs-type-detect/lib/type.js +0 -142
  183. data/vendor/components/component-link-delegate/component.json +0 -23
  184. data/vendor/components/component-link-delegate/index.js +0 -60
  185. data/vendor/components/component-url/component.json +0 -17
  186. data/vendor/components/component-url/index.js +0 -63
  187. data/vendor/components/discore-closest/component.json +0 -14
  188. data/vendor/components/discore-closest/index.js +0 -18
  189. data/vendor/components/indefinido-indemma/.gitignore +0 -14
  190. data/vendor/components/indefinido-indemma/.ruby-gemset +0 -1
  191. data/vendor/components/indefinido-indemma/.ruby-version +0 -1
  192. data/vendor/components/indefinido-indemma/Gemfile +0 -13
  193. data/vendor/components/indefinido-indemma/Guardfile +0 -39
  194. data/vendor/components/indefinido-indemma/History.md +0 -0
  195. data/vendor/components/indefinido-indemma/Readme.md +0 -443
  196. data/vendor/components/indefinido-indemma/build/development.js +0 -331
  197. data/vendor/components/indefinido-indemma/build/test.js +0 -331
  198. data/vendor/components/indefinido-indemma/components/chaijs-assertion-error/component.json +0 -18
  199. data/vendor/components/indefinido-indemma/components/chaijs-assertion-error/index.js +0 -110
  200. data/vendor/components/indefinido-indemma/components/chaijs-chai/component.json +0 -47
  201. data/vendor/components/indefinido-indemma/components/chaijs-chai/index.js +0 -1
  202. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/assertion.js +0 -130
  203. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
  204. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
  205. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
  206. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/should.js +0 -76
  207. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
  208. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
  209. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
  210. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/eql.js +0 -129
  211. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
  212. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
  213. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
  214. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
  215. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
  216. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
  217. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
  218. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/index.js +0 -108
  219. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
  220. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
  221. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
  222. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
  223. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/test.js +0 -26
  224. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
  225. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/type.js +0 -45
  226. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai.js +0 -80
  227. data/vendor/components/indefinido-indemma/components/component-bind/component.json +0 -14
  228. data/vendor/components/indefinido-indemma/components/component-bind/index.js +0 -24
  229. data/vendor/components/indefinido-indemma/components/component-jquery/component.json +0 -14
  230. data/vendor/components/indefinido-indemma/components/component-jquery/index.js +0 -9601
  231. data/vendor/components/indefinido-indemma/components/component-type/component.json +0 -18
  232. data/vendor/components/indefinido-indemma/components/component-type/index.js +0 -32
  233. data/vendor/components/indefinido-indemma/components/indefinido-advisable/component.json +0 -21
  234. data/vendor/components/indefinido-indemma/components/indefinido-advisable/index.js +0 -1
  235. data/vendor/components/indefinido-indemma/components/indefinido-advisable/lib/advisable.js +0 -60
  236. data/vendor/components/indefinido-indemma/components/indefinido-observable/component.json +0 -25
  237. data/vendor/components/indefinido-indemma/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -4290
  238. data/vendor/components/indefinido-indemma/components/indefinido-observable/index.js +0 -1
  239. data/vendor/components/indefinido-indemma/components/indefinido-observable/lib/adapters/rivets.js +0 -26
  240. data/vendor/components/indefinido-indemma/components/indefinido-observable/lib/observable.js +0 -323
  241. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
  242. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/accessors.js +0 -173
  243. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
  244. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/object.create.js +0 -77
  245. data/vendor/components/indefinido-indemma/components/kapit-observe-utils/component.json +0 -13
  246. data/vendor/components/indefinido-indemma/components/pluma-assimilate/component.json +0 -25
  247. data/vendor/components/indefinido-indemma/components/pluma-assimilate/dist/assimilate.js +0 -87
  248. data/vendor/components/indefinido-indemma/karma.conf.js +0 -86
  249. data/vendor/components/indefinido-indemma/lib/record/errors.js +0 -1
  250. data/vendor/components/indefinido-indemma/spec/record/associable_spec.js +0 -76
  251. data/vendor/components/indefinido-indemma/spec/record/resource_spec.js +0 -90
  252. data/vendor/components/indefinido-indemma/spec/record/rest_spec.js +0 -32
  253. data/vendor/components/indefinido-indemma/spec/record/restfulable_spec.js +0 -232
  254. data/vendor/components/indefinido-indemma/spec/record/scopable_spec.js +0 -201
  255. data/vendor/components/indefinido-indemma/spec/record/translationable.js +0 -28
  256. data/vendor/components/indefinido-indemma/spec/record/validatable_spec.js +0 -111
  257. data/vendor/components/indefinido-indemma/spec/record/validations/associated_spec.js +0 -43
  258. data/vendor/components/indefinido-indemma/spec/record/validations/confirmation_spec.js +0 -36
  259. data/vendor/components/indefinido-indemma/spec/record/validations/cpf_spec.js +0 -35
  260. data/vendor/components/indefinido-indemma/spec/record/validations/presence_spec.js +0 -28
  261. data/vendor/components/indefinido-indemma/spec/record/validations/remote_spec.js +0 -86
  262. data/vendor/components/indefinido-indemma/spec/record/validations/type_spec.js +0 -48
  263. data/vendor/components/indefinido-indemma/spec/record_spec.js +0 -37
  264. data/vendor/components/indefinido-indemma/spec/spec_helper.js +0 -11
  265. data/vendor/components/indefinido-indemma/spec/support/value_objects/phone.js +0 -45
  266. data/vendor/components/indefinido-indemma/src/lib/extensions/rivets.coffee +0 -17
  267. data/vendor/components/indefinido-indemma/src/lib/record/associable.coffee +0 -173
  268. data/vendor/components/indefinido-indemma/src/lib/record/errors.coffee +0 -20
  269. data/vendor/components/indefinido-indemma/src/lib/record/maid.coffee +0 -16
  270. data/vendor/components/indefinido-indemma/src/lib/record/resource.coffee +0 -103
  271. data/vendor/components/indefinido-indemma/src/lib/record/rest.coffee +0 -28
  272. data/vendor/components/indefinido-indemma/src/lib/record/restfulable.coffee +0 -314
  273. data/vendor/components/indefinido-indemma/src/lib/record/scopable.coffee +0 -266
  274. data/vendor/components/indefinido-indemma/src/lib/record/translationable.coffee +0 -18
  275. data/vendor/components/indefinido-indemma/src/lib/record/validatable.coffee +0 -209
  276. data/vendor/components/indefinido-indemma/src/lib/record/validations/associated.coffee +0 -32
  277. data/vendor/components/indefinido-indemma/src/lib/record/validations/confirmation.coffee +0 -19
  278. data/vendor/components/indefinido-indemma/src/lib/record/validations/cpf.coffee +0 -58
  279. data/vendor/components/indefinido-indemma/src/lib/record/validations/presence.coffee +0 -19
  280. data/vendor/components/indefinido-indemma/src/lib/record/validations/remote.coffee +0 -65
  281. data/vendor/components/indefinido-indemma/src/lib/record/validations/type.coffee +0 -32
  282. data/vendor/components/indefinido-indemma/src/lib/record.coffee +0 -123
  283. data/vendor/components/indefinido-indemma/src/spec/record/associable_spec.coffee +0 -63
  284. data/vendor/components/indefinido-indemma/src/spec/record/resource_spec.coffee +0 -64
  285. data/vendor/components/indefinido-indemma/src/spec/record/rest_spec.coffee +0 -22
  286. data/vendor/components/indefinido-indemma/src/spec/record/restfulable_spec.coffee +0 -164
  287. data/vendor/components/indefinido-indemma/src/spec/record/scopable_spec.coffee +0 -181
  288. data/vendor/components/indefinido-indemma/src/spec/record/translationable.coffee +0 -19
  289. data/vendor/components/indefinido-indemma/src/spec/record/validatable_spec.coffee +0 -100
  290. data/vendor/components/indefinido-indemma/src/spec/record/validations/associated_spec.coffee +0 -35
  291. data/vendor/components/indefinido-indemma/src/spec/record/validations/confirmation_spec.coffee +0 -25
  292. data/vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee +0 -28
  293. data/vendor/components/indefinido-indemma/src/spec/record/validations/presence_spec.coffee +0 -24
  294. data/vendor/components/indefinido-indemma/src/spec/record/validations/remote_spec.coffee +0 -72
  295. data/vendor/components/indefinido-indemma/src/spec/record/validations/type_spec.coffee +0 -33
  296. data/vendor/components/indefinido-indemma/src/spec/record_spec.coffee +0 -23
  297. data/vendor/components/indefinido-indemma/src/spec/spec_helper.coffee +0 -9
  298. data/vendor/components/indefinido-indemma/src/spec/support/value_objects/phone.coffee +0 -30
  299. data/vendor/components/indefinido-indemma/vendor/owl/pluralize.js +0 -190
@@ -1,314 +0,0 @@
1
- merge = require('assimilate').withStrategy 'deep'
2
- type = require 'type'
3
- observable = require('observable').mixin
4
- $ = require 'jquery' # TODO remove jquery dependency and use simple promises implementation
5
- rest = require './rest.js'
6
-
7
- util =
8
- model:
9
- map: (models) ->
10
- @ model for model in models
11
-
12
-
13
- restful =
14
- model:
15
- # returns an array of promises
16
- create: (params..., callback) ->
17
- throw new TypeError("No arguments provided for #{@resource}.create") unless arguments.length
18
- unless typeof callback == 'function'
19
- params.push callback
20
- callback = undefined
21
-
22
- params.unshift {} unless params.length
23
-
24
- savings = []
25
- for attributes in params
26
- # TODO accept dirty as attribute on record creation
27
- record = @ attributes
28
- record.dirty = true
29
- savings.push record.save callback
30
-
31
- $.when savings...
32
-
33
- # returns a promise
34
- # TODO move to scopable
35
- all: (conditions = {}, callback) ->
36
- if typeof conditions == 'function'
37
- callback = conditions
38
- conditions = {}
39
-
40
- # TODO Consider parent resources
41
- # if @parent and not @parent._id
42
- # return callback.call @model, []
43
-
44
-
45
- $.when(rest.get.call @, conditions)
46
- .then(util.model.map )
47
- .done callback
48
-
49
- first: (conditions = {}, callback) ->
50
- if typeof conditions == 'function'
51
- callback = conditions
52
- conditions = {}
53
-
54
- namespaced = conditions[@resource] || {}
55
- namespaced.limit = 1
56
- namespaced.order = 'desc'
57
-
58
- # TODO should fail when server returns more then one record
59
- @all conditions, callback
60
-
61
- get: (action, data) ->
62
- # TODO better way to override route
63
- old_route = @route
64
- @route = "/#{model.pluralize @resource.name}/#{action}"
65
- resource = data.resource
66
- data = data.json() if data and data.json
67
-
68
- if resource?
69
- payload = data
70
- data = {}
71
- data[resource] = payload
72
-
73
- promise = rest.get.call @, data
74
-
75
- route = old_route
76
-
77
- promise
78
-
79
- put: rest.put
80
-
81
- record:
82
- reload: ->
83
- promise = rest.get.call @
84
- promise.done @assign_attributes
85
- promise.fail @failed
86
-
87
- # Bind one time save callbacks
88
- promise.done argument for argument in arguments when type(argument) is 'function'
89
-
90
- promise
91
-
92
- assign_attributes: (attributes) ->
93
-
94
- # TODO only set associations on nested attributes!
95
- # First assign has_many associations
96
- # TODO implement setter on has_many association and move this code there
97
- for association_name in model[@resource.toString()].has_many
98
- associations_attributes = attributes[association_name]
99
- delete attributes[association_name] # Remove loaded json data
100
-
101
- # Clear current stored cache on this association
102
- # TODO implement setter on this association and let user to set
103
- # it to an empty array
104
- association = @[association_name]
105
-
106
- unless association?
107
- message = "Association '#{association_name}' not found. \n"
108
- message += "For record with resource #{@resource}. \n"
109
- message += "Probably defined on server side but not on client side.\n"
110
- message += "Skipping association assignment!"
111
- console.warn message
112
- continue
113
-
114
- # TODO implement association.clear
115
- Array.prototype.splice.call association, 0 if association.length
116
-
117
- # continue if no associations_attributes were found by the server
118
- continue unless associations_attributes? and associations_attributes.length
119
-
120
- singular_resource = model.singularize association_name
121
-
122
- # Normalize json data for building on association
123
- for association_attributes in associations_attributes
124
-
125
- # TODO only nest specified nested attributes on model definition
126
- # TODO create special deserialization method no plural association
127
- # TODO check if we need to nest attributes in other association tipes
128
- for association_name in model[singular_resource].has_many
129
- association_attributes["#{association_name}_attributes"] = association_attributes[association_name]
130
- delete association_attributes[association_name]
131
-
132
- # Load new associations_attributes on this association
133
- association.add associations_attributes...
134
-
135
-
136
- # Nested attributes
137
- # TODO implement setter on has_one association and move this code there
138
- for association_name in model[@resource.toString()].has_one
139
- association_attributes = attributes[association_name]
140
- delete attributes[association_name]
141
-
142
- @[association_name] = @["build_#{association_name}"] association_attributes if association_attributes
143
-
144
-
145
- # Assign remaining attributes
146
- @[attribute] = attributes[attribute] for attribute of attributes
147
-
148
- destroy: (doned, failed, data) ->
149
- throw new Error 'Can\'t delete record without id!' unless @id? or @_id?
150
-
151
- promise = rest.delete.call @, data
152
- promise.done @destroyed
153
- promise.fail @failed
154
-
155
- # Bind one time save callbacks
156
- promise.done doned
157
- promise.fail failed
158
-
159
- promise
160
-
161
- saving: false
162
- salvation: null
163
- save: (doned, failed, data) ->
164
- return @salvation if @saving
165
-
166
- # TODO better lock generation
167
- @lock = JSON.stringify @json()
168
-
169
- # TODO remove jquery dependency
170
- # TODO think with wich value makes more sense to resolve the
171
- # absence of need to save the model
172
- salvation = $.Deferred().resolveWith @, null unless @dirty
173
- salvation ||= rest[if @_id then 'put' else 'post'].call @, data
174
- @salvation = salvation
175
- @saving = true
176
-
177
- salvation.done @saved
178
- salvation.fail @failed
179
- salvation.always -> @saving = false
180
-
181
- # Bind one time save callbacks
182
- salvation.done doned
183
- salvation.fail failed
184
-
185
- salvation
186
-
187
- saved: (data) ->
188
-
189
- # TODO better lock generation
190
- if @lock == JSON.stringify(@json())
191
- @dirty = false
192
- delete @lock
193
- # Delayed optimistic lock
194
- else
195
- return @save()
196
-
197
- @assign_attributes data if data?
198
-
199
- throw "Not supported after_save callback: " + callback for callback in @after_save if @after_save
200
-
201
- # Parse error json if any
202
- failed: (xhr, error, status) ->
203
- payload = xhr.responseJSON
204
- try payload ||= JSON.parse(xhr.responseText) catch e
205
- payload ||= xhr.responseText
206
-
207
- # When client fail
208
- switch xhr.status
209
- # move to validatable
210
- when 422
211
-
212
- definition = model[@resource]
213
-
214
- for attribute_name, messages of payload.errors
215
-
216
- # Only add errors to existing attributes
217
- unless @hasOwnProperty(attribute_name) or definition.hasOwnProperty(attribute_name)
218
- message = "Server returned an validation error message for a attribute that is not defined in your model.\n"
219
- message += "The attribute was '#{attribute_name}', the model resource was '#{@resource}'.\n"
220
- message += "The model definition keys were '#{JSON.stringify Object.keys definition }'.\n"
221
- message += "Please remove server validation, or update your model definition."
222
- throw new TypeError message
223
-
224
- for message in messages
225
- @errors.add attribute_name, 'server', server_message: message
226
-
227
- # Unknown fail
228
- else
229
- message = "Fail in #{@resource}.save:\n"
230
- message += "Record: #{@}\n"
231
- message += "Status: #{status} (#{payload.status || xhr.status})\n"
232
- message += "Error : #{payload.error || payload.message || payload}"
233
-
234
-
235
- toString: ->
236
- serialized = {}
237
- serialized[@resource] = @json()
238
- JSON.stringify serialized
239
-
240
- json: (methods = {}) ->
241
- json = {}
242
-
243
- for name, value of @ when type(value) isnt 'function'
244
- continue unless value? # Bypass null, and undefined values
245
-
246
- if type(value) == 'object'
247
-
248
- if value.toJSON?
249
-
250
- json[name] = value.toJSON(methods[name])
251
-
252
- else
253
-
254
- # TODO move nested attributes to model definition
255
- # TODO and implement toJSON there
256
- for attribute in @nested_attributes when attribute == name
257
- json["#{name}_attributes"] = value.json(methods[name])
258
-
259
- else
260
-
261
- json[name] = value
262
-
263
- observable.unobserve json
264
-
265
- # TODO Store reserved words in a array
266
- # TODO Use _.omit function
267
- # TODO Use object.defineProperty to not need to delete this properties
268
- # Remove model reserved words
269
- delete json.dirty
270
- delete json.resource
271
- delete json.route
272
- delete json.initial_route # TODO implement better initial_route and remove attribute from here
273
- delete json.after_initialize
274
- delete json.parent_resource
275
- delete json.nested_attributes
276
- delete json.saving
277
- delete json.salvation
278
- delete json.element
279
- delete json.default
280
- delete json.lock
281
- delete json.validated
282
- delete json.validation
283
-
284
- json
285
-
286
- # TODO put deprecation warning on json method
287
- # TODO rename json method to toJSON
288
- restful.toJSON = restful.json
289
-
290
-
291
- # Extend indemma
292
- model = window.model # TODO better way to get parent
293
- record = window.record # TODO better way to get parent
294
-
295
- model.restfulable = true
296
-
297
- record.mix (recordable) ->
298
- merge recordable, restful.record
299
-
300
-
301
- model.mix (modelable ) ->
302
- merge modelable , restful.model
303
-
304
-
305
- model.associable && model.associable.mix (singular_association, plural_association) ->
306
-
307
- # TODO move route setting to plural_association.after_mix
308
- plural_association.get = ->
309
- @route ||= "#{@parent.route}/#{@parent._id}/#{model.pluralize @resource.name}" if @parent?
310
- rest.get.apply @, arguments
311
-
312
- plural_association.post = ->
313
- @route ||= "#{@parent.route}/#{@parent._id}/#{model.pluralize @resource.name}" if @parent?
314
- rest.post.apply @, arguments
@@ -1,266 +0,0 @@
1
- require './restfulable'
2
- require './resource'
3
-
4
- stampit = require '../../vendor/stampit'
5
- extend = require 'assimilate'
6
- merge = extend.withStrategy 'deep'
7
- $ = require 'jquery'
8
- rest = require './rest'
9
-
10
-
11
- scopable =
12
- builder: stampit().enclose ->
13
-
14
- # Builds a given scope
15
- # {param} name Scope name also, the name of method used to invoke it
16
- # {param} type Default value for scope, or base class to derive default for default type
17
-
18
- stampit.mixIn (name, type) ->
19
- if $.type(type) == 'function'
20
- @["$#{name}"] = type() || new type
21
- type = $.type @["$#{name}"]
22
- else
23
- @["$#{name}"] = defaults[type] || type
24
-
25
- type = $.type type unless $.type(type) == 'string'
26
- builder = builders[type]
27
-
28
- throw "Unknown scope type #{type} for model with resource #{model.resource}" unless builder?
29
-
30
- @scope.declared.push name
31
- @[name] = builder name: name
32
- ,
33
- data: {}
34
- then: []
35
- fail: []
36
- declared: []
37
- fetch: (data, done, fail) ->
38
- scope = extend {}, @scope.data
39
-
40
- if scope.noned?
41
- deferred = $.Deferred()
42
- deferred.resolveWith @, [[]]
43
- else
44
- deferred = rest.get.call(@, extend scope, data)
45
-
46
- deferred
47
- .done(@scope.then.concat done)
48
- .fail([@scope.fail, fail])
49
-
50
- @scope.clear()
51
-
52
- deferred
53
-
54
- clear: ->
55
- @data = {}
56
- @callbacks = []
57
-
58
- # Shared scope stuff
59
- base: stampit().state
60
- name: 'unamed_scope'
61
-
62
- record:
63
- # Parse error json if any
64
- failed: (xhr, error, status) ->
65
- payload = xhr.responseJSON
66
- try payload ||= JSON.parse(xhr.responseText) catch e
67
- payload ||= xhr.responseText
68
-
69
- # When client fail
70
- switch xhr.status
71
- when 422
72
- @valid = false
73
- return @errors = payload.errors
74
- # Unknown fail
75
- else
76
- message = "Fail in #{@resource}.save:\n"
77
- message += "Record: #{@}\n"
78
- message += "Status: #{status} (#{payload.status || xhr.status})\n"
79
- message += "Error : #{payload.error || payload.message || payload}"
80
-
81
- console.error message
82
- model:
83
- # TODO implement getter for none property!
84
- none: ->
85
- @scope.data.noned = true
86
- @
87
-
88
- fetch: (data, done, fail) ->
89
- @scope.fetch.call @, data, done, fail
90
-
91
- # TODO optmize this iterations or add support for stampit on associable and merge factories
92
- # @ = record instance
93
- forward_scopes_to_associations: ->
94
- factory = model[@resource]
95
-
96
- for association_name in factory.has_many
97
- associated_resource = model.singularize association_name
98
- associated_factory = model[associated_resource]
99
-
100
- # TODO change this warn message into a exception when
101
- # associations are renamable
102
- unless model[associated_resource]
103
- console.warn("Associated factory not found for associated resource: #{associated_resource}")
104
- continue
105
-
106
- association = @[association_name]
107
- association.scope = scopable.builder association
108
-
109
-
110
- for scope in associated_factory.scope.declared
111
- association.scope scope, associated_factory["$#{scope}"]
112
-
113
- for associated_resource in factory.has_one
114
- # TODO change this warn message into a exception when
115
- # associations are renamable
116
- unless model[associated_resource]
117
- console.warn("Associated factory not found for associated resource: #{associated_resource}")
118
- continue
119
-
120
- for scope in model[associated_resource].scope.declared
121
- @[associated_resource][scope] = factory[scope]
122
-
123
- # TODO improve associable inner workings to stampit objects
124
- if factory.belongs_to.length
125
- generate_forwarder = (associated_resource) ->
126
- associated_factory = model[associated_resource]
127
-
128
- # TODO change this warn message into a exception when
129
- # associations are renamable
130
- return console.warn("Associated factory not found for associated resource: #{associated_resource}") unless associated_factory
131
-
132
- declared_scopes = associated_factory.scope.declared
133
-
134
- ->
135
- for scope in declared_scopes
136
- @[associated_resource][scope] = associated_factory[scope]
137
-
138
- for associated_resource in factory.belongs_to
139
- forwarder = generate_forwarder associated_resource
140
- @after "build_#{associated_resource}", forwarder
141
-
142
- true
143
- # @ = model instance
144
- after_mix: ->
145
- @scope = scopable.builder @
146
-
147
- for property, type of @
148
- if property.charAt(0) == '$'
149
- name = property.substring 1
150
- @scope name, type
151
-
152
- builders =
153
- # Builds a boolean scope builder
154
- boolean: stampit().enclose ->
155
- base = scopable.base @
156
-
157
- stampit.mixIn (value, callbacks...) ->
158
- callbacks.length and @scope.then = @scope.then.concat callbacks
159
- @scope.data[base.name] ||= value ? @["$#{base.name}"]
160
- @
161
-
162
- # Builds a array scope builder
163
- array: stampit().enclose ->
164
- base = scopable.base @
165
-
166
- stampit.mixIn (values...) ->
167
- @scope.data[base.name] ||= values ? @["$#{base.name}"]
168
- @
169
-
170
- defaults =
171
- boolean: true
172
- array: []
173
-
174
- # Extend indemma
175
- model = window.model # TODO better way to get parent
176
- record = window.record # TODO better way to get parent
177
-
178
- model.scopable = true
179
-
180
- # TODO use stampit to extend record and model
181
- #record.mix (recordable) ->
182
- # merge recordable, scopable.record
183
-
184
- model.mix (modelable) ->
185
- merge modelable, scopable.model
186
-
187
- modelable.after_mix.push scopable.after_mix
188
-
189
-
190
- # TODO create a deferred to better mix models
191
- if model.associable
192
- model.mix (modelable) ->
193
- modelable.record.after_initialize.push ->
194
- scopable.model.forward_scopes_to_associations.call @
195
-
196
- model.associable.mix (singular_association, plural_association) ->
197
-
198
- # reload (done callbacks...)
199
- plural_association.all = plural_association.reload = (data, done, fail) ->
200
- # TODO move route discovery to plural_association.after_mix
201
- @route ||= "#{@parent.route}/#{@parent._id}/#{model.pluralize @resource}" if @parent?
202
- promises = []
203
-
204
- # TODO better calculate fetch settings
205
- # dirty = 0
206
- # if more than 5 records are dirty, we reftech all
207
- # if dirty < 5
208
- # for record in @
209
- # promises.push record.reload()
210
- # else we reload everthing!
211
- # else
212
- #
213
- # for record in @
214
- # dirty++ if record.dirty
215
-
216
- if typeof data == 'function'
217
- done = data
218
- data = undefined
219
-
220
- promises.push @scope.fetch.call @, data, null, scopable.record.failed
221
-
222
- reload = $.when.apply jQuery, promises
223
-
224
- # Update association with data sent from the server
225
- # TODO implement setter on this association and let user to set
226
- reload.done (records, status) ->
227
-
228
- # Clear current stored cache on this association
229
- # it to an empty array
230
- Array.prototype.splice.call @, 0
231
-
232
- # return if no records were found by the server
233
- return unless records.length
234
-
235
- singular_resource = model.singularize @resource
236
-
237
- # Normalize json data for building on association
238
- for record in records
239
-
240
- # TODO only nest specified nested attributes on model definition
241
- # TODO create special deserialization method no plural association
242
- # TODO check if we need to nest attributes in other association tipes
243
- for association_name in model[singular_resource].has_many
244
- record["#{association_name}_attributes"] = record[association_name]
245
- delete record[association_name]
246
-
247
- # Load new records on this association
248
- @add.apply @, records
249
-
250
- # Override the response records object with added to association records
251
- records.splice 0
252
- records.push.apply records, @
253
-
254
-
255
- reload.done done
256
- reload.fail fail
257
-
258
- reload
259
-
260
- plural_association.each = (callback) ->
261
- @route ||= "#{@parent.route}/#{@parent._id}/#{model.pluralize @resource}" if @parent?
262
-
263
- # TODO cache models
264
- @get().done (records) =>
265
- for record in @
266
- callback record
@@ -1,18 +0,0 @@
1
- root = exports ? window
2
-
3
- # TODO better way to get core model definition
4
- # model = require ...
5
-
6
- # TODO implement method
7
- # model[resource].validators_on 'field' # Get all validators related to this field
8
-
9
- extend = require('assimilate')
10
-
11
- extensions =
12
- model:
13
- human_attribute_name: (attribute_name) ->
14
- @translation?.attributes?[attribute_name] or attribute_name
15
-
16
- model.mix (modelable) ->
17
- extend modelable, extensions.model
18
-