@asdp/ferryui 0.1.22-dev.10353 → 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.js CHANGED
@@ -452,9 +452,12 @@ var MANIFEST_ENTITY = {
452
452
  INDIVIDUAL: "individual"
453
453
  };
454
454
  var HARDCODED_ID = {
455
- FAQ_ID_PEMESANAN_TIKET: 1,
456
- COMPANY_ID_LAINNYA: "999999",
457
- LOAD_TYPE_ID_LAINNYA: 87
455
+ FAQ__PEMESANAN_TIKET: 1,
456
+ COMPANY__LAINNYA: "999999",
457
+ LOAD_TYPE__LAINNYA: 87
458
+ };
459
+ var HARDCODED_NAME = {
460
+ LOAD_TYPE__LAINNYA: "Lainnya"
458
461
  };
459
462
  var useStyles2 = reactComponents.makeStyles({
460
463
  carousel: {},
@@ -12643,8 +12646,10 @@ var DEFAULT_LABELS26 = {
12643
12646
  cargoItemTitle: "Muatan {index}",
12644
12647
  commodityLabel: "Data Komoditas",
12645
12648
  hereLinkText: "disini",
12646
- cargoTypeLabel: "Data Jenis Muatan",
12647
- cargoTypeHelperText: 'Apabila jenis muatan belum tersedia dapat memilih "Lainnya" dan silakan isi jenis muatannya.',
12649
+ loadTypeLabel: "Data Jenis Muatan",
12650
+ loadTypeOthersLabel: "Jenis Muatan Lainnya",
12651
+ loadTypeHelperText: 'Apabila jenis muatan belum tersedia dapat memilih "Lainnya" dan silakan isi jenis muatannya.',
12652
+ loadTypeOthersPlaceholder: "Masukkan Jenis Muatan",
12648
12653
  cargoQuantityLabel: "Jumlah Muatan",
12649
12654
  priceLabel: "Harga",
12650
12655
  industryTypeLabel: "Data Jenis Industri",
@@ -12652,7 +12657,7 @@ var DEFAULT_LABELS26 = {
12652
12657
  cargoCategoryLabel: "Kategori Muatan",
12653
12658
  deleteCargoButton: "Hapus Muatan",
12654
12659
  addCargoButton: "Tambah Muatan",
12655
- cargoTypeOptions: {
12660
+ loadTypeOptions: {
12656
12661
  karung: "Karung",
12657
12662
  kg: "Kg",
12658
12663
  ton: "Ton",
@@ -12695,8 +12700,10 @@ var DEFAULT_LABELS26 = {
12695
12700
  cargoItemTitle: "Cargo {index}",
12696
12701
  commodityLabel: "Commodity Data",
12697
12702
  hereLinkText: "here",
12698
- cargoTypeLabel: "Cargo Type Data",
12699
- cargoTypeHelperText: 'If the cargo type is not available, select "Other" and enter the cargo type.',
12703
+ loadTypeLabel: "Cargo Type Data",
12704
+ loadTypeHelperText: 'If the cargo type is not available, select "Other" and enter the cargo type.',
12705
+ loadTypeOthersPlaceholder: "Enter Cargo Type",
12706
+ loadTypeOthersLabel: "Other Cargo Type",
12700
12707
  cargoQuantityLabel: "Cargo Quantity",
12701
12708
  priceLabel: "Price",
12702
12709
  industryTypeLabel: "Industry Type Data",
@@ -12704,7 +12711,7 @@ var DEFAULT_LABELS26 = {
12704
12711
  cargoCategoryLabel: "Cargo Category",
12705
12712
  deleteCargoButton: "Delete Cargo",
12706
12713
  addCargoButton: "Add Cargo",
12707
- cargoTypeOptions: {
12714
+ loadTypeOptions: {
12708
12715
  karung: "Sack",
12709
12716
  kg: "Kg",
12710
12717
  ton: "Ton",
@@ -12916,7 +12923,7 @@ var CardVehicleOwnerForm = ({
12916
12923
  /* @__PURE__ */ jsxRuntime.jsx(
12917
12924
  reactGridSystem.Col,
12918
12925
  {
12919
- lg: owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY_ID_LAINNYA ? 6 : 12,
12926
+ lg: owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY__LAINNYA ? 6 : 12,
12920
12927
  children: /* @__PURE__ */ jsxRuntime.jsx(
12921
12928
  InputDynamic_default,
12922
12929
  {
@@ -12938,7 +12945,7 @@ var CardVehicleOwnerForm = ({
12938
12945
  )
12939
12946
  }
12940
12947
  ),
12941
- owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY_ID_LAINNYA && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xl: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
12948
+ owner.cargoOwnerEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoOwnerEntity === HARDCODED_ID.COMPANY__LAINNYA && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xl: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
12942
12949
  InputDynamic_default,
12943
12950
  {
12944
12951
  control,
@@ -13030,7 +13037,7 @@ var CardVehicleOwnerForm = ({
13030
13037
  /* @__PURE__ */ jsxRuntime.jsx(
13031
13038
  reactGridSystem.Col,
13032
13039
  {
13033
- lg: owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY_ID_LAINNYA ? 6 : 12,
13040
+ lg: owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY__LAINNYA ? 6 : 12,
13034
13041
  children: /* @__PURE__ */ jsxRuntime.jsx(
13035
13042
  InputDynamic_default,
13036
13043
  {
@@ -13055,7 +13062,7 @@ var CardVehicleOwnerForm = ({
13055
13062
  )
13056
13063
  }
13057
13064
  ),
13058
- owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY_ID_LAINNYA && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { lg: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
13065
+ owner.cargoReceiverEntityType === MANIFEST_ENTITY.COMPANY && owner.cargoReceiverEntity === HARDCODED_ID.COMPANY__LAINNYA && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { lg: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
13059
13066
  InputDynamic_default,
13060
13067
  {
13061
13068
  control,
@@ -13147,7 +13154,7 @@ var CardVehicleOwnerForm = ({
13147
13154
  /* @__PURE__ */ jsxRuntime.jsx(
13148
13155
  reactGridSystem.Col,
13149
13156
  {
13150
- xl: owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY_ID_LAINNYA ? 6 : 12,
13157
+ xl: owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY__LAINNYA ? 6 : 12,
13151
13158
  children: /* @__PURE__ */ jsxRuntime.jsx(
13152
13159
  InputDynamic_default,
13153
13160
  {
@@ -13172,7 +13179,7 @@ var CardVehicleOwnerForm = ({
13172
13179
  )
13173
13180
  }
13174
13181
  ),
13175
- owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY_ID_LAINNYA && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xl: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
13182
+ owner.logisticsEntityType === MANIFEST_ENTITY.COMPANY && owner.logisticsEntity === HARDCODED_ID.COMPANY__LAINNYA && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xl: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
13176
13183
  InputDynamic_default,
13177
13184
  {
13178
13185
  control,
@@ -13290,471 +13297,520 @@ var CardVehicleOwnerForm = ({
13290
13297
  (cargo) => `cargo-${cargo.id}`
13291
13298
  ) || [],
13292
13299
  multiple: true,
13293
- children: owner.cargoItems?.map((cargo, cargoIndex) => /* @__PURE__ */ jsxRuntime.jsxs(
13294
- reactComponents.AccordionItem,
13295
- {
13296
- value: `cargo-${cargo.id}`,
13297
- className: styles.accordion,
13298
- children: [
13299
- /* @__PURE__ */ jsxRuntime.jsx(
13300
- reactComponents.AccordionHeader,
13301
- {
13302
- className: styles.accordionHeader,
13303
- expandIconPosition: "end",
13304
- children: /* @__PURE__ */ jsxRuntime.jsx(
13305
- "div",
13306
- {
13307
- style: {
13308
- display: "flex",
13309
- justifyContent: "space-between",
13310
- alignItems: "center",
13311
- width: "100%"
13312
- },
13313
- children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Strong, { children: mergedLabels.cargoItemTitle.replace(
13314
- "{index}",
13315
- (cargoIndex + 1).toString()
13316
- ) })
13317
- }
13318
- )
13319
- }
13320
- ),
13321
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.AccordionPanel, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.form, children: [
13322
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13323
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13324
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13325
- mergedLabels.commodityLabel,
13326
- " ",
13327
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13328
- ] }),
13329
- /* @__PURE__ */ jsxRuntime.jsx(
13330
- InputDynamic_default,
13300
+ children: owner.cargoItems?.map((cargo, cargoIndex) => {
13301
+ const watchCommodity = watch(
13302
+ `owners.${index}.cargo.${cargoIndex}.commodity`
13303
+ );
13304
+ const watchLoadType = watch(
13305
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13306
+ );
13307
+ watch(
13308
+ `owners.${index}.cargo.${cargoIndex}.industryType`
13309
+ );
13310
+ let _loadTypeOptions = [];
13311
+ if (watchCommodity && loadTypeOptionsByCommodityId[watchCommodity]) {
13312
+ _loadTypeOptions = loadTypeOptionsByCommodityId[watchCommodity];
13313
+ } else {
13314
+ _loadTypeOptions = loadTypeOptions.map((lt) => ({
13315
+ value: lt.id.toString(),
13316
+ label: `${lt.name}${lt.unit?.name ? ` (${lt.unit.name})` : ""}`
13317
+ }));
13318
+ }
13319
+ const isLoadTypeOther = _loadTypeOptions.find(
13320
+ (lt) => lt.value.toString() === String(watchLoadType)
13321
+ )?.label.startsWith(HARDCODED_NAME.LOAD_TYPE__LAINNYA);
13322
+ return /* @__PURE__ */ jsxRuntime.jsxs(
13323
+ reactComponents.AccordionItem,
13324
+ {
13325
+ value: `cargo-${cargo.id}`,
13326
+ className: styles.accordion,
13327
+ children: [
13328
+ /* @__PURE__ */ jsxRuntime.jsx(
13329
+ reactComponents.AccordionHeader,
13330
+ {
13331
+ className: styles.accordionHeader,
13332
+ expandIconPosition: "end",
13333
+ children: /* @__PURE__ */ jsxRuntime.jsx(
13334
+ "div",
13331
13335
  {
13332
- control,
13333
- disabled,
13334
- name: `owners.${index}.cargo.${cargoIndex}.commodity`,
13335
- onChange: (val) => {
13336
- const name = `owners.${index}.cargo.${cargoIndex}.commodity`;
13337
- setValue(name, val);
13338
- const updatedCargoItems = owner.cargoItems?.map(
13339
- (c, cIdx) => cIdx === cargoIndex ? {
13340
- ...c,
13341
- commodity: val
13342
- } : c
13343
- );
13344
- onUpdateOwner(owner.id, {
13345
- cargoItems: updatedCargoItems
13346
- });
13347
- setValue(
13348
- `owners.${index}.cargo.${cargoIndex}.cargoType`,
13349
- ""
13350
- );
13336
+ style: {
13337
+ display: "flex",
13338
+ justifyContent: "space-between",
13339
+ alignItems: "center",
13340
+ width: "100%"
13351
13341
  },
13352
- options: commodityOptions,
13353
- placeholder: mergedLabels.selectPlaceholder,
13354
- required: true,
13355
- type: "select",
13356
- size: "large"
13342
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1Strong, { children: mergedLabels.cargoItemTitle.replace(
13343
+ "{index}",
13344
+ (cargoIndex + 1).toString()
13345
+ ) })
13357
13346
  }
13358
13347
  )
13359
- ] }),
13360
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13361
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13362
- mergedLabels.cargoTypeLabel,
13363
- " ",
13364
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13348
+ }
13349
+ ),
13350
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.AccordionPanel, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.form, children: [
13351
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13352
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: isLoadTypeOther ? 4 : 6, children: [
13353
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13354
+ mergedLabels.commodityLabel,
13355
+ " ",
13356
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13357
+ ] }),
13358
+ /* @__PURE__ */ jsxRuntime.jsx(
13359
+ InputDynamic_default,
13360
+ {
13361
+ control,
13362
+ disabled,
13363
+ name: `owners.${index}.cargo.${cargoIndex}.commodity`,
13364
+ onChange: (val) => {
13365
+ const name = `owners.${index}.cargo.${cargoIndex}.commodity`;
13366
+ setValue(name, val);
13367
+ const updatedCargoItems = owner.cargoItems?.map(
13368
+ (c, cIdx) => cIdx === cargoIndex ? {
13369
+ ...c,
13370
+ commodity: val
13371
+ } : c
13372
+ );
13373
+ onUpdateOwner(owner.id, {
13374
+ cargoItems: updatedCargoItems
13375
+ });
13376
+ setValue(
13377
+ `owners.${index}.cargo.${cargoIndex}.loadType`,
13378
+ ""
13379
+ );
13380
+ },
13381
+ options: commodityOptions,
13382
+ placeholder: mergedLabels.selectPlaceholder,
13383
+ required: true,
13384
+ type: "select",
13385
+ size: "large"
13386
+ }
13387
+ )
13365
13388
  ] }),
13366
- /* @__PURE__ */ jsxRuntime.jsx(
13367
- InputDynamic_default,
13368
- {
13369
- control,
13370
- disabled: disabled || (getValues(
13371
- `owners.${index}.cargo.${cargoIndex}.commodity`
13372
- ) || "") === "",
13373
- name: `owners.${index}.cargo.${cargoIndex}.cargoType`,
13374
- onChange: (val) => {
13375
- const name = `owners.${index}.cargo.${cargoIndex}.cargoType`;
13376
- setValue(name, val);
13377
- const updatedCargoItems = owner.cargoItems?.map(
13378
- (c, cIdx) => cIdx === cargoIndex ? {
13379
- ...c,
13380
- cargoType: val
13381
- } : c
13382
- );
13383
- onUpdateOwner(owner.id, {
13384
- cargoItems: updatedCargoItems
13385
- });
13386
- },
13387
- options: (() => {
13388
- const selectedCommodityId = watch(
13389
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: isLoadTypeOther ? 4 : 6, children: [
13390
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13391
+ mergedLabels.loadTypeLabel,
13392
+ " ",
13393
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13394
+ ] }),
13395
+ /* @__PURE__ */ jsxRuntime.jsx(
13396
+ InputDynamic_default,
13397
+ {
13398
+ control,
13399
+ disabled: disabled || (getValues(
13389
13400
  `owners.${index}.cargo.${cargoIndex}.commodity`
13390
- );
13391
- if (selectedCommodityId && loadTypeOptionsByCommodityId[selectedCommodityId]) {
13392
- return loadTypeOptionsByCommodityId[selectedCommodityId];
13393
- }
13394
- return loadTypeOptions.map((lt) => ({
13395
- value: lt.id.toString(),
13396
- label: `${lt.name}${lt.unit?.name ? ` (${lt.unit.name})` : ""}`
13397
- }));
13398
- })(),
13399
- placeholder: mergedLabels.selectPlaceholder,
13400
- required: true,
13401
- size: "large",
13402
- type: "select"
13403
- }
13404
- ),
13405
- /* @__PURE__ */ jsxRuntime.jsx(
13406
- reactComponents.Caption1,
13407
- {
13408
- style: {
13409
- color: reactComponents.tokens.colorNeutralForeground3,
13410
- marginTop: "0.25rem"
13411
- },
13412
- children: mergedLabels.cargoTypeHelperText
13413
- }
13414
- )
13415
- ] })
13416
- ] }),
13417
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13418
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13419
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13420
- mergedLabels.industryTypeLabel,
13421
- " ",
13422
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13401
+ ) || "") === "",
13402
+ name: `owners.${index}.cargo.${cargoIndex}.loadType`,
13403
+ onChange: (val) => {
13404
+ const name = `owners.${index}.cargo.${cargoIndex}.loadType`;
13405
+ setValue(name, val);
13406
+ const updatedCargoItems = owner.cargoItems?.map(
13407
+ (c, cIdx) => cIdx === cargoIndex ? {
13408
+ ...c,
13409
+ loadType: val
13410
+ } : c
13411
+ );
13412
+ onUpdateOwner(owner.id, {
13413
+ cargoItems: updatedCargoItems
13414
+ });
13415
+ },
13416
+ options: _loadTypeOptions,
13417
+ placeholder: mergedLabels.selectPlaceholder,
13418
+ required: true,
13419
+ size: "large",
13420
+ type: "select"
13421
+ }
13422
+ ),
13423
+ /* @__PURE__ */ jsxRuntime.jsx(
13424
+ reactComponents.Caption1,
13425
+ {
13426
+ style: {
13427
+ color: reactComponents.tokens.colorNeutralForeground3,
13428
+ marginTop: "0.25rem"
13429
+ },
13430
+ children: mergedLabels.loadTypeHelperText
13431
+ }
13432
+ )
13423
13433
  ] }),
13424
- /* @__PURE__ */ jsxRuntime.jsx(
13425
- InputDynamic_default,
13426
- {
13427
- control,
13428
- disabled,
13429
- name: `owners.${index}.cargo.${cargoIndex}.industryType`,
13430
- options: industryOptions,
13431
- onChange: (val) => {
13432
- const name = `owners.${index}.cargo.${cargoIndex}.industryType`;
13433
- setValue(name, val);
13434
- const updatedCargoItems = owner.cargoItems?.map(
13435
- (c, cIdx) => cIdx === cargoIndex ? {
13436
- ...c,
13437
- industryType: val
13438
- } : c
13439
- );
13440
- onUpdateOwner(owner.id, {
13441
- cargoItems: updatedCargoItems
13442
- });
13443
- },
13444
- placeholder: mergedLabels.selectPlaceholder,
13445
- required: true,
13446
- size: "large",
13447
- type: "select"
13448
- }
13449
- ),
13450
- /* @__PURE__ */ jsxRuntime.jsx(
13451
- reactComponents.Caption1,
13452
- {
13453
- style: {
13454
- color: reactComponents.tokens.colorNeutralForeground3,
13455
- marginTop: "0.25rem"
13456
- },
13457
- children: mergedLabels.industryTypeHelperText
13458
- }
13459
- )
13434
+ isLoadTypeOther && /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { xl: 4, children: [
13435
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13436
+ mergedLabels.loadTypeOthersLabel,
13437
+ " ",
13438
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13439
+ ] }),
13440
+ /* @__PURE__ */ jsxRuntime.jsx(
13441
+ InputDynamic_default,
13442
+ {
13443
+ control,
13444
+ disabled,
13445
+ name: `owners.${index}.cargo.${cargoIndex}.loadTypeOther`,
13446
+ placeholder: mergedLabels.loadTypeOthersPlaceholder,
13447
+ required: true,
13448
+ size: "large",
13449
+ type: "text",
13450
+ onChange: (val) => {
13451
+ setValue(
13452
+ `owners.${index}.cargo.${cargoIndex}.loadTypeOther`,
13453
+ val
13454
+ );
13455
+ const updatedCargoItems = owner.cargoItems?.map(
13456
+ (c, cIdx) => cIdx === cargoIndex ? {
13457
+ ...c,
13458
+ loadTypeOther: val
13459
+ } : c
13460
+ );
13461
+ onUpdateOwner(owner.id, {
13462
+ cargoItems: updatedCargoItems
13463
+ });
13464
+ }
13465
+ }
13466
+ )
13467
+ ] })
13460
13468
  ] }),
13461
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13462
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13463
- mergedLabels.cargoCategoryLabel,
13464
- " ",
13465
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13466
- ] }),
13467
- /* @__PURE__ */ jsxRuntime.jsx(
13468
- InputDynamic_default,
13469
- {
13470
- control,
13471
- disabled,
13472
- name: `owners.${index}.cargo.${cargoIndex}.cargoCategory`,
13473
- options: loadCategoryOptions,
13474
- onChange: (val) => {
13475
- const name = `owners.${index}.cargo.${cargoIndex}.cargoCategory`;
13476
- setValue(name, val);
13477
- const updatedCargoItems = owner.cargoItems?.map(
13478
- (c, cIdx) => cIdx === cargoIndex ? {
13479
- ...c,
13480
- cargoCategory: 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
- ] })
13494
- ] }),
13495
- /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Row, { children: /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { children: (owner.cargoItems?.length || 0) > 1 && /* @__PURE__ */ jsxRuntime.jsx(
13496
- reactComponents.Button,
13497
- {
13498
- disabled,
13499
- icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:delete-24-regular" }),
13500
- onClick: (e) => {
13501
- e.stopPropagation();
13502
- onDeleteCargo(owner.id, cargo.id);
13503
- },
13504
- onKeyDown: (e) => {
13505
- if (e.key === "Enter" || e.key === " ") {
13506
- e.stopPropagation();
13507
- onDeleteCargo(owner.id, cargo.id);
13508
- }
13509
- },
13510
- size: "medium",
13511
- shape: "circular",
13512
- style: {
13513
- border: `1px solid ${reactComponents.tokens.colorPaletteRedForeground1}`,
13514
- color: reactComponents.tokens.colorPaletteRedForeground1,
13515
- width: "100%"
13516
- },
13517
- children: mergedLabels.deleteCargoButton
13518
- }
13519
- ) }) }),
13520
- (() => {
13521
- const type = watch(
13522
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13523
- );
13524
- const _selectedLoadType = loadTypes.find(
13525
- (loadType) => loadType.id.toString() === type
13526
- );
13527
- if (!_selectedLoadType) return null;
13528
- return /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13529
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 12, children: [
13530
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
13531
- /* @__PURE__ */ jsxRuntime.jsxs(
13532
- "div",
13469
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13470
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13471
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13472
+ mergedLabels.industryTypeLabel,
13473
+ " ",
13474
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13475
+ ] }),
13476
+ /* @__PURE__ */ jsxRuntime.jsx(
13477
+ InputDynamic_default,
13478
+ {
13479
+ control,
13480
+ disabled,
13481
+ name: `owners.${index}.cargo.${cargoIndex}.industryType`,
13482
+ options: industryOptions,
13483
+ onChange: (val) => {
13484
+ const name = `owners.${index}.cargo.${cargoIndex}.industryType`;
13485
+ setValue(name, val);
13486
+ const updatedCargoItems = owner.cargoItems?.map(
13487
+ (c, cIdx) => cIdx === cargoIndex ? {
13488
+ ...c,
13489
+ industryType: val
13490
+ } : c
13491
+ );
13492
+ onUpdateOwner(owner.id, {
13493
+ cargoItems: updatedCargoItems
13494
+ });
13495
+ },
13496
+ placeholder: mergedLabels.selectPlaceholder,
13497
+ required: true,
13498
+ size: "large",
13499
+ type: "select"
13500
+ }
13501
+ ),
13502
+ /* @__PURE__ */ jsxRuntime.jsx(
13503
+ reactComponents.Caption1,
13533
13504
  {
13534
13505
  style: {
13535
- display: "flex",
13536
- alignItems: "center",
13537
- border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
13538
- borderRadius: reactComponents.tokens.borderRadiusMedium,
13539
- height: "40px",
13540
- padding: "0 12px",
13541
- backgroundColor: reactComponents.tokens.colorNeutralBackground1
13506
+ color: reactComponents.tokens.colorNeutralForeground3,
13507
+ marginTop: "0.25rem"
13542
13508
  },
13543
- children: [
13544
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
13545
- /* @__PURE__ */ jsxRuntime.jsxs(
13546
- "div",
13547
- {
13548
- style: {
13549
- display: "flex",
13550
- alignItems: "center",
13551
- gap: "12px"
13552
- },
13553
- children: [
13554
- /* @__PURE__ */ jsxRuntime.jsx(
13555
- reactComponents.Button,
13556
- {
13557
- appearance: "transparent",
13558
- disabled,
13559
- icon: /* @__PURE__ */ jsxRuntime.jsx(
13560
- react.Icon,
13561
- {
13562
- icon: "fluent:subtract-circle-24-regular",
13563
- style: {
13564
- fontSize: "24px",
13565
- color: reactComponents.tokens.colorNeutralForeground4
13566
- }
13567
- }
13568
- ),
13569
- "aria-label": mergedLabels.decrementQuantityAriaLabel,
13570
- size: "small",
13571
- onClick: () => {
13572
- const currentVal = getValues(
13573
- `owners.${index}.cargo.${cargoIndex}.quantity`
13574
- ) || 0;
13575
- const currentQty = Number(currentVal);
13576
- if (currentQty > 1) {
13577
- const newVal = currentQty - 1;
13578
- setValue(
13579
- `owners.${index}.cargo.${cargoIndex}.quantity`,
13580
- newVal
13581
- );
13582
- onUpdateCargoQuantity(
13583
- owner.id,
13584
- cargo.id,
13585
- newVal
13586
- );
13587
- }
13588
- },
13589
- style: {
13590
- minWidth: "32px",
13591
- padding: "0"
13592
- }
13593
- }
13594
- ),
13595
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
13596
- reactHookForm.Controller,
13597
- {
13598
- name: `owners.${index}.cargo.${cargoIndex}.quantity`,
13599
- control,
13600
- disabled,
13601
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
13602
- "input",
13603
- {
13604
- ...field,
13605
- min: 1,
13606
- step: "1",
13607
- type: "number",
13608
- style: {
13609
- border: "none",
13610
- width: "100%",
13611
- textAlign: "center",
13612
- outline: "none",
13613
- backgroundColor: "transparent",
13614
- color: reactComponents.tokens.colorNeutralForeground1,
13615
- fontSize: reactComponents.tokens.fontSizeBase400,
13616
- fontFamily: reactComponents.tokens.fontFamilyBase
13617
- },
13618
- onKeyDown: (e) => {
13619
- if ([
13620
- "e",
13621
- "E",
13622
- "+",
13623
- "-",
13624
- ".",
13625
- ","
13626
- ].includes(e.key)) {
13627
- e.preventDefault();
13628
- }
13629
- },
13630
- onPaste: (e) => {
13631
- const paste = e.clipboardData.getData(
13632
- "text"
13633
- );
13634
- if (!/^\d+$/.test(paste)) {
13635
- e.preventDefault();
13509
+ children: mergedLabels.industryTypeHelperText
13510
+ }
13511
+ )
13512
+ ] }),
13513
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13514
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13515
+ mergedLabels.cargoCategoryLabel,
13516
+ " ",
13517
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13518
+ ] }),
13519
+ /* @__PURE__ */ jsxRuntime.jsx(
13520
+ InputDynamic_default,
13521
+ {
13522
+ control,
13523
+ disabled,
13524
+ name: `owners.${index}.cargo.${cargoIndex}.cargoCategory`,
13525
+ options: loadCategoryOptions,
13526
+ onChange: (val) => {
13527
+ const name = `owners.${index}.cargo.${cargoIndex}.cargoCategory`;
13528
+ setValue(name, val);
13529
+ const updatedCargoItems = owner.cargoItems?.map(
13530
+ (c, cIdx) => cIdx === cargoIndex ? {
13531
+ ...c,
13532
+ cargoCategory: val
13533
+ } : c
13534
+ );
13535
+ onUpdateOwner(owner.id, {
13536
+ cargoItems: updatedCargoItems
13537
+ });
13538
+ },
13539
+ placeholder: mergedLabels.selectPlaceholder,
13540
+ required: true,
13541
+ size: "large",
13542
+ type: "select"
13543
+ }
13544
+ )
13545
+ ] })
13546
+ ] }),
13547
+ /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Row, { children: /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { children: (owner.cargoItems?.length || 0) > 1 && /* @__PURE__ */ jsxRuntime.jsx(
13548
+ reactComponents.Button,
13549
+ {
13550
+ disabled,
13551
+ icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:delete-24-regular" }),
13552
+ onClick: (e) => {
13553
+ e.stopPropagation();
13554
+ onDeleteCargo(owner.id, cargo.id);
13555
+ },
13556
+ onKeyDown: (e) => {
13557
+ if (e.key === "Enter" || e.key === " ") {
13558
+ e.stopPropagation();
13559
+ onDeleteCargo(
13560
+ owner.id,
13561
+ cargo.id
13562
+ );
13563
+ }
13564
+ },
13565
+ size: "medium",
13566
+ shape: "circular",
13567
+ style: {
13568
+ border: `1px solid ${reactComponents.tokens.colorPaletteRedForeground1}`,
13569
+ color: reactComponents.tokens.colorPaletteRedForeground1,
13570
+ width: "100%"
13571
+ },
13572
+ children: mergedLabels.deleteCargoButton
13573
+ }
13574
+ ) }) }),
13575
+ (() => {
13576
+ const type = watch(
13577
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13578
+ );
13579
+ const _selectedLoadType = loadTypes.find(
13580
+ (loadType) => loadType.id.toString() === type
13581
+ );
13582
+ if (!_selectedLoadType) return null;
13583
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13584
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 12, children: [
13585
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
13586
+ /* @__PURE__ */ jsxRuntime.jsxs(
13587
+ "div",
13588
+ {
13589
+ style: {
13590
+ display: "flex",
13591
+ alignItems: "center",
13592
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
13593
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
13594
+ height: "40px",
13595
+ padding: "0 12px",
13596
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1
13597
+ },
13598
+ children: [
13599
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
13600
+ /* @__PURE__ */ jsxRuntime.jsxs(
13601
+ "div",
13602
+ {
13603
+ style: {
13604
+ display: "flex",
13605
+ alignItems: "center",
13606
+ gap: "12px"
13607
+ },
13608
+ children: [
13609
+ /* @__PURE__ */ jsxRuntime.jsx(
13610
+ reactComponents.Button,
13611
+ {
13612
+ appearance: "transparent",
13613
+ disabled,
13614
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
13615
+ react.Icon,
13616
+ {
13617
+ icon: "fluent:subtract-circle-24-regular",
13618
+ style: {
13619
+ fontSize: "24px",
13620
+ color: reactComponents.tokens.colorNeutralForeground4
13636
13621
  }
13637
- },
13638
- onWheel: (e) => e.target.blur(),
13639
- onChange: (e) => {
13640
- const newVal = Number(
13641
- e.target.value
13622
+ }
13623
+ ),
13624
+ "aria-label": mergedLabels.decrementQuantityAriaLabel,
13625
+ size: "small",
13626
+ onClick: () => {
13627
+ const currentVal = getValues(
13628
+ `owners.${index}.cargo.${cargoIndex}.quantity`
13629
+ ) || 0;
13630
+ const currentQty = Number(currentVal);
13631
+ if (currentQty > 1) {
13632
+ const newVal = currentQty - 1;
13633
+ setValue(
13634
+ `owners.${index}.cargo.${cargoIndex}.quantity`,
13635
+ newVal
13642
13636
  );
13643
- field.onChange(e);
13644
13637
  onUpdateCargoQuantity(
13645
13638
  owner.id,
13646
13639
  cargo.id,
13647
13640
  newVal
13648
13641
  );
13649
13642
  }
13643
+ },
13644
+ style: {
13645
+ minWidth: "32px",
13646
+ padding: "0"
13650
13647
  }
13651
- ),
13652
- rules: {
13653
- required: true,
13654
- validate: (val) => Number(val) > 0
13655
13648
  }
13656
- }
13657
- ) }),
13658
- /* @__PURE__ */ jsxRuntime.jsx(
13659
- reactComponents.Button,
13660
- {
13661
- appearance: "transparent",
13662
- disabled,
13663
- icon: /* @__PURE__ */ jsxRuntime.jsx(
13664
- react.Icon,
13665
- {
13666
- icon: "fluent:add-circle-24-regular",
13667
- style: {
13668
- fontSize: "24px",
13669
- color: reactComponents.tokens.colorBrandStroke1
13649
+ ),
13650
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
13651
+ reactHookForm.Controller,
13652
+ {
13653
+ name: `owners.${index}.cargo.${cargoIndex}.quantity`,
13654
+ control,
13655
+ disabled,
13656
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
13657
+ "input",
13658
+ {
13659
+ ...field,
13660
+ min: 1,
13661
+ step: "1",
13662
+ type: "number",
13663
+ style: {
13664
+ border: "none",
13665
+ width: "100%",
13666
+ textAlign: "center",
13667
+ outline: "none",
13668
+ backgroundColor: "transparent",
13669
+ color: reactComponents.tokens.colorNeutralForeground1,
13670
+ fontSize: reactComponents.tokens.fontSizeBase400,
13671
+ fontFamily: reactComponents.tokens.fontFamilyBase
13672
+ },
13673
+ onKeyDown: (e) => {
13674
+ if ([
13675
+ "e",
13676
+ "E",
13677
+ "+",
13678
+ "-",
13679
+ ".",
13680
+ ","
13681
+ ].includes(e.key)) {
13682
+ e.preventDefault();
13683
+ }
13684
+ },
13685
+ onPaste: (e) => {
13686
+ const paste = e.clipboardData.getData(
13687
+ "text"
13688
+ );
13689
+ if (!/^\d+$/.test(paste)) {
13690
+ e.preventDefault();
13691
+ }
13692
+ },
13693
+ onWheel: (e) => e.target.blur(),
13694
+ onChange: (e) => {
13695
+ const newVal = Number(
13696
+ e.target.value
13697
+ );
13698
+ field.onChange(e);
13699
+ onUpdateCargoQuantity(
13700
+ owner.id,
13701
+ cargo.id,
13702
+ newVal
13703
+ );
13704
+ }
13670
13705
  }
13706
+ ),
13707
+ rules: {
13708
+ required: true,
13709
+ validate: (val) => Number(val) > 0
13671
13710
  }
13672
- ),
13673
- "aria-label": mergedLabels.incrementQuantityAriaLabel,
13674
- size: "small",
13675
- onClick: () => {
13676
- const currentVal = getValues(
13677
- `owners.${index}.cargo.${cargoIndex}.quantity`
13678
- ) || 0;
13679
- const currentQty = Number(currentVal);
13680
- const newVal = currentQty + 1;
13681
- setValue(
13682
- `owners.${index}.cargo.${cargoIndex}.quantity`,
13683
- newVal
13684
- );
13685
- onUpdateCargoQuantity(
13686
- owner.id,
13687
- cargo.id,
13688
- newVal
13689
- );
13690
- },
13691
- style: {
13692
- minWidth: "32px",
13693
- padding: "0"
13694
13711
  }
13695
- }
13696
- )
13697
- ]
13698
- }
13699
- ),
13700
- /* @__PURE__ */ jsxRuntime.jsx(
13701
- "div",
13702
- {
13703
- style: {
13704
- flex: 1,
13705
- textAlign: "left",
13706
- color: reactComponents.tokens.colorNeutralForeground1,
13707
- fontSize: reactComponents.tokens.fontSizeBase300,
13708
- paddingRight: "8px"
13709
- },
13710
- children: (() => {
13711
- const type2 = watch(
13712
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13713
- );
13714
- const selectedLoadType2 = loadTypes.find(
13715
- (loadType) => loadType.id.toString() === type2
13716
- );
13717
- return selectedLoadType2?.unit?.name;
13718
- })()
13719
- }
13720
- )
13721
- ]
13722
- }
13723
- )
13724
- ] }),
13725
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 12, children: [
13726
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
13727
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13728
- /* @__PURE__ */ jsxRuntime.jsx(
13729
- reactComponents.Body2,
13730
- {
13731
- style: { marginTop: "0.5rem" },
13732
- children: (() => {
13733
- return new Intl.NumberFormat(
13734
- "id-ID",
13735
- {
13736
- style: "currency",
13737
- currency: "IDR",
13738
- minimumFractionDigits: 0
13739
- }
13740
- ).format(
13741
- Number(
13742
- getValues(
13743
- `owners.${index}.cargo.${cargoIndex}.quantity`
13744
- ) || 0
13745
- ) * (_selectedLoadType?.price || 0)
13746
- );
13747
- })()
13748
- }
13749
- )
13750
- ] })
13751
- ] });
13752
- })()
13753
- ] }) })
13754
- ]
13755
- },
13756
- cargo.id
13757
- ))
13712
+ ) }),
13713
+ /* @__PURE__ */ jsxRuntime.jsx(
13714
+ reactComponents.Button,
13715
+ {
13716
+ appearance: "transparent",
13717
+ disabled,
13718
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
13719
+ react.Icon,
13720
+ {
13721
+ icon: "fluent:add-circle-24-regular",
13722
+ style: {
13723
+ fontSize: "24px",
13724
+ color: reactComponents.tokens.colorBrandStroke1
13725
+ }
13726
+ }
13727
+ ),
13728
+ "aria-label": mergedLabels.incrementQuantityAriaLabel,
13729
+ size: "small",
13730
+ onClick: () => {
13731
+ const currentVal = getValues(
13732
+ `owners.${index}.cargo.${cargoIndex}.quantity`
13733
+ ) || 0;
13734
+ const currentQty = Number(currentVal);
13735
+ const newVal = currentQty + 1;
13736
+ setValue(
13737
+ `owners.${index}.cargo.${cargoIndex}.quantity`,
13738
+ newVal
13739
+ );
13740
+ onUpdateCargoQuantity(
13741
+ owner.id,
13742
+ cargo.id,
13743
+ newVal
13744
+ );
13745
+ },
13746
+ style: {
13747
+ minWidth: "32px",
13748
+ padding: "0"
13749
+ }
13750
+ }
13751
+ )
13752
+ ]
13753
+ }
13754
+ ),
13755
+ /* @__PURE__ */ jsxRuntime.jsx(
13756
+ "div",
13757
+ {
13758
+ style: {
13759
+ flex: 1,
13760
+ textAlign: "left",
13761
+ color: reactComponents.tokens.colorNeutralForeground1,
13762
+ fontSize: reactComponents.tokens.fontSizeBase300,
13763
+ paddingRight: "8px"
13764
+ },
13765
+ children: (() => {
13766
+ const type2 = watch(
13767
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13768
+ );
13769
+ const selectedLoadType2 = loadTypes.find(
13770
+ (loadType) => loadType.id.toString() === type2
13771
+ );
13772
+ return selectedLoadType2?.unit?.name;
13773
+ })()
13774
+ }
13775
+ )
13776
+ ]
13777
+ }
13778
+ )
13779
+ ] }),
13780
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 12, children: [
13781
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
13782
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13783
+ /* @__PURE__ */ jsxRuntime.jsx(
13784
+ reactComponents.Body2,
13785
+ {
13786
+ style: { marginTop: "0.5rem" },
13787
+ children: (() => {
13788
+ return new Intl.NumberFormat(
13789
+ "id-ID",
13790
+ {
13791
+ style: "currency",
13792
+ currency: "IDR",
13793
+ minimumFractionDigits: 0
13794
+ }
13795
+ ).format(
13796
+ Number(
13797
+ getValues(
13798
+ `owners.${index}.cargo.${cargoIndex}.quantity`
13799
+ ) || 0
13800
+ ) * (_selectedLoadType?.price || 0)
13801
+ );
13802
+ })()
13803
+ }
13804
+ )
13805
+ ] })
13806
+ ] });
13807
+ })()
13808
+ ] }) })
13809
+ ]
13810
+ },
13811
+ cargo.id
13812
+ );
13813
+ })
13758
13814
  }
13759
13815
  ),
13760
13816
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -17575,6 +17631,7 @@ exports.EmptyContentDefaultLabels = DEFAULT_LABELS11;
17575
17631
  exports.FileUpload = FileUpload_default;
17576
17632
  exports.GENDER = GENDER;
17577
17633
  exports.HARDCODED_ID = HARDCODED_ID;
17634
+ exports.HARDCODED_NAME = HARDCODED_NAME;
17578
17635
  exports.HTTP_STATUS = HTTP_STATUS;
17579
17636
  exports.IDENTITY_TYPE = IDENTITY_TYPE;
17580
17637
  exports.InputDynamic = InputDynamic_default;