@voplus/morpho-csp 1.2.53 → 1.2.55
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/corporate/clda/components/CLDASendForm/index.js +8 -4
- package/es/modules/corporate/clda/components/CLDASendForm/index.js.map +1 -1
- package/es/modules/corporate/clda/components/CLDASendForm/state.d.ts +5 -0
- package/es/modules/corporate/clda/components/CLDASendForm/state.js +23 -0
- package/es/modules/corporate/clda/components/CLDASendForm/state.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
2
|
import { Button, Form, Row, Space } from "@voplus/antd";
|
|
3
3
|
import { observe } from "@voplus/morpho-ui";
|
|
4
4
|
import { useIncorporationCLDAStore, useIncorporationCLDA, } from "../../../../../data/incorporation-clda";
|
|
5
|
+
import { runInAction } from "mobx";
|
|
6
|
+
import { State } from "./state";
|
|
5
7
|
import Modal from "@voplus/morpho-ui/es/components/Modal";
|
|
6
8
|
import ProseMirror from "@voplus/morpho-text/es/controls/ProseMirror";
|
|
7
9
|
import styles from "./index.less";
|
|
8
10
|
const CLDASendForm = (props) => {
|
|
9
11
|
const clda = useIncorporationCLDA(props.id, { reload: true, includes: "email-content" });
|
|
10
12
|
const store = useIncorporationCLDAStore();
|
|
11
|
-
const [
|
|
13
|
+
const [state] = useState(new State());
|
|
14
|
+
useEffect(() => runInAction(() => state.update(clda.emailContent)));
|
|
12
15
|
return observe(() => (React.createElement(Modal, { title: "CLDA Send Form Dialog", visible: true, destroyOnClose: true, closable: false, footer: null, onCancel: props.onCancel },
|
|
13
16
|
React.createElement("div", { className: styles["clda-send-form"] },
|
|
14
17
|
React.createElement(Form, { layout: "vertical" },
|
|
15
18
|
React.createElement(Form.Item, { label: "Email Content" },
|
|
16
|
-
React.createElement(ProseMirror, { toolbarProps: { sticky: false }, scroll: true, defaultHtml: clda === null || clda === void 0 ? void 0 : clda.emailContent, className: "proseMirror", onChange: (opt) =>
|
|
19
|
+
React.createElement(ProseMirror, { toolbarProps: { sticky: false }, scroll: true, defaultHtml: clda === null || clda === void 0 ? void 0 : clda.emailContent, className: "proseMirror", onChange: (opt) => (state.text =
|
|
20
|
+
opt.editor.dom.innerHTML === "<p><br></p>" ? "" : opt.editor.dom.innerHTML) })),
|
|
17
21
|
React.createElement(Row, { justify: "end" },
|
|
18
22
|
React.createElement(Space, null,
|
|
19
23
|
React.createElement(Button, { onClick: onCancel }, "Cancel"),
|
|
@@ -24,7 +28,7 @@ const CLDASendForm = (props) => {
|
|
|
24
28
|
}
|
|
25
29
|
/** email send */
|
|
26
30
|
async function onSend() {
|
|
27
|
-
await store.send(props.id, { data: { Email: text }, error: "message" });
|
|
31
|
+
await store.send(props.id, { data: { Email: state.text }, error: "message" });
|
|
28
32
|
if (props.onCancel)
|
|
29
33
|
props.onCancel();
|
|
30
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/corporate/clda/components/CLDASendForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/corporate/clda/components/CLDASendForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACN,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,KAAK,EA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SAAS,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAE5E,CACS;gBACZ,oBAAC,GAAG,IAAC,OAAO,EAAC,KAAK;oBACjB,oBAAC,KAAK;wBACL,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB;wBAC1C,oBAAC,MAAM,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,WAE7B,CACF,CACH,CACA,CACF,CACC,CACR,CAAC,CAAC;IAEH,SAAS,QAAQ;QAChB,IAAI,KAAK,CAAC,QAAQ;YAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED,iBAAiB;IACjB,KAAK,UAAU,MAAM;QACpB,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9E,IAAI,KAAK,CAAC,QAAQ;YAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { action, makeObservable, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
Object.defineProperty(this, "text", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value: void 0
|
|
10
|
+
});
|
|
11
|
+
makeObservable(this);
|
|
12
|
+
}
|
|
13
|
+
update(defaultVal) {
|
|
14
|
+
this.text = defaultVal;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
observable
|
|
19
|
+
], State.prototype, "text", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
action
|
|
22
|
+
], State.prototype, "update", null);
|
|
23
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../src/modules/corporate/clda/components/CLDASendForm/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,OAAO,KAAK;IAGjB;QAFY;;;;;WAAoB;QAG/B,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAEc,MAAM,CAAC,UAAkB;QACvC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACxB,CAAC;CACD;AATY;IAAX,UAAU;mCAAqB;AAMxB;IAAP,MAAM;mCAEN"}
|