@voplus/morpho-document 1.2.0-dev13 → 1.2.0-dev14
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/pages/EmailTemplate/CodeMirror/index.d.ts +13 -0
- package/es/pages/EmailTemplate/CodeMirror/index.js +37 -0
- package/es/pages/EmailTemplate/CodeMirror/index.js.map +1 -0
- package/es/pages/EmailTemplate/CodeMirror/state.d.ts +5 -0
- package/es/pages/EmailTemplate/CodeMirror/state.js +28 -0
- package/es/pages/EmailTemplate/CodeMirror/state.js.map +1 -0
- package/es/pages/EmailTemplate/EmailTemplateDefaultView/index.d.ts +4 -0
- package/es/pages/EmailTemplate/EmailTemplateDefaultView/index.js +47 -0
- package/es/pages/EmailTemplate/EmailTemplateDefaultView/index.js.map +1 -0
- package/es/pages/EmailTemplate/EmailTemplateDefaultView/index.less +39 -0
- package/es/pages/EmailTemplate/EmailTemplateForm/index.d.ts +4 -0
- package/es/pages/EmailTemplate/EmailTemplateForm/index.js +28 -0
- package/es/pages/EmailTemplate/EmailTemplateForm/index.js.map +1 -0
- package/es/pages/EmailTemplate/EmailTemplateForm/index.less +27 -0
- package/es/pages/EmailTemplate/EmailTemplateItem/index.d.ts +6 -0
- package/es/pages/EmailTemplate/EmailTemplateItem/index.js +34 -0
- package/es/pages/EmailTemplate/EmailTemplateItem/index.js.map +1 -0
- package/es/pages/EmailTemplate/EmailTemplateItem/index.less +17 -0
- package/es/pages/EmailTemplate/EmailTemplateItems/index.d.ts +7 -0
- package/es/pages/EmailTemplate/EmailTemplateItems/index.js +35 -0
- package/es/pages/EmailTemplate/EmailTemplateItems/index.js.map +1 -0
- package/es/pages/EmailTemplate/EmailTemplateItems/index.less +67 -0
- package/es/pages/EmailTemplate/EmailTemplateItems/state.d.ts +6 -0
- package/es/pages/EmailTemplate/EmailTemplateItems/state.js +24 -0
- package/es/pages/EmailTemplate/EmailTemplateItems/state.js.map +1 -0
- package/es/pages/EmailTemplate/EmailTemplatePropertiesView/index.d.ts +6 -0
- package/es/pages/EmailTemplate/EmailTemplatePropertiesView/index.js +28 -0
- package/es/pages/EmailTemplate/EmailTemplatePropertiesView/index.js.map +1 -0
- package/es/pages/EmailTemplate/EmailTemplatePropertiesView/index.less +12 -0
- package/es/pages/EmailTemplate/EmailTemplateSelect/index.d.ts +12 -0
- package/es/pages/EmailTemplate/EmailTemplateSelect/index.js +29 -0
- package/es/pages/EmailTemplate/EmailTemplateSelect/index.js.map +1 -0
- package/es/pages/EmailTemplate/data/EmailTemplateStore.d.ts +13 -0
- package/es/pages/EmailTemplate/data/EmailTemplateStore.js +29 -0
- package/es/pages/EmailTemplate/data/EmailTemplateStore.js.map +1 -0
- package/es/pages/EmailTemplate/data/hook.d.ts +10 -0
- package/es/pages/EmailTemplate/data/hook.js +19 -0
- package/es/pages/EmailTemplate/data/hook.js.map +1 -0
- package/es/pages/EmailTemplate/data/index.d.ts +4 -0
- package/es/pages/EmailTemplate/data/index.js +5 -0
- package/es/pages/EmailTemplate/data/index.js.map +1 -0
- package/es/pages/EmailTemplate/data/interfaces.d.ts +12 -0
- package/es/pages/EmailTemplate/data/interfaces.js +2 -0
- package/es/pages/EmailTemplate/data/interfaces.js.map +1 -0
- package/es/pages/EmailTemplate/data/types.d.ts +7 -0
- package/es/pages/EmailTemplate/data/types.js +2 -0
- package/es/pages/EmailTemplate/data/types.js.map +1 -0
- package/es/pages/Page/PageItem/state.d.ts +1 -1
- package/es/pages/Page/PageItem/state.js +9 -4
- package/es/pages/Page/PageItem/state.js.map +1 -1
- package/es/pages/Page/PageItems/index.less +3 -4
- package/es/pages/Signature/Envelope/components/PropertiesView/index.js +4 -5
- package/es/pages/Signature/Envelope/components/PropertiesView/index.js.map +1 -1
- package/es/pages/Signature/Letter/LetterList/index.js +0 -3
- package/es/pages/Signature/Letter/LetterList/index.js.map +1 -1
- package/es/pages/Signature/SignatureTable/EditSignatureDialog.js +0 -1
- package/es/pages/Signature/SignatureTable/EditSignatureDialog.js.map +1 -1
- package/es/pages/Signature/SignatureTable/index.js +20 -34
- package/es/pages/Signature/SignatureTable/index.js.map +1 -1
- package/es/pages/Signature/SignatureTable/index.less +5 -2
- package/es/pages/Signature/SignerSelect/index.js +8 -6
- package/es/pages/Signature/SignerSelect/index.js.map +1 -1
- package/es/pages/Signature/SignerSelect/state.d.ts +3 -2
- package/es/pages/Signature/SignerSelect/state.js +7 -5
- package/es/pages/Signature/SignerSelect/state.js.map +1 -1
- package/es/pages/Signature/data/EnvelopeContext.d.ts +2 -0
- package/es/pages/Signature/data/EnvelopeContext.js +10 -0
- package/es/pages/Signature/data/EnvelopeContext.js.map +1 -1
- package/es/routes.d.ts +15 -0
- package/es/routes.js +27 -1
- package/es/routes.js.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "codemirror/addon/display/autorefresh";
|
|
3
|
+
import "codemirror/addon/comment/comment";
|
|
4
|
+
import "codemirror/addon/edit/matchbrackets";
|
|
5
|
+
import "codemirror/keymap/sublime";
|
|
6
|
+
import "codemirror/theme/eclipse.css";
|
|
7
|
+
declare const CodeMirror: (props: {
|
|
8
|
+
code: string;
|
|
9
|
+
height?: string | undefined;
|
|
10
|
+
readOnly?: boolean | undefined;
|
|
11
|
+
onChange?: ((code: string) => void) | undefined;
|
|
12
|
+
}) => JSX.Element;
|
|
13
|
+
export default CodeMirror;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "codemirror/addon/display/autorefresh";
|
|
2
|
+
import "codemirror/addon/comment/comment";
|
|
3
|
+
import "codemirror/addon/edit/matchbrackets";
|
|
4
|
+
import "codemirror/keymap/sublime";
|
|
5
|
+
import "codemirror/theme/eclipse.css";
|
|
6
|
+
import React, { useEffect, useState } from "react";
|
|
7
|
+
import Mirror from "@uiw/react-codemirror";
|
|
8
|
+
import { State } from "./state";
|
|
9
|
+
import { observe } from "@voplus/morpho-ui";
|
|
10
|
+
const CodeMirror = (props) => {
|
|
11
|
+
const { code, height, readOnly, onChange } = props;
|
|
12
|
+
const [state] = useState(new State());
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
state.update(props.code);
|
|
15
|
+
}, [props.code]);
|
|
16
|
+
return observe(() => (React.createElement(Mirror, { value: code, height: height, options: {
|
|
17
|
+
// theme,
|
|
18
|
+
keyMap: "sublime",
|
|
19
|
+
mode: "jsx",
|
|
20
|
+
// autofocus: true,
|
|
21
|
+
// lineNumbers: 2,
|
|
22
|
+
// lineWrapping: true,
|
|
23
|
+
extraKeys: { Ctrl: "autocomplete" },
|
|
24
|
+
readOnly: !!readOnly,
|
|
25
|
+
scrollbarStyle: "null",
|
|
26
|
+
spellcheck: true,
|
|
27
|
+
autocorrect: true,
|
|
28
|
+
}, onChanges: (instance, change) => {
|
|
29
|
+
state.update(instance.getValue());
|
|
30
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(instance.getValue());
|
|
31
|
+
} })));
|
|
32
|
+
};
|
|
33
|
+
// CodeMirror.defaultProps = {
|
|
34
|
+
// height: "auto",
|
|
35
|
+
// };
|
|
36
|
+
export default CodeMirror;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/CodeMirror/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,UAAU,GAAG,CAAC,KAKnB,EAAE,EAAE;IACJ,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEnD,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAEtC,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,MAAM,IACN,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;YACR,SAAS;YACT,MAAM,EAAE,SAAS;YACjB,IAAI,EAAE,KAAK;YACX,mBAAmB;YACnB,kBAAkB;YAClB,sBAAsB;YACtB,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;YACnC,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,cAAc,EAAE,MAAM;YACtB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;SACjB,EACD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YAC/B,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;YAClC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjC,CAAC,GACA,CACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,8BAA8B;AAC9B,mBAAmB;AACnB,KAAK;AAEL,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { action, makeObservable, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
Object.defineProperty(this, "code", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value: ""
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(this, "update", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: (code) => {
|
|
16
|
+
this.code = code;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
makeObservable(this);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
observable
|
|
24
|
+
], State.prototype, "code", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
action
|
|
27
|
+
], State.prototype, "update", void 0);
|
|
28
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/CodeMirror/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,OAAO,KAAK;IAGjB;QAFY;;;;mBAAc,EAAE;WAAC;QAO7B;;;;mBAAgB,CAAC,IAAY,EAAE,EAAE;gBAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YAClB,CAAC;WAAC;QAND,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CAMD;AAVY;IAAX,UAAU;mCAAkB;AAO7B;IADC,MAAM;qCAGL"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { Archive, Reload, Sidebar } from "../../../controls/ToolBar/buttons";
|
|
3
|
+
import { AsideContent, useAutorunEffect } from "@voplus/morpho-ui";
|
|
4
|
+
import React, { useEffect, useState } from "react";
|
|
5
|
+
import DocumentHeader from "../../../components/DocumentHeader";
|
|
6
|
+
import DocumentTabs from "../../../components/DocumentTabs";
|
|
7
|
+
import EmailTemplateItem from "../EmailTemplateItem";
|
|
8
|
+
import ToolBar from "../../../controls/ToolBar/ToolBar2";
|
|
9
|
+
import { useEmailTemplate } from "../data";
|
|
10
|
+
import { useRouteMatch } from "react-router";
|
|
11
|
+
import { useTabItem } from "@voplus/morpho-data";
|
|
12
|
+
const EmailTemplateDefaultView = () => {
|
|
13
|
+
const match = useRouteMatch();
|
|
14
|
+
const id = match.params.id;
|
|
15
|
+
const [loaded, setLoaded] = useState(true);
|
|
16
|
+
const emailTemplate = useEmailTemplate(id, { includes: "tags" });
|
|
17
|
+
const [asideContext] = useState(AsideContent.createContext());
|
|
18
|
+
const tab = useTabItem();
|
|
19
|
+
useAutorunEffect(() => {
|
|
20
|
+
tab.title = emailTemplate === null || emailTemplate === void 0 ? void 0 : emailTemplate.name;
|
|
21
|
+
});
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
asideContext.openAside(AsideElement, { span: 12 });
|
|
24
|
+
}, []);
|
|
25
|
+
const AsideElement = (React.createElement("div", { className: "email-template-default-view_aside" },
|
|
26
|
+
React.createElement(DocumentTabs, { id: id, docTab: false })));
|
|
27
|
+
return (React.createElement(AsideContent, { context: asideContext },
|
|
28
|
+
React.createElement("div", { className: "email-template-default-view" }, loaded && (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement("header", null,
|
|
30
|
+
React.createElement(DocumentHeader, { id: id, size: "h3", clickNameEffect: "edit",
|
|
31
|
+
// quickDataBarAlign={quickDataBarAlign}
|
|
32
|
+
autoSaveName: true, tools: React.createElement(ToolBar, { id: id },
|
|
33
|
+
React.createElement(Reload, { action: reload }),
|
|
34
|
+
React.createElement(Sidebar, { action: () => asideContext.asideContent
|
|
35
|
+
? asideContext.closeAside()
|
|
36
|
+
: asideContext.openAside(AsideElement, { span: 12 }) }),
|
|
37
|
+
React.createElement(Archive, null)), descriptionVisible: false })),
|
|
38
|
+
React.createElement(EmailTemplateItem, { id: id }))))));
|
|
39
|
+
function reload() {
|
|
40
|
+
setLoaded(false);
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
setLoaded(true);
|
|
43
|
+
}, 100);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export default EmailTemplateDefaultView;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/EmailTemplateDefaultView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAChE,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,wBAAwB,GAAG,GAAG,EAAE;IACrC,MAAM,KAAK,GAAG,aAAa,EAAkB,CAAC;IAC9C,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;IAE3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE3C,MAAM,aAAa,GAAG,gBAAgB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAEjE,MAAM,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;IAE9D,MAAM,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U,CAAC,GAAG,EAAE;YACf,SAAS,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,EAAE,GAAG,CAAC,CAAC;IACT,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@import "~@voplus/antd/es/style/themes/index.less";
|
|
2
|
+
|
|
3
|
+
:global {
|
|
4
|
+
.email-template-default-view {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
height: 100%;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
background: #f5f5f5;
|
|
11
|
+
> header {
|
|
12
|
+
z-index: 1;
|
|
13
|
+
box-shadow: 2px 2px 5px #e8e8e8;
|
|
14
|
+
background-color: @component-background;
|
|
15
|
+
}
|
|
16
|
+
.document-header-default {
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.email-template-default-view_aside {
|
|
21
|
+
height: 100%;
|
|
22
|
+
.ant-tabs {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
height: 100%;
|
|
26
|
+
.ant-tabs-content {
|
|
27
|
+
height: 100%;
|
|
28
|
+
padding-bottom: 0px !important;
|
|
29
|
+
.ant-tabs-tabpane {
|
|
30
|
+
position: relative;
|
|
31
|
+
height: 100%;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.ant-tabs-bar {
|
|
35
|
+
margin: 0 20px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { Button, Checkbox, Form, Input } from "@voplus/antd";
|
|
3
|
+
import CodeMirror from "../CodeMirror";
|
|
4
|
+
import EmailTemplateSelect from "../EmailTemplateSelect";
|
|
5
|
+
import FormItem from "@voplus/antd/es/form/FormItem";
|
|
6
|
+
import React from "react";
|
|
7
|
+
const EmailTemplateForm = () => {
|
|
8
|
+
return (React.createElement(Form, { layout: "vertical", initialValues: { name: "", isLayout: false, subject: "", html: "", text: "" }, onFinish: submit, className: "email-template-form" },
|
|
9
|
+
React.createElement(FormItem, { name: "isLayout", valuePropName: "checked" },
|
|
10
|
+
React.createElement(Checkbox, null, "IsLayout")),
|
|
11
|
+
React.createElement(FormItem, { label: "Layout" },
|
|
12
|
+
React.createElement(EmailTemplateSelect, { value: "bff2287a-3e63-48bd-abf6-abbb00a770d6" })),
|
|
13
|
+
React.createElement(FormItem, { label: "Name", name: "name", required: true },
|
|
14
|
+
React.createElement(Input, null)),
|
|
15
|
+
React.createElement(FormItem, { label: "Description", name: "text" }),
|
|
16
|
+
React.createElement(FormItem, { label: "Subject", name: "subject" },
|
|
17
|
+
React.createElement(Input, null)),
|
|
18
|
+
React.createElement(FormItem, { label: "HtmlText", name: "html" },
|
|
19
|
+
React.createElement(CodeMirror, { code: "" })),
|
|
20
|
+
React.createElement(FormItem, { className: "submit-btn" },
|
|
21
|
+
React.createElement(Button, { type: "primary", htmlType: "submit" }, "Save"))));
|
|
22
|
+
function submit(values) {
|
|
23
|
+
const text = values.text.editor.dom.innerHTML === "<p><br></p>" ? "" : values.text.editor.dom.innerHTML;
|
|
24
|
+
console.log("onFinish", values, text);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export default EmailTemplateForm;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/EmailTemplateForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO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AAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;QAC5F,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import "~@voplus/antd/es/style/themes/default.less";
|
|
2
|
+
:global {
|
|
3
|
+
.email-template-form {
|
|
4
|
+
.ant-select {
|
|
5
|
+
width: auto;
|
|
6
|
+
}
|
|
7
|
+
.proseMirror {
|
|
8
|
+
height: 10rem !important;
|
|
9
|
+
.editor-toolbar {
|
|
10
|
+
padding: 0.2rem 0.65rem;
|
|
11
|
+
}
|
|
12
|
+
.ProseMirror {
|
|
13
|
+
padding: 1rem 1.25rem;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
.ant-form-item {
|
|
17
|
+
margin-bottom: 10px;
|
|
18
|
+
&.submit-btn {
|
|
19
|
+
margin: 10px 0 0;
|
|
20
|
+
text-align: right;
|
|
21
|
+
}
|
|
22
|
+
.ant-form-item-control-input-content .CodeMirror-lines {
|
|
23
|
+
min-height: 10rem;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { Button, Checkbox, Input, Row, Skeleton } from "@voplus/antd";
|
|
3
|
+
import CodeMirror from "../CodeMirror";
|
|
4
|
+
import DescriptionEditor from "../../../controls/DescriptionEditor";
|
|
5
|
+
import EmailTemplateSelect from "../EmailTemplateSelect";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { Scrollbars } from "react-custom-scrollbars";
|
|
8
|
+
import { observe } from "@voplus/morpho-ui";
|
|
9
|
+
import { useEmailTemplate } from "../data";
|
|
10
|
+
const EmailTemplateItem = (props) => {
|
|
11
|
+
const { id } = props;
|
|
12
|
+
const emailTemplate = useEmailTemplate(id);
|
|
13
|
+
return observe(() => (React.createElement("div", { className: "email-template-item_view" },
|
|
14
|
+
React.createElement(Scrollbars, null,
|
|
15
|
+
React.createElement("div", { className: "email-template-item_content" },
|
|
16
|
+
React.createElement(Checkbox, null, "IsLayout"),
|
|
17
|
+
React.createElement("h3", null, "Layout"),
|
|
18
|
+
React.createElement(EmailTemplateSelect, { bordered: false, value: "bff2287a-3e63-48bd-abf6-abbb00a770d6" }),
|
|
19
|
+
React.createElement("h3", null, "Description"),
|
|
20
|
+
emailTemplate.loading ? (React.createElement("div", { className: "task-description" },
|
|
21
|
+
React.createElement(Skeleton, { active: true }))) : (React.createElement(DescriptionEditor, { id: id, description: emailTemplate.description, readonly: emailTemplate.readonly, padding: "0" })),
|
|
22
|
+
React.createElement("h3", null, "Subject"),
|
|
23
|
+
React.createElement(Input, { value: "VO+ Lunar New Year Office Closing/Mail Collection Announcement", bordered: false }),
|
|
24
|
+
React.createElement(Row, { justify: "space-between" },
|
|
25
|
+
React.createElement("h3", null, "HtmlText"),
|
|
26
|
+
React.createElement(Button, { type: "link" }, "Save")),
|
|
27
|
+
React.createElement(CodeMirror, { code: `<p>By setting an editor's <code>height</code> style
|
|
28
|
+
to <code>auto</code> and giving
|
|
29
|
+
the <a href="../doc/manual.html#option_viewportMargin"><code>viewportMargin</code></a>
|
|
30
|
+
a value of <code>Infinity</code>, CodeMirror can be made to
|
|
31
|
+
automatically resize to fit its content.</p>` }))))));
|
|
32
|
+
};
|
|
33
|
+
export default EmailTemplateItem;
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/EmailTemplateItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,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B,oBAAC,MAAM,IAAC,IAAI,EAAC,MAAM,WAAc,CAC5B;gBAEN,oBAAC,UAAU,IACV,IAAI,EAAE;;;;qDAIyC,GAC9C,CACG,CACM,CACR,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import "~@voplus/antd/es/style/themes/index.less";
|
|
2
|
+
:global {
|
|
3
|
+
.email-template-item_view {
|
|
4
|
+
height: 100%;
|
|
5
|
+
margin: 1rem;
|
|
6
|
+
background-color: @component-background;
|
|
7
|
+
.email-template-item_content {
|
|
8
|
+
padding: 15px 20px;
|
|
9
|
+
h3 {
|
|
10
|
+
padding-top: 15px;
|
|
11
|
+
}
|
|
12
|
+
.description-editor-proseMirror {
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { ListView, observe } from "@voplus/morpho-ui";
|
|
3
|
+
import { useEmailTemplateListEffect } from "../data";
|
|
4
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { useAutoUpdateListData } from "@voplus/morpho-document-core";
|
|
7
|
+
import DocumentHeader from "../../../components/DocumentHeader";
|
|
8
|
+
import EmailTemplateForm from "../EmailTemplateForm";
|
|
9
|
+
import EmailTemplatePropertiesView from "../EmailTemplatePropertiesView";
|
|
10
|
+
import NewDocumentForm from "../../../components/NewDocumentForm";
|
|
11
|
+
import { State } from "./state";
|
|
12
|
+
import classnames from "classnames";
|
|
13
|
+
const EmailTemplateItems = (props) => {
|
|
14
|
+
const { id, readonly } = props;
|
|
15
|
+
const [state] = useState(new State());
|
|
16
|
+
const list = useCreateListDataState({
|
|
17
|
+
filterDefaults: {
|
|
18
|
+
includes: "tags",
|
|
19
|
+
filters: [
|
|
20
|
+
{ c: "ParentNodeId", o: "=", l: "And", v1: "923577de-eb81-4cb8-9936-ac77002bd3d1" },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
}, [id]);
|
|
24
|
+
// useRenderOnChange(() => data.filters.options);
|
|
25
|
+
useEmailTemplateListEffect(list, (result) => list.union(result), list.filters.options);
|
|
26
|
+
/** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
|
|
27
|
+
useAutoUpdateListData(list, (d) => d.type === "" && d.parentId === id);
|
|
28
|
+
return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
29
|
+
React.createElement(ListView, { headerProps: { quickSearch: true }, className: "email-template-items-view", propertiesView: (id) => React.createElement(EmailTemplatePropertiesView, { id: id }), formViewTitle: "Add EmailTemplate", formView: React.createElement(EmailTemplateForm, null), renderItem: ({ item, index }) => (React.createElement(DocumentHeader, { id: item.id, className: "email-template-item",
|
|
30
|
+
// size="h3"
|
|
31
|
+
itemHover: true, skeletonVisible: false, flagVisible: false, preVisible: false, toolsVisible: false, quickDataBar: React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.subject) || "VO+ Lunar New Year Office Closing/Mail Collection Announcement") })) }),
|
|
32
|
+
React.createElement(NewDocumentForm, { parentId: id, type: "EmailTemplate", className: classnames("email-template-items_form", { show: state.addAble }), onCancel: () => state.updateAddAble(false) }))));
|
|
33
|
+
};
|
|
34
|
+
export default EmailTemplateItems;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/EmailTemplateItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAQ,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAoC,0BAA0B,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,sB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,QAAQ,IAAC,KAAK,EAAE,IAAI;QACpC,oBAAC,QAAQ,IACR,WAAW,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAClC,SAAS,EAAC,2BAA2B,EACrC,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,oBAAC,2BAA2B,IAAC,EAAE,EAAE,EAAE,GAAI,EAC/D,aAAa,EAAC,mBAAmB,EACjC,QAAQ,EAAE,oBAAC,iBAAiB,OAAG,EAC/B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAA2C,EAAE,EAAE,CAAC,CACzE,oBAAC,cAAc,IACd,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,SAAS,EAAC,qBAAqB;gBAC/B,YAAY;gBACZ,SAAS,QACT,eAAe,EAAE,KAAK,EACtB,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,KAAK,EACnB,YAAY,EACX,0CACE,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,KAAI,gEAAgE,CAChF,GAEH,CACF,GACA;QACF,oBAAC,eAAe,IACf,QAAQ,EAAE,EAAE,EACZ,IAAI,EAAE,eAAsB,EAC5B,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAC3E,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,GACzC,CAKwB,CAC3B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@import "~@voplus/antd/es/style/themes/index.less";
|
|
2
|
+
:global {
|
|
3
|
+
.email-template-items-view {
|
|
4
|
+
.email-template-item {
|
|
5
|
+
position: relative;
|
|
6
|
+
::after {
|
|
7
|
+
position: absolute;
|
|
8
|
+
content: "";
|
|
9
|
+
left: 20px;
|
|
10
|
+
right: 20px;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
border-bottom: 1px solid #f2f2f2;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
.email-template-items_form.sub-document-simply-form {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 0;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
background-color: #fff;
|
|
23
|
+
border-top: 0 @border-style-base @border-color-split;
|
|
24
|
+
transition: height 0.3s, opacity 0.2s ease-out, border-color 0.1s;
|
|
25
|
+
.ant-form {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
&.show {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: auto;
|
|
32
|
+
padding: 10px 20px;
|
|
33
|
+
border-top-width: @border-width-base;
|
|
34
|
+
.ant-form {
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
.ant-input {
|
|
38
|
+
padding: 4px 0;
|
|
39
|
+
border: none;
|
|
40
|
+
box-shadow: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.ant-form-item {
|
|
44
|
+
margin-bottom: 0;
|
|
45
|
+
}
|
|
46
|
+
.detailed {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// .plus-icon.email-template-items_add {
|
|
51
|
+
// position: absolute;
|
|
52
|
+
// bottom: 20px;
|
|
53
|
+
// right: 20px;
|
|
54
|
+
// width: 26px;
|
|
55
|
+
// height: 26px;
|
|
56
|
+
// line-height: 26px;
|
|
57
|
+
// font-size: 18px;
|
|
58
|
+
// border-radius: 2px;
|
|
59
|
+
// box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
60
|
+
// 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
61
|
+
// transition: width 0.3s, opacity 0.2s ease-out, color 0.3s;
|
|
62
|
+
// &.hide {
|
|
63
|
+
// width: 0;
|
|
64
|
+
// opacity: 0;
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
67
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { action, makeObservable, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** Enable of new document */
|
|
6
|
+
Object.defineProperty(this, "addAble", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: false
|
|
11
|
+
});
|
|
12
|
+
makeObservable(this);
|
|
13
|
+
}
|
|
14
|
+
updateAddAble(addAble) {
|
|
15
|
+
this.addAble = addAble;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
observable
|
|
20
|
+
], State.prototype, "addAble", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
action
|
|
23
|
+
], State.prototype, "updateAddAble", null);
|
|
24
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/EmailTemplateItems/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAK1D,MAAM,OAAO,KAAK;IAIjB;QAHA,8BAA8B;QAClB;;;;mBAAiB,KAAK;WAAC;QAGlC,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAGM,aAAa,CAAC,OAAgB;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD;AAVY;IAAX,UAAU;sCAAwB;AAOnC;IADC,MAAM;0CAGN"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { Archive, Reload } from "../../../controls/ToolBar/buttons";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import DocumentHeader from "../../../components/DocumentHeader";
|
|
5
|
+
import DocumentTabs from "../../../components/DocumentTabs";
|
|
6
|
+
import EmailTemplateItem from "../EmailTemplateItem";
|
|
7
|
+
import ToolBar from "../../../controls/ToolBar/ToolBar2";
|
|
8
|
+
import { observe } from "@voplus/morpho-ui";
|
|
9
|
+
import { useEmailTemplate } from "../data";
|
|
10
|
+
const EmailTemplatePropertiesView = (props) => {
|
|
11
|
+
const { id } = props;
|
|
12
|
+
const [loaded, setLoaded] = useState(true);
|
|
13
|
+
const emailTemplate = useEmailTemplate(id, { reload: true });
|
|
14
|
+
return observe(() => (React.createElement("div", { className: "module-detail-view email-template-properties-view" }, loaded && (React.createElement(React.Fragment, null,
|
|
15
|
+
React.createElement(DocumentHeader, { id: id, size: "h3", quickDataBarAlign: "left", clickNameEffect: "edit", autoSaveName: true, tools: React.createElement(ToolBar, { id: id },
|
|
16
|
+
React.createElement(Reload, { action: reload }),
|
|
17
|
+
React.createElement(Archive, null)) }),
|
|
18
|
+
React.createElement(DocumentTabs, { id: id, details: React.createElement(EmailTemplateItem, { id: id }) }),
|
|
19
|
+
" ")))));
|
|
20
|
+
function reload() {
|
|
21
|
+
setLoaded(false);
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
setLoaded(true);
|
|
24
|
+
}, 100);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export default EmailTemplatePropertiesView;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/EmailTemplatePropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAW,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEx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AACF,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import "~@voplus/antd/es/style/themes/index.less";
|
|
2
|
+
:global {
|
|
3
|
+
.email-template-properties-view {
|
|
4
|
+
background: #f5f5f5;
|
|
5
|
+
.ant-tabs-nav {
|
|
6
|
+
background-color: @component-background;
|
|
7
|
+
}
|
|
8
|
+
.ant-tabs-content {
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const EmailTemplateSelect: {
|
|
3
|
+
(props: {
|
|
4
|
+
value: string;
|
|
5
|
+
bordered?: boolean | undefined;
|
|
6
|
+
onChange?: ((id: string) => void) | undefined;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
defaultProps: {
|
|
9
|
+
bordered: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default EmailTemplateSelect;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEmailTemplateListEffect } from "../data";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { Select } from "@voplus/antd";
|
|
4
|
+
import { observe } from "@voplus/morpho-ui";
|
|
5
|
+
import { useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
6
|
+
const EmailTemplateSelect = (props) => {
|
|
7
|
+
const { value, bordered, onChange } = props;
|
|
8
|
+
const [templateId, setTemplateId] = useState("");
|
|
9
|
+
const list = useCreateListDataState({
|
|
10
|
+
// filterDefaults: {
|
|
11
|
+
// page: { Page: 1, PageSize: 50 },
|
|
12
|
+
// },
|
|
13
|
+
}, []);
|
|
14
|
+
useEmailTemplateListEffect(list, (result) => {
|
|
15
|
+
list.union(result);
|
|
16
|
+
}, list.filters.options);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
setTemplateId(value);
|
|
19
|
+
}, [value]);
|
|
20
|
+
return observe(() => (React.createElement(Select, { value: templateId, bordered: bordered, style: { width: "100%" }, onChange: (id) => {
|
|
21
|
+
setTemplateId(id);
|
|
22
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(id);
|
|
23
|
+
} }, list.data.map((t) => (React.createElement(Select.Option, { key: t.id, value: t.id }, t.name))))));
|
|
24
|
+
};
|
|
25
|
+
EmailTemplateSelect.defaultProps = {
|
|
26
|
+
bordered: true,
|
|
27
|
+
};
|
|
28
|
+
export default EmailTemplateSelect;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/EmailTemplate/EmailTemplateSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,0BAA0B,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,mBAAmB,GAAG,CAAC,KAI5B,EAAE,EAAE;IACJ,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE5C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEjD,MAAM,IAAI,GAAG,sBAAsB,CAClC;IACC,oBAAoB;IACpB,oCAAoC;IACpC,KAAK;KACL,EACD,EAAE,CACF,CAAC;IAEF,0BAA0B,CACzB,IAAI,EACJ,CAAC,MAAM,EAAE,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC,EACD,IAAI,CAAC,OAAO,CAAC,OAAO,CACpB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,aAAa,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,MAAM,IACN,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE;YAChB,aAAa,CAAC,EAAE,CAAC,CAAC;YAClB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,EAAE,CAAC,CAAC;QAChB,CAAC,IAEA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACrB,oBAAC,MAAM,CAAC,MAAM,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,IACnC,CAAC,CAAC,IAAI,CACQ,CAChB,CAAC,CACM,CACT,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG;IAClC,QAAQ,EAAE,IAAI;CACd,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CountedMap } from "@voplus/morpho-data";
|
|
2
|
+
import { CreateDocumentOptions, DocumentStore, DocumentTypeStore, EditDocumentOptions, LoadDocumentListOptions, LoadDocumentOptions } from "@voplus/morpho-document-core";
|
|
3
|
+
import { ApiEndPoint } from "@voplus/api";
|
|
4
|
+
import { IEmailTemplate } from "./interfaces";
|
|
5
|
+
export declare class EmailTemplateStore extends DocumentTypeStore<IEmailTemplate, LoadDocumentOptions, LoadDocumentListOptions, CreateDocumentOptions, EditDocumentOptions, any> {
|
|
6
|
+
/** Name of the store */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
constructor(endpoint: ApiEndPoint, documents: DocumentStore);
|
|
9
|
+
/** All currently used activity. */
|
|
10
|
+
readonly items: CountedMap<string, IEmailTemplate>;
|
|
11
|
+
}
|
|
12
|
+
/** 响应钩子检索 EmailTemplateStore */
|
|
13
|
+
export declare const useEmailTemplateStore: () => EmailTemplateStore;
|