@asdp/ferryui 0.1.22-dev.10344 → 0.1.22-dev.10371

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.mjs CHANGED
@@ -443,9 +443,12 @@ var MANIFEST_ENTITY = {
443
443
  INDIVIDUAL: "individual"
444
444
  };
445
445
  var HARDCODED_ID = {
446
- FAQ_ID_PEMESANAN_TIKET: 1,
447
- COMPANY_ID_LAINNYA: "999999",
448
- LOAD_TYPE_ID_LAINNYA: 87
446
+ FAQ__PEMESANAN_TIKET: 1,
447
+ COMPANY__LAINNYA: "999999",
448
+ LOAD_TYPE__LAINNYA: 87
449
+ };
450
+ var HARDCODED_NAME = {
451
+ LOAD_TYPE__LAINNYA: "Lainnya"
449
452
  };
450
453
  var useStyles2 = makeStyles({
451
454
  carousel: {},
@@ -12634,8 +12637,10 @@ var DEFAULT_LABELS26 = {
12634
12637
  cargoItemTitle: "Muatan {index}",
12635
12638
  commodityLabel: "Data Komoditas",
12636
12639
  hereLinkText: "disini",
12637
- cargoTypeLabel: "Data Jenis Muatan",
12638
- cargoTypeHelperText: 'Apabila jenis muatan belum tersedia dapat memilih "Lainnya" dan silakan isi jenis muatannya.',
12640
+ loadTypeLabel: "Data Jenis Muatan",
12641
+ loadTypeOthersLabel: "Jenis Muatan Lainnya",
12642
+ loadTypeHelperText: 'Apabila jenis muatan belum tersedia dapat memilih "Lainnya" dan silakan isi jenis muatannya.',
12643
+ loadTypeOthersPlaceholder: "Masukkan Jenis Muatan",
12639
12644
  cargoQuantityLabel: "Jumlah Muatan",
12640
12645
  priceLabel: "Harga",
12641
12646
  industryTypeLabel: "Data Jenis Industri",
@@ -12643,7 +12648,7 @@ var DEFAULT_LABELS26 = {
12643
12648
  cargoCategoryLabel: "Kategori Muatan",
12644
12649
  deleteCargoButton: "Hapus Muatan",
12645
12650
  addCargoButton: "Tambah Muatan",
12646
- cargoTypeOptions: {
12651
+ loadTypeOptions: {
12647
12652
  karung: "Karung",
12648
12653
  kg: "Kg",
12649
12654
  ton: "Ton",
@@ -12686,8 +12691,10 @@ var DEFAULT_LABELS26 = {
12686
12691
  cargoItemTitle: "Cargo {index}",
12687
12692
  commodityLabel: "Commodity Data",
12688
12693
  hereLinkText: "here",
12689
- cargoTypeLabel: "Cargo Type Data",
12690
- cargoTypeHelperText: 'If the cargo type is not available, select "Other" and enter the cargo type.',
12694
+ loadTypeLabel: "Cargo Type Data",
12695
+ loadTypeHelperText: 'If the cargo type is not available, select "Other" and enter the cargo type.',
12696
+ loadTypeOthersPlaceholder: "Enter Cargo Type",
12697
+ loadTypeOthersLabel: "Other Cargo Type",
12691
12698
  cargoQuantityLabel: "Cargo Quantity",
12692
12699
  priceLabel: "Price",
12693
12700
  industryTypeLabel: "Industry Type Data",
@@ -12695,7 +12702,7 @@ var DEFAULT_LABELS26 = {
12695
12702
  cargoCategoryLabel: "Cargo Category",
12696
12703
  deleteCargoButton: "Delete Cargo",
12697
12704
  addCargoButton: "Add Cargo",
12698
- cargoTypeOptions: {
12705
+ loadTypeOptions: {
12699
12706
  karung: "Sack",
12700
12707
  kg: "Kg",
12701
12708
  ton: "Ton",
@@ -12858,7 +12865,7 @@ var CardVehicleOwnerForm = ({
12858
12865
  " ",
12859
12866
  /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
12860
12867
  ] }) }),
12861
- /* @__PURE__ */ jsxs(Col, { lg: 6, children: [
12868
+ /* @__PURE__ */ jsxs(Col, { lg: 12, children: [
12862
12869
  /* @__PURE__ */ jsx(
12863
12870
  "div",
12864
12871
  {
@@ -12907,7 +12914,7 @@ var CardVehicleOwnerForm = ({
12907
12914
  /* @__PURE__ */ jsx(
12908
12915
  Col,
12909
12916
  {
12910
- lg: owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY_ID_LAINNYA ? 6 : 12,
12917
+ lg: owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY__LAINNYA ? 6 : 12,
12911
12918
  children: /* @__PURE__ */ jsx(
12912
12919
  InputDynamic_default,
12913
12920
  {
@@ -12929,7 +12936,7 @@ var CardVehicleOwnerForm = ({
12929
12936
  )
12930
12937
  }
12931
12938
  ),
12932
- owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY_ID_LAINNYA && /* @__PURE__ */ jsx(Col, { xl: 6, children: /* @__PURE__ */ jsx(
12939
+ owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY__LAINNYA && /* @__PURE__ */ jsx(Col, { xl: 6, children: /* @__PURE__ */ jsx(
12933
12940
  InputDynamic_default,
12934
12941
  {
12935
12942
  control,
@@ -12961,36 +12968,10 @@ var CardVehicleOwnerForm = ({
12961
12968
  children: mergedLabels.otherCompanyHelperText
12962
12969
  }
12963
12970
  )
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
12971
  ] })
12991
12972
  ] }),
12992
- hasLoad && /* @__PURE__ */ jsxs(Row, { children: [
12993
- /* @__PURE__ */ jsx(Col, { lg: 6, children: /* @__PURE__ */ jsxs(Row, { nogutter: true, children: [
12973
+ hasLoad && /* @__PURE__ */ jsxs(Fragment, { children: [
12974
+ /* @__PURE__ */ jsxs(Row, { nogutter: true, children: [
12994
12975
  /* @__PURE__ */ jsx(Col, { lg: 12, children: /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoReceiverTitle }) }),
12995
12976
  /* @__PURE__ */ jsxs(Col, { lg: 12, children: [
12996
12977
  /* @__PURE__ */ jsx(
@@ -13047,7 +13028,7 @@ var CardVehicleOwnerForm = ({
13047
13028
  /* @__PURE__ */ jsx(
13048
13029
  Col,
13049
13030
  {
13050
- lg: owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY_ID_LAINNYA ? 6 : 12,
13031
+ lg: owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY__LAINNYA ? 6 : 12,
13051
13032
  children: /* @__PURE__ */ jsx(
13052
13033
  InputDynamic_default,
13053
13034
  {
@@ -13072,7 +13053,7 @@ var CardVehicleOwnerForm = ({
13072
13053
  )
13073
13054
  }
13074
13055
  ),
13075
- owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY_ID_LAINNYA && /* @__PURE__ */ jsx(Col, { lg: 6, children: /* @__PURE__ */ jsx(
13056
+ owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY__LAINNYA && /* @__PURE__ */ jsx(Col, { lg: 6, children: /* @__PURE__ */ jsx(
13076
13057
  InputDynamic_default,
13077
13058
  {
13078
13059
  control,
@@ -13105,8 +13086,8 @@ var CardVehicleOwnerForm = ({
13105
13086
  }
13106
13087
  )
13107
13088
  ] })
13108
- ] }) }),
13109
- /* @__PURE__ */ jsx(Col, { lg: 6, children: /* @__PURE__ */ jsxs(Row, { nogutter: true, children: [
13089
+ ] }),
13090
+ /* @__PURE__ */ jsxs(Row, { nogutter: true, children: [
13110
13091
  /* @__PURE__ */ jsx(Col, { lg: 12, children: /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13111
13092
  mergedLabels.logisticsCompanyTitle,
13112
13093
  " ",
@@ -13164,7 +13145,7 @@ var CardVehicleOwnerForm = ({
13164
13145
  /* @__PURE__ */ jsx(
13165
13146
  Col,
13166
13147
  {
13167
- xl: owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY_ID_LAINNYA ? 6 : 12,
13148
+ xl: owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY__LAINNYA ? 6 : 12,
13168
13149
  children: /* @__PURE__ */ jsx(
13169
13150
  InputDynamic_default,
13170
13151
  {
@@ -13189,7 +13170,7 @@ var CardVehicleOwnerForm = ({
13189
13170
  )
13190
13171
  }
13191
13172
  ),
13192
- owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY_ID_LAINNYA && /* @__PURE__ */ jsx(Col, { xl: 6, children: /* @__PURE__ */ jsx(
13173
+ owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY__LAINNYA && /* @__PURE__ */ jsx(Col, { xl: 6, children: /* @__PURE__ */ jsx(
13193
13174
  InputDynamic_default,
13194
13175
  {
13195
13176
  control,
@@ -13222,10 +13203,10 @@ var CardVehicleOwnerForm = ({
13222
13203
  children: mergedLabels.otherCompanyHelperText
13223
13204
  }
13224
13205
  )
13225
- ] }) })
13206
+ ] })
13226
13207
  ] }),
13227
13208
  /* @__PURE__ */ jsxs(Row, { children: [
13228
- /* @__PURE__ */ jsxs(Col, { children: [
13209
+ /* @__PURE__ */ jsxs(Col, { xl: 6, children: [
13229
13210
  /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.originCityLabel }),
13230
13211
  /* @__PURE__ */ jsx(
13231
13212
  InputDynamic_default,
@@ -13247,7 +13228,7 @@ var CardVehicleOwnerForm = ({
13247
13228
  }
13248
13229
  )
13249
13230
  ] }),
13250
- /* @__PURE__ */ jsxs(Col, { children: [
13231
+ /* @__PURE__ */ jsxs(Col, { xl: 6, children: [
13251
13232
  /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.destinationCityLabel }),
13252
13233
  /* @__PURE__ */ jsx(
13253
13234
  InputDynamic_default,
@@ -13268,6 +13249,32 @@ var CardVehicleOwnerForm = ({
13268
13249
  type: "select"
13269
13250
  }
13270
13251
  )
13252
+ ] }),
13253
+ /* @__PURE__ */ jsxs(Col, { lg: 12, children: [
13254
+ /* @__PURE__ */ jsx("div", { style: { height: "1rem" } }),
13255
+ /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13256
+ mergedLabels.estimatedVehicleWeightLabel,
13257
+ " ",
13258
+ /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13259
+ ] }),
13260
+ /* @__PURE__ */ jsx(
13261
+ InputDynamic_default,
13262
+ {
13263
+ control,
13264
+ disabled,
13265
+ name: `owners.${index}.estimatedWeight`,
13266
+ placeholder: mergedLabels.inputNumberPlaceholder,
13267
+ required: true,
13268
+ size: "large",
13269
+ type: "number",
13270
+ onChange: (val) => {
13271
+ setValue(`owners.${index}.estimatedWeight`, val);
13272
+ onUpdateOwner(owner.id, {
13273
+ estimatedWeight: val
13274
+ });
13275
+ }
13276
+ }
13277
+ )
13271
13278
  ] })
13272
13279
  ] }),
13273
13280
  hasLoad && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -13281,159 +13288,291 @@ var CardVehicleOwnerForm = ({
13281
13288
  (cargo) => `cargo-${cargo.id}`
13282
13289
  ) || [],
13283
13290
  multiple: true,
13284
- children: owner.cargoItems?.map((cargo, cargoIndex) => /* @__PURE__ */ jsxs(
13285
- AccordionItem,
13286
- {
13287
- value: `cargo-${cargo.id}`,
13288
- className: styles.accordion,
13289
- children: [
13290
- /* @__PURE__ */ jsx(
13291
- AccordionHeader,
13292
- {
13293
- className: styles.accordionHeader,
13294
- expandIconPosition: "end",
13295
- children: /* @__PURE__ */ jsx(
13296
- "div",
13297
- {
13298
- style: {
13299
- display: "flex",
13300
- justifyContent: "space-between",
13301
- alignItems: "center",
13302
- width: "100%"
13303
- },
13304
- children: /* @__PURE__ */ jsx(Body1Strong, { children: mergedLabels.cargoItemTitle.replace(
13305
- "{index}",
13306
- (cargoIndex + 1).toString()
13307
- ) })
13308
- }
13309
- )
13310
- }
13311
- ),
13312
- /* @__PURE__ */ jsx(AccordionPanel, { children: /* @__PURE__ */ jsxs("div", { className: styles.form, children: [
13313
- /* @__PURE__ */ jsxs(Row, { children: [
13314
- /* @__PURE__ */ jsxs(Col, { md: 3, children: [
13315
- /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13316
- mergedLabels.commodityLabel,
13317
- " ",
13318
- /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13319
- ] }),
13320
- /* @__PURE__ */ jsx(
13321
- InputDynamic_default,
13291
+ children: owner.cargoItems?.map((cargo, cargoIndex) => {
13292
+ const watchCommodity = watch(
13293
+ `owners.${index}.cargo.${cargoIndex}.commodity`
13294
+ );
13295
+ const watchLoadType = watch(
13296
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13297
+ );
13298
+ watch(
13299
+ `owners.${index}.cargo.${cargoIndex}.industryType`
13300
+ );
13301
+ let _loadTypeOptions = [];
13302
+ if (watchCommodity && loadTypeOptionsByCommodityId[watchCommodity]) {
13303
+ _loadTypeOptions = loadTypeOptionsByCommodityId[watchCommodity];
13304
+ } else {
13305
+ _loadTypeOptions = loadTypeOptions.map((lt) => ({
13306
+ value: lt.id.toString(),
13307
+ label: `${lt.name}${lt.unit?.name ? ` (${lt.unit.name})` : ""}`
13308
+ }));
13309
+ }
13310
+ const isLoadTypeOther = _loadTypeOptions.find(
13311
+ (lt) => lt.value.toString() === String(watchLoadType)
13312
+ )?.label.startsWith(HARDCODED_NAME.LOAD_TYPE__LAINNYA);
13313
+ return /* @__PURE__ */ jsxs(
13314
+ AccordionItem,
13315
+ {
13316
+ value: `cargo-${cargo.id}`,
13317
+ className: styles.accordion,
13318
+ children: [
13319
+ /* @__PURE__ */ jsx(
13320
+ AccordionHeader,
13321
+ {
13322
+ className: styles.accordionHeader,
13323
+ expandIconPosition: "end",
13324
+ children: /* @__PURE__ */ jsx(
13325
+ "div",
13322
13326
  {
13323
- control,
13324
- disabled,
13325
- name: `owners.${index}.cargo.${cargoIndex}.commodity`,
13326
- onChange: (val) => {
13327
- const name = `owners.${index}.cargo.${cargoIndex}.commodity`;
13328
- setValue(name, val);
13329
- const updatedCargoItems = owner.cargoItems?.map(
13330
- (c, cIdx) => cIdx === cargoIndex ? {
13331
- ...c,
13332
- commodity: val
13333
- } : c
13334
- );
13335
- onUpdateOwner(owner.id, {
13336
- cargoItems: updatedCargoItems
13337
- });
13338
- setValue(
13339
- `owners.${index}.cargo.${cargoIndex}.cargoType`,
13340
- ""
13341
- );
13327
+ style: {
13328
+ display: "flex",
13329
+ justifyContent: "space-between",
13330
+ alignItems: "center",
13331
+ width: "100%"
13342
13332
  },
13343
- options: commodityOptions,
13344
- placeholder: mergedLabels.selectPlaceholder,
13345
- required: true,
13346
- type: "select",
13347
- size: "large"
13333
+ children: /* @__PURE__ */ jsx(Body1Strong, { children: mergedLabels.cargoItemTitle.replace(
13334
+ "{index}",
13335
+ (cargoIndex + 1).toString()
13336
+ ) })
13348
13337
  }
13349
13338
  )
13350
- ] }),
13351
- /* @__PURE__ */ jsxs(Col, { md: 3, children: [
13352
- /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13353
- mergedLabels.cargoTypeLabel,
13354
- " ",
13355
- /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13339
+ }
13340
+ ),
13341
+ /* @__PURE__ */ jsx(AccordionPanel, { children: /* @__PURE__ */ jsxs("div", { className: styles.form, children: [
13342
+ /* @__PURE__ */ jsxs(Row, { children: [
13343
+ /* @__PURE__ */ jsxs(Col, { md: isLoadTypeOther ? 4 : 6, children: [
13344
+ /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13345
+ mergedLabels.commodityLabel,
13346
+ " ",
13347
+ /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13348
+ ] }),
13349
+ /* @__PURE__ */ jsx(
13350
+ InputDynamic_default,
13351
+ {
13352
+ control,
13353
+ disabled,
13354
+ name: `owners.${index}.cargo.${cargoIndex}.commodity`,
13355
+ onChange: (val) => {
13356
+ const name = `owners.${index}.cargo.${cargoIndex}.commodity`;
13357
+ setValue(name, val);
13358
+ const updatedCargoItems = owner.cargoItems?.map(
13359
+ (c, cIdx) => cIdx === cargoIndex ? {
13360
+ ...c,
13361
+ commodity: val
13362
+ } : c
13363
+ );
13364
+ onUpdateOwner(owner.id, {
13365
+ cargoItems: updatedCargoItems
13366
+ });
13367
+ setValue(
13368
+ `owners.${index}.cargo.${cargoIndex}.loadType`,
13369
+ ""
13370
+ );
13371
+ },
13372
+ options: commodityOptions,
13373
+ placeholder: mergedLabels.selectPlaceholder,
13374
+ required: true,
13375
+ type: "select",
13376
+ size: "large"
13377
+ }
13378
+ )
13356
13379
  ] }),
13357
- /* @__PURE__ */ jsx(
13358
- InputDynamic_default,
13359
- {
13360
- control,
13361
- disabled: disabled || (getValues(
13362
- `owners.${index}.cargo.${cargoIndex}.commodity`
13363
- ) || "") === "",
13364
- name: `owners.${index}.cargo.${cargoIndex}.cargoType`,
13365
- onChange: (val) => {
13366
- const name = `owners.${index}.cargo.${cargoIndex}.cargoType`;
13367
- setValue(name, val);
13368
- const updatedCargoItems = owner.cargoItems?.map(
13369
- (c, cIdx) => cIdx === cargoIndex ? {
13370
- ...c,
13371
- cargoType: val
13372
- } : c
13373
- );
13374
- onUpdateOwner(owner.id, {
13375
- cargoItems: updatedCargoItems
13376
- });
13377
- },
13378
- options: (() => {
13379
- const selectedCommodityId = watch(
13380
+ /* @__PURE__ */ jsxs(Col, { md: isLoadTypeOther ? 4 : 6, children: [
13381
+ /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13382
+ mergedLabels.loadTypeLabel,
13383
+ " ",
13384
+ /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13385
+ ] }),
13386
+ /* @__PURE__ */ jsx(
13387
+ InputDynamic_default,
13388
+ {
13389
+ control,
13390
+ disabled: disabled || (getValues(
13380
13391
  `owners.${index}.cargo.${cargoIndex}.commodity`
13381
- );
13382
- if (selectedCommodityId && loadTypeOptionsByCommodityId[selectedCommodityId]) {
13383
- return loadTypeOptionsByCommodityId[selectedCommodityId];
13392
+ ) || "") === "",
13393
+ name: `owners.${index}.cargo.${cargoIndex}.loadType`,
13394
+ onChange: (val) => {
13395
+ const name = `owners.${index}.cargo.${cargoIndex}.loadType`;
13396
+ setValue(name, val);
13397
+ const updatedCargoItems = owner.cargoItems?.map(
13398
+ (c, cIdx) => cIdx === cargoIndex ? {
13399
+ ...c,
13400
+ loadType: val
13401
+ } : c
13402
+ );
13403
+ onUpdateOwner(owner.id, {
13404
+ cargoItems: updatedCargoItems
13405
+ });
13406
+ },
13407
+ options: _loadTypeOptions,
13408
+ placeholder: mergedLabels.selectPlaceholder,
13409
+ required: true,
13410
+ size: "large",
13411
+ type: "select"
13412
+ }
13413
+ ),
13414
+ /* @__PURE__ */ jsx(
13415
+ Caption1,
13416
+ {
13417
+ style: {
13418
+ color: tokens.colorNeutralForeground3,
13419
+ marginTop: "0.25rem"
13420
+ },
13421
+ children: mergedLabels.loadTypeHelperText
13422
+ }
13423
+ )
13424
+ ] }),
13425
+ isLoadTypeOther && /* @__PURE__ */ jsxs(Col, { xl: 4, children: [
13426
+ /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13427
+ mergedLabels.loadTypeOthersLabel,
13428
+ " ",
13429
+ /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13430
+ ] }),
13431
+ /* @__PURE__ */ jsx(
13432
+ InputDynamic_default,
13433
+ {
13434
+ control,
13435
+ disabled,
13436
+ name: `owners.${index}.cargo.${cargoIndex}.loadTypeOther`,
13437
+ placeholder: mergedLabels.loadTypeOthersPlaceholder,
13438
+ required: true,
13439
+ size: "large",
13440
+ type: "text",
13441
+ onChange: (val) => {
13442
+ setValue(
13443
+ `owners.${index}.cargo.${cargoIndex}.loadTypeOther`,
13444
+ val
13445
+ );
13446
+ const updatedCargoItems = owner.cargoItems?.map(
13447
+ (c, cIdx) => cIdx === cargoIndex ? {
13448
+ ...c,
13449
+ loadTypeOther: val
13450
+ } : c
13451
+ );
13452
+ onUpdateOwner(owner.id, {
13453
+ cargoItems: updatedCargoItems
13454
+ });
13384
13455
  }
13385
- return loadTypeOptions.map((lt) => ({
13386
- value: lt.id.toString(),
13387
- label: `${lt.name}${lt.unit?.name ? ` (${lt.unit.name})` : ""}`
13388
- }));
13389
- })(),
13390
- placeholder: mergedLabels.selectPlaceholder,
13391
- required: true,
13392
- size: "large",
13393
- type: "select"
13394
- }
13395
- ),
13396
- /* @__PURE__ */ jsx(
13397
- Caption1,
13398
- {
13399
- style: {
13400
- color: tokens.colorNeutralForeground3,
13401
- marginTop: "0.25rem"
13402
- },
13403
- children: mergedLabels.cargoTypeHelperText
13404
- }
13405
- )
13456
+ }
13457
+ )
13458
+ ] })
13459
+ ] }),
13460
+ /* @__PURE__ */ jsxs(Row, { children: [
13461
+ /* @__PURE__ */ jsxs(Col, { md: 6, children: [
13462
+ /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13463
+ mergedLabels.industryTypeLabel,
13464
+ " ",
13465
+ /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13466
+ ] }),
13467
+ /* @__PURE__ */ jsx(
13468
+ InputDynamic_default,
13469
+ {
13470
+ control,
13471
+ disabled,
13472
+ name: `owners.${index}.cargo.${cargoIndex}.industryType`,
13473
+ options: industryOptions,
13474
+ onChange: (val) => {
13475
+ const name = `owners.${index}.cargo.${cargoIndex}.industryType`;
13476
+ setValue(name, val);
13477
+ const updatedCargoItems = owner.cargoItems?.map(
13478
+ (c, cIdx) => cIdx === cargoIndex ? {
13479
+ ...c,
13480
+ industryType: val
13481
+ } : c
13482
+ );
13483
+ onUpdateOwner(owner.id, {
13484
+ cargoItems: updatedCargoItems
13485
+ });
13486
+ },
13487
+ placeholder: mergedLabels.selectPlaceholder,
13488
+ required: true,
13489
+ size: "large",
13490
+ type: "select"
13491
+ }
13492
+ ),
13493
+ /* @__PURE__ */ jsx(
13494
+ Caption1,
13495
+ {
13496
+ style: {
13497
+ color: tokens.colorNeutralForeground3,
13498
+ marginTop: "0.25rem"
13499
+ },
13500
+ children: mergedLabels.industryTypeHelperText
13501
+ }
13502
+ )
13503
+ ] }),
13504
+ /* @__PURE__ */ jsxs(Col, { md: 6, children: [
13505
+ /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13506
+ mergedLabels.cargoCategoryLabel,
13507
+ " ",
13508
+ /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13509
+ ] }),
13510
+ /* @__PURE__ */ jsx(
13511
+ InputDynamic_default,
13512
+ {
13513
+ control,
13514
+ disabled,
13515
+ name: `owners.${index}.cargo.${cargoIndex}.cargoCategory`,
13516
+ options: loadCategoryOptions,
13517
+ onChange: (val) => {
13518
+ const name = `owners.${index}.cargo.${cargoIndex}.cargoCategory`;
13519
+ setValue(name, val);
13520
+ const updatedCargoItems = owner.cargoItems?.map(
13521
+ (c, cIdx) => cIdx === cargoIndex ? {
13522
+ ...c,
13523
+ cargoCategory: val
13524
+ } : c
13525
+ );
13526
+ onUpdateOwner(owner.id, {
13527
+ cargoItems: updatedCargoItems
13528
+ });
13529
+ },
13530
+ placeholder: mergedLabels.selectPlaceholder,
13531
+ required: true,
13532
+ size: "large",
13533
+ type: "select"
13534
+ }
13535
+ )
13536
+ ] })
13406
13537
  ] }),
13538
+ /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsx(Col, { children: (owner.cargoItems?.length || 0) > 1 && /* @__PURE__ */ jsx(
13539
+ Button,
13540
+ {
13541
+ disabled,
13542
+ icon: /* @__PURE__ */ jsx(Icon, { icon: "fluent:delete-24-regular" }),
13543
+ onClick: (e) => {
13544
+ e.stopPropagation();
13545
+ onDeleteCargo(owner.id, cargo.id);
13546
+ },
13547
+ onKeyDown: (e) => {
13548
+ if (e.key === "Enter" || e.key === " ") {
13549
+ e.stopPropagation();
13550
+ onDeleteCargo(
13551
+ owner.id,
13552
+ cargo.id
13553
+ );
13554
+ }
13555
+ },
13556
+ size: "medium",
13557
+ shape: "circular",
13558
+ style: {
13559
+ border: `1px solid ${tokens.colorPaletteRedForeground1}`,
13560
+ color: tokens.colorPaletteRedForeground1,
13561
+ width: "100%"
13562
+ },
13563
+ children: mergedLabels.deleteCargoButton
13564
+ }
13565
+ ) }) }),
13407
13566
  (() => {
13408
13567
  const type = watch(
13409
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13568
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13410
13569
  );
13411
- const selectedLoadType2 = loadTypes.find(
13570
+ const _selectedLoadType = loadTypes.find(
13412
13571
  (loadType) => loadType.id.toString() === type
13413
13572
  );
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: [
13573
+ if (!_selectedLoadType) return null;
13574
+ return /* @__PURE__ */ jsxs(Row, { children: [
13575
+ /* @__PURE__ */ jsxs(Col, { md: 12, children: [
13437
13576
  /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
13438
13577
  /* @__PURE__ */ jsxs(
13439
13578
  "div",
@@ -13616,12 +13755,12 @@ var CardVehicleOwnerForm = ({
13616
13755
  },
13617
13756
  children: (() => {
13618
13757
  const type2 = watch(
13619
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13758
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13620
13759
  );
13621
- const selectedLoadType3 = loadTypes.find(
13760
+ const selectedLoadType2 = loadTypes.find(
13622
13761
  (loadType) => loadType.id.toString() === type2
13623
13762
  );
13624
- return selectedLoadType3?.unit?.name;
13763
+ return selectedLoadType2?.unit?.name;
13625
13764
  })()
13626
13765
  }
13627
13766
  )
@@ -13629,7 +13768,7 @@ var CardVehicleOwnerForm = ({
13629
13768
  }
13630
13769
  )
13631
13770
  ] }),
13632
- /* @__PURE__ */ jsxs(Col, { md: 3, children: [
13771
+ /* @__PURE__ */ jsxs(Col, { md: 12, children: [
13633
13772
  /* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
13634
13773
  /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13635
13774
  /* @__PURE__ */ jsx(
@@ -13649,7 +13788,7 @@ var CardVehicleOwnerForm = ({
13649
13788
  getValues(
13650
13789
  `owners.${index}.cargo.${cargoIndex}.quantity`
13651
13790
  ) || 0
13652
- ) * (selectedLoadType2?.price || 0)
13791
+ ) * (_selectedLoadType?.price || 0)
13653
13792
  );
13654
13793
  })()
13655
13794
  }
@@ -13657,115 +13796,12 @@ var CardVehicleOwnerForm = ({
13657
13796
  ] })
13658
13797
  ] });
13659
13798
  })()
13660
- ] }),
13661
- /* @__PURE__ */ jsxs(Row, { children: [
13662
- /* @__PURE__ */ jsxs(Col, { md: 6, children: [
13663
- /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13664
- mergedLabels.industryTypeLabel,
13665
- " ",
13666
- /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13667
- ] }),
13668
- /* @__PURE__ */ jsx(
13669
- InputDynamic_default,
13670
- {
13671
- control,
13672
- disabled,
13673
- name: `owners.${index}.cargo.${cargoIndex}.industryType`,
13674
- options: industryOptions,
13675
- onChange: (val) => {
13676
- const name = `owners.${index}.cargo.${cargoIndex}.industryType`;
13677
- setValue(name, val);
13678
- const updatedCargoItems = owner.cargoItems?.map(
13679
- (c, cIdx) => cIdx === cargoIndex ? {
13680
- ...c,
13681
- industryType: val
13682
- } : c
13683
- );
13684
- onUpdateOwner(owner.id, {
13685
- cargoItems: updatedCargoItems
13686
- });
13687
- },
13688
- placeholder: mergedLabels.selectPlaceholder,
13689
- required: true,
13690
- size: "large",
13691
- type: "select"
13692
- }
13693
- ),
13694
- /* @__PURE__ */ jsx(
13695
- Caption1,
13696
- {
13697
- style: {
13698
- color: tokens.colorNeutralForeground3,
13699
- marginTop: "0.25rem"
13700
- },
13701
- children: mergedLabels.industryTypeHelperText
13702
- }
13703
- )
13704
- ] }),
13705
- /* @__PURE__ */ jsxs(Col, { md: 6, children: [
13706
- /* @__PURE__ */ jsxs(Body1, { className: styles.label, children: [
13707
- mergedLabels.cargoCategoryLabel,
13708
- " ",
13709
- /* @__PURE__ */ jsx("span", { style: { color: "red" }, children: "*" })
13710
- ] }),
13711
- /* @__PURE__ */ jsx(
13712
- InputDynamic_default,
13713
- {
13714
- control,
13715
- disabled,
13716
- name: `owners.${index}.cargo.${cargoIndex}.cargoCategory`,
13717
- options: loadCategoryOptions,
13718
- onChange: (val) => {
13719
- const name = `owners.${index}.cargo.${cargoIndex}.cargoCategory`;
13720
- setValue(name, val);
13721
- const updatedCargoItems = owner.cargoItems?.map(
13722
- (c, cIdx) => cIdx === cargoIndex ? {
13723
- ...c,
13724
- cargoCategory: val
13725
- } : c
13726
- );
13727
- onUpdateOwner(owner.id, {
13728
- cargoItems: updatedCargoItems
13729
- });
13730
- },
13731
- placeholder: mergedLabels.selectPlaceholder,
13732
- required: true,
13733
- size: "large",
13734
- type: "select"
13735
- }
13736
- )
13737
- ] })
13738
- ] }),
13739
- /* @__PURE__ */ jsx(Row, { children: /* @__PURE__ */ jsx(Col, { children: (owner.cargoItems?.length || 0) > 1 && /* @__PURE__ */ jsx(
13740
- Button,
13741
- {
13742
- disabled,
13743
- icon: /* @__PURE__ */ jsx(Icon, { icon: "fluent:delete-24-regular" }),
13744
- onClick: (e) => {
13745
- e.stopPropagation();
13746
- onDeleteCargo(owner.id, cargo.id);
13747
- },
13748
- onKeyDown: (e) => {
13749
- if (e.key === "Enter" || e.key === " ") {
13750
- e.stopPropagation();
13751
- onDeleteCargo(owner.id, cargo.id);
13752
- }
13753
- },
13754
- size: "medium",
13755
- shape: "circular",
13756
- style: {
13757
- border: `1px solid ${tokens.colorPaletteRedForeground1}`,
13758
- color: tokens.colorPaletteRedForeground1,
13759
- width: "100%"
13760
- },
13761
- children: mergedLabels.deleteCargoButton
13762
- }
13763
- ) }) })
13764
- ] }) })
13765
- ]
13766
- },
13767
- cargo.id
13768
- ))
13799
+ ] }) })
13800
+ ]
13801
+ },
13802
+ cargo.id
13803
+ );
13804
+ })
13769
13805
  }
13770
13806
  ),
13771
13807
  /* @__PURE__ */ jsx(
@@ -17540,6 +17576,6 @@ var CardProfileMenu = ({
17540
17576
  ) });
17541
17577
  };
17542
17578
 
17543
- export { API_CONFIG, API_ERROR_MESSAGES, BackgroundTicketCard_default as BackgroundTicketCard, BackgroundTicketCardVertical_default as BackgroundTicketCardVertical, COUNTRIES, CardAddon, CardBanner, CardBookingAddOn, CardBookingTicket, CardFAQ, CardMealCatalog, CardOrdererInfo, CardPassengerList, CardPaymentGuide, CardPaymentInfo, CardPaymentMethodList, CardPriceDetails, CardProfileMenu, CardPromo, CardReview, CardReviewDetail, CardReviewPassenger, CardServiceMenu, CardStatusOrder, CardTicket, CardTicketSearch, DEFAULT_LABELS8 as CardTicketSearchDefaultLabels, CardTicketSearchSummary, DEFAULT_LABELS9 as CardTicketSearchSummaryDefaultLabels, CardVehicleDetail, CardVehicleOwnerForm, CarouselWithCustomNav, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS18 as DateFilterDefaultLabels, EmptyContent, DEFAULT_LABELS11 as EmptyContentDefaultLabels, FileUpload_default as FileUpload, GENDER, HARDCODED_ID, HTTP_STATUS, IDENTITY_TYPE, InputDynamic_default as InputDynamic, LOAD_TYPE, MANIFEST_ENTITY, MODAL_PRESETS, MY_TICKET_STATUS, MY_TICKET_TAB, ModalFilterTicket, DEFAULT_LABELS17 as ModalFilterTicketDefaultLabels, ModalIllustration, ModalListMenuService, ModalListPassenger, ModalPassengerForm, ModalPreviewImage, ModalPriceDetail, ModalSearchHarbor, ModalSearchTicket, ModalSelectDate, ModalService, ModalTotalPassengers, ModalTypeOfService, PASSENGER_TYPE, SortMenu, Stepper, calculateAge, getBadgeConfig, getModalPreset, getSortLabel, hexToRgba };
17579
+ export { API_CONFIG, API_ERROR_MESSAGES, BackgroundTicketCard_default as BackgroundTicketCard, BackgroundTicketCardVertical_default as BackgroundTicketCardVertical, COUNTRIES, CardAddon, CardBanner, CardBookingAddOn, CardBookingTicket, CardFAQ, CardMealCatalog, CardOrdererInfo, CardPassengerList, CardPaymentGuide, CardPaymentInfo, CardPaymentMethodList, CardPriceDetails, CardProfileMenu, CardPromo, CardReview, CardReviewDetail, CardReviewPassenger, CardServiceMenu, CardStatusOrder, CardTicket, CardTicketSearch, DEFAULT_LABELS8 as CardTicketSearchDefaultLabels, CardTicketSearchSummary, DEFAULT_LABELS9 as CardTicketSearchSummaryDefaultLabels, CardVehicleDetail, CardVehicleOwnerForm, CarouselWithCustomNav, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS18 as DateFilterDefaultLabels, EmptyContent, DEFAULT_LABELS11 as EmptyContentDefaultLabels, FileUpload_default as FileUpload, GENDER, HARDCODED_ID, HARDCODED_NAME, HTTP_STATUS, IDENTITY_TYPE, InputDynamic_default as InputDynamic, LOAD_TYPE, MANIFEST_ENTITY, MODAL_PRESETS, MY_TICKET_STATUS, MY_TICKET_TAB, ModalFilterTicket, DEFAULT_LABELS17 as ModalFilterTicketDefaultLabels, ModalIllustration, ModalListMenuService, ModalListPassenger, ModalPassengerForm, ModalPreviewImage, ModalPriceDetail, ModalSearchHarbor, ModalSearchTicket, ModalSelectDate, ModalService, ModalTotalPassengers, ModalTypeOfService, PASSENGER_TYPE, SortMenu, Stepper, calculateAge, getBadgeConfig, getModalPreset, getSortLabel, hexToRgba };
17544
17580
  //# sourceMappingURL=index.mjs.map
17545
17581
  //# sourceMappingURL=index.mjs.map