@asdp/ferryui 0.1.22-dev.10344 → 0.1.22-dev.10353
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/index.js +271 -291
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +271 -291
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12858,7 +12858,7 @@ var CardVehicleOwnerForm = ({
|
|
|
12858
12858
|
" ",
|
|
12859
12859
|
/* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
|
|
12860
12860
|
] }) }),
|
|
12861
|
-
/* @__PURE__ */ jsxs(Col, { lg:
|
|
12861
|
+
/* @__PURE__ */ jsxs(Col, { lg: 12, children: [
|
|
12862
12862
|
/* @__PURE__ */ jsx(
|
|
12863
12863
|
"div",
|
|
12864
12864
|
{
|
|
@@ -12961,36 +12961,10 @@ var CardVehicleOwnerForm = ({
|
|
|
12961
12961
|
children: mergedLabels.otherCompanyHelperText
|
|
12962
12962
|
}
|
|
12963
12963
|
)
|
|
12964
|
-
] }),
|
|
12965
|
-
/* @__PURE__ */ jsxs(Col, { lg: 6, children: [
|
|
12966
|
-
/* @__PURE__ */ jsx("div", { style: { height: "1rem" } }),
|
|
12967
|
-
/* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
|
|
12968
|
-
mergedLabels.estimatedVehicleWeightLabel,
|
|
12969
|
-
" ",
|
|
12970
|
-
/* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
|
|
12971
|
-
] }),
|
|
12972
|
-
/* @__PURE__ */ jsx(
|
|
12973
|
-
InputDynamic_default,
|
|
12974
|
-
{
|
|
12975
|
-
control,
|
|
12976
|
-
disabled,
|
|
12977
|
-
name: `owners.${index}.estimatedWeight`,
|
|
12978
|
-
placeholder: mergedLabels.inputNumberPlaceholder,
|
|
12979
|
-
required: true,
|
|
12980
|
-
size: "large",
|
|
12981
|
-
type: "number",
|
|
12982
|
-
onChange: (val) => {
|
|
12983
|
-
setValue(`owners.${index}.estimatedWeight`, val);
|
|
12984
|
-
onUpdateOwner(owner.id, {
|
|
12985
|
-
estimatedWeight: val
|
|
12986
|
-
});
|
|
12987
|
-
}
|
|
12988
|
-
}
|
|
12989
|
-
)
|
|
12990
12964
|
] })
|
|
12991
12965
|
] }),
|
|
12992
|
-
hasLoad && /* @__PURE__ */ jsxs(
|
|
12993
|
-
/* @__PURE__ */
|
|
12966
|
+
hasLoad && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12967
|
+
/* @__PURE__ */ jsxs(Row, { nogutter: true, children: [
|
|
12994
12968
|
/* @__PURE__ */ jsx(Col, { lg: 12, children: /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoReceiverTitle }) }),
|
|
12995
12969
|
/* @__PURE__ */ jsxs(Col, { lg: 12, children: [
|
|
12996
12970
|
/* @__PURE__ */ jsx(
|
|
@@ -13105,8 +13079,8 @@ var CardVehicleOwnerForm = ({
|
|
|
13105
13079
|
}
|
|
13106
13080
|
)
|
|
13107
13081
|
] })
|
|
13108
|
-
] })
|
|
13109
|
-
/* @__PURE__ */
|
|
13082
|
+
] }),
|
|
13083
|
+
/* @__PURE__ */ jsxs(Row, { nogutter: true, children: [
|
|
13110
13084
|
/* @__PURE__ */ jsx(Col, { lg: 12, children: /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
|
|
13111
13085
|
mergedLabels.logisticsCompanyTitle,
|
|
13112
13086
|
" ",
|
|
@@ -13222,10 +13196,10 @@ var CardVehicleOwnerForm = ({
|
|
|
13222
13196
|
children: mergedLabels.otherCompanyHelperText
|
|
13223
13197
|
}
|
|
13224
13198
|
)
|
|
13225
|
-
] })
|
|
13199
|
+
] })
|
|
13226
13200
|
] }),
|
|
13227
13201
|
/* @__PURE__ */ jsxs(Row, { children: [
|
|
13228
|
-
/* @__PURE__ */ jsxs(Col, { children: [
|
|
13202
|
+
/* @__PURE__ */ jsxs(Col, { xl: 6, children: [
|
|
13229
13203
|
/* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.originCityLabel }),
|
|
13230
13204
|
/* @__PURE__ */ jsx(
|
|
13231
13205
|
InputDynamic_default,
|
|
@@ -13247,7 +13221,7 @@ var CardVehicleOwnerForm = ({
|
|
|
13247
13221
|
}
|
|
13248
13222
|
)
|
|
13249
13223
|
] }),
|
|
13250
|
-
/* @__PURE__ */ jsxs(Col, { children: [
|
|
13224
|
+
/* @__PURE__ */ jsxs(Col, { xl: 6, children: [
|
|
13251
13225
|
/* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.destinationCityLabel }),
|
|
13252
13226
|
/* @__PURE__ */ jsx(
|
|
13253
13227
|
InputDynamic_default,
|
|
@@ -13268,6 +13242,32 @@ var CardVehicleOwnerForm = ({
|
|
|
13268
13242
|
type: "select"
|
|
13269
13243
|
}
|
|
13270
13244
|
)
|
|
13245
|
+
] }),
|
|
13246
|
+
/* @__PURE__ */ jsxs(Col, { lg: 12, children: [
|
|
13247
|
+
/* @__PURE__ */ jsx("div", { style: { height: "1rem" } }),
|
|
13248
|
+
/* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
|
|
13249
|
+
mergedLabels.estimatedVehicleWeightLabel,
|
|
13250
|
+
" ",
|
|
13251
|
+
/* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
|
|
13252
|
+
] }),
|
|
13253
|
+
/* @__PURE__ */ jsx(
|
|
13254
|
+
InputDynamic_default,
|
|
13255
|
+
{
|
|
13256
|
+
control,
|
|
13257
|
+
disabled,
|
|
13258
|
+
name: `owners.${index}.estimatedWeight`,
|
|
13259
|
+
placeholder: mergedLabels.inputNumberPlaceholder,
|
|
13260
|
+
required: true,
|
|
13261
|
+
size: "large",
|
|
13262
|
+
type: "number",
|
|
13263
|
+
onChange: (val) => {
|
|
13264
|
+
setValue(`owners.${index}.estimatedWeight`, val);
|
|
13265
|
+
onUpdateOwner(owner.id, {
|
|
13266
|
+
estimatedWeight: val
|
|
13267
|
+
});
|
|
13268
|
+
}
|
|
13269
|
+
}
|
|
13270
|
+
)
|
|
13271
13271
|
] })
|
|
13272
13272
|
] }),
|
|
13273
13273
|
hasLoad && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -13311,7 +13311,7 @@ var CardVehicleOwnerForm = ({
|
|
|
13311
13311
|
),
|
|
13312
13312
|
/* @__PURE__ */ jsx(AccordionPanel, { children: /* @__PURE__ */ jsxs("div", { className: styles.form, children: [
|
|
13313
13313
|
/* @__PURE__ */ jsxs(Row, { children: [
|
|
13314
|
-
/* @__PURE__ */ jsxs(Col, { md:
|
|
13314
|
+
/* @__PURE__ */ jsxs(Col, { md: 6, children: [
|
|
13315
13315
|
/* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
|
|
13316
13316
|
mergedLabels.commodityLabel,
|
|
13317
13317
|
" ",
|
|
@@ -13348,7 +13348,7 @@ var CardVehicleOwnerForm = ({
|
|
|
13348
13348
|
}
|
|
13349
13349
|
)
|
|
13350
13350
|
] }),
|
|
13351
|
-
/* @__PURE__ */ jsxs(Col, { md:
|
|
13351
|
+
/* @__PURE__ */ jsxs(Col, { md: 6, children: [
|
|
13352
13352
|
/* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
|
|
13353
13353
|
mergedLabels.cargoTypeLabel,
|
|
13354
13354
|
" ",
|
|
@@ -13403,260 +13403,7 @@ var CardVehicleOwnerForm = ({
|
|
|
13403
13403
|
children: mergedLabels.cargoTypeHelperText
|
|
13404
13404
|
}
|
|
13405
13405
|
)
|
|
13406
|
-
] })
|
|
13407
|
-
(() => {
|
|
13408
|
-
const type = watch(
|
|
13409
|
-
`owners.${index}.cargo.${cargoIndex}.cargoType`
|
|
13410
|
-
);
|
|
13411
|
-
const selectedLoadType2 = loadTypes.find(
|
|
13412
|
-
(loadType) => loadType.id.toString() === type
|
|
13413
|
-
);
|
|
13414
|
-
if (!selectedLoadType2) {
|
|
13415
|
-
return /* @__PURE__ */ jsxs(Col, { md: 3, children: [
|
|
13416
|
-
/* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
|
|
13417
|
-
/* @__PURE__ */ jsx(
|
|
13418
|
-
Body2,
|
|
13419
|
-
{
|
|
13420
|
-
style: { marginTop: "0.5rem" },
|
|
13421
|
-
children: (() => {
|
|
13422
|
-
return new Intl.NumberFormat(
|
|
13423
|
-
"id-ID",
|
|
13424
|
-
{
|
|
13425
|
-
style: "currency",
|
|
13426
|
-
currency: "IDR",
|
|
13427
|
-
minimumFractionDigits: 0
|
|
13428
|
-
}
|
|
13429
|
-
).format(0);
|
|
13430
|
-
})()
|
|
13431
|
-
}
|
|
13432
|
-
)
|
|
13433
|
-
] });
|
|
13434
|
-
}
|
|
13435
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13436
|
-
/* @__PURE__ */ jsxs(Col, { md: 3, children: [
|
|
13437
|
-
/* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
|
|
13438
|
-
/* @__PURE__ */ jsxs(
|
|
13439
|
-
"div",
|
|
13440
|
-
{
|
|
13441
|
-
style: {
|
|
13442
|
-
display: "flex",
|
|
13443
|
-
alignItems: "center",
|
|
13444
|
-
border: `1px solid ${tokens.colorNeutralStroke1}`,
|
|
13445
|
-
borderRadius: tokens.borderRadiusMedium,
|
|
13446
|
-
height: "40px",
|
|
13447
|
-
padding: "0 12px",
|
|
13448
|
-
backgroundColor: tokens.colorNeutralBackground1
|
|
13449
|
-
},
|
|
13450
|
-
children: [
|
|
13451
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
|
|
13452
|
-
/* @__PURE__ */ jsxs(
|
|
13453
|
-
"div",
|
|
13454
|
-
{
|
|
13455
|
-
style: {
|
|
13456
|
-
display: "flex",
|
|
13457
|
-
alignItems: "center",
|
|
13458
|
-
gap: "12px"
|
|
13459
|
-
},
|
|
13460
|
-
children: [
|
|
13461
|
-
/* @__PURE__ */ jsx(
|
|
13462
|
-
Button,
|
|
13463
|
-
{
|
|
13464
|
-
appearance: "transparent",
|
|
13465
|
-
disabled,
|
|
13466
|
-
icon: /* @__PURE__ */ jsx(
|
|
13467
|
-
Icon,
|
|
13468
|
-
{
|
|
13469
|
-
icon: "fluent:subtract-circle-24-regular",
|
|
13470
|
-
style: {
|
|
13471
|
-
fontSize: "24px",
|
|
13472
|
-
color: tokens.colorNeutralForeground4
|
|
13473
|
-
}
|
|
13474
|
-
}
|
|
13475
|
-
),
|
|
13476
|
-
"aria-label": mergedLabels.decrementQuantityAriaLabel,
|
|
13477
|
-
size: "small",
|
|
13478
|
-
onClick: () => {
|
|
13479
|
-
const currentVal = getValues(
|
|
13480
|
-
`owners.${index}.cargo.${cargoIndex}.quantity`
|
|
13481
|
-
) || 0;
|
|
13482
|
-
const currentQty = Number(currentVal);
|
|
13483
|
-
if (currentQty > 1) {
|
|
13484
|
-
const newVal = currentQty - 1;
|
|
13485
|
-
setValue(
|
|
13486
|
-
`owners.${index}.cargo.${cargoIndex}.quantity`,
|
|
13487
|
-
newVal
|
|
13488
|
-
);
|
|
13489
|
-
onUpdateCargoQuantity(
|
|
13490
|
-
owner.id,
|
|
13491
|
-
cargo.id,
|
|
13492
|
-
newVal
|
|
13493
|
-
);
|
|
13494
|
-
}
|
|
13495
|
-
},
|
|
13496
|
-
style: {
|
|
13497
|
-
minWidth: "32px",
|
|
13498
|
-
padding: "0"
|
|
13499
|
-
}
|
|
13500
|
-
}
|
|
13501
|
-
),
|
|
13502
|
-
/* @__PURE__ */ jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsx(
|
|
13503
|
-
Controller,
|
|
13504
|
-
{
|
|
13505
|
-
name: `owners.${index}.cargo.${cargoIndex}.quantity`,
|
|
13506
|
-
control,
|
|
13507
|
-
disabled,
|
|
13508
|
-
render: ({ field }) => /* @__PURE__ */ jsx(
|
|
13509
|
-
"input",
|
|
13510
|
-
{
|
|
13511
|
-
...field,
|
|
13512
|
-
min: 1,
|
|
13513
|
-
step: "1",
|
|
13514
|
-
type: "number",
|
|
13515
|
-
style: {
|
|
13516
|
-
border: "none",
|
|
13517
|
-
width: "100%",
|
|
13518
|
-
textAlign: "center",
|
|
13519
|
-
outline: "none",
|
|
13520
|
-
backgroundColor: "transparent",
|
|
13521
|
-
color: tokens.colorNeutralForeground1,
|
|
13522
|
-
fontSize: tokens.fontSizeBase400,
|
|
13523
|
-
fontFamily: tokens.fontFamilyBase
|
|
13524
|
-
},
|
|
13525
|
-
onKeyDown: (e) => {
|
|
13526
|
-
if ([
|
|
13527
|
-
"e",
|
|
13528
|
-
"E",
|
|
13529
|
-
"+",
|
|
13530
|
-
"-",
|
|
13531
|
-
".",
|
|
13532
|
-
","
|
|
13533
|
-
].includes(e.key)) {
|
|
13534
|
-
e.preventDefault();
|
|
13535
|
-
}
|
|
13536
|
-
},
|
|
13537
|
-
onPaste: (e) => {
|
|
13538
|
-
const paste = e.clipboardData.getData(
|
|
13539
|
-
"text"
|
|
13540
|
-
);
|
|
13541
|
-
if (!/^\d+$/.test(paste)) {
|
|
13542
|
-
e.preventDefault();
|
|
13543
|
-
}
|
|
13544
|
-
},
|
|
13545
|
-
onWheel: (e) => e.target.blur(),
|
|
13546
|
-
onChange: (e) => {
|
|
13547
|
-
const newVal = Number(
|
|
13548
|
-
e.target.value
|
|
13549
|
-
);
|
|
13550
|
-
field.onChange(e);
|
|
13551
|
-
onUpdateCargoQuantity(
|
|
13552
|
-
owner.id,
|
|
13553
|
-
cargo.id,
|
|
13554
|
-
newVal
|
|
13555
|
-
);
|
|
13556
|
-
}
|
|
13557
|
-
}
|
|
13558
|
-
),
|
|
13559
|
-
rules: {
|
|
13560
|
-
required: true,
|
|
13561
|
-
validate: (val) => Number(val) > 0
|
|
13562
|
-
}
|
|
13563
|
-
}
|
|
13564
|
-
) }),
|
|
13565
|
-
/* @__PURE__ */ jsx(
|
|
13566
|
-
Button,
|
|
13567
|
-
{
|
|
13568
|
-
appearance: "transparent",
|
|
13569
|
-
disabled,
|
|
13570
|
-
icon: /* @__PURE__ */ jsx(
|
|
13571
|
-
Icon,
|
|
13572
|
-
{
|
|
13573
|
-
icon: "fluent:add-circle-24-regular",
|
|
13574
|
-
style: {
|
|
13575
|
-
fontSize: "24px",
|
|
13576
|
-
color: tokens.colorBrandStroke1
|
|
13577
|
-
}
|
|
13578
|
-
}
|
|
13579
|
-
),
|
|
13580
|
-
"aria-label": mergedLabels.incrementQuantityAriaLabel,
|
|
13581
|
-
size: "small",
|
|
13582
|
-
onClick: () => {
|
|
13583
|
-
const currentVal = getValues(
|
|
13584
|
-
`owners.${index}.cargo.${cargoIndex}.quantity`
|
|
13585
|
-
) || 0;
|
|
13586
|
-
const currentQty = Number(currentVal);
|
|
13587
|
-
const newVal = currentQty + 1;
|
|
13588
|
-
setValue(
|
|
13589
|
-
`owners.${index}.cargo.${cargoIndex}.quantity`,
|
|
13590
|
-
newVal
|
|
13591
|
-
);
|
|
13592
|
-
onUpdateCargoQuantity(
|
|
13593
|
-
owner.id,
|
|
13594
|
-
cargo.id,
|
|
13595
|
-
newVal
|
|
13596
|
-
);
|
|
13597
|
-
},
|
|
13598
|
-
style: {
|
|
13599
|
-
minWidth: "32px",
|
|
13600
|
-
padding: "0"
|
|
13601
|
-
}
|
|
13602
|
-
}
|
|
13603
|
-
)
|
|
13604
|
-
]
|
|
13605
|
-
}
|
|
13606
|
-
),
|
|
13607
|
-
/* @__PURE__ */ jsx(
|
|
13608
|
-
"div",
|
|
13609
|
-
{
|
|
13610
|
-
style: {
|
|
13611
|
-
flex: 1,
|
|
13612
|
-
textAlign: "left",
|
|
13613
|
-
color: tokens.colorNeutralForeground1,
|
|
13614
|
-
fontSize: tokens.fontSizeBase300,
|
|
13615
|
-
paddingRight: "8px"
|
|
13616
|
-
},
|
|
13617
|
-
children: (() => {
|
|
13618
|
-
const type2 = watch(
|
|
13619
|
-
`owners.${index}.cargo.${cargoIndex}.cargoType`
|
|
13620
|
-
);
|
|
13621
|
-
const selectedLoadType3 = loadTypes.find(
|
|
13622
|
-
(loadType) => loadType.id.toString() === type2
|
|
13623
|
-
);
|
|
13624
|
-
return selectedLoadType3?.unit?.name;
|
|
13625
|
-
})()
|
|
13626
|
-
}
|
|
13627
|
-
)
|
|
13628
|
-
]
|
|
13629
|
-
}
|
|
13630
|
-
)
|
|
13631
|
-
] }),
|
|
13632
|
-
/* @__PURE__ */ jsxs(Col, { md: 3, children: [
|
|
13633
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
|
|
13634
|
-
/* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
|
|
13635
|
-
/* @__PURE__ */ jsx(
|
|
13636
|
-
Body2,
|
|
13637
|
-
{
|
|
13638
|
-
style: { marginTop: "0.5rem" },
|
|
13639
|
-
children: (() => {
|
|
13640
|
-
return new Intl.NumberFormat(
|
|
13641
|
-
"id-ID",
|
|
13642
|
-
{
|
|
13643
|
-
style: "currency",
|
|
13644
|
-
currency: "IDR",
|
|
13645
|
-
minimumFractionDigits: 0
|
|
13646
|
-
}
|
|
13647
|
-
).format(
|
|
13648
|
-
Number(
|
|
13649
|
-
getValues(
|
|
13650
|
-
`owners.${index}.cargo.${cargoIndex}.quantity`
|
|
13651
|
-
) || 0
|
|
13652
|
-
) * (selectedLoadType2?.price || 0)
|
|
13653
|
-
);
|
|
13654
|
-
})()
|
|
13655
|
-
}
|
|
13656
|
-
)
|
|
13657
|
-
] })
|
|
13658
|
-
] });
|
|
13659
|
-
})()
|
|
13406
|
+
] })
|
|
13660
13407
|
] }),
|
|
13661
13408
|
/* @__PURE__ */ jsxs(Row, { children: [
|
|
13662
13409
|
/* @__PURE__ */ jsxs(Col, { md: 6, children: [
|
|
@@ -13760,7 +13507,240 @@ var CardVehicleOwnerForm = ({
|
|
|
13760
13507
|
},
|
|
13761
13508
|
children: mergedLabels.deleteCargoButton
|
|
13762
13509
|
}
|
|
13763
|
-
) }) })
|
|
13510
|
+
) }) }),
|
|
13511
|
+
(() => {
|
|
13512
|
+
const type = watch(
|
|
13513
|
+
`owners.${index}.cargo.${cargoIndex}.cargoType`
|
|
13514
|
+
);
|
|
13515
|
+
const _selectedLoadType = loadTypes.find(
|
|
13516
|
+
(loadType) => loadType.id.toString() === type
|
|
13517
|
+
);
|
|
13518
|
+
if (!_selectedLoadType) return null;
|
|
13519
|
+
return /* @__PURE__ */ jsxs(Row, { children: [
|
|
13520
|
+
/* @__PURE__ */ jsxs(Col, { md: 12, children: [
|
|
13521
|
+
/* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
|
|
13522
|
+
/* @__PURE__ */ jsxs(
|
|
13523
|
+
"div",
|
|
13524
|
+
{
|
|
13525
|
+
style: {
|
|
13526
|
+
display: "flex",
|
|
13527
|
+
alignItems: "center",
|
|
13528
|
+
border: `1px solid ${tokens.colorNeutralStroke1}`,
|
|
13529
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
13530
|
+
height: "40px",
|
|
13531
|
+
padding: "0 12px",
|
|
13532
|
+
backgroundColor: tokens.colorNeutralBackground1
|
|
13533
|
+
},
|
|
13534
|
+
children: [
|
|
13535
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
|
|
13536
|
+
/* @__PURE__ */ jsxs(
|
|
13537
|
+
"div",
|
|
13538
|
+
{
|
|
13539
|
+
style: {
|
|
13540
|
+
display: "flex",
|
|
13541
|
+
alignItems: "center",
|
|
13542
|
+
gap: "12px"
|
|
13543
|
+
},
|
|
13544
|
+
children: [
|
|
13545
|
+
/* @__PURE__ */ jsx(
|
|
13546
|
+
Button,
|
|
13547
|
+
{
|
|
13548
|
+
appearance: "transparent",
|
|
13549
|
+
disabled,
|
|
13550
|
+
icon: /* @__PURE__ */ jsx(
|
|
13551
|
+
Icon,
|
|
13552
|
+
{
|
|
13553
|
+
icon: "fluent:subtract-circle-24-regular",
|
|
13554
|
+
style: {
|
|
13555
|
+
fontSize: "24px",
|
|
13556
|
+
color: tokens.colorNeutralForeground4
|
|
13557
|
+
}
|
|
13558
|
+
}
|
|
13559
|
+
),
|
|
13560
|
+
"aria-label": mergedLabels.decrementQuantityAriaLabel,
|
|
13561
|
+
size: "small",
|
|
13562
|
+
onClick: () => {
|
|
13563
|
+
const currentVal = getValues(
|
|
13564
|
+
`owners.${index}.cargo.${cargoIndex}.quantity`
|
|
13565
|
+
) || 0;
|
|
13566
|
+
const currentQty = Number(currentVal);
|
|
13567
|
+
if (currentQty > 1) {
|
|
13568
|
+
const newVal = currentQty - 1;
|
|
13569
|
+
setValue(
|
|
13570
|
+
`owners.${index}.cargo.${cargoIndex}.quantity`,
|
|
13571
|
+
newVal
|
|
13572
|
+
);
|
|
13573
|
+
onUpdateCargoQuantity(
|
|
13574
|
+
owner.id,
|
|
13575
|
+
cargo.id,
|
|
13576
|
+
newVal
|
|
13577
|
+
);
|
|
13578
|
+
}
|
|
13579
|
+
},
|
|
13580
|
+
style: {
|
|
13581
|
+
minWidth: "32px",
|
|
13582
|
+
padding: "0"
|
|
13583
|
+
}
|
|
13584
|
+
}
|
|
13585
|
+
),
|
|
13586
|
+
/* @__PURE__ */ jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsx(
|
|
13587
|
+
Controller,
|
|
13588
|
+
{
|
|
13589
|
+
name: `owners.${index}.cargo.${cargoIndex}.quantity`,
|
|
13590
|
+
control,
|
|
13591
|
+
disabled,
|
|
13592
|
+
render: ({ field }) => /* @__PURE__ */ jsx(
|
|
13593
|
+
"input",
|
|
13594
|
+
{
|
|
13595
|
+
...field,
|
|
13596
|
+
min: 1,
|
|
13597
|
+
step: "1",
|
|
13598
|
+
type: "number",
|
|
13599
|
+
style: {
|
|
13600
|
+
border: "none",
|
|
13601
|
+
width: "100%",
|
|
13602
|
+
textAlign: "center",
|
|
13603
|
+
outline: "none",
|
|
13604
|
+
backgroundColor: "transparent",
|
|
13605
|
+
color: tokens.colorNeutralForeground1,
|
|
13606
|
+
fontSize: tokens.fontSizeBase400,
|
|
13607
|
+
fontFamily: tokens.fontFamilyBase
|
|
13608
|
+
},
|
|
13609
|
+
onKeyDown: (e) => {
|
|
13610
|
+
if ([
|
|
13611
|
+
"e",
|
|
13612
|
+
"E",
|
|
13613
|
+
"+",
|
|
13614
|
+
"-",
|
|
13615
|
+
".",
|
|
13616
|
+
","
|
|
13617
|
+
].includes(e.key)) {
|
|
13618
|
+
e.preventDefault();
|
|
13619
|
+
}
|
|
13620
|
+
},
|
|
13621
|
+
onPaste: (e) => {
|
|
13622
|
+
const paste = e.clipboardData.getData(
|
|
13623
|
+
"text"
|
|
13624
|
+
);
|
|
13625
|
+
if (!/^\d+$/.test(paste)) {
|
|
13626
|
+
e.preventDefault();
|
|
13627
|
+
}
|
|
13628
|
+
},
|
|
13629
|
+
onWheel: (e) => e.target.blur(),
|
|
13630
|
+
onChange: (e) => {
|
|
13631
|
+
const newVal = Number(
|
|
13632
|
+
e.target.value
|
|
13633
|
+
);
|
|
13634
|
+
field.onChange(e);
|
|
13635
|
+
onUpdateCargoQuantity(
|
|
13636
|
+
owner.id,
|
|
13637
|
+
cargo.id,
|
|
13638
|
+
newVal
|
|
13639
|
+
);
|
|
13640
|
+
}
|
|
13641
|
+
}
|
|
13642
|
+
),
|
|
13643
|
+
rules: {
|
|
13644
|
+
required: true,
|
|
13645
|
+
validate: (val) => Number(val) > 0
|
|
13646
|
+
}
|
|
13647
|
+
}
|
|
13648
|
+
) }),
|
|
13649
|
+
/* @__PURE__ */ jsx(
|
|
13650
|
+
Button,
|
|
13651
|
+
{
|
|
13652
|
+
appearance: "transparent",
|
|
13653
|
+
disabled,
|
|
13654
|
+
icon: /* @__PURE__ */ jsx(
|
|
13655
|
+
Icon,
|
|
13656
|
+
{
|
|
13657
|
+
icon: "fluent:add-circle-24-regular",
|
|
13658
|
+
style: {
|
|
13659
|
+
fontSize: "24px",
|
|
13660
|
+
color: tokens.colorBrandStroke1
|
|
13661
|
+
}
|
|
13662
|
+
}
|
|
13663
|
+
),
|
|
13664
|
+
"aria-label": mergedLabels.incrementQuantityAriaLabel,
|
|
13665
|
+
size: "small",
|
|
13666
|
+
onClick: () => {
|
|
13667
|
+
const currentVal = getValues(
|
|
13668
|
+
`owners.${index}.cargo.${cargoIndex}.quantity`
|
|
13669
|
+
) || 0;
|
|
13670
|
+
const currentQty = Number(currentVal);
|
|
13671
|
+
const newVal = currentQty + 1;
|
|
13672
|
+
setValue(
|
|
13673
|
+
`owners.${index}.cargo.${cargoIndex}.quantity`,
|
|
13674
|
+
newVal
|
|
13675
|
+
);
|
|
13676
|
+
onUpdateCargoQuantity(
|
|
13677
|
+
owner.id,
|
|
13678
|
+
cargo.id,
|
|
13679
|
+
newVal
|
|
13680
|
+
);
|
|
13681
|
+
},
|
|
13682
|
+
style: {
|
|
13683
|
+
minWidth: "32px",
|
|
13684
|
+
padding: "0"
|
|
13685
|
+
}
|
|
13686
|
+
}
|
|
13687
|
+
)
|
|
13688
|
+
]
|
|
13689
|
+
}
|
|
13690
|
+
),
|
|
13691
|
+
/* @__PURE__ */ jsx(
|
|
13692
|
+
"div",
|
|
13693
|
+
{
|
|
13694
|
+
style: {
|
|
13695
|
+
flex: 1,
|
|
13696
|
+
textAlign: "left",
|
|
13697
|
+
color: tokens.colorNeutralForeground1,
|
|
13698
|
+
fontSize: tokens.fontSizeBase300,
|
|
13699
|
+
paddingRight: "8px"
|
|
13700
|
+
},
|
|
13701
|
+
children: (() => {
|
|
13702
|
+
const type2 = watch(
|
|
13703
|
+
`owners.${index}.cargo.${cargoIndex}.cargoType`
|
|
13704
|
+
);
|
|
13705
|
+
const selectedLoadType2 = loadTypes.find(
|
|
13706
|
+
(loadType) => loadType.id.toString() === type2
|
|
13707
|
+
);
|
|
13708
|
+
return selectedLoadType2?.unit?.name;
|
|
13709
|
+
})()
|
|
13710
|
+
}
|
|
13711
|
+
)
|
|
13712
|
+
]
|
|
13713
|
+
}
|
|
13714
|
+
)
|
|
13715
|
+
] }),
|
|
13716
|
+
/* @__PURE__ */ jsxs(Col, { md: 12, children: [
|
|
13717
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
|
|
13718
|
+
/* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
|
|
13719
|
+
/* @__PURE__ */ jsx(
|
|
13720
|
+
Body2,
|
|
13721
|
+
{
|
|
13722
|
+
style: { marginTop: "0.5rem" },
|
|
13723
|
+
children: (() => {
|
|
13724
|
+
return new Intl.NumberFormat(
|
|
13725
|
+
"id-ID",
|
|
13726
|
+
{
|
|
13727
|
+
style: "currency",
|
|
13728
|
+
currency: "IDR",
|
|
13729
|
+
minimumFractionDigits: 0
|
|
13730
|
+
}
|
|
13731
|
+
).format(
|
|
13732
|
+
Number(
|
|
13733
|
+
getValues(
|
|
13734
|
+
`owners.${index}.cargo.${cargoIndex}.quantity`
|
|
13735
|
+
) || 0
|
|
13736
|
+
) * (_selectedLoadType?.price || 0)
|
|
13737
|
+
);
|
|
13738
|
+
})()
|
|
13739
|
+
}
|
|
13740
|
+
)
|
|
13741
|
+
] })
|
|
13742
|
+
] });
|
|
13743
|
+
})()
|
|
13764
13744
|
] }) })
|
|
13765
13745
|
]
|
|
13766
13746
|
},
|