@powerhousedao/design-system 1.7.2 → 1.9.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/dist/connect/components/index.d.ts +0 -1
- package/dist/index.js +368 -369
- package/dist/index.js.map +1 -1
- package/dist/rwa/components/inputs/entry-time-label.d.ts +5 -0
- package/dist/rwa/components/inputs/entry-time-label.js +12 -0
- package/dist/rwa/components/inputs/entry-time-label.js.map +1 -0
- package/dist/rwa/hooks/useDefaultFormValues.js +12 -12
- package/dist/rwa/hooks/useDefaultFormValues.js.map +1 -1
- package/dist/rwa/hooks/useFormInputs.d.ts +2 -2
- package/dist/rwa/hooks/useFormInputs.js +249 -247
- package/dist/rwa/hooks/useFormInputs.js.map +1 -1
- package/dist/rwa/hooks/useTableForm.d.ts +1 -1
- package/dist/rwa/utils/date.d.ts +3 -5
- package/dist/rwa/utils/date.js +16 -11
- package/dist/rwa/utils/date.js.map +1 -1
- package/package.json +1 -1
- package/dist/connect/components/date-time-input/date-time-local-input.d.ts +0 -5
- package/dist/connect/components/date-time-input/date-time-local-input.js +0 -23
- package/dist/connect/components/date-time-input/date-time-local-input.js.map +0 -1
- package/dist/connect/components/date-time-input/index.d.ts +0 -1
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { CashBalanceChange as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useEditorContext as
|
|
9
|
-
import { useModal as
|
|
10
|
-
import { tableNames as
|
|
11
|
-
import { feesTransactions as
|
|
12
|
-
import { makeFixedIncomeOptionLabel as
|
|
13
|
-
import {
|
|
14
|
-
import { formatDateForDisplay as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { handleTableDatum as
|
|
18
|
-
function
|
|
1
|
+
import { jsxs as F, Fragment as g, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as D, useMemo as k } from "react";
|
|
3
|
+
import { CashBalanceChange as B } from "../components/table/transactions/cash-balance-change.js";
|
|
4
|
+
import { EntryTimeLabel as $ } from "../components/inputs/entry-time-label.js";
|
|
5
|
+
import { FeeTransactionsTable as z } from "../components/table/transactions/fee-transactions-table.js";
|
|
6
|
+
import { UnitPrice as Y } from "../components/table/transactions/unit-price.js";
|
|
7
|
+
import { TransactionReference as W } from "../components/table/transactions/transaction-reference.js";
|
|
8
|
+
import { useEditorContext as j } from "../context/editor-context.js";
|
|
9
|
+
import { useModal as G } from "../components/modal/modal-manager.js";
|
|
10
|
+
import { tableNames as f } from "../constants/names.js";
|
|
11
|
+
import { feesTransactions as H, assetGroupTransactions as Q, allGroupTransactionTypes as Z, groupTransactionTypeLabels as X } from "../constants/transactions.js";
|
|
12
|
+
import { makeFixedIncomeOptionLabel as J } from "../utils/form.js";
|
|
13
|
+
import { RWATableTextInput as u } from "../components/inputs/text-input.js";
|
|
14
|
+
import { formatDateForDisplay as K } from "../utils/date.js";
|
|
15
|
+
import { RWATableSelect as y } from "../components/inputs/select.js";
|
|
16
|
+
import { RWANumberInput as R } from "../components/inputs/number-input.js";
|
|
17
|
+
import { handleTableDatum as T } from "../utils/table.js";
|
|
18
|
+
function ge(V) {
|
|
19
19
|
const {
|
|
20
|
-
tableName:
|
|
21
|
-
operation:
|
|
22
|
-
formState:
|
|
23
|
-
tableItem:
|
|
24
|
-
register:
|
|
25
|
-
watch:
|
|
26
|
-
control:
|
|
27
|
-
} =
|
|
28
|
-
fixedIncomeTypes:
|
|
29
|
-
spvs:
|
|
30
|
-
serviceProviderFeeTypes:
|
|
31
|
-
accounts:
|
|
32
|
-
fixedIncomes:
|
|
33
|
-
} =
|
|
34
|
-
(
|
|
35
|
-
|
|
20
|
+
tableName: A,
|
|
21
|
+
operation: i,
|
|
22
|
+
formState: p,
|
|
23
|
+
tableItem: E,
|
|
24
|
+
register: b,
|
|
25
|
+
watch: q,
|
|
26
|
+
control: h
|
|
27
|
+
} = V, {
|
|
28
|
+
fixedIncomeTypes: C,
|
|
29
|
+
spvs: w,
|
|
30
|
+
serviceProviderFeeTypes: S,
|
|
31
|
+
accounts: P,
|
|
32
|
+
fixedIncomes: M
|
|
33
|
+
} = j(), { showModal: x } = G(), I = D(
|
|
34
|
+
(r) => () => {
|
|
35
|
+
x("createItem", { tableName: r });
|
|
36
36
|
},
|
|
37
|
-
[
|
|
37
|
+
[x]
|
|
38
38
|
);
|
|
39
|
-
return
|
|
40
|
-
switch (
|
|
41
|
-
case
|
|
42
|
-
const
|
|
39
|
+
return k(() => {
|
|
40
|
+
switch (A) {
|
|
41
|
+
case f.ASSET: {
|
|
42
|
+
const r = E, c = b, e = p, { errors: t } = e, o = h, d = i !== "create" && r ? [
|
|
43
43
|
{
|
|
44
44
|
label: "Notional",
|
|
45
|
-
Input: () => /* @__PURE__ */
|
|
45
|
+
Input: () => /* @__PURE__ */ s(g, { children: T(r.notional) })
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
label: "Purchase Date",
|
|
49
|
-
Input: () => /* @__PURE__ */
|
|
49
|
+
Input: () => /* @__PURE__ */ s(g, { children: T(r.purchaseDate) })
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
label: "Purchase Price",
|
|
53
|
-
Input: () => /* @__PURE__ */
|
|
53
|
+
Input: () => /* @__PURE__ */ s(g, { children: T(r.purchasePrice, 6) })
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
label: "Purchase Proceeds",
|
|
57
|
-
Input: () => /* @__PURE__ */
|
|
57
|
+
Input: () => /* @__PURE__ */ s(g, { children: T(r.purchaseProceeds) })
|
|
58
58
|
}
|
|
59
|
-
] : []
|
|
59
|
+
] : [];
|
|
60
60
|
return { inputs: [
|
|
61
61
|
{
|
|
62
62
|
label: "Asset Name",
|
|
63
63
|
Input: () => {
|
|
64
|
-
var
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
64
|
+
var a;
|
|
65
|
+
return /* @__PURE__ */ s(
|
|
66
|
+
u,
|
|
67
67
|
{
|
|
68
|
-
...
|
|
69
|
-
disabled:
|
|
68
|
+
...c("name", {
|
|
69
|
+
disabled: i === "view",
|
|
70
70
|
required: "Asset name is required"
|
|
71
71
|
}),
|
|
72
|
-
"aria-invalid":
|
|
73
|
-
errorMessage: (
|
|
72
|
+
"aria-invalid": t.name ? "true" : "false",
|
|
73
|
+
errorMessage: (a = t.name) == null ? void 0 : a.message,
|
|
74
74
|
inputClassName: "text-left",
|
|
75
75
|
placeholder: "E.g. My Asset"
|
|
76
76
|
}
|
|
@@ -80,11 +80,11 @@ function fe(L) {
|
|
|
80
80
|
{
|
|
81
81
|
label: "CUSIP",
|
|
82
82
|
Input: () => {
|
|
83
|
-
var
|
|
84
|
-
return
|
|
85
|
-
|
|
83
|
+
var a;
|
|
84
|
+
return i === "view" ? (r == null ? void 0 : r.CUSIP) ?? "Not available" : /* @__PURE__ */ s(
|
|
85
|
+
u,
|
|
86
86
|
{
|
|
87
|
-
...
|
|
87
|
+
...c("CUSIP", {
|
|
88
88
|
maxLength: {
|
|
89
89
|
value: 9,
|
|
90
90
|
message: "CUSIP cannot be longer than 9 characters"
|
|
@@ -98,8 +98,8 @@ function fe(L) {
|
|
|
98
98
|
message: "CUSIP must be alphanumeric"
|
|
99
99
|
}
|
|
100
100
|
}),
|
|
101
|
-
"aria-invalid":
|
|
102
|
-
errorMessage: (
|
|
101
|
+
"aria-invalid": t.CUSIP ? "true" : "false",
|
|
102
|
+
errorMessage: (a = t.CUSIP) == null ? void 0 : a.message,
|
|
103
103
|
placeholder: "E.g. A2345B789"
|
|
104
104
|
}
|
|
105
105
|
);
|
|
@@ -108,11 +108,11 @@ function fe(L) {
|
|
|
108
108
|
{
|
|
109
109
|
label: "ISIN",
|
|
110
110
|
Input: () => {
|
|
111
|
-
var
|
|
112
|
-
return
|
|
113
|
-
|
|
111
|
+
var a;
|
|
112
|
+
return i === "view" ? (r == null ? void 0 : r.ISIN) ?? "Not available" : /* @__PURE__ */ s(
|
|
113
|
+
u,
|
|
114
114
|
{
|
|
115
|
-
...
|
|
115
|
+
...c("ISIN", {
|
|
116
116
|
maxLength: {
|
|
117
117
|
value: 12,
|
|
118
118
|
message: "ISIN cannot be longer than 12 characters"
|
|
@@ -126,8 +126,8 @@ function fe(L) {
|
|
|
126
126
|
message: "ISIN must be alphanumeric"
|
|
127
127
|
}
|
|
128
128
|
}),
|
|
129
|
-
"aria-invalid":
|
|
130
|
-
errorMessage: (
|
|
129
|
+
"aria-invalid": t.ISIN ? "true" : "false",
|
|
130
|
+
errorMessage: (a = t.ISIN) == null ? void 0 : a.message,
|
|
131
131
|
placeholder: "E.g. 123456789ABC"
|
|
132
132
|
}
|
|
133
133
|
);
|
|
@@ -135,39 +135,39 @@ function fe(L) {
|
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
label: "Maturity",
|
|
138
|
-
Input: () => /* @__PURE__ */
|
|
139
|
-
|
|
138
|
+
Input: () => /* @__PURE__ */ s(
|
|
139
|
+
"input",
|
|
140
140
|
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
className: "h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",
|
|
142
|
+
step: 1,
|
|
143
|
+
type: "date",
|
|
144
|
+
...c("maturity", {
|
|
145
|
+
disabled: i === "view"
|
|
146
|
+
})
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
inputLabel:
|
|
149
|
+
inputLabel: r != null && r.maturity ? K(r.maturity, !0) : null
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
label: "Asset Type",
|
|
153
153
|
Input: () => {
|
|
154
|
-
var
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
|
|
154
|
+
var a;
|
|
155
|
+
return /* @__PURE__ */ s(
|
|
156
|
+
y,
|
|
157
157
|
{
|
|
158
158
|
addItemButtonProps: {
|
|
159
|
-
onClick:
|
|
159
|
+
onClick: I("ASSET"),
|
|
160
160
|
label: "Create Fixed Income Type"
|
|
161
161
|
},
|
|
162
|
-
"aria-invalid":
|
|
162
|
+
"aria-invalid": t.fixedIncomeTypeId ? "true" : "false",
|
|
163
163
|
control: o,
|
|
164
|
-
disabled:
|
|
165
|
-
errorMessage: (
|
|
164
|
+
disabled: i === "view",
|
|
165
|
+
errorMessage: (a = t.fixedIncomeTypeId) == null ? void 0 : a.message,
|
|
166
166
|
name: "fixedIncomeTypeId",
|
|
167
|
-
options:
|
|
168
|
-
...
|
|
169
|
-
value:
|
|
170
|
-
label:
|
|
167
|
+
options: C.map((l) => ({
|
|
168
|
+
...l,
|
|
169
|
+
value: l.id,
|
|
170
|
+
label: l.name
|
|
171
171
|
})),
|
|
172
172
|
rules: { required: "Asset type is required" }
|
|
173
173
|
}
|
|
@@ -177,59 +177,59 @@ function fe(L) {
|
|
|
177
177
|
{
|
|
178
178
|
label: "SPV",
|
|
179
179
|
Input: () => {
|
|
180
|
-
var
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
-
|
|
180
|
+
var a;
|
|
181
|
+
return /* @__PURE__ */ s(
|
|
182
|
+
y,
|
|
183
183
|
{
|
|
184
184
|
addItemButtonProps: {
|
|
185
|
-
onClick:
|
|
185
|
+
onClick: I("SPV"),
|
|
186
186
|
label: "Create SPV"
|
|
187
187
|
},
|
|
188
|
-
"aria-invalid":
|
|
188
|
+
"aria-invalid": t.spvId ? "true" : "false",
|
|
189
189
|
control: o,
|
|
190
|
-
disabled:
|
|
191
|
-
errorMessage: (
|
|
190
|
+
disabled: i === "view",
|
|
191
|
+
errorMessage: (a = t.spvId) == null ? void 0 : a.message,
|
|
192
192
|
name: "spvId",
|
|
193
|
-
options:
|
|
194
|
-
...
|
|
195
|
-
value:
|
|
196
|
-
label:
|
|
193
|
+
options: w.map((l) => ({
|
|
194
|
+
...l,
|
|
195
|
+
value: l.id,
|
|
196
|
+
label: l.name
|
|
197
197
|
})),
|
|
198
198
|
rules: { required: "SPV is required" }
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
|
-
...
|
|
203
|
+
...d
|
|
204
204
|
] };
|
|
205
205
|
}
|
|
206
|
-
case
|
|
207
|
-
const
|
|
208
|
-
label:
|
|
206
|
+
case f.TRANSACTION: {
|
|
207
|
+
const r = b, c = q, { errors: e } = p, t = h, o = c("type"), d = !!o && H.includes(o), v = !!o && Q.includes(o), a = !d, l = Z.map((n) => ({
|
|
208
|
+
label: X[n],
|
|
209
209
|
value: n
|
|
210
|
-
})),
|
|
211
|
-
label:
|
|
210
|
+
})), _ = M.map((n) => ({
|
|
211
|
+
label: J(n),
|
|
212
212
|
value: n.id
|
|
213
|
-
})),
|
|
213
|
+
})), N = S.map(
|
|
214
214
|
(n) => {
|
|
215
|
-
var
|
|
215
|
+
var m;
|
|
216
216
|
return {
|
|
217
|
-
label: `${n.name} — ${n.feeType} — ${(
|
|
217
|
+
label: `${n.name} — ${n.feeType} — ${(m = P.find((U) => U.id === n.accountId)) == null ? void 0 : m.reference}`,
|
|
218
218
|
value: n.id
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
-
),
|
|
221
|
+
), O = [
|
|
222
222
|
{
|
|
223
223
|
label: "Transaction Type",
|
|
224
224
|
Input: () => {
|
|
225
225
|
var n;
|
|
226
|
-
return /* @__PURE__ */
|
|
227
|
-
|
|
226
|
+
return /* @__PURE__ */ s(
|
|
227
|
+
y,
|
|
228
228
|
{
|
|
229
|
-
"aria-invalid":
|
|
230
|
-
control:
|
|
231
|
-
disabled:
|
|
232
|
-
errorMessage: (n =
|
|
229
|
+
"aria-invalid": e.type ? "true" : "false",
|
|
230
|
+
control: t,
|
|
231
|
+
disabled: i === "view",
|
|
232
|
+
errorMessage: (n = e.type) == null ? void 0 : n.message,
|
|
233
233
|
name: "type",
|
|
234
234
|
options: l,
|
|
235
235
|
rules: {
|
|
@@ -241,51 +241,53 @@ function fe(L) {
|
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
label: "Entry Time",
|
|
244
|
-
Input: () => /* @__PURE__ */
|
|
245
|
-
|
|
244
|
+
Input: () => /* @__PURE__ */ s(
|
|
245
|
+
"input",
|
|
246
246
|
{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
247
|
+
className: "h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",
|
|
248
|
+
step: 1,
|
|
249
|
+
type: "datetime-local",
|
|
250
|
+
...r("entryTime", {
|
|
251
|
+
disabled: i === "view",
|
|
252
|
+
required: "Entry time is required"
|
|
253
|
+
})
|
|
252
254
|
}
|
|
253
255
|
),
|
|
254
|
-
inputLabel:
|
|
256
|
+
inputLabel: /* @__PURE__ */ s($, { control: t })
|
|
255
257
|
},
|
|
256
|
-
|
|
258
|
+
d ? {
|
|
257
259
|
label: "Service Provider",
|
|
258
|
-
Input: () => /* @__PURE__ */
|
|
259
|
-
|
|
260
|
+
Input: () => /* @__PURE__ */ s(
|
|
261
|
+
y,
|
|
260
262
|
{
|
|
261
263
|
addItemButtonProps: {
|
|
262
|
-
onClick:
|
|
264
|
+
onClick: I("SERVICE_PROVIDER_FEE_TYPE"),
|
|
263
265
|
label: "Add Service Provider"
|
|
264
266
|
},
|
|
265
|
-
control:
|
|
266
|
-
disabled:
|
|
267
|
+
control: t,
|
|
268
|
+
disabled: i === "view",
|
|
267
269
|
name: "serviceProviderFeeTypeId",
|
|
268
|
-
options:
|
|
270
|
+
options: N
|
|
269
271
|
}
|
|
270
272
|
)
|
|
271
273
|
} : null,
|
|
272
|
-
|
|
274
|
+
v ? {
|
|
273
275
|
label: "Asset name",
|
|
274
276
|
Input: () => {
|
|
275
277
|
var n;
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
|
|
278
|
+
return /* @__PURE__ */ s(
|
|
279
|
+
y,
|
|
278
280
|
{
|
|
279
281
|
addItemButtonProps: {
|
|
280
|
-
onClick:
|
|
282
|
+
onClick: I("ASSET"),
|
|
281
283
|
label: "Create Asset"
|
|
282
284
|
},
|
|
283
|
-
"aria-invalid":
|
|
284
|
-
control:
|
|
285
|
-
disabled:
|
|
286
|
-
errorMessage: (n =
|
|
285
|
+
"aria-invalid": e.type ? "true" : "false",
|
|
286
|
+
control: t,
|
|
287
|
+
disabled: i === "view",
|
|
288
|
+
errorMessage: (n = e.type) == null ? void 0 : n.message,
|
|
287
289
|
name: "fixedIncomeId",
|
|
288
|
-
options:
|
|
290
|
+
options: _,
|
|
289
291
|
rules: {
|
|
290
292
|
required: "Asset name is required"
|
|
291
293
|
}
|
|
@@ -293,23 +295,23 @@ function fe(L) {
|
|
|
293
295
|
);
|
|
294
296
|
}
|
|
295
297
|
} : void 0,
|
|
296
|
-
|
|
298
|
+
v ? {
|
|
297
299
|
label: "Quantity",
|
|
298
300
|
Input: () => {
|
|
299
301
|
var n;
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
|
|
302
|
+
return /* @__PURE__ */ s(
|
|
303
|
+
R,
|
|
302
304
|
{
|
|
303
|
-
"aria-invalid":
|
|
304
|
-
control:
|
|
305
|
-
disabled:
|
|
306
|
-
errorMessage: (n =
|
|
305
|
+
"aria-invalid": e.fixedIncomeAmount ? "true" : "false",
|
|
306
|
+
control: t,
|
|
307
|
+
disabled: i === "view",
|
|
308
|
+
errorMessage: (n = e.fixedIncomeAmount) == null ? void 0 : n.message,
|
|
307
309
|
name: "fixedIncomeAmount",
|
|
308
310
|
placeholder: "E.g. 1,000.00",
|
|
309
311
|
rules: {
|
|
310
312
|
required: "Quantity is required",
|
|
311
313
|
validate: {
|
|
312
|
-
positive: (
|
|
314
|
+
positive: (m) => !!m && Number(m) > 0 || "Asset proceeds must be greater than zero"
|
|
313
315
|
}
|
|
314
316
|
}
|
|
315
317
|
}
|
|
@@ -317,33 +319,33 @@ function fe(L) {
|
|
|
317
319
|
}
|
|
318
320
|
} : void 0,
|
|
319
321
|
{
|
|
320
|
-
label:
|
|
322
|
+
label: v ? "Asset Proceeds" : "Cash Amount",
|
|
321
323
|
Input: () => {
|
|
322
324
|
var n;
|
|
323
|
-
return /* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
|
|
325
|
+
return /* @__PURE__ */ F(g, { children: [
|
|
326
|
+
/* @__PURE__ */ s(
|
|
327
|
+
R,
|
|
326
328
|
{
|
|
327
|
-
"aria-invalid":
|
|
328
|
-
control:
|
|
329
|
+
"aria-invalid": e.cashAmount ? "true" : "false",
|
|
330
|
+
control: t,
|
|
329
331
|
currency: "USD",
|
|
330
|
-
disabled:
|
|
331
|
-
errorMessage: (n =
|
|
332
|
+
disabled: i === "view",
|
|
333
|
+
errorMessage: (n = e.cashAmount) == null ? void 0 : n.message,
|
|
332
334
|
name: "cashAmount",
|
|
333
335
|
placeholder: "E.g. $1,000.00",
|
|
334
336
|
rules: {
|
|
335
337
|
required: "Asset proceeds is required",
|
|
336
338
|
validate: {
|
|
337
|
-
positive: (
|
|
339
|
+
positive: (m) => !!m && Number(m) > 0 || "Asset proceeds must be greater than zero"
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
342
|
}
|
|
341
343
|
),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
+
v ? /* @__PURE__ */ s(
|
|
345
|
+
Y,
|
|
344
346
|
{
|
|
345
|
-
control:
|
|
346
|
-
isViewOnly:
|
|
347
|
+
control: t,
|
|
348
|
+
isViewOnly: i === "view"
|
|
347
349
|
}
|
|
348
350
|
) : null
|
|
349
351
|
] });
|
|
@@ -353,55 +355,55 @@ function fe(L) {
|
|
|
353
355
|
label: "Transaction reference",
|
|
354
356
|
Input: () => {
|
|
355
357
|
var n;
|
|
356
|
-
return /* @__PURE__ */
|
|
357
|
-
|
|
358
|
+
return /* @__PURE__ */ s(
|
|
359
|
+
W,
|
|
358
360
|
{
|
|
359
|
-
...
|
|
360
|
-
disabled:
|
|
361
|
+
...r("txRef", {
|
|
362
|
+
disabled: i === "view"
|
|
361
363
|
}),
|
|
362
|
-
"aria-invalid":
|
|
363
|
-
control:
|
|
364
|
-
errorMessage: (n =
|
|
364
|
+
"aria-invalid": e.txRef ? "true" : "false",
|
|
365
|
+
control: t,
|
|
366
|
+
errorMessage: (n = e.txRef) == null ? void 0 : n.message,
|
|
365
367
|
placeholder: "E.g. 0x123..."
|
|
366
368
|
}
|
|
367
369
|
);
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
|
-
].filter(Boolean),
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
|
|
372
|
+
].filter(Boolean), L = /* @__PURE__ */ F(g, { children: [
|
|
373
|
+
/* @__PURE__ */ s(
|
|
374
|
+
z,
|
|
373
375
|
{
|
|
374
|
-
canHaveTransactionFees:
|
|
375
|
-
control:
|
|
376
|
-
errors:
|
|
377
|
-
isViewOnly:
|
|
378
|
-
serviceProviderFeeTypeOptions:
|
|
379
|
-
serviceProviderFeeTypes:
|
|
380
|
-
showCreateServiceProviderFeeTypeModal:
|
|
376
|
+
canHaveTransactionFees: a,
|
|
377
|
+
control: t,
|
|
378
|
+
errors: e,
|
|
379
|
+
isViewOnly: i === "view",
|
|
380
|
+
serviceProviderFeeTypeOptions: N,
|
|
381
|
+
serviceProviderFeeTypes: S,
|
|
382
|
+
showCreateServiceProviderFeeTypeModal: I(
|
|
381
383
|
"SERVICE_PROVIDER_FEE_TYPE"
|
|
382
384
|
)
|
|
383
385
|
}
|
|
384
386
|
),
|
|
385
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ s(B, { control: t })
|
|
386
388
|
] });
|
|
387
|
-
return { inputs:
|
|
389
|
+
return { inputs: O, additionalInputs: L };
|
|
388
390
|
}
|
|
389
|
-
case
|
|
390
|
-
const
|
|
391
|
+
case f.ACCOUNT: {
|
|
392
|
+
const r = b, c = p, { errors: e } = c;
|
|
391
393
|
return { inputs: [
|
|
392
394
|
{
|
|
393
395
|
label: "Account Label",
|
|
394
396
|
Input: () => {
|
|
395
|
-
var
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
|
|
397
|
+
var o, d;
|
|
398
|
+
return /* @__PURE__ */ s(
|
|
399
|
+
u,
|
|
398
400
|
{
|
|
399
|
-
...
|
|
400
|
-
disabled:
|
|
401
|
+
...r("label", {
|
|
402
|
+
disabled: i === "view",
|
|
401
403
|
required: "Account label is required"
|
|
402
404
|
}),
|
|
403
|
-
"aria-invalid": ((
|
|
404
|
-
errorMessage: (
|
|
405
|
+
"aria-invalid": ((o = e.label) == null ? void 0 : o.type) === "required" ? "true" : "false",
|
|
406
|
+
errorMessage: (d = e.label) == null ? void 0 : d.message,
|
|
405
407
|
placeholder: "E.g. My Label"
|
|
406
408
|
}
|
|
407
409
|
);
|
|
@@ -410,16 +412,16 @@ function fe(L) {
|
|
|
410
412
|
{
|
|
411
413
|
label: "Account Reference",
|
|
412
414
|
Input: () => {
|
|
413
|
-
var
|
|
414
|
-
return /* @__PURE__ */
|
|
415
|
-
|
|
415
|
+
var o, d;
|
|
416
|
+
return /* @__PURE__ */ s(
|
|
417
|
+
u,
|
|
416
418
|
{
|
|
417
|
-
...
|
|
418
|
-
disabled:
|
|
419
|
+
...r("reference", {
|
|
420
|
+
disabled: i === "view",
|
|
419
421
|
required: "Account reference is required"
|
|
420
422
|
}),
|
|
421
|
-
"aria-invalid": ((
|
|
422
|
-
errorMessage: (
|
|
423
|
+
"aria-invalid": ((o = e.reference) == null ? void 0 : o.type) === "required" ? "true" : "false",
|
|
424
|
+
errorMessage: (d = e.reference) == null ? void 0 : d.message,
|
|
423
425
|
placeholder: "E.g. bank account number or ETH address"
|
|
424
426
|
}
|
|
425
427
|
);
|
|
@@ -427,22 +429,22 @@ function fe(L) {
|
|
|
427
429
|
}
|
|
428
430
|
] };
|
|
429
431
|
}
|
|
430
|
-
case
|
|
431
|
-
const
|
|
432
|
+
case f.SPV: {
|
|
433
|
+
const r = b, c = p, { errors: e } = c;
|
|
432
434
|
return { inputs: [
|
|
433
435
|
{
|
|
434
436
|
label: "SPV name",
|
|
435
437
|
Input: () => {
|
|
436
|
-
var
|
|
437
|
-
return /* @__PURE__ */
|
|
438
|
-
|
|
438
|
+
var o, d;
|
|
439
|
+
return /* @__PURE__ */ s(
|
|
440
|
+
u,
|
|
439
441
|
{
|
|
440
|
-
...
|
|
441
|
-
disabled:
|
|
442
|
+
...r("name", {
|
|
443
|
+
disabled: i === "view",
|
|
442
444
|
required: "SPV name is required"
|
|
443
445
|
}),
|
|
444
|
-
"aria-invalid": ((
|
|
445
|
-
errorMessage: (
|
|
446
|
+
"aria-invalid": ((o = e.name) == null ? void 0 : o.type) === "required" ? "true" : "false",
|
|
447
|
+
errorMessage: (d = e.name) == null ? void 0 : d.message,
|
|
446
448
|
placeholder: "E.g. My SPV name"
|
|
447
449
|
}
|
|
448
450
|
);
|
|
@@ -450,22 +452,22 @@ function fe(L) {
|
|
|
450
452
|
}
|
|
451
453
|
] };
|
|
452
454
|
}
|
|
453
|
-
case
|
|
454
|
-
const
|
|
455
|
+
case f.FIXED_INCOME_TYPE: {
|
|
456
|
+
const r = b, c = p, { errors: e } = c;
|
|
455
457
|
return { inputs: [
|
|
456
458
|
{
|
|
457
459
|
label: "Fixed Income Type Name",
|
|
458
460
|
Input: () => {
|
|
459
|
-
var
|
|
460
|
-
return /* @__PURE__ */
|
|
461
|
-
|
|
461
|
+
var o, d;
|
|
462
|
+
return /* @__PURE__ */ s(
|
|
463
|
+
u,
|
|
462
464
|
{
|
|
463
|
-
...
|
|
464
|
-
disabled:
|
|
465
|
+
...r("name", {
|
|
466
|
+
disabled: i === "view",
|
|
465
467
|
required: "Fixed Income Type name is required"
|
|
466
468
|
}),
|
|
467
|
-
"aria-invalid": ((
|
|
468
|
-
errorMessage: (
|
|
469
|
+
"aria-invalid": ((o = e.name) == null ? void 0 : o.type) === "required" ? "true" : "false",
|
|
470
|
+
errorMessage: (d = e.name) == null ? void 0 : d.message,
|
|
469
471
|
placeholder: "E.g. My Fixed Income Type name"
|
|
470
472
|
}
|
|
471
473
|
);
|
|
@@ -473,26 +475,26 @@ function fe(L) {
|
|
|
473
475
|
}
|
|
474
476
|
] };
|
|
475
477
|
}
|
|
476
|
-
case
|
|
477
|
-
const
|
|
478
|
-
...
|
|
479
|
-
value:
|
|
480
|
-
label:
|
|
478
|
+
case f.SERVICE_PROVIDER_FEE_TYPE: {
|
|
479
|
+
const r = b, c = p, { errors: e } = c, t = h, o = (a) => `${a.label} (${a.reference})`, d = (a) => a.map((l) => ({
|
|
480
|
+
...l,
|
|
481
|
+
value: l.id,
|
|
482
|
+
label: o(l)
|
|
481
483
|
}));
|
|
482
484
|
return { inputs: [
|
|
483
485
|
{
|
|
484
486
|
label: "Service Provider Name",
|
|
485
487
|
Input: () => {
|
|
486
|
-
var
|
|
487
|
-
return /* @__PURE__ */
|
|
488
|
-
|
|
488
|
+
var a, l;
|
|
489
|
+
return /* @__PURE__ */ s(
|
|
490
|
+
u,
|
|
489
491
|
{
|
|
490
|
-
...
|
|
491
|
-
disabled:
|
|
492
|
+
...r("name", {
|
|
493
|
+
disabled: i === "view",
|
|
492
494
|
required: "Service provider name is required"
|
|
493
495
|
}),
|
|
494
|
-
"aria-invalid": ((
|
|
495
|
-
errorMessage: (
|
|
496
|
+
"aria-invalid": ((a = e.name) == null ? void 0 : a.type) === "required" ? "true" : "false",
|
|
497
|
+
errorMessage: (l = e.name) == null ? void 0 : l.message,
|
|
496
498
|
placeholder: "E.g. My Service Provider"
|
|
497
499
|
}
|
|
498
500
|
);
|
|
@@ -501,16 +503,16 @@ function fe(L) {
|
|
|
501
503
|
{
|
|
502
504
|
label: "Fee Type",
|
|
503
505
|
Input: () => {
|
|
504
|
-
var
|
|
505
|
-
return /* @__PURE__ */
|
|
506
|
-
|
|
506
|
+
var a, l;
|
|
507
|
+
return /* @__PURE__ */ s(
|
|
508
|
+
u,
|
|
507
509
|
{
|
|
508
|
-
...
|
|
509
|
-
disabled:
|
|
510
|
+
...r("feeType", {
|
|
511
|
+
disabled: i === "view",
|
|
510
512
|
required: "Fee type is required"
|
|
511
513
|
}),
|
|
512
|
-
"aria-invalid": ((
|
|
513
|
-
errorMessage: (
|
|
514
|
+
"aria-invalid": ((a = e.name) == null ? void 0 : a.type) === "required" ? "true" : "false",
|
|
515
|
+
errorMessage: (l = e.name) == null ? void 0 : l.message,
|
|
514
516
|
placeholder: "E.g. My Fee Type"
|
|
515
517
|
}
|
|
516
518
|
);
|
|
@@ -519,20 +521,20 @@ function fe(L) {
|
|
|
519
521
|
{
|
|
520
522
|
label: "Account",
|
|
521
523
|
Input: () => {
|
|
522
|
-
var
|
|
523
|
-
return /* @__PURE__ */
|
|
524
|
-
|
|
524
|
+
var a;
|
|
525
|
+
return /* @__PURE__ */ s(
|
|
526
|
+
y,
|
|
525
527
|
{
|
|
526
528
|
addItemButtonProps: {
|
|
527
|
-
onClick:
|
|
529
|
+
onClick: I("ACCOUNT"),
|
|
528
530
|
label: "Create Account"
|
|
529
531
|
},
|
|
530
|
-
"aria-invalid":
|
|
531
|
-
control:
|
|
532
|
-
disabled:
|
|
533
|
-
errorMessage: (
|
|
532
|
+
"aria-invalid": e.accountId ? "true" : "false",
|
|
533
|
+
control: t,
|
|
534
|
+
disabled: i === "view",
|
|
535
|
+
errorMessage: (a = e.accountId) == null ? void 0 : a.message,
|
|
534
536
|
name: "accountId",
|
|
535
|
-
options:
|
|
537
|
+
options: d(P),
|
|
536
538
|
rules: { required: "Account is required" }
|
|
537
539
|
}
|
|
538
540
|
);
|
|
@@ -542,22 +544,22 @@ function fe(L) {
|
|
|
542
544
|
}
|
|
543
545
|
}
|
|
544
546
|
}, [
|
|
547
|
+
p,
|
|
548
|
+
h,
|
|
545
549
|
b,
|
|
546
|
-
|
|
547
|
-
v,
|
|
548
|
-
C,
|
|
549
|
-
P,
|
|
550
|
+
E,
|
|
550
551
|
q,
|
|
552
|
+
P,
|
|
553
|
+
C,
|
|
551
554
|
M,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
w
|
|
555
|
+
i,
|
|
556
|
+
S,
|
|
557
|
+
I,
|
|
558
|
+
w,
|
|
559
|
+
A
|
|
558
560
|
]);
|
|
559
561
|
}
|
|
560
562
|
export {
|
|
561
|
-
|
|
563
|
+
ge as useFormInputs
|
|
562
564
|
};
|
|
563
565
|
//# sourceMappingURL=useFormInputs.js.map
|