ende 0.4.12 → 0.4.13

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.
@@ -26,10 +26,14 @@ function require(path, parent, orig) {
26
26
  // perform real require()
27
27
  // by invoking the module's
28
28
  // registered function
29
- if (!module.exports) {
30
- module.exports = {};
31
- module.client = module.component = true;
32
- module.call(this, module.exports, require.relative(resolved), module);
29
+ if (!module._resolving && !module.exports) {
30
+ var mod = {};
31
+ mod.exports = {};
32
+ mod.client = mod.component = true;
33
+ module._resolving = true;
34
+ module.call(this, mod.exports, require.relative(resolved), mod);
35
+ delete module._resolving;
36
+ module.exports = mod.exports;
33
37
  }
34
38
 
35
39
  return module.exports;
@@ -19156,7 +19160,7 @@ model.pluralize = resourceable.pluralize;
19156
19160
 
19157
19161
  });
19158
19162
  require.register("indefinido-indemma/lib/record/rest.js", function(exports, require, module){
19159
- var $, data_for, request;
19163
+ var $, request;
19160
19164
 
19161
19165
  $ = require('jquery');
19162
19166
 
@@ -19175,7 +19179,7 @@ module.exports = {
19175
19179
  }
19176
19180
  };
19177
19181
 
19178
- data_for = function(data) {
19182
+ request = function(method, url, data) {
19179
19183
  var param_name;
19180
19184
 
19181
19185
  param_name = this.resource.param_name || this.resource.toString();
@@ -19187,11 +19191,6 @@ data_for = function(data) {
19187
19191
  delete data[param_name]['id'];
19188
19192
  delete data[param_name]['_id'];
19189
19193
  }
19190
- return data;
19191
- };
19192
-
19193
- request = function(method, url, data) {
19194
- data = data_for.call(this, data);
19195
19194
  return $.ajax({
19196
19195
  url: url,
19197
19196
  data: data,
@@ -20279,230 +20278,215 @@ module.exports = composed;
20279
20278
 
20280
20279
  });
20281
20280
  require.register("indefinido-indemma/lib/record/validatable.js", function(exports, require, module){
20282
- var errorsable, extensions, initializers, manager, messages, observable, root, stampit, type;
20283
-
20284
- require('./translationable');
20281
+ (function() {
20282
+ var errorsable, extensions, initializers, manager, messages, observable, root, stampit, type;
20285
20283
 
20286
- root = typeof exports !== "undefined" && exports !== null ? exports : this;
20284
+ require('./translationable');
20287
20285
 
20288
- stampit = require('../../vendor/stampit');
20286
+ root = typeof exports !== "undefined" && exports !== null ? exports : this;
20289
20287
 
20290
- observable = require('observable').mixin;
20288
+ stampit = require('../../vendor/stampit');
20291
20289
 
20292
- type = require('type');
20290
+ observable = require('observable').mixin;
20293
20291
 
20294
- messages = {
20295
- blank: function(attribute_name) {
20296
- attribute_name = this.human_attribute_name(attribute_name);
20297
- return "O campo " + attribute_name + " não pode ficar em branco.";
20298
- },
20299
- cpf: function(attribute_name) {
20300
- attribute_name = this.human_attribute_name(attribute_name);
20301
- return "O campo " + attribute_name + " não está válido.";
20302
- },
20303
- confirmation: function(attribute_name) {
20304
- var confirmation_attribute_name;
20292
+ type = require('type');
20305
20293
 
20306
- confirmation_attribute_name = this.human_attribute_name(attribute_name);
20307
- attribute_name = this.human_attribute_name(attribute_name.replace('_confirmation', ''));
20308
- return "O campo " + attribute_name + " não está de acordo com o campo " + confirmation_attribute_name + ".";
20309
- },
20310
- associated: function(attribute_name) {
20311
- attribute_name = this.human_attribute_name(attribute_name);
20312
- return "O registro associado " + attribute_name + " não é válido.";
20313
- },
20314
- server: function(attribute_name, options) {
20315
- if (attribute_name === 'base') {
20316
- return options.server_message;
20317
- } else {
20294
+ messages = {
20295
+ blank: function(attribute_name) {
20296
+ attribute_name = this.human_attribute_name(attribute_name);
20297
+ return "O campo " + attribute_name + " não pode ficar em branco.";
20298
+ },
20299
+ cpf: function(attribute_name) {
20300
+ attribute_name = this.human_attribute_name(attribute_name);
20301
+ return "O campo " + attribute_name + " não está válido.";
20302
+ },
20303
+ confirmation: function(attribute_name) {
20304
+ var confirmation_attribute_name;
20305
+ confirmation_attribute_name = this.human_attribute_name(attribute_name);
20306
+ attribute_name = this.human_attribute_name(attribute_name.replace('_confirmation', ''));
20307
+ return "O campo " + attribute_name + " não está de acordo com o campo " + confirmation_attribute_name + ".";
20308
+ },
20309
+ associated: function(attribute_name) {
20318
20310
  attribute_name = this.human_attribute_name(attribute_name);
20319
- return "" + attribute_name + " " + options.server_message + ".";
20311
+ return "O registro associado " + attribute_name + " não é válido.";
20312
+ },
20313
+ server: function(attribute_name, options) {
20314
+ if (attribute_name === 'base') {
20315
+ return options.server_message;
20316
+ } else {
20317
+ attribute_name = this.human_attribute_name(attribute_name);
20318
+ return "" + attribute_name + " " + options.server_message + ".";
20319
+ }
20320
+ },
20321
+ type: function(attribute_name, options) {
20322
+ attribute_name = this.human_attribute_name(attribute_name);
20323
+ return "O campo " + attribute_name + " não está válido.";
20320
20324
  }
20321
- },
20322
- type: function(attribute_name, options) {
20323
- attribute_name = this.human_attribute_name(attribute_name);
20324
- return "O campo " + attribute_name + " não está válido.";
20325
- }
20326
- };
20327
-
20328
- errorsable = stampit({
20329
- add: function(attribute_name, message_key, options) {
20330
- var translator;
20325
+ };
20331
20326
 
20332
- this.push([attribute_name, message_key, options]);
20333
- this.messages[attribute_name] = '';
20334
- translator = messages[message_key];
20335
- if (translator != null) {
20336
- return this.messages[attribute_name] += translator.call(this.model, attribute_name, options);
20337
- } else {
20338
- return this.messages[attribute_name] += message_key;
20339
- }
20340
- },
20341
- clear: function() {
20342
- var attribute_name, _results;
20327
+ errorsable = stampit({
20328
+ add: function(attribute_name, message_key, options) {
20329
+ var translator;
20330
+ this.push([attribute_name, message_key, options]);
20331
+ this.messages[attribute_name] = '';
20332
+ translator = messages[message_key];
20333
+ if (translator != null) {
20334
+ return this.messages[attribute_name] += translator.call(this.model, attribute_name, options);
20335
+ } else {
20336
+ return this.messages[attribute_name] += message_key;
20337
+ }
20338
+ },
20339
+ clear: function() {
20340
+ var attribute_name, _results;
20341
+ if (this.length) {
20342
+ this.length = 0;
20343
+ _results = [];
20344
+ for (attribute_name in this.messages) {
20345
+ _results.push(this.messages[attribute_name] = null);
20346
+ }
20347
+ return _results;
20348
+ }
20349
+ },
20350
+ push: Array.prototype.push,
20351
+ splice: Array.prototype.splice,
20352
+ indexOf: Array.prototype.indexOf
20353
+ }, {
20354
+ model: null,
20355
+ messages: null,
20356
+ length: 0
20357
+ }, function() {
20358
+ this.messages = {};
20359
+ return this;
20360
+ });
20343
20361
 
20344
- if (this.length) {
20345
- this.length = 0;
20362
+ initializers = {
20363
+ define_triggers: function() {
20364
+ this.errors = errorsable({
20365
+ model: model[this.resource]
20366
+ });
20367
+ this.before('save', function() {
20368
+ if (this.save) return this.validate();
20369
+ });
20370
+ this.validated = false;
20371
+ this.subscribe('dirty', function(value) {
20372
+ return value && (this.validated = false);
20373
+ });
20374
+ return Object.defineProperty(this, 'valid', {
20375
+ get: function() {
20376
+ this.validate();
20377
+ if (this.validation.state() === 'resolved') {
20378
+ return !this.errors.length;
20379
+ } else {
20380
+ return null;
20381
+ }
20382
+ },
20383
+ set: function() {
20384
+ throw new TypeError("You can't set the value for the valid property.");
20385
+ },
20386
+ enumerable: false
20387
+ });
20388
+ },
20389
+ create_validators: function(definitions) {
20390
+ var definition, name, validator, validator_options, _ref, _results;
20391
+ this.validators = [];
20392
+ _ref = manager.validators;
20346
20393
  _results = [];
20347
- for (attribute_name in this.messages) {
20348
- _results.push(this.messages[attribute_name] = null);
20394
+ for (name in _ref) {
20395
+ validator = _ref[name];
20396
+ definition = definitions[validator.definition_key];
20397
+ if (definition) {
20398
+ if (type(definition) !== 'array') definition = [definition];
20399
+ _results.push((function() {
20400
+ var _i, _len, _results2;
20401
+ _results2 = [];
20402
+ for (_i = 0, _len = definition.length; _i < _len; _i++) {
20403
+ validator_options = definition[_i];
20404
+ if (type(validator_options) !== 'object') {
20405
+ validator_options = {
20406
+ attribute_name: validator_options
20407
+ };
20408
+ }
20409
+ validator_options.model = this;
20410
+ this.validators.push(validator(validator_options));
20411
+ _results2.push(delete definitions[validator.definition_key]);
20412
+ }
20413
+ return _results2;
20414
+ }).call(this));
20415
+ } else {
20416
+ _results.push(void 0);
20417
+ }
20349
20418
  }
20350
20419
  return _results;
20351
20420
  }
20352
- },
20353
- push: Array.prototype.push,
20354
- splice: Array.prototype.splice,
20355
- indexOf: Array.prototype.indexOf
20356
- }, {
20357
- model: null,
20358
- messages: null,
20359
- length: 0
20360
- }, function() {
20361
- this.messages = {};
20362
- return this;
20363
- });
20421
+ };
20364
20422
 
20365
- initializers = {
20366
- define_triggers: function() {
20367
- this.errors = errorsable({
20368
- model: model[this.resource]
20369
- });
20370
- this.before('save', function() {
20371
- if (this.save) {
20372
- return this.validate();
20373
- }
20374
- });
20375
- this.validated = false;
20376
- this.subscribe('dirty', function(value) {
20377
- return value && (this.validated = false);
20378
- });
20379
- return Object.defineProperty(this, 'valid', {
20380
- get: function() {
20381
- this.validate();
20382
- if (this.validation.state() === 'resolved') {
20383
- return !this.errors.length;
20384
- } else {
20385
- return null;
20386
- }
20387
- },
20388
- set: function() {
20389
- throw new TypeError("You can't set the value for the valid property.");
20423
+ extensions = {
20424
+ model: {
20425
+ validators: null
20426
+ },
20427
+ record: {
20428
+ validate_attribute: function(attribute, doned, failed) {
20429
+ var results, validation, validator, _i, _len, _ref;
20430
+ this.errors.messages[attribute] = null;
20431
+ results = [this, attribute];
20432
+ _ref = model[this.resource.toString()].validators;
20433
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
20434
+ validator = _ref[_i];
20435
+ if (validator.attribute_name === attribute) {
20436
+ results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
20437
+ }
20438
+ }
20439
+ validation = jQuery.when.apply(jQuery, results);
20440
+ validation.done(doned);
20441
+ validation.fail(failed);
20442
+ return validation;
20390
20443
  },
20391
- enumerable: false
20392
- });
20393
- },
20394
- create_validators: function(definitions) {
20395
- var definition, name, validator, validator_options, _ref, _results;
20396
-
20397
- this.validators = [];
20398
- _ref = manager.validators;
20399
- _results = [];
20400
- for (name in _ref) {
20401
- validator = _ref[name];
20402
- definition = definitions[validator.definition_key];
20403
- if (definition) {
20404
- if (type(definition) !== 'array') {
20405
- definition = [definition];
20406
- }
20407
- _results.push((function() {
20408
- var _i, _len, _results1;
20409
-
20410
- _results1 = [];
20411
- for (_i = 0, _len = definition.length; _i < _len; _i++) {
20412
- validator_options = definition[_i];
20413
- if (type(validator_options) !== 'object') {
20414
- validator_options = {
20415
- attribute_name: validator_options
20416
- };
20417
- }
20418
- validator_options.model = this;
20419
- this.validators.push(validator(validator_options));
20420
- _results1.push(delete definitions[validator.definition_key]);
20421
- }
20422
- return _results1;
20423
- }).call(this));
20424
- } else {
20425
- _results.push(void 0);
20444
+ validate: function(doned, failed) {
20445
+ var results, validator, _i, _len, _ref;
20446
+ if (this.validated && !this.dirty) return this.validation;
20447
+ this.errors.clear();
20448
+ results = [this];
20449
+ _ref = model[this.resource.toString()].validators;
20450
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
20451
+ validator = _ref[_i];
20452
+ results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
20453
+ }
20454
+ this.validation = jQuery.when.apply(jQuery, results);
20455
+ this.validation.done(doned);
20456
+ this.validation.fail(failed);
20457
+ return this.validation.done(function(record) {
20458
+ return record.validated || (record.validated = true);
20459
+ });
20426
20460
  }
20427
20461
  }
20428
- return _results;
20429
- }
20430
- };
20431
-
20432
- extensions = {
20433
- model: {
20434
- validators: null
20435
- },
20436
- record: {
20437
- validate_attribute: function(attribute, doned, failed) {
20438
- var results, validation, validator, _i, _len, _ref;
20439
-
20440
- this.errors.messages[attribute] = null;
20441
- results = [this, attribute];
20442
- _ref = model[this.resource.toString()].validators;
20443
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
20444
- validator = _ref[_i];
20445
- if (validator.attribute_name === attribute) {
20446
- results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
20447
- }
20448
- }
20449
- validation = jQuery.when.apply(jQuery, results);
20450
- validation.done(doned);
20451
- validation.fail(failed);
20452
- return validation;
20453
- },
20454
- validate: function(doned, failed) {
20455
- var results, validator, _i, _len, _ref;
20462
+ };
20456
20463
 
20457
- if (this.validated && !this.dirty) {
20458
- return this.validation;
20459
- }
20460
- this.errors.clear();
20461
- results = [this];
20462
- _ref = model[this.resource.toString()].validators;
20463
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
20464
- validator = _ref[_i];
20465
- results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
20466
- }
20467
- this.validation = jQuery.when.apply(jQuery, results);
20468
- this.validation.done(doned);
20469
- this.validation.fail(failed);
20470
- return this.validation.done(function(record) {
20471
- var old_dirty;
20472
-
20473
- old_dirty = record.dirty;
20474
- record.dirty = null;
20475
- record.validated || (record.validated = true);
20476
- record.dirty = old_dirty;
20477
- return record;
20478
- });
20479
- }
20480
- }
20481
- };
20464
+ manager = {
20465
+ validators: {}
20466
+ };
20482
20467
 
20483
- manager = {
20484
- validators: {}
20485
- };
20468
+ model.mix(function(modelable) {
20469
+ jQuery.extend(modelable, extensions.model);
20470
+ jQuery.extend(modelable.record, extensions.record);
20471
+ modelable.after_mix.unshift(initializers.create_validators);
20472
+ modelable.record.after_initialize.push(initializers.define_triggers);
20473
+ return model.validators = manager.validators;
20474
+ });
20486
20475
 
20487
- model.mix(function(modelable) {
20488
- jQuery.extend(modelable, extensions.model);
20489
- jQuery.extend(modelable.record, extensions.record);
20490
- modelable.after_mix.unshift(initializers.create_validators);
20491
- modelable.record.after_initialize.push(initializers.define_triggers);
20492
- return model.validators = manager.validators;
20493
- });
20476
+ manager.validators.confirmation = require('./validations/confirmation');
20494
20477
 
20495
- manager.validators.confirmation = require('./validations/confirmation');
20478
+ manager.validators.associated = require('./validations/associated');
20496
20479
 
20497
- manager.validators.associated = require('./validations/associated');
20480
+ manager.validators.presence = require('./validations/presence');
20498
20481
 
20499
- manager.validators.presence = require('./validations/presence');
20482
+ manager.validators.remote = require('./validations/remote');
20500
20483
 
20501
- manager.validators.remote = require('./validations/remote');
20484
+ manager.validators.type = require('./validations/type');
20502
20485
 
20503
- manager.validators.type = require('./validations/type');
20486
+ manager.validators.cpf = require('./validations/cpf');
20504
20487
 
20505
- manager.validators.cpf = require('./validations/cpf');
20488
+ }).call(this);
20489
+ ;
20506
20490
 
20507
20491
  });
20508
20492
  require.register("indefinido-indemma/lib/extensions/rivets.js", function(exports, require, module){
@@ -32262,11 +32246,54 @@ require.register("ened/vendor/assets/javascripts/polyfills/es6-map-shim.js", fun
32262
32246
  }.call(this, window));
32263
32247
 
32264
32248
  });
32249
+
32250
+
32251
+
32252
+
32253
+
32254
+
32255
+
32256
+
32257
+
32258
+
32259
+
32260
+
32261
+
32262
+
32263
+
32264
+
32265
+
32266
+
32267
+
32268
+
32269
+
32270
+
32271
+
32272
+
32273
+
32274
+
32275
+
32276
+
32277
+
32278
+
32279
+
32280
+
32281
+
32282
+
32283
+
32284
+
32285
+
32286
+
32287
+
32288
+
32289
+
32290
+
32291
+
32292
+
32265
32293
  require.alias("mikeric-rivets/dist/rivets.js", "ened/deps/rivets/dist/rivets.js");
32266
32294
  require.alias("mikeric-rivets/dist/rivets.js", "ened/deps/rivets/index.js");
32267
32295
  require.alias("mikeric-rivets/dist/rivets.js", "rivets/index.js");
32268
32296
  require.alias("mikeric-rivets/dist/rivets.js", "mikeric-rivets/index.js");
32269
-
32270
32297
  require.alias("segmentio-extend/index.js", "ened/deps/extend/index.js");
32271
32298
  require.alias("segmentio-extend/index.js", "extend/index.js");
32272
32299
 
@@ -32274,12 +32301,10 @@ require.alias("pluma-assimilate/dist/assimilate.js", "ened/deps/assimilate/dist/
32274
32301
  require.alias("pluma-assimilate/dist/assimilate.js", "ened/deps/assimilate/index.js");
32275
32302
  require.alias("pluma-assimilate/dist/assimilate.js", "assimilate/index.js");
32276
32303
  require.alias("pluma-assimilate/dist/assimilate.js", "pluma-assimilate/index.js");
32277
-
32278
32304
  require.alias("paulmillr-es6-shim/es6-shim.js", "ened/deps/es6-shim/es6-shim.js");
32279
32305
  require.alias("paulmillr-es6-shim/es6-shim.js", "ened/deps/es6-shim/index.js");
32280
32306
  require.alias("paulmillr-es6-shim/es6-shim.js", "es6-shim/index.js");
32281
32307
  require.alias("paulmillr-es6-shim/es6-shim.js", "paulmillr-es6-shim/index.js");
32282
-
32283
32308
  require.alias("component-type/index.js", "ened/deps/type/index.js");
32284
32309
  require.alias("component-type/index.js", "type/index.js");
32285
32310
 
@@ -32297,7 +32322,6 @@ require.alias("components-modernizr/modernizr.js", "ened/deps/modernizr/moderniz
32297
32322
  require.alias("components-modernizr/modernizr.js", "ened/deps/modernizr/index.js");
32298
32323
  require.alias("components-modernizr/modernizr.js", "modernizr/index.js");
32299
32324
  require.alias("components-modernizr/modernizr.js", "components-modernizr/index.js");
32300
-
32301
32325
  require.alias("indefinido-indemma/index.js", "ened/deps/indemma/index.js");
32302
32326
  require.alias("indefinido-indemma/vendor/stampit.js", "ened/deps/indemma/vendor/stampit.js");
32303
32327
  require.alias("indefinido-indemma/vendor/sinon.js", "ened/deps/indemma/vendor/sinon.js");
@@ -32326,7 +32350,6 @@ require.alias("indefinido-indemma/index.js", "indemma/index.js");
32326
32350
  require.alias("pluma-assimilate/dist/assimilate.js", "indefinido-indemma/deps/assimilate/dist/assimilate.js");
32327
32351
  require.alias("pluma-assimilate/dist/assimilate.js", "indefinido-indemma/deps/assimilate/index.js");
32328
32352
  require.alias("pluma-assimilate/dist/assimilate.js", "pluma-assimilate/index.js");
32329
-
32330
32353
  require.alias("component-type/index.js", "indefinido-indemma/deps/type/index.js");
32331
32354
 
32332
32355
  require.alias("component-bind/index.js", "indefinido-indemma/deps/bind/index.js");
@@ -32401,6 +32424,4 @@ require.alias("component-value/index.js", "component-dom/deps/value/index.js");
32401
32424
  require.alias("component-type/index.js", "component-value/deps/type/index.js");
32402
32425
 
32403
32426
  require.alias("component-value/index.js", "component-value/index.js");
32404
-
32405
32427
  require.alias("component-query/index.js", "component-dom/deps/query/index.js");
32406
-