@voplus/morpho-csp 11.2.8 → 11.3.0-dev.0
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/components/LegalContactSelect/index.d.ts +7 -0
- package/es/components/LegalContactSelect/index.js +127 -12
- package/es/components/LegalContactSelect/index.js.map +1 -1
- package/es/data/clda-form/conversion.d.ts +9 -6
- package/es/data/clda-form/conversion.js +11 -18
- package/es/data/clda-form/conversion.js.map +1 -1
- package/es/data/clda-form/identityAdapter.d.ts +60 -0
- package/es/data/clda-form/identityAdapter.js +196 -0
- package/es/data/clda-form/identityAdapter.js.map +1 -0
- package/es/data/clda-form/interfaces.d.ts +20 -1
- package/es/data/clda-form/saveFormDraft.d.ts +4 -0
- package/es/data/clda-form/saveFormDraft.js +21 -0
- package/es/data/clda-form/saveFormDraft.js.map +1 -0
- package/es/data/clda-form/types.d.ts +31 -2
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.d.ts +35 -0
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js +53 -0
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js.map +1 -0
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js +41 -15
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js.map +1 -1
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.d.ts +59 -1
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js +244 -15
- package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js.map +1 -1
- package/es/modules/corporate/company/components/CorporateOfficerSelect/index.d.ts +5 -0
- package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js +13 -7
- package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js +20 -24
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js +38 -11
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.d.ts +3 -3
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.d.ts +25 -4
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js +88 -5
- package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.d.ts +13 -0
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js +20 -0
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js.map +1 -0
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js +28 -28
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js +3 -4
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js +16 -9
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js +128 -61
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.d.ts +2 -2
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js +119 -24
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.d.ts +0 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js +16 -8
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.d.ts +274 -23
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js +560 -210
- package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js.map +1 -1
- package/es/modules/corporate/components/CorporateSelect/index.d.ts +12 -1
- package/es/modules/corporate/components/CorporateSelect/index.js +19 -5
- package/es/modules/corporate/components/CorporateSelect/index.js.map +1 -1
- package/es/modules/corporate/filing-record/filing-type/components/FilingTypeReminderScheduleList/index.js +9 -6
- package/es/modules/corporate/filing-record/filing-type/components/FilingTypeReminderScheduleList/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/AppointOfficer/index.d.ts +6 -1
- package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js +3 -2
- package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.d.ts +6 -1
- package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js +3 -2
- package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js +3 -3
- package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/IssueShares/interface.d.ts +1 -1
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.d.ts +16 -1
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js +27 -9
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/PowerOfAttroney/interface.d.ts +5 -2
- package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js +1 -1
- package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.d.ts +13 -1
- package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js +24 -6
- package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js.map +1 -1
- package/es/modules/corporate/legal-generation/components/ShareTransfer/interface.d.ts +5 -2
- package/es/modules/corporate/legal-generation/components/SubmitButton/index.d.ts +11 -3
- package/es/modules/corporate/legal-generation/components/SubmitButton/index.js +9 -3
- package/es/modules/corporate/legal-generation/components/SubmitButton/index.js.map +1 -1
- package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.d.ts +31 -2
- package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js +52 -37
- package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js.map +1 -1
- package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.d.ts +27 -2
- package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js +78 -21
- package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js.map +1 -1
- package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.d.ts +17 -0
- package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js +36 -0
- package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.d.ts +11 -0
- package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js +25 -0
- package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/index.d.ts +7 -0
- package/es/modules/corporate/legal-generation/fields/state/index.js +5 -0
- package/es/modules/corporate/legal-generation/fields/state/index.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/types.d.ts +37 -0
- package/es/modules/corporate/legal-generation/fields/state/types.js +27 -0
- package/es/modules/corporate/legal-generation/fields/state/types.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.d.ts +28 -0
- package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js +45 -0
- package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.d.ts +31 -0
- package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js +47 -0
- package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.d.ts +35 -0
- package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js +36 -0
- package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js.map +1 -0
- package/es/modules/corporate/legal-generation/fields/state/useOperateField.d.ts +15 -0
- package/es/modules/corporate/legal-generation/fields/state/useOperateField.js +27 -0
- package/es/modules/corporate/legal-generation/fields/state/useOperateField.js.map +1 -0
- package/es/modules/corporate/legal-generation/form/AppointOfficerForm.d.ts +18 -9
- package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js +130 -28
- package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js.map +1 -1
- package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.d.ts +27 -17
- package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js +112 -24
- package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js.map +1 -1
- package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.d.ts +637 -0
- package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js +840 -0
- package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js.map +1 -0
- package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.d.ts +23 -0
- package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js +55 -0
- package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js.map +1 -0
- package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js +38 -8
- package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js +50 -33
- package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/ContactFields/index.d.ts +5 -2
- package/es/modules/self-registration/clda-form/components/ContactFields/index.js +6 -3
- package/es/modules/self-registration/clda-form/components/ContactFields/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js +7 -18
- package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/components/useContactEditSession.d.ts +35 -0
- package/es/modules/self-registration/clda-form/components/useContactEditSession.js +51 -0
- package/es/modules/self-registration/clda-form/components/useContactEditSession.js.map +1 -0
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js +60 -12
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js +3 -5
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js +7 -21
- package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js +6 -5
- package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js +23 -28
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js +11 -24
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js +13 -8
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js +11 -24
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js +18 -9
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js +11 -24
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js +23 -28
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js +81 -14
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js +11 -15
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js +34 -5
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js +4 -5
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js +5 -4
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js +32 -12
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.d.ts +2 -3
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js +80 -13
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.d.ts +1 -2
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js +7 -9
- package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.d.ts +3 -0
- package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js +4 -2
- package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js.map +1 -1
- package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js +16 -1
- package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js.map +1 -1
- package/es/routes.d.ts +1 -1
- package/es/routes.js +4 -2
- package/es/routes.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,217 +1,567 @@
|
|
|
1
|
-
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { computed, observable } from "mobx";
|
|
3
1
|
import { createContext, useContext } from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
2
|
+
import { useStore } from "zustand";
|
|
3
|
+
import { createStore } from "zustand/vanilla";
|
|
4
|
+
import { message } from "antd";
|
|
5
|
+
import { FIELD_LABELS, HIDABLE_FIELDS, } from "@voplus/morpho-compliance/es/components/CapturedShapeFields";
|
|
6
|
+
/** Fresh values when changing between search and create; errors never share an object. */
|
|
7
|
+
const emptyIdentityCapture = () => ({
|
|
8
|
+
shape: undefined,
|
|
9
|
+
alias: "",
|
|
10
|
+
issuingCountry: "",
|
|
11
|
+
expiryDate: undefined,
|
|
12
|
+
shapeErrors: {},
|
|
13
|
+
});
|
|
14
|
+
/** A fresh wizard run: the initial value of every field, and what `reset` puts back. */
|
|
15
|
+
const initialLegalState = () => ({
|
|
16
|
+
step: 1,
|
|
17
|
+
operate: "Search",
|
|
18
|
+
unitType: "Person",
|
|
19
|
+
identityId: "",
|
|
20
|
+
unitId: "",
|
|
21
|
+
fistName: "",
|
|
22
|
+
lastName: "",
|
|
23
|
+
middleName: "",
|
|
24
|
+
number: "",
|
|
25
|
+
country: "",
|
|
26
|
+
...emptyIdentityCapture(),
|
|
27
|
+
email: "",
|
|
28
|
+
phone: "",
|
|
29
|
+
address: {
|
|
30
|
+
line1: "",
|
|
31
|
+
line2: "",
|
|
32
|
+
city: "",
|
|
33
|
+
state: "",
|
|
34
|
+
postalCode: "",
|
|
35
|
+
country: "",
|
|
36
|
+
},
|
|
37
|
+
contactList: [],
|
|
38
|
+
orderName: "Western",
|
|
39
|
+
tabKey: "Contact",
|
|
40
|
+
loading: true,
|
|
41
|
+
saving: false,
|
|
42
|
+
catalogStatus: "loading",
|
|
43
|
+
disclosureOpen: false,
|
|
44
|
+
createdOwner: null,
|
|
45
|
+
detailsSaved: false,
|
|
46
|
+
savingStep: null,
|
|
47
|
+
failedOperation: null,
|
|
48
|
+
leaveConfirmOpen: false,
|
|
49
|
+
});
|
|
50
|
+
/** The contact's display name in the picked Western or Eastern order. */
|
|
51
|
+
export const fullNameOf = (state) => state.orderName === "Western"
|
|
52
|
+
? (state.fistName ? state.fistName + " " : "") +
|
|
53
|
+
(state.middleName ? state.middleName + " " : "") +
|
|
54
|
+
(state.lastName ? state.lastName + " " : "")
|
|
55
|
+
: (state.lastName ? state.lastName + " " : "") + (state.fistName ? state.fistName + " " : "");
|
|
56
|
+
/** The captured values projected onto the keys the shape policies are keyed by. */
|
|
57
|
+
export const capturedValuesOf = (state) => ({
|
|
58
|
+
alias: state.alias,
|
|
59
|
+
issuingCountry: state.issuingCountry,
|
|
60
|
+
expiryDate: state.expiryDate,
|
|
61
|
+
});
|
|
62
|
+
/** Whether a captured definition applies to the wizard's current owner kind. */
|
|
63
|
+
export const isShapeApplicableTo = (shape, unitType) => shape.subject === "Both" || shape.subject === unitType;
|
|
64
|
+
/**
|
|
65
|
+
* spec:3851 — what the identity step still needs: a picked shape (its `source` is the number the
|
|
66
|
+
* identity is created with), and a value for every captured field that shape's policies mark
|
|
67
|
+
* mandatory. A field the shape omits or leaves optional is never required.
|
|
68
|
+
*/
|
|
69
|
+
export const identityStepErrorsOf = (state) => {
|
|
70
|
+
const errors = {};
|
|
71
|
+
if (!state.shape) {
|
|
72
|
+
errors.shape = "Identity type is required";
|
|
73
|
+
return errors;
|
|
74
|
+
}
|
|
75
|
+
if (!isShapeApplicableTo(state.shape, state.unitType)) {
|
|
76
|
+
errors.shape = `Identity type is not available for ${state.unitType.toLowerCase()} contacts`;
|
|
77
|
+
return errors;
|
|
78
|
+
}
|
|
79
|
+
const captured = capturedValuesOf(state);
|
|
80
|
+
for (const field of HIDABLE_FIELDS) {
|
|
81
|
+
if (state.shape.policies[field] === "mandatory" && !captured[field]?.trim())
|
|
82
|
+
errors[field] = `${FIELD_LABELS[field]} is required`;
|
|
83
|
+
}
|
|
84
|
+
return errors;
|
|
85
|
+
};
|
|
86
|
+
/** spec:3851 — what leaving now keeps in the contact directory, so the confirmation can say it exactly. */
|
|
87
|
+
export const leaveDescriptionOf = (state) => {
|
|
88
|
+
const name = state.createdOwner?.name ?? fullNameOf(state);
|
|
89
|
+
const kept = state.detailsSaved
|
|
90
|
+
? `${name} and the contact details already saved for it stay in the contact directory`
|
|
91
|
+
: `${name} stays in the contact directory`;
|
|
92
|
+
return `${kept}. Its identity is still missing — you can find it there and finish it later.`;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* The dialog state's store. A pure UI store, so it is a Zustand store and not a MobX one: every
|
|
96
|
+
* wizard step goes through it — the facade below for the property-shaped reads and writes the
|
|
97
|
+
* steps have always used, and `useLegalContext` for a re-render on each write.
|
|
98
|
+
*/
|
|
99
|
+
export const createLegalStore = () => {
|
|
100
|
+
/** Private ownership generation: leaving, unmounting or resetting revokes any pending sequence. */
|
|
101
|
+
let submissionGeneration = 0;
|
|
102
|
+
/** spec:3851 — Detached values certified by the retained owner's last successful detail write. */
|
|
103
|
+
/** Raw draft baseline avoids treating server capitalization as a user rename. */
|
|
104
|
+
let draftNameBaseline = null;
|
|
105
|
+
let savedDetails = null;
|
|
106
|
+
return createStore()((set, get) => ({
|
|
107
|
+
...initialLegalState(),
|
|
108
|
+
/** spec:3851 — a fresh run; the one place besides a finished identity where the retained owner is dropped. */
|
|
109
|
+
reset: () => {
|
|
110
|
+
submissionGeneration += 1;
|
|
111
|
+
savedDetails = null;
|
|
112
|
+
draftNameBaseline = null;
|
|
113
|
+
set(initialLegalState());
|
|
114
|
+
},
|
|
115
|
+
/** spec:3851 — Abandon result delivery without deleting the retained owner or saved details. */
|
|
116
|
+
invalidateSubmission: () => {
|
|
117
|
+
submissionGeneration += 1;
|
|
118
|
+
set({ saving: false, savingStep: null });
|
|
119
|
+
},
|
|
120
|
+
/** spec:3851 — the disclosure that has to be accepted before the contact is written. */
|
|
121
|
+
openDisclosure: () => set({ disclosureOpen: true }),
|
|
122
|
+
/** spec:3851 — dismissing the disclosure writes nothing, so the wizard is still on the review. */
|
|
123
|
+
closeDisclosure: () => set({ disclosureOpen: false }),
|
|
124
|
+
/** spec:3851 — leaving an unfinished contact asks first: the contact stays in the directory. */
|
|
125
|
+
requestLeave: () => set({ leaveConfirmOpen: true }),
|
|
126
|
+
/** spec:3851 — keep editing: the confirmation goes away and the wizard keeps every value for a retry. */
|
|
127
|
+
cancelLeave: () => set({ leaveConfirmOpen: false }),
|
|
128
|
+
/**
|
|
129
|
+
* spec:3851 — the identity step refuses to advance while the picked shape's captured mandatory
|
|
130
|
+
* fields are empty: what is still missing comes back (and is written to `shapeErrors`, which the
|
|
131
|
+
* step renders inline) and the step does not move. Only a satisfied selection advances.
|
|
132
|
+
*/
|
|
133
|
+
advanceFromIdentityStep: () => {
|
|
134
|
+
const errors = identityStepErrorsOf(get());
|
|
135
|
+
set({ shapeErrors: errors });
|
|
136
|
+
const missing = Object.values(errors);
|
|
137
|
+
if (missing.length === 0)
|
|
138
|
+
set({ step: get().step + 1 });
|
|
139
|
+
return missing;
|
|
140
|
+
},
|
|
141
|
+
/**
|
|
142
|
+
* spec:3851 — the create sequence, in order: create owner → save entered contact details →
|
|
143
|
+
* create identity from that owner and the picked shape's `source`. Each write is named while
|
|
144
|
+
* it runs (`savingStep`), and the first one that fails is named afterwards
|
|
145
|
+
* (`failedOperation`) with the wizard left open on the review.
|
|
146
|
+
*
|
|
147
|
+
* A retry resumes against the retained `createdOwner` and never issues a second owner-create;
|
|
148
|
+
* the retained id is cleared only by a completed identity or by an explicit reset.
|
|
149
|
+
*/
|
|
150
|
+
submitCreate: async (writes, onComplete) => {
|
|
151
|
+
if (get().saving)
|
|
152
|
+
return { status: "busy" };
|
|
153
|
+
const generation = submissionGeneration;
|
|
154
|
+
/** spec:3851 — Only the current review owns state writes, error messages and result delivery. */
|
|
155
|
+
const isCurrent = () => generation === submissionGeneration;
|
|
156
|
+
if (!fullNameOf(get()).trim()) {
|
|
157
|
+
message.warning("Name is required");
|
|
158
|
+
return { status: "blocked" };
|
|
159
|
+
}
|
|
160
|
+
const currentErrors = identityStepErrorsOf(get());
|
|
161
|
+
const blocked = Object.values(currentErrors);
|
|
162
|
+
const shape = get().shape;
|
|
163
|
+
if (!shape || blocked.length > 0) {
|
|
164
|
+
set({ shapeErrors: currentErrors });
|
|
165
|
+
message.warning(blocked[0] ?? "Identity type is required");
|
|
166
|
+
return { status: "blocked" };
|
|
167
|
+
}
|
|
168
|
+
/** Stop the sequence on `step`, naming it for the review to report it against the contact. */
|
|
169
|
+
const stop = (step, e) => {
|
|
170
|
+
if (!isCurrent())
|
|
171
|
+
return { status: "abandoned" };
|
|
172
|
+
set({ failedOperation: step });
|
|
173
|
+
message.error(e instanceof Error ? e.message : String(e));
|
|
174
|
+
return { status: "failed", step };
|
|
175
|
+
};
|
|
176
|
+
set({ saving: true, failedOperation: null });
|
|
177
|
+
try {
|
|
178
|
+
// spec:3851 — create the owner, unless a previous attempt already did
|
|
179
|
+
let owner = get().createdOwner;
|
|
180
|
+
if (!owner) {
|
|
181
|
+
set({ savingStep: "contact" });
|
|
182
|
+
try {
|
|
183
|
+
const creationName = fullNameOf(get()).trim();
|
|
184
|
+
const created = await writes.createOwner();
|
|
185
|
+
if (!isCurrent())
|
|
186
|
+
return { status: "abandoned" };
|
|
187
|
+
owner = { id: created.id, name: created.name || fullNameOf(get()) };
|
|
188
|
+
draftNameBaseline = creationName;
|
|
189
|
+
set({ createdOwner: owner });
|
|
190
|
+
}
|
|
191
|
+
catch (e) {
|
|
192
|
+
return stop("contact", e);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// spec:3851 — save the entered contact details onto it. `UnitStore.edit` reports a
|
|
196
|
+
// failure through its error callback and nowhere else, so the write it is bound to
|
|
197
|
+
// rejects instead of resolving: that rejection is what halts the sequence here.
|
|
198
|
+
const current = get();
|
|
199
|
+
const details = {
|
|
200
|
+
name: fullNameOf(current),
|
|
201
|
+
email: current.email,
|
|
202
|
+
phone: current.phone,
|
|
203
|
+
address: { ...current.address },
|
|
204
|
+
};
|
|
205
|
+
const addressFields = ["line1", "line2", "city", "state", "postalCode", "country"];
|
|
206
|
+
// spec:3851 — A prior save only certifies those values; edits require a new write on this owner.
|
|
207
|
+
if (!current.detailsSaved ||
|
|
208
|
+
!savedDetails ||
|
|
209
|
+
details.name !== savedDetails.name ||
|
|
210
|
+
details.email !== savedDetails.email ||
|
|
211
|
+
details.phone !== savedDetails.phone ||
|
|
212
|
+
addressFields.some((field) => details.address[field] !== savedDetails?.address[field])) {
|
|
213
|
+
set({ savingStep: "details" });
|
|
214
|
+
try {
|
|
215
|
+
const rename = details.name.trim() !== (draftNameBaseline ?? details.name.trim())
|
|
216
|
+
? details.name : undefined;
|
|
217
|
+
await writes.saveDetails(owner.id, rename);
|
|
218
|
+
if (!isCurrent())
|
|
219
|
+
return { status: "abandoned" };
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
return stop("details", e);
|
|
223
|
+
}
|
|
224
|
+
if (details.name.trim() !== (draftNameBaseline ?? details.name.trim()))
|
|
225
|
+
owner = { ...owner, name: details.name };
|
|
226
|
+
draftNameBaseline = details.name.trim();
|
|
227
|
+
savedDetails = details;
|
|
228
|
+
set({ detailsSaved: true, createdOwner: owner });
|
|
229
|
+
}
|
|
230
|
+
// spec:3851 — create the identity from the created owner and the picked shape's source
|
|
231
|
+
set({ savingStep: "identity" });
|
|
232
|
+
try {
|
|
233
|
+
await writes.createIdentity(owner.id, shape);
|
|
234
|
+
if (!isCurrent())
|
|
235
|
+
return { status: "abandoned" };
|
|
236
|
+
}
|
|
237
|
+
catch (e) {
|
|
238
|
+
return stop("identity", e);
|
|
239
|
+
}
|
|
240
|
+
// The identity exists, so the wizard is finished with this contact: the retained owner
|
|
241
|
+
// (and the fact that its details were saved) belongs to a retry, not to the next run.
|
|
242
|
+
savedDetails = null;
|
|
243
|
+
set({ failedOperation: null, createdOwner: null, detailsSaved: false });
|
|
244
|
+
// spec:3851 — Deliver the result while ownership is still current, before yielding again.
|
|
245
|
+
onComplete?.(owner.id);
|
|
246
|
+
return { status: "completed", ownerId: owner.id };
|
|
247
|
+
}
|
|
248
|
+
finally {
|
|
249
|
+
if (isCurrent())
|
|
250
|
+
set({ saving: false, savingStep: null });
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
}));
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* The wizard's dialog state. The state itself lives in a Zustand store (`createLegalStore`); this
|
|
257
|
+
* facade keeps the property-shaped reads and writes the steps have always used — `legal.email =
|
|
258
|
+
* value`, `legal.step += 1` — writing straight through to the store, and owns the two things that
|
|
259
|
+
* belong to the dialog's host rather than to the state: its props, and the callback a finished
|
|
260
|
+
* contact is reported to.
|
|
261
|
+
*/
|
|
262
|
+
export class State {
|
|
263
|
+
/** The store every read and write of this dialog state goes through. */
|
|
264
|
+
store;
|
|
265
|
+
/** The dialog's host props: whether it is open, and the channel it reports back through. */
|
|
266
|
+
props;
|
|
267
|
+
/** @param store - the store to drive. The default is a whole fresh wizard, so `new State()` is one. */
|
|
268
|
+
constructor(store = createLegalStore()) {
|
|
269
|
+
this.store = store;
|
|
270
|
+
}
|
|
271
|
+
/** The current state, read for every property below. */
|
|
272
|
+
get snapshot() {
|
|
273
|
+
return this.store.getState();
|
|
274
|
+
}
|
|
275
|
+
/** step of Add Legal Contact */
|
|
276
|
+
get step() {
|
|
277
|
+
return this.snapshot.step;
|
|
278
|
+
}
|
|
279
|
+
set step(value) {
|
|
280
|
+
this.store.setState({ step: value });
|
|
281
|
+
}
|
|
282
|
+
/** Search an existing contact or Create a new contact */
|
|
283
|
+
get operate() {
|
|
284
|
+
return this.snapshot.operate;
|
|
285
|
+
}
|
|
286
|
+
set operate(value) {
|
|
287
|
+
if (value !== this.snapshot.operate) {
|
|
288
|
+
// spec:1807 — Changing mode must not reuse a capture admitted for the other branch.
|
|
289
|
+
this.store.setState({
|
|
290
|
+
operate: value,
|
|
291
|
+
...emptyIdentityCapture(),
|
|
292
|
+
});
|
|
293
|
+
return;
|
|
113
294
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
#unitId_accessor_storage = (__runInitializers(this, _identityId_extraInitializers), __runInitializers(this, _unitId_initializers, ""));
|
|
132
|
-
/** id of unit of the new officer */
|
|
133
|
-
get unitId() { return this.#unitId_accessor_storage; }
|
|
134
|
-
set unitId(value) { this.#unitId_accessor_storage = value; }
|
|
135
|
-
#fistName_accessor_storage = (__runInitializers(this, _unitId_extraInitializers), __runInitializers(this, _fistName_initializers, ""));
|
|
136
|
-
/** */
|
|
137
|
-
get fistName() { return this.#fistName_accessor_storage; }
|
|
138
|
-
set fistName(value) { this.#fistName_accessor_storage = value; }
|
|
139
|
-
#lastName_accessor_storage = (__runInitializers(this, _fistName_extraInitializers), __runInitializers(this, _lastName_initializers, ""));
|
|
140
|
-
/** last name */
|
|
141
|
-
get lastName() { return this.#lastName_accessor_storage; }
|
|
142
|
-
set lastName(value) { this.#lastName_accessor_storage = value; }
|
|
143
|
-
#middleName_accessor_storage = (__runInitializers(this, _lastName_extraInitializers), __runInitializers(this, _middleName_initializers, ""));
|
|
144
|
-
/** */
|
|
145
|
-
get middleName() { return this.#middleName_accessor_storage; }
|
|
146
|
-
set middleName(value) { this.#middleName_accessor_storage = value; }
|
|
147
|
-
#number_accessor_storage = (__runInitializers(this, _middleName_extraInitializers), __runInitializers(this, _number_initializers, ""));
|
|
148
|
-
/** number of identity of the new officer */
|
|
149
|
-
get number() { return this.#number_accessor_storage; }
|
|
150
|
-
set number(value) { this.#number_accessor_storage = value; }
|
|
151
|
-
#country_accessor_storage = (__runInitializers(this, _number_extraInitializers), __runInitializers(this, _country_initializers, ""));
|
|
152
|
-
/** country of identity of the new officer */
|
|
153
|
-
get country() { return this.#country_accessor_storage; }
|
|
154
|
-
set country(value) { this.#country_accessor_storage = value; }
|
|
155
|
-
#type_accessor_storage = (__runInitializers(this, _country_extraInitializers), __runInitializers(this, _type_initializers, "Passport"));
|
|
156
|
-
/** type of identity of the new officer */
|
|
157
|
-
get type() { return this.#type_accessor_storage; }
|
|
158
|
-
set type(value) { this.#type_accessor_storage = value; }
|
|
159
|
-
#expiryDate_accessor_storage = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _expiryDate_initializers, void 0));
|
|
160
|
-
/** expiryDate of identity(Passport required) */
|
|
161
|
-
get expiryDate() { return this.#expiryDate_accessor_storage; }
|
|
162
|
-
set expiryDate(value) { this.#expiryDate_accessor_storage = value; }
|
|
163
|
-
#email_accessor_storage = (__runInitializers(this, _expiryDate_extraInitializers), __runInitializers(this, _email_initializers, ""));
|
|
164
|
-
/** email of unit of the new officer */
|
|
165
|
-
get email() { return this.#email_accessor_storage; }
|
|
166
|
-
set email(value) { this.#email_accessor_storage = value; }
|
|
167
|
-
#phone_accessor_storage = (__runInitializers(this, _email_extraInitializers), __runInitializers(this, _phone_initializers, ""));
|
|
168
|
-
/** phone of unit of the new officer */
|
|
169
|
-
get phone() { return this.#phone_accessor_storage; }
|
|
170
|
-
set phone(value) { this.#phone_accessor_storage = value; }
|
|
171
|
-
#address_accessor_storage = (__runInitializers(this, _phone_extraInitializers), __runInitializers(this, _address_initializers, {
|
|
172
|
-
line1: "",
|
|
173
|
-
line2: "",
|
|
174
|
-
city: "",
|
|
175
|
-
state: "",
|
|
176
|
-
postalCode: "",
|
|
177
|
-
country: "",
|
|
178
|
-
}));
|
|
179
|
-
/** address of unit of the new officer */
|
|
180
|
-
get address() { return this.#address_accessor_storage; }
|
|
181
|
-
set address(value) { this.#address_accessor_storage = value; }
|
|
182
|
-
#contactList_accessor_storage = (__runInitializers(this, _address_extraInitializers), __runInitializers(this, _contactList_initializers, []));
|
|
183
|
-
/** list of unit */
|
|
184
|
-
get contactList() { return this.#contactList_accessor_storage; }
|
|
185
|
-
set contactList(value) { this.#contactList_accessor_storage = value; }
|
|
186
|
-
#orderName_accessor_storage = (__runInitializers(this, _contactList_extraInitializers), __runInitializers(this, _orderName_initializers, "Western"));
|
|
187
|
-
/** order name by Western or Eastern */
|
|
188
|
-
get orderName() { return this.#orderName_accessor_storage; }
|
|
189
|
-
set orderName(value) { this.#orderName_accessor_storage = value; }
|
|
190
|
-
#tabKey_accessor_storage = (__runInitializers(this, _orderName_extraInitializers), __runInitializers(this, _tabKey_initializers, "Contact"));
|
|
191
|
-
/** key of tabPane of Page4 */
|
|
192
|
-
get tabKey() { return this.#tabKey_accessor_storage; }
|
|
193
|
-
set tabKey(value) { this.#tabKey_accessor_storage = value; }
|
|
194
|
-
#loading_accessor_storage = (__runInitializers(this, _tabKey_extraInitializers), __runInitializers(this, _loading_initializers, true));
|
|
195
|
-
/** loading of load identity list */
|
|
196
|
-
get loading() { return this.#loading_accessor_storage; }
|
|
197
|
-
set loading(value) { this.#loading_accessor_storage = value; }
|
|
198
|
-
#saving_accessor_storage = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _saving_initializers, false));
|
|
199
|
-
/** loading of save identity item */
|
|
200
|
-
get saving() { return this.#saving_accessor_storage; }
|
|
201
|
-
set saving(value) { this.#saving_accessor_storage = value; }
|
|
202
|
-
get fullName() {
|
|
203
|
-
return this.orderName === "Western"
|
|
204
|
-
? (this.fistName ? this.fistName + " " : "") +
|
|
205
|
-
(this.middleName ? this.middleName + " " : "") +
|
|
206
|
-
(this.lastName ? this.lastName + " " : "")
|
|
207
|
-
: (this.lastName ? this.lastName + " " : "") + (this.fistName ? this.fistName + " " : "");
|
|
295
|
+
this.store.setState({ operate: value });
|
|
296
|
+
}
|
|
297
|
+
/** type of unit of the new officer */
|
|
298
|
+
get unitType() {
|
|
299
|
+
return this.snapshot.unitType;
|
|
300
|
+
}
|
|
301
|
+
set unitType(value) {
|
|
302
|
+
// spec:3851 — A retained owner's kind cannot change; a pre-create incompatible capture is reset.
|
|
303
|
+
if (this.snapshot.createdOwner)
|
|
304
|
+
return;
|
|
305
|
+
const shape = this.snapshot.shape;
|
|
306
|
+
if (shape && !isShapeApplicableTo(shape, value)) {
|
|
307
|
+
this.store.setState({
|
|
308
|
+
unitType: value,
|
|
309
|
+
...emptyIdentityCapture(),
|
|
310
|
+
});
|
|
311
|
+
return;
|
|
208
312
|
}
|
|
209
|
-
|
|
210
|
-
|
|
313
|
+
this.store.setState({ unitType: value });
|
|
314
|
+
}
|
|
315
|
+
/** id of identity */
|
|
316
|
+
get identityId() {
|
|
317
|
+
return this.snapshot.identityId;
|
|
318
|
+
}
|
|
319
|
+
set identityId(value) {
|
|
320
|
+
this.store.setState({ identityId: value });
|
|
321
|
+
}
|
|
322
|
+
/** id of unit of the new officer */
|
|
323
|
+
get unitId() {
|
|
324
|
+
return this.snapshot.unitId;
|
|
325
|
+
}
|
|
326
|
+
set unitId(value) {
|
|
327
|
+
this.store.setState({ unitId: value });
|
|
328
|
+
}
|
|
329
|
+
/** */
|
|
330
|
+
get fistName() {
|
|
331
|
+
return this.snapshot.fistName;
|
|
332
|
+
}
|
|
333
|
+
set fistName(value) {
|
|
334
|
+
this.store.setState({ fistName: value });
|
|
335
|
+
}
|
|
336
|
+
/** last name */
|
|
337
|
+
get lastName() {
|
|
338
|
+
return this.snapshot.lastName;
|
|
339
|
+
}
|
|
340
|
+
set lastName(value) {
|
|
341
|
+
this.store.setState({ lastName: value });
|
|
342
|
+
}
|
|
343
|
+
/** */
|
|
344
|
+
get middleName() {
|
|
345
|
+
return this.snapshot.middleName;
|
|
346
|
+
}
|
|
347
|
+
set middleName(value) {
|
|
348
|
+
this.store.setState({ middleName: value });
|
|
349
|
+
}
|
|
350
|
+
/** number of identity of the new officer */
|
|
351
|
+
get number() {
|
|
352
|
+
return this.snapshot.number;
|
|
353
|
+
}
|
|
354
|
+
set number(value) {
|
|
355
|
+
this.store.setState({ number: value });
|
|
356
|
+
}
|
|
357
|
+
/** country of identity of the new officer */
|
|
358
|
+
get country() {
|
|
359
|
+
return this.snapshot.country;
|
|
360
|
+
}
|
|
361
|
+
set country(value) {
|
|
362
|
+
this.store.setState({ country: value });
|
|
363
|
+
}
|
|
364
|
+
/** issuing country captured under the picked shape's policy */
|
|
365
|
+
get issuingCountry() {
|
|
366
|
+
return this.snapshot.issuingCountry;
|
|
367
|
+
}
|
|
368
|
+
set issuingCountry(value) {
|
|
369
|
+
this.store.setState({ issuingCountry: value });
|
|
370
|
+
}
|
|
371
|
+
/** alias captured under the picked shape's policy */
|
|
372
|
+
get alias() {
|
|
373
|
+
return this.snapshot.alias;
|
|
374
|
+
}
|
|
375
|
+
set alias(value) {
|
|
376
|
+
this.store.setState({ alias: value });
|
|
377
|
+
}
|
|
378
|
+
/** expiryDate of identity of the new officer, when the picked shape captures it */
|
|
379
|
+
get expiryDate() {
|
|
380
|
+
return this.snapshot.expiryDate;
|
|
381
|
+
}
|
|
382
|
+
set expiryDate(value) {
|
|
383
|
+
this.store.setState({ expiryDate: value });
|
|
384
|
+
}
|
|
385
|
+
/** email of unit of the new officer */
|
|
386
|
+
get email() {
|
|
387
|
+
return this.snapshot.email;
|
|
388
|
+
}
|
|
389
|
+
set email(value) {
|
|
390
|
+
this.store.setState({ email: value });
|
|
391
|
+
}
|
|
392
|
+
/** phone of unit of the new officer */
|
|
393
|
+
get phone() {
|
|
394
|
+
return this.snapshot.phone;
|
|
395
|
+
}
|
|
396
|
+
set phone(value) {
|
|
397
|
+
this.store.setState({ phone: value });
|
|
398
|
+
}
|
|
399
|
+
/** address of unit of the new officer */
|
|
400
|
+
get address() {
|
|
401
|
+
return this.snapshot.address;
|
|
402
|
+
}
|
|
403
|
+
set address(value) {
|
|
404
|
+
this.store.setState({ address: value });
|
|
405
|
+
}
|
|
406
|
+
/** list of unit */
|
|
407
|
+
get contactList() {
|
|
408
|
+
return this.snapshot.contactList;
|
|
409
|
+
}
|
|
410
|
+
set contactList(value) {
|
|
411
|
+
this.store.setState({ contactList: value });
|
|
412
|
+
}
|
|
413
|
+
/** order name by Western or Eastern */
|
|
414
|
+
get orderName() {
|
|
415
|
+
return this.snapshot.orderName;
|
|
416
|
+
}
|
|
417
|
+
set orderName(value) {
|
|
418
|
+
this.store.setState({ orderName: value });
|
|
419
|
+
}
|
|
420
|
+
/** key of tabPane of Page4 */
|
|
421
|
+
get tabKey() {
|
|
422
|
+
return this.snapshot.tabKey;
|
|
423
|
+
}
|
|
424
|
+
set tabKey(value) {
|
|
425
|
+
this.store.setState({ tabKey: value });
|
|
426
|
+
}
|
|
427
|
+
/** loading of load identity list */
|
|
428
|
+
get loading() {
|
|
429
|
+
return this.snapshot.loading;
|
|
430
|
+
}
|
|
431
|
+
set loading(value) {
|
|
432
|
+
this.store.setState({ loading: value });
|
|
433
|
+
}
|
|
434
|
+
/** loading of save identity item, and of the create sequence while it runs */
|
|
435
|
+
get saving() {
|
|
436
|
+
return this.snapshot.saving;
|
|
437
|
+
}
|
|
438
|
+
set saving(value) {
|
|
439
|
+
this.store.setState({ saving: value });
|
|
440
|
+
}
|
|
441
|
+
/** the shape picked for the new identity — its `source` is the number the identity is created with */
|
|
442
|
+
get shape() {
|
|
443
|
+
return this.snapshot.shape;
|
|
444
|
+
}
|
|
445
|
+
set shape(value) {
|
|
446
|
+
this.store.setState({ shape: value });
|
|
447
|
+
}
|
|
448
|
+
/** spec:3717 — the picker's catalog status; the identity step is blocked until it is "ready". */
|
|
449
|
+
get catalogStatus() {
|
|
450
|
+
return this.snapshot.catalogStatus;
|
|
451
|
+
}
|
|
452
|
+
set catalogStatus(value) {
|
|
453
|
+
this.store.setState({ catalogStatus: value });
|
|
454
|
+
}
|
|
455
|
+
/** spec:3713 — the identity-step messages a blocked step shows for the picked shape's policies. */
|
|
456
|
+
get shapeErrors() {
|
|
457
|
+
return this.snapshot.shapeErrors;
|
|
458
|
+
}
|
|
459
|
+
set shapeErrors(value) {
|
|
460
|
+
this.store.setState({ shapeErrors: value });
|
|
461
|
+
}
|
|
462
|
+
/** spec:3851 — the pre-create disclosure the user accepts before the contact is written. */
|
|
463
|
+
get disclosureOpen() {
|
|
464
|
+
return this.snapshot.disclosureOpen;
|
|
465
|
+
}
|
|
466
|
+
set disclosureOpen(value) {
|
|
467
|
+
this.store.setState({ disclosureOpen: value });
|
|
468
|
+
}
|
|
469
|
+
/** spec:3851 — the owner the create sequence already created; a retry reuses it. */
|
|
470
|
+
get createdOwner() {
|
|
471
|
+
return this.snapshot.createdOwner;
|
|
472
|
+
}
|
|
473
|
+
set createdOwner(value) {
|
|
474
|
+
this.store.setState({ createdOwner: value });
|
|
475
|
+
}
|
|
476
|
+
/** spec:3851 — whether the entered contact details were saved onto the created owner. */
|
|
477
|
+
get detailsSaved() {
|
|
478
|
+
return this.snapshot.detailsSaved;
|
|
479
|
+
}
|
|
480
|
+
set detailsSaved(value) {
|
|
481
|
+
this.store.setState({ detailsSaved: value });
|
|
482
|
+
}
|
|
483
|
+
/** spec:3851 — the step of the create sequence in flight, named while it runs. */
|
|
484
|
+
get savingStep() {
|
|
485
|
+
return this.snapshot.savingStep;
|
|
486
|
+
}
|
|
487
|
+
set savingStep(value) {
|
|
488
|
+
this.store.setState({ savingStep: value });
|
|
489
|
+
}
|
|
490
|
+
/** spec:3851 — the step that failed after the owner was created; the wizard stays open. */
|
|
491
|
+
get failedOperation() {
|
|
492
|
+
return this.snapshot.failedOperation;
|
|
493
|
+
}
|
|
494
|
+
set failedOperation(value) {
|
|
495
|
+
this.store.setState({ failedOperation: value });
|
|
496
|
+
}
|
|
497
|
+
/** spec:3851 — the confirmation shown when the user tries to leave an unfinished contact. */
|
|
498
|
+
get leaveConfirmOpen() {
|
|
499
|
+
return this.snapshot.leaveConfirmOpen;
|
|
500
|
+
}
|
|
501
|
+
set leaveConfirmOpen(value) {
|
|
502
|
+
this.store.setState({ leaveConfirmOpen: value });
|
|
503
|
+
}
|
|
504
|
+
/** The contact's display name in the picked Western or Eastern order. */
|
|
505
|
+
get fullName() {
|
|
506
|
+
return fullNameOf(this.snapshot);
|
|
507
|
+
}
|
|
508
|
+
/** The captured values projected onto the keys the shape policies are keyed by. */
|
|
509
|
+
get capturedValues() {
|
|
510
|
+
return capturedValuesOf(this.snapshot);
|
|
511
|
+
}
|
|
512
|
+
/** What leaving now keeps in the contact directory, so the confirmation can say it exactly. */
|
|
513
|
+
get leaveDescription() {
|
|
514
|
+
return leaveDescriptionOf(this.snapshot);
|
|
515
|
+
}
|
|
516
|
+
/** Start a fresh wizard run. */
|
|
517
|
+
reset = () => this.snapshot.reset();
|
|
518
|
+
/** spec:3851 — Revoke an abandoned review's pending result without discarding saved directory data. */
|
|
519
|
+
invalidateSubmission = () => this.snapshot.invalidateSubmission();
|
|
520
|
+
/** Open the pre-create disclosure. */
|
|
521
|
+
openDisclosure = () => this.snapshot.openDisclosure();
|
|
522
|
+
/** Dismiss the pre-create disclosure without writing anything. */
|
|
523
|
+
closeDisclosure = () => this.snapshot.closeDisclosure();
|
|
524
|
+
/** spec:3851 — ask to leave: with nothing created the dialog just closes, with a contact
|
|
525
|
+
* already created the user confirms first, because that contact stays in the directory. */
|
|
526
|
+
requestLeave = () => {
|
|
527
|
+
if (!this.snapshot.createdOwner) {
|
|
528
|
+
this.leave();
|
|
529
|
+
return;
|
|
211
530
|
}
|
|
531
|
+
this.snapshot.requestLeave();
|
|
212
532
|
};
|
|
213
|
-
|
|
214
|
-
|
|
533
|
+
/** spec:3851 — keep editing: drop the leave confirmation so the wizard stays open for a retry. */
|
|
534
|
+
cancelLeave = () => this.snapshot.cancelLeave();
|
|
535
|
+
/** spec:3851 — leave the unfinished contact behind: it stays in the directory with whatever was
|
|
536
|
+
* saved for it, and no identity is selected for the calling workflow. */
|
|
537
|
+
leave = () => {
|
|
538
|
+
this.invalidateSubmission();
|
|
539
|
+
this.snapshot.cancelLeave();
|
|
540
|
+
this.props?.updateVisible?.();
|
|
541
|
+
};
|
|
542
|
+
/** spec:3851 — gate the identity step on the picked shape's captured-field policies. */
|
|
543
|
+
advanceFromIdentityStep = () => this.snapshot.advanceFromIdentityStep();
|
|
544
|
+
/**
|
|
545
|
+
* spec:3851 — run the ordered create sequence, then report a finished contact back through the
|
|
546
|
+
* dialog's own result channel. Only a created identity advances the calling workflow; a contact
|
|
547
|
+
* left behind by a failure or by leaving is never reported as a selection.
|
|
548
|
+
*/
|
|
549
|
+
submitCreate = async (writes) => {
|
|
550
|
+
const updateVisible = this.props?.updateVisible;
|
|
551
|
+
return this.snapshot.submitCreate(writes, (ownerId) => {
|
|
552
|
+
void updateVisible?.(ownerId);
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
}
|
|
215
556
|
export const LegalContext = createContext(null);
|
|
216
|
-
|
|
557
|
+
/**
|
|
558
|
+
* The dialog state for the calling step. The same hook subscribes the step to every write of that
|
|
559
|
+
* state, so a step re-renders when the wizard advances, when the shape catalog answers, or when a
|
|
560
|
+
* create sequence reports the step it is on — no observable wrapper required.
|
|
561
|
+
*/
|
|
562
|
+
export const useLegalContext = () => {
|
|
563
|
+
const state = useContext(LegalContext);
|
|
564
|
+
useStore(state.store, (snapshot) => snapshot);
|
|
565
|
+
return state;
|
|
566
|
+
};
|
|
217
567
|
//# sourceMappingURL=state.js.map
|