@voplus/morpho-csp 2.0.4 → 2.0.6
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/share-certificate/interfaces.d.ts +4 -0
- package/es/data/share-transaction/ShareTransactionStore.d.ts +10 -0
- package/es/data/share-transaction/ShareTransactionStore.js +16 -0
- package/es/data/share-transaction/ShareTransactionStore.js.map +1 -1
- package/es/data/share-transaction/interfaces/IShareTransaction.d.ts +4 -0
- package/es/data/share-transaction/interfaces/IShareTransactionLine.d.ts +5 -1
- package/es/modules/corporate/clda/components/CLDASendForm/index.less +48 -47
- package/es/modules/corporate/clda/controls/ModeIcon/index.d.ts +1 -1
- package/es/modules/corporate/company/components/CompanyProperties/Properties.js +5 -5
- package/es/modules/corporate/company/components/CompanyProperties/Properties.js.map +1 -1
- package/es/modules/corporate/company/controller-register/components/ControllerInformation/index.js +10 -10
- package/es/modules/corporate/company/controller-register/components/ControllerInformation/index.js.map +1 -1
- package/es/modules/corporate/company/controller-register/components/SelectControllerForm/index.less +5 -1
- package/es/modules/corporate/company/identity/components/ContactIdentitySelectDialog/index.less +7 -3
- package/es/modules/corporate/company/member-register/components/CompanyMemberItem/index.js +1 -1
- package/es/modules/corporate/company/member-register/components/CompanyMemberItem/index.js.map +1 -1
- package/es/modules/corporate/company/officer-register/components/OfficerInformation/index.js +7 -7
- package/es/modules/corporate/company/officer-register/components/OfficerInformation/index.js.map +1 -1
- package/es/modules/corporate/company/officer-register/components/OfficerItem/index.js +1 -1
- package/es/modules/corporate/company/officer-register/components/OfficerItem/index.js.map +1 -1
- package/es/modules/corporate/company/pages/CompanyPage/Dashboard.js +32 -26
- package/es/modules/corporate/company/pages/CompanyPage/Dashboard.js.map +1 -1
- package/es/modules/corporate/company/pages/CompanyPage/index.less +10 -20
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step1.d.ts +15 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step1.js +92 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step1.js.map +1 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step2.d.ts +27 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step2.js +51 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step2.js.map +1 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/index.d.ts +9 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/index.js +19 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/index.js.map +1 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/index.less +88 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/state.d.ts +9 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/state.js +27 -0
- package/es/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/state.js.map +1 -0
- package/es/modules/corporate/company/share-transactions-register/components/ShareTransactionItems/TableDragCell.js +54 -19
- package/es/modules/corporate/company/share-transactions-register/components/ShareTransactionItems/TableDragCell.js.map +1 -1
- package/es/modules/corporate/company/share-transactions-register/components/ShareTransactionProperties/index.d.ts +1 -1
- package/es/modules/corporate/company/share-transactions-register/components/ShareTransactionProperties/index.js +13 -4
- package/es/modules/corporate/company/share-transactions-register/components/ShareTransactionProperties/index.js.map +1 -1
- package/es/modules/corporate/company/share-transactions-register/pages/ShareTransactionDefaultView/index.js +6 -2
- package/es/modules/corporate/company/share-transactions-register/pages/ShareTransactionDefaultView/index.js.map +1 -1
- package/es/modules/corporate/company/share-transactions-register/pages/ShareTransactionDefaultView/index.less +15 -5
- package/es/modules/corporate/filing-record/components/FilingRecordQuickView/index.js +4 -4
- package/es/modules/corporate/filing-record/components/FilingRecordQuickView/index.js.map +1 -1
- package/es/modules/corporate/filing-record/filing-type/components/FilingTypeProperties/index.js +4 -4
- package/es/modules/corporate/filing-record/filing-type/components/FilingTypeProperties/index.js.map +1 -1
- package/es/modules/corporate/filing-record/filing-year/FilingYearTabs/index.js +1 -1
- package/es/modules/corporate/filing-record/filing-year/FilingYearTabs/index.js.map +1 -1
- package/es/modules/corporate/share-certificate/components/ShareCertificateItem/index.d.ts +9 -3
- package/es/modules/corporate/share-certificate/components/ShareCertificateItem/index.js +17 -8
- package/es/modules/corporate/share-certificate/components/ShareCertificateItem/index.js.map +1 -1
- package/es/modules/corporate/share-certificate/components/ShareCertificateItem/index.less +17 -30
- package/es/modules/corporate/share-certificate/components/ShareCertificateProperties/index.d.ts +1 -1
- package/es/modules/corporate/share-certificate/components/ShareCertificateProperties/index.js +14 -8
- package/es/modules/corporate/share-certificate/components/ShareCertificateProperties/index.js.map +1 -1
- package/es/modules/corporate/share-options-register/components/ShareOptionItem/index.js +2 -2
- package/es/modules/corporate/share-options-register/components/ShareOptionItem/index.js.map +1 -1
- package/es/modules/corporate/share-options-register/components/ShareOptionPropertiesView/Content.js +2 -2
- package/es/modules/corporate/share-options-register/components/ShareOptionPropertiesView/Content.js.map +1 -1
- package/es/modules/corporate/share-options-register/pages/ShareOptionDefaultView/index.js +2 -2
- package/es/modules/corporate/share-options-register/pages/ShareOptionDefaultView/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/CompanyInfo/index.js +3 -3
- package/es/modules/self-registration/clda-form/components/CompanyInfo/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/CompanyInfo/index.less +19 -19
- package/es/modules/self-registration/clda-form/components/ShareCapital/index.js +2 -2
- package/es/modules/self-registration/clda-form/components/ShareCapital/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/agm/index.js +3 -4
- package/es/modules/self-registration/clda-form/incorporation/agm/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/bvi/index.js +3 -4
- package/es/modules/self-registration/clda-form/incorporation/bvi/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/sgp/index.js +3 -4
- package/es/modules/self-registration/clda-form/incorporation/sgp/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/index.js +1 -1
- package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/index.js.map +1 -1
- package/es/modules/self-registration/controls/Tips/Tip.js +3 -3
- package/es/modules/self-registration/controls/Tips/Tip.js.map +1 -1
- package/es/obsolete/ShareTransactionPropertiesView/Content.js +2 -2
- package/es/obsolete/ShareTransactionPropertiesView/Content.js.map +1 -1
- package/es/obsolete/controller-register/components/ControllerInformation/index.js +7 -7
- package/es/obsolete/controller-register/components/ControllerInformation/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { Col, Row, Button } from "antd";
|
|
1
|
+
import React, { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { Col, Row, Button, Tooltip } from "antd";
|
|
3
3
|
import { observe } from "@voplus/morpho-ui";
|
|
4
4
|
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
5
5
|
import { faListTimeline } from "@fortawesome/pro-light-svg-icons";
|
|
6
|
-
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
|
7
6
|
import ActivityLog from "@voplus/morpho-org/es/components/ActivityLog/ActivityLog2";
|
|
8
7
|
import CompanyProperties from "../../components/CompanyProperties";
|
|
9
8
|
import RelatedDocument from "@voplus/morpho-document/es/controls/RelatedDocument";
|
|
@@ -12,30 +11,37 @@ import OfficerListCard from "../../officer-register/components/OfficerListCard";
|
|
|
12
11
|
import styles from "./index.less";
|
|
13
12
|
const Dashboard = (props) => {
|
|
14
13
|
const { corporate, membersRegisterId, officersRegisterId } = props;
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
React.createElement(
|
|
24
|
-
React.createElement(
|
|
25
|
-
React.createElement(
|
|
26
|
-
React.createElement(
|
|
27
|
-
|
|
28
|
-
React.createElement(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
React.createElement(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
const ref = useRef(null);
|
|
15
|
+
const [visible, setVisible] = useState(true);
|
|
16
|
+
const [activitiesHeight, setActivitiesHeight] = useState();
|
|
17
|
+
useLayoutEffect(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
setActivitiesHeight((_a = ref.current) === null || _a === void 0 ? void 0 : _a.offsetHeight);
|
|
20
|
+
});
|
|
21
|
+
return observe(() => (React.createElement("div", { className: styles["dashboard-content"], ref: ref },
|
|
22
|
+
React.createElement(RelatedDocument, null,
|
|
23
|
+
React.createElement("div", { className: "dashboard-content-header flex items-center justify-between w-full" },
|
|
24
|
+
React.createElement("div", { className: "flex-1 min-w-0" },
|
|
25
|
+
React.createElement("div", { className: "text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate" }, corporate.name)),
|
|
26
|
+
React.createElement(Tooltip, { title: "Toggle Activity Log" },
|
|
27
|
+
React.createElement(Button, { icon: React.createElement(FAIcon, { icon: faListTimeline }), onClick: toggleActivity }))),
|
|
28
|
+
React.createElement(Row, { gutter: [16, 0] },
|
|
29
|
+
React.createElement(Col, { xs: 0, sm: 0, md: 0, lg: 0, xl: 8 },
|
|
30
|
+
React.createElement(CompanyProperties, { id: corporate.id })),
|
|
31
|
+
React.createElement(Col, { xs: 0, sm: 0, md: 0, lg: 0, xl: visible ? 10 : 16 },
|
|
32
|
+
officersRegisterId && (React.createElement(OfficerListCard, { officersRegisterId: officersRegisterId, corporateId: corporate.id, style: { height: "400px" } })),
|
|
33
|
+
membersRegisterId && (React.createElement(CompanyMemberListCard, { membersRegisterId: membersRegisterId, corporateId: corporate.id, style: { height: "400px" } }))),
|
|
34
|
+
React.createElement(Col, { xs: 0, sm: 0, md: 0, lg: 0, xl: visible ? 6 : 0 },
|
|
35
|
+
React.createElement("div", { className: "activity-log-card shadow ring-black ring-opacity-5", style: { height: `${activitiesHeight - 120}px` } },
|
|
36
|
+
React.createElement(ActivityLog, { id: corporate.id }))),
|
|
37
|
+
React.createElement(Col, { xs: 24, sm: 24, md: 24, lg: 24, xl: 0 },
|
|
38
|
+
React.createElement(CompanyProperties, { id: corporate.id }),
|
|
39
|
+
officersRegisterId && (React.createElement(OfficerListCard, { officersRegisterId: officersRegisterId, corporateId: corporate.id, style: { height: "400px" } })),
|
|
40
|
+
membersRegisterId && (React.createElement(CompanyMemberListCard, { membersRegisterId: membersRegisterId, corporateId: corporate.id, style: { height: "400px" } })),
|
|
41
|
+
visible && (React.createElement("div", { className: "activity-log-card shadow ring-black ring-opacity-5", style: { height: `${activitiesHeight - 120}px` } },
|
|
42
|
+
React.createElement(ActivityLog, { id: corporate.id })))))))));
|
|
35
43
|
function toggleActivity() {
|
|
36
|
-
|
|
37
|
-
? asideContext.closeAside()
|
|
38
|
-
: asideContext.openAside(ActivityLogCard, { span: 8 });
|
|
44
|
+
setVisible(!visible);
|
|
39
45
|
}
|
|
40
46
|
};
|
|
41
47
|
export default Dashboard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.js","sourceRoot":"","sources":["../../../../../../src/modules/corporate/company/pages/CompanyPage/Dashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Dashboard.js","sourceRoot":"","sources":["../../../../../../src/modules/corporate/company/pages/CompanyPage/Dashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,M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GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;oBACzC,oBAAC,iBAAiB,IAAC,EAAE,EAAE,SAAS,CAAC,EAAE,GAAI;oBACtC,kBAAkB,IAAI,CACtB,oBAAC,eAAe,IACf,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,SAAS,CAAC,EAAE,EACzB,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GACzB,CACF;oBACA,iBAAiB,IAAI,CACrB,oBAAC,qBAAqB,IACrB,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,SAAS,CAAC,EAAE,EACzB,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GACzB,CACF;oBACA,OAAO,IAAI,CACX,6BACC,SAAS,EAAC,oDAAoD,EAC9D,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,gBAAiB,GAAG,GAAG,IAAI,EAAE;wBAEjD,oBAAC,WAAW,IAAC,EAAE,EAAE,SAAS,CAAC,EAAE,GAAI,CAC5B,CACN,CACI,CACD,CACW,CACb,CACN,CAAC,CAAC;IAEH,SAAS,cAAc;QACtB,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -56,29 +56,19 @@
|
|
|
56
56
|
|
|
57
57
|
:global {
|
|
58
58
|
.dashboard-content-header {
|
|
59
|
-
padding: 2em
|
|
59
|
+
padding: 2em 0px 1em 0px;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.
|
|
63
|
-
height: calc(100% -
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.activity-log-card {
|
|
72
|
-
height: calc(100% - 1.25rem);
|
|
73
|
-
margin-top: 1.25rem;
|
|
74
|
-
overflow: hidden;
|
|
75
|
-
border-radius: 0.5rem;
|
|
76
|
-
border: 1px solid rgb(229 231 235);
|
|
77
|
-
}
|
|
62
|
+
.activity-log-card {
|
|
63
|
+
// height: calc(100% - 1.25rem);
|
|
64
|
+
margin-top: 1.25rem;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
border-radius: 0.5rem;
|
|
67
|
+
border: 1px solid rgb(229 231 235);
|
|
68
|
+
}
|
|
78
69
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
70
|
+
.activity-log-view {
|
|
71
|
+
background: #fff;
|
|
82
72
|
}
|
|
83
73
|
}
|
|
84
74
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IShareCertificate } from "../../../../../../data/share-certificate";
|
|
3
|
+
import { ICancelledCertificate } from "./Step2";
|
|
4
|
+
export declare type Step1Props = {
|
|
5
|
+
transactionId: string;
|
|
6
|
+
shareholderId?: string;
|
|
7
|
+
lineId: string;
|
|
8
|
+
lineClass?: string;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
onNext?: (res: ICancelledCertificate, selectedCertIds: string[]) => void;
|
|
11
|
+
/** Call back when an item has been clicked on the list. */
|
|
12
|
+
onClickItem?: (item: IShareCertificate) => void;
|
|
13
|
+
};
|
|
14
|
+
declare const Step1: (props: Step1Props) => JSX.Element;
|
|
15
|
+
export default Step1;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useMemo, useState } from "react";
|
|
2
|
+
import { Checkbox, Empty, Space, Button, message } from "antd";
|
|
3
|
+
import { useShareCertificateListEffect, } from "../../../../../../data/share-certificate";
|
|
4
|
+
import { useShareTransactionStore } from "../../../../../../data/share-transaction";
|
|
5
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
6
|
+
import { useAutoUpdateListData } from "@voplus/morpho-document-core";
|
|
7
|
+
import { observe } from "@voplus/morpho-ui";
|
|
8
|
+
import { State } from "./state";
|
|
9
|
+
import { useRenderOnChange } from "@voplus/morpho-ui";
|
|
10
|
+
import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
|
11
|
+
import ShareCertificateItem from "../../../../share-certificate/components/ShareCertificateItem";
|
|
12
|
+
import Scrollbars from "react-custom-scrollbars";
|
|
13
|
+
import styles from "./index.less";
|
|
14
|
+
const Step1 = (props) => {
|
|
15
|
+
const { transactionId, shareholderId, lineId, lineClass } = props;
|
|
16
|
+
const [state] = useState(new State());
|
|
17
|
+
const [total, setTotal] = useState(0);
|
|
18
|
+
const store = useShareTransactionStore();
|
|
19
|
+
const view = useMemo(() => new ViewContextData("PropertiesView"), []);
|
|
20
|
+
const list = useCreateListDataState({
|
|
21
|
+
filterDefaults: {
|
|
22
|
+
includes: "tags,versions",
|
|
23
|
+
filters: filters(),
|
|
24
|
+
},
|
|
25
|
+
}, [lineClass]);
|
|
26
|
+
/** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
|
|
27
|
+
useAutoUpdateListData(list, (d) => d.type === "ShareCertificate");
|
|
28
|
+
useRenderOnChange(() => list.filters.options);
|
|
29
|
+
/** 把ListDataState传给useShareCertificateListEffect,使之可以自動更新loading, hasmore. */
|
|
30
|
+
useShareCertificateListEffect(list, (result, total) => {
|
|
31
|
+
list.union(result);
|
|
32
|
+
}, {
|
|
33
|
+
Total: true,
|
|
34
|
+
...list.filters.options,
|
|
35
|
+
});
|
|
36
|
+
return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
37
|
+
React.createElement(ViewContext.Provider, { value: view },
|
|
38
|
+
React.createElement("div", { className: styles["step1-content"] },
|
|
39
|
+
React.createElement("div", { className: "share-cert-list-data" },
|
|
40
|
+
React.createElement(Scrollbars, null, list.data.length ? (list.data.map((cert) => (React.createElement("div", { className: "share-cert-item", key: cert.id },
|
|
41
|
+
React.createElement(Checkbox, { value: cert, onChange: onChange }),
|
|
42
|
+
React.createElement(ShareCertificateItem, { id: cert.id, toolBarVisible: false }))))) : (React.createElement(Empty, null)))),
|
|
43
|
+
React.createElement("div", { className: "step1-footer" },
|
|
44
|
+
React.createElement("div", { className: "step1-amount" },
|
|
45
|
+
React.createElement("span", { className: "step1-amount-title" }, "Balance"),
|
|
46
|
+
React.createElement("span", { className: "step1-amount-total" }, total)),
|
|
47
|
+
React.createElement("div", { className: "step1-btn" },
|
|
48
|
+
React.createElement(Space, null,
|
|
49
|
+
React.createElement(Button, { onClick: props.onCancel }, "Cancel"),
|
|
50
|
+
React.createElement(Button, { type: "primary", onClick: onSubmit }, "Next")))))))));
|
|
51
|
+
function filters() {
|
|
52
|
+
const filter = [{ c: "CertificateStatus", o: "=", l: "And", v1: "Issued" }];
|
|
53
|
+
if (lineClass)
|
|
54
|
+
filter.push({ c: "Class", o: "=", l: "And", v1: lineClass });
|
|
55
|
+
if (shareholderId)
|
|
56
|
+
filter.push({ c: "ShareholderId", o: "=", l: "And", v1: shareholderId });
|
|
57
|
+
return filter;
|
|
58
|
+
}
|
|
59
|
+
function onChange(e) {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const certId = (_a = e.target.value) === null || _a === void 0 ? void 0 : _a.id;
|
|
62
|
+
const certShares = (_b = e.target.value) === null || _b === void 0 ? void 0 : _b.shares;
|
|
63
|
+
const isExit = state.selectedCertIds.includes(certId);
|
|
64
|
+
if (isExit) {
|
|
65
|
+
state.selectedCertIds = state.selectedCertIds.filter((i) => i !== certId);
|
|
66
|
+
state.selectedCerts = state.selectedCerts.filter((c) => c.id !== certId);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
state.selectedCertIds.push(certId);
|
|
70
|
+
state.selectedCerts.push({ id: certId, shares: certShares });
|
|
71
|
+
}
|
|
72
|
+
sum();
|
|
73
|
+
}
|
|
74
|
+
function sum() {
|
|
75
|
+
let selectedCertShares = state.selectedCerts.map((s) => s.shares);
|
|
76
|
+
setTotal(eval(selectedCertShares.join("+")) || 0);
|
|
77
|
+
}
|
|
78
|
+
async function onSubmit() {
|
|
79
|
+
if (!state.selectedCertIds.length) {
|
|
80
|
+
message.error("can not be empty");
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
await store
|
|
84
|
+
.cancelCreateSummary(transactionId, lineId, {
|
|
85
|
+
data: { SelectedCertIds: state.selectedCertIds },
|
|
86
|
+
})
|
|
87
|
+
.then((res) => props.onNext && props.onNext(res, state.selectedCertIds));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
export default Step1;
|
|
92
|
+
//# sourceMappingURL=Step1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step1.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step1.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/D,OAAO,EAEN,6BAA6B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACN,WAAW,EACX,eAAe,GACf,MAAM,0DAA0D,CAAC;AAClE,OAAO,oBAAoB,MAAM,+DAA+D,CAAC;AACjG,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,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G,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,UAAU,QAAQ;QACtB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,EAAE;YAClC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;SAClC;aAAM;YACN,MAAM,KAAK;iBACT,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE;gBAC3C,IAAI,EAAE,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE;aAChD,CAAC;iBACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,GAAI,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;SAC3E;IACF,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ICancelledCertificate {
|
|
3
|
+
cancel: {
|
|
4
|
+
certificates: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}[];
|
|
8
|
+
class: string;
|
|
9
|
+
shares: number;
|
|
10
|
+
};
|
|
11
|
+
required: {
|
|
12
|
+
shares: number;
|
|
13
|
+
class: string;
|
|
14
|
+
};
|
|
15
|
+
create?: {
|
|
16
|
+
shares: number;
|
|
17
|
+
class: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
declare const Step2: (props: {
|
|
21
|
+
transactionId: string;
|
|
22
|
+
lineId: string;
|
|
23
|
+
data: ICancelledCertificate;
|
|
24
|
+
selectedCertIds: string[];
|
|
25
|
+
onCancel?: () => void;
|
|
26
|
+
}) => JSX.Element;
|
|
27
|
+
export default Step2;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { observe } from "@voplus/morpho-ui";
|
|
3
|
+
import { Space, Button, Col, Row, Divider, Alert } from "antd";
|
|
4
|
+
import { useShareTransactionStore } from "../../../../../../data/share-transaction";
|
|
5
|
+
import ReferenceList from "@voplus/morpho-document/es/controls/ReferenceList";
|
|
6
|
+
import styles from "./index.less";
|
|
7
|
+
const Step2 = (props) => {
|
|
8
|
+
const { transactionId, lineId, data } = props;
|
|
9
|
+
const store = useShareTransactionStore();
|
|
10
|
+
return observe(() => {
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
12
|
+
return (React.createElement("div", { className: styles["step2-content"] },
|
|
13
|
+
React.createElement(Alert, { className: "step2-content-alter-message", message: "Attention: Please review the summary before confirming. Share certificate(s) will be cancelled/created immediately upon confirmation.", type: "warning" }),
|
|
14
|
+
React.createElement(Row, { align: "bottom" },
|
|
15
|
+
React.createElement(Col, { span: 18, className: "step2-content-title" }, "Required"),
|
|
16
|
+
React.createElement(Col, { span: 6, className: "step2-content-shares" }, (_a = data === null || data === void 0 ? void 0 : data.required) === null || _a === void 0 ? void 0 : _a.shares)),
|
|
17
|
+
React.createElement(Row, { align: "bottom" },
|
|
18
|
+
React.createElement(Col, { span: 6, offset: 18, className: "step2-content-class" }, (_b = data === null || data === void 0 ? void 0 : data.required) === null || _b === void 0 ? void 0 : _b.class)),
|
|
19
|
+
React.createElement(Divider, null),
|
|
20
|
+
React.createElement(Row, { align: "bottom" },
|
|
21
|
+
React.createElement(Col, { span: 18, className: "step2-content-title" }, "Cancel Certificates"),
|
|
22
|
+
React.createElement(Col, { span: 6, className: "step2-content-shares" }, (_c = data === null || data === void 0 ? void 0 : data.cancel) === null || _c === void 0 ? void 0 : _c.shares)),
|
|
23
|
+
React.createElement(Row, null,
|
|
24
|
+
React.createElement(Col, { span: 18 },
|
|
25
|
+
React.createElement(ReferenceList, { canEdit: false, document: (_d = data === null || data === void 0 ? void 0 : data.cancel) === null || _d === void 0 ? void 0 : _d.certificates })),
|
|
26
|
+
React.createElement(Col, { span: 6, className: "step2-content-class" }, (_e = data === null || data === void 0 ? void 0 : data.cancel) === null || _e === void 0 ? void 0 : _e.class)),
|
|
27
|
+
(data === null || data === void 0 ? void 0 : data.create) && (React.createElement(React.Fragment, null,
|
|
28
|
+
React.createElement(Divider, null),
|
|
29
|
+
React.createElement(Row, { align: "bottom" },
|
|
30
|
+
React.createElement(Col, { span: 18, className: "step2-content-title" }, "Create Certificate"),
|
|
31
|
+
React.createElement(Col, { span: 6, className: "step2-content-shares" }, (_f = data === null || data === void 0 ? void 0 : data.create) === null || _f === void 0 ? void 0 : _f.shares)),
|
|
32
|
+
React.createElement(Row, null,
|
|
33
|
+
React.createElement(Col, { span: 6, offset: 18, className: "step2-content-class" }, (_g = data === null || data === void 0 ? void 0 : data.create) === null || _g === void 0 ? void 0 : _g.class)))),
|
|
34
|
+
React.createElement("div", { className: "step2-footer" },
|
|
35
|
+
React.createElement("div", { className: "step2-btn" },
|
|
36
|
+
React.createElement(Space, null,
|
|
37
|
+
React.createElement(Button, { onClick: props.onCancel }, "Cancel"),
|
|
38
|
+
React.createElement(Button, { type: "primary", onClick: () => {
|
|
39
|
+
store
|
|
40
|
+
.cancelCreateConfirm(transactionId, lineId, {
|
|
41
|
+
data: { SelectedCertIds: props.selectedCertIds },
|
|
42
|
+
})
|
|
43
|
+
.then(() => {
|
|
44
|
+
if (props.onCancel)
|
|
45
|
+
props.onCancel();
|
|
46
|
+
});
|
|
47
|
+
} }, "Confirm"))))));
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export default Step2;
|
|
51
|
+
//# sourceMappingURL=Step2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Step2.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/Step2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAA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,IACN,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,GAAG,EAAE;gCACb,KAAK;qCACH,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE;oCAC3C,IAAI,EAAE,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE;iCAChD,CAAC;qCACD,IAAI,CAAC,GAAG,EAAE;oCACV,IAAI,KAAK,CAAC,QAAQ;wCAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;gCACtC,CAAC,CAAC,CAAC;4BACL,CAAC,cAGO,CACF,CACH,CACD,CACD,CACN,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { observe } from "@voplus/morpho-ui";
|
|
3
|
+
import { Modal } from "antd";
|
|
4
|
+
import { State } from "./state";
|
|
5
|
+
import Step1 from "./Step1";
|
|
6
|
+
import Step2 from "./Step2";
|
|
7
|
+
import styles from "./index.less";
|
|
8
|
+
const CertCancelCreateDialog = (props) => {
|
|
9
|
+
const [step, setStep] = useState(1);
|
|
10
|
+
const [data, setData] = useState();
|
|
11
|
+
const [state] = useState(new State());
|
|
12
|
+
return observe(() => (React.createElement(Modal, { open: true, closable: false, footer: false, className: styles["cert-cancel-create-dialog"], title: step === 1 ? "Select Certs to Cancel" : "Confirm Operation Summary" }, step === 1 ? (React.createElement(Step1, { transactionId: props.transactionId, shareholderId: props.shareholderId, lineId: props.lineId, lineClass: props.lineClass, onCancel: props.onCancel, onNext: (res, selectedCertIds) => {
|
|
13
|
+
setData(res);
|
|
14
|
+
state.selectedCertIds = selectedCertIds;
|
|
15
|
+
setStep(2);
|
|
16
|
+
} })) : (React.createElement(Step2, { transactionId: props.transactionId, lineId: props.lineId, data: data, selectedCertIds: state.selectedCertIds, onCancel: props.onCancel })))));
|
|
17
|
+
};
|
|
18
|
+
export default CertCancelCreateDialog;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/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,MAAM,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAgC,MAAM,SAAS,CAAC;AACvD,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,sBAAsB,GAAG,CAAC,KAM/B,EAAE,EAAE;IACJ,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAQ,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAyB,CAAC;IAE1D,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAEtC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,IACL,IAAI,QACJ,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,KAAK,EACb,SAAS,EAAE,MAAM,CAAC,2BAA2B,CAAC,EAC9C,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,2BAA2B,IAEzE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CACb,oBAAC,KAAK,IACL,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,MAAM,EAAE,CAAC,GAA0B,EAAE,eAAyB,EAAE,EAAE;YACjE,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;YACxC,OAAO,CAAC,CAAC,CAAC,CAAC;QACZ,CAAC,GACA,CACF,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,IACL,aAAa,EAAE,KAAK,CAAC,aAAa,EAClC,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,IAAI,EAAE,IAAK,EACX,eAAe,EAAE,KAAK,CAAC,eAAe,EACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GACvB,CACF,CACM,CACR,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@import "~@voplus/morpho-theme/styles/index.less";
|
|
2
|
+
|
|
3
|
+
.cert-cancel-create-dialog {
|
|
4
|
+
:global {
|
|
5
|
+
.ant-modal-body {
|
|
6
|
+
padding: 0px !important;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.step1-content {
|
|
12
|
+
padding: 0px 24px 10px 24px;
|
|
13
|
+
|
|
14
|
+
:global {
|
|
15
|
+
.share-cert-list-data {
|
|
16
|
+
height: 350px;
|
|
17
|
+
|
|
18
|
+
.share-cert-item {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
|
|
22
|
+
.share-certificate-item___vRC37 {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.step1-footer {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
height: 50px;
|
|
32
|
+
padding-top: 10px;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
border-top: 1px solid #d9d9d9;
|
|
35
|
+
|
|
36
|
+
.step1-amount {
|
|
37
|
+
.step1-amount-title {
|
|
38
|
+
font-size: 20px;
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
color: @heading-subtitle-color;
|
|
41
|
+
margin-right: 10px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.step1-amount-total {
|
|
45
|
+
font-size: 20px;
|
|
46
|
+
font-weight: bold;
|
|
47
|
+
color: #ff5809;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.step2-content {
|
|
55
|
+
padding: 0px 24px 10px 24px;
|
|
56
|
+
|
|
57
|
+
:global {
|
|
58
|
+
|
|
59
|
+
.step2-content-alter-message{
|
|
60
|
+
margin: 20px 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.step2-content-title {
|
|
64
|
+
font-size: 1.5rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.step2-content-shares {
|
|
68
|
+
text-align: end;
|
|
69
|
+
font-size: 2rem;
|
|
70
|
+
margin-bottom: -10px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.step2-content-class {
|
|
74
|
+
opacity: 0.6;
|
|
75
|
+
text-align: end;
|
|
76
|
+
font-size: 0.7rem !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.step2-footer {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: end;
|
|
83
|
+
height: 50px;
|
|
84
|
+
margin-top: 20px;
|
|
85
|
+
// border-top: 1px solid #d9d9d9;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { makeObservable, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** */
|
|
6
|
+
Object.defineProperty(this, "selectedCertIds", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: []
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "selectedCerts", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: []
|
|
17
|
+
});
|
|
18
|
+
makeObservable(this);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
__decorate([
|
|
22
|
+
observable
|
|
23
|
+
], State.prototype, "selectedCertIds", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
observable
|
|
26
|
+
], State.prototype, "selectedCerts", void 0);
|
|
27
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/share-transactions-register/components/CertCancelCreateDialog/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,OAAO,KAAK;IAMjB;QALA,MAAM;QACM;;;;mBAAmC,EAAE;WAAC;QAEtC;;;;mBAAyD,EAAE;WAAC;QAGvE,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACD;AAPY;IAAX,UAAU;8CAAuC;AAEtC;IAAX,UAAU;4CAA6D"}
|
|
@@ -4,6 +4,7 @@ import React, { useRef, useState } from "react";
|
|
|
4
4
|
import { faBars, faTrashAlt } from "@fortawesome/pro-light-svg-icons";
|
|
5
5
|
import CurrencyView from "../../../../../../components/CurrencyView";
|
|
6
6
|
import DocumentReference from "@voplus/morpho-document/es/controls/DocumentReference";
|
|
7
|
+
import ReferenceList from "@voplus/morpho-document/es/controls/ReferenceList";
|
|
7
8
|
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
8
9
|
import ShareholderSelector from "../ShareholderSelector";
|
|
9
10
|
import classnames from "classnames";
|
|
@@ -11,38 +12,72 @@ import { isEqual } from "lodash-es";
|
|
|
11
12
|
import { observe } from "@voplus/morpho-ui";
|
|
12
13
|
import { useFormRowContext } from "../../../../../../components/TableDragRow/FormRowContext";
|
|
13
14
|
import { useTableDataContext } from "./TableDataContext";
|
|
15
|
+
import CertCancelCreateDialog from "../CertCancelCreateDialog";
|
|
14
16
|
const DragTableCell = (props) => {
|
|
15
17
|
const { shareTransaction, verified, confirmed, editable, dataIndex, record, rowIndex, children, onAdd, onDel, ...restProps } = props;
|
|
16
18
|
const formContext = useFormRowContext();
|
|
17
19
|
const dataContext = useTableDataContext();
|
|
18
20
|
const store = useShareTransactionStore();
|
|
19
21
|
const [editing, setEditing] = useState(false);
|
|
22
|
+
const [certCancelCreate, setCertCancelCreate] = useState({ visible: false, lineId: "", shareholder: "", lineClass: "" });
|
|
20
23
|
/** Open of shareType */
|
|
21
24
|
const [open, setOpen] = useState(false);
|
|
22
25
|
const ref = useRef();
|
|
23
26
|
const required = dataIndex === "certificate" || dataIndex === "currency" ? false : true;
|
|
24
27
|
return observe(() => {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
return (React.createElement("td", { ...restProps, ref: ref },
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
, {
|
|
28
|
+
var _a, _b, _c, _d, _e;
|
|
29
|
+
return (React.createElement("td", { ...restProps, ref: ref },
|
|
30
|
+
dataIndex === "Dnd" ? (record.added ? (React.createElement(Button, { danger: true, shape: "circle", onClick: () => onDel(record.id) },
|
|
31
|
+
React.createElement(FAIcon, { icon: faTrashAlt }))) : (formContext.connectDragSource(React.createElement("span", { style: shareTransaction.readonly ? { pointerEvents: "none" } : { cursor: "move" } },
|
|
32
|
+
React.createElement(FAIcon, { icon: faBars }))))) : editable ? ((record && record.added) || editing ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [{ required: required, message: `${dataIndex} is required.` }] }, dataIndex === "shareholder" ? (React.createElement(ShareholderSelector, { memberId: shareTransaction.memberRegisterId, open: editing, defaultValue: record.shareholder, onChange: save })) : dataIndex === "class" ? (React.createElement(AutoComplete
|
|
31
33
|
// autoFocus
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
, {
|
|
35
|
+
// autoFocus
|
|
36
|
+
open: open || editing, onSelect: save, onBlur: save, onDropdownVisibleChange: (open) => setOpen(open) },
|
|
37
|
+
React.createElement(AutoComplete.Option, { value: "Ordinary" }, "Ordinary"),
|
|
38
|
+
React.createElement(AutoComplete.Option, { value: "Preference" }, "Preference"))) : dataIndex === "certificate" ? null : dataIndex === "currency" ? (React.createElement(CurrencyView, { currency: record.currency, editable: !!record.added, onChange: save })) : (React.createElement(InputNumber, { autoFocus: editing, min: inputNumberMinVal(shareTransaction.transactionType, dataIndex), max: dataIndex === "discount" ? 100 : 100000000000, precision: dataIndex === "price" ? 2 : 0, onPressEnter: save, onBlur: save, onKeyDown: onKeyDown })))) : dataIndex === "shareholder" && record.shareholder ? (React.createElement("div", { onClick: () => !record.id && toggleEdit() }, record.shareholder.name)) : dataIndex === "certificate" ? (record.newCertificate || ((_a = record.cancelledCertificates) === null || _a === void 0 ? void 0 : _a.length) ? (React.createElement("div", { className: "share-transaction-table-share" },
|
|
39
|
+
record.newCertificate && (React.createElement("div", { className: "new-certificate" },
|
|
40
|
+
((_b = record.cancelledCertificates) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (React.createElement("div", { className: "new-certificate-title" }, "New")) : null,
|
|
41
|
+
React.createElement(DocumentReference, { id: (_c = record.newCertificate) === null || _c === void 0 ? void 0 : _c.id }))),
|
|
42
|
+
((_d = record.cancelledCertificates) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (React.createElement("div", { className: "cancelled-certificates" },
|
|
43
|
+
React.createElement("div", { className: "cancelled-certificates-title" }, "Cancelled"),
|
|
44
|
+
React.createElement(ReferenceList, { canEdit: false, document: record.cancelledCertificates }))) : null)) : record.shares > 0 ? (confirmed && verified ? (React.createElement(Button, { disabled: shareTransaction.readonly, onClick: () => createCertificate(record.id) }, "Create")) : null) : confirmed && verified ? (React.createElement(Button, { disabled: shareTransaction.readonly, onClick: () => {
|
|
45
|
+
var _a;
|
|
46
|
+
return setCertCancelCreate({
|
|
47
|
+
visible: true,
|
|
48
|
+
shareholder: (_a = record.shareholder) === null || _a === void 0 ? void 0 : _a.id,
|
|
49
|
+
lineId: record.id,
|
|
50
|
+
lineClass: record.class,
|
|
51
|
+
});
|
|
52
|
+
} }, "Create")) : null) : (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement("div", { className: classnames({
|
|
54
|
+
"editable-cell-wrap": dataIndex === "consideration",
|
|
55
|
+
}) },
|
|
56
|
+
React.createElement("div", { onClick: toggleEdit }, children),
|
|
57
|
+
dataIndex === "consideration" &&
|
|
58
|
+
dataContext.hoverKey === rowIndex &&
|
|
59
|
+
!((_e = record.certificate) === null || _e === void 0 ? void 0 : _e.id) &&
|
|
60
|
+
verified === false &&
|
|
61
|
+
confirmed === false && (React.createElement(Button, { danger: true, shape: "circle", onClick: () => onDel(record.id) },
|
|
62
|
+
React.createElement(FAIcon, { icon: faTrashAlt }))))))) : dataIndex === "shareholder" && record.shareholder ? (record.shareholder.name) : (children),
|
|
63
|
+
certCancelCreate.visible && (React.createElement(CertCancelCreateDialog, { transactionId: shareTransaction.id, shareholderId: certCancelCreate.shareholder, lineId: certCancelCreate.lineId, lineClass: certCancelCreate.lineClass, onCancel: () => setCertCancelCreate({
|
|
64
|
+
visible: false,
|
|
65
|
+
shareholder: "",
|
|
66
|
+
lineId: "",
|
|
67
|
+
lineClass: "",
|
|
68
|
+
}) }))));
|
|
45
69
|
});
|
|
70
|
+
function inputNumberMinVal(transactionType, dataIndex) {
|
|
71
|
+
if (transactionType === "Allotment") {
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
if (dataIndex === "shares") {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
46
81
|
function toggleEdit() {
|
|
47
82
|
var _a;
|
|
48
83
|
if ((_a = record.certificate) === null || _a === void 0 ? void 0 : _a.id)
|