@voplus/morpho-csp 1.2.110 → 1.2.111
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/data/officer/hooks.js +1 -1
- package/es/data/officer/hooks.js.map +1 -1
- package/es/modules/corporate/company/officer/components/OfficerInformation/index.js +31 -45
- package/es/modules/corporate/company/officer/components/OfficerInformation/index.js.map +1 -1
- package/package.json +1 -1
- package/es/modules/corporate/company/officer/components/OfficerInformation/state.d.ts +0 -6
- package/es/modules/corporate/company/officer/components/OfficerInformation/state.js +0 -18
- package/es/modules/corporate/company/officer/components/OfficerInformation/state.js.map +0 -1
package/es/data/officer/hooks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useDocumentListLoaderEffect
|
|
1
|
+
import { useDocumentListLoaderEffect } from "@voplus/morpho-document-core";
|
|
2
2
|
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
3
3
|
import { useOfficerStore } from "./OfficerStore";
|
|
4
4
|
/** React hook to retrieve a officer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/officer/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/officer/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAKpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,OAA4B,EAAE,EAAE;IACtE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAAyB,CAAC;IACzD,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,OAAO,qBAAqB,CAC3B,EAAE,EACF,KAAK,CAAC,KAAK,EACX,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAC9B,OAAO,CACK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CACnC,IAA2C,EAC3C,MAA6B,EAC7B,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;IAElC,mFAAmF;IACnF,OAAO,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3F,CAAC,CAAC"}
|
|
@@ -1,55 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { Badge, Form, Skeleton } from "@voplus/antd";
|
|
2
|
-
import { useOfficer, useOfficerStore } from "../../../../../../data/officer";
|
|
3
|
-
import
|
|
3
|
+
import { useOfficer, useOfficerStore, } from "../../../../../../data/officer";
|
|
4
|
+
import { observe, InlineEdit } from "@voplus/morpho-ui";
|
|
4
5
|
import DateInputEditor from "@voplus/morpho-ui/es/controls/InlineEdit/editors/DateInputEditor";
|
|
5
|
-
import { InlineEdit } from "@voplus/morpho-ui";
|
|
6
6
|
import Scrollbars from "react-custom-scrollbars";
|
|
7
|
-
import { State } from "./state";
|
|
8
7
|
import moment from "moment";
|
|
9
|
-
import { observe } from "@voplus/morpho-ui";
|
|
10
8
|
const OfficerInformation = (props) => {
|
|
11
9
|
const { id, allowEdit } = props;
|
|
12
|
-
const
|
|
13
|
-
state.officer = useOfficer(id);
|
|
10
|
+
const officer = useOfficer(id);
|
|
14
11
|
const officerStore = useOfficerStore();
|
|
15
|
-
return observe(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, editor: DateInputEditor, editable: allowEdit, onSave: (date) => {
|
|
43
|
-
var _a;
|
|
44
|
-
if (moment(date).isSame((_a = state.officer) === null || _a === void 0 ? void 0 : _a.cease, "day"))
|
|
45
|
-
return;
|
|
46
|
-
edit({ Cease: date });
|
|
47
|
-
} })),
|
|
48
|
-
React.createElement(Form.Item, { label: "Email" },
|
|
49
|
-
React.createElement(InlineEdit, { defaultValue: state.officer.email, content: (v) => React.createElement("div", null, state.officer.email ? state.officer.email : "Add Email"), onSave: (value) => officerStore.edit(id, { data: { Email: value }, error: "message" }) })),
|
|
50
|
-
React.createElement(Form.Item, { label: "Phone" },
|
|
51
|
-
React.createElement(InlineEdit, { defaultValue: state.officer.phone, content: (v) => React.createElement("div", null, state.officer.phone ? state.officer.phone : "Add Phone"), onSave: (value) => officerStore.edit(id, { data: { Phone: value }, error: "message" }) }))))));
|
|
52
|
-
});
|
|
12
|
+
return observe(() => (React.createElement(Scrollbars, null, officer.loading ? (React.createElement("div", { style: { padding: "0 20px" } },
|
|
13
|
+
React.createElement(Skeleton, { active: true }))) : (React.createElement(Form, { labelAlign: "left", labelCol: { span: 10 }, className: "company-information" },
|
|
14
|
+
officer.status && (React.createElement(Form.Item, { label: "Status" }, officer.status === "Present" ? (React.createElement(Badge, { status: "success", text: "Present" })) : (React.createElement(Badge, { status: "error", text: "Past" })))),
|
|
15
|
+
React.createElement(Form.Item, { label: "Appointment Date" },
|
|
16
|
+
React.createElement(InlineEdit, { defaultValue: moment(officer === null || officer === void 0 ? void 0 : officer.appointment), content: (v) => (React.createElement("span", null, (officer === null || officer === void 0 ? void 0 : officer.appointment)
|
|
17
|
+
? moment(v.store.value).format("YYYY-MM-DD")
|
|
18
|
+
: allowEdit
|
|
19
|
+
? "Add Appointment Date"
|
|
20
|
+
: "No Appointment Date")), editor: DateInputEditor, editable: allowEdit, onSave: (date) => {
|
|
21
|
+
if (moment(date).isSame(officer === null || officer === void 0 ? void 0 : officer.appointment, "day"))
|
|
22
|
+
return;
|
|
23
|
+
edit({ Appointment: date !== null ? date : "" });
|
|
24
|
+
} })),
|
|
25
|
+
React.createElement(Form.Item, { label: "Cease Date" },
|
|
26
|
+
React.createElement(InlineEdit, { defaultValue: moment(officer === null || officer === void 0 ? void 0 : officer.cease), content: (v) => (React.createElement("span", null, (officer === null || officer === void 0 ? void 0 : officer.cease)
|
|
27
|
+
? moment(officer === null || officer === void 0 ? void 0 : officer.cease).format("YYYY-MM-DD")
|
|
28
|
+
: allowEdit
|
|
29
|
+
? "Add Cease Date"
|
|
30
|
+
: "No Cease Date")), editor: DateInputEditor, editable: allowEdit, onSave: (date) => {
|
|
31
|
+
if (moment(date).isSame(officer === null || officer === void 0 ? void 0 : officer.cease, "day"))
|
|
32
|
+
return;
|
|
33
|
+
edit({ Cease: date !== null ? date : "" });
|
|
34
|
+
} })),
|
|
35
|
+
React.createElement(Form.Item, { label: "Email" },
|
|
36
|
+
React.createElement(InlineEdit, { defaultValue: officer.email, content: (v) => React.createElement("div", null, officer.email ? officer.email : "Add Email"), onSave: (value) => officerStore.edit(id, { data: { Email: value }, error: "message" }) })),
|
|
37
|
+
React.createElement(Form.Item, { label: "Phone" },
|
|
38
|
+
React.createElement(InlineEdit, { defaultValue: officer.phone, content: (v) => React.createElement("div", null, officer.phone ? officer.phone : "Add Phone"), onSave: (value) => officerStore.edit(id, { data: { Phone: value }, error: "message" }) })))))));
|
|
53
39
|
async function edit(data) {
|
|
54
40
|
await officerStore.edit(id, { data, error: "message" });
|
|
55
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer/components/OfficerInformation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer/components/OfficerInformation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAEN,UAAU,EACV,eAAe,GACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,eAAe,MAAM,kEAAkE,CAAC;AAC/F,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,kBAAkB,GAAG,CAAC,KAA0C,EAAE,EAAE;IACzE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;IAC/B,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,UAAU,QACT,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAChC,oBAAC,QAAQ,IAAC,MAAM,SAAG,CACd,CACN,CAAC,CAAC,CAAC,CACH,oBAAC,IAAI,IAAC,UAAU,EAAC,MAAM,EAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,qBAAqB;QAC7E,OAAO,CAAC,MAAM,IAAI,CAClB,oBAAC,IAAI,CAAC,IAAI,IAAC,K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CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAO,EACxE,MAAM,EAAE,CAAC,KAAU,EAAE,EAAE,CACtB,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAEnE,CACS,CACN,CACP,CACW,CACb,CAAC,CAAC;IACH,KAAK,UAAU,IAAI,CAAC,IAA4B;QAC/C,MAAM,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC;AACF,CAAC,CAAC;AACF,kBAAkB,CAAC,YAAY,GAAG;IACjC,SAAS,EAAE,IAAI;CACf,CAAC;AACF,eAAe,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { makeAutoObservable, observable } from "mobx";
|
|
3
|
-
export class State {
|
|
4
|
-
constructor() {
|
|
5
|
-
/** info of the officer */
|
|
6
|
-
Object.defineProperty(this, "officer", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: void 0
|
|
11
|
-
});
|
|
12
|
-
makeAutoObservable(this);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
__decorate([
|
|
16
|
-
observable
|
|
17
|
-
], State.prototype, "officer", void 0);
|
|
18
|
-
//# sourceMappingURL=state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/officer/components/OfficerInformation/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAItD,MAAM,OAAO,KAAK;IAIjB;QAHA,0BAA0B;QACd;;;;;WAAyB;QAGpC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACD;AALY;IAAX,UAAU;sCAA0B"}
|