@voplus/morpho-csp 1.0.0-dev002
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/changelog.md +0 -0
- package/es/Modules.d.ts +6 -0
- package/es/Modules.js +17 -0
- package/es/Modules.js.map +1 -0
- package/es/components/CurrencyView/index.d.ts +9 -0
- package/es/components/CurrencyView/index.js +196 -0
- package/es/components/CurrencyView/index.js.map +1 -0
- package/es/components/CurrencyView/state.d.ts +9 -0
- package/es/components/CurrencyView/state.js +206 -0
- package/es/components/CurrencyView/state.js.map +1 -0
- package/es/components/TableDragRow/FormRowContext.d.ts +4 -0
- package/es/components/TableDragRow/FormRowContext.js +5 -0
- package/es/components/TableDragRow/FormRowContext.js.map +1 -0
- package/es/components/TableDragRow/index.d.ts +3 -0
- package/es/components/TableDragRow/index.js +41 -0
- package/es/components/TableDragRow/index.js.map +1 -0
- package/es/data/metas.d.ts +0 -0
- package/es/data/metas.js +1 -0
- package/es/data/metas.js.map +1 -0
- package/es/data/shareTransaction/ShareTransactionStore.d.ts +12 -0
- package/es/data/shareTransaction/ShareTransactionStore.js +17 -0
- package/es/data/shareTransaction/ShareTransactionStore.js.map +1 -0
- package/es/data/shareTransaction/hooks.d.ts +9 -0
- package/es/data/shareTransaction/hooks.js +20 -0
- package/es/data/shareTransaction/hooks.js.map +1 -0
- package/es/data/shareTransaction/index.d.ts +4 -0
- package/es/data/shareTransaction/index.js +5 -0
- package/es/data/shareTransaction/index.js.map +1 -0
- package/es/data/shareTransaction/interfaces/IShareTransaction.d.ts +20 -0
- package/es/data/shareTransaction/interfaces/IShareTransaction.js +1 -0
- package/es/data/shareTransaction/interfaces/IShareTransaction.js.map +1 -0
- package/es/data/shareTransaction/interfaces/IShareTransactionLine.d.ts +19 -0
- package/es/data/shareTransaction/interfaces/IShareTransactionLine.js +1 -0
- package/es/data/shareTransaction/interfaces/IShareTransactionLine.js.map +1 -0
- package/es/data/shareTransaction/interfaces/index.d.ts +2 -0
- package/es/data/shareTransaction/interfaces/index.js +3 -0
- package/es/data/shareTransaction/interfaces/index.js.map +1 -0
- package/es/data/shareTransaction/metas.d.ts +6 -0
- package/es/data/shareTransaction/metas.js +13 -0
- package/es/data/shareTransaction/metas.js.map +1 -0
- package/es/data/shareTransaction/types/ShareLineCreateOptions.d.ts +12 -0
- package/es/data/shareTransaction/types/ShareLineCreateOptions.js +1 -0
- package/es/data/shareTransaction/types/ShareLineCreateOptions.js.map +1 -0
- package/es/data/shareTransaction/types/ShareTransactionCreateOptions.d.ts +11 -0
- package/es/data/shareTransaction/types/ShareTransactionCreateOptions.js +1 -0
- package/es/data/shareTransaction/types/ShareTransactionCreateOptions.js.map +1 -0
- package/es/data/shareTransaction/types/ShareTransactionEditOptions.d.ts +10 -0
- package/es/data/shareTransaction/types/ShareTransactionEditOptions.js +1 -0
- package/es/data/shareTransaction/types/ShareTransactionEditOptions.js.map +1 -0
- package/es/data/shareTransaction/types/ShareTransactionType.d.ts +1 -0
- package/es/data/shareTransaction/types/ShareTransactionType.js +1 -0
- package/es/data/shareTransaction/types/ShareTransactionType.js.map +1 -0
- package/es/data/shareTransaction/types/index.d.ts +3 -0
- package/es/data/shareTransaction/types/index.js +4 -0
- package/es/data/shareTransaction/types/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareMovementsDataIcon/index.d.ts +7 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareMovementsDataIcon/index.js +36 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareMovementsDataIcon/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareMovementsDataIcon/index.less +11 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionDefaultView/index.d.ts +4 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionDefaultView/index.js +70 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionDefaultView/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionDefaultView/index.less +94 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItem/index.d.ts +8 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItem/index.js +36 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItem/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItem/index.less +65 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDataContext.d.ts +29 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDataContext.js +64 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDataContext.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDragCell.d.ts +3 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDragCell.js +90 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDragCell.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/index.d.ts +6 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/index.js +152 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/index.d.ts +7 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/index.js +85 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/index.less +15 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/state.d.ts +7 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/state.js +27 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/state.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionRegisterDefaultView/index.d.ts +4 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionRegisterDefaultView/index.js +48 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionRegisterDefaultView/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionRegisterDefaultView/index.less +22 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/index.d.ts +13 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/index.js +34 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/state.d.ts +8 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/state.js +23 -0
- package/es/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/state.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/TransactionTypeDropdown/index.d.ts +5 -0
- package/es/modules/legalEntity/shareTransactionsRegister/TransactionTypeDropdown/index.js +28 -0
- package/es/modules/legalEntity/shareTransactionsRegister/TransactionTypeDropdown/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/TransactionTypeFilter/index.d.ts +3 -0
- package/es/modules/legalEntity/shareTransactionsRegister/TransactionTypeFilter/index.js +33 -0
- package/es/modules/legalEntity/shareTransactionsRegister/TransactionTypeFilter/index.js.map +1 -0
- package/es/modules/legalEntity/shareTransactionsRegister/TransactionTypeFilter/index.less +5 -0
- package/es/routes.d.ts +17 -0
- package/es/routes.js +38 -0
- package/es/routes.js.map +1 -0
- package/es/style/common.less +25 -0
- package/package.json +68 -0
- package/readme.md +0 -0
package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDragCell.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AutoComplete, Button, Form, InputNumber } from "@voplus/antd";
|
|
2
|
+
import React, { useRef, useState } from "react";
|
|
3
|
+
import { faBars, faTrashAlt } from "@fortawesome/pro-light-svg-icons";
|
|
4
|
+
import CurrencyView from "../../../../components/CurrencyView";
|
|
5
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
6
|
+
import ShareholderSelector from "../ShareholderSelector";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import { isEqual } from "lodash-es";
|
|
9
|
+
import { useFormRowContext } from "../../../../components/TableDragRow/FormRowContext";
|
|
10
|
+
import { useObserver } from "mobx-react-lite";
|
|
11
|
+
import { useTableDataContext } from "./TableDataContext";
|
|
12
|
+
const DragTableCell = (props) => {
|
|
13
|
+
const { editable, dataIndex, record, rowIndex, children, onAdd, onDel, ...restProps } = props;
|
|
14
|
+
const formContext = useFormRowContext();
|
|
15
|
+
const dataContext = useTableDataContext();
|
|
16
|
+
const [editing, setEditing] = useState(false);
|
|
17
|
+
/** Open of shareType */
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
|
+
const ref = useRef();
|
|
20
|
+
return useObserver(() => (React.createElement("td", Object.assign({}, restProps, { ref: ref }), dataIndex === "Dnd" ? (record.added ? (React.createElement(Button, { danger: true, shape: "circle", onClick: () => onDel(record.id) },
|
|
21
|
+
React.createElement(FAIcon, { icon: faTrashAlt }))) : (formContext.connectDragSource(React.createElement("span", { style: { cursor: "move" } },
|
|
22
|
+
React.createElement(FAIcon, { icon: faBars }))))) : editable ? ((record && record.added) || editing ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [{ required: true, message: `${dataIndex} is required.` }] }, dataIndex === "shareholder" ? (React.createElement(ShareholderSelector, { open: editing, defaultValue: record.shareholder, onChange: save })) : dataIndex === "class" ? (React.createElement(AutoComplete, { autoFocus: true, open: open || editing, onSelect: save, onBlur: save, onDropdownVisibleChange: open => setOpen(open) },
|
|
23
|
+
React.createElement(AutoComplete.Option, { value: "Ordinary" }, "Ordinary"),
|
|
24
|
+
React.createElement(AutoComplete.Option, { value: "Preference" }, "Preference"))) : dataIndex === "currency" ? (React.createElement(CurrencyView, { currency: record.currency, editable: !!record.added, onChange: save })) : (React.createElement(InputNumber, { autoFocus: editing, min: dataIndex === "qty" ? 1 : 0, max: dataIndex === "discount" ? 100 : 100000000000, precision: dataIndex === "price" ? 2 : 0, onPressEnter: save, onBlur: save, onKeyDown: onKeyDown })))) : dataIndex === "shareholder" && record.shareholder ? (React.createElement("div", { onClick: toggleEdit }, record.shareholder.name)) : (React.createElement(React.Fragment, null,
|
|
25
|
+
React.createElement("div", { className: classnames({
|
|
26
|
+
"editable-cell-wrap": dataIndex === "consideration"
|
|
27
|
+
}) },
|
|
28
|
+
React.createElement("div", { onClick: toggleEdit }, children),
|
|
29
|
+
dataIndex === "consideration" && dataContext.hoverKey === rowIndex && (React.createElement(Button, { danger: true, shape: "circle", onClick: () => onDel(record.id) },
|
|
30
|
+
React.createElement(FAIcon, { icon: faTrashAlt }))))))) : dataIndex === "shareholder" && record.shareholder ? (record.shareholder.name) : (children))));
|
|
31
|
+
function toggleEdit() {
|
|
32
|
+
formContext.form.setFieldsValue(record);
|
|
33
|
+
setEditing(!editing);
|
|
34
|
+
}
|
|
35
|
+
function save() {
|
|
36
|
+
formContext.form
|
|
37
|
+
.validateFields()
|
|
38
|
+
.then((sharesLine) => {
|
|
39
|
+
const { added, shareholder, consideration, shares, currency } = record;
|
|
40
|
+
const line = {
|
|
41
|
+
shareholder: sharesLine.shareholder || shareholder,
|
|
42
|
+
class: sharesLine.class || record.class,
|
|
43
|
+
consideration: sharesLine.consideration || consideration,
|
|
44
|
+
shares: sharesLine.shares || shares,
|
|
45
|
+
currency: sharesLine.currency || currency
|
|
46
|
+
};
|
|
47
|
+
const hasChange = !isEqual(line, {
|
|
48
|
+
shareholder,
|
|
49
|
+
class: record.class,
|
|
50
|
+
consideration,
|
|
51
|
+
shares,
|
|
52
|
+
currency
|
|
53
|
+
});
|
|
54
|
+
/** Add or edit Quotation line */
|
|
55
|
+
if (added || hasChange) {
|
|
56
|
+
setSharesLine(rowIndex, sharesLine);
|
|
57
|
+
}
|
|
58
|
+
if (!added)
|
|
59
|
+
return toggleEdit();
|
|
60
|
+
})
|
|
61
|
+
.catch((errorInfo) => {
|
|
62
|
+
// console.log(errorInfo, "errorInfo");
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function onKeyDown(e) {
|
|
66
|
+
/** Esc to quit editing */
|
|
67
|
+
if (e.keyCode === 27)
|
|
68
|
+
return setEditing(false);
|
|
69
|
+
if (e.keyCode !== 9 || dataIndex !== "discount")
|
|
70
|
+
return;
|
|
71
|
+
formContext.form
|
|
72
|
+
.validateFields()
|
|
73
|
+
.then(() => {
|
|
74
|
+
onAdd();
|
|
75
|
+
})
|
|
76
|
+
.catch((errorInfo) => {
|
|
77
|
+
// console.log(errorInfo, "errorInfo");
|
|
78
|
+
});
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
function setSharesLine(index, sharesLine) {
|
|
82
|
+
dataContext.invoiceLines[index] = {
|
|
83
|
+
...dataContext.invoiceLines[index],
|
|
84
|
+
...sharesLine
|
|
85
|
+
};
|
|
86
|
+
dataContext.invoiceLines = [...dataContext.invoiceLines];
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export default DragTableCell;
|
|
90
|
+
//# sourceMappingURL=TableDragCell.js.map
|
package/es/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDragCell.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableDragCell.js","sourceRoot":"","sources":["../../../../../src/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/TableDragCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAU,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OA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,EAAE;aAChB,IAAI,CAAC,GAAG,EAAE;YACV,KAAK,EAAE,CAAC;QACT,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,SAAc,EAAE,EAAE;YACzB,uCAAuC;QACxC,CAAC,CAAC,CAAC;QACJ,OAAO;IACR,CAAC;IACD,SAAS,aAAa,CAAC,KAAa,EAAE,UAAe;QACpD,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG;YACjC,GAAG,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC;YAClC,GAAG,UAAU;SACb,CAAC;QACF,WAAW,CAAC,YAAY,GAAG,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;AACF,CAAC,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Button, Modal, Table } from "@voplus/antd";
|
|
2
|
+
import { useShareTransactionStore } from "../../../../data/shareTransaction";
|
|
3
|
+
import React, { useEffect, useState } from "react";
|
|
4
|
+
import { TableDataContext, TableDataContextState } from "./TableDataContext";
|
|
5
|
+
import { clone, isEqual } from "lodash-es";
|
|
6
|
+
import { DndProvider } from "react-dnd";
|
|
7
|
+
import DragTableCell from "./TableDragCell";
|
|
8
|
+
import DragTableRow from "../../../../components/TableDragRow";
|
|
9
|
+
import HTML5Backend from "react-dnd-html5-backend";
|
|
10
|
+
import { toJS } from "mobx";
|
|
11
|
+
import update from "immutability-helper";
|
|
12
|
+
import { useDocumentStore } from "@voplus/morpho-document";
|
|
13
|
+
import { useObserver } from "mobx-react-lite";
|
|
14
|
+
const ShareTransactionItems = (props) => {
|
|
15
|
+
const { data } = props;
|
|
16
|
+
const [state] = useState(new TableDataContextState());
|
|
17
|
+
state.props = props;
|
|
18
|
+
const shareStore = useShareTransactionStore();
|
|
19
|
+
const documents = useDocumentStore();
|
|
20
|
+
const columnsList = [
|
|
21
|
+
{
|
|
22
|
+
title: "",
|
|
23
|
+
dataIndex: "Dnd",
|
|
24
|
+
width: 40,
|
|
25
|
+
className: "column-dnd"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: "Shareholder",
|
|
29
|
+
dataIndex: "shareholder",
|
|
30
|
+
editable: !state.readonly
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "Share Type",
|
|
34
|
+
dataIndex: "class",
|
|
35
|
+
editable: !state.readonly
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: "Shares",
|
|
39
|
+
dataIndex: "shares",
|
|
40
|
+
editable: !state.readonly
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
const columnsAllList = [
|
|
44
|
+
...columnsList,
|
|
45
|
+
{
|
|
46
|
+
title: "Currency",
|
|
47
|
+
dataIndex: "currency",
|
|
48
|
+
editable: !state.readonly
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: "Consideration",
|
|
52
|
+
dataIndex: "consideration",
|
|
53
|
+
editable: !state.readonly
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
const components = {
|
|
57
|
+
body: {
|
|
58
|
+
row: DragTableRow,
|
|
59
|
+
cell: DragTableCell
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const columns = (data.transactionType === "Allotment" ? columnsAllList : columnsList).map(col => {
|
|
63
|
+
return {
|
|
64
|
+
...col,
|
|
65
|
+
onCell: (record, rowIndex) => {
|
|
66
|
+
return {
|
|
67
|
+
record,
|
|
68
|
+
editable: col.editable,
|
|
69
|
+
dataIndex: col.dataIndex,
|
|
70
|
+
rowIndex: rowIndex,
|
|
71
|
+
onAdd,
|
|
72
|
+
onDel
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
state.invoiceLines = toJS(data.lines);
|
|
79
|
+
}, [data.lines]);
|
|
80
|
+
return useObserver(() => (React.createElement(TableDataContext.Provider, { value: state },
|
|
81
|
+
React.createElement(DndProvider, { backend: HTML5Backend },
|
|
82
|
+
React.createElement(Table, { components: components, pagination: false, bordered: true, dataSource: state.invoiceLines, columns: columns, rowKey: "id", onRow: (record, index) => ({
|
|
83
|
+
index,
|
|
84
|
+
moveAfter: moveAfter,
|
|
85
|
+
onMouseEnter: () => (state.hoverKey = index),
|
|
86
|
+
onMouseLeave: () => (state.hoverKey = -1)
|
|
87
|
+
}), footer: () => (React.createElement(React.Fragment, null,
|
|
88
|
+
React.createElement("div", { className: "operate" }, !state.readonly && (React.createElement(React.Fragment, null,
|
|
89
|
+
React.createElement(Button, { type: "link", onClick: onAdd }, "Add an item"),
|
|
90
|
+
React.createElement(Button, { type: "link", className: "cancel", onClick: getSharesTransaction }, "Reset"),
|
|
91
|
+
React.createElement(Button, { loading: state.loading, disabled: isEqual(toJS(state.invoiceLines), toJS(data.lines)), type: "link", onClick: onSave }, "Save")))),
|
|
92
|
+
React.createElement("div", { className: "total" },
|
|
93
|
+
"TOTAL",
|
|
94
|
+
React.createElement("span", null, state.sharesTotal.toLocaleString(undefined, {
|
|
95
|
+
minimumFractionDigits: 2
|
|
96
|
+
}))),
|
|
97
|
+
data.transactionType === "Allotment" && (React.createElement("div", { className: "total" },
|
|
98
|
+
"TOTAL",
|
|
99
|
+
React.createElement("span", null, state.considerationTotal.toLocaleString(undefined, {
|
|
100
|
+
minimumFractionDigits: 2
|
|
101
|
+
})))))) })))));
|
|
102
|
+
/** reload invoice */
|
|
103
|
+
function getSharesTransaction() {
|
|
104
|
+
const document = documents.items.get(data.id);
|
|
105
|
+
state.invoiceLines = clone(document.lines);
|
|
106
|
+
}
|
|
107
|
+
/** Add Invoice */
|
|
108
|
+
function onAdd() {
|
|
109
|
+
const id = Math.floor(Math.random() * 100000 + 1);
|
|
110
|
+
state.invoiceLines = [...state.invoiceLines, { id, added: true, ...state.InvoiceLine }];
|
|
111
|
+
}
|
|
112
|
+
/** */
|
|
113
|
+
function onDel(id) {
|
|
114
|
+
if (state.isAdding)
|
|
115
|
+
return (state.invoiceLines = state.invoiceLines.filter(line => line.id !== id));
|
|
116
|
+
return Modal.confirm({
|
|
117
|
+
title: "Do you want to delete this item?",
|
|
118
|
+
onOk() {
|
|
119
|
+
state.invoiceLines = state.invoiceLines.filter(line => line.id !== id);
|
|
120
|
+
onSave();
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
async function onSave() {
|
|
125
|
+
const Lines = state.invoiceLines.map(record => {
|
|
126
|
+
const { shareholder, consideration, currency, shares } = record;
|
|
127
|
+
return {
|
|
128
|
+
Shareholder: shareholder.name,
|
|
129
|
+
Consideration: consideration,
|
|
130
|
+
Currency: currency,
|
|
131
|
+
Shares: shares,
|
|
132
|
+
Class: record.class
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
state.loading = true;
|
|
136
|
+
await shareStore.edit(data.id, { Lines }).catch(e => e);
|
|
137
|
+
state.loading = false;
|
|
138
|
+
getSharesTransaction();
|
|
139
|
+
}
|
|
140
|
+
function moveAfter(dragIndex, afterIndex) {
|
|
141
|
+
const dragRow = state.invoiceLines[dragIndex];
|
|
142
|
+
state.invoiceLines = update(state.invoiceLines, {
|
|
143
|
+
$splice: [
|
|
144
|
+
[dragIndex, 1],
|
|
145
|
+
[afterIndex, 0, dragRow]
|
|
146
|
+
]
|
|
147
|
+
});
|
|
148
|
+
onSave();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
export default ShareTransactionItems;
|
|
152
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/legalEntity/shareTransactionsRegister/ShareTransactionItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAGN,wBAAwB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ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,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;YAChE,OAAO;gBACN,WAAW,EAAE,WAAW,CAAC,IAAI;gBAC7B,aAAa,EAAE,aAAa;gBAC5B,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,MAAM,CAAC,KAAK;aACnB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;QACtB,oBAAoB,EAAE,CAAC;IACxB,CAAC;IACD,SAAS,SAAS,CAAC,SAAiB,EAAE,UAAkB;QACvD,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC9C,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE;YAC/C,OAAO,EAAE;gBACR,CAAC,SAAS,EAAE,CAAC,CAAC;gBACd,CAAC,UAAU,EAAE,CAAC,EAAE,OAAO,CAAC;aACxB;SACD,CAAC,CAAC;QACH,MAAM,EAAE,CAAC;IACV,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { FilterViewContext, FilterViewContextState } from "@voplus/morpho-ui/es/data/FilterViewContext";
|
|
3
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data/ListDataContext";
|
|
4
|
+
import React, { useEffect, useState } from "react";
|
|
5
|
+
import { useShareTransactionListEffect, useShareTransactionStore } from "../../../../data/shareTransaction";
|
|
6
|
+
import { useAutoUpdateListData, useDocumentStore } from "@voplus/morpho-document";
|
|
7
|
+
import FilterView from "@voplus/morpho-ui/es/controls/FilterView";
|
|
8
|
+
import { Input } from "@voplus/antd";
|
|
9
|
+
import ListView2 from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
10
|
+
import { LoadingOutlined } from "@ant-design/icons";
|
|
11
|
+
import ShareTransactionItem from "../ShareTransactionItem";
|
|
12
|
+
import { State } from "./state";
|
|
13
|
+
import TransactionTypeDropdown from "../TransactionTypeDropdown";
|
|
14
|
+
import TransactionTypeFilter from "../TransactionTypeFilter";
|
|
15
|
+
import { useDeepMemo } from "@voplus/morpho-data";
|
|
16
|
+
import { useObserver } from "mobx-react-lite";
|
|
17
|
+
import { useRenderOnChange } from "@voplus/morpho-ui";
|
|
18
|
+
const ShareTransactionList = (props) => {
|
|
19
|
+
const { parentId, readonly } = props;
|
|
20
|
+
const shareStore = useShareTransactionStore();
|
|
21
|
+
const documentStore = useDocumentStore();
|
|
22
|
+
const list = useCreateListDataState({
|
|
23
|
+
filterDefaults: {
|
|
24
|
+
filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: parentId }]
|
|
25
|
+
}
|
|
26
|
+
}, [parentId]);
|
|
27
|
+
const [filterViewState] = useState(new FilterViewContextState());
|
|
28
|
+
const state = useDeepMemo(() => new State(), []);
|
|
29
|
+
useAutoUpdateListData(list, d => d.type === "ShareTransaction");
|
|
30
|
+
useRenderOnChange(() => list.filters.options);
|
|
31
|
+
useShareTransactionListEffect(list, result => list.union(result), list.filters.options);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
filterViewState.customize = { transactionTypes: [] };
|
|
34
|
+
}, []);
|
|
35
|
+
return useObserver(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
36
|
+
React.createElement(FilterViewContext.Provider, { value: filterViewState },
|
|
37
|
+
React.createElement(ListView2, { headerProps: {
|
|
38
|
+
viewTitle: "ShareTransaction List",
|
|
39
|
+
header: (React.createElement("div", { className: "shareTransaction-list-header" },
|
|
40
|
+
React.createElement("div", { className: "view-title" }, "ShareTransaction List"),
|
|
41
|
+
React.createElement("div", null,
|
|
42
|
+
React.createElement(FilterView, { onFilter: onFilter },
|
|
43
|
+
React.createElement(TransactionTypeFilter, null)),
|
|
44
|
+
!readonly && React.createElement(TransactionTypeDropdown, { onSelect: onSelect })))),
|
|
45
|
+
sortable: false,
|
|
46
|
+
addAble: false
|
|
47
|
+
}, renderItem: ({ item, index, connectDragSource, checkbox }) => (React.createElement(ShareTransactionItem, { key: item.id, id: item.id, connectDragSource: connectDragSource, className: index === 0 ? "shareTransaction-item-first" : "" })), moveAfter: moveAfter })),
|
|
48
|
+
state.addAble && (React.createElement("div", { className: "create-shareTransaction-form" },
|
|
49
|
+
React.createElement(Input, { autoFocus: true, value: state.name, onChange: e => (state.name = e.target.value), placeholder: `Name of ${state.type} for ShareTransaction`, suffix: state.loading ? React.createElement(LoadingOutlined, null) : "", onPressEnter: onSave, onKeyDown: e => {
|
|
50
|
+
if (e.keyCode === 27)
|
|
51
|
+
state.addAble = false;
|
|
52
|
+
} }))))));
|
|
53
|
+
function onSelect(type) {
|
|
54
|
+
state.type = type;
|
|
55
|
+
state.addAble = !!type;
|
|
56
|
+
}
|
|
57
|
+
async function onSave() {
|
|
58
|
+
await shareStore.create({
|
|
59
|
+
ParentId: parentId,
|
|
60
|
+
Name: state.name,
|
|
61
|
+
TransactionType: state.type,
|
|
62
|
+
Currency: "SGD"
|
|
63
|
+
});
|
|
64
|
+
state.addAble = false;
|
|
65
|
+
state.name = "";
|
|
66
|
+
}
|
|
67
|
+
async function moveAfter(id, afterId) {
|
|
68
|
+
await documentStore.moveAfter(id, afterId);
|
|
69
|
+
}
|
|
70
|
+
function onFilter(value) {
|
|
71
|
+
list.reset();
|
|
72
|
+
const { customize } = value;
|
|
73
|
+
if (customize.transactionTypes && customize.transactionTypes.length)
|
|
74
|
+
list.filters.replace({
|
|
75
|
+
c: "TransactionType",
|
|
76
|
+
o: "contains",
|
|
77
|
+
v1: JSON.stringify(customize.transactionTypes),
|
|
78
|
+
l: "And"
|
|
79
|
+
});
|
|
80
|
+
if (!(filterViewState.customize && filterViewState.customize.transactionTypes))
|
|
81
|
+
filterViewState.customize = { transactionTypes: [] };
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export default ShareTransactionList;
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAEN,6BAA6B,EAC7B,wBAAwB,EACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAElF,OAAO,UAAU,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,SAAS,MAAM,2DAA2D,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,uBAAuB,MAAM,4BAA4B,CAAC;AACjE,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,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,CAAC;AACF,CAAC,CAAC;AACF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@import "~@voplus/antd/es/style/themes/default.less";
|
|
2
|
+
:global {
|
|
3
|
+
.create-shareTransaction-form {
|
|
4
|
+
padding: 10px 20px;
|
|
5
|
+
border-top: 1px solid @border-color-base;
|
|
6
|
+
:global {
|
|
7
|
+
.ant-input {
|
|
8
|
+
padding: 0;
|
|
9
|
+
border: 0;
|
|
10
|
+
box-shadow: none;
|
|
11
|
+
color: @heading-color;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from "mobx";
|
|
3
|
+
let State = /** @class */ (() => {
|
|
4
|
+
class State {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = "";
|
|
7
|
+
this.type = "Allotment";
|
|
8
|
+
this.addAble = false;
|
|
9
|
+
this.loading = false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
__decorate([
|
|
13
|
+
observable
|
|
14
|
+
], State.prototype, "name", void 0);
|
|
15
|
+
__decorate([
|
|
16
|
+
observable
|
|
17
|
+
], State.prototype, "type", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
observable
|
|
20
|
+
], State.prototype, "addAble", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
observable
|
|
23
|
+
], State.prototype, "loading", void 0);
|
|
24
|
+
return State;
|
|
25
|
+
})();
|
|
26
|
+
export { State };
|
|
27
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/legalEntity/shareTransactionsRegister/ShareTransactionList/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC;IAAA,MAAa,KAAK;QAAlB;YACoB,SAAI,GAAG,EAAE,CAAC;YACV,SAAI,GAAyB,WAAW,CAAC;YACzC,YAAO,GAAG,KAAK,CAAC;YAChB,YAAO,GAAG,KAAK,CAAC;QACpC,CAAC;KAAA;IAJY;QAAX,UAAU;uCAAkB;IACjB;QAAX,UAAU;uCAAiD;IAChD;QAAX,UAAU;0CAAwB;IACvB;QAAX,UAAU;0CAAwB;IACpC,YAAC;KAAA;SALY,KAAK"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { useRouteMatch } from "react-router";
|
|
4
|
+
import { useDocument, useDocumentStore } from "@voplus/morpho-document";
|
|
5
|
+
import { AsideContent } from "@voplus/morpho-ui";
|
|
6
|
+
import DocumentHeader from "@voplus/morpho-document/es/components/DocumentHeader";
|
|
7
|
+
import DocumentTabs from "@voplus/morpho-document/es/components/DocumentTabs";
|
|
8
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
9
|
+
import RichTextEditor from "@voplus/morpho-ui/es/controls/RichTextEditor";
|
|
10
|
+
import ShareTransactionList from "../ShareTransactionList";
|
|
11
|
+
import { Skeleton } from "@voplus/antd";
|
|
12
|
+
import ToolBar from "@voplus/morpho-document/es/controls/ToolBar";
|
|
13
|
+
import { faEdit } from "@fortawesome/pro-light-svg-icons";
|
|
14
|
+
import { useObserver } from "mobx-react-lite";
|
|
15
|
+
import { useTabItem } from "@voplus/morpho-data";
|
|
16
|
+
const ShareTransactionRegisterDefaultView = () => {
|
|
17
|
+
const match = useRouteMatch();
|
|
18
|
+
const id = match.params.id;
|
|
19
|
+
const [reload, setReload] = useState(true);
|
|
20
|
+
const shareTransaction = useDocument(id, { reload, includes: "tags" });
|
|
21
|
+
const documentStore = useDocumentStore();
|
|
22
|
+
const tab = useTabItem();
|
|
23
|
+
tab.title = (shareTransaction && shareTransaction.name) || "";
|
|
24
|
+
const [asideContext] = useState(AsideContent.createContext());
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
asideContext.openAside(AsideElement, { span: 12 });
|
|
27
|
+
}, []);
|
|
28
|
+
const AsideElement = (React.createElement("div", { className: "csp-default-view_aside" },
|
|
29
|
+
React.createElement(DocumentTabs, { id: id })));
|
|
30
|
+
return useObserver(() => (React.createElement(AsideContent, { context: asideContext },
|
|
31
|
+
React.createElement("div", { className: "csp-default-view share-transaction-register-view" },
|
|
32
|
+
React.createElement("div", { className: "share-transaction-register-header" }, !shareTransaction.loaded ? (React.createElement(Skeleton, { active: true })) : (React.createElement(React.Fragment, null,
|
|
33
|
+
React.createElement(DocumentHeader, { id: id, size: "h3", quickDataBarAlign: "left", tools: React.createElement(ToolBar, { id: id, includes: "tags", reload: true, expand: true, onExpand: () => asideContext.asideContent
|
|
34
|
+
? asideContext.closeAside()
|
|
35
|
+
: asideContext.openAside(AsideElement, { span: 12 }), onLock: () => documentStore.edit(id, { Status: "Readonly" }), onUnlock: () => documentStore.edit(id, { Status: "Normal" }), onReLoad: onReLoad }) }),
|
|
36
|
+
React.createElement(RichTextEditor, { readOnly: shareTransaction.readonly, editable: false, content: shareTransaction.description || "", placeholder: shareTransaction.readonly ? ("") : (React.createElement("span", null,
|
|
37
|
+
React.createElement(FAIcon, { icon: faEdit }),
|
|
38
|
+
"Add Description")), onSave: v => documentStore.edit(id, { Description: v }) })))),
|
|
39
|
+
reload && React.createElement(ShareTransactionList, { parentId: id, readonly: shareTransaction.readonly })))));
|
|
40
|
+
function onReLoad() {
|
|
41
|
+
setReload(false);
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
setReload(true);
|
|
44
|
+
}, 100);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export default ShareTransactionRegisterDefaultView;
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/legalEntity/shareTransactionsRegister/ShareTransactionRegisterDefa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AAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAC5D,QAAQ,EAAE,QAAQ,GACjB,GAEF;gBACF,oBAAC,cAAc,IACd,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,EACnC,QAAQ,EAAE,KAAK,EACf,OAAO,EAAE,gBAAgB,CAAC,WAAW,IAAI,EAAE,EAC3C,WAAW,EACV,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC3B,EAAE,CACF,CAAC,CAAC,CAAC,CACH;wBACC,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,GAAI;0CAElB,CACP,EAEF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,GACtD,CACc,CACjB,CACI;YAIL,MAAM,IAAI,oBAAC,oBAAoB,IAAC,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,GAAI,CAEjF,CACQ,CACf,CAAC,CAAC;IACH,SAAS,QAAQ;QAChB,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,UAAU,CAAC,GAAG,EAAE;YACf,SAAS,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,EAAE,GAAG,CAAC,CAAC;IACT,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@import "../../../../style/common.less";
|
|
2
|
+
:global {
|
|
3
|
+
.share-transaction-register-view {
|
|
4
|
+
.share-transaction-register-header {
|
|
5
|
+
padding: 10px 20px;
|
|
6
|
+
.document-header-default {
|
|
7
|
+
padding: 0;
|
|
8
|
+
margin-bottom: 0.5em;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
.shareTransaction-list-header {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex: 1;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
line-height: 21px;
|
|
16
|
+
color: #fff;
|
|
17
|
+
}
|
|
18
|
+
.share-transaction-loading {
|
|
19
|
+
padding: 10px 20px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const ShareholderSelector: (props: {
|
|
3
|
+
defaultValue: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
open: boolean;
|
|
8
|
+
onChange?: ((contact: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}) => void) | undefined;
|
|
12
|
+
}) => JSX.Element;
|
|
13
|
+
export default ShareholderSelector;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AutoComplete, Spin } from "@voplus/antd";
|
|
2
|
+
import { useContactListEffect } from "@voplus/morpho-org/es/data";
|
|
3
|
+
import React, { useEffect, useState } from "react";
|
|
4
|
+
import { LoadingOutlined } from "@ant-design/icons";
|
|
5
|
+
import { State } from "./state";
|
|
6
|
+
import { useObserver } from "mobx-react-lite";
|
|
7
|
+
const ShareholderSelector = (props) => {
|
|
8
|
+
const { defaultValue, open, onChange } = props;
|
|
9
|
+
// total contacts
|
|
10
|
+
const [state] = useState(new State());
|
|
11
|
+
const [items, setItems] = useState([]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
state.value = defaultValue;
|
|
14
|
+
}, [defaultValue]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
state.open = open;
|
|
17
|
+
}, [open]);
|
|
18
|
+
useContactListEffect(list => {
|
|
19
|
+
setItems(list);
|
|
20
|
+
state.loading = false;
|
|
21
|
+
});
|
|
22
|
+
// set or add a new selection to values
|
|
23
|
+
const selectOnSelect = (value, option) => {
|
|
24
|
+
state.value = { id: option.key, name: value };
|
|
25
|
+
if (onChange)
|
|
26
|
+
onChange(state.value);
|
|
27
|
+
};
|
|
28
|
+
return useObserver(() => (React.createElement(AutoComplete, { autoFocus: true, allowClear: true, open: state.open, defaultValue: defaultValue.name, filterOption: filterItems, onSelect: selectOnSelect, onChange: value => (state.value = { id: value, name: value }), onBlur: () => onChange && onChange(state.value), onDropdownVisibleChange: open => (state.open = open) }, state.loading ? (React.createElement(Spin, { indicator: React.createElement(LoadingOutlined, { spin: true }) })) : (items.map(contact => (React.createElement(AutoComplete.Option, { key: contact.id, value: contact.name, title: contact.name }, contact.name)))))));
|
|
29
|
+
function filterItems(input, option) {
|
|
30
|
+
return option.title.toLowerCase().includes(input.toLowerCase());
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export default ShareholderSelector;
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAY,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,mBAAmB,GAAG,CAAC,KAI5B,EAAE,EAAE;IACJ,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC/C,iBAAiB;IACjB,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAa,EAAE,CAAC,CAAC;IAEnD,SAA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oBAAC,eAAe,IAAC,IAAI,SAAG,GAAI,CAC7C,CAAC,CAAC,CAAC,CACH,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CACpB,oBAAC,YAAY,CAAC,MAAM,IAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,IAC5E,OAAO,CAAC,IAAI,CACQ,CACtB,CAAC,CACF,CACa,CACf,CAAC,CAAC;IACH,SAAS,WAAW,CAAC,KAAU,EAAE,MAAW;QAC3C,OAAQ,MAAM,CAAC,KAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7E,CAAC;AACF,CAAC,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from "mobx";
|
|
3
|
+
let State = /** @class */ (() => {
|
|
4
|
+
class State {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.value = { id: "", name: "" };
|
|
7
|
+
this.loading = true;
|
|
8
|
+
this.open = false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
__decorate([
|
|
12
|
+
observable
|
|
13
|
+
], State.prototype, "value", void 0);
|
|
14
|
+
__decorate([
|
|
15
|
+
observable
|
|
16
|
+
], State.prototype, "loading", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
observable
|
|
19
|
+
], State.prototype, "open", void 0);
|
|
20
|
+
return State;
|
|
21
|
+
})();
|
|
22
|
+
export { State };
|
|
23
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/legalEntity/shareTransactionsRegister/ShareholderSelector/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC;IAAA,MAAa,KAAK;QAAlB;YACa,UAAK,GAAiC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;YACpD,YAAO,GAAG,IAAI,CAAC;YACf,SAAI,GAAG,KAAK,CAAC;QACjC,CAAC;KAAA;IAHY;QAAX,UAAU;wCAA4D;IAC3D;QAAX,UAAU;0CAAuB;IACtB;QAAX,UAAU;uCAAqB;IACjC,YAAC;KAAA;SAJY,KAAK"}
|