@asdp/ferryui 0.1.22-dev.9949 → 0.1.22-dev.9962

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
@@ -12526,6 +12526,7 @@ var CardVehicleOwnerForm = ({
12526
12526
  commodityOptions = [],
12527
12527
  loadTypeOptions = [],
12528
12528
  loadTypes = [],
12529
+ loadTypeOptionsByCommodityId = {},
12529
12530
  industryOptions = [],
12530
12531
  loadCategoryOptions = [],
12531
12532
  language = "id",
@@ -13142,10 +13143,18 @@ var CardVehicleOwnerForm = ({
13142
13143
  cargoItems: updatedCargoItems
13143
13144
  });
13144
13145
  },
13145
- options: loadTypeOptions.map((lt) => ({
13146
- value: lt.id.toString(),
13147
- label: `${lt.name} (${lt.unit?.name})`
13148
- })),
13146
+ options: (() => {
13147
+ const selectedCommodityId = watch(
13148
+ `owners.${index}.cargo.${cargoIndex}.commodity`
13149
+ );
13150
+ if (selectedCommodityId && loadTypeOptionsByCommodityId[selectedCommodityId]) {
13151
+ return loadTypeOptionsByCommodityId[selectedCommodityId];
13152
+ }
13153
+ return loadTypeOptions.map((lt) => ({
13154
+ value: lt.id.toString(),
13155
+ label: `${lt.name}${lt.unit?.name ? ` (${lt.unit.name})` : ""}`
13156
+ }));
13157
+ })(),
13149
13158
  placeholder: mergedLabels.selectPlaceholder,
13150
13159
  required: true,
13151
13160
  size: "large",