mandarina-antd 2.1.51 → 2.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ActionButton.js +34 -16
- package/build/ActionForm.d.ts +1 -1
- package/build/ActionForm.js +32 -14
- package/build/Auth.js +9 -4
- package/build/Bridge.js +16 -19
- package/build/ConfirmActionButton.js +34 -16
- package/build/Forms.d.ts +6 -6
- package/build/Forms.js +25 -8
- package/build/List/HeaderDefault.d.ts +2 -2
- package/build/List/HeaderDefault.js +26 -10
- package/build/List/List.d.ts +2 -2
- package/build/List/List.js +43 -22
- package/build/List/ListFilter.d.ts +1 -1
- package/build/List/ListFilter.js +29 -11
- package/build/List/ListFilters.d.ts +2 -1
- package/build/List/ListFilters.js +46 -26
- package/build/List/ListHeader.js +23 -7
- package/build/List/ListVirtualized.d.ts +6 -6
- package/build/List/ListVirtualized.js +57 -44
- package/build/List/ListVirtualized.js.map +1 -1
- package/build/List/SortButton.js +3 -3
- package/build/List/SortableColumns.js +3 -2
- package/build/List/utils.js +3 -1
- package/build/index.js +10 -9
- package/build/uniforms/AutoField.js +24 -6
- package/build/uniforms/AutoFields.js +36 -18
- package/build/uniforms/ErrorsField.js +2 -2
- package/build/uniforms/HiddenTableField.js +4 -2
- package/build/uniforms/ListField.js +28 -12
- package/build/uniforms/ListItemField.js +26 -10
- package/build/uniforms/NestField.js +32 -14
- package/build/uniforms/TableField.js +8 -6
- package/build/utils.js +1 -0
- package/package.json +1 -1
- package/src/List/ListVirtualized.tsx +1 -1
package/build/ActionButton.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -23,6 +25,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
23
25
|
};
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
35
|
+
}) : (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
o[k2] = m[k];
|
|
38
|
+
}));
|
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
+
}) : function(o, v) {
|
|
42
|
+
o["default"] = v;
|
|
43
|
+
});
|
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
26
51
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
52
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
53
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -38,7 +63,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
63
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
64
|
function step(op) {
|
|
40
65
|
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
-
while (_) try {
|
|
66
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
42
67
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
68
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
69
|
switch (op[0]) {
|
|
@@ -70,13 +95,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
70
95
|
}
|
|
71
96
|
return t;
|
|
72
97
|
};
|
|
73
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
74
|
-
if (mod && mod.__esModule) return mod;
|
|
75
|
-
var result = {};
|
|
76
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
77
|
-
result["default"] = mod;
|
|
78
|
-
return result;
|
|
79
|
-
};
|
|
80
98
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
81
99
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
82
100
|
};
|
|
@@ -95,7 +113,7 @@ var ActionButton = /** @class */ (function (_super) {
|
|
|
95
113
|
var _this = _super.call(this, props) || this;
|
|
96
114
|
_this.refetchQueries = function (mutationResult) {
|
|
97
115
|
var schema = mandarina_1.Schema.instances[_this.schemaName];
|
|
98
|
-
return Mutate_1.refetchQueries(mutationResult, _this.props.client, _this.props.refetchSchemas, schema);
|
|
116
|
+
return (0, Mutate_1.refetchQueries)(mutationResult, _this.props.client, _this.props.refetchSchemas, schema);
|
|
99
117
|
};
|
|
100
118
|
_this.schemaName = _this.props.result.replace(/[\[\]\!]/g, '');
|
|
101
119
|
return _this;
|
|
@@ -107,18 +125,18 @@ var ActionButton = /** @class */ (function (_super) {
|
|
|
107
125
|
if (mandarina_1.Schema.instances[this.schemaName]) {
|
|
108
126
|
if (!resultFields)
|
|
109
127
|
throw new Error('ActionForm: if the result is a Schema you need to enter resultFields');
|
|
110
|
-
queryFromFields = utils_1.buildQueryFromFields(resultFields);
|
|
128
|
+
queryFromFields = (0, utils_1.buildQueryFromFields)(resultFields);
|
|
111
129
|
}
|
|
112
130
|
if (resultFields) {
|
|
113
|
-
queryFromFields = utils_1.buildQueryFromFields(resultFields, false);
|
|
131
|
+
queryFromFields = (0, utils_1.buildQueryFromFields)(resultFields, false);
|
|
114
132
|
}
|
|
115
133
|
var dataString = '', dataString2 = '';
|
|
116
134
|
if (schema) {
|
|
117
|
-
dataString = "($data: "
|
|
135
|
+
dataString = "($data: ".concat((0, utils_2.capitalize)(schema.name), "Input!)");
|
|
118
136
|
dataString2 = "(data: $data)";
|
|
119
137
|
}
|
|
120
|
-
var gqlString = "\n mutation "
|
|
121
|
-
var MUTATION = graphql_tag_1.default(gqlString);
|
|
138
|
+
var gqlString = "\n mutation ".concat(actionName, " ").concat(dataString, "{\n ").concat(actionName, " ").concat(dataString2, "\n ").concat(queryFromFields, "\n }\n ");
|
|
139
|
+
var MUTATION = (0, graphql_tag_1.default)(gqlString);
|
|
122
140
|
return (React.createElement(react_apollo_1.Mutation, { mutation: MUTATION, onCompleted: onCompleted,
|
|
123
141
|
// @ts-ignore
|
|
124
142
|
refetchQueries: refetchQueries, update: update, ignoreResults: ignoreResults, optimisticResponse: optimisticResponse, awaitRefetchQueries: awaitRefetchQueries, onError: onError, context: context }, function (mutation, _a) {
|
|
@@ -135,7 +153,7 @@ var ActionButton = /** @class */ (function (_super) {
|
|
|
135
153
|
};
|
|
136
154
|
return ActionButton;
|
|
137
155
|
}(React.PureComponent));
|
|
138
|
-
var ActionFormWithApollo = react_apollo_1.withApollo(ActionButton);
|
|
156
|
+
var ActionFormWithApollo = (0, react_apollo_1.withApollo)(ActionButton);
|
|
139
157
|
exports.default = React.forwardRef(function (props, ref) {
|
|
140
158
|
return React.createElement(ActionFormWithApollo, __assign({}, props, { innerRef: ref }));
|
|
141
159
|
});
|
package/build/ActionForm.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ export interface ActionFormProps extends AutoFormProps {
|
|
|
13
13
|
overwrite?: Overwrite;
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
}
|
|
16
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<ActionFormProps,
|
|
16
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<ActionFormProps, keyof ActionFormProps> & React.RefAttributes<HTMLFormElement>>;
|
|
17
17
|
export default _default;
|
package/build/ActionForm.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -23,6 +25,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
23
25
|
};
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
35
|
+
}) : (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
o[k2] = m[k];
|
|
38
|
+
}));
|
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
+
}) : function(o, v) {
|
|
42
|
+
o["default"] = v;
|
|
43
|
+
});
|
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
26
51
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
27
52
|
var t = {};
|
|
28
53
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -34,13 +59,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
34
59
|
}
|
|
35
60
|
return t;
|
|
36
61
|
};
|
|
37
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
38
|
-
if (mod && mod.__esModule) return mod;
|
|
39
|
-
var result = {};
|
|
40
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
41
|
-
result["default"] = mod;
|
|
42
|
-
return result;
|
|
43
|
-
};
|
|
44
62
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
63
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
64
|
};
|
|
@@ -62,7 +80,7 @@ var ActionForm = /** @class */ (function (_super) {
|
|
|
62
80
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
63
81
|
_this.state = { changed: false };
|
|
64
82
|
_this.refetchQueries = function (mutationResult) {
|
|
65
|
-
return Mutate_1.refetchQueries(mutationResult, _this.props.client, _this.props.refetchSchemas, _this.props.schema);
|
|
83
|
+
return (0, Mutate_1.refetchQueries)(mutationResult, _this.props.client, _this.props.refetchSchemas, _this.props.schema);
|
|
66
84
|
};
|
|
67
85
|
return _this;
|
|
68
86
|
}
|
|
@@ -75,14 +93,14 @@ var ActionForm = /** @class */ (function (_super) {
|
|
|
75
93
|
if (mandarina_1.Schema.instances[schemaName]) {
|
|
76
94
|
if (!resultFields)
|
|
77
95
|
throw new Error('ActionForm: if the result is a Schema you need to enter resultFields');
|
|
78
|
-
queryFromFields = utils_2.buildQueryFromFields(resultFields);
|
|
96
|
+
queryFromFields = (0, utils_2.buildQueryFromFields)(resultFields);
|
|
79
97
|
}
|
|
80
98
|
if (resultFields) {
|
|
81
|
-
queryFromFields = utils_2.buildQueryFromFields(resultFields, false);
|
|
99
|
+
queryFromFields = (0, utils_2.buildQueryFromFields)(resultFields, false);
|
|
82
100
|
}
|
|
83
|
-
var gqlString = "\n mutation "
|
|
101
|
+
var gqlString = "\n mutation ".concat(actionName, "($data: ").concat((0, utils_1.capitalize)(schema.name), "Input!) {\n ").concat(actionName, "(data: $data)\n ").concat(queryFromFields, "\n }\n ");
|
|
84
102
|
var bridge = new Bridge_1.Bridge(schema, fields, overwrite);
|
|
85
|
-
var MUTATION = graphql_tag_1.default(gqlString);
|
|
103
|
+
var MUTATION = (0, graphql_tag_1.default)(gqlString);
|
|
86
104
|
return (react_1.default.createElement(react_apollo_1.Mutation, { mutation: MUTATION, onCompleted: onCompleted, refetchQueries: refetchQueries, update: update, ignoreResults: ignoreResults, optimisticResponse: optimisticResponse, awaitRefetchQueries: awaitRefetchQueries, onError: onError, context: context }, function (mutation, _a) {
|
|
87
105
|
var loading = _a.loading, error = _a.error, restMutation = __rest(_a, ["loading", "error"]);
|
|
88
106
|
return (react_1.default.createElement(AutoForm_1.default, __assign({ disabled: loading, onSubmit: function (data) {
|
|
@@ -105,7 +123,7 @@ var ActionForm = /** @class */ (function (_super) {
|
|
|
105
123
|
};
|
|
106
124
|
return ActionForm;
|
|
107
125
|
}(react_1.PureComponent));
|
|
108
|
-
var ActionFormWithApollo = react_apollo_1.withApollo(ActionForm);
|
|
126
|
+
var ActionFormWithApollo = (0, react_apollo_1.withApollo)(ActionForm);
|
|
109
127
|
exports.default = react_1.default.forwardRef(function (props, ref) {
|
|
110
128
|
return react_1.default.createElement(ActionFormWithApollo, __assign({}, props, { innerRef: ref }));
|
|
111
129
|
});
|
package/build/Auth.js
CHANGED
|
@@ -25,6 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.AuthListVirtualized = exports.AuthList = exports.AuthCreateForm = exports.AuthUpdateForm = void 0;
|
|
28
29
|
var react_1 = __importDefault(require("react"));
|
|
29
30
|
var mandarina_1 = require("mandarina");
|
|
30
31
|
var Forms_1 = require("./Forms");
|
|
@@ -46,16 +47,20 @@ var AuthAntD = function (_a) {
|
|
|
46
47
|
!loading && fields && react_1.default.createElement(Component, __assign({ ref: innerRef, schema: schema }, props, { fields: fields, readFields: readFields }))));
|
|
47
48
|
}));
|
|
48
49
|
};
|
|
49
|
-
|
|
50
|
+
var AuthUpdateForm = function (props) {
|
|
50
51
|
return react_1.default.createElement(AuthAntD, __assign({ action: 'update', Component: Forms_1.UpdateForm }, props));
|
|
51
52
|
};
|
|
52
|
-
exports.
|
|
53
|
+
exports.AuthUpdateForm = AuthUpdateForm;
|
|
54
|
+
var AuthCreateForm = function (props) {
|
|
53
55
|
return react_1.default.createElement(AuthAntD, __assign({ action: 'create', Component: Forms_1.CreateForm }, props));
|
|
54
56
|
};
|
|
55
|
-
exports.
|
|
57
|
+
exports.AuthCreateForm = AuthCreateForm;
|
|
58
|
+
var AuthList = function (props) {
|
|
56
59
|
return react_1.default.createElement(AuthAntD, __assign({ action: 'read', Component: List_1.List }, props));
|
|
57
60
|
};
|
|
58
|
-
exports.
|
|
61
|
+
exports.AuthList = AuthList;
|
|
62
|
+
var AuthListVirtualized = function (props) {
|
|
59
63
|
return react_1.default.createElement(AuthAntD, __assign({ action: 'read', Component: ListVirtualized_1.ListVirtualized }, props));
|
|
60
64
|
};
|
|
65
|
+
exports.AuthListVirtualized = AuthListVirtualized;
|
|
61
66
|
//# sourceMappingURL=Auth.js.map
|
package/build/Bridge.js
CHANGED
|
@@ -10,14 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
19
21
|
};
|
|
20
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.Bridge = void 0;
|
|
21
24
|
var mandarina_1 = require("mandarina");
|
|
22
25
|
var lodash_1 = require("lodash");
|
|
23
26
|
var Mutate_1 = require("mandarina/build/Operations/Mutate");
|
|
@@ -31,7 +34,7 @@ var Bridge = /** @class */ (function () {
|
|
|
31
34
|
var lastDot = field.lastIndexOf('.');
|
|
32
35
|
if (lastDot >= 0) {
|
|
33
36
|
var parent_1 = field.substring(0, lastDot);
|
|
34
|
-
return
|
|
37
|
+
return __spreadArray(__spreadArray([], _this.getAncestors(parent_1), true), [parent_1], false);
|
|
35
38
|
}
|
|
36
39
|
return [];
|
|
37
40
|
};
|
|
@@ -51,7 +54,7 @@ var Bridge = /** @class */ (function () {
|
|
|
51
54
|
if (error && typeof error.message === 'string' && this.schema.errorFromServerMapper) {
|
|
52
55
|
return this.schema.errorFromServerMapper(name, error);
|
|
53
56
|
}
|
|
54
|
-
if (error && Object.keys(error).some(function (e) { return e.match(new RegExp("^"
|
|
57
|
+
if (error && Object.keys(error).some(function (e) { return e.match(new RegExp("^".concat(name, "\\."))); }))
|
|
55
58
|
return true;
|
|
56
59
|
return error && error[name];
|
|
57
60
|
};
|
|
@@ -90,9 +93,9 @@ var Bridge = /** @class */ (function () {
|
|
|
90
93
|
var field = mandarina_1.Schema.cleanKey(name);
|
|
91
94
|
var overwrite = this.overwrite && this.overwrite[field];
|
|
92
95
|
if (!this.fieldDefinitions[field])
|
|
93
|
-
this.fieldDefinitions[field] = overwrite ? lodash_1.merge(Mutate_1.deepClone(this.schema.getPathDefinition(field)), overwrite) : this.schema.getPathDefinition(field);
|
|
96
|
+
this.fieldDefinitions[field] = overwrite ? (0, lodash_1.merge)((0, Mutate_1.deepClone)(this.schema.getPathDefinition(field)), overwrite) : this.schema.getPathDefinition(field);
|
|
94
97
|
if (!this.fieldDefinitions[field] || !this.fieldDefinitions[field].type)
|
|
95
|
-
throw new Error("No field named \""
|
|
98
|
+
throw new Error("No field named \"".concat(field, "\" in schema ").concat(this.schema.name));
|
|
96
99
|
return this.fieldDefinitions[field];
|
|
97
100
|
};
|
|
98
101
|
Bridge.prototype.getType = function (name) {
|
|
@@ -124,7 +127,7 @@ var Bridge = /** @class */ (function () {
|
|
|
124
127
|
});
|
|
125
128
|
var item = {};
|
|
126
129
|
var schema = mandarina_1.Schema.getInstance(field.type);
|
|
127
|
-
schema.clean(item, utils_1.getDecendentsDot(this.fields, name));
|
|
130
|
+
schema.clean(item, (0, utils_1.getDecendentsDot)(this.fields, name));
|
|
128
131
|
var items = Math.max(minCount_1, initialCount);
|
|
129
132
|
return new Array(items).fill(item);
|
|
130
133
|
}
|
|
@@ -144,7 +147,7 @@ var Bridge = /** @class */ (function () {
|
|
|
144
147
|
var item = {};
|
|
145
148
|
if (field.isTable) {
|
|
146
149
|
var schema = mandarina_1.Schema.getInstance(field.type);
|
|
147
|
-
schema.clean(item, utils_1.getDecendentsDot(this.fields, name));
|
|
150
|
+
schema.clean(item, (0, utils_1.getDecendentsDot)(this.fields, name));
|
|
148
151
|
}
|
|
149
152
|
return item;
|
|
150
153
|
}
|
|
@@ -212,13 +215,7 @@ var Bridge = /** @class */ (function () {
|
|
|
212
215
|
if (validator.validatorName === 'maxCount')
|
|
213
216
|
maxCount_1 = validator.param;
|
|
214
217
|
});
|
|
215
|
-
this.fieldProps[name] = __assign(__assign({ label: field.label ? field.label : "", allowedValues: allowedValues,
|
|
216
|
-
minCount: minCount_3,
|
|
217
|
-
maxCount: maxCount_1,
|
|
218
|
-
transform: transform,
|
|
219
|
-
component: component,
|
|
220
|
-
required: required,
|
|
221
|
-
placeholder: placeholder }, uniforms), field.form.props);
|
|
218
|
+
this.fieldProps[name] = __assign(__assign({ label: field.label ? field.label : "", allowedValues: allowedValues, minCount: minCount_3, maxCount: maxCount_1, transform: transform, component: component, required: required, placeholder: placeholder }, uniforms), field.form.props);
|
|
222
219
|
}
|
|
223
220
|
return this.fieldProps[name];
|
|
224
221
|
/**
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -23,6 +25,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
23
25
|
};
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
35
|
+
}) : (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
o[k2] = m[k];
|
|
38
|
+
}));
|
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
+
}) : function(o, v) {
|
|
42
|
+
o["default"] = v;
|
|
43
|
+
});
|
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
26
51
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
52
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
53
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -38,7 +63,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
63
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
64
|
function step(op) {
|
|
40
65
|
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
-
while (_) try {
|
|
66
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
42
67
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
68
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
69
|
switch (op[0]) {
|
|
@@ -70,13 +95,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
70
95
|
}
|
|
71
96
|
return t;
|
|
72
97
|
};
|
|
73
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
74
|
-
if (mod && mod.__esModule) return mod;
|
|
75
|
-
var result = {};
|
|
76
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
77
|
-
result["default"] = mod;
|
|
78
|
-
return result;
|
|
79
|
-
};
|
|
80
98
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
81
99
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
82
100
|
};
|
|
@@ -96,7 +114,7 @@ var ConfirmActionButton = /** @class */ (function (_super) {
|
|
|
96
114
|
var _this = _super.call(this, props) || this;
|
|
97
115
|
_this.refetchQueries = function (mutationResult) {
|
|
98
116
|
var schema = mandarina_1.Schema.instances[_this.schemaName];
|
|
99
|
-
return Mutate_1.refetchQueries(mutationResult, _this.props.client, _this.props.refetchSchemas, schema);
|
|
117
|
+
return (0, Mutate_1.refetchQueries)(mutationResult, _this.props.client, _this.props.refetchSchemas, schema);
|
|
100
118
|
};
|
|
101
119
|
_this.schemaName = _this.props.result.replace(/[\[\]\!]/g, '');
|
|
102
120
|
return _this;
|
|
@@ -108,18 +126,18 @@ var ConfirmActionButton = /** @class */ (function (_super) {
|
|
|
108
126
|
if (mandarina_1.Schema.instances[this.schemaName]) {
|
|
109
127
|
if (!resultFields)
|
|
110
128
|
throw new Error('ActionForm: if the result is a Schema you need to enter resultFields');
|
|
111
|
-
queryFromFields = utils_1.buildQueryFromFields(resultFields);
|
|
129
|
+
queryFromFields = (0, utils_1.buildQueryFromFields)(resultFields);
|
|
112
130
|
}
|
|
113
131
|
if (resultFields) {
|
|
114
|
-
queryFromFields = utils_1.buildQueryFromFields(resultFields, false);
|
|
132
|
+
queryFromFields = (0, utils_1.buildQueryFromFields)(resultFields, false);
|
|
115
133
|
}
|
|
116
134
|
var dataString = '', dataString2 = '';
|
|
117
135
|
if (schema) {
|
|
118
|
-
dataString = "($data: "
|
|
136
|
+
dataString = "($data: ".concat((0, utils_2.capitalize)(schema.name), "Input!)");
|
|
119
137
|
dataString2 = "(data: $data)";
|
|
120
138
|
}
|
|
121
|
-
var gqlString = "\n mutation "
|
|
122
|
-
var MUTATION = graphql_tag_1.default(gqlString);
|
|
139
|
+
var gqlString = "\n mutation ".concat(actionName, " ").concat(dataString, "{\n ").concat(actionName, " ").concat(dataString2, "\n ").concat(queryFromFields, "\n }\n ");
|
|
140
|
+
var MUTATION = (0, graphql_tag_1.default)(gqlString);
|
|
123
141
|
return (React.createElement(react_apollo_1.Mutation, { mutation: MUTATION, onCompleted: onCompleted,
|
|
124
142
|
// @ts-ignore
|
|
125
143
|
refetchQueries: refetchQueries, update: update, ignoreResults: ignoreResults, optimisticResponse: optimisticResponse, awaitRefetchQueries: awaitRefetchQueries, onError: onError, context: context }, function (mutation, _a) {
|
|
@@ -139,7 +157,7 @@ var ConfirmActionButton = /** @class */ (function (_super) {
|
|
|
139
157
|
};
|
|
140
158
|
return ConfirmActionButton;
|
|
141
159
|
}(React.PureComponent));
|
|
142
|
-
var ConfirmActionFormWithApollo = react_apollo_1.withApollo(ConfirmActionButton);
|
|
160
|
+
var ConfirmActionFormWithApollo = (0, react_apollo_1.withApollo)(ConfirmActionButton);
|
|
143
161
|
exports.default = React.forwardRef(function (props, ref) {
|
|
144
162
|
return React.createElement(ConfirmActionFormWithApollo, __assign({}, props, { innerRef: ref }));
|
|
145
163
|
});
|
package/build/Forms.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Schema } from "mandarina";
|
|
|
3
3
|
import { CreateProps, MutateResultProps, UpdateProps } from "mandarina/build/Operations/Mutate";
|
|
4
4
|
import { OperationVariables } from "react-apollo";
|
|
5
5
|
import { Model, Overwrite } from "mandarina/build/Schema/Schema";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
7
|
+
type Component = (props: CreateProps | UpdateProps) => ReactElement;
|
|
8
|
+
type FormPropsOmitComponent = Omit<FormProps, 'Component'>;
|
|
9
9
|
export interface CreateFormProps extends FormPropsOmitComponent {
|
|
10
10
|
ref?: React.Ref<HTMLFormElement>;
|
|
11
11
|
}
|
|
@@ -18,9 +18,9 @@ export interface DeleteFormProps extends FormPropsOmitComponent {
|
|
|
18
18
|
id: string;
|
|
19
19
|
ref?: React.Ref<HTMLFormElement>;
|
|
20
20
|
}
|
|
21
|
-
export declare const CreateForm: React.ForwardRefExoticComponent<Pick<CreateFormProps, "id" | "placeholder" | "style" | "children" | "onChange" | "onSubmit" | "onError" | "disabled" | "client" | "ignoreResults" | "optimisticResponse" | "variables" | "refetchQueries" | "awaitRefetchQueries" | "update" | "onCompleted" | "context" | "fetchPolicy" | "schema" | "refetchSchemas" | "innerRef" | "
|
|
22
|
-
export declare const UpdateForm: React.ForwardRefExoticComponent<Pick<UpdateFormProps, "id" | "placeholder" | "style" | "children" | "onChange" | "onSubmit" | "onError" | "disabled" | "client" | "ignoreResults" | "optimisticResponse" | "variables" | "refetchQueries" | "awaitRefetchQueries" | "update" | "onCompleted" | "context" | "fetchPolicy" | "schema" | "refetchSchemas" | "innerRef" | "
|
|
23
|
-
export declare const DeleteForm: React.ForwardRefExoticComponent<Pick<DeleteFormProps, "id" | "placeholder" | "style" | "children" | "onChange" | "onSubmit" | "onError" | "disabled" | "client" | "ignoreResults" | "optimisticResponse" | "variables" | "refetchQueries" | "awaitRefetchQueries" | "update" | "onCompleted" | "context" | "fetchPolicy" | "schema" | "refetchSchemas" | "innerRef" | "
|
|
21
|
+
export declare const CreateForm: React.ForwardRefExoticComponent<Pick<CreateFormProps, "id" | "placeholder" | "style" | "children" | "onChange" | "onSubmit" | "onError" | "disabled" | "client" | "ignoreResults" | "optimisticResponse" | "variables" | "refetchQueries" | "awaitRefetchQueries" | "update" | "onCompleted" | "context" | "fetchPolicy" | "schema" | "refetchSchemas" | "innerRef" | "error" | "fields" | "overwrite" | "showInlineError" | "autosaveDelay" | "autosave" | "label" | "model" | "modelTransform" | "onSubmitFailure" | "onSubmitSuccess" | "onValidate" | "onChangeModel" | "validate"> & React.RefAttributes<HTMLFormElement>>;
|
|
22
|
+
export declare const UpdateForm: React.ForwardRefExoticComponent<Pick<UpdateFormProps, "id" | "placeholder" | "style" | "children" | "onChange" | "onSubmit" | "onError" | "disabled" | "client" | "ignoreResults" | "optimisticResponse" | "variables" | "refetchQueries" | "awaitRefetchQueries" | "update" | "onCompleted" | "context" | "fetchPolicy" | "schema" | "refetchSchemas" | "innerRef" | "error" | "fields" | "overwrite" | "showInlineError" | "autosaveDelay" | "autosave" | "label" | "model" | "modelTransform" | "onSubmitFailure" | "onSubmitSuccess" | "onValidate" | "onChangeModel" | "validate" | "readFields"> & React.RefAttributes<HTMLFormElement>>;
|
|
23
|
+
export declare const DeleteForm: React.ForwardRefExoticComponent<Pick<DeleteFormProps, "id" | "placeholder" | "style" | "children" | "onChange" | "onSubmit" | "onError" | "disabled" | "client" | "ignoreResults" | "optimisticResponse" | "variables" | "refetchQueries" | "awaitRefetchQueries" | "update" | "onCompleted" | "context" | "fetchPolicy" | "schema" | "refetchSchemas" | "innerRef" | "error" | "fields" | "overwrite" | "showInlineError" | "autosaveDelay" | "autosave" | "label" | "model" | "modelTransform" | "onSubmitFailure" | "onSubmitSuccess" | "onValidate" | "onChangeModel" | "validate"> & React.RefAttributes<HTMLFormElement>>;
|
|
24
24
|
export interface AutoFormProps {
|
|
25
25
|
showInlineError?: boolean;
|
|
26
26
|
autosaveDelay?: number;
|
package/build/Forms.js
CHANGED
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
37
|
var t = {};
|
|
15
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -21,17 +44,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
44
|
}
|
|
22
45
|
return t;
|
|
23
46
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
28
|
-
result["default"] = mod;
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
49
|
};
|
|
34
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.DeleteForm = exports.UpdateForm = exports.CreateForm = void 0;
|
|
35
52
|
var react_1 = __importStar(require("react"));
|
|
36
53
|
var mandarina_1 = require("mandarina");
|
|
37
54
|
var AutoForm_1 = __importDefault(require("uniforms-antd/AutoForm"));
|
|
@@ -47,7 +64,7 @@ exports.CreateForm = react_1.default.forwardRef(function (props, ref) {
|
|
|
47
64
|
});
|
|
48
65
|
exports.UpdateForm = react_1.default.forwardRef(function (_a, ref) {
|
|
49
66
|
var fields = _a.fields, _b = _a.readFields, readFields = _b === void 0 ? fields : _b, props = __rest(_a, ["fields", "readFields"]);
|
|
50
|
-
var Component = react_1.useMemo(function () { return function (_a) {
|
|
67
|
+
var Component = (0, react_1.useMemo)(function () { return function (_a) {
|
|
51
68
|
var children = _a.children, id = _a.id, props = __rest(_a, ["children", "id"]);
|
|
52
69
|
return react_1.default.createElement(mandarina_1.Update, __assign({}, props, { fields: readFields, id: id, children: children }));
|
|
53
70
|
}; }, [readFields.join()]);
|
|
@@ -16,8 +16,8 @@ export interface HeaderProps extends ControlledListProps {
|
|
|
16
16
|
where: any;
|
|
17
17
|
client: ApolloClient<any>;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
20
|
-
export
|
|
19
|
+
export type Action = (props: HeaderActionButtonProps) => void | Promise<any>;
|
|
20
|
+
export type ContentFnc = (props: HeaderActionButtonProps) => ReactNode;
|
|
21
21
|
export interface HeaderDefaultProps {
|
|
22
22
|
leftButtons?: ReactNode;
|
|
23
23
|
counter?: boolean;
|
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
37
|
var t = {};
|
|
15
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -21,13 +44,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
44
|
}
|
|
22
45
|
return t;
|
|
23
46
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
28
|
-
result["default"] = mod;
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
49
|
};
|
|
@@ -42,7 +58,7 @@ var getOption = function (optionName) {
|
|
|
42
58
|
};
|
|
43
59
|
var HeaderDefault = function (_a) {
|
|
44
60
|
var leftButtons = _a.leftButtons, _b = _a.counter, counter = _b === void 0 ? true : _b, _c = _a.menuItems, menuItems = _c === void 0 ? [] : _c, count = _a.count, props = __rest(_a, ["leftButtons", "counter", "menuItems", "count"]);
|
|
45
|
-
var _d = react_1.useState(false), loadingAction = _d[0], setLoadingAction = _d[1];
|
|
61
|
+
var _d = (0, react_1.useState)(false), loadingAction = _d[0], setLoadingAction = _d[1];
|
|
46
62
|
var menu = menuItems.map(function (item, index) {
|
|
47
63
|
if (typeof item === 'string') {
|
|
48
64
|
var existingOption = getOption(item);
|
|
@@ -50,7 +66,7 @@ var HeaderDefault = function (_a) {
|
|
|
50
66
|
return existingOption;
|
|
51
67
|
}
|
|
52
68
|
else {
|
|
53
|
-
throw new Error("List menu option named "
|
|
69
|
+
throw new Error("List menu option named ".concat(item, " do not exist"));
|
|
54
70
|
}
|
|
55
71
|
}
|
|
56
72
|
var action = item.action, content = item.content;
|
|
@@ -81,7 +97,7 @@ var HeaderDefault = function (_a) {
|
|
|
81
97
|
});
|
|
82
98
|
return (react_1.default.createElement(row_1.default, { gutter: 0, className: 'mandarina-list-menu' },
|
|
83
99
|
react_1.default.createElement(col_1.default, { xs: 5, sm: 4, md: 3, lg: 2, xl: 2, xxl: 1 },
|
|
84
|
-
counter && "Total: "
|
|
100
|
+
counter && "Total: ".concat(count === 0 || count ? count : '...'),
|
|
85
101
|
leftButtons),
|
|
86
102
|
!!menu.length && react_1.default.createElement(col_1.default, { xs: 19, sm: 20, md: 21, lg: 22, xl: 22, xxl: 23, style: { textAlign: 'right' } },
|
|
87
103
|
react_1.default.createElement(antd_1.Spin, { spinning: loadingAction },
|
package/build/List/List.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Where } from "./ListFilter";
|
|
|
7
7
|
import { FindProps } from "mandarina/build/Operations/Find";
|
|
8
8
|
import { ReactComponentLike } from "prop-types";
|
|
9
9
|
import { TableProps } from "antd/lib/table/interface";
|
|
10
|
-
export
|
|
10
|
+
export type onResize = (e: any, { size }: {
|
|
11
11
|
size: {
|
|
12
12
|
width: number;
|
|
13
13
|
};
|
|
@@ -70,7 +70,7 @@ export declare class List extends React.Component<ListProps, {
|
|
|
70
70
|
};
|
|
71
71
|
getColumns(fields: string[], path?: string): ColumnProps<any>[];
|
|
72
72
|
getColumnDefinition: (field: string, index: number) => ColumnProps<any> | undefined;
|
|
73
|
-
buildFetchMore: (fetchMore: (fetchMoreOptions: any) => Promise<any>, endCursor?: string
|
|
73
|
+
buildFetchMore: (fetchMore: (fetchMoreOptions: any) => Promise<any>, endCursor?: string) => void;
|
|
74
74
|
filters: {
|
|
75
75
|
[field: string]: Where;
|
|
76
76
|
};
|