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.
- checksums.yaml +4 -4
- data/build/build.css +111 -0
- data/lib/assets/javascripts/aura/extensions/routes.js.coffee +9 -4
- data/lib/ende/version.rb +1 -1
- data/vendor/assets/components/ende_build.js +236 -215
- data/vendor/components/indefinido-indemma/build/development.js +21901 -44
- data/vendor/components/indefinido-indemma/build/release.js +208 -210
- data/vendor/components/indefinido-indemma/build/test.js +21901 -44
- data/vendor/components/indefinido-indemma/lib/record/rest.js +2 -7
- data/vendor/components/indefinido-indemma/lib/record/validatable.js +191 -206
- data/vendor/components/indefinido-indemma/src/lib/record/rest.coffee +1 -7
- data/vendor/components/indefinido-indemma/src/lib/record/validatable.coffee +1 -12
- metadata +4 -3
@@ -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
|
-
|
31
|
-
|
32
|
-
|
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;
|
@@ -20733,7 +20737,7 @@ model.pluralize = resourceable.pluralize;
|
|
20733
20737
|
|
20734
20738
|
});
|
20735
20739
|
require.register("indemma/lib/record/rest.js", function(exports, require, module){
|
20736
|
-
var $,
|
20740
|
+
var $, request;
|
20737
20741
|
|
20738
20742
|
$ = require('jquery');
|
20739
20743
|
|
@@ -20752,7 +20756,7 @@ module.exports = {
|
|
20752
20756
|
}
|
20753
20757
|
};
|
20754
20758
|
|
20755
|
-
|
20759
|
+
request = function(method, url, data) {
|
20756
20760
|
var param_name;
|
20757
20761
|
|
20758
20762
|
param_name = this.resource.param_name || this.resource.toString();
|
@@ -20764,11 +20768,6 @@ data_for = function(data) {
|
|
20764
20768
|
delete data[param_name]['id'];
|
20765
20769
|
delete data[param_name]['_id'];
|
20766
20770
|
}
|
20767
|
-
return data;
|
20768
|
-
};
|
20769
|
-
|
20770
|
-
request = function(method, url, data) {
|
20771
|
-
data = data_for.call(this, data);
|
20772
20771
|
return $.ajax({
|
20773
20772
|
url: url,
|
20774
20773
|
data: data,
|
@@ -21856,230 +21855,219 @@ module.exports = composed;
|
|
21856
21855
|
|
21857
21856
|
});
|
21858
21857
|
require.register("indemma/lib/record/validatable.js", function(exports, require, module){
|
21859
|
-
|
21858
|
+
(function() {
|
21859
|
+
var errorsable, extensions, initializers, manager, messages, observable, root, stampit, type;
|
21860
21860
|
|
21861
|
-
require('./translationable');
|
21861
|
+
require('./translationable');
|
21862
21862
|
|
21863
|
-
root = typeof exports !== "undefined" && exports !== null ? exports : this;
|
21863
|
+
root = typeof exports !== "undefined" && exports !== null ? exports : this;
|
21864
21864
|
|
21865
|
-
stampit = require('../../vendor/stampit');
|
21865
|
+
stampit = require('../../vendor/stampit');
|
21866
21866
|
|
21867
|
-
observable = require('observable').mixin;
|
21867
|
+
observable = require('observable').mixin;
|
21868
21868
|
|
21869
|
-
type = require('type');
|
21869
|
+
type = require('type');
|
21870
21870
|
|
21871
|
-
messages = {
|
21872
|
-
|
21873
|
-
attribute_name = this.human_attribute_name(attribute_name);
|
21874
|
-
return "O campo " + attribute_name + " não pode ficar em branco.";
|
21875
|
-
},
|
21876
|
-
cpf: function(attribute_name) {
|
21877
|
-
attribute_name = this.human_attribute_name(attribute_name);
|
21878
|
-
return "O campo " + attribute_name + " não está válido.";
|
21879
|
-
},
|
21880
|
-
confirmation: function(attribute_name) {
|
21881
|
-
var confirmation_attribute_name;
|
21882
|
-
|
21883
|
-
confirmation_attribute_name = this.human_attribute_name(attribute_name);
|
21884
|
-
attribute_name = this.human_attribute_name(attribute_name.replace('_confirmation', ''));
|
21885
|
-
return "O campo " + attribute_name + " não está de acordo com o campo " + confirmation_attribute_name + ".";
|
21886
|
-
},
|
21887
|
-
associated: function(attribute_name) {
|
21888
|
-
attribute_name = this.human_attribute_name(attribute_name);
|
21889
|
-
return "O registro associado " + attribute_name + " não é válido.";
|
21890
|
-
},
|
21891
|
-
server: function(attribute_name, options) {
|
21892
|
-
if (attribute_name === 'base') {
|
21893
|
-
return options.server_message;
|
21894
|
-
} else {
|
21871
|
+
messages = {
|
21872
|
+
blank: function(attribute_name) {
|
21895
21873
|
attribute_name = this.human_attribute_name(attribute_name);
|
21896
|
-
return "" + attribute_name + "
|
21874
|
+
return "O campo " + attribute_name + " não pode ficar em branco.";
|
21875
|
+
},
|
21876
|
+
cpf: function(attribute_name) {
|
21877
|
+
attribute_name = this.human_attribute_name(attribute_name);
|
21878
|
+
return "O campo " + attribute_name + " não está válido.";
|
21879
|
+
},
|
21880
|
+
confirmation: function(attribute_name) {
|
21881
|
+
var confirmation_attribute_name;
|
21882
|
+
confirmation_attribute_name = this.human_attribute_name(attribute_name);
|
21883
|
+
attribute_name = this.human_attribute_name(attribute_name.replace('_confirmation', ''));
|
21884
|
+
return "O campo " + attribute_name + " não está de acordo com o campo " + confirmation_attribute_name + ".";
|
21885
|
+
},
|
21886
|
+
associated: function(attribute_name) {
|
21887
|
+
attribute_name = this.human_attribute_name(attribute_name);
|
21888
|
+
return "O registro associado " + attribute_name + " não é válido.";
|
21889
|
+
},
|
21890
|
+
server: function(attribute_name, options) {
|
21891
|
+
if (attribute_name === 'base') {
|
21892
|
+
return options.server_message;
|
21893
|
+
} else {
|
21894
|
+
attribute_name = this.human_attribute_name(attribute_name);
|
21895
|
+
return "" + attribute_name + " " + options.server_message + ".";
|
21896
|
+
}
|
21897
|
+
},
|
21898
|
+
type: function(attribute_name, options) {
|
21899
|
+
attribute_name = this.human_attribute_name(attribute_name);
|
21900
|
+
return "O campo " + attribute_name + " não está válido.";
|
21897
21901
|
}
|
21898
|
-
}
|
21899
|
-
type: function(attribute_name, options) {
|
21900
|
-
attribute_name = this.human_attribute_name(attribute_name);
|
21901
|
-
return "O campo " + attribute_name + " não está válido.";
|
21902
|
-
}
|
21903
|
-
};
|
21904
|
-
|
21905
|
-
errorsable = stampit({
|
21906
|
-
add: function(attribute_name, message_key, options) {
|
21907
|
-
var translator;
|
21902
|
+
};
|
21908
21903
|
|
21909
|
-
|
21910
|
-
|
21911
|
-
|
21912
|
-
|
21913
|
-
|
21914
|
-
|
21915
|
-
|
21916
|
-
|
21917
|
-
|
21918
|
-
|
21919
|
-
|
21904
|
+
errorsable = stampit({
|
21905
|
+
add: function(attribute_name, message_key, options) {
|
21906
|
+
var translator;
|
21907
|
+
this.push([attribute_name, message_key, options]);
|
21908
|
+
this.messages[attribute_name] = '';
|
21909
|
+
translator = messages[message_key];
|
21910
|
+
if (translator != null) {
|
21911
|
+
return this.messages[attribute_name] += translator.call(this.model, attribute_name, options);
|
21912
|
+
} else {
|
21913
|
+
return this.messages[attribute_name] += message_key;
|
21914
|
+
}
|
21915
|
+
},
|
21916
|
+
clear: function() {
|
21917
|
+
var attribute_name, _results;
|
21918
|
+
if (this.length) {
|
21919
|
+
this.length = 0;
|
21920
|
+
_results = [];
|
21921
|
+
for (attribute_name in this.messages) {
|
21922
|
+
_results.push(this.messages[attribute_name] = null);
|
21923
|
+
}
|
21924
|
+
return _results;
|
21925
|
+
}
|
21926
|
+
},
|
21927
|
+
push: Array.prototype.push,
|
21928
|
+
splice: Array.prototype.splice,
|
21929
|
+
indexOf: Array.prototype.indexOf
|
21930
|
+
}, {
|
21931
|
+
model: null,
|
21932
|
+
messages: null,
|
21933
|
+
length: 0
|
21934
|
+
}, function() {
|
21935
|
+
this.messages = {};
|
21936
|
+
return this;
|
21937
|
+
});
|
21920
21938
|
|
21921
|
-
|
21922
|
-
|
21939
|
+
initializers = {
|
21940
|
+
define_triggers: function() {
|
21941
|
+
this.errors = errorsable({
|
21942
|
+
model: model[this.resource]
|
21943
|
+
});
|
21944
|
+
this.before('save', function() {
|
21945
|
+
if (this.save) return this.validate();
|
21946
|
+
});
|
21947
|
+
this.validated = false;
|
21948
|
+
this.subscribe('dirty', function(value) {
|
21949
|
+
return value && (this.validated = false);
|
21950
|
+
});
|
21951
|
+
return Object.defineProperty(this, 'valid', {
|
21952
|
+
get: function() {
|
21953
|
+
this.validate();
|
21954
|
+
if (this.validation.state() === 'resolved') {
|
21955
|
+
return !this.errors.length;
|
21956
|
+
} else {
|
21957
|
+
return null;
|
21958
|
+
}
|
21959
|
+
},
|
21960
|
+
set: function() {
|
21961
|
+
throw new TypeError("You can't set the value for the valid property.");
|
21962
|
+
},
|
21963
|
+
enumerable: false
|
21964
|
+
});
|
21965
|
+
},
|
21966
|
+
create_validators: function(definitions) {
|
21967
|
+
var definition, name, validator, validator_options, _ref, _results;
|
21968
|
+
this.validators = [];
|
21969
|
+
_ref = manager.validators;
|
21923
21970
|
_results = [];
|
21924
|
-
for (
|
21925
|
-
|
21971
|
+
for (name in _ref) {
|
21972
|
+
validator = _ref[name];
|
21973
|
+
definition = definitions[validator.definition_key];
|
21974
|
+
if (definition) {
|
21975
|
+
if (type(definition) !== 'array') definition = [definition];
|
21976
|
+
_results.push((function() {
|
21977
|
+
var _i, _len, _results2;
|
21978
|
+
_results2 = [];
|
21979
|
+
for (_i = 0, _len = definition.length; _i < _len; _i++) {
|
21980
|
+
validator_options = definition[_i];
|
21981
|
+
if (type(validator_options) !== 'object') {
|
21982
|
+
validator_options = {
|
21983
|
+
attribute_name: validator_options
|
21984
|
+
};
|
21985
|
+
}
|
21986
|
+
validator_options.model = this;
|
21987
|
+
this.validators.push(validator(validator_options));
|
21988
|
+
_results2.push(delete definitions[validator.definition_key]);
|
21989
|
+
}
|
21990
|
+
return _results2;
|
21991
|
+
}).call(this));
|
21992
|
+
} else {
|
21993
|
+
_results.push(void 0);
|
21994
|
+
}
|
21926
21995
|
}
|
21927
21996
|
return _results;
|
21928
21997
|
}
|
21929
|
-
}
|
21930
|
-
push: Array.prototype.push,
|
21931
|
-
splice: Array.prototype.splice,
|
21932
|
-
indexOf: Array.prototype.indexOf
|
21933
|
-
}, {
|
21934
|
-
model: null,
|
21935
|
-
messages: null,
|
21936
|
-
length: 0
|
21937
|
-
}, function() {
|
21938
|
-
this.messages = {};
|
21939
|
-
return this;
|
21940
|
-
});
|
21998
|
+
};
|
21941
21999
|
|
21942
|
-
|
21943
|
-
|
21944
|
-
|
21945
|
-
|
21946
|
-
|
21947
|
-
|
21948
|
-
|
21949
|
-
|
21950
|
-
|
21951
|
-
|
21952
|
-
|
21953
|
-
|
21954
|
-
|
21955
|
-
|
21956
|
-
|
21957
|
-
|
21958
|
-
|
21959
|
-
|
21960
|
-
|
21961
|
-
|
21962
|
-
return null;
|
21963
|
-
}
|
21964
|
-
},
|
21965
|
-
set: function() {
|
21966
|
-
throw new TypeError("You can't set the value for the valid property.");
|
22000
|
+
extensions = {
|
22001
|
+
model: {
|
22002
|
+
validators: null
|
22003
|
+
},
|
22004
|
+
record: {
|
22005
|
+
validate_attribute: function(attribute, doned, failed) {
|
22006
|
+
var results, validation, validator, _i, _len, _ref;
|
22007
|
+
this.errors.messages[attribute] = null;
|
22008
|
+
results = [this, attribute];
|
22009
|
+
_ref = model[this.resource.toString()].validators;
|
22010
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
22011
|
+
validator = _ref[_i];
|
22012
|
+
if (validator.attribute_name === attribute) {
|
22013
|
+
results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
|
22014
|
+
}
|
22015
|
+
}
|
22016
|
+
validation = jQuery.when.apply(jQuery, results);
|
22017
|
+
validation.done(doned);
|
22018
|
+
validation.fail(failed);
|
22019
|
+
return validation;
|
21967
22020
|
},
|
21968
|
-
|
21969
|
-
|
21970
|
-
|
21971
|
-
|
21972
|
-
|
21973
|
-
|
21974
|
-
|
21975
|
-
|
21976
|
-
|
21977
|
-
|
21978
|
-
|
21979
|
-
|
21980
|
-
|
21981
|
-
|
21982
|
-
|
21983
|
-
|
21984
|
-
|
21985
|
-
|
21986
|
-
|
21987
|
-
|
21988
|
-
|
21989
|
-
validator_options = definition[_i];
|
21990
|
-
if (type(validator_options) !== 'object') {
|
21991
|
-
validator_options = {
|
21992
|
-
attribute_name: validator_options
|
21993
|
-
};
|
21994
|
-
}
|
21995
|
-
validator_options.model = this;
|
21996
|
-
this.validators.push(validator(validator_options));
|
21997
|
-
_results1.push(delete definitions[validator.definition_key]);
|
21998
|
-
}
|
21999
|
-
return _results1;
|
22000
|
-
}).call(this));
|
22001
|
-
} else {
|
22002
|
-
_results.push(void 0);
|
22021
|
+
validate: function(doned, failed) {
|
22022
|
+
var results, validator, _i, _len, _ref;
|
22023
|
+
if (this.validated && !this.dirty) return this.validation;
|
22024
|
+
this.errors.clear();
|
22025
|
+
results = [this];
|
22026
|
+
_ref = model[this.resource.toString()].validators;
|
22027
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
22028
|
+
validator = _ref[_i];
|
22029
|
+
results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
|
22030
|
+
}
|
22031
|
+
this.validation = jQuery.when.apply(jQuery, results);
|
22032
|
+
this.validation.done(doned);
|
22033
|
+
this.validation.fail(failed);
|
22034
|
+
return this.validation.done(function(record) {
|
22035
|
+
var old_dirty;
|
22036
|
+
old_dirty = record.dirty;
|
22037
|
+
record.dirty = null;
|
22038
|
+
record.validated || (record.validated = true);
|
22039
|
+
if (record.dirty !== old_dirty) record.dirty = old_dirty;
|
22040
|
+
return record;
|
22041
|
+
});
|
22003
22042
|
}
|
22004
22043
|
}
|
22005
|
-
|
22006
|
-
}
|
22007
|
-
};
|
22008
|
-
|
22009
|
-
extensions = {
|
22010
|
-
model: {
|
22011
|
-
validators: null
|
22012
|
-
},
|
22013
|
-
record: {
|
22014
|
-
validate_attribute: function(attribute, doned, failed) {
|
22015
|
-
var results, validation, validator, _i, _len, _ref;
|
22016
|
-
|
22017
|
-
this.errors.messages[attribute] = null;
|
22018
|
-
results = [this, attribute];
|
22019
|
-
_ref = model[this.resource.toString()].validators;
|
22020
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
22021
|
-
validator = _ref[_i];
|
22022
|
-
if (validator.attribute_name === attribute) {
|
22023
|
-
results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
|
22024
|
-
}
|
22025
|
-
}
|
22026
|
-
validation = jQuery.when.apply(jQuery, results);
|
22027
|
-
validation.done(doned);
|
22028
|
-
validation.fail(failed);
|
22029
|
-
return validation;
|
22030
|
-
},
|
22031
|
-
validate: function(doned, failed) {
|
22032
|
-
var results, validator, _i, _len, _ref;
|
22044
|
+
};
|
22033
22045
|
|
22034
|
-
|
22035
|
-
|
22036
|
-
|
22037
|
-
this.errors.clear();
|
22038
|
-
results = [this];
|
22039
|
-
_ref = model[this.resource.toString()].validators;
|
22040
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
22041
|
-
validator = _ref[_i];
|
22042
|
-
results.push(validator.validate_each(this, validator.attribute_name, this[validator.attribute_name]));
|
22043
|
-
}
|
22044
|
-
this.validation = jQuery.when.apply(jQuery, results);
|
22045
|
-
this.validation.done(doned);
|
22046
|
-
this.validation.fail(failed);
|
22047
|
-
return this.validation.done(function(record) {
|
22048
|
-
var old_dirty;
|
22049
|
-
|
22050
|
-
old_dirty = record.dirty;
|
22051
|
-
record.dirty = null;
|
22052
|
-
record.validated || (record.validated = true);
|
22053
|
-
record.dirty = old_dirty;
|
22054
|
-
return record;
|
22055
|
-
});
|
22056
|
-
}
|
22057
|
-
}
|
22058
|
-
};
|
22046
|
+
manager = {
|
22047
|
+
validators: {}
|
22048
|
+
};
|
22059
22049
|
|
22060
|
-
|
22061
|
-
|
22062
|
-
|
22050
|
+
model.mix(function(modelable) {
|
22051
|
+
jQuery.extend(modelable, extensions.model);
|
22052
|
+
jQuery.extend(modelable.record, extensions.record);
|
22053
|
+
modelable.after_mix.unshift(initializers.create_validators);
|
22054
|
+
modelable.record.after_initialize.push(initializers.define_triggers);
|
22055
|
+
return model.validators = manager.validators;
|
22056
|
+
});
|
22063
22057
|
|
22064
|
-
|
22065
|
-
jQuery.extend(modelable, extensions.model);
|
22066
|
-
jQuery.extend(modelable.record, extensions.record);
|
22067
|
-
modelable.after_mix.unshift(initializers.create_validators);
|
22068
|
-
modelable.record.after_initialize.push(initializers.define_triggers);
|
22069
|
-
return model.validators = manager.validators;
|
22070
|
-
});
|
22058
|
+
manager.validators.confirmation = require('./validations/confirmation');
|
22071
22059
|
|
22072
|
-
manager.validators.
|
22060
|
+
manager.validators.associated = require('./validations/associated');
|
22073
22061
|
|
22074
|
-
manager.validators.
|
22062
|
+
manager.validators.presence = require('./validations/presence');
|
22075
22063
|
|
22076
|
-
manager.validators.
|
22064
|
+
manager.validators.remote = require('./validations/remote');
|
22077
22065
|
|
22078
|
-
manager.validators.
|
22066
|
+
manager.validators.type = require('./validations/type');
|
22079
22067
|
|
22080
|
-
manager.validators.
|
22068
|
+
manager.validators.cpf = require('./validations/cpf');
|
22081
22069
|
|
22082
|
-
|
22070
|
+
}).call(this);
|
22083
22071
|
|
22084
22072
|
});
|
22085
22073
|
require.register("indemma/lib/extensions/rivets.js", function(exports, require, module){
|
@@ -22108,11 +22096,22 @@ model.rivets = function() {
|
|
22108
22096
|
};
|
22109
22097
|
|
22110
22098
|
});
|
22099
|
+
|
22100
|
+
|
22101
|
+
|
22102
|
+
|
22103
|
+
|
22104
|
+
|
22105
|
+
|
22106
|
+
|
22107
|
+
|
22108
|
+
|
22109
|
+
|
22110
|
+
|
22111
22111
|
require.alias("pluma-assimilate/dist/assimilate.js", "indemma/deps/assimilate/dist/assimilate.js");
|
22112
22112
|
require.alias("pluma-assimilate/dist/assimilate.js", "indemma/deps/assimilate/index.js");
|
22113
22113
|
require.alias("pluma-assimilate/dist/assimilate.js", "assimilate/index.js");
|
22114
22114
|
require.alias("pluma-assimilate/dist/assimilate.js", "pluma-assimilate/index.js");
|
22115
|
-
|
22116
22115
|
require.alias("component-type/index.js", "indemma/deps/type/index.js");
|
22117
22116
|
require.alias("component-type/index.js", "type/index.js");
|
22118
22117
|
|
@@ -22138,4 +22137,3 @@ require.alias("indefinido-advisable/index.js", "indemma/deps/advisable/index.js"
|
|
22138
22137
|
require.alias("indefinido-advisable/lib/advisable.js", "indemma/deps/advisable/lib/advisable.js");
|
22139
22138
|
require.alias("indefinido-advisable/index.js", "advisable/index.js");
|
22140
22139
|
require.alias("component-jquery/index.js", "indefinido-advisable/deps/jquery/index.js");
|
22141
|
-
|