@voplus/morpho-document 5.0.20 → 5.0.21

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voplus/morpho-document",
3
- "version": "5.0.20",
3
+ "version": "5.0.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://voplus.visualstudio.com/morpho-document/_git/morpho-document"
@@ -1,33 +0,0 @@
1
- import { ApiEndPoint } from "@voplus/api";
2
- import { Store, StoreActionOptions } from "@voplus/morpho-data";
3
- export interface IVerification {
4
- verifiedBy: {
5
- id: string;
6
- name: string;
7
- };
8
- verifiedOn: Date;
9
- confirmedBy: {
10
- id: string;
11
- name: string;
12
- };
13
- confirmedOn: Date;
14
- }
15
- /** Quotation store supply backend functions. */
16
- export declare class VerificationStore extends Store {
17
- readonly endpoint: ApiEndPoint;
18
- /** Name of the store */
19
- readonly name: string;
20
- constructor(endpoint: ApiEndPoint);
21
- /** Edit verified. */
22
- verify(nodeId: string, options: {
23
- verified: boolean;
24
- } & StoreActionOptions): Promise<any>;
25
- /** Edit an confirmed. */
26
- confirm(nodeId: string, options: {
27
- confirmed: boolean;
28
- } & StoreActionOptions): Promise<any>;
29
- /** load verification */
30
- load(nodeId: string): Promise<IVerification>;
31
- }
32
- /** 响应钩子检索 VerificationStore */
33
- export declare const useVerificationStore: () => VerificationStore;
@@ -1,50 +0,0 @@
1
- import { RequestBuilder } from "@voplus/api";
2
- import { Store, useApplicationContext } from "@voplus/morpho-data";
3
- const StoreName = "VerificationStore";
4
- /** Quotation store supply backend functions. */
5
- export class VerificationStore extends Store {
6
- constructor(endpoint) {
7
- super();
8
- Object.defineProperty(this, "endpoint", {
9
- enumerable: true,
10
- configurable: true,
11
- writable: true,
12
- value: endpoint
13
- });
14
- /** Name of the store */
15
- Object.defineProperty(this, "name", {
16
- enumerable: true,
17
- configurable: true,
18
- writable: true,
19
- value: StoreName
20
- });
21
- }
22
- /** Edit verified. */
23
- async verify(nodeId, options) {
24
- return this.action(async () => {
25
- const r = await this.endpoint.post(`/api/nodes/${nodeId}/manual-verification/verify`, new RequestBuilder().json(options.verified));
26
- return await r.json();
27
- }, options);
28
- }
29
- /** Edit an confirmed. */
30
- async confirm(nodeId, options) {
31
- return this.action(async () => {
32
- const r = await this.endpoint.post(`/api/nodes/${nodeId}/manual-verification/confirm`, new RequestBuilder().json(options.confirmed));
33
- return await r.json();
34
- }, options);
35
- }
36
- /** load verification */
37
- async load(nodeId) {
38
- const r = await this.endpoint.get(`/api/nodes/${nodeId}/manual-verification`);
39
- return await r.json();
40
- }
41
- }
42
- /** 响应钩子检索 VerificationStore */
43
- export const useVerificationStore = () => {
44
- const context = useApplicationContext();
45
- if (!context.getService(StoreName)) {
46
- context.registerService(new VerificationStore(context.api.currentEndPoint));
47
- }
48
- return context.getService(StoreName);
49
- };
50
- //# sourceMappingURL=VerificationStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VerificationStore.js","sourceRoot":"","sources":["../../../src/components/VerificationInformation/VerificationStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAsB,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEvF,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAStC,gDAAgD;AAChD,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAI3C,YAAmC,QAAqB;QACvD,KAAK,EAAE,CAAC;QADU;;;;mBAAgB,QAAQ;WAAa;QAHxD,wBAAwB;QACR;;;;mBAAe,SAAS;WAAC;IAIzC,CAAC;IAED,qBAAqB;IACd,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,OAAmD;QACtF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACjC,cAAc,MAAM,6BAA6B,EACjD,IAAI,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAC3C,CAAC;YAEF,OAAO,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,EAAE,OAAO,CAAC,CAAC;IACb,CAAC;IACD,yBAAyB;IAClB,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAoD;QACxF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACjC,cAAc,MAAM,8BAA8B,EAClD,IAAI,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAC5C,CAAC;YAEF,OAAO,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,EAAE,OAAO,CAAC,CAAC;IACb,CAAC;IACD,wBAAwB;IACjB,KAAK,CAAC,IAAI,CAAC,MAAc;QAC/B,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,MAAM,sBAAsB,CAAC,CAAC;QAC9E,OAAO,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;CACD;AAED,+BAA+B;AAC/B,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACxC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QACnC,OAAO,CAAC,eAAe,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KAC5E;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,CAAuB,CAAC;AAC5D,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- declare const VerificationInformation: (props: {
3
- id: string;
4
- }) => React.JSX.Element;
5
- export default VerificationInformation;
@@ -1,36 +0,0 @@
1
- import { Form, Skeleton, Switch } from "antd";
2
- import React, { useEffect, useState } from "react";
3
- import { State } from "./state";
4
- import moment from "moment";
5
- import { observe } from "@voplus/morpho-ui";
6
- import { runInAction } from "mobx";
7
- import { useVerificationStore } from "./VerificationStore";
8
- const VerificationInformation = (props) => {
9
- const { id } = props;
10
- const verifyStore = useVerificationStore();
11
- const [state] = useState(new State(verifyStore));
12
- useEffect(() => {
13
- runInAction(() => {
14
- state.id = id;
15
- state.load();
16
- });
17
- }, [id]);
18
- return observe(() => {
19
- var _a, _b;
20
- return (React.createElement(Form, { labelAlign: "left", labelCol: { span: 10 } }, state.loading ? (React.createElement(Skeleton, { active: true })) : (React.createElement(React.Fragment, null,
21
- React.createElement(Form.Item, { label: "Verified" },
22
- React.createElement(Switch, { checked: state.verified, onChange: state.onVerified }),
23
- ((_a = state.verification) === null || _a === void 0 ? void 0 : _a.verifiedBy.id) && (React.createElement("div", { className: "operate-record" },
24
- state.verification.verifiedBy.name,
25
- " verified on",
26
- moment(moment.utc(state.verification.verifiedOn).toDate()).format("YYYY-MM-DD HH:mm:ss")))),
27
- React.createElement(Form.Item, { label: "Confirmed" },
28
- React.createElement(Switch, { checked: state.confirmed, onChange: state.onConfirmed }),
29
- ((_b = state.verification) === null || _b === void 0 ? void 0 : _b.confirmedBy.id) && (React.createElement("div", { className: "operate-record" },
30
- state.verification.confirmedBy.name,
31
- " confirmed on",
32
- moment(moment.utc(state.verification.confirmedOn).toDate()).format("YYYY-MM-DD HH:mm:ss"))))))));
33
- });
34
- };
35
- export default VerificationInformation;
36
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/VerificationInformation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ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AS,EAAC,gBAAgB;oBAC7B,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI;;oBAClC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CACjE,qBAAqB,CACrB,CACI,CACN,CACU;YACZ,oBAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,WAAW;gBAC3B,oBAAC,MAAM,IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,GAAI;gBAChE,CAAA,MAAA,KAAK,CAAC,YAAY,0CAAE,WAAW,CAAC,EAAE,KAAI,CACtC,6BAAK,SAAS,EAAC,gBAAgB;oBAC7B,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI;;oBACnC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAClE,qBAAqB,CACrB,CACI,CACN,CACU,CACI,CACjB,CACK,CACP,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -1,19 +0,0 @@
1
- import { IVerification, VerificationStore } from "./VerificationStore";
2
- export declare class State {
3
- private verifyStore;
4
- id: string;
5
- /** data of verification */
6
- verification: IVerification;
7
- /** checked of verified */
8
- verified: boolean;
9
- /** checked of confirmed */
10
- confirmed: boolean;
11
- /** loading of load manual-verification */
12
- loading: boolean;
13
- constructor(verifyStore: VerificationStore);
14
- load(): Promise<void>;
15
- /** Edit verified */
16
- onVerified: (checked: boolean) => Promise<void>;
17
- /** Edit confirmed */
18
- onConfirmed: (checked: boolean) => Promise<void>;
19
- }
@@ -1,116 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { action, makeAutoObservable, observable } from "mobx";
3
- import { message } from "antd";
4
- export class State {
5
- constructor(verifyStore) {
6
- Object.defineProperty(this, "verifyStore", {
7
- enumerable: true,
8
- configurable: true,
9
- writable: true,
10
- value: verifyStore
11
- });
12
- Object.defineProperty(this, "id", {
13
- enumerable: true,
14
- configurable: true,
15
- writable: true,
16
- value: ""
17
- });
18
- /** data of verification */
19
- Object.defineProperty(this, "verification", {
20
- enumerable: true,
21
- configurable: true,
22
- writable: true,
23
- value: void 0
24
- });
25
- /** checked of verified */
26
- Object.defineProperty(this, "verified", {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: false
31
- });
32
- /** checked of confirmed */
33
- Object.defineProperty(this, "confirmed", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: false
38
- });
39
- /** loading of load manual-verification */
40
- Object.defineProperty(this, "loading", {
41
- enumerable: true,
42
- configurable: true,
43
- writable: true,
44
- value: false
45
- });
46
- /** Edit verified */
47
- Object.defineProperty(this, "onVerified", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: async (checked) => {
52
- this.verified = checked;
53
- const res = await this.verifyStore.verify(this.id, {
54
- verified: checked,
55
- error: (error) => {
56
- message.error(error.message);
57
- this.verified = !checked;
58
- },
59
- });
60
- if (!res)
61
- return;
62
- this.verification = res;
63
- this.verified = !!res.verifiedBy.id;
64
- }
65
- });
66
- /** Edit confirmed */
67
- Object.defineProperty(this, "onConfirmed", {
68
- enumerable: true,
69
- configurable: true,
70
- writable: true,
71
- value: async (checked) => {
72
- this.confirmed = checked;
73
- const res = await this.verifyStore.confirm(this.id, {
74
- confirmed: checked,
75
- error: (error) => {
76
- message.error(error.message);
77
- this.confirmed = !checked;
78
- },
79
- });
80
- if (!res)
81
- return;
82
- this.verification = res;
83
- this.confirmed = !!res.confirmedBy.id;
84
- }
85
- });
86
- makeAutoObservable(this);
87
- }
88
- async load() {
89
- this.loading = true;
90
- const res = await this.verifyStore.load(this.id);
91
- this.verification = res;
92
- this.verified = !!res.verifiedBy.id;
93
- this.confirmed = !!res.confirmedBy.id;
94
- this.loading = false;
95
- }
96
- }
97
- __decorate([
98
- observable
99
- ], State.prototype, "id", void 0);
100
- __decorate([
101
- observable
102
- ], State.prototype, "verification", void 0);
103
- __decorate([
104
- observable
105
- ], State.prototype, "verified", void 0);
106
- __decorate([
107
- observable
108
- ], State.prototype, "confirmed", void 0);
109
- __decorate([
110
- observable
111
- ], State.prototype, "loading", void 0);
112
- __decorate([
113
- action
114
- /** Load verification */
115
- ], State.prototype, "load", null);
116
- //# sourceMappingURL=state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/components/VerificationInformation/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,OAAO,KAAK;IAWjB,YAA2B,WAA8B;QAAtC;;;;mBAAQ,WAAW;WAAmB;QAVtC;;;;mBAAK,EAAE;WAAC;QAC3B,2BAA2B;QACR;;;;;WAA4B;QAC/C,0BAA0B;QACP;;;;mBAAW,KAAK;WAAC;QACpC,2BAA2B;QACR;;;;mBAAY,KAAK;WAAC;QACrC,0CAA0C;QACvB;;;;mBAAU,KAAK;WAAC;QAgBnC,oBAAoB;QACb;;;;mBAAa,KAAK,EAAE,OAAgB,EAAE,EAAE;gBAC9C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;gBACxB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE;oBAClD,QAAQ,EAAE,OAAO;oBACjB,KAAK,EAAE,CAAC,KAAY,EAAE,EAAE;wBACvB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;wBAC7B,IAAI,CAAC,QAAQ,GAAG,CAAC,OAAO,CAAC;oBAC1B,CAAC;iBACD,CAAC,CAAC;gBACH,IAAI,CAAC,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