@voplus/morpho-csp 1.2.102-fix2 → 1.2.102-fix3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/data/identity/IdentityStore.d.ts +2 -4
- package/es/data/identity/IdentityStore.js.map +1 -1
- package/es/data/identity/interfaces.d.ts +1 -1
- package/es/data/identity/types.d.ts +7 -7
- package/es/data/incorporation-form/interfaces.d.ts +2 -2
- package/es/data/incorporation-form/types.d.ts +1 -0
- package/es/modules/corporate/company/identity/components/IdentityInformation/index.js +15 -18
- package/es/modules/corporate/company/identity/components/IdentityInformation/index.js.map +1 -1
- package/es/modules/corporate/company/identity/components/IdentityInformation/state.d.ts +3 -12
- package/es/modules/corporate/company/identity/components/IdentityInformation/state.js +21 -59
- package/es/modules/corporate/company/identity/components/IdentityInformation/state.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiEndPoint } from "@voplus/api";
|
|
2
2
|
import { CountedMap, Store, StoreActionOptions } from "@voplus/morpho-data";
|
|
3
|
-
import { IdentityCreateOptions, LoadIdentityOptions } from "./types";
|
|
3
|
+
import { IdentityCreateOptions, IdentityEditOptions, LoadIdentityOptions } from "./types";
|
|
4
4
|
import { IIdentity } from "./interfaces";
|
|
5
5
|
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
6
6
|
/** Quotation store supply backend functions. */
|
|
@@ -22,9 +22,7 @@ export declare class IdentityStore extends Store {
|
|
|
22
22
|
data: IdentityCreateOptions;
|
|
23
23
|
} & StoreActionOptions): Promise<IIdentity>;
|
|
24
24
|
/** Edit an existing item on server. */
|
|
25
|
-
edit(id: string, options:
|
|
26
|
-
data: IdentityCreateOptions;
|
|
27
|
-
} & StoreActionOptions): Promise<any>;
|
|
25
|
+
edit(id: string, options: IdentityEditOptions): Promise<any>;
|
|
28
26
|
delete(id: string, options?: any): Promise<IIdentity>;
|
|
29
27
|
reveal(id: string, options?: StoreActionOptions): Promise<{
|
|
30
28
|
number: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityStore.js","sourceRoot":"","sources":["../../../src/data/identity/IdentityStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAsB,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGnG,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,gDAAgD;AAChD,MAAM,OAAO,aAAc,SAAQ,KAAK;IAMvC,YAAmC,QAAqB;QACvD,KAAK,EAAE,CAAC;;;;;mBAD0B;;QALnC,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;QACzC;;;;mBAAoC,IAAI,eAAe,EAA4B;WAAC;QACpF;;;;mBAAoC,IAAI,eAAe,EAA4B;WAAC;QAMpF,mCAAmC;QACnC;;;;mBAAuD,IAAI,UAAU,CACpE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAgB,CAAA,EAC1D,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAClC;WAAC;IANF,CAAC;IAQD,2DAA2D;IAC3D,IAAW,oBAAoB;QAC9B,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;IAED,wDAAwD;IACxD,IAAW,oBAAoB;QAC9B,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;IAED,6BAA6B;IACtB,KAAK,CAAC,MAAM,CAClB,OAA6D;QAE7D,oDAAoD;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;YA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MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACjC,kBAAkB,KAAK,EAAE,EACzB,IAAI,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC9D,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAgB,CAAC;IACxC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,EAAU,EAAE,OAA4B;QACzD,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,OAAO,CAAC,QAAQ;YAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,IAAI,KAAK;YAAE,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;CACD;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACpC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QACnC,OAAO,CAAC,eAAe,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,CAAmB,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -8,7 +8,7 @@ export interface IIdentity extends ILoadable {
|
|
|
8
8
|
/** full name of the identity */
|
|
9
9
|
fullName: string;
|
|
10
10
|
/** number of the identity */
|
|
11
|
-
number?:
|
|
11
|
+
number?: string;
|
|
12
12
|
/** Indicate if the number of the identity is revealed */
|
|
13
13
|
revealed?: boolean;
|
|
14
14
|
/** country of issued of the identity */
|
|
@@ -12,7 +12,7 @@ export declare type IdentityCreateDataOptions = {
|
|
|
12
12
|
/** full name of the identity */
|
|
13
13
|
FullName?: string;
|
|
14
14
|
/** number of the identity */
|
|
15
|
-
Number?:
|
|
15
|
+
Number?: string;
|
|
16
16
|
/** country of issued of the identity */
|
|
17
17
|
Country?: string;
|
|
18
18
|
/** expiry date of the identity */
|
|
@@ -26,17 +26,17 @@ export declare type IdentityCreateDataOptions = {
|
|
|
26
26
|
};
|
|
27
27
|
export declare type IdentityEditDataOptions = {
|
|
28
28
|
/** full name of the identity */
|
|
29
|
-
|
|
29
|
+
FullName?: string;
|
|
30
30
|
/** alias of the identity */
|
|
31
|
-
|
|
31
|
+
Alias?: string;
|
|
32
32
|
/** type of the identity */
|
|
33
|
-
|
|
33
|
+
Type?: string;
|
|
34
34
|
/** number of the identity */
|
|
35
|
-
|
|
35
|
+
Number?: string;
|
|
36
36
|
/** country of issued of the identity */
|
|
37
|
-
|
|
37
|
+
Country?: string;
|
|
38
38
|
/** expiry date of the identity */
|
|
39
|
-
|
|
39
|
+
ExpiryDate?: Date;
|
|
40
40
|
};
|
|
41
41
|
export declare type IdentityCreateOptions = {
|
|
42
42
|
data: IdentityCreateDataOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAddress } from "@voplus/morpho-org/es/data/interfaces/IAddress";
|
|
2
2
|
import { IDocument } from "@voplus/morpho-document-core";
|
|
3
|
-
import {
|
|
3
|
+
import { IIdentity } from "../identity";
|
|
4
4
|
export interface IFormPeopleOptions {
|
|
5
5
|
/** 需要前端自己生成,可以用uuid */
|
|
6
6
|
id: string;
|
|
@@ -8,7 +8,7 @@ export interface IFormPeopleOptions {
|
|
|
8
8
|
email?: string;
|
|
9
9
|
phone?: string;
|
|
10
10
|
address?: IAddress;
|
|
11
|
-
identity?:
|
|
11
|
+
identity?: Partial<IIdentity>;
|
|
12
12
|
type?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface IShareholderOptions {
|
|
@@ -12,6 +12,7 @@ export declare type CreateIncorporationFormOptions = {
|
|
|
12
12
|
/** The parent id of the new Incorporation Form to be created in. */
|
|
13
13
|
ParentId: string;
|
|
14
14
|
};
|
|
15
|
+
/** 應該使用PascalCase,edit options 也不應該混用 interface, 有機會改正 - 10 Jun 2022 Alex*/
|
|
15
16
|
export declare type EditIncorporationFormOptions = {
|
|
16
17
|
/** name of the entity user going to incorporate 实体用户的名称 */
|
|
17
18
|
legalEntityName?: string;
|
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
import { Button, DatePicker, Form, Input, Select, Skeleton, Tooltip
|
|
2
|
-
import React, {
|
|
1
|
+
import { Button, DatePicker, Form, Input, Select, Skeleton, Tooltip } from "@voplus/antd";
|
|
2
|
+
import React, { useEffect, useMemo } from "react";
|
|
3
3
|
import { useIdentity, useIdentityStore } from "../../../../../../data/identity";
|
|
4
4
|
import { EditOutlined } from "@ant-design/icons";
|
|
5
5
|
import { InputCountry } from "@voplus/morpho-ui";
|
|
6
6
|
import { State } from "./state";
|
|
7
7
|
import moment from "moment";
|
|
8
8
|
import { observe } from "@voplus/morpho-ui";
|
|
9
|
+
import { when } from "mobx";
|
|
9
10
|
const IdentityInformation = (props) => {
|
|
10
11
|
const { id, allowEdit } = props;
|
|
11
12
|
const identityStore = useIdentityStore();
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const state = useMemo(() => new State(id, identityStore), [id]);
|
|
14
|
+
const identity = useIdentity(id, { reload: true });
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
when(() => identity.loaded === true, () => state.reset(identity));
|
|
17
|
+
}, [id]);
|
|
18
|
+
return observe(() => (React.createElement(React.Fragment, null, identity.loading ? (React.createElement(Skeleton, { active: true })) : (React.createElement(React.Fragment, null,
|
|
15
19
|
React.createElement("div", { className: "identity-information" },
|
|
16
20
|
React.createElement("h3", null, "Identity Information"),
|
|
17
21
|
allowEdit && (React.createElement("div", null, state.editable ? (React.createElement(React.Fragment, null,
|
|
18
|
-
React.createElement(Button, { type: "text", onClick: state.
|
|
22
|
+
React.createElement(Button, { type: "text", onClick: () => state.reset(identity) }, "Cancel"),
|
|
19
23
|
React.createElement(Button, { type: "link", loading: state.loading, onClick: state.onOk }, "Ok"))) : (React.createElement(Tooltip, { title: "Edit" },
|
|
20
24
|
React.createElement(Button, { type: "link", onClick: onEdit },
|
|
21
25
|
React.createElement(EditOutlined, null))))))),
|
|
22
26
|
React.createElement(Form, { labelAlign: "left", labelCol: { span: 5 } },
|
|
23
|
-
React.createElement(Form.Item, { label: "Country",
|
|
24
|
-
React.createElement(Form.Item, { label: "Identity Type",
|
|
27
|
+
React.createElement(Form.Item, { label: "Country", rules: [{ required: true }] }, state.editable ? (React.createElement(InputCountry, { defaultValue: state.value.Country, onChange: (v) => (state.value.Country = v) })) : (identity.country)),
|
|
28
|
+
React.createElement(Form.Item, { label: "Identity Type", rules: [{ required: true }] }, state.editable ? (React.createElement(Select, { value: state.value.Type, onChange: (v) => (state.value.Type = v) },
|
|
25
29
|
React.createElement(Select.Option, { value: "Passport" }, "International Passport"),
|
|
26
30
|
React.createElement(Select.Option, { value: "IdentityCard" }, "Identify Card"),
|
|
27
|
-
React.createElement(Select.Option, { value: "BusinessRegistration" }, "Business Registration"))) : (
|
|
28
|
-
React.createElement(Form.Item, { label: "Identity #",
|
|
29
|
-
|
|
30
|
-
, {
|
|
31
|
-
// defaultValue={state.identity.number}
|
|
32
|
-
value: state.identity.number, onChange: (e) => (state.identity.number = e.target.value) })) : (state.identity
|
|
33
|
-
.number.toString()
|
|
34
|
-
.slice(-4)
|
|
35
|
-
.padStart(state.identity.number.toString().length, "*"))),
|
|
36
|
-
React.createElement(Form.Item, { label: "Expiry Date", name: "expiryDate", rules: [{ required: state.Type === "Passport" }] }, state.editable ? (React.createElement(DatePicker, { defaultValue: moment(state.identity.expiryDate), value: state.identity.expiryDate, onChange: (date) => (state.identity.expiryDate = date) })) : (moment(state.identity.expiryDate).format("YYYY-MM-DD")))))))));
|
|
31
|
+
React.createElement(Select.Option, { value: "BusinessRegistration" }, "Business Registration"))) : (identity.type)),
|
|
32
|
+
React.createElement(Form.Item, { label: "Identity #", rules: [{ required: true }] }, state.editable ? (React.createElement(Input, { value: state.value.Number, onChange: (e) => (state.value.Number = e.target.value) })) : (identity.number)),
|
|
33
|
+
React.createElement(Form.Item, { label: "Expiry Date", name: "expiryDate", rules: [{ required: state.value.Type === "Passport" }] }, state.editable ? (React.createElement(DatePicker, { value: moment(state.value.ExpiryDate), onChange: (date) => (state.value.ExpiryDate = date === null || date === void 0 ? void 0 : date.toDate()) })) : (identity.expiryDate && moment(identity.expiryDate).format("YYYY-MM-DD")))))))));
|
|
37
34
|
/** hover edit IdentityInformation */
|
|
38
35
|
function onEdit() {
|
|
39
36
|
state.editable = !!allowEdit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityInformation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityInformation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,KAA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,sCAAsC;IACtC,SAAS,MAAM;QACd,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC;IAC9B,CAAC;AACF,CAAC,CAAC;AACF,mBAAmB,CAAC,YAAY,GAAG;IAClC,SAAS,EAAE,IAAI;CACf,CAAC;AACF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import { IIdentity, IdentityStore } from "../../../../../../data/identity";
|
|
2
|
-
import moment from "moment";
|
|
1
|
+
import { IIdentity, IdentityEditDataOptions, IdentityStore } from "../../../../../../data/identity";
|
|
3
2
|
export declare class State {
|
|
4
3
|
private id;
|
|
5
4
|
private identityStore;
|
|
6
5
|
/** hover on edit */
|
|
7
6
|
editable: boolean;
|
|
8
7
|
/** */
|
|
9
|
-
|
|
10
|
-
/** */
|
|
11
|
-
Type: string;
|
|
12
|
-
/** */
|
|
13
|
-
Country: string;
|
|
14
|
-
/** */
|
|
15
|
-
ExpiryDate: moment.Moment;
|
|
16
|
-
/** */
|
|
17
|
-
identity: IIdentity;
|
|
8
|
+
value: Partial<IdentityEditDataOptions>;
|
|
18
9
|
/** loading of save */
|
|
19
10
|
loading: boolean;
|
|
20
11
|
constructor(id: string, identityStore: IdentityStore);
|
|
21
|
-
|
|
12
|
+
reset: (identity: IIdentity) => void;
|
|
22
13
|
onOk: () => Promise<any>;
|
|
23
14
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { action, makeAutoObservable, observable } from "mobx";
|
|
2
|
+
import { action, makeAutoObservable, observable, toJS } from "mobx";
|
|
3
3
|
import { message } from "@voplus/antd";
|
|
4
|
-
import moment from "moment";
|
|
5
4
|
export class State {
|
|
6
5
|
constructor(id, identityStore) {
|
|
7
6
|
Object.defineProperty(this, "id", {
|
|
@@ -24,39 +23,11 @@ export class State {
|
|
|
24
23
|
value: false
|
|
25
24
|
});
|
|
26
25
|
/** */
|
|
27
|
-
Object.defineProperty(this, "
|
|
26
|
+
Object.defineProperty(this, "value", {
|
|
28
27
|
enumerable: true,
|
|
29
28
|
configurable: true,
|
|
30
29
|
writable: true,
|
|
31
|
-
value:
|
|
32
|
-
});
|
|
33
|
-
/** */
|
|
34
|
-
Object.defineProperty(this, "Type", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: ""
|
|
39
|
-
});
|
|
40
|
-
/** */
|
|
41
|
-
Object.defineProperty(this, "Country", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true,
|
|
45
|
-
value: ""
|
|
46
|
-
});
|
|
47
|
-
/** */
|
|
48
|
-
Object.defineProperty(this, "ExpiryDate", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true,
|
|
51
|
-
writable: true,
|
|
52
|
-
value: moment()
|
|
53
|
-
});
|
|
54
|
-
/** */
|
|
55
|
-
Object.defineProperty(this, "identity", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
configurable: true,
|
|
58
|
-
writable: true,
|
|
59
|
-
value: void 0
|
|
30
|
+
value: {}
|
|
60
31
|
});
|
|
61
32
|
/** loading of save */
|
|
62
33
|
Object.defineProperty(this, "loading", {
|
|
@@ -65,12 +36,18 @@ export class State {
|
|
|
65
36
|
writable: true,
|
|
66
37
|
value: false
|
|
67
38
|
});
|
|
68
|
-
Object.defineProperty(this, "
|
|
39
|
+
Object.defineProperty(this, "reset", {
|
|
69
40
|
enumerable: true,
|
|
70
41
|
configurable: true,
|
|
71
42
|
writable: true,
|
|
72
|
-
value: () => {
|
|
43
|
+
value: (identity) => {
|
|
73
44
|
this.editable = false;
|
|
45
|
+
this.value = toJS({
|
|
46
|
+
Number: undefined,
|
|
47
|
+
Type: identity.type,
|
|
48
|
+
Country: identity.country,
|
|
49
|
+
ExpiryDate: identity.expiryDate,
|
|
50
|
+
});
|
|
74
51
|
}
|
|
75
52
|
});
|
|
76
53
|
Object.defineProperty(this, "onOk", {
|
|
@@ -78,19 +55,16 @@ export class State {
|
|
|
78
55
|
configurable: true,
|
|
79
56
|
writable: true,
|
|
80
57
|
value: async () => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(this.
|
|
58
|
+
var _a, _b;
|
|
59
|
+
if (!((_a = this.value) === null || _a === void 0 ? void 0 : _a.Number) ||
|
|
60
|
+
!((_b = this.value) === null || _b === void 0 ? void 0 : _b.Country) ||
|
|
61
|
+
(this.value.Type === "Passport" && !this.value.ExpiryDate))
|
|
84
62
|
return message.warn("Identity information required");
|
|
85
|
-
const { number, country, type, expiryDate } = this.identity;
|
|
86
|
-
const Options = {
|
|
87
|
-
Number: number,
|
|
88
|
-
Country: country,
|
|
89
|
-
Type: type,
|
|
90
|
-
ExpiryDate: moment(expiryDate).format("YYYY-MM-DD"),
|
|
91
|
-
};
|
|
92
63
|
this.loading = true;
|
|
93
|
-
await this.identityStore.edit(this.id, {
|
|
64
|
+
await this.identityStore.edit(this.id, {
|
|
65
|
+
data: toJS(this.value),
|
|
66
|
+
error: "message",
|
|
67
|
+
});
|
|
94
68
|
this.loading = false;
|
|
95
69
|
return (this.editable = false);
|
|
96
70
|
}
|
|
@@ -103,25 +77,13 @@ __decorate([
|
|
|
103
77
|
], State.prototype, "editable", void 0);
|
|
104
78
|
__decorate([
|
|
105
79
|
observable
|
|
106
|
-
], State.prototype, "
|
|
107
|
-
__decorate([
|
|
108
|
-
observable
|
|
109
|
-
], State.prototype, "Type", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
observable
|
|
112
|
-
], State.prototype, "Country", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
observable
|
|
115
|
-
], State.prototype, "ExpiryDate", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
observable
|
|
118
|
-
], State.prototype, "identity", void 0);
|
|
80
|
+
], State.prototype, "value", void 0);
|
|
119
81
|
__decorate([
|
|
120
82
|
observable
|
|
121
83
|
], State.prototype, "loading", void 0);
|
|
122
84
|
__decorate([
|
|
123
85
|
action
|
|
124
|
-
], State.prototype, "
|
|
86
|
+
], State.prototype, "reset", void 0);
|
|
125
87
|
__decorate([
|
|
126
88
|
action
|
|
127
89
|
], State.prototype, "onOk", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityInformation/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../../src/modules/corporate/company/identity/components/IdentityInformation/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,KAAK;IASjB,YAA2B,EAAU,EAAU,aAA4B;;;;;mBAAhD;;;;;;mBAAoB;;QAR/C,oBAAoB;QACR;;;;mBAAkB,KAAK;WAAC;QACpC,MAAM;QACM;;;;mBAAiD,EAAE;WAAC;QAEhE,sBAAsB;QACV;;;;mBAAiB,KAAK;WAAC;QAQnC;;;;mBAAe,CAAC,QAAmB,EAAE,EAAE;gBACtC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;oBACjB,MAAM,EAAE,SAAS;oBACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,UAAU,EAAE,QAAQ,CAAC,UAAU;iBAC/B,CAAC,CAAC;YACJ,CAAC;WAAC;QAIF;;;;mBAAc,KAAK,IAAI,EAAE;;gBACxB,IACC,CAAC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,CAAA;oBACnB,CAA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