admin-config
Advanced tools
Comparing version 0.12.2 to 0.12.3
@@ -25,3 +25,3 @@ 'use strict'; | ||
var _UtilsOrderElement = require('./Utils/orderElement'); | ||
var _UtilsOrderElement = require("./Utils/orderElement"); | ||
@@ -32,4 +32,4 @@ var _UtilsOrderElement2 = _interopRequireDefault(_UtilsOrderElement); | ||
function Application() { | ||
var title = arguments[0] === undefined ? 'ng-admin' : arguments[0]; | ||
var debug = arguments[1] === undefined ? true : arguments[1]; | ||
var title = arguments.length <= 0 || arguments[0] === undefined ? 'ng-admin' : arguments[0]; | ||
var debug = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; | ||
@@ -117,4 +117,2 @@ _classCallCheck(this, Application); | ||
} | ||
}, { | ||
key: 'menu', | ||
@@ -139,2 +137,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'menu', | ||
value: function menu(_menu) { | ||
@@ -222,3 +222,3 @@ if (!arguments.length) { | ||
if (!entity) { | ||
throw new Error('No entity given'); | ||
throw new Error("No entity given"); | ||
} | ||
@@ -286,3 +286,3 @@ | ||
key: 'entities', | ||
get: function () { | ||
get: function get() { | ||
return this._entities; | ||
@@ -289,0 +289,0 @@ } |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -14,3 +16,3 @@ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,12 +24,10 @@ var _ViewListView = require('./View/ListView'); | ||
var Collection = (function (_ListView) { | ||
_inherits(Collection, _ListView); | ||
function Collection() { | ||
_classCallCheck(this, Collection); | ||
if (_ListView != null) { | ||
_ListView.apply(this, arguments); | ||
} | ||
_get(Object.getPrototypeOf(Collection.prototype), 'constructor', this).apply(this, arguments); | ||
} | ||
_inherits(Collection, _ListView); | ||
_createClass(Collection, [{ | ||
@@ -34,0 +34,0 @@ key: 'setEntity', |
@@ -39,4 +39,2 @@ 'use strict'; | ||
} | ||
}, { | ||
key: 'getFirstEntry', | ||
@@ -48,4 +46,6 @@ /** | ||
*/ | ||
}, { | ||
key: 'getFirstEntry', | ||
value: function getFirstEntry(name) { | ||
var filter = arguments[1] === undefined ? function () { | ||
var filter = arguments.length <= 1 || arguments[1] === undefined ? function () { | ||
return true; | ||
@@ -52,0 +52,0 @@ } : arguments[1]; |
@@ -21,35 +21,35 @@ "use strict"; | ||
var _ViewDashboardView = require("../View/DashboardView"); | ||
var _ViewDashboardView = require('../View/DashboardView'); | ||
var _ViewDashboardView2 = _interopRequireDefault(_ViewDashboardView); | ||
var _ViewMenuView = require("../View/MenuView"); | ||
var _ViewMenuView = require('../View/MenuView'); | ||
var _ViewMenuView2 = _interopRequireDefault(_ViewMenuView); | ||
var _ViewListView = require("../View/ListView"); | ||
var _ViewListView = require('../View/ListView'); | ||
var _ViewListView2 = _interopRequireDefault(_ViewListView); | ||
var _ViewCreateView = require("../View/CreateView"); | ||
var _ViewCreateView = require('../View/CreateView'); | ||
var _ViewCreateView2 = _interopRequireDefault(_ViewCreateView); | ||
var _ViewEditView = require("../View/EditView"); | ||
var _ViewEditView = require('../View/EditView'); | ||
var _ViewEditView2 = _interopRequireDefault(_ViewEditView); | ||
var _ViewDeleteView = require("../View/DeleteView"); | ||
var _ViewDeleteView = require('../View/DeleteView'); | ||
var _ViewDeleteView2 = _interopRequireDefault(_ViewDeleteView); | ||
var _ViewShowView = require("../View/ShowView"); | ||
var _ViewShowView = require('../View/ShowView'); | ||
var _ViewShowView2 = _interopRequireDefault(_ViewShowView); | ||
var _ViewBatchDeleteView = require("../View/BatchDeleteView"); | ||
var _ViewBatchDeleteView = require('../View/BatchDeleteView'); | ||
var _ViewBatchDeleteView2 = _interopRequireDefault(_ViewBatchDeleteView); | ||
var _ViewExportView = require("../View/ExportView"); | ||
var _ViewExportView = require('../View/ExportView'); | ||
@@ -65,3 +65,3 @@ var _ViewExportView2 = _interopRequireDefault(_ViewExportView); | ||
this._name = name; | ||
this._uniqueId = this._name + "_" + index++; | ||
this._uniqueId = this._name + '_' + index++; | ||
this._baseApiUrl = null; | ||
@@ -178,3 +178,3 @@ this._label = null; | ||
if (!(value instanceof _FieldField2["default"])) { | ||
throw new Error("Entity " + this.name() + ": identifier must be an instance of Field."); | ||
throw new Error('Entity ' + this.name() + ': identifier must be an instance of Field.'); | ||
} | ||
@@ -199,3 +199,3 @@ this._identifierField = value; | ||
value: function getErrorMessage(response) { | ||
if (typeof this._errorMessage === "function") { | ||
if (typeof this._errorMessage === 'function') { | ||
return this._errorMessage(response); | ||
@@ -230,3 +230,3 @@ } | ||
value: function getUrl(viewType, identifierValue, identifierName) { | ||
if (typeof this._url === "function") { | ||
if (typeof this._url === 'function') { | ||
return this._url(this.name(), viewType, identifierValue, identifierName); | ||
@@ -267,3 +267,3 @@ } | ||
key: "uniqueId", | ||
get: function () { | ||
get: function get() { | ||
return this._uniqueId; | ||
@@ -273,3 +273,3 @@ } | ||
key: "views", | ||
get: function () { | ||
get: function get() { | ||
return this._views; | ||
@@ -279,3 +279,3 @@ } | ||
key: "isReadOnly", | ||
get: function () { | ||
get: function get() { | ||
return this._isReadOnly; | ||
@@ -282,0 +282,0 @@ } |
@@ -45,3 +45,3 @@ 'use strict'; | ||
key: 'entityName', | ||
get: function () { | ||
get: function get() { | ||
return this._entityName; | ||
@@ -51,3 +51,3 @@ } | ||
key: 'identifierValue', | ||
get: function () { | ||
get: function get() { | ||
return this._identifierValue; | ||
@@ -64,4 +64,2 @@ } | ||
} | ||
}, { | ||
key: 'createFromRest', | ||
@@ -73,6 +71,8 @@ /** | ||
*/ | ||
}, { | ||
key: 'createFromRest', | ||
value: function createFromRest(restEntry) { | ||
var fields = arguments[1] === undefined ? [] : arguments[1]; | ||
var entityName = arguments[2] === undefined ? '' : arguments[2]; | ||
var identifierName = arguments[3] === undefined ? 'id' : arguments[3]; | ||
var fields = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; | ||
var entityName = arguments.length <= 2 || arguments[2] === undefined ? '' : arguments[2]; | ||
var identifierName = arguments.length <= 3 || arguments[3] === undefined ? 'id' : arguments[3]; | ||
@@ -97,4 +97,2 @@ if (!restEntry || Object.keys(restEntry).length == 0) { | ||
} | ||
}, { | ||
key: 'createArrayFromRest', | ||
@@ -106,2 +104,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'createArrayFromRest', | ||
value: function createArrayFromRest(restEntries, fields, entityName, identifierName) { | ||
@@ -108,0 +108,0 @@ return restEntries.map(function (e) { |
@@ -113,15 +113,15 @@ "use strict"; | ||
var _MenuMenu = require("./Menu/Menu"); | ||
var _MenuMenu = require('./Menu/Menu'); | ||
var _MenuMenu2 = _interopRequireDefault(_MenuMenu); | ||
var _Collection = require("./Collection"); | ||
var _Collection = require('./Collection'); | ||
var _Collection2 = _interopRequireDefault(_Collection); | ||
var _Dashboard = require("./Dashboard"); | ||
var _Dashboard = require('./Dashboard'); | ||
var _Dashboard2 = _interopRequireDefault(_Dashboard); | ||
var _Entry = require("./Entry"); | ||
var _Entry = require('./Entry'); | ||
@@ -151,3 +151,3 @@ var _Entry2 = _interopRequireDefault(_Entry); | ||
value: function field(name, type) { | ||
type = type || "string"; | ||
type = type || 'string'; | ||
@@ -221,21 +221,21 @@ if (!(type in this._fieldTypes)) { | ||
value: function _init() { | ||
this.registerFieldType("boolean", _FieldBooleanField2["default"]); | ||
this.registerFieldType("choice", _FieldChoiceField2["default"]); | ||
this.registerFieldType("choices", _FieldChoicesField2["default"]); | ||
this.registerFieldType("date", _FieldDateField2["default"]); | ||
this.registerFieldType("datetime", _FieldDateTimeField2["default"]); | ||
this.registerFieldType("email", _FieldEmailField2["default"]); | ||
this.registerFieldType("embedded_list", _FieldEmbeddedListField2["default"]); | ||
this.registerFieldType("float", _FieldFloatFieldJs2["default"]); | ||
this.registerFieldType("string", _FieldField2["default"]); | ||
this.registerFieldType("file", _FieldFileField2["default"]); | ||
this.registerFieldType("json", _FieldJsonField2["default"]); | ||
this.registerFieldType("number", _FieldNumberField2["default"]); | ||
this.registerFieldType("password", _FieldPasswordField2["default"]); | ||
this.registerFieldType("reference", _FieldReferenceField2["default"]); | ||
this.registerFieldType("reference_many", _FieldReferenceManyField2["default"]); | ||
this.registerFieldType("referenced_list", _FieldReferencedListField2["default"]); | ||
this.registerFieldType("template", _FieldTemplateField2["default"]); | ||
this.registerFieldType("text", _FieldTextField2["default"]); | ||
this.registerFieldType("wysiwyg", _FieldWysiwygField2["default"]); | ||
this.registerFieldType('boolean', _FieldBooleanField2["default"]); | ||
this.registerFieldType('choice', _FieldChoiceField2["default"]); | ||
this.registerFieldType('choices', _FieldChoicesField2["default"]); | ||
this.registerFieldType('date', _FieldDateField2["default"]); | ||
this.registerFieldType('datetime', _FieldDateTimeField2["default"]); | ||
this.registerFieldType('email', _FieldEmailField2["default"]); | ||
this.registerFieldType('embedded_list', _FieldEmbeddedListField2["default"]); | ||
this.registerFieldType('float', _FieldFloatFieldJs2["default"]); | ||
this.registerFieldType('string', _FieldField2["default"]); | ||
this.registerFieldType('file', _FieldFileField2["default"]); | ||
this.registerFieldType('json', _FieldJsonField2["default"]); | ||
this.registerFieldType('number', _FieldNumberField2["default"]); | ||
this.registerFieldType('password', _FieldPasswordField2["default"]); | ||
this.registerFieldType('reference', _FieldReferenceField2["default"]); | ||
this.registerFieldType('reference_many', _FieldReferenceManyField2["default"]); | ||
this.registerFieldType('referenced_list', _FieldReferencedListField2["default"]); | ||
this.registerFieldType('template', _FieldTemplateField2["default"]); | ||
this.registerFieldType('text', _FieldTextField2["default"]); | ||
this.registerFieldType('wysiwyg', _FieldWysiwygField2["default"]); | ||
} | ||
@@ -242,0 +242,0 @@ }]); |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _ChoiceField2 = require("./ChoiceField"); | ||
var BooleanField = (function (_ChoiceField) { | ||
_inherits(BooleanField, _ChoiceField); | ||
function BooleanField(name) { | ||
@@ -30,8 +32,6 @@ _classCallCheck(this, BooleanField); | ||
this._type = "boolean"; | ||
this._choices = [{ value: null, label: "undefined" }, { value: true, label: "true" }, { value: false, label: "false" }]; | ||
this._filterChoices = [{ value: true, label: "true" }, { value: false, label: "false" }]; | ||
this._choices = [{ value: null, label: 'undefined' }, { value: true, label: 'true' }, { value: false, label: 'false' }]; | ||
this._filterChoices = [{ value: true, label: 'true' }, { value: false, label: 'false' }]; | ||
} | ||
_inherits(BooleanField, _ChoiceField); | ||
_createClass(BooleanField, [{ | ||
@@ -38,0 +38,0 @@ key: "filterChoices", |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _Field2 = require("./Field"); | ||
var ChoiceField = (function (_Field) { | ||
_inherits(ChoiceField, _Field); | ||
function ChoiceField(name) { | ||
@@ -33,4 +35,2 @@ _classCallCheck(this, ChoiceField); | ||
_inherits(ChoiceField, _Field); | ||
_createClass(ChoiceField, [{ | ||
@@ -47,3 +47,3 @@ key: "choices", | ||
value: function getLabelForChoice(value, entry) { | ||
var choices = typeof this._choices === "function" ? this._choices(entry) : this._choices; | ||
var choices = typeof this._choices === 'function' ? this._choices(entry) : this._choices; | ||
var choice = choices.filter(function (c) { | ||
@@ -50,0 +50,0 @@ return c.value == value; |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _ChoiceField2 = require("./ChoiceField"); | ||
var ChoicesField = (function (_ChoiceField) { | ||
_inherits(ChoicesField, _ChoiceField); | ||
function ChoicesField(name) { | ||
@@ -30,4 +32,2 @@ _classCallCheck(this, ChoicesField); | ||
_inherits(ChoicesField, _ChoiceField); | ||
return ChoicesField; | ||
@@ -34,0 +34,0 @@ })(_ChoiceField3["default"]); |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _Field2 = require("./Field"); | ||
var DateField = (function (_Field) { | ||
_inherits(DateField, _Field); | ||
function DateField(name) { | ||
@@ -46,4 +48,2 @@ _classCallCheck(this, DateField); | ||
_inherits(DateField, _Field); | ||
_createClass(DateField, [{ | ||
@@ -50,0 +50,0 @@ key: "format", |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _DateField2 = require("./DateField"); | ||
var DateTimeField = (function (_DateField) { | ||
_inherits(DateTimeField, _DateField); | ||
function DateTimeField(name) { | ||
@@ -33,7 +35,5 @@ _classCallCheck(this, DateTimeField); | ||
this._type = "datetime"; | ||
this._type = 'datetime'; | ||
} | ||
_inherits(DateTimeField, _DateField); | ||
return DateTimeField; | ||
@@ -40,0 +40,0 @@ })(_DateField3["default"]); |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _Field2 = require("./Field"); | ||
var EmailField = (function (_Field) { | ||
_inherits(EmailField, _Field); | ||
function EmailField(name) { | ||
@@ -30,4 +32,2 @@ _classCallCheck(this, EmailField); | ||
_inherits(EmailField, _Field); | ||
return EmailField; | ||
@@ -34,0 +34,0 @@ })(_Field3["default"]); |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -50,2 +50,4 @@ var _Field2 = require("./Field"); | ||
var EmbeddedListField = (function (_Field) { | ||
_inherits(EmbeddedListField, _Field); | ||
function EmbeddedListField(name) { | ||
@@ -55,3 +57,3 @@ _classCallCheck(this, EmbeddedListField); | ||
_get(Object.getPrototypeOf(EmbeddedListField.prototype), "constructor", this).call(this, name); | ||
this._type = "embedded_list"; | ||
this._type = 'embedded_list'; | ||
this._flattenable = false; | ||
@@ -66,12 +68,10 @@ this._targetEntity = new _EntityEntity2["default"](); // link to an empty entity by default | ||
_inherits(EmbeddedListField, _Field); | ||
/** | ||
* Optionally set the target Entity | ||
* | ||
* Useful if the embedded entries can be edited in standalone | ||
*/ | ||
_createClass(EmbeddedListField, [{ | ||
key: "targetEntity", | ||
/** | ||
* Optionally set the target Entity | ||
* | ||
* Useful if the embedded entries can be edited in standalone | ||
*/ | ||
value: function targetEntity(entity) { | ||
@@ -85,4 +85,2 @@ if (!arguments.length) { | ||
} | ||
}, { | ||
key: "targetFields", | ||
@@ -100,2 +98,4 @@ /** | ||
*/ | ||
}, { | ||
key: "targetFields", | ||
value: function targetFields(value) { | ||
@@ -107,4 +107,2 @@ if (!arguments.length) return this._targetFields; | ||
} | ||
}, { | ||
key: "sortField", | ||
@@ -116,2 +114,4 @@ /** | ||
*/ | ||
}, { | ||
key: "sortField", | ||
value: function sortField() { | ||
@@ -125,4 +125,2 @@ if (arguments.length) { | ||
} | ||
}, { | ||
key: "sortDir", | ||
@@ -134,2 +132,4 @@ /** | ||
*/ | ||
}, { | ||
key: "sortDir", | ||
value: function sortDir() { | ||
@@ -154,4 +154,2 @@ if (arguments.length) { | ||
} | ||
}, { | ||
key: "permanentFilters", | ||
@@ -168,2 +166,4 @@ /** | ||
*/ | ||
}, { | ||
key: "permanentFilters", | ||
value: function permanentFilters(filters) { | ||
@@ -170,0 +170,0 @@ if (!arguments.length) { |
@@ -22,3 +22,3 @@ "use strict"; | ||
this._name = name || Math.random().toString(36).substring(7); | ||
this._detailLink = name === "id"; | ||
this._detailLink = name === 'id'; | ||
this._type = "string"; | ||
@@ -35,3 +35,3 @@ this._order = null; | ||
this._sortable = true; | ||
this._detailLinkRoute = "edit"; | ||
this._detailLinkRoute = 'edit'; | ||
this._pinned = false; | ||
@@ -42,3 +42,3 @@ this._flattenable = true; | ||
this._template = function () { | ||
return ""; | ||
return ''; | ||
}; | ||
@@ -82,3 +82,3 @@ this._templateIncludesLabel = false; | ||
if (arguments[1] !== true) { | ||
console.warn("Setting order with Field.order is deprecated, order directly in fields array"); | ||
console.warn('Setting order with Field.order is deprecated, order directly in fields array'); | ||
} | ||
@@ -100,3 +100,3 @@ this._order = arguments[0]; | ||
if (this._detailLink === null) { | ||
return this._name === "id"; | ||
return this._name === 'id'; | ||
} | ||
@@ -137,4 +137,2 @@ | ||
} | ||
}, { | ||
key: "transform", | ||
@@ -144,2 +142,4 @@ /** | ||
*/ | ||
}, { | ||
key: "transform", | ||
value: function transform(fn) { | ||
@@ -192,10 +192,10 @@ if (!fn) return this._transforms; | ||
if (!this._cssClasses) { | ||
return ""; | ||
return ''; | ||
} | ||
if (this._cssClasses.constructor === Array) { | ||
return this._cssClasses.join(" "); | ||
return this._cssClasses.join(' '); | ||
} | ||
if (typeof this._cssClasses === "function") { | ||
if (typeof this._cssClasses === 'function') { | ||
return this._cssClasses(entry); | ||
@@ -267,3 +267,3 @@ } | ||
value: function getTemplateValue(data) { | ||
if (typeof this._template === "function") { | ||
if (typeof this._template === 'function') { | ||
return this._template(data); | ||
@@ -289,3 +289,3 @@ } | ||
value: function template(_template) { | ||
var templateIncludesLabel = arguments[1] === undefined ? false : arguments[1]; | ||
var templateIncludesLabel = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; | ||
@@ -299,3 +299,3 @@ if (!arguments.length) return this._template; | ||
key: "detailLink", | ||
set: function (isDetailLink) { | ||
set: function set(isDetailLink) { | ||
return this._detailLink = isDetailLink; | ||
@@ -302,0 +302,0 @@ } |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _Field2 = require("./Field"); | ||
var FileField = (function (_Field) { | ||
_inherits(FileField, _Field); | ||
function FileField(name) { | ||
@@ -31,9 +33,7 @@ _classCallCheck(this, FileField); | ||
this._uploadInformation = { | ||
url: "/upload", | ||
accept: "*" | ||
url: '/upload', | ||
accept: '*' | ||
}; | ||
} | ||
_inherits(FileField, _Field); | ||
_createClass(FileField, [{ | ||
@@ -40,0 +40,0 @@ key: "uploadInformation", |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,5 +14,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _NumberField2 = require('./NumberField'); | ||
var _NumberField2 = require("./NumberField"); | ||
@@ -22,2 +22,4 @@ var _NumberField3 = _interopRequireDefault(_NumberField2); | ||
var FloatField = (function (_NumberField) { | ||
_inherits(FloatField, _NumberField); | ||
function FloatField(name) { | ||
@@ -31,4 +33,2 @@ _classCallCheck(this, FloatField); | ||
_inherits(FloatField, _NumberField); | ||
return FloatField; | ||
@@ -35,0 +35,0 @@ })(_NumberField3['default']); |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _Field2 = require("./Field"); | ||
var JsonField = (function (_Field) { | ||
_inherits(JsonField, _Field); | ||
function JsonField(name) { | ||
@@ -31,4 +33,2 @@ _classCallCheck(this, JsonField); | ||
_inherits(JsonField, _Field); | ||
return JsonField; | ||
@@ -35,0 +35,0 @@ })(_Field3["default"]); |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _Field2 = require("./Field"); | ||
var NumberField = (function (_Field) { | ||
_inherits(NumberField, _Field); | ||
function NumberField(name) { | ||
@@ -33,18 +35,16 @@ _classCallCheck(this, NumberField); | ||
_inherits(NumberField, _Field); | ||
/** | ||
* Specify format pattern for number to string conversion. | ||
* | ||
* Based on NumeralJs, which uses a syntax similar to Excel. | ||
* | ||
* {@link} http://numeraljs.com/ | ||
* {@link} https://github.com/baumandm/angular-numeraljs | ||
* {@example} | ||
* | ||
* nga.field('height', 'number').format('$0,0.00'); | ||
*/ | ||
_createClass(NumberField, [{ | ||
key: "format", | ||
/** | ||
* Specify format pattern for number to string conversion. | ||
* | ||
* Based on NumeralJs, which uses a syntax similar to Excel. | ||
* | ||
* {@link} http://numeraljs.com/ | ||
* {@link} https://github.com/baumandm/angular-numeraljs | ||
* {@example} | ||
* | ||
* nga.field('height', 'number').format('$0,0.00'); | ||
*/ | ||
value: function format(value) { | ||
@@ -58,4 +58,4 @@ if (!arguments.length) return this._format; | ||
value: function fractionSize(decimals) { | ||
console.warn("NumberField.fractionSize() is deprecated, use NumberField.format() instead"); | ||
this.format("0." + "0".repeat(decimals)); | ||
console.warn('NumberField.fractionSize() is deprecated, use NumberField.format() instead'); | ||
this.format('0.' + '0'.repeat(decimals)); | ||
return this; | ||
@@ -62,0 +62,0 @@ } |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _Field2 = require("./Field"); | ||
var PasswordField = (function (_Field) { | ||
_inherits(PasswordField, _Field); | ||
function PasswordField(name) { | ||
@@ -30,4 +32,2 @@ _classCallCheck(this, PasswordField); | ||
_inherits(PasswordField, _Field); | ||
return PasswordField; | ||
@@ -34,0 +34,0 @@ })(_Field3["default"]); |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,5 +16,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _ReferenceField2 = require('./ReferenceField'); | ||
var _ReferenceField2 = require("./ReferenceField"); | ||
@@ -28,2 +28,4 @@ var _ReferenceField3 = _interopRequireDefault(_ReferenceField2); | ||
var ReferencedListField = (function (_ReferenceField) { | ||
_inherits(ReferencedListField, _ReferenceField); | ||
function ReferencedListField(name) { | ||
@@ -41,4 +43,2 @@ _classCallCheck(this, ReferencedListField); | ||
_inherits(ReferencedListField, _ReferenceField); | ||
_createClass(ReferencedListField, [{ | ||
@@ -45,0 +45,0 @@ key: 'targetReferenceField', |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,5 +16,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _Field2 = require('./Field'); | ||
var _Field2 = require("./Field"); | ||
@@ -24,2 +24,4 @@ var _Field3 = _interopRequireDefault(_Field2); | ||
var ReferenceField = (function (_Field) { | ||
_inherits(ReferenceField, _Field); | ||
function ReferenceField(name) { | ||
@@ -44,4 +46,2 @@ _classCallCheck(this, ReferenceField); | ||
_inherits(ReferenceField, _Field); | ||
_createClass(ReferenceField, [{ | ||
@@ -77,4 +77,2 @@ key: 'perPage', | ||
} | ||
}, { | ||
key: 'permanentFilters', | ||
@@ -91,2 +89,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'permanentFilters', | ||
value: function permanentFilters(filters) { | ||
@@ -101,4 +101,2 @@ if (!arguments.length) { | ||
} | ||
}, { | ||
key: 'filters', | ||
@@ -108,2 +106,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'filters', | ||
value: function filters(_filters) { | ||
@@ -182,4 +182,2 @@ console.warn('ReferenceField.filters() is deprecated, please use ReferenceField.permanentFilters() instead'); | ||
} | ||
}, { | ||
key: 'remoteComplete', | ||
@@ -207,2 +205,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'remoteComplete', | ||
value: function remoteComplete(_remoteComplete, options) { | ||
@@ -209,0 +209,0 @@ if (!arguments.length) return this._remoteComplete; |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _ReferenceField2 = require("./ReferenceField"); | ||
var ReferenceManyField = (function (_ReferenceField) { | ||
_inherits(ReferenceManyField, _ReferenceField); | ||
function ReferenceManyField(name) { | ||
@@ -27,7 +29,5 @@ _classCallCheck(this, ReferenceManyField); | ||
_get(Object.getPrototypeOf(ReferenceManyField.prototype), "constructor", this).call(this, name); | ||
this._type = "reference_many"; | ||
this._type = 'reference_many'; | ||
} | ||
_inherits(ReferenceManyField, _ReferenceField); | ||
return ReferenceManyField; | ||
@@ -34,0 +34,0 @@ })(_ReferenceField3["default"]); |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _Field2 = require("./Field"); | ||
var TemplateField = (function (_Field) { | ||
_inherits(TemplateField, _Field); | ||
function TemplateField(name) { | ||
@@ -31,4 +33,2 @@ _classCallCheck(this, TemplateField); | ||
_inherits(TemplateField, _Field); | ||
return TemplateField; | ||
@@ -35,0 +35,0 @@ })(_Field3["default"]); |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _Field2 = require("./Field"); | ||
var TextField = (function (_Field) { | ||
_inherits(TextField, _Field); | ||
function TextField(name) { | ||
@@ -30,4 +32,2 @@ _classCallCheck(this, TextField); | ||
_inherits(TextField, _Field); | ||
return TextField; | ||
@@ -34,0 +34,0 @@ })(_Field3["default"]); |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _Field2 = require("./Field"); | ||
var WysiwygField = (function (_Field) { | ||
_inherits(WysiwygField, _Field); | ||
function WysiwygField(name) { | ||
@@ -34,4 +36,2 @@ _classCallCheck(this, WysiwygField); | ||
_inherits(WysiwygField, _Field); | ||
_createClass(WysiwygField, [{ | ||
@@ -38,0 +38,0 @@ key: "stripTags", |
@@ -11,2 +11,4 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
@@ -157,3 +159,16 @@ | ||
}); | ||
this.link('/' + entity.name() + '/list'); | ||
var search = ""; | ||
var defaultFilters = entity.listView().filters().filter(function (filter) { | ||
return filter.pinned() && filter.defaultValue(); | ||
}).reduce(function (filters, currentFilter) { | ||
return Object.assign({}, filters, _defineProperty({}, currentFilter.name(), currentFilter.getTransformedValue(currentFilter.defaultValue()))); | ||
}, {}); | ||
if (Object.keys(defaultFilters).length) { | ||
var encodedDefaultFilters = encodeURIComponent(JSON.stringify(defaultFilters)); | ||
search = '?search=' + encodedDefaultFilters; | ||
} | ||
this.link('/' + entity.name() + '/list' + search); | ||
// deprecated | ||
@@ -160,0 +175,0 @@ this.icon(entity.menuView().icon()); |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -14,3 +16,3 @@ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -26,12 +28,10 @@ var _Queries2 = require('./Queries'); | ||
var ReadQueries = (function (_Queries) { | ||
_inherits(ReadQueries, _Queries); | ||
function ReadQueries() { | ||
_classCallCheck(this, ReadQueries); | ||
if (_Queries != null) { | ||
_Queries.apply(this, arguments); | ||
} | ||
_get(Object.getPrototypeOf(ReadQueries.prototype), 'constructor', this).apply(this, arguments); | ||
} | ||
_inherits(ReadQueries, _Queries); | ||
_createClass(ReadQueries, [{ | ||
@@ -54,4 +54,2 @@ key: 'getOne', | ||
} | ||
}, { | ||
key: 'getAll', | ||
@@ -70,2 +68,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'getAll', | ||
value: function getAll(view, page, filterValues, sortField, sortDir) { | ||
@@ -100,4 +100,2 @@ page = page || 1; | ||
} | ||
}, { | ||
key: 'getRawValues', | ||
@@ -121,2 +119,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'getRawValues', | ||
value: function getRawValues(entity, viewName, viewType, page, perPage, filterValues, filterFields, sortField, sortDir, url) { | ||
@@ -178,4 +178,2 @@ var params = {}; | ||
} | ||
}, { | ||
key: 'getFilteredReferenceData', | ||
@@ -191,2 +189,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'getFilteredReferenceData', | ||
value: function getFilteredReferenceData(references, rawValues) { | ||
@@ -212,4 +212,2 @@ if (!references || !Object.keys(references).length) { | ||
} | ||
}, { | ||
key: 'getOptimizedReferenceData', | ||
@@ -225,2 +223,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'getOptimizedReferenceData', | ||
value: function getOptimizedReferenceData(references, rawValues) { | ||
@@ -246,4 +246,2 @@ if (!references || !Object.keys(references).length) { | ||
} | ||
}, { | ||
key: 'getAllReferencedData', | ||
@@ -258,2 +256,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'getAllReferencedData', | ||
value: function getAllReferencedData(references, search) { | ||
@@ -307,4 +307,2 @@ if (!references || !Object.keys(references).length) { | ||
} | ||
}, { | ||
key: 'fillOptimizedReferencedData', | ||
@@ -318,2 +316,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'fillOptimizedReferencedData', | ||
value: function fillOptimizedReferencedData(apiCalls, references) { | ||
@@ -344,4 +344,2 @@ return this._promisesResolver.allEvenFailed(apiCalls).then(function (responses) { | ||
} | ||
}, { | ||
key: 'fillFilteredReferencedData', | ||
@@ -356,2 +354,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'fillFilteredReferencedData', | ||
value: function fillFilteredReferencedData(apiCalls, references, rawValues) { | ||
@@ -391,4 +391,2 @@ return this._promisesResolver.allEvenFailed(apiCalls).then(function (responses) { | ||
} | ||
}, { | ||
key: 'getReferencedListData', | ||
@@ -405,2 +403,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'getReferencedListData', | ||
value: function getReferencedListData(referencedLists, sortField, sortDir, entityId) { | ||
@@ -407,0 +407,0 @@ var getRawValues = this.getRawValues.bind(this), |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -14,3 +16,3 @@ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,12 +24,10 @@ var _Queries2 = require('./Queries'); | ||
var WriteQueries = (function (_Queries) { | ||
_inherits(WriteQueries, _Queries); | ||
function WriteQueries() { | ||
_classCallCheck(this, WriteQueries); | ||
if (_Queries != null) { | ||
_Queries.apply(this, arguments); | ||
} | ||
_get(Object.getPrototypeOf(WriteQueries.prototype), 'constructor', this).apply(this, arguments); | ||
} | ||
_inherits(WriteQueries, _Queries); | ||
_createClass(WriteQueries, [{ | ||
@@ -48,4 +48,2 @@ key: 'createOne', | ||
} | ||
}, { | ||
key: 'updateOne', | ||
@@ -62,2 +60,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'updateOne', | ||
value: function updateOne(view, rawEntity, originEntityId) { | ||
@@ -69,4 +69,2 @@ var entityId = originEntityId || rawEntity[view.entity.identifier().name()]; | ||
} | ||
}, { | ||
key: 'deleteOne', | ||
@@ -82,7 +80,7 @@ /** | ||
*/ | ||
}, { | ||
key: 'deleteOne', | ||
value: function deleteOne(view, entityId) { | ||
return this._restWrapper.deleteOne(view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(entityId), view.type, entityId, view.identifier()), view.entity.deleteMethod()); | ||
} | ||
}, { | ||
key: 'batchDelete', | ||
@@ -98,2 +96,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'batchDelete', | ||
value: function batchDelete(view, entityIds) { | ||
@@ -100,0 +100,0 @@ var deleteOne = this.deleteOne.bind(this); |
@@ -40,3 +40,3 @@ 'use strict'; | ||
function cloneAndFlatten(object) { | ||
var excludedProperties = arguments[1] === undefined ? [] : arguments[1]; | ||
var excludedProperties = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; | ||
@@ -43,0 +43,0 @@ if (typeof object !== 'object') { |
@@ -14,3 +14,3 @@ 'use strict'; | ||
getReferences: function getReferences(fields, withRemoteComplete) { | ||
var optimized = arguments[2] === undefined ? null : arguments[2]; | ||
var optimized = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; | ||
@@ -17,0 +17,0 @@ var references = fields.filter(function (f) { |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _View2 = require('./View'); | ||
var BatchDeleteView = (function (_View) { | ||
_inherits(BatchDeleteView, _View); | ||
function BatchDeleteView(name) { | ||
@@ -32,4 +34,2 @@ _classCallCheck(this, BatchDeleteView); | ||
_inherits(BatchDeleteView, _View); | ||
return BatchDeleteView; | ||
@@ -36,0 +36,0 @@ })(_View3['default']); |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _View2 = require('./View'); | ||
var CreateView = (function (_View) { | ||
_inherits(CreateView, _View); | ||
function CreateView(name) { | ||
@@ -34,48 +36,46 @@ _classCallCheck(this, CreateView); | ||
_inherits(CreateView, _View); | ||
/** | ||
* Add a function to be executed after the creation succeeds. | ||
* | ||
* This is the ideal place to use the response to update the entry, or | ||
* redirect to another view. | ||
* | ||
* If the function returns false, the default execution workflow is stopped. | ||
* This means that the function must provide a custom workflow. | ||
* | ||
* If the function throws an exception, the onSubmitError callback will | ||
* execute. | ||
* | ||
* The syntax depends on the framework calling the function. | ||
* | ||
* With ng-admin, the function can be an angular injectable, listing | ||
* required dependencies in an array. Among other, the function can receive | ||
* the following services: | ||
* - $event: the form submission event | ||
* - entry: the current Entry instance | ||
* - entity: the current entity | ||
* - form: the form object (for form validation and errors) | ||
* - progression: the controller for the loading indicator | ||
* - notification: the controller for top notifications | ||
* | ||
* The function can be asynchronous, in which case it should return | ||
* a Promise. | ||
* | ||
* @example | ||
* | ||
* post.creationView().onSubmitSuccess(['progression', 'notification', '$state', 'entry', 'entity', function(progression, notification, $state, entry, entity) { | ||
* // stop the progress bar | ||
* progression.done(); | ||
* // add a notification | ||
* notification.log(`Element #${entry._identifierValue} successfully created.`, { addnCls: 'humane-flatty-success' }); | ||
* // redirect to the list view | ||
* $state.go($state.get('list'), { entity: entity.name() }); | ||
* // cancel the default action (redirect to the edition view) | ||
* return false; | ||
* }]) | ||
* | ||
*/ | ||
_createClass(CreateView, [{ | ||
key: 'onSubmitSuccess', | ||
/** | ||
* Add a function to be executed after the creation succeeds. | ||
* | ||
* This is the ideal place to use the response to update the entry, or | ||
* redirect to another view. | ||
* | ||
* If the function returns false, the default execution workflow is stopped. | ||
* This means that the function must provide a custom workflow. | ||
* | ||
* If the function throws an exception, the onSubmitError callback will | ||
* execute. | ||
* | ||
* The syntax depends on the framework calling the function. | ||
* | ||
* With ng-admin, the function can be an angular injectable, listing | ||
* required dependencies in an array. Among other, the function can receive | ||
* the following services: | ||
* - $event: the form submission event | ||
* - entry: the current Entry instance | ||
* - entity: the current entity | ||
* - form: the form object (for form validation and errors) | ||
* - progression: the controller for the loading indicator | ||
* - notification: the controller for top notifications | ||
* | ||
* The function can be asynchronous, in which case it should return | ||
* a Promise. | ||
* | ||
* @example | ||
* | ||
* post.creationView().onSubmitSuccess(['progression', 'notification', '$state', 'entry', 'entity', function(progression, notification, $state, entry, entity) { | ||
* // stop the progress bar | ||
* progression.done(); | ||
* // add a notification | ||
* notification.log(`Element #${entry._identifierValue} successfully created.`, { addnCls: 'humane-flatty-success' }); | ||
* // redirect to the list view | ||
* $state.go($state.get('list'), { entity: entity.name() }); | ||
* // cancel the default action (redirect to the edition view) | ||
* return false; | ||
* }]) | ||
* | ||
*/ | ||
value: function onSubmitSuccess(_onSubmitSuccess) { | ||
@@ -86,4 +86,2 @@ if (!arguments.length) return this._onSubmitSuccess; | ||
} | ||
}, { | ||
key: 'onSubmitError', | ||
@@ -134,2 +132,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'onSubmitError', | ||
value: function onSubmitError(_onSubmitError) { | ||
@@ -136,0 +136,0 @@ if (!arguments.length) return this._onSubmitError; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -14,3 +16,3 @@ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,12 +24,10 @@ var _ListView2 = require('./ListView'); | ||
var DashboardView = (function (_ListView) { | ||
_inherits(DashboardView, _ListView); | ||
function DashboardView() { | ||
_classCallCheck(this, DashboardView); | ||
if (_ListView != null) { | ||
_ListView.apply(this, arguments); | ||
} | ||
_get(Object.getPrototypeOf(DashboardView.prototype), 'constructor', this).apply(this, arguments); | ||
} | ||
_inherits(DashboardView, _ListView); | ||
_createClass(DashboardView, [{ | ||
@@ -34,0 +34,0 @@ key: 'setEntity', |
@@ -7,4 +7,6 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -14,3 +16,3 @@ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +24,4 @@ var _View2 = require('./View'); | ||
var DeleteView = (function (_View) { | ||
_inherits(DeleteView, _View); | ||
function DeleteView(name) { | ||
@@ -29,6 +33,102 @@ _classCallCheck(this, DeleteView); | ||
this._enabled = true; | ||
this._submitCreationSuccess = null; | ||
this._submitCreationError = null; | ||
} | ||
_inherits(DeleteView, _View); | ||
/** | ||
* Add a function to be executed after the delete succeeds. | ||
* | ||
* This is the ideal place to use the response to delete the entry, or | ||
* redirect to another view. | ||
* | ||
* If the function returns false, the default execution workflow is stopped. | ||
* This means that the function must provide a custom workflow. | ||
* | ||
* If the function throws an exception, the onSubmitError callback will | ||
* execute. | ||
* | ||
* The syntax depends on the framework calling the function. | ||
* | ||
* With ng-admin, the function can be an angular injectable, listing | ||
* required dependencies in an array. Among other, the function can receive | ||
* the following services: | ||
* - $event: the form submission event | ||
* - entry: the current Entry instance | ||
* - entity: the current entity | ||
* - form: the form object (for form validation and errors) | ||
* - progression: the controller for the loading indicator | ||
* - notification: the controller for top notifications | ||
* | ||
* The function can be asynchronous, in which case it should return | ||
* a Promise. | ||
* | ||
* @example | ||
* | ||
* post.deletionView().onSubmitSuccess(['progression', 'notification', '$state', 'entry', 'entity', function(progression, notification, $state, entry, entity) { | ||
* // stop the progress bar | ||
* progression.done(); | ||
* // add a notification | ||
* notification.log(`Element #${entry._identifierValue} successfully deleted.`, { addnCls: 'humane-flatty-success' }); | ||
* // redirect to the list view | ||
* $state.go($state.get('list'), { entity: entity.name() }); | ||
* // cancel the default action (redirect to the edition view) | ||
* return false; | ||
* }]) | ||
*/ | ||
_createClass(DeleteView, [{ | ||
key: 'onSubmitSuccess', | ||
value: function onSubmitSuccess(_onSubmitSuccess) { | ||
if (!arguments.length) return this._onSubmitSuccess; | ||
this._onSubmitSuccess = _onSubmitSuccess; | ||
return this; | ||
} | ||
/** | ||
* Add a function to be executed after the delete request receives a failed | ||
* http response from the server. | ||
* | ||
* This is the ideal place to use the response to delete the entry, display | ||
* server-side validation error, or redirect to another view. | ||
* | ||
* If the function returns false, the default execution workflow is stopped. | ||
* This means that the function must provide a custom workflow. | ||
* | ||
* The syntax depends on the framework calling the function. | ||
* | ||
* With ng-admin, the function can be an angular injectable, listing | ||
* required dependencies in an array. Among other, the function can receive | ||
* the following services: | ||
* - $event: the form submission event | ||
* - error: the response from the server | ||
* - errorMessage: the error message based on the response | ||
* - entry: the current Entry instance | ||
* - entity: the current entity | ||
* - form: the form object (for form validation and errors) | ||
* - progression: the controller for the loading indicator | ||
* - notification: the controller for top notifications | ||
* | ||
* The function can be asynchronous, in which case it should return | ||
* a Promise. | ||
* | ||
* @example | ||
* | ||
* post.deletionView().onSubmitError(['error', 'form', 'progression', 'notification', function(error, form, progression, notification) { | ||
* // stop the progress bar | ||
* progression.done(); | ||
* // add a notification | ||
* notification.log(`Failed to delete element.`, { addnCls: 'humane-flatty-error' }); | ||
* // cancel the default action (default error messages) | ||
* return false; | ||
* }]); | ||
*/ | ||
}, { | ||
key: 'onSubmitError', | ||
value: function onSubmitError(_onSubmitError) { | ||
if (!arguments.length) return this._onSubmitError; | ||
this._onSubmitError = _onSubmitError; | ||
return this; | ||
} | ||
}]); | ||
return DeleteView; | ||
@@ -35,0 +135,0 @@ })(_View3['default']); |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ var _View2 = require('./View'); | ||
var EditView = (function (_View) { | ||
_inherits(EditView, _View); | ||
function EditView(name) { | ||
@@ -34,47 +36,45 @@ _classCallCheck(this, EditView); | ||
_inherits(EditView, _View); | ||
/** | ||
* Add a function to be executed after the update succeeds. | ||
* | ||
* This is the ideal place to use the response to update the entry, or | ||
* redirect to another view. | ||
* | ||
* If the function returns false, the default execution workflow is stopped. | ||
* This means that the function must provide a custom workflow. | ||
* | ||
* If the function throws an exception, the onSubmitError callback will | ||
* execute. | ||
* | ||
* The syntax depends on the framework calling the function. | ||
* | ||
* With ng-admin, the function can be an angular injectable, listing | ||
* required dependencies in an array. Among other, the function can receive | ||
* the following services: | ||
* - $event: the form submission event | ||
* - entry: the current Entry instance | ||
* - entity: the current entity | ||
* - form: the form object (for form validation and errors) | ||
* - progression: the controller for the loading indicator | ||
* - notification: the controller for top notifications | ||
* | ||
* The function can be asynchronous, in which case it should return | ||
* a Promise. | ||
* | ||
* @example | ||
* | ||
* post.editionView().onSubmitSuccess(['progression', 'notification', '$state', 'entry', 'entity', function(progression, notification, $state, entry, entity) { | ||
* // stop the progress bar | ||
* progression.done(); | ||
* // add a notification | ||
* notification.log(`Element #${entry._identifierValue} successfully edited.`, { addnCls: 'humane-flatty-success' }); | ||
* // redirect to the list view | ||
* $state.go($state.get('list'), { entity: entity.name() }); | ||
* // cancel the default action (redirect to the edition view) | ||
* return false; | ||
* }]) | ||
*/ | ||
_createClass(EditView, [{ | ||
key: 'onSubmitSuccess', | ||
/** | ||
* Add a function to be executed after the update succeeds. | ||
* | ||
* This is the ideal place to use the response to update the entry, or | ||
* redirect to another view. | ||
* | ||
* If the function returns false, the default execution workflow is stopped. | ||
* This means that the function must provide a custom workflow. | ||
* | ||
* If the function throws an exception, the onSubmitError callback will | ||
* execute. | ||
* | ||
* The syntax depends on the framework calling the function. | ||
* | ||
* With ng-admin, the function can be an angular injectable, listing | ||
* required dependencies in an array. Among other, the function can receive | ||
* the following services: | ||
* - $event: the form submission event | ||
* - entry: the current Entry instance | ||
* - entity: the current entity | ||
* - form: the form object (for form validation and errors) | ||
* - progression: the controller for the loading indicator | ||
* - notification: the controller for top notifications | ||
* | ||
* The function can be asynchronous, in which case it should return | ||
* a Promise. | ||
* | ||
* @example | ||
* | ||
* post.editionView().onSubmitSuccess(['progression', 'notification', '$state', 'entry', 'entity', function(progression, notification, $state, entry, entity) { | ||
* // stop the progress bar | ||
* progression.done(); | ||
* // add a notification | ||
* notification.log(`Element #${entry._identifierValue} successfully edited.`, { addnCls: 'humane-flatty-success' }); | ||
* // redirect to the list view | ||
* $state.go($state.get('list'), { entity: entity.name() }); | ||
* // cancel the default action (redirect to the edition view) | ||
* return false; | ||
* }]) | ||
*/ | ||
value: function onSubmitSuccess(_onSubmitSuccess) { | ||
@@ -85,4 +85,2 @@ if (!arguments.length) return this._onSubmitSuccess; | ||
} | ||
}, { | ||
key: 'onSubmitError', | ||
@@ -133,2 +131,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'onSubmitError', | ||
value: function onSubmitError(_onSubmitError) { | ||
@@ -135,0 +135,0 @@ if (!arguments.length) return this._onSubmitError; |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _ListView2 = require('./ListView'); | ||
var ExportView = (function (_ListView) { | ||
_inherits(ExportView, _ListView); | ||
function ExportView(name) { | ||
@@ -31,4 +33,2 @@ _classCallCheck(this, ExportView); | ||
_inherits(ExportView, _ListView); | ||
return ExportView; | ||
@@ -35,0 +35,0 @@ })(_ListView3['default']); |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -23,3 +23,3 @@ var _View2 = require('./View'); | ||
var _UtilsOrderElement = require('../Utils/orderElement'); | ||
var _UtilsOrderElement = require("../Utils/orderElement"); | ||
@@ -29,2 +29,4 @@ var _UtilsOrderElement2 = _interopRequireDefault(_UtilsOrderElement); | ||
var ListView = (function (_View) { | ||
_inherits(ListView, _View); | ||
function ListView(name) { | ||
@@ -50,4 +52,2 @@ _classCallCheck(this, ListView); | ||
_inherits(ListView, _View); | ||
_createClass(ListView, [{ | ||
@@ -62,6 +62,6 @@ key: 'perPage', | ||
} | ||
/** @deprecated Use perPage instead */ | ||
}, { | ||
key: 'limit', | ||
/** @deprecated Use perPage instead */ | ||
value: function limit() { | ||
@@ -152,4 +152,2 @@ if (!arguments.length) { | ||
} | ||
}, { | ||
key: 'permanentFilters', | ||
@@ -166,2 +164,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'permanentFilters', | ||
value: function permanentFilters(filters) { | ||
@@ -176,4 +176,2 @@ if (!arguments.length) { | ||
} | ||
}, { | ||
key: 'filters', | ||
@@ -190,2 +188,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'filters', | ||
value: function filters(_filters) { | ||
@@ -192,0 +192,0 @@ if (!arguments.length) { |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -16,5 +16,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _View2 = require('./View'); | ||
var _View2 = require("./View"); | ||
@@ -24,2 +24,4 @@ var _View3 = _interopRequireDefault(_View2); | ||
var MenuView = (function (_View) { | ||
_inherits(MenuView, _View); | ||
function MenuView(name) { | ||
@@ -33,4 +35,2 @@ _classCallCheck(this, MenuView); | ||
_inherits(MenuView, _View); | ||
_createClass(MenuView, [{ | ||
@@ -53,3 +53,3 @@ key: 'icon', | ||
key: 'enabled', | ||
get: function () { | ||
get: function get() { | ||
return this._enabled === null ? this.entity._views['ListView'].enabled : this._enabled; | ||
@@ -56,0 +56,0 @@ } |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
@@ -14,3 +14,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -22,2 +22,4 @@ var _View2 = require('./View'); | ||
var ShowView = (function (_View) { | ||
_inherits(ShowView, _View); | ||
function ShowView(name) { | ||
@@ -30,4 +32,2 @@ _classCallCheck(this, ShowView); | ||
_inherits(ShowView, _View); | ||
return ShowView; | ||
@@ -34,0 +34,0 @@ })(_View3['default']); |
@@ -84,4 +84,2 @@ 'use strict'; | ||
} | ||
}, { | ||
key: 'isEnabled', | ||
@@ -91,7 +89,7 @@ /** | ||
*/ | ||
}, { | ||
key: 'isEnabled', | ||
value: function isEnabled() { | ||
return this.enabled; | ||
} | ||
}, { | ||
key: 'getEntity', | ||
@@ -101,7 +99,7 @@ /** | ||
*/ | ||
}, { | ||
key: 'getEntity', | ||
value: function getEntity() { | ||
return this.entity; | ||
} | ||
}, { | ||
key: 'setEntity', | ||
@@ -111,2 +109,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'setEntity', | ||
value: function setEntity(entity) { | ||
@@ -120,4 +120,2 @@ this.entity = entity; | ||
} | ||
}, { | ||
key: 'fields', | ||
@@ -132,2 +130,4 @@ /* | ||
*/ | ||
}, { | ||
key: 'fields', | ||
value: function fields() { | ||
@@ -282,4 +282,2 @@ if (!arguments.length) return this._fields; | ||
} | ||
}, { | ||
key: 'mapEntry', | ||
@@ -289,2 +287,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'mapEntry', | ||
value: function mapEntry(restEntry) { | ||
@@ -298,4 +298,2 @@ return _Entry2['default'].createFromRest(restEntry, this._fields, this.entity.name(), this.entity.identifier().name()); | ||
} | ||
}, { | ||
key: 'transformEntry', | ||
@@ -305,7 +303,7 @@ /** | ||
*/ | ||
}, { | ||
key: 'transformEntry', | ||
value: function transformEntry(entry) { | ||
return entry.transformToRest(this._fields); | ||
} | ||
}, { | ||
key: 'prepare', | ||
@@ -352,2 +350,4 @@ /** | ||
*/ | ||
}, { | ||
key: 'prepare', | ||
value: function prepare(_prepare) { | ||
@@ -365,3 +365,3 @@ if (!arguments.length) return this._prepare; | ||
key: 'enabled', | ||
get: function () { | ||
get: function get() { | ||
return this._enabled === null ? !!this._fields.length : this._enabled; | ||
@@ -371,3 +371,3 @@ } | ||
key: 'type', | ||
get: function () { | ||
get: function get() { | ||
return this._type; | ||
@@ -374,0 +374,0 @@ } |
{ | ||
"name": "admin-config", | ||
"version": "0.12.2", | ||
"version": "0.12.3", | ||
"private": false, | ||
"files": [ | ||
"*.md", | ||
"lib" | ||
"*.md", | ||
"lib" | ||
], | ||
@@ -23,5 +23,5 @@ "repository": { | ||
"scripts": { | ||
"prepublish": "make transpile", | ||
"test": "make test" | ||
"prepublish": "make transpile", | ||
"test": "make test" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
387405
4157
1