@voplus/morpho-csp 11.2.9 → 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.
Files changed (210) hide show
  1. package/es/components/LegalContactSelect/index.d.ts +7 -0
  2. package/es/components/LegalContactSelect/index.js +127 -12
  3. package/es/components/LegalContactSelect/index.js.map +1 -1
  4. package/es/data/clda-form/conversion.d.ts +9 -6
  5. package/es/data/clda-form/conversion.js +11 -18
  6. package/es/data/clda-form/conversion.js.map +1 -1
  7. package/es/data/clda-form/identityAdapter.d.ts +60 -0
  8. package/es/data/clda-form/identityAdapter.js +196 -0
  9. package/es/data/clda-form/identityAdapter.js.map +1 -0
  10. package/es/data/clda-form/interfaces.d.ts +20 -1
  11. package/es/data/clda-form/saveFormDraft.d.ts +4 -0
  12. package/es/data/clda-form/saveFormDraft.js +21 -0
  13. package/es/data/clda-form/saveFormDraft.js.map +1 -0
  14. package/es/data/clda-form/types.d.ts +31 -2
  15. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.d.ts +35 -0
  16. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js +53 -0
  17. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/IdentityShapeFields.js.map +1 -0
  18. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js +41 -15
  19. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/index.js.map +1 -1
  20. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.d.ts +59 -1
  21. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js +244 -15
  22. package/es/modules/corporate/background-investigation/risk-profile/components/IdentityProperties/state.js.map +1 -1
  23. package/es/modules/corporate/company/components/CorporateOfficerSelect/index.d.ts +5 -0
  24. package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js +13 -7
  25. package/es/modules/corporate/company/components/CorporateOfficerSelect/index.js.map +1 -1
  26. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.d.ts +2 -2
  27. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js +20 -24
  28. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step3.js.map +1 -1
  29. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.d.ts +2 -2
  30. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js +38 -11
  31. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/Step4.js.map +1 -1
  32. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.d.ts +3 -3
  33. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/index.js.map +1 -1
  34. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.d.ts +25 -4
  35. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js +88 -5
  36. package/es/modules/corporate/company/identity/components/NewLegalContactDialog/state.js.map +1 -1
  37. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.d.ts +13 -0
  38. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js +20 -0
  39. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/DialogShell.js.map +1 -0
  40. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js +28 -28
  41. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page1.js.map +1 -1
  42. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js +3 -4
  43. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page2.js.map +1 -1
  44. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js +16 -9
  45. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page3.js.map +1 -1
  46. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.d.ts +2 -2
  47. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js +128 -61
  48. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.js.map +1 -1
  49. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.d.ts +2 -2
  50. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js +119 -24
  51. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.js.map +1 -1
  52. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.d.ts +0 -1
  53. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js +16 -8
  54. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/index.js.map +1 -1
  55. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.d.ts +274 -23
  56. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js +560 -210
  57. package/es/modules/corporate/company/identity/components/SelectLegalContactDialog/state.js.map +1 -1
  58. package/es/modules/corporate/components/CorporateSelect/index.d.ts +12 -1
  59. package/es/modules/corporate/components/CorporateSelect/index.js +19 -5
  60. package/es/modules/corporate/components/CorporateSelect/index.js.map +1 -1
  61. package/es/modules/corporate/legal-generation/components/AppointOfficer/index.d.ts +6 -1
  62. package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js +3 -2
  63. package/es/modules/corporate/legal-generation/components/AppointOfficer/index.js.map +1 -1
  64. package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.d.ts +6 -1
  65. package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js +3 -2
  66. package/es/modules/corporate/legal-generation/components/CorporateRepresentative/index.js.map +1 -1
  67. package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js +3 -3
  68. package/es/modules/corporate/legal-generation/components/IssueShares/Fields.js.map +1 -1
  69. package/es/modules/corporate/legal-generation/components/IssueShares/interface.d.ts +1 -1
  70. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.d.ts +16 -1
  71. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js +27 -9
  72. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/Fields.js.map +1 -1
  73. package/es/modules/corporate/legal-generation/components/PowerOfAttroney/interface.d.ts +5 -2
  74. package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js +1 -1
  75. package/es/modules/corporate/legal-generation/components/ResignationLetter/Fields.js.map +1 -1
  76. package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.d.ts +13 -1
  77. package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js +24 -6
  78. package/es/modules/corporate/legal-generation/components/ShareTransfer/Fields.js.map +1 -1
  79. package/es/modules/corporate/legal-generation/components/ShareTransfer/interface.d.ts +5 -2
  80. package/es/modules/corporate/legal-generation/components/SubmitButton/index.d.ts +11 -3
  81. package/es/modules/corporate/legal-generation/components/SubmitButton/index.js +9 -3
  82. package/es/modules/corporate/legal-generation/components/SubmitButton/index.js.map +1 -1
  83. package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.d.ts +31 -2
  84. package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js +52 -37
  85. package/es/modules/corporate/legal-generation/fields/AppointOfficerFields.js.map +1 -1
  86. package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.d.ts +27 -2
  87. package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js +78 -21
  88. package/es/modules/corporate/legal-generation/fields/CorporateRepresentativeFields.js.map +1 -1
  89. package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.d.ts +17 -0
  90. package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js +36 -0
  91. package/es/modules/corporate/legal-generation/fields/ParentCompanyDetailsFields.js.map +1 -0
  92. package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.d.ts +11 -0
  93. package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js +25 -0
  94. package/es/modules/corporate/legal-generation/fields/renderCapturedIdentityColumn.js.map +1 -0
  95. package/es/modules/corporate/legal-generation/fields/state/index.d.ts +7 -0
  96. package/es/modules/corporate/legal-generation/fields/state/index.js +5 -0
  97. package/es/modules/corporate/legal-generation/fields/state/index.js.map +1 -0
  98. package/es/modules/corporate/legal-generation/fields/state/types.d.ts +37 -0
  99. package/es/modules/corporate/legal-generation/fields/state/types.js +27 -0
  100. package/es/modules/corporate/legal-generation/fields/state/types.js.map +1 -0
  101. package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.d.ts +28 -0
  102. package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js +45 -0
  103. package/es/modules/corporate/legal-generation/fields/state/useCapturedIdentityField.js.map +1 -0
  104. package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.d.ts +31 -0
  105. package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js +47 -0
  106. package/es/modules/corporate/legal-generation/fields/state/useIdentityShapeCapture.js.map +1 -0
  107. package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.d.ts +35 -0
  108. package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js +36 -0
  109. package/es/modules/corporate/legal-generation/fields/state/useLegalGenerationIdentityCapture.js.map +1 -0
  110. package/es/modules/corporate/legal-generation/fields/state/useOperateField.d.ts +15 -0
  111. package/es/modules/corporate/legal-generation/fields/state/useOperateField.js +27 -0
  112. package/es/modules/corporate/legal-generation/fields/state/useOperateField.js.map +1 -0
  113. package/es/modules/corporate/legal-generation/form/AppointOfficerForm.d.ts +18 -9
  114. package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js +130 -28
  115. package/es/modules/corporate/legal-generation/form/AppointOfficerForm.js.map +1 -1
  116. package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.d.ts +27 -17
  117. package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js +112 -24
  118. package/es/modules/corporate/legal-generation/form/CorporateRepresentativeForm.js.map +1 -1
  119. package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.d.ts +637 -0
  120. package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js +840 -0
  121. package/es/modules/corporate/legal-generation/form/legalGenerationSubmit.js.map +1 -0
  122. package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.d.ts +23 -0
  123. package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js +55 -0
  124. package/es/modules/corporate/legal-generation/form/useLegalGenerationDocument.js.map +1 -0
  125. package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js +38 -8
  126. package/es/modules/corporate/legal-generation/pages/CorporateLegalGeneration/index.js.map +1 -1
  127. package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js +50 -33
  128. package/es/modules/self-registration/clda-form/components/CLDAContactList/index.js.map +1 -1
  129. package/es/modules/self-registration/clda-form/components/ContactFields/index.d.ts +5 -2
  130. package/es/modules/self-registration/clda-form/components/ContactFields/index.js +6 -3
  131. package/es/modules/self-registration/clda-form/components/ContactFields/index.js.map +1 -1
  132. package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.d.ts +1 -2
  133. package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js +7 -18
  134. package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/NewDPODialog/index.js.map +1 -1
  135. package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.d.ts +1 -2
  136. package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js +7 -18
  137. package/es/modules/self-registration/clda-form/components/NewDirectorDialog/index.js.map +1 -1
  138. package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.d.ts +1 -2
  139. package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js +7 -18
  140. package/es/modules/self-registration/clda-form/components/NewSecretaryDialog/index.js.map +1 -1
  141. package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.d.ts +1 -2
  142. package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js +7 -18
  143. package/es/modules/self-registration/clda-form/components/NewShareholderDialog/index.js.map +1 -1
  144. package/es/modules/self-registration/clda-form/components/useContactEditSession.d.ts +35 -0
  145. package/es/modules/self-registration/clda-form/components/useContactEditSession.js +51 -0
  146. package/es/modules/self-registration/clda-form/components/useContactEditSession.js.map +1 -0
  147. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.d.ts +2 -3
  148. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js +60 -12
  149. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailItem/index.js.map +1 -1
  150. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.d.ts +1 -2
  151. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js +3 -5
  152. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/components/NewOfficerDetailList/index.js.map +1 -1
  153. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js +7 -21
  154. package/es/modules/self-registration/clda-form/incorporation/appoint-representative/index.js.map +1 -1
  155. package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js +6 -5
  156. package/es/modules/self-registration/clda-form/incorporation/company-general/CompanyGeneralForm.js.map +1 -1
  157. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.d.ts +1 -2
  158. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js +23 -28
  159. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddAllotmentDialog/index.js.map +1 -1
  160. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.d.ts +1 -2
  161. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js +11 -24
  162. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddBankOpeningDialog/index.js.map +1 -1
  163. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.d.ts +1 -2
  164. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js +13 -8
  165. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddDivideDialog/index.js.map +1 -1
  166. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.d.ts +1 -2
  167. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js +11 -24
  168. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddOfficerDialog/index.js.map +1 -1
  169. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.d.ts +1 -2
  170. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js +18 -9
  171. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRedonminationDialog/index.js.map +1 -1
  172. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.d.ts +1 -2
  173. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js +11 -24
  174. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddRemoveOfficerDialog/index.js.map +1 -1
  175. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.d.ts +1 -2
  176. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js +23 -28
  177. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AddTransferDialog/index.js.map +1 -1
  178. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.d.ts +2 -3
  179. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js +81 -14
  180. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentItem/index.js.map +1 -1
  181. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.d.ts +1 -2
  182. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js +11 -15
  183. package/es/modules/self-registration/clda-form/incorporation/company-general/components/AllotmentList/index.js.map +1 -1
  184. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.d.ts +2 -3
  185. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js +34 -5
  186. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningContactItem/index.js.map +1 -1
  187. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.d.ts +1 -2
  188. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js +4 -5
  189. package/es/modules/self-registration/clda-form/incorporation/company-general/components/BankOpeningList/index.js.map +1 -1
  190. package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.d.ts +1 -2
  191. package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js +5 -4
  192. package/es/modules/self-registration/clda-form/incorporation/company-general/components/CapitalReceiptSelect/index.js.map +1 -1
  193. package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.d.ts +1 -2
  194. package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js +32 -12
  195. package/es/modules/self-registration/clda-form/incorporation/company-general/components/OfficerDetailItem/index.js.map +1 -1
  196. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.d.ts +2 -3
  197. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js +80 -13
  198. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferItem/index.js.map +1 -1
  199. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.d.ts +1 -2
  200. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js +7 -9
  201. package/es/modules/self-registration/clda-form/incorporation/company-general/components/TransferList/index.js.map +1 -1
  202. package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.d.ts +3 -0
  203. package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js +4 -2
  204. package/es/modules/self-registration/clda-form/incorporation/components/FormContactEditor/index.js.map +1 -1
  205. package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js +16 -1
  206. package/es/modules/self-registration/clda-form/pages/CLDAFormDefaultView/Content.js.map +1 -1
  207. package/es/routes.d.ts +1 -1
  208. package/es/routes.js +4 -2
  209. package/es/routes.js.map +1 -1
  210. package/package.json +4 -4
@@ -1,71 +1,138 @@
1
- import { Button, Form, Input, Select, Tabs, message } from "antd";
2
- import { utcdayjs } from "@voplus/morpho-ui/es/controls/UTCDatePicker/state";
1
+ import { Button, Form, Input, Row, Tabs, message } from "antd";
3
2
  import Address from "@voplus/morpho-ui/es/controls/Address";
4
- import { InputCountry, UTCDatePicker as DatePicker } from "@voplus/morpho-ui";
5
- import React from "react";
3
+ import { InputCountry } from "@voplus/morpho-ui";
4
+ import React, { useState } from "react";
6
5
  import { observe } from "@voplus/morpho-ui";
7
- import { runInAction } from "mobx";
8
6
  import { useLegalContext } from "./state";
7
+ import IdentityShapeSelect from "@voplus/morpho-compliance/es/components/IdentityShapeSelect";
8
+ import { clearHiddenFields, hiddenFieldsFor, } from "@voplus/morpho-compliance/es/components/CapturedShapeFields";
9
+ import { CATALOG_UNAVAILABLE_MESSAGE } from "@voplus/morpho-compliance/es/data/identityShape";
10
+ import ShapeChangeConfirm from "@voplus/morpho-compliance/es/components/ShapeChangeConfirm";
11
+ import { renderCapturedIdentityColumn } from "../../../../legal-generation/fields/renderCapturedIdentityColumn";
12
+ /** Capture the selected identity type and require confirmation before replacing populated fields. */
9
13
  const Page4 = () => {
10
14
  const legal = useLegalContext();
11
- return observe(() => (React.createElement(React.Fragment, null,
12
- React.createElement(Tabs, { activeKey: legal.tabKey, tabPlacement: "start", onChange: (key) => (legal.tabKey = key), items: [
13
- {
14
- key: "Contact",
15
- label: "Contact Info",
16
- children: (React.createElement(Form, { layout: "vertical" },
17
- React.createElement(Form.Item, { label: "E-mail" },
18
- React.createElement(Input, { value: legal.email, onChange: (e) => {
19
- legal.email = e.target.value;
20
- } })),
21
- React.createElement(Form.Item, { label: "Phone" },
22
- React.createElement(Input, { value: legal.phone, onChange: (e) => {
23
- legal.phone = e.target.value;
24
- } })),
25
- React.createElement(Address, { value: legal.address, onChange: (v) => {
26
- legal.address = v;
27
- } }))),
28
- },
29
- {
30
- key: "Identify",
31
- label: "Identify Info",
32
- children: (React.createElement(Form, { layout: "vertical" },
33
- React.createElement(Form.Item, { label: legal.unitType === "Organization" ? "Country of Registration" : "Country", name: "country", rules: [{ required: true }] },
34
- React.createElement(InputCountry, { defaultValue: legal.country, onChange: (country) => (legal.country = country) })),
35
- legal.unitType === "Person" && (React.createElement(Form.Item, { label: "Identify Type", name: "identifyType", rules: [{ required: true }] },
36
- React.createElement(Select, { defaultValue: legal.type, value: legal.type, onChange: (value) => {
37
- legal.type = value;
38
- }, options: [
39
- { value: "Passport", label: "International Passport" },
40
- { value: "IdentityCard", label: "Identify Card" },
41
- { value: "BusinessRegistration", label: "Business Registration" },
42
- ] }))),
43
- React.createElement(Form.Item, { label: legal.unitType === "Organization" ? "Registration #" : "Identify #", name: "identity", rules: [{ required: true }] },
44
- React.createElement(Input, { defaultValue: legal.number, value: legal.number, onChange: (e) => {
45
- legal.number = e.target.value;
46
- } })),
47
- legal.unitType === "Person" && (React.createElement(Form.Item, { label: "Expiry Date", name: "expiryDate", rules: [{ required: legal.type === "Passport" }] },
48
- React.createElement(DatePicker, { defaultValue: legal.expiryDate ? utcdayjs(legal.expiryDate) : undefined, onChange: (date, dateString) => (legal.expiryDate = dateString) }))))),
49
- },
50
- ] }),
51
- React.createElement("div", { className: "select-legal-contact_footer" },
52
- React.createElement(Button, { size: "middle", onClick: () => {
53
- legal.step -= 1;
54
- } }, "Back"),
55
- React.createElement(Button, { size: "middle", type: "primary", onClick: next }, "Next")))));
15
+ /** The replacement waiting for consent; the wizard buffer keeps its previous shape until then. */
16
+ const [pendingShape, setPendingShape] = useState(null);
17
+ /**
18
+ * The picked shape's policy for one captured field. With no shape picked yet every field reads as
19
+ * `omitted`, which is what keeps the step from rendering a capture it does not have.
20
+ */
21
+ const policyFor = (field) => legal.shape?.policies[field] ?? "omitted";
22
+ /** Render only fields the current snapshot captures. */
23
+ const isVisible = (field) => policyFor(field) !== "omitted";
24
+ // The captured fields regroup by meaning: the alias is a variant of the contact's own name, so it
25
+ // stays the first row right under the identity type it belongs to; issuing country and expiry date
26
+ // are both attributes of the document, so they share one row of two equal columns. A shape that
27
+ // omits one of the pair gives the survivor the full width instead of leaving a ragged half-row.
28
+ //
29
+ // The Zustand context subscription refreshes these values; the existing observer wrapper also
30
+ // remains available for observable values supplied by external controls.
31
+ return observe(() => {
32
+ const documentFields = ["issuingCountry", "expiryDate"].filter(isVisible);
33
+ // spec:3851 — CSP: Read all capture inputs in the existing observer render.
34
+ const capturedFields = {
35
+ shape: legal.shape,
36
+ values: legal.capturedValues,
37
+ fieldErrors: legal.shapeErrors,
38
+ onChange: setCapturedValue,
39
+ };
40
+ return (React.createElement(React.Fragment, null,
41
+ React.createElement(Tabs, { activeKey: legal.tabKey, tabPlacement: "start", onChange: (key) => (legal.tabKey = key), items: [
42
+ {
43
+ key: "Contact",
44
+ label: "Contact Info",
45
+ children: (React.createElement(Form, { layout: "vertical" },
46
+ React.createElement(Form.Item, { label: "E-mail" },
47
+ React.createElement(Input, { value: legal.email, onChange: (e) => {
48
+ legal.email = e.target.value;
49
+ } })),
50
+ React.createElement(Form.Item, { label: "Phone" },
51
+ React.createElement(Input, { value: legal.phone, onChange: (e) => {
52
+ legal.phone = e.target.value;
53
+ } })),
54
+ React.createElement(Address, { value: legal.address, onChange: (v) => {
55
+ legal.address = v;
56
+ } }))),
57
+ },
58
+ {
59
+ key: "Identify",
60
+ label: "Identify Info",
61
+ children: (React.createElement(Form, { layout: "vertical" },
62
+ React.createElement(Form.Item, { label: legal.unitType === "Organization" ? "Country of Registration" : "Country", name: "country", rules: [{ required: true }] },
63
+ React.createElement(InputCountry, { defaultValue: legal.country, onChange: (country) => (legal.country = country) })),
64
+ React.createElement(Form.Item, { label: "Identity type", required: true, validateStatus: legal.shapeErrors.shape ? "error" : undefined, help: legal.shapeErrors.shape },
65
+ React.createElement(IdentityShapeSelect, { subject: legal.unitType === "Organization" ? "Organization" : "Person", value: legal.shape?.source, capturedShapeName: legal.shape?.name, onChange: selectShape, onCatalogStatus: (status) => (legal.catalogStatus = status) })),
66
+ renderCapturedIdentityColumn("alias", 24, capturedFields),
67
+ documentFields.length > 0 && (React.createElement(Row, { gutter: 16 },
68
+ renderCapturedIdentityColumn("issuingCountry", documentFields.length > 1 ? 12 : 24, capturedFields),
69
+ renderCapturedIdentityColumn("expiryDate", documentFields.length > 1 ? 12 : 24, capturedFields))),
70
+ React.createElement(Form.Item, { label: legal.unitType === "Organization" ? "Registration #" : "Identify #", rules: [{ required: true }] },
71
+ React.createElement(Input, { value: legal.number, onChange: (e) => {
72
+ legal.number = e.target.value;
73
+ } })))),
74
+ },
75
+ ] }),
76
+ React.createElement("div", { className: "select-legal-contact_footer" },
77
+ React.createElement(Button, { size: "middle", onClick: () => {
78
+ legal.step -= 1;
79
+ } }, "Back"),
80
+ React.createElement(Button, { size: "middle", type: "primary", onClick: next }, "Next")),
81
+ React.createElement(ShapeChangeConfirm, { pendingShape: pendingShape, values: legal.capturedValues, onConfirm: applyShape, onCancel: () => setPendingShape(null) })));
82
+ });
83
+ /** spec:3715 — Keep the current capture while populated fields need confirmation to be cleared. */
84
+ function selectShape(shape) {
85
+ if (hiddenFieldsFor(shape, legal.capturedValues).length > 0)
86
+ setPendingShape(shape);
87
+ else
88
+ applyShape(shape);
89
+ }
90
+ /** spec:3851 — Apply an admitted replacement with only the fields its policies still capture. */
91
+ function applyShape(shape) {
92
+ const values = clearHiddenFields(shape, legal.capturedValues);
93
+ legal.alias = values.alias ?? "";
94
+ legal.issuingCountry = values.issuingCountry ?? "";
95
+ legal.expiryDate = values.expiryDate;
96
+ legal.shape = shape;
97
+ legal.shapeErrors = {};
98
+ setPendingShape(null);
99
+ }
100
+ /** Write one captured value back into the wizard buffer, clearing the message it just satisfied. */
101
+ function setCapturedValue(field, value) {
102
+ if (field === "alias")
103
+ legal.alias = value ?? "";
104
+ else if (field === "issuingCountry")
105
+ legal.issuingCountry = value ?? "";
106
+ else
107
+ legal.expiryDate = value ?? "";
108
+ if (legal.shapeErrors[field]) {
109
+ const next = { ...legal.shapeErrors };
110
+ delete next[field];
111
+ legal.shapeErrors = next;
112
+ }
113
+ }
56
114
  /** 下一个步骤, 如果是 create existing contact, 跳过Page2跟Page3 */
57
115
  function next() {
58
- runInAction(() => {
59
- if (!legal.number || !legal.country) {
60
- message.warning(legal.unitType === "Organization"
61
- ? "Country && Registration are required"
62
- : "Country && Identify are required");
63
- /** 如果 Identify Info 为空, 则跳转 Identify Tab */
64
- legal.tabKey = "Identify";
65
- return;
66
- }
67
- legal.step += 1;
68
- });
116
+ if (!legal.number || !legal.country) {
117
+ message.warning(legal.unitType === "Organization"
118
+ ? "Country && Registration are required"
119
+ : "Country && Identify are required");
120
+ /** 如果 Identify Info 为空, 则跳转 Identify Tab */
121
+ legal.tabKey = "Identify";
122
+ return;
123
+ }
124
+ /** spec:3717 — COMPLIANCE: A shape-dependent step is blocked until the catalog is available */
125
+ if (legal.catalogStatus !== "ready") {
126
+ message.warning(CATALOG_UNAVAILABLE_MESSAGE);
127
+ legal.tabKey = "Identify";
128
+ return;
129
+ }
130
+ // spec:3851 — CSP: The identity step refuses to advance while the picked shape's captured mandatory fields are empty
131
+ const missing = legal.advanceFromIdentityStep();
132
+ if (missing.length > 0) {
133
+ message.warning(`Identity information required: ${missing.join(", ")}`);
134
+ legal.tabKey = "Identify";
135
+ }
69
136
  }
70
137
  };
71
138
  export default Page4;
@@ -1 +1 @@
1
- {"version":3,"file":"Page4.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,QAA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,EAAC,QAAQ,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,IAAI,WAEzC,CACJ,CACU,CACjB,CAAC,CAAC;IAEH,wDAAwD;IACxD,SAAS,IAAI;QACZ,WAAW,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACrC,OAAO,CAAC,OAAO,CACd,KAAK,CAAC,QAAQ,KAAK,cAAc;oBAChC,CAAC,CAAC,sCAAsC;oBACxC,CAAC,CAAC,kCAAkC,CACrC,CAAC;gBACF,6CAA6C;gBAC7C,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;gBAC1B,OAAO;YACR,CAAC;YAED,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AACF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Page4.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/SelectLegalContactDialog/Page4.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/D,OAAO,OAAO,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,EACN,iBAAiB,EACjB,eAAe,GACf,MAAM,6DAA6D,CAAC;AAGrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,kBAAkB,MAAM,4DAA4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kCAAkC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxE,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;QAC3B,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AACF,eAAe,KAAK,CAAC"}
@@ -1,3 +1,3 @@
1
- import React from "react";
2
- declare const Page5: () => React.JSX.Element;
1
+ /** Review the captured identity and retain completed directory writes when a submission is abandoned. */
2
+ declare const Page5: () => JSX.Element;
3
3
  export default Page5;
@@ -1,13 +1,95 @@
1
- import { Button, Form } from "antd";
2
- import React from "react";
1
+ import { Alert, Button, Form, Modal } from "antd";
2
+ import React, { useEffect } from "react";
3
3
  import { observe } from "@voplus/morpho-ui";
4
- import { runInAction } from "mobx";
5
4
  import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
6
5
  import { useIdentityStore } from "../../../../../../data/identity";
6
+ import { useUnitStore } from "@voplus/morpho-org";
7
7
  import { useLegalContext } from "./state";
8
+ /** What each step of the create sequence is doing, shown while it runs. */
9
+ const SAVING_MESSAGE = {
10
+ contact: "Creating the contact…",
11
+ details: "Saving the contact details…",
12
+ identity: "Creating the identity…",
13
+ };
14
+ /** spec:3851 — how a stopped sequence explains itself: which contact exists, which write failed,
15
+ * and that the contact stays in the contact directory to be finished later. */
16
+ const FAILURE_COPY = {
17
+ contact: (contact) => ({
18
+ message: `Creating the contact "${contact}" failed.`,
19
+ description: "Nothing was created yet. Your entries and the identity type you picked are still here — retry to try again.",
20
+ }),
21
+ details: (contact) => ({
22
+ message: `Contact "${contact}" was created, but saving its contact details failed.`,
23
+ description: "Your entries and the identity type you picked are still here. Retry to finish — it reuses the same contact and never creates a second one. The contact stays in the contact directory, where it can be completed later.",
24
+ }),
25
+ identity: (contact) => ({
26
+ message: `Contact "${contact}" was created, but creating its identity failed.`,
27
+ description: "Your entries and the identity type you picked are still here. Retry to finish — it reuses the same contact and never creates a second one. The contact stays in the contact directory, where it can be completed later.",
28
+ }),
29
+ };
30
+ /** Review the captured identity and retain completed directory writes when a submission is abandoned. */
8
31
  const Page5 = () => {
9
32
  const legal = useLegalContext();
33
+ // spec:3851 — A whole-wizard/replacement unmount revokes delivery. Intra-wizard Back first changes
34
+ // the step, so its review unmount keeps the retained owner/result owned by this wizard lifetime.
35
+ useEffect(() => () => {
36
+ if (legal.step === 5)
37
+ legal.invalidateSubmission();
38
+ }, [legal]);
10
39
  const identityStore = useIdentityStore();
40
+ const unitStore = useUnitStore();
41
+ // spec:3851 — CSP: Submission performs create owner → save entered contact details → create identity
42
+ /**
43
+ * The three writes the ordered sequence performs, bound to the stores this step has: the dialog
44
+ * state owns which step runs, what a failure names and what a retry reuses, so the review only
45
+ * has to say how each write is issued.
46
+ */
47
+ const writes = {
48
+ /** Create the owning contact (the only write that can fail with nothing created). */
49
+ createOwner: async () => {
50
+ const created = await unitStore.create({
51
+ data: { name: legal.fullName, type: legal.unitType },
52
+ });
53
+ return { id: created.id, name: created.name || legal.fullName };
54
+ },
55
+ /**
56
+ * spec:3851 — save the entered contact details onto the created owner. `UnitStore.edit`
57
+ * returns no success value: a failed write is reported through its **error callback** and
58
+ * nowhere else, so that callback is what turns the failure into the rejection that halts
59
+ * the sequence against the contact already created.
60
+ */
61
+ saveDetails: async (ownerId, name) => {
62
+ let failure;
63
+ await unitStore.edit(ownerId, {
64
+ data: {
65
+ ...(name === undefined ? {} : { Name: name }),
66
+ Email: legal.email,
67
+ Phone: legal.phone,
68
+ Address: toEditAddress(legal.address),
69
+ },
70
+ error: (e) => (failure = e),
71
+ });
72
+ if (failure)
73
+ throw failure;
74
+ },
75
+ /** Create the identity from that owner and the picked shape's `source` number. */
76
+ createIdentity: async (ownerId, shape) => {
77
+ await identityStore.create({
78
+ data: {
79
+ UnitId: ownerId,
80
+ SourceNumber: shape.source,
81
+ FullName: legal.fullName,
82
+ Number: String(legal.number),
83
+ Country: legal.country,
84
+ Alias: legal.alias || undefined,
85
+ IssuingCountry: legal.issuingCountry || undefined,
86
+ ExpiryDate: legal.expiryDate || undefined,
87
+ },
88
+ });
89
+ },
90
+ };
91
+ const failureCopy = legal.failedOperation
92
+ ? FAILURE_COPY[legal.failedOperation](legal.createdOwner?.name ?? legal.fullName) : undefined;
11
93
  return observe(() => (React.createElement(React.Fragment, null,
12
94
  React.createElement("div", { className: "select-legal-contact_content page5" },
13
95
  React.createElement("div", { className: "full-name" }, legal.fullName),
@@ -27,33 +109,46 @@ const Page5 = () => {
27
109
  legal.address?.line2 ? legal.address.line2 + ", " : "",
28
110
  legal.address?.city ? legal.address.city + ", " : "",
29
111
  legal.address?.state ? legal.address.state + ", " : "",
30
- legal.address?.country))),
112
+ legal.address?.country),
113
+ React.createElement(Form.Item, { label: "Identity type" }, legal.shape?.name ?? "—")),
114
+ legal.savingStep && (React.createElement(Alert, { className: "mt-md", type: "info", showIcon: true, message: SAVING_MESSAGE[legal.savingStep] })),
115
+ legal.failedOperation && (React.createElement(Alert, { className: "mt-md", type: "error", showIcon: true, message: failureCopy?.message, description: failureCopy?.description }))),
31
116
  React.createElement("div", { className: "select-legal-contact_footer" },
32
- React.createElement(Button, { size: "middle", onClick: () => runInAction(() => (legal.operate === "Search" ? (legal.step = 1) : (legal.step -= 1))) }, "Back"),
33
- React.createElement(Button, { size: "middle", type: "primary", loading: legal.saving, onClick: legal.operate === "Search" ? Ok : create }, legal.operate === "Search" ? "Ok" : "Create")))));
117
+ legal.createdOwner && (React.createElement(Button, { size: "middle", onClick: legal.requestLeave }, "Cancel")),
118
+ React.createElement(Button, { size: "middle", disabled: legal.saving, onClick: () => (legal.operate === "Search" ? (legal.step = 1) : (legal.step -= 1)) }, "Back"),
119
+ React.createElement(Button, { size: "middle", type: "primary", loading: legal.saving, onClick: legal.operate === "Search" ? Ok : onCreate }, legal.operate === "Search" ? "Ok" : legal.failedOperation ? "Retry" : "Create")),
120
+ React.createElement(Modal, { open: legal.disclosureOpen, title: "Create this contact?", okText: "Create contact", cancelText: "Cancel", onOk: confirmCreate, onCancel: () => (legal.disclosureOpen = false) },
121
+ React.createElement(Alert, { type: "info", showIcon: true, message: "The contact is created first and is added to the contact directory.", description: "If saving its contact details or its identity fails \u2014 or you leave before finishing \u2014 the contact stays in the directory and can be completed later." })))));
122
+ /** Report the selected existing owner to the host. */
34
123
  function Ok() {
35
124
  if (legal.unitId)
36
125
  legal.props.updateVisible?.(legal.unitId);
37
126
  }
38
- /** create a new contact */
39
- async function create() {
40
- const Option = {
41
- FullName: legal.fullName,
42
- Number: legal.number,
43
- Country: legal.country,
44
- ExpiryDate: legal.expiryDate,
45
- Type: legal.type,
46
- Email: legal.email,
47
- Phone: legal.phone,
48
- Address: legal.address,
49
- UnitType: legal.unitType,
127
+ /** spec:3851 — the pre-create disclosure stands between the review and the first write. */
128
+ function onCreate() {
129
+ // A retry resumes the sequence against the contact it already created, so nothing is written
130
+ // that the disclosure did not already cover; the first attempt is disclosed first.
131
+ if (legal.failedOperation) {
132
+ void legal.submitCreate(writes);
133
+ return;
134
+ }
135
+ legal.openDisclosure();
136
+ }
137
+ /** The disclosed create: the user accepted that the contact is written first and stays behind. */
138
+ function confirmCreate() {
139
+ legal.closeDisclosure();
140
+ void legal.submitCreate(writes);
141
+ }
142
+ /** The contact address in its wire shape. */
143
+ function toEditAddress(address) {
144
+ return {
145
+ Line1: address?.line1 ?? "",
146
+ Line2: address?.line2,
147
+ City: address?.city,
148
+ State: address?.state,
149
+ PostalCode: address?.postalCode,
150
+ Country: address?.country ?? "",
50
151
  };
51
- runInAction(() => (legal.saving = true));
52
- await identityStore.create({ data: Option, error: "message" }).then((res) => {
53
- if (legal.props.updateVisible && res.unitId)
54
- legal.props.updateVisible(res.unitId);
55
- runInAction(() => (legal.saving = false));
56
- });
57
152
  }
58
153
  };
59
154
  export default Page5;
@@ -1 +1 @@
1
- {"version":3,"file":"Page5.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE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Aa,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;IACD,2BAA2B;IAC3B,KAAK,UAAU,MAAM;QACpB,MAAM,MAAM,GAAG;YACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACxB,CAAC;QACF,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;QACzC,MAAM,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAa,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YAClF,IAAI,KAAK,CAAC,KAAK,CAAC,aAAa,IAAI,GAAG,CAAC,MAAM;gBAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACnF,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AACF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Page5.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/SelectLegalContactDialog/Page5.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,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AK,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAChC,OAAO;QACR,CAAC;QACD,KAAK,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,kGAAkG;IAClG,SAAS,aAAa;QACrB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,6CAA6C;IAC7C,SAAS,aAAa,CAAC,OAAiB;QACvC,OAAO;YACN,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;YAC3B,KAAK,EAAE,OAAO,EAAE,KAAK;YACrB,IAAI,EAAE,OAAO,EAAE,IAAI;YACnB,KAAK,EAAE,OAAO,EAAE,KAAK;YACrB,UAAU,EAAE,OAAO,EAAE,UAAU;YAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE;SAC/B,CAAC;IACH,CAAC;AACF,CAAC,CAAC;AACF,eAAe,KAAK,CAAC"}
@@ -1,4 +1,3 @@
1
- import "./index.css";
2
1
  import React from "react";
3
2
  declare const SelectLegalContactDialog: (props: {
4
3
  visible: boolean;
@@ -1,19 +1,27 @@
1
- import "./index.css";
2
- import { Modal } from "antd";
3
- import { LegalContext, State } from "./state";
1
+ import { LegalContext, State, useLegalContext } from "./state";
4
2
  import React, { useState } from "react";
3
+ import DialogShell from "./DialogShell";
5
4
  import Page1 from "./Page1";
6
5
  import Page2 from "./Page2";
7
6
  import Page3 from "./Page3";
8
7
  import Page4 from "./Page4";
9
8
  import Page5 from "./Page5";
10
- import { observe } from "@voplus/morpho-ui";
9
+ /**
10
+ * The step of the wizard that is on screen. It reads the dialog state through the same hook every
11
+ * step uses, so advancing a step — or a create sequence reporting the write it is on — re-renders
12
+ * the wizard instead of leaving the previous step up.
13
+ */
14
+ const CurrentStep = () => {
15
+ const legal = useLegalContext();
16
+ return legal.step === 5 ? (React.createElement(Page5, null)) : legal.step === 4 ? (React.createElement(Page4, null)) : legal.step === 3 ? (React.createElement(Page3, null)) : legal.step === 2 ? (React.createElement(Page2, null)) : (React.createElement(Page1, null));
17
+ };
11
18
  const SelectLegalContactDialog = (props) => {
12
- const { visible, updateVisible } = props;
13
- const [state] = useState(new State());
19
+ const { visible } = props;
20
+ const [state] = useState(() => new State());
14
21
  state.props = props;
15
- return observe(() => (React.createElement(LegalContext.Provider, { value: state },
16
- React.createElement(Modal, { width: 500, title: "", footer: null, closable: false, wrapClassName: "select-legal-contact-dialog", onCancel: () => updateVisible?.(), open: visible }, state.step === 5 ? (React.createElement(Page5, null)) : state.step === 4 ? (React.createElement(Page4, null)) : state.step === 3 ? (React.createElement(Page3, null)) : state.step === 2 ? (React.createElement(Page2, null)) : (React.createElement(Page1, null))))));
22
+ return (React.createElement(LegalContext.Provider, { value: state },
23
+ React.createElement(DialogShell, { visible: visible },
24
+ React.createElement(CurrentStep, null))));
17
25
  };
18
26
  export default SelectLegalContactDialog;
19
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/SelectLegalContactDialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAU,KAAK,EAAW,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,wBAAwB,GAAG,CAAC,KAGjC,EAAE,EAAE;IACJ,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAEzC,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAEtC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAEpB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;QAClC,oBAAC,KAAK,IACL,KAAK,EAAE,GAAG,EACV,KAAK,EAAC,EAAE,EACR,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,KAAK,EACf,aAAa,EAAC,6BAA6B,EAC3C,QAAQ,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,EAAE,EACjC,IAAI,EAAE,OAAO,IAEZ,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CACnB,oBAAC,KAAK,OAAG,CACT,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,oBAAC,KAAK,OAAG,CACT,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,oBAAC,KAAK,OAAG,CACT,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,oBAAC,KAAK,OAAG,CACT,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,OAAG,CACT,CACM,CACe,CACxB,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/SelectLegalContactDialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,WAAW,MAAM,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