@voplus/morpho-csp 10.0.24 → 10.0.25
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/identity/identity-events/index.d.ts +6 -3
- package/es/data/identity/identity-events/index.js +6 -3
- package/es/data/identity/identity-events/index.js.map +1 -1
- package/es/data/identity/index.d.ts +6 -4
- package/es/data/identity/index.js +6 -4
- package/es/data/identity/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/ContactIdentitySelectDialog/index.d.ts +7 -9
- package/es/modules/corporate/company/identity/components/ContactIdentitySelectDialog/index.js +7 -64
- package/es/modules/corporate/company/identity/components/ContactIdentitySelectDialog/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/IdentifyDetail/index.d.ts +7 -14
- package/es/modules/corporate/company/identity/components/IdentifyDetail/index.js +7 -71
- package/es/modules/corporate/company/identity/components/IdentifyDetail/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/IdentifyProperties/index.d.ts +7 -11
- package/es/modules/corporate/company/identity/components/IdentifyProperties/index.js +7 -61
- package/es/modules/corporate/company/identity/components/IdentifyProperties/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/IdentifyQuickViewDialog/index.d.ts +7 -9
- package/es/modules/corporate/company/identity/components/IdentifyQuickViewDialog/index.js +7 -27
- package/es/modules/corporate/company/identity/components/IdentifyQuickViewDialog/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/IdentityChange/index.d.ts +7 -8
- package/es/modules/corporate/company/identity/components/IdentityChange/index.js +7 -28
- package/es/modules/corporate/company/identity/components/IdentityChange/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/IdentityInformation/index.d.ts +7 -5
- package/es/modules/corporate/company/identity/components/IdentityInformation/index.js +7 -62
- package/es/modules/corporate/company/identity/components/IdentityInformation/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/IdentityItem/index.d.ts +7 -8
- package/es/modules/corporate/company/identity/components/IdentityItem/index.js +7 -38
- package/es/modules/corporate/company/identity/components/IdentityItem/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/index.d.ts +7 -8
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/index.js +7 -18
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/index.js.map +1 -1
- package/es/modules/corporate/company/identity/controls/IdentityMenu/index.d.ts +7 -10
- package/es/modules/corporate/company/identity/controls/IdentityMenu/index.js +7 -15
- package/es/modules/corporate/company/identity/controls/IdentityMenu/index.js.map +1 -1
- package/package.json +2 -1
- package/es/data/identity/IdentityStore.d.ts +0 -35
- package/es/data/identity/IdentityStore.js +0 -119
- package/es/data/identity/IdentityStore.js.map +0 -1
- package/es/data/identity/hooks.d.ts +0 -6
- package/es/data/identity/hooks.js +0 -14
- package/es/data/identity/hooks.js.map +0 -1
- package/es/data/identity/identity-events/useAutoUpdateListData.d.ts +0 -4
- package/es/data/identity/identity-events/useAutoUpdateListData.js +0 -13
- package/es/data/identity/identity-events/useAutoUpdateListData.js.map +0 -1
- package/es/data/identity/identity-events/useOnDeleteIdentity.d.ts +0 -4
- package/es/data/identity/identity-events/useOnDeleteIdentity.js +0 -16
- package/es/data/identity/identity-events/useOnDeleteIdentity.js.map +0 -1
- package/es/data/identity/identity-events/useOnNewIdentity.d.ts +0 -4
- package/es/data/identity/identity-events/useOnNewIdentity.js +0 -16
- package/es/data/identity/identity-events/useOnNewIdentity.js.map +0 -1
- package/es/data/identity/interfaces.d.ts +0 -26
- package/es/data/identity/interfaces.js +0 -2
- package/es/data/identity/interfaces.js.map +0 -1
- package/es/data/identity/types.d.ts +0 -50
- package/es/data/identity/types.js +0 -2
- package/es/data/identity/types.js.map +0 -1
- package/es/modules/corporate/company/identity/components/ContactIdentitySelectDialog/index.css +0 -89
- package/es/modules/corporate/company/identity/components/IdentifyDetail/index.css +0 -76
- package/es/modules/corporate/company/identity/components/IdentifyProperties/index.css +0 -67
- package/es/modules/corporate/company/identity/components/IdentifyQuickViewDialog/index.css +0 -44
- package/es/modules/corporate/company/identity/components/IdentityInformation/state.d.ts +0 -14
- package/es/modules/corporate/company/identity/components/IdentityInformation/state.js +0 -94
- package/es/modules/corporate/company/identity/components/IdentityInformation/state.js.map +0 -1
- package/es/modules/corporate/company/identity/components/IdentityItem/index.css +0 -45
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step1.d.ts +0 -6
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step1.js +0 -40
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step1.js.map +0 -1
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step2.d.ts +0 -3
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step2.js +0 -52
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step2.js.map +0 -1
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step3.d.ts +0 -3
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step3.js +0 -46
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/Step3.js.map +0 -1
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/index.css +0 -65
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/state.d.ts +0 -44
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/state.js +0 -188
- package/es/modules/corporate/company/identity/components/NewIdentityDialog/state.js.map +0 -1
- package/es/modules/corporate/company/identity/controls/IdentityMenu/index.css +0 -32
|
@@ -1,63 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { FontAwesomeIcon as FAIcon, faPenLineRegular } from "@voplus/morpho-ui/es/faIcons";
|
|
9
|
-
import { InputCountry, observe, UTCDatePicker as DatePicker } from "@voplus/morpho-ui";
|
|
10
|
-
import { useIdentity, useIdentityStore } from "../../../../../../data/identity";
|
|
11
|
-
import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
|
|
12
|
-
const IdentityInformation = (props) => {
|
|
13
|
-
const { id } = props;
|
|
14
|
-
const identityStore = useIdentityStore();
|
|
15
|
-
const state = useMemo(() => new State(id, identityStore), [id]);
|
|
16
|
-
const identity = useIdentity(id, { reload: true, includes: "permissions" });
|
|
17
|
-
const { user } = useApplicationContext();
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
when(() => identity.loaded === true, () => state.reset(identity));
|
|
20
|
-
}, [id]);
|
|
21
|
-
return observe(() => (React.createElement("div", { className: "identity-information" },
|
|
22
|
-
React.createElement(Skeleton, { active: true, loading: !identity.loaded },
|
|
23
|
-
React.createElement("div", { className: "identity-information-content" },
|
|
24
|
-
React.createElement("div", { className: "identity-information-title" },
|
|
25
|
-
React.createElement("h3", null, "Identity Information"),
|
|
26
|
-
user.can("edit", identity.p) && (React.createElement("div", null, state.editable ? (React.createElement(React.Fragment, null,
|
|
27
|
-
React.createElement(Button, { type: "text", onClick: () => state.reset(identity) }, "Cancel"),
|
|
28
|
-
React.createElement(Button, { type: "link", loading: state.loading, onClick: state.onOk }, "Ok"))) : (React.createElement(Tooltip, { title: "Edit" },
|
|
29
|
-
React.createElement(Button, { type: "link", onClick: onEdit },
|
|
30
|
-
React.createElement(FAIcon, { icon: faPenLineRegular, style: { fontSize: "12px" } }))))))),
|
|
31
|
-
React.createElement(Scrollbars, { autoHide: true },
|
|
32
|
-
React.createElement(Form, { className: "identity-information-info", labelAlign: "left", labelCol: { span: 10 } },
|
|
33
|
-
React.createElement(Form.Item, { label: "Full Name", rules: [{ required: true }] }, state.editable ? (React.createElement(Input, { value: state.value.FullName, onChange: (e) => {
|
|
34
|
-
state.value.FullName = e.target.value;
|
|
35
|
-
} })) : (identity.fullName)),
|
|
36
|
-
React.createElement(Form.Item, { label: "Country / Nationality", rules: [{ required: true }] }, state.editable ? (React.createElement(InputCountry, { defaultValue: state.value.Country, onChange: (v) => (state.value.Country = v) })) : (identity.country)),
|
|
37
|
-
identity.type === "IdentityCard" ? (React.createElement(Form.Item, { label: "Issuing Country", rules: [{ required: true }] }, state.editable ? (React.createElement(InputCountry, { defaultValue: state.value.IssuingCountry, onChange: (v) => (state.value.IssuingCountry = v) })) : (identity.issuingCountry))) : null,
|
|
38
|
-
React.createElement(Form.Item, { label: "Identity Type", rules: [{ required: true }] }, state.editable ? (React.createElement(Select, { value: state.value.Type, onChange: (v) => {
|
|
39
|
-
state.value.Type = v;
|
|
40
|
-
}, options: [
|
|
41
|
-
{ value: "Passport", label: "International Passport" },
|
|
42
|
-
{ value: "IdentityCard", label: "Identify Card" },
|
|
43
|
-
{ value: "BusinessRegistration", label: "Business Registration" },
|
|
44
|
-
] })) : (identity.type)),
|
|
45
|
-
React.createElement(Form.Item, { label: "Identity #", rules: [{ required: true }] }, state.editable ? (React.createElement(Input, { value: state.value.Number, onChange: (e) => {
|
|
46
|
-
state.value.Number = e.target.value;
|
|
47
|
-
} })) : (identity.number)),
|
|
48
|
-
React.createElement(Form.Item, { label: "Expiry Date",
|
|
49
|
-
// name="expiryDate"
|
|
50
|
-
rules: [{ required: state.value.Type === "Passport" }] }, state.editable ? (React.createElement(DatePicker, { style: { width: "100%" }, defaultValue: state.value.ExpiryDate ? utcdayjs(state.value.ExpiryDate) : undefined, onChange: (date, dateString) => (state.value.ExpiryDate = dateString) })) : (React.createElement(UTCShortDate, { value: identity.expiryDate }))))))))));
|
|
51
|
-
/** hover edit IdentityInformation */
|
|
52
|
-
// spec:1799 — CSP: Identity Information edit requires permission and reveals number on entry
|
|
53
|
-
async function onEdit() {
|
|
54
|
-
if (!state.value.Number) {
|
|
55
|
-
await identityStore.reveal(id).then((res) => {
|
|
56
|
-
state.value.Number = res.number;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
state.editable = user.can("edit", identity.p);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
export default IdentityInformation;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import { IdentityInformation } from "@voplus/morpho-compliance" instead. This
|
|
3
|
+
* component moved to its own package; this compatibility re-export will be removed in a
|
|
4
|
+
* future release.
|
|
5
|
+
*/
|
|
6
|
+
export * from "@voplus/morpho-compliance/es/components/IdentityInformation";
|
|
7
|
+
export { default } from "@voplus/morpho-compliance/es/components/IdentityInformation";
|
|
63
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityInformation/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityInformation/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,6DAA6D,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,6DAA6D,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export default IdentityItem;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import { IdentityItem } from "@voplus/morpho-compliance" instead. This
|
|
3
|
+
* component moved to its own package; this compatibility re-export will be removed in a
|
|
4
|
+
* future release.
|
|
5
|
+
*/
|
|
6
|
+
export * from "@voplus/morpho-compliance/es/components/IdentityItem";
|
|
7
|
+
export { default } from "@voplus/morpho-compliance/es/components/IdentityItem";
|
|
@@ -1,39 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import classnames from "classnames";
|
|
9
|
-
import "./index.css";
|
|
10
|
-
const IdentityItem = (props) => {
|
|
11
|
-
const { id, active } = props;
|
|
12
|
-
const identity = useIdentity(id);
|
|
13
|
-
const identityStore = useIdentityStore();
|
|
14
|
-
const [hover, setHover] = useState(false);
|
|
15
|
-
let currentTime = new Date().getTime();
|
|
16
|
-
return observe(() => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
return (React.createElement("div", { className: classnames("identity-item", { active: active }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) },
|
|
19
|
-
React.createElement("div", { className: "identity-info" },
|
|
20
|
-
React.createElement("div", { className: "identity-name" },
|
|
21
|
-
identity.fullName, (_a = identity.number) === null || _a === void 0 ? void 0 :
|
|
22
|
-
_a.toString().slice(-4).padStart((_b = identity.number) === null || _b === void 0 ? void 0 : _b.toString().length, "*")),
|
|
23
|
-
React.createElement("div", { className: "identity-data" },
|
|
24
|
-
identity.country && (React.createElement("span", null,
|
|
25
|
-
React.createElement(FAIcon, { icon: faLocationCircleRegular }),
|
|
26
|
-
identity.country)),
|
|
27
|
-
identity.type && (React.createElement("span", { className: "margin-left-15" },
|
|
28
|
-
React.createElement(FAIcon, { icon: faPassportRegular }),
|
|
29
|
-
identity.type)))),
|
|
30
|
-
currentTime > new Date(identity.expiryDate).getTime() && !hover && (React.createElement(Badge, { status: "error", text: "Expired" })),
|
|
31
|
-
React.createElement("div", { className: classnames("hover-operate-icon", {
|
|
32
|
-
show: hover,
|
|
33
|
-
}) },
|
|
34
|
-
React.createElement(ToolBar, { id: id, showMenu: false },
|
|
35
|
-
React.createElement(Delete, { action: () => identityStore.delete(id) })))));
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
export default IdentityItem;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import { IdentityItem } from "@voplus/morpho-compliance" instead. This
|
|
3
|
+
* component moved to its own package; this compatibility re-export will be removed in a
|
|
4
|
+
* future release.
|
|
5
|
+
*/
|
|
6
|
+
export * from "@voplus/morpho-compliance/es/components/IdentityItem";
|
|
7
|
+
export { default } from "@voplus/morpho-compliance/es/components/IdentityItem";
|
|
39
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityItem/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityItem/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,sDAAsD,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sDAAsD,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export default NewIdentityDialog;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import { NewIdentityDialog } from "@voplus/morpho-compliance" instead. This
|
|
3
|
+
* component moved to its own package; this compatibility re-export will be removed in a
|
|
4
|
+
* future release.
|
|
5
|
+
*/
|
|
6
|
+
export * from "@voplus/morpho-compliance/es/components/NewIdentityDialog";
|
|
7
|
+
export { default } from "@voplus/morpho-compliance/es/components/NewIdentityDialog";
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { observe } from "@voplus/morpho-ui";
|
|
9
|
-
import { useUnit } from "@voplus/morpho-org";
|
|
10
|
-
const NewIdentityDialog = (props) => {
|
|
11
|
-
const { id, visible, updateVisible } = props;
|
|
12
|
-
const [state] = useState(new State());
|
|
13
|
-
const unit = useUnit(id);
|
|
14
|
-
state.props = props;
|
|
15
|
-
return observe(() => (React.createElement(LegalContext.Provider, { value: state },
|
|
16
|
-
React.createElement(Modal, { width: 500, title: "", footer: null, wrapClassName: "select-legal-contact-dialog", onCancel: () => updateVisible === null || updateVisible === void 0 ? void 0 : updateVisible(), open: visible }, state.step === 3 ? (React.createElement(Step3, null)) : state.step === 2 ? (React.createElement(Step2, null)) : (React.createElement(Step1, { unitId: unit.id, type: unit.type }))))));
|
|
17
|
-
};
|
|
18
|
-
export default NewIdentityDialog;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import { NewIdentityDialog } from "@voplus/morpho-compliance" instead. This
|
|
3
|
+
* component moved to its own package; this compatibility re-export will be removed in a
|
|
4
|
+
* future release.
|
|
5
|
+
*/
|
|
6
|
+
export * from "@voplus/morpho-compliance/es/components/NewIdentityDialog";
|
|
7
|
+
export { default } from "@voplus/morpho-compliance/es/components/NewIdentityDialog";
|
|
19
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/NewIdentityDialog/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/NewIdentityDialog/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,2DAA2D,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,2DAA2D,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
icon?: React.ReactNode;
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
export default IdentityMenu;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import { IdentityMenu } from "@voplus/morpho-compliance" instead. This
|
|
3
|
+
* component moved to its own package; this compatibility re-export will be removed in a
|
|
4
|
+
* future release.
|
|
5
|
+
*/
|
|
6
|
+
export * from "@voplus/morpho-compliance/es/components/IdentityMenu";
|
|
7
|
+
export { default } from "@voplus/morpho-compliance/es/components/IdentityMenu";
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const IdentityMenu = (props) => {
|
|
9
|
-
const store = useIdentityStore();
|
|
10
|
-
return observe(() => (React.createElement(NodeMenu, { id: props.id, icon: props.icon, store: store, menus: React.createElement(React.Fragment, null,
|
|
11
|
-
React.createElement(Access, null),
|
|
12
|
-
React.createElement(SubPasteNodeMenu, { style: { left: "-170px" } }),
|
|
13
|
-
React.createElement(Delete, null)) })));
|
|
14
|
-
};
|
|
15
|
-
export default IdentityMenu;
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import { IdentityMenu } from "@voplus/morpho-compliance" instead. This
|
|
3
|
+
* component moved to its own package; this compatibility re-export will be removed in a
|
|
4
|
+
* future release.
|
|
5
|
+
*/
|
|
6
|
+
export * from "@voplus/morpho-compliance/es/components/IdentityMenu";
|
|
7
|
+
export { default } from "@voplus/morpho-compliance/es/components/IdentityMenu";
|
|
16
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/controls/IdentityMenu/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/controls/IdentityMenu/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,sDAAsD,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sDAAsD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voplus/morpho-csp",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.25",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://voplus.visualstudio.com/morpho-csp/_git/morpho-csp"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@voplus/morpho-collaboration-action": "10.x",
|
|
32
|
+
"@voplus/morpho-compliance": "10.x",
|
|
32
33
|
"@voplus/morpho-document": "10.x",
|
|
33
34
|
"@voplus/morpho-finance": "10.x",
|
|
34
35
|
"@voplus/morpho-form": "10.x",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ApiEndPoint } from "@voplus/api";
|
|
2
|
-
import { CountedMap, Store, StoreActionOptions } from "@voplus/morpho-data";
|
|
3
|
-
import { IdentityCreateOptions, IdentityEditOptions, LoadIdentityOptions } from "./types";
|
|
4
|
-
import { IIdentity } from "./interfaces";
|
|
5
|
-
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
6
|
-
/** Quotation store supply backend functions. */
|
|
7
|
-
export declare class IdentityStore extends Store {
|
|
8
|
-
readonly endpoint: ApiEndPoint;
|
|
9
|
-
/** Name of the store */
|
|
10
|
-
readonly name: string;
|
|
11
|
-
private readonly _identityDeleted;
|
|
12
|
-
private readonly _identityCreated;
|
|
13
|
-
constructor(endpoint: ApiEndPoint);
|
|
14
|
-
/** All currently used identity. */
|
|
15
|
-
readonly items: CountedMap<string, IIdentity>;
|
|
16
|
-
/** Event fires when a delete identity has been deleted. */
|
|
17
|
-
get IdentityDeletedEvent(): import("ste-events").IEvent<IdentityStore, IIdentity>;
|
|
18
|
-
/** Event fires when a new Identity has been created. */
|
|
19
|
-
get IdentityCreatedEvent(): import("ste-events").IEvent<IdentityStore, IIdentity>;
|
|
20
|
-
/** Create a new Identity. */
|
|
21
|
-
create(options: IdentityCreateOptions): Promise<IIdentity>;
|
|
22
|
-
/** Edit an existing item on server. */
|
|
23
|
-
edit(id: string, options: IdentityEditOptions): Promise<any>;
|
|
24
|
-
delete(id: string, options?: any): Promise<IIdentity>;
|
|
25
|
-
reveal(id: string, options?: StoreActionOptions): Promise<{
|
|
26
|
-
number: string;
|
|
27
|
-
}>;
|
|
28
|
-
/** Load a list of documents from server.
|
|
29
|
-
* @param {LoadDocumentListOptions}
|
|
30
|
-
*/
|
|
31
|
-
loadList(options?: LoadDocumentListOptions): Promise<IIdentity[]>;
|
|
32
|
-
load(id: string, options: LoadIdentityOptions): Promise<IIdentity>;
|
|
33
|
-
}
|
|
34
|
-
/** 响应钩子检索 IdentityStore */
|
|
35
|
-
export declare const useIdentityStore: () => IdentityStore;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { RequestBuilder } from "@voplus/api";
|
|
2
|
-
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
3
|
-
import { EventDispatcher } from "strongly-typed-events";
|
|
4
|
-
import { observable } from "mobx";
|
|
5
|
-
const StoreName = "IdentityStore";
|
|
6
|
-
/** Quotation store supply backend functions. */
|
|
7
|
-
export class IdentityStore extends Store {
|
|
8
|
-
constructor(endpoint) {
|
|
9
|
-
super();
|
|
10
|
-
Object.defineProperty(this, "endpoint", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true,
|
|
14
|
-
value: endpoint
|
|
15
|
-
});
|
|
16
|
-
/** Name of the store */
|
|
17
|
-
Object.defineProperty(this, "name", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: StoreName
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(this, "_identityDeleted", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: new EventDispatcher()
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(this, "_identityCreated", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: new EventDispatcher()
|
|
34
|
-
});
|
|
35
|
-
/** All currently used identity. */
|
|
36
|
-
Object.defineProperty(this, "items", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
configurable: true,
|
|
39
|
-
writable: true,
|
|
40
|
-
value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
/** Event fires when a delete identity has been deleted. */
|
|
44
|
-
get IdentityDeletedEvent() {
|
|
45
|
-
return this._identityDeleted.asEvent();
|
|
46
|
-
}
|
|
47
|
-
/** Event fires when a new Identity has been created. */
|
|
48
|
-
get IdentityCreatedEvent() {
|
|
49
|
-
return this._identityCreated.asEvent();
|
|
50
|
-
}
|
|
51
|
-
/** Create a new Identity. */
|
|
52
|
-
async create(options) {
|
|
53
|
-
// invariant(options.name, "Name cannot be empty.");
|
|
54
|
-
return this.action(async () => {
|
|
55
|
-
const r = await this.endpoint.post(`/api/identities/create`, new RequestBuilder().json(options.data));
|
|
56
|
-
const t = (await r.json());
|
|
57
|
-
this._identityCreated.dispatch(this, t);
|
|
58
|
-
return t;
|
|
59
|
-
}, options);
|
|
60
|
-
}
|
|
61
|
-
/** Edit an existing item on server. */
|
|
62
|
-
async edit(id, options) {
|
|
63
|
-
return this.action(async () => {
|
|
64
|
-
const r = await this.endpoint.post(`/api/identities/${id}`, new RequestBuilder().json(options.data));
|
|
65
|
-
const t = await r.json();
|
|
66
|
-
this.items.overwrite(t.id, t);
|
|
67
|
-
return t;
|
|
68
|
-
}, options);
|
|
69
|
-
}
|
|
70
|
-
async delete(id, options) {
|
|
71
|
-
await this.action(async () => {
|
|
72
|
-
await this.endpoint.delete(`/api/identities/${id}`);
|
|
73
|
-
}, options);
|
|
74
|
-
const item = this.items.peek(id);
|
|
75
|
-
if (item) {
|
|
76
|
-
this._identityDeleted.dispatch(this, item);
|
|
77
|
-
}
|
|
78
|
-
return item;
|
|
79
|
-
}
|
|
80
|
-
async reveal(id, options) {
|
|
81
|
-
return this.action(async () => {
|
|
82
|
-
const r = await this.endpoint.get(`/api/identities/reveal/${id}`);
|
|
83
|
-
const t = await r.json();
|
|
84
|
-
this.items.overwrite(t.id, t);
|
|
85
|
-
return t;
|
|
86
|
-
}, options !== null && options !== void 0 ? options : {});
|
|
87
|
-
}
|
|
88
|
-
/** Load a list of documents from server.
|
|
89
|
-
* @param {LoadDocumentListOptions}
|
|
90
|
-
*/
|
|
91
|
-
async loadList(options) {
|
|
92
|
-
let query = "";
|
|
93
|
-
if (options === null || options === void 0 ? void 0 : options.Includes) {
|
|
94
|
-
query = query.concat(`includes=${options.Includes}`);
|
|
95
|
-
}
|
|
96
|
-
if (query)
|
|
97
|
-
query = "?".concat(query);
|
|
98
|
-
const r = await this.endpoint.post(`/api/identities${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
|
|
99
|
-
return (await r.json());
|
|
100
|
-
}
|
|
101
|
-
async load(id, options) {
|
|
102
|
-
let query = "";
|
|
103
|
-
if (options.includes)
|
|
104
|
-
query = query.concat(`includes=${options.includes}`);
|
|
105
|
-
if (query)
|
|
106
|
-
query = "?".concat(query);
|
|
107
|
-
const r = await this.endpoint.get(`/api/identities/${id}${query}`);
|
|
108
|
-
return await r.json();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/** 响应钩子检索 IdentityStore */
|
|
112
|
-
export const useIdentityStore = () => {
|
|
113
|
-
const context = useApplicationContext();
|
|
114
|
-
if (!context.getService(StoreName)) {
|
|
115
|
-
context.registerService(new IdentityStore(context.api.currentEndPoint));
|
|
116
|
-
}
|
|
117
|
-
return context.getService(StoreName);
|
|
118
|
-
};
|
|
119
|
-
//# sourceMappingURL=IdentityStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityStore.js","sourceRoot":"","sources":["../../../src/data/identity/IdentityStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAsB,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGnG,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,gDAAgD;AAChD,MAAM,OAAO,aAAc,SAAQ,KAAK;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,GAAG,GAAG,EAAE;IACpC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,eAAe,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,CAAmB,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
2
|
-
import { IIdentity } from "./interfaces";
|
|
3
|
-
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
4
|
-
import { LoadIdentityOptions } from ".";
|
|
5
|
-
export declare const useIdentity: (id: string, options?: LoadIdentityOptions) => IIdentity;
|
|
6
|
-
export declare const useIdentityListEffect: (list: ListDataContextState<IIdentity> | null, effect: (list: any[]) => void, options?: LoadDocumentListOptions) => void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useListLoaderEffect } from "@voplus/morpho-ui/es/hooks";
|
|
2
|
-
import { useIdentityStore } from "./IdentityStore";
|
|
3
|
-
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
4
|
-
export const useIdentity = (id, options) => {
|
|
5
|
-
options = options ? options : {};
|
|
6
|
-
const store = useIdentityStore();
|
|
7
|
-
return useLoadCountedMapItem(id, store.items, (calculatedOptions) => store.load(id, calculatedOptions), options);
|
|
8
|
-
};
|
|
9
|
-
export const useIdentityListEffect = (list, effect, options) => {
|
|
10
|
-
const deps = options ? options : {};
|
|
11
|
-
const store = useIdentityStore();
|
|
12
|
-
return useListLoaderEffect(list, store.items, effect, () => store.loadList(options), [deps]);
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/identity/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,OAA6B,EAAE,EAAE;IACxE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA0B,CAAC;IAC1D,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IAEjC,OAAO,qBAAqB,CAC3B,EAAE,EACF,KAAK,CAAC,KAAK,EACX,CAAC,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,iBAAiB,CAAC,EACxD,OAAO,CACP,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA4C,EAC5C,MAA6B,EAC7B,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IIdentity } from "../interfaces";
|
|
2
|
-
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
3
|
-
/** React hook to call action when a new Identity has been created. */
|
|
4
|
-
export declare const useAutoUpdateListData: (list: ListDataContextState<any>, shouldUpdate: (d: IIdentity, event: string) => boolean) => void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useOnDeleteIdentity, useOnNewIdentity } from ".";
|
|
2
|
-
/** React hook to call action when a new Identity has been created. */
|
|
3
|
-
export const useAutoUpdateListData = (list, shouldUpdate) => {
|
|
4
|
-
useOnNewIdentity((s, d) => {
|
|
5
|
-
if (shouldUpdate(d, "new"))
|
|
6
|
-
list.union([d]);
|
|
7
|
-
});
|
|
8
|
-
useOnDeleteIdentity((s, d) => {
|
|
9
|
-
if (shouldUpdate(d, "new"))
|
|
10
|
-
list.remove(d.id);
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=useAutoUpdateListData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoUpdateListData.js","sourceRoot":"","sources":["../../../../src/data/identity/identity-events/useAutoUpdateListData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAK1D,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA+B,EAC/B,YAAsD,EACrD,EAAE;IACH,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC5B,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IdentityStore } from "../IdentityStore";
|
|
2
|
-
import { IIdentity } from "../interfaces";
|
|
3
|
-
/** React hook to call action when a delete Identity has been created. */
|
|
4
|
-
export declare const useOnDeleteIdentity: (action: (store: IdentityStore, doc: IIdentity) => void) => void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useIdentityStore } from "../IdentityStore";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
/** React hook to call action when a delete Identity has been created. */
|
|
4
|
-
export const useOnDeleteIdentity = (action) => {
|
|
5
|
-
const store = useIdentityStore();
|
|
6
|
-
const onDeleteIdentity = (store, doc) => {
|
|
7
|
-
action(store, doc);
|
|
8
|
-
};
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
store.IdentityDeletedEvent.subscribe(onDeleteIdentity);
|
|
11
|
-
return () => {
|
|
12
|
-
store.IdentityDeletedEvent.unsubscribe(onDeleteIdentity);
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=useOnDeleteIdentity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOnDeleteIdentity.js","sourceRoot":"","sources":["../../../../src/data/identity/identity-events/useOnDeleteIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAsD,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,CAAC,KAAoB,EAAE,GAAc,EAAE,EAAE;QACjE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAC1D,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IdentityStore } from "../IdentityStore";
|
|
2
|
-
import { IIdentity } from "../interfaces";
|
|
3
|
-
/** React hook to call action when a new Identity has been created. */
|
|
4
|
-
export declare const useOnNewIdentity: (action: (store: IdentityStore, doc: IIdentity) => void) => void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useIdentityStore } from "../IdentityStore";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
/** React hook to call action when a new Identity has been created. */
|
|
4
|
-
export const useOnNewIdentity = (action) => {
|
|
5
|
-
const store = useIdentityStore();
|
|
6
|
-
const onNewIdentity = (store, doc) => {
|
|
7
|
-
action(store, doc);
|
|
8
|
-
};
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
store.IdentityCreatedEvent.subscribe(onNewIdentity);
|
|
11
|
-
return () => {
|
|
12
|
-
store.IdentityCreatedEvent.unsubscribe(onNewIdentity);
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=useOnNewIdentity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOnNewIdentity.js","sourceRoot":"","sources":["../../../../src/data/identity/identity-events/useOnNewIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAsD,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,aAAa,GAAG,CAAC,KAAoB,EAAE,GAAc,EAAE,EAAE;QAC9D,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACpD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACvD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ILoadable } from "@voplus/morpho-data";
|
|
2
|
-
import { INode } from "@voplus/morpho-document-core";
|
|
3
|
-
export type IdentityType = "IdentityCard" | "Passport" | "BusinessRegistration";
|
|
4
|
-
export interface IIdentity extends ILoadable, INode {
|
|
5
|
-
/** id of identity */
|
|
6
|
-
id: string;
|
|
7
|
-
/** id of the unit */
|
|
8
|
-
unitId: string;
|
|
9
|
-
/** full name of the identity */
|
|
10
|
-
fullName: string;
|
|
11
|
-
/** number of the identity */
|
|
12
|
-
number?: string;
|
|
13
|
-
/** Indicate if the number of the identity is revealed */
|
|
14
|
-
revealed?: boolean;
|
|
15
|
-
/** country of issued of the identity */
|
|
16
|
-
country: string;
|
|
17
|
-
issuingCountry?: string;
|
|
18
|
-
/** expiry date of the identity */
|
|
19
|
-
expiryDate: string;
|
|
20
|
-
/** type of the identity */
|
|
21
|
-
type: IdentityType;
|
|
22
|
-
/** type of the unit */
|
|
23
|
-
unitType?: "Person" | "Organization";
|
|
24
|
-
/** */
|
|
25
|
-
identity: string;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/identity/interfaces.ts"],"names":[],"mappings":""}
|