@asdp/ferryui 0.1.22-dev.9540 → 0.1.22-dev.9545

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
@@ -12153,6 +12153,7 @@ var CardVehicleOwnerForm = ({
12153
12153
  cityDestinationOptions = [],
12154
12154
  commodityOptions = [],
12155
12155
  loadTypeOptions = [],
12156
+ loadTypes = [],
12156
12157
  industryOptions = [],
12157
12158
  loadCategoryOptions = [],
12158
12159
  language = "id",
@@ -12767,55 +12768,132 @@ var CardVehicleOwnerForm = ({
12767
12768
  }
12768
12769
  )
12769
12770
  ] }),
12770
- /* @__PURE__ */ jsxs(Col, { md: 3, children: [
12771
- /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
12772
- /* @__PURE__ */ jsxs(
12773
- "div",
12774
- {
12775
- style: {
12776
- display: "flex",
12777
- alignItems: "center",
12778
- border: `1px solid ${tokens.colorNeutralStroke1}`,
12779
- borderRadius: tokens.borderRadiusMedium,
12780
- height: "40px",
12781
- padding: "0 12px",
12782
- backgroundColor: tokens.colorNeutralBackground1
12783
- },
12784
- children: [
12785
- /* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
12786
- /* @__PURE__ */ jsxs(
12787
- "div",
12788
- {
12789
- style: {
12790
- display: "flex",
12791
- alignItems: "center",
12792
- gap: "12px"
12793
- },
12794
- children: [
12795
- /* @__PURE__ */ jsx(
12796
- Button,
12797
- {
12798
- appearance: "transparent",
12799
- disabled,
12800
- icon: /* @__PURE__ */ jsx(
12801
- Icon,
12802
- {
12803
- icon: "fluent:subtract-circle-24-regular",
12804
- style: {
12805
- fontSize: "24px",
12806
- color: tokens.colorNeutralForeground4
12771
+ (() => {
12772
+ const type = watch(
12773
+ `owners.${index}.cargo.${cargoIndex}.cargoType`
12774
+ );
12775
+ const selectedLoadType = loadTypes.find(
12776
+ (loadType) => loadType.id === type
12777
+ );
12778
+ if (!selectedLoadType) {
12779
+ return /* @__PURE__ */ jsx(Fragment, {});
12780
+ }
12781
+ return /* @__PURE__ */ jsxs(Col, { md: 3, children: [
12782
+ /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
12783
+ /* @__PURE__ */ jsxs(
12784
+ "div",
12785
+ {
12786
+ style: {
12787
+ display: "flex",
12788
+ alignItems: "center",
12789
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
12790
+ borderRadius: tokens.borderRadiusMedium,
12791
+ height: "40px",
12792
+ padding: "0 12px",
12793
+ backgroundColor: tokens.colorNeutralBackground1
12794
+ },
12795
+ children: [
12796
+ /* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
12797
+ /* @__PURE__ */ jsxs(
12798
+ "div",
12799
+ {
12800
+ style: {
12801
+ display: "flex",
12802
+ alignItems: "center",
12803
+ gap: "12px"
12804
+ },
12805
+ children: [
12806
+ /* @__PURE__ */ jsx(
12807
+ Button,
12808
+ {
12809
+ appearance: "transparent",
12810
+ disabled,
12811
+ icon: /* @__PURE__ */ jsx(
12812
+ Icon,
12813
+ {
12814
+ icon: "fluent:subtract-circle-24-regular",
12815
+ style: {
12816
+ fontSize: "24px",
12817
+ color: tokens.colorNeutralForeground4
12818
+ }
12819
+ }
12820
+ ),
12821
+ "aria-label": mergedLabels.decrementQuantityAriaLabel,
12822
+ size: "small",
12823
+ onClick: () => {
12824
+ const currentVal = getValues(
12825
+ `owners.${index}.cargo.${cargoIndex}.quantity`
12826
+ ) || 0;
12827
+ const currentQty = Number(currentVal);
12828
+ if (currentQty > 0) {
12829
+ const newVal = currentQty - 1;
12830
+ setValue(
12831
+ `owners.${index}.cargo.${cargoIndex}.quantity`,
12832
+ newVal
12833
+ );
12834
+ onUpdateCargoQuantity(
12835
+ owner.id,
12836
+ cargo.id,
12837
+ newVal
12838
+ );
12807
12839
  }
12840
+ },
12841
+ style: {
12842
+ minWidth: "32px",
12843
+ padding: "0"
12808
12844
  }
12809
- ),
12810
- "aria-label": mergedLabels.decrementQuantityAriaLabel,
12811
- size: "small",
12812
- onClick: () => {
12813
- const currentVal = getValues(
12814
- `owners.${index}.cargo.${cargoIndex}.quantity`
12815
- ) || 0;
12816
- const currentQty = Number(currentVal);
12817
- if (currentQty > 0) {
12818
- const newVal = currentQty - 1;
12845
+ }
12846
+ ),
12847
+ /* @__PURE__ */ jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsx(
12848
+ Controller,
12849
+ {
12850
+ name: `owners.${index}.cargo.${cargoIndex}.quantity`,
12851
+ control,
12852
+ disabled,
12853
+ render: ({ field }) => /* @__PURE__ */ jsx(
12854
+ "input",
12855
+ {
12856
+ ...field,
12857
+ min: 1,
12858
+ type: "number",
12859
+ style: {
12860
+ border: "none",
12861
+ width: "100%",
12862
+ textAlign: "center",
12863
+ outline: "none",
12864
+ backgroundColor: "transparent",
12865
+ color: tokens.colorNeutralForeground1,
12866
+ fontSize: tokens.fontSizeBase400,
12867
+ fontFamily: tokens.fontFamilyBase
12868
+ },
12869
+ onWheel: (e) => e.target.blur()
12870
+ }
12871
+ )
12872
+ }
12873
+ ) }),
12874
+ /* @__PURE__ */ jsx(
12875
+ Button,
12876
+ {
12877
+ appearance: "transparent",
12878
+ disabled,
12879
+ icon: /* @__PURE__ */ jsx(
12880
+ Icon,
12881
+ {
12882
+ icon: "fluent:add-circle-24-regular",
12883
+ style: {
12884
+ fontSize: "24px",
12885
+ color: tokens.colorBrandStroke1
12886
+ }
12887
+ }
12888
+ ),
12889
+ "aria-label": mergedLabels.incrementQuantityAriaLabel,
12890
+ size: "small",
12891
+ onClick: () => {
12892
+ const currentVal = getValues(
12893
+ `owners.${index}.cargo.${cargoIndex}.quantity`
12894
+ ) || 0;
12895
+ const currentQty = Number(currentVal);
12896
+ const newVal = currentQty + 1;
12819
12897
  setValue(
12820
12898
  `owners.${index}.cargo.${cargoIndex}.quantity`,
12821
12899
  newVal
@@ -12825,112 +12903,42 @@ var CardVehicleOwnerForm = ({
12825
12903
  cargo.id,
12826
12904
  newVal
12827
12905
  );
12906
+ },
12907
+ style: {
12908
+ minWidth: "32px",
12909
+ padding: "0"
12828
12910
  }
12829
- },
12830
- style: {
12831
- minWidth: "32px",
12832
- padding: "0"
12833
- }
12834
- }
12835
- ),
12836
- /* @__PURE__ */ jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsx(
12837
- Controller,
12838
- {
12839
- name: `owners.${index}.cargo.${cargoIndex}.quantity`,
12840
- control,
12841
- disabled,
12842
- render: ({ field }) => /* @__PURE__ */ jsx(
12843
- "input",
12844
- {
12845
- ...field,
12846
- type: "number",
12847
- style: {
12848
- border: "none",
12849
- width: "100%",
12850
- textAlign: "center",
12851
- outline: "none",
12852
- backgroundColor: "transparent",
12853
- color: tokens.colorNeutralForeground1,
12854
- fontSize: tokens.fontSizeBase400,
12855
- fontFamily: tokens.fontFamilyBase
12856
- },
12857
- onWheel: (e) => e.target.blur()
12858
- }
12859
- )
12860
- }
12861
- ) }),
12862
- /* @__PURE__ */ jsx(
12863
- Button,
12864
- {
12865
- appearance: "transparent",
12866
- disabled,
12867
- icon: /* @__PURE__ */ jsx(
12868
- Icon,
12869
- {
12870
- icon: "fluent:add-circle-24-regular",
12871
- style: {
12872
- fontSize: "24px",
12873
- color: tokens.colorBrandStroke1
12874
- }
12875
- }
12876
- ),
12877
- "aria-label": mergedLabels.incrementQuantityAriaLabel,
12878
- size: "small",
12879
- onClick: () => {
12880
- const currentVal = getValues(
12881
- `owners.${index}.cargo.${cargoIndex}.quantity`
12882
- ) || 0;
12883
- const currentQty = Number(currentVal);
12884
- const newVal = currentQty + 1;
12885
- setValue(
12886
- `owners.${index}.cargo.${cargoIndex}.quantity`,
12887
- newVal
12888
- );
12889
- onUpdateCargoQuantity(
12890
- owner.id,
12891
- cargo.id,
12892
- newVal
12893
- );
12894
- },
12895
- style: {
12896
- minWidth: "32px",
12897
- padding: "0"
12898
12911
  }
12899
- }
12900
- )
12901
- ]
12902
- }
12903
- ),
12904
- /* @__PURE__ */ jsx(
12905
- "div",
12906
- {
12907
- style: {
12908
- flex: 1,
12909
- textAlign: "left",
12910
- color: tokens.colorNeutralForeground1,
12911
- fontSize: tokens.fontSizeBase300,
12912
- paddingRight: "8px"
12913
- },
12914
- children: (() => {
12915
- const type = watch(
12916
- `owners.${index}.cargo.${cargoIndex}.cargoType`
12917
- );
12918
- if (type === "karung")
12919
- return mergedLabels.cargoTypeOptions.karung;
12920
- if (type === "kg")
12921
- return mergedLabels.cargoTypeOptions.kg;
12922
- if (type === "ton")
12923
- return mergedLabels.cargoTypeOptions.ton;
12924
- if (type === "unit")
12925
- return mergedLabels.cargoTypeOptions.unit;
12926
- return "";
12927
- })()
12928
- }
12929
- )
12930
- ]
12931
- }
12932
- )
12933
- ] }),
12912
+ )
12913
+ ]
12914
+ }
12915
+ ),
12916
+ /* @__PURE__ */ jsx(
12917
+ "div",
12918
+ {
12919
+ style: {
12920
+ flex: 1,
12921
+ textAlign: "left",
12922
+ color: tokens.colorNeutralForeground1,
12923
+ fontSize: tokens.fontSizeBase300,
12924
+ paddingRight: "8px"
12925
+ },
12926
+ children: (() => {
12927
+ const type2 = watch(
12928
+ `owners.${index}.cargo.${cargoIndex}.cargoType`
12929
+ );
12930
+ const selectedLoadType2 = loadTypes.find(
12931
+ (loadType) => loadType.id === type2
12932
+ );
12933
+ return selectedLoadType2?.unit?.name || "87";
12934
+ })()
12935
+ }
12936
+ )
12937
+ ]
12938
+ }
12939
+ )
12940
+ ] });
12941
+ })(),
12934
12942
  /* @__PURE__ */ jsxs(Col, { md: 3, children: [
12935
12943
  /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
12936
12944
  /* @__PURE__ */ jsx(