@voplus/morpho-workspace 1.3.155 → 1.3.156
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/es/modules/board/components/NewColumnDocumentForm/index.js +21 -23
- package/es/modules/board/components/NewColumnDocumentForm/index.js.map +1 -1
- package/es/modules/board/components/NewColumnDocumentForm/state.d.ts +1 -10
- package/es/modules/board/components/NewColumnDocumentForm/state.js +2 -64
- package/es/modules/board/components/NewColumnDocumentForm/state.js.map +1 -1
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
3
3
|
import { State } from "./state";
|
4
|
-
import { Form, Input, Spin
|
4
|
+
import { Form, Input, Spin } from "@voplus/antd";
|
5
5
|
import { useDocumentStore, useMetaStore } from "@voplus/morpho-document-core";
|
6
6
|
import { useApplicationContext } from "@voplus/morpho-data";
|
7
7
|
import { runInAction } from "mobx";
|
@@ -11,10 +11,8 @@ const NewColumnDocumentForm = (props) => {
|
|
11
11
|
const { user } = useApplicationContext();
|
12
12
|
const documents = useDocumentStore();
|
13
13
|
const meta = useMetaStore();
|
14
|
-
const [state] = useState(new State(
|
15
|
-
|
16
|
-
const [loading, setLoading] = useState(false);
|
17
|
-
return observe(() => (React.createElement(AddFormView, { title: `Add ${type} in ${columnName}`, onCancel: onCancel, onSubmit: onSubmit }, type === "Deal" || type === "Quotation" || type === "Form" ? (React.createElement("div", null, type &&
|
14
|
+
const [state] = useState(new State());
|
15
|
+
return observe(() => (React.createElement(AddFormView, { title: `Add ${type} in ${columnName}`, onCancel: onCancel, onSubmit: () => onSubmit(state.createData) }, type === "Deal" || type === "Quotation" || type === "Form" ? (React.createElement("div", null, type &&
|
18
16
|
meta.getNewForm({
|
19
17
|
id: "",
|
20
18
|
type: type,
|
@@ -24,29 +22,29 @@ const NewColumnDocumentForm = (props) => {
|
|
24
22
|
onChange: (data) => runInAction(() => (state.createData = data)),
|
25
23
|
}))) : (React.createElement(Form, { layout: "vertical" },
|
26
24
|
React.createElement(Form.Item, null,
|
27
|
-
React.createElement(Spin, { spinning: !!loading },
|
25
|
+
React.createElement(Spin, { spinning: !!state.loading },
|
28
26
|
React.createElement("div", { className: "form-item-layout" },
|
29
|
-
React.createElement(Input, { autoFocus: true,
|
27
|
+
React.createElement(Input, { autoFocus: true, placeholder: `Add a ${type === "Document" ? "Folder" : type} for state Document`, onChange: (e) => runInAction(() => (state.createData = { Name: e.target.value })) })))))))));
|
30
28
|
function onCancel() {
|
31
|
-
|
29
|
+
runInAction(() => (state.createData = undefined));
|
32
30
|
if (props.onCancel)
|
33
31
|
props.onCancel();
|
34
32
|
}
|
35
|
-
async function onSubmit() {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
33
|
+
async function onSubmit(value) {
|
34
|
+
state.loading = true;
|
35
|
+
const data = type === "Task (For Self)"
|
36
|
+
? { MemberIds: [user.info.id], ...value, Type: "Task", ParentId: parentId }
|
37
|
+
: {
|
38
|
+
...value,
|
39
|
+
Type: type,
|
40
|
+
ParentId: parentId,
|
41
|
+
};
|
42
|
+
await documents.createFromType({
|
43
|
+
data: data,
|
44
|
+
error: "message",
|
45
|
+
});
|
46
|
+
onCancel();
|
47
|
+
runInAction(() => (state.loading = false));
|
50
48
|
}
|
51
49
|
};
|
52
50
|
export default NewColumnDocumentForm;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/NewColumnDocumentForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,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IAAI,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE;YAC3E,CAAC,CAAC;gBACA,GAAG,KAAK;gBACR,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,QAAQ;aACjB,CAAC;QACN,MAAM,SAAS,CAAC,cAAc,CAAC;YAC9B,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,SAAS;SAChB,CAAC,CAAC;QACH,QAAQ,EAAE,CAAC;QACX,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;IAC5C,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
@@ -1,15 +1,6 @@
|
|
1
|
-
import { UserContext } from "@voplus/morpho-data";
|
2
|
-
import { DocumentStore } from "@voplus/morpho-document-core";
|
3
1
|
export declare class State {
|
4
|
-
|
5
|
-
private _user;
|
6
|
-
private parentId;
|
7
|
-
constructor(_store: DocumentStore, _user: UserContext, parentId: string);
|
2
|
+
constructor();
|
8
3
|
/** loading */
|
9
4
|
loading: boolean;
|
10
|
-
type: string;
|
11
5
|
createData: any;
|
12
|
-
onCancel?: () => void;
|
13
|
-
/** new document submit function */
|
14
|
-
onSubmit: (value?: any) => Promise<void>;
|
15
6
|
}
|
@@ -1,25 +1,7 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import {
|
2
|
+
import { makeObservable, observable } from "mobx";
|
3
3
|
export class State {
|
4
|
-
constructor(
|
5
|
-
Object.defineProperty(this, "_store", {
|
6
|
-
enumerable: true,
|
7
|
-
configurable: true,
|
8
|
-
writable: true,
|
9
|
-
value: _store
|
10
|
-
});
|
11
|
-
Object.defineProperty(this, "_user", {
|
12
|
-
enumerable: true,
|
13
|
-
configurable: true,
|
14
|
-
writable: true,
|
15
|
-
value: _user
|
16
|
-
});
|
17
|
-
Object.defineProperty(this, "parentId", {
|
18
|
-
enumerable: true,
|
19
|
-
configurable: true,
|
20
|
-
writable: true,
|
21
|
-
value: parentId
|
22
|
-
});
|
4
|
+
constructor() {
|
23
5
|
/** loading */
|
24
6
|
Object.defineProperty(this, "loading", {
|
25
7
|
enumerable: true,
|
@@ -27,63 +9,19 @@ export class State {
|
|
27
9
|
writable: true,
|
28
10
|
value: false
|
29
11
|
});
|
30
|
-
Object.defineProperty(this, "type", {
|
31
|
-
enumerable: true,
|
32
|
-
configurable: true,
|
33
|
-
writable: true,
|
34
|
-
value: "Document"
|
35
|
-
});
|
36
12
|
Object.defineProperty(this, "createData", {
|
37
13
|
enumerable: true,
|
38
14
|
configurable: true,
|
39
15
|
writable: true,
|
40
16
|
value: void 0
|
41
17
|
});
|
42
|
-
Object.defineProperty(this, "onCancel", {
|
43
|
-
enumerable: true,
|
44
|
-
configurable: true,
|
45
|
-
writable: true,
|
46
|
-
value: void 0
|
47
|
-
});
|
48
|
-
/** new document submit function */
|
49
|
-
Object.defineProperty(this, "onSubmit", {
|
50
|
-
enumerable: true,
|
51
|
-
configurable: true,
|
52
|
-
writable: true,
|
53
|
-
value: async (value) => {
|
54
|
-
var _a;
|
55
|
-
this.loading = true;
|
56
|
-
const data = this.type === "Task (For Self)"
|
57
|
-
? { MemberIds: [this._user.info.id], ...value, Type: "Task", ParentId: this.parentId }
|
58
|
-
: {
|
59
|
-
...value,
|
60
|
-
Type: this.type,
|
61
|
-
ParentId: this.parentId,
|
62
|
-
};
|
63
|
-
await this._store.createFromType({
|
64
|
-
data: data,
|
65
|
-
error: "message",
|
66
|
-
});
|
67
|
-
(_a = this.onCancel) === null || _a === void 0 ? void 0 : _a.call(this);
|
68
|
-
runInAction(() => (this.loading = false));
|
69
|
-
}
|
70
|
-
});
|
71
18
|
makeObservable(this);
|
72
19
|
}
|
73
20
|
}
|
74
21
|
__decorate([
|
75
22
|
observable
|
76
23
|
], State.prototype, "loading", void 0);
|
77
|
-
__decorate([
|
78
|
-
observable
|
79
|
-
], State.prototype, "type", void 0);
|
80
24
|
__decorate([
|
81
25
|
observable
|
82
26
|
], State.prototype, "createData", void 0);
|
83
|
-
__decorate([
|
84
|
-
observable
|
85
|
-
], State.prototype, "onCancel", void 0);
|
86
|
-
__decorate([
|
87
|
-
action
|
88
|
-
], State.prototype, "onSubmit", void 0);
|
89
27
|
//# sourceMappingURL=state.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/NewColumnDocumentForm/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/NewColumnDocumentForm/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,OAAO,KAAK;IACjB;QAIA,cAAc;QACF;;;;mBAAiB,KAAK;WAAC;QACvB;;;;;WAAuB;QALlC,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CAKD;AAFY;IAAX,UAAU;sCAAwB;AACvB;IAAX,UAAU;yCAAwB"}
|