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

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