mandarina-antd 2.5.3 → 2.5.4
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/package.json +1 -1
- package/src/ActionButton.js +102 -0
- package/src/ActionButton.js.map +1 -0
- package/src/ActionForm.js +103 -0
- package/src/ActionForm.js.map +1 -0
- package/src/Auth.js +46 -0
- package/src/Auth.js.map +1 -0
- package/src/Bridge.js +239 -0
- package/src/Bridge.js.map +1 -0
- package/src/ConfirmActionButton.js +105 -0
- package/src/ConfirmActionButton.js.map +1 -0
- package/src/Forms.js +104 -0
- package/src/Forms.js.map +1 -0
- package/src/List/HeaderDefault.js +96 -0
- package/src/List/HeaderDefault.js.map +1 -0
- package/src/List/HideColumn.js +12 -0
- package/src/List/HideColumn.js.map +1 -0
- package/src/List/List.js +227 -0
- package/src/List/List.js.map +1 -0
- package/src/List/ListFilter.js +83 -0
- package/src/List/ListFilter.js.map +1 -0
- package/src/List/ListFilters.js +225 -0
- package/src/List/ListFilters.js.map +1 -0
- package/src/List/ListVirtualized.js +477 -0
- package/src/List/ListVirtualized.js.map +1 -0
- package/src/List/SortButton.js +23 -0
- package/src/List/SortButton.js.map +1 -0
- package/src/List/SortableColumns.js +28 -0
- package/src/List/SortableColumns.js.map +1 -0
- package/src/List/utils.js +7 -0
- package/src/List/utils.js.map +1 -0
- package/src/index.js +42 -0
- package/src/index.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmActionButton.js","sourceRoot":"","sources":["ConfirmActionButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA8B;AAE9B,+CAQqB;AACrB,8DAA8B;AAC9B,yCAAgC;AAChC,4DAAsE;AACtE,8DAAiE;AACjE,6DAAoD;AACpD,wDAAwD;AACxD,+BAA2B;AAiB3B,MAAM,mBAAoB,SAAQ,KAAK,CAAC,aAAyD;IAG7F,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AAEnE,kBAAe,KAAK,CAAC,UAAU,CAAmC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAC7E,oBAAC,2BAA2B,oBAAK,KAAK,IAAE,QAAQ,EAAE,GAAG,IAAG,CAAC,CAAA"}
|
package/src/Forms.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.DeleteForm = exports.UpdateForm = exports.CreateForm = void 0;
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const mandarina_1 = require("mandarina");
|
|
43
|
+
const AutoForm_1 = __importDefault(require("uniforms-antd/AutoForm"));
|
|
44
|
+
const SubmitField_1 = __importDefault(require("uniforms-antd/SubmitField"));
|
|
45
|
+
const Mutate_1 = require("mandarina/build/Operations/Mutate");
|
|
46
|
+
const Bridge_1 = require("./Bridge");
|
|
47
|
+
//
|
|
48
|
+
const ErrorsField = require("./uniforms/ErrorsField").default;
|
|
49
|
+
const AutoFields = require("./uniforms/AutoFields").default;
|
|
50
|
+
const AutoField = require("./uniforms/AutoField").default;
|
|
51
|
+
exports.CreateForm = react_1.default.forwardRef((props, ref) => react_1.default.createElement(Form, Object.assign({ Component: mandarina_1.Create }, props, { innerRef: ref })));
|
|
52
|
+
exports.UpdateForm = react_1.default.forwardRef((_a, ref) => {
|
|
53
|
+
var { fields, readFields = fields } = _a, props = __rest(_a, ["fields", "readFields"]);
|
|
54
|
+
const Component = (0, react_1.useMemo)(() => (_a) => {
|
|
55
|
+
var { children, id } = _a, props = __rest(_a, ["children", "id"]);
|
|
56
|
+
return react_1.default.createElement(mandarina_1.Update, Object.assign({}, props, { fields: readFields, id: id, children: children }));
|
|
57
|
+
}, [readFields.join()]);
|
|
58
|
+
return react_1.default.createElement(Form, Object.assign({ Component: Component, fields: fields }, props, { innerRef: ref }));
|
|
59
|
+
});
|
|
60
|
+
exports.DeleteForm = react_1.default.forwardRef((props, ref) => react_1.default.createElement(Form, Object.assign({ Component: Mutate_1.Delete }, props, { innerRef: ref })));
|
|
61
|
+
// /**
|
|
62
|
+
// * If a fields is Table and the form is query, it'll remove all subfields diferents to id
|
|
63
|
+
// * @param fields
|
|
64
|
+
// * @param schema
|
|
65
|
+
// * @param overwrite
|
|
66
|
+
// */
|
|
67
|
+
// export const normalizeFields = (fields: string[], schema: Schema, overwrite?: Overwrite) => {
|
|
68
|
+
// const tables: string[] = []
|
|
69
|
+
// const result: string[] = []
|
|
70
|
+
// fields.forEach((field) => {
|
|
71
|
+
// if (field.match(/\.id$/)) {
|
|
72
|
+
// const parent = field.substr(0, field.length - 3)
|
|
73
|
+
// const def = schema.getPathDefinition(parent)
|
|
74
|
+
// // @ts-ignore
|
|
75
|
+
// const query = (overwrite && overwrite[field] && overwrite[field].form && overwrite[field].form.props && overwrite[field].form.props.query) || (def && def.form && def.form.props && def.form.props.query)
|
|
76
|
+
// if (query) tables.push(parent.replace(/\./, '\\.'))
|
|
77
|
+
// }
|
|
78
|
+
// result.push(field)
|
|
79
|
+
// })
|
|
80
|
+
// if (tables.length === 0) return result
|
|
81
|
+
// const rg = new RegExp(`^(${tables.join('|')})\\.(?!id$).*`)
|
|
82
|
+
// return result.filter((field) => !rg.test(field))
|
|
83
|
+
// }
|
|
84
|
+
const Form = (_a) => {
|
|
85
|
+
var { Component, fields, schema, innerRef, id, onSubmit, children, showInlineError, autosaveDelay, autosave, model, disabled, onChange, error, modelTransform, label, onSubmitSuccess, onValidate, onSubmitFailure, onChangeModel, overwrite, style, validate } = _a, mutationProps = __rest(_a, ["Component", "fields", "schema", "innerRef", "id", "onSubmit", "children", "showInlineError", "autosaveDelay", "autosave", "model", "disabled", "onChange", "error", "modelTransform", "label", "onSubmitSuccess", "onValidate", "onSubmitFailure", "onChangeModel", "overwrite", "style", "validate"]);
|
|
86
|
+
const bridge = new Bridge_1.Bridge(schema, fields, overwrite);
|
|
87
|
+
const isDelete = Component === Mutate_1.Delete;
|
|
88
|
+
const allFields = isDelete ? [] : fields;
|
|
89
|
+
return (react_1.default.createElement(Component, Object.assign({ id: id, schema: schema, fields: allFields }, mutationProps), (_a) => {
|
|
90
|
+
var { mutate, doc = model, loading, called } = _a, rest = __rest(_a, ["mutate", "doc", "loading", "called"]);
|
|
91
|
+
return (react_1.default.createElement(AutoForm_1.default, { key: id && doc && 'key', schema: bridge, model: doc, onSubmit: (model) => {
|
|
92
|
+
schema.clean(model, allFields); // fill null all missing keys
|
|
93
|
+
onSubmit && onSubmit(model);
|
|
94
|
+
return mutate(model);
|
|
95
|
+
}, onChangeModel: onChangeModel, ref: innerRef, onChange: onChange, modelTransform: modelTransform, autosave: autosave, label: label, error: error, disabled: loading || disabled, showInlineError: showInlineError, autosaveDelay: autosaveDelay, autoField: AutoField, onSubmitSuccess: onSubmitSuccess, onSubmitFailure: onSubmitFailure, onValidate: onValidate, style: style, validate: validate },
|
|
96
|
+
children && typeof children !== "function" && children,
|
|
97
|
+
children && typeof children === "function" && children(Object.assign(Object.assign({ doc, loading, called }, rest), { fields })),
|
|
98
|
+
!children && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
99
|
+
react_1.default.createElement(AutoFields, { autoField: AutoField, fields: fields }),
|
|
100
|
+
react_1.default.createElement(ErrorsField, { style: { marginBottom: '15px' } }),
|
|
101
|
+
!autosave && react_1.default.createElement(SubmitField_1.default, { value: 'Save', size: 'large', loading: loading })))));
|
|
102
|
+
}));
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=Forms.js.map
|
package/src/Forms.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Forms.js","sourceRoot":"","sources":["Forms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkD;AAClD,yCAAiD;AACjD,sEAA6C;AAC7C,4EAAoD;AACp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,GAAG,CAC3E,CAAC,CAED,CACd,CAAA;IACL,CAAC,CACO,CACf,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const col_1 = __importDefault(require("antd/lib/col"));
|
|
42
|
+
const menu_1 = __importDefault(require("antd/lib/menu"));
|
|
43
|
+
const row_1 = __importDefault(require("antd/lib/row"));
|
|
44
|
+
const antd_1 = require("antd");
|
|
45
|
+
const getOption = (optionName) => {
|
|
46
|
+
return false;
|
|
47
|
+
};
|
|
48
|
+
const HeaderDefault = (_a) => {
|
|
49
|
+
var { leftButtons, counter = true, menuItems = [], count } = _a, props = __rest(_a, ["leftButtons", "counter", "menuItems", "count"]);
|
|
50
|
+
const [loadingAction, setLoadingAction] = (0, react_1.useState)(false);
|
|
51
|
+
const menu = menuItems.map((item, index) => {
|
|
52
|
+
if (typeof item === 'string') {
|
|
53
|
+
const existingOption = getOption(item);
|
|
54
|
+
if (existingOption) {
|
|
55
|
+
return existingOption;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
throw new Error(`List menu option named ${item} do not exist`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const { action, content } = item;
|
|
62
|
+
const onClick = () => {
|
|
63
|
+
setLoadingAction(true);
|
|
64
|
+
const result = action && action(Object.assign({ count }, props));
|
|
65
|
+
if (result instanceof Promise) {
|
|
66
|
+
result
|
|
67
|
+
.then(() => setLoadingAction(false))
|
|
68
|
+
.catch(() => setLoadingAction(false));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
setLoadingAction(false);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
if (react_1.default.isValidElement(content) && content.type.name !== 'SubMenu' && content.type.name !== "Menu") {
|
|
76
|
+
let _a = item.props || {}, { disabled } = _a, props = __rest(_a, ["disabled"]);
|
|
77
|
+
if (typeof disabled === 'function')
|
|
78
|
+
disabled = disabled(count);
|
|
79
|
+
return react_1.default.createElement(menu_1.default.Item, Object.assign({}, props, { disabled: disabled, key: index, onClick: onClick }), content);
|
|
80
|
+
}
|
|
81
|
+
if (typeof content === 'function') {
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
return content(Object.assign({ count, setLoadingAction }, props));
|
|
84
|
+
}
|
|
85
|
+
return content;
|
|
86
|
+
});
|
|
87
|
+
return (react_1.default.createElement(row_1.default, { gutter: 0, className: 'mandarina-list-menu' },
|
|
88
|
+
react_1.default.createElement(col_1.default, { xs: 5, sm: 4, md: 3, lg: 2, xl: 2, xxl: 1 },
|
|
89
|
+
counter && `Total: ${count === 0 || count ? count : '...'}`,
|
|
90
|
+
leftButtons),
|
|
91
|
+
!!menu.length && react_1.default.createElement(col_1.default, { xs: 19, sm: 20, md: 21, lg: 22, xl: 22, xxl: 23, style: { textAlign: 'right' } },
|
|
92
|
+
react_1.default.createElement(antd_1.Spin, { spinning: loadingAction },
|
|
93
|
+
react_1.default.createElement(menu_1.default, { className: 'mandarina-list-menu-btn', mode: 'horizontal' }, menu)))));
|
|
94
|
+
};
|
|
95
|
+
exports.default = HeaderDefault;
|
|
96
|
+
//# sourceMappingURL=HeaderDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderDefault.js","sourceRoot":"","sources":["HeaderDefault.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8D;AAK9D,uDAA+B;AAC/B,yDAAiC;AACjC,uDAA+B;AAC/B,+BAA0B;AAiC1B,MAAM,SAAS,GAAG,CAAC,UAAkB,EAAE,EAAE;IACrC,OAAO,KAAK,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,aAAa,G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AAI,EAAE,YAAY,IAAG,IAAI,CAAQ,CAC1E,CACL,CACJ,CACT,CAAA;AACL,CAAC,CAAA;AACD,kBAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const icon_1 = __importDefault(require("antd/lib/icon"));
|
|
8
|
+
const HideColumn = ({ onHide }) => {
|
|
9
|
+
return (react_1.default.createElement(icon_1.default, { type: "close", onClick: onHide, className: 'mandarina-hide-column' }));
|
|
10
|
+
};
|
|
11
|
+
exports.default = HideColumn;
|
|
12
|
+
//# sourceMappingURL=HideColumn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideColumn.js","sourceRoot":"","sources":["HideColumn.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,yDAAiC;AAEjC,MAAM,UAAU,GAAG,CAAC,EAAC,MAAM,EAAmB,EAAE,EAAE;IAC9C,OAAO,CAAC,8BAAC,cAAI,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,GAAI,CAAC,CAAA;AACvF,CAAC,CAAA;AACD,kBAAe,UAAU,CAAA"}
|
package/src/List/List.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.List = void 0;
|
|
41
|
+
const table_1 = __importDefault(require("antd/lib/table"));
|
|
42
|
+
const mandarina_1 = require("mandarina");
|
|
43
|
+
const React = __importStar(require("react"));
|
|
44
|
+
const lodash_1 = require("lodash");
|
|
45
|
+
const ListVirtualized_1 = require("./ListVirtualized");
|
|
46
|
+
const Mutate_1 = require("mandarina/build/Operations/Mutate");
|
|
47
|
+
const antd_1 = require("antd");
|
|
48
|
+
//
|
|
49
|
+
// const components = {
|
|
50
|
+
// header: {
|
|
51
|
+
// cell: ListHeader
|
|
52
|
+
// }
|
|
53
|
+
// };
|
|
54
|
+
class List extends React.Component {
|
|
55
|
+
constructor(props) {
|
|
56
|
+
super(props);
|
|
57
|
+
this.hasNextPage = false;
|
|
58
|
+
this.refetching = false;
|
|
59
|
+
this.getColumnDefinition = (field, index) => {
|
|
60
|
+
const parentPath = (0, ListVirtualized_1.getParentCellComponent)(field, this.props.schema);
|
|
61
|
+
if (parentPath) {
|
|
62
|
+
field = parentPath;
|
|
63
|
+
}
|
|
64
|
+
const overwrite = this.props.overwrite && this.props.overwrite[field];
|
|
65
|
+
let definition;
|
|
66
|
+
if (!this.props.schema.hasPath(field) && field.indexOf('.') < 0 && overwrite) {
|
|
67
|
+
definition = (0, lodash_1.merge)({
|
|
68
|
+
list: {
|
|
69
|
+
noFilter: true,
|
|
70
|
+
noSort: true
|
|
71
|
+
}
|
|
72
|
+
}, (0, Mutate_1.deepClone)(this.props.schema.applyDefinitionsDefaults({ type: String }, field)), overwrite);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
definition = this.props.schema.getPathDefinition(field);
|
|
76
|
+
if (overwrite) {
|
|
77
|
+
definition = (0, lodash_1.merge)((0, Mutate_1.deepClone)(definition), overwrite);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!definition.list)
|
|
81
|
+
throw new Error(`You need to provide overwrite full definition for "${field}"`);
|
|
82
|
+
if (definition.list.hidden)
|
|
83
|
+
return;
|
|
84
|
+
return {
|
|
85
|
+
// fixed: index===0 ? 'left' :undefined,
|
|
86
|
+
dataIndex: field,
|
|
87
|
+
key: field,
|
|
88
|
+
width: definition.list.width,
|
|
89
|
+
title: definition.label ? definition.label : "",
|
|
90
|
+
render: (value, row, index) => {
|
|
91
|
+
const CellComponent = definition.list.CellComponent || ListVirtualized_1.DefaultCellComponent;
|
|
92
|
+
return React.createElement(CellComponent, Object.assign({ columnIndex: 0, rowIndex: index, data: this.data, field: field }, definition.list.props));
|
|
93
|
+
},
|
|
94
|
+
onHeaderCell: (column) => ({
|
|
95
|
+
field: field,
|
|
96
|
+
fieldDefinition: definition,
|
|
97
|
+
// onFilterChange: this.onFilterChange,
|
|
98
|
+
width: column.width,
|
|
99
|
+
onResize: this.handleResize(index),
|
|
100
|
+
})
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
this.buildFetchMore = (fetchMore, endCursor) => {
|
|
104
|
+
const name = this.props.schema.names.query.connection;
|
|
105
|
+
this.fetchMore = () => {
|
|
106
|
+
this.refetching = true;
|
|
107
|
+
fetchMore({
|
|
108
|
+
variables: {
|
|
109
|
+
after: endCursor
|
|
110
|
+
},
|
|
111
|
+
updateQuery: (previousResult, { fetchMoreResult }) => {
|
|
112
|
+
this.refetching = false;
|
|
113
|
+
const newEdges = fetchMoreResult[name].edges;
|
|
114
|
+
const pageInfo = fetchMoreResult[name].pageInfo;
|
|
115
|
+
const aggregate = fetchMoreResult[name].aggregate;
|
|
116
|
+
return newEdges.length
|
|
117
|
+
? {
|
|
118
|
+
// Put the new comments at the end of the list and update `pageInfo`
|
|
119
|
+
// so we have the new `endCursor` and `hasNextPage` values
|
|
120
|
+
[name]: {
|
|
121
|
+
__typename: previousResult[name].__typename,
|
|
122
|
+
edges: [...previousResult[name].edges, ...newEdges],
|
|
123
|
+
pageInfo,
|
|
124
|
+
aggregate
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
: previousResult;
|
|
128
|
+
}
|
|
129
|
+
}).catch((console.error)); //todo
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
this.filters = {};
|
|
133
|
+
// onFilterChange: OnFilterChange = (field, where) => {
|
|
134
|
+
// if (where && !isEmpty(where)) {
|
|
135
|
+
// this.filters[field] = where
|
|
136
|
+
// } else {
|
|
137
|
+
// delete this.filters[field]
|
|
138
|
+
// }
|
|
139
|
+
// const allFilters = Object.values(this.filters)
|
|
140
|
+
// this.variables.where = this.variables.where || {}
|
|
141
|
+
// if (this.props.where) {
|
|
142
|
+
// this.variables.where = {AND: [this.props.where, ...allFilters]}
|
|
143
|
+
// } else {
|
|
144
|
+
// this.variables.where = {AND: allFilters}
|
|
145
|
+
// }
|
|
146
|
+
//
|
|
147
|
+
// this.refetch(this.variables)
|
|
148
|
+
// }
|
|
149
|
+
this.handleResize = (index) => (e, { size }) => {
|
|
150
|
+
this.setState(({ columns }) => {
|
|
151
|
+
const nextColumns = [...columns];
|
|
152
|
+
nextColumns[index] = Object.assign(Object.assign({}, nextColumns[index]), { width: size.width });
|
|
153
|
+
``;
|
|
154
|
+
return { columns: nextColumns };
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
this.firstLoad = true;
|
|
158
|
+
//const definitions: Partial<FieldDefinitions> = {}
|
|
159
|
+
const { fields } = this.props;
|
|
160
|
+
const columns = this.getColumns(fields);
|
|
161
|
+
this.state = { columns };
|
|
162
|
+
this.me = React.createRef();
|
|
163
|
+
this.loading = true;
|
|
164
|
+
this.data = [];
|
|
165
|
+
//this.definitions=definitions
|
|
166
|
+
}
|
|
167
|
+
getColumns(fields, path = "") {
|
|
168
|
+
const columns = [];
|
|
169
|
+
fields.forEach((field, index) => {
|
|
170
|
+
const column = this.getColumnDefinition(field, index);
|
|
171
|
+
if (column && !columns.some((c) => !!(c && c.dataIndex === column.dataIndex))) {
|
|
172
|
+
columns.push(column);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
return columns;
|
|
176
|
+
}
|
|
177
|
+
render() {
|
|
178
|
+
const _a = this.props, { schema, first, fields, header, where, Dimmer, tableProps } = _a, findBaseProps = __rest(_a, ["schema", "first", "fields", "header", "where", "Dimmer", "tableProps"]);
|
|
179
|
+
const { columns } = this.state;
|
|
180
|
+
return (React.createElement("div", { className: "list-wrapper", style: { width: '100%' }, ref: this.me },
|
|
181
|
+
React.createElement(mandarina_1.Find, Object.assign({ schema: schema, where: where, first: first, fields: fields }, findBaseProps), ({ data = [], variables, refetch, loading, count, pageInfo, fetchMore, error }) => {
|
|
182
|
+
this.loading = loading;
|
|
183
|
+
if (error)
|
|
184
|
+
return React.createElement(antd_1.Result, { status: "500", subTitle: error.message });
|
|
185
|
+
this.refetch = refetch;
|
|
186
|
+
this.variables = variables;
|
|
187
|
+
this.buildFetchMore(fetchMore, pageInfo && pageInfo.endCursor);
|
|
188
|
+
this.hasNextPage = !!(pageInfo && pageInfo.hasNextPage);
|
|
189
|
+
const dataSource = loading && this.hasNextPage ? [...data, ...new Array(first).fill({})] : data;
|
|
190
|
+
if (!loading)
|
|
191
|
+
this.firstLoad = false;
|
|
192
|
+
//this.lastHeight = this.me && this.me.current && this.me.current.offsetHeight || 0// && this.me.current && this.me.current.clientHeight || document.body.clientHeight + scrollTop + 200
|
|
193
|
+
let headerNode = null;
|
|
194
|
+
if (typeof header === 'function') {
|
|
195
|
+
const Header = header;
|
|
196
|
+
headerNode = React.createElement(Header, { data: dataSource, count: count });
|
|
197
|
+
}
|
|
198
|
+
if (typeof header === 'object' || !header) {
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
headerNode = React.createElement(HeaderDefault, Object.assign({ data: dataSource, count: count }, header));
|
|
201
|
+
}
|
|
202
|
+
this.data = dataSource;
|
|
203
|
+
return (React.createElement("div", null,
|
|
204
|
+
headerNode,
|
|
205
|
+
React.createElement("div", { style: { position: 'relative' } },
|
|
206
|
+
Dimmer && React.createElement(Dimmer, null),
|
|
207
|
+
React.createElement(table_1.default, Object.assign({ scroll: { x: 'auto' }, pagination: {
|
|
208
|
+
pageSize: 5000,
|
|
209
|
+
total: count,
|
|
210
|
+
simple: true,
|
|
211
|
+
hideOnSinglePage: true,
|
|
212
|
+
}, rowKey: (record) => record.id, bordered: true,
|
|
213
|
+
//components={components}
|
|
214
|
+
columns: columns, loading: this.firstLoad, dataSource: dataSource }, tableProps)))));
|
|
215
|
+
})));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
exports.List = List;
|
|
219
|
+
List.defaultProps = {
|
|
220
|
+
first: 300,
|
|
221
|
+
pageSize: 300,
|
|
222
|
+
};
|
|
223
|
+
const HeaderDefault = ({ count, title = ' total' }) => React.createElement("div", { style: { textAlign: "right" } },
|
|
224
|
+
count,
|
|
225
|
+
" ",
|
|
226
|
+
title);
|
|
227
|
+
//# sourceMappingURL=List.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["List.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAAsD;AACtD,yCAAuC;AACvC,6CAA+B;AAI/B,mCAA6B;AAC7B,uDAA+E;AAE/E,8DAA4D;AAC5D,+BAA4B;AAiD5B,EAAE;AACF,uBAAuB;AACvB,gBAAgB;AAChB,2BAA2B;AAC3B,QAAQ;AACR,KAAK;AAEL,MAAa,IAAK,SAAQ,KAAK,CAAC,SAAqD;IAUjF,YAAY,KAAgB;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QAPjB,gBAAW,GAAY,KAAK,CAAA;QAC5B,eAAU,GAAY,KAAK,CAAA;QAoC3B,wBAAmB,GAAG,CAAC,KAAa,EAAE,KAAa,EAAgC,EAAE;YACjF,MAAM,UAAU,GAAG,IAAA,wCAAsB,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACpE,IAAI,UAAU,EAAE;gBACZ,KAAK,GAAG,UAAU,CAAA;aACrB;YACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAEtE,IAAI,UAA2B,CAAA;YAC/B,IAAI,C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H;oBACK,UAAU;oBACX,6BAAK,KAAK,EAAE,EAAC,QAAQ,EAAE,UAAU,EAAC;wBAC7B,MAAM,IAAI,oBAAC,MAAM,OAAE;wBACpB,oBAAC,eAAS,kBACN,MAAM,EAAE,EAAC,CAAC,EAAE,MAAM,EAAC,EACnB,UAAU,EAAE;gCACR,QAAQ,EAAE,IAAI;gCACd,KAAK,EAAE,KAAK;gCACZ,MAAM,EAAE,IAAI;gCACZ,gBAAgB,EAAE,IAAI;6BACzB,EACD,MAAM,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,EAElC,QAAQ;4BACR,yBAAyB;4BACzB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,IAAI,CAAC,SAAS,EACvB,UAAU,EAAE,UAAU,IAClB,UAAU,EAChB,CACA,CACJ,CACT,CAAA;YACL,CAAC,CAEE,CACL,CACT,CAAC;IACN,CAAC;;AApNL,oBAqNC;AA7LU,iBAAY,GAAG;IAClB,KAAK,EAAE,GAAG;IACV,QAAQ,EAAE,GAAG;CAChB,CAAA;AA6LL,MAAM,aAAa,GAAG,CAAC,EAAC,KAAK,EAAC,KAAK,GAAC,QAAQ,EAAmC,EAAE,EAAE,CAAC,6BAAK,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAC;IAAG,KAAK;;IAAG,KAAK,CAAO,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ListFilter = exports.uuid = void 0;
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const react_1 = require("react");
|
|
32
|
+
const AutoForm_1 = __importDefault(require("uniforms-antd/AutoForm"));
|
|
33
|
+
const mandarina_1 = require("mandarina");
|
|
34
|
+
const Bridge_1 = require("../Bridge");
|
|
35
|
+
const ListFilters_1 = require("./ListFilters");
|
|
36
|
+
const Mutate_1 = require("mandarina/build/Operations/Mutate");
|
|
37
|
+
const HiddenField_1 = __importDefault(require("uniforms-antd/HiddenField"));
|
|
38
|
+
const lodash_1 = require("lodash");
|
|
39
|
+
const uuid = () => 'i' + (Date.now() - 1540000000000 + Math.random()).toString(36);
|
|
40
|
+
exports.uuid = uuid;
|
|
41
|
+
exports.ListFilter = (0, react_1.memo)(({ onFilterChange, overwrite, field, filter, schema, filters }) => {
|
|
42
|
+
let FieldComponent = (0, react_1.useMemo)(() => {
|
|
43
|
+
const fieldDefinition = (0, lodash_1.merge)((0, Mutate_1.deepClone)(schema.getPathDefinition(field)), overwrite);
|
|
44
|
+
let FC;
|
|
45
|
+
if (fieldDefinition.isTable) {
|
|
46
|
+
if (fieldDefinition.list.filterComponent === undefined) {
|
|
47
|
+
throw new Error(`Field: "${field}" you need to set "list.noFilter" to true, or pass your custom filterComponent "`);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
FC = fieldDefinition.list.filterComponent;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
FC = fieldDefinition.list.filterComponent === undefined ? (0, ListFilters_1.getDefaultComponent)(fieldDefinition) : fieldDefinition.list.filterComponent;
|
|
55
|
+
}
|
|
56
|
+
return FC;
|
|
57
|
+
}, [schema, field]);
|
|
58
|
+
const name = (0, react_1.useRef)(`filter-${field}-${(0, exports.uuid)()}`).current; //todo remove this dependeincy making schema get optional name
|
|
59
|
+
const bridge = (0, react_1.useMemo)(() => {
|
|
60
|
+
const fieldDefinition = (0, Mutate_1.deepClone)(schema.getPathDefinition(field));
|
|
61
|
+
fieldDefinition.validators = fieldDefinition.validators.filter(({ validatorName, arrayValidator, tableValidator }) => validatorName !== 'required' && !arrayValidator && !tableValidator);
|
|
62
|
+
const filterSchema = new mandarina_1.Schema({
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
filter: fieldDefinition,
|
|
65
|
+
internal: { type: String }
|
|
66
|
+
}, {
|
|
67
|
+
name
|
|
68
|
+
});
|
|
69
|
+
return new Bridge_1.Bridge(filterSchema, filterSchema.getFields());
|
|
70
|
+
}, [schema, field]);
|
|
71
|
+
const onSubmit = ({ filter }) => {
|
|
72
|
+
if (filter)
|
|
73
|
+
filter.internal = 'true'; //this is for avoid rerender, if the filter does not have internal, is because is a external change as clear filters.
|
|
74
|
+
onFilterChange(field, filter);
|
|
75
|
+
};
|
|
76
|
+
return FieldComponent && (React.createElement(AutoForm_1.default, { schema: bridge, autosave: true, autosaveDelay: 400, style: { width: 'calc(100% - 4px)' }, onSubmit: onSubmit, onValidate: (model, error, callback) => {
|
|
77
|
+
return callback(null);
|
|
78
|
+
}, model: { filter } },
|
|
79
|
+
React.createElement(HiddenField_1.default, { name: 'internal' }),
|
|
80
|
+
React.createElement(FieldComponent, { name: 'filter', label: false, col: false, defaultValue: '', filters: filters })));
|
|
81
|
+
});
|
|
82
|
+
exports.default = exports.ListFilter;
|
|
83
|
+
//# sourceMappingURL=ListFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListFilter.js","sourceRoot":"","sources":["ListFilter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,iCAA4C;AAC5C,sEAA8C;AAC9C,yCAAiC;AACjC,sCAAiC;AACjC,+CAAkD;AAElD,8DAA4D;AAC5D,4EAAoD;AACpD,mCAA6B;AAEtB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AAA5E,QAAA,IAAI,QAAwE;AAmB5E,QAAA,UAAU,GAAG,IAAA,YAAI,EAAC,CAAC,EAAC,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAkB,EAAE,EAAE;IAC5G,IAAI,cAAc,GAAoB,IAAA,eAAO,EAAC,GAAG,EAAE;QAC/C,MAAM,eAAe,GAAoB,IAAA,cAAK,EAAC,IAAA,kBAAS,EAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,EAAC,SAAS,CAAC,CAAA;QACpG,IAAI,EAAmB,CAAA;QACvB,IAAI,eAAe,CAAC,OAAO,EAAE;YACzB,IAAI,eAAe,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE;gBACpD,MAAM,IAAI,KAAK,CAAC,WAAW,KAAK,mFAAmF,CAAC,CAAA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