@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.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",
@@ -12867,7 +12874,7 @@ var CardVehicleOwnerForm = ({
12867
12874
  " ",
12868
12875
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
12869
12876
  ] }) }),
12870
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { lg: 6, children: [
12877
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { lg: 12, children: [
12871
12878
  /* @__PURE__ */ jsxRuntime.jsx(
12872
12879
  "div",
12873
12880
  {
@@ -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,
@@ -12970,36 +12977,10 @@ var CardVehicleOwnerForm = ({
12970
12977
  children: mergedLabels.otherCompanyHelperText
12971
12978
  }
12972
12979
  )
12973
- ] }),
12974
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { lg: 6, children: [
12975
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "1rem" } }),
12976
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
12977
- mergedLabels.estimatedVehicleWeightLabel,
12978
- " ",
12979
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
12980
- ] }),
12981
- /* @__PURE__ */ jsxRuntime.jsx(
12982
- InputDynamic_default,
12983
- {
12984
- control,
12985
- disabled,
12986
- name: `owners.${index}.estimatedWeight`,
12987
- placeholder: mergedLabels.inputNumberPlaceholder,
12988
- required: true,
12989
- size: "large",
12990
- type: "number",
12991
- onChange: (val) => {
12992
- setValue(`owners.${index}.estimatedWeight`, val);
12993
- onUpdateOwner(owner.id, {
12994
- estimatedWeight: val
12995
- });
12996
- }
12997
- }
12998
- )
12999
12980
  ] })
13000
12981
  ] }),
13001
- hasLoad && /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13002
- /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { lg: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { nogutter: true, children: [
12982
+ hasLoad && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12983
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { nogutter: true, children: [
13003
12984
  /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.cargoReceiverTitle }) }),
13004
12985
  /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { lg: 12, children: [
13005
12986
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -13056,7 +13037,7 @@ var CardVehicleOwnerForm = ({
13056
13037
  /* @__PURE__ */ jsxRuntime.jsx(
13057
13038
  reactGridSystem.Col,
13058
13039
  {
13059
- 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,
13060
13041
  children: /* @__PURE__ */ jsxRuntime.jsx(
13061
13042
  InputDynamic_default,
13062
13043
  {
@@ -13081,7 +13062,7 @@ var CardVehicleOwnerForm = ({
13081
13062
  )
13082
13063
  }
13083
13064
  ),
13084
- 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(
13085
13066
  InputDynamic_default,
13086
13067
  {
13087
13068
  control,
@@ -13114,8 +13095,8 @@ var CardVehicleOwnerForm = ({
13114
13095
  }
13115
13096
  )
13116
13097
  ] })
13117
- ] }) }),
13118
- /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { lg: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { nogutter: true, children: [
13098
+ ] }),
13099
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { nogutter: true, children: [
13119
13100
  /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { lg: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13120
13101
  mergedLabels.logisticsCompanyTitle,
13121
13102
  " ",
@@ -13173,7 +13154,7 @@ var CardVehicleOwnerForm = ({
13173
13154
  /* @__PURE__ */ jsxRuntime.jsx(
13174
13155
  reactGridSystem.Col,
13175
13156
  {
13176
- 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,
13177
13158
  children: /* @__PURE__ */ jsxRuntime.jsx(
13178
13159
  InputDynamic_default,
13179
13160
  {
@@ -13198,7 +13179,7 @@ var CardVehicleOwnerForm = ({
13198
13179
  )
13199
13180
  }
13200
13181
  ),
13201
- 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(
13202
13183
  InputDynamic_default,
13203
13184
  {
13204
13185
  control,
@@ -13231,10 +13212,10 @@ var CardVehicleOwnerForm = ({
13231
13212
  children: mergedLabels.otherCompanyHelperText
13232
13213
  }
13233
13214
  )
13234
- ] }) })
13215
+ ] })
13235
13216
  ] }),
13236
13217
  /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13237
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { children: [
13218
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { xl: 6, children: [
13238
13219
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.originCityLabel }),
13239
13220
  /* @__PURE__ */ jsxRuntime.jsx(
13240
13221
  InputDynamic_default,
@@ -13256,7 +13237,7 @@ var CardVehicleOwnerForm = ({
13256
13237
  }
13257
13238
  )
13258
13239
  ] }),
13259
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { children: [
13240
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { xl: 6, children: [
13260
13241
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.destinationCityLabel }),
13261
13242
  /* @__PURE__ */ jsxRuntime.jsx(
13262
13243
  InputDynamic_default,
@@ -13277,6 +13258,32 @@ var CardVehicleOwnerForm = ({
13277
13258
  type: "select"
13278
13259
  }
13279
13260
  )
13261
+ ] }),
13262
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { lg: 12, children: [
13263
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "1rem" } }),
13264
+ /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13265
+ mergedLabels.estimatedVehicleWeightLabel,
13266
+ " ",
13267
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13268
+ ] }),
13269
+ /* @__PURE__ */ jsxRuntime.jsx(
13270
+ InputDynamic_default,
13271
+ {
13272
+ control,
13273
+ disabled,
13274
+ name: `owners.${index}.estimatedWeight`,
13275
+ placeholder: mergedLabels.inputNumberPlaceholder,
13276
+ required: true,
13277
+ size: "large",
13278
+ type: "number",
13279
+ onChange: (val) => {
13280
+ setValue(`owners.${index}.estimatedWeight`, val);
13281
+ onUpdateOwner(owner.id, {
13282
+ estimatedWeight: val
13283
+ });
13284
+ }
13285
+ }
13286
+ )
13280
13287
  ] })
13281
13288
  ] }),
13282
13289
  hasLoad && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -13290,159 +13297,291 @@ 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: 3, 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: 3, 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];
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
+ )
13433
+ ] }),
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
+ });
13393
13464
  }
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
- )
13465
+ }
13466
+ )
13467
+ ] })
13468
+ ] }),
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,
13504
+ {
13505
+ style: {
13506
+ color: reactComponents.tokens.colorNeutralForeground3,
13507
+ marginTop: "0.25rem"
13508
+ },
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
+ ] })
13415
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
+ ) }) }),
13416
13575
  (() => {
13417
13576
  const type = watch(
13418
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13577
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13419
13578
  );
13420
- const selectedLoadType2 = loadTypes.find(
13579
+ const _selectedLoadType = loadTypes.find(
13421
13580
  (loadType) => loadType.id.toString() === type
13422
13581
  );
13423
- if (!selectedLoadType2) {
13424
- return /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
13425
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13426
- /* @__PURE__ */ jsxRuntime.jsx(
13427
- reactComponents.Body2,
13428
- {
13429
- style: { marginTop: "0.5rem" },
13430
- children: (() => {
13431
- return new Intl.NumberFormat(
13432
- "id-ID",
13433
- {
13434
- style: "currency",
13435
- currency: "IDR",
13436
- minimumFractionDigits: 0
13437
- }
13438
- ).format(0);
13439
- })()
13440
- }
13441
- )
13442
- ] });
13443
- }
13444
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13445
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
13582
+ if (!_selectedLoadType) return null;
13583
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13584
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 12, children: [
13446
13585
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
13447
13586
  /* @__PURE__ */ jsxRuntime.jsxs(
13448
13587
  "div",
@@ -13625,12 +13764,12 @@ var CardVehicleOwnerForm = ({
13625
13764
  },
13626
13765
  children: (() => {
13627
13766
  const type2 = watch(
13628
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13767
+ `owners.${index}.cargo.${cargoIndex}.loadType`
13629
13768
  );
13630
- const selectedLoadType3 = loadTypes.find(
13769
+ const selectedLoadType2 = loadTypes.find(
13631
13770
  (loadType) => loadType.id.toString() === type2
13632
13771
  );
13633
- return selectedLoadType3?.unit?.name;
13772
+ return selectedLoadType2?.unit?.name;
13634
13773
  })()
13635
13774
  }
13636
13775
  )
@@ -13638,7 +13777,7 @@ var CardVehicleOwnerForm = ({
13638
13777
  }
13639
13778
  )
13640
13779
  ] }),
13641
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
13780
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 12, children: [
13642
13781
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
13643
13782
  /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13644
13783
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -13658,7 +13797,7 @@ var CardVehicleOwnerForm = ({
13658
13797
  getValues(
13659
13798
  `owners.${index}.cargo.${cargoIndex}.quantity`
13660
13799
  ) || 0
13661
- ) * (selectedLoadType2?.price || 0)
13800
+ ) * (_selectedLoadType?.price || 0)
13662
13801
  );
13663
13802
  })()
13664
13803
  }
@@ -13666,115 +13805,12 @@ var CardVehicleOwnerForm = ({
13666
13805
  ] })
13667
13806
  ] });
13668
13807
  })()
13669
- ] }),
13670
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13671
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13672
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13673
- mergedLabels.industryTypeLabel,
13674
- " ",
13675
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13676
- ] }),
13677
- /* @__PURE__ */ jsxRuntime.jsx(
13678
- InputDynamic_default,
13679
- {
13680
- control,
13681
- disabled,
13682
- name: `owners.${index}.cargo.${cargoIndex}.industryType`,
13683
- options: industryOptions,
13684
- onChange: (val) => {
13685
- const name = `owners.${index}.cargo.${cargoIndex}.industryType`;
13686
- setValue(name, val);
13687
- const updatedCargoItems = owner.cargoItems?.map(
13688
- (c, cIdx) => cIdx === cargoIndex ? {
13689
- ...c,
13690
- industryType: val
13691
- } : c
13692
- );
13693
- onUpdateOwner(owner.id, {
13694
- cargoItems: updatedCargoItems
13695
- });
13696
- },
13697
- placeholder: mergedLabels.selectPlaceholder,
13698
- required: true,
13699
- size: "large",
13700
- type: "select"
13701
- }
13702
- ),
13703
- /* @__PURE__ */ jsxRuntime.jsx(
13704
- reactComponents.Caption1,
13705
- {
13706
- style: {
13707
- color: reactComponents.tokens.colorNeutralForeground3,
13708
- marginTop: "0.25rem"
13709
- },
13710
- children: mergedLabels.industryTypeHelperText
13711
- }
13712
- )
13713
- ] }),
13714
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [
13715
- /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Body1, { className: styles.label, children: [
13716
- mergedLabels.cargoCategoryLabel,
13717
- " ",
13718
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "red" }, children: "*" })
13719
- ] }),
13720
- /* @__PURE__ */ jsxRuntime.jsx(
13721
- InputDynamic_default,
13722
- {
13723
- control,
13724
- disabled,
13725
- name: `owners.${index}.cargo.${cargoIndex}.cargoCategory`,
13726
- options: loadCategoryOptions,
13727
- onChange: (val) => {
13728
- const name = `owners.${index}.cargo.${cargoIndex}.cargoCategory`;
13729
- setValue(name, val);
13730
- const updatedCargoItems = owner.cargoItems?.map(
13731
- (c, cIdx) => cIdx === cargoIndex ? {
13732
- ...c,
13733
- cargoCategory: val
13734
- } : c
13735
- );
13736
- onUpdateOwner(owner.id, {
13737
- cargoItems: updatedCargoItems
13738
- });
13739
- },
13740
- placeholder: mergedLabels.selectPlaceholder,
13741
- required: true,
13742
- size: "large",
13743
- type: "select"
13744
- }
13745
- )
13746
- ] })
13747
- ] }),
13748
- /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Row, { children: /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { children: (owner.cargoItems?.length || 0) > 1 && /* @__PURE__ */ jsxRuntime.jsx(
13749
- reactComponents.Button,
13750
- {
13751
- disabled,
13752
- icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:delete-24-regular" }),
13753
- onClick: (e) => {
13754
- e.stopPropagation();
13755
- onDeleteCargo(owner.id, cargo.id);
13756
- },
13757
- onKeyDown: (e) => {
13758
- if (e.key === "Enter" || e.key === " ") {
13759
- e.stopPropagation();
13760
- onDeleteCargo(owner.id, cargo.id);
13761
- }
13762
- },
13763
- size: "medium",
13764
- shape: "circular",
13765
- style: {
13766
- border: `1px solid ${reactComponents.tokens.colorPaletteRedForeground1}`,
13767
- color: reactComponents.tokens.colorPaletteRedForeground1,
13768
- width: "100%"
13769
- },
13770
- children: mergedLabels.deleteCargoButton
13771
- }
13772
- ) }) })
13773
- ] }) })
13774
- ]
13775
- },
13776
- cargo.id
13777
- ))
13808
+ ] }) })
13809
+ ]
13810
+ },
13811
+ cargo.id
13812
+ );
13813
+ })
13778
13814
  }
13779
13815
  ),
13780
13816
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -17595,6 +17631,7 @@ exports.EmptyContentDefaultLabels = DEFAULT_LABELS11;
17595
17631
  exports.FileUpload = FileUpload_default;
17596
17632
  exports.GENDER = GENDER;
17597
17633
  exports.HARDCODED_ID = HARDCODED_ID;
17634
+ exports.HARDCODED_NAME = HARDCODED_NAME;
17598
17635
  exports.HTTP_STATUS = HTTP_STATUS;
17599
17636
  exports.IDENTITY_TYPE = IDENTITY_TYPE;
17600
17637
  exports.InputDynamic = InputDynamic_default;