@asdp/ferryui 0.1.22-dev.9596 → 0.1.22-dev.9630

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
@@ -460,7 +460,8 @@ var MANIFEST_ENTITY = {
460
460
  };
461
461
  var HARDCODED_ID = {
462
462
  FAQ_ID_PEMESANAN_TIKET: 1,
463
- COMPANY_ID_LAINNYA: "999999"
463
+ COMPANY_ID_LAINNYA: "999999",
464
+ LOAD_TYPE_ID_LAINNYA: 87
464
465
  };
465
466
  var useStyles2 = makeStyles({
466
467
  carousel: {},
@@ -4232,7 +4233,8 @@ var InputDynamic = ({
4232
4233
  ...provided,
4233
4234
  minHeight: "40px",
4234
4235
  // fontSize: tokens.fontSizeBase400,
4235
- transition: "all 0.2s ease"
4236
+ transition: "all 0.2s ease",
4237
+ cursor: disabled ? "not-allowed" : "pointer"
4236
4238
  };
4237
4239
  if (currentAppearance === "outline") {
4238
4240
  return {
@@ -11914,7 +11916,7 @@ var CardPassengerList = ({
11914
11916
  /* @__PURE__ */ jsx(
11915
11917
  Icon,
11916
11918
  {
11917
- icon: "fluent:chevron-right-24-regular",
11919
+ icon: passenger.name && passenger.serviceName ? "fluent:edit-24-regular" : "fluent:chevron-right-24-regular",
11918
11920
  width: 20,
11919
11921
  height: 20
11920
11922
  }
@@ -12784,6 +12786,7 @@ var CardVehicleOwnerForm = ({
12784
12786
  onUpdateOwner(owner.id, {
12785
12787
  cargoItems: updatedCargoItems
12786
12788
  });
12789
+ setValue(`owners.${index}.cargo.${cargoIndex}.cargoType`, "");
12787
12790
  },
12788
12791
  options: commodityOptions,
12789
12792
  placeholder: mergedLabels.selectPlaceholder,
@@ -12817,7 +12820,9 @@ var CardVehicleOwnerForm = ({
12817
12820
  InputDynamic_default,
12818
12821
  {
12819
12822
  control,
12820
- disabled,
12823
+ disabled: disabled || (getValues(
12824
+ `owners.${index}.cargo.${cargoIndex}.commodity`
12825
+ ) || "") === "",
12821
12826
  name: `owners.${index}.cargo.${cargoIndex}.cargoType`,
12822
12827
  onChange: (val) => {
12823
12828
  const name = `owners.${index}.cargo.${cargoIndex}.cargoType`;
@@ -12832,7 +12837,12 @@ var CardVehicleOwnerForm = ({
12832
12837
  cargoItems: updatedCargoItems
12833
12838
  });
12834
12839
  },
12835
- options: loadTypeOptions,
12840
+ options: loadTypeOptions.filter((lt) => lt.commodityId === (getValues(
12841
+ `owners.${index}.cargo.${cargoIndex}.commodity`
12842
+ ) || "")).map((lt) => ({
12843
+ value: lt.id.toString(),
12844
+ label: `${lt.name} (${lt.unit?.name})`
12845
+ })),
12836
12846
  placeholder: mergedLabels.selectPlaceholder,
12837
12847
  required: true,
12838
12848
  size: "large",
@@ -12858,57 +12868,158 @@ var CardVehicleOwnerForm = ({
12858
12868
  (loadType) => loadType.id === type
12859
12869
  );
12860
12870
  if (!selectedLoadType) {
12861
- return /* @__PURE__ */ jsx(Fragment, {});
12871
+ return /* @__PURE__ */ jsxs(Col, { md: 3, children: [
12872
+ /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
12873
+ /* @__PURE__ */ jsx(
12874
+ Body2,
12875
+ {
12876
+ style: { marginTop: "0.5rem" },
12877
+ children: (() => {
12878
+ return new Intl.NumberFormat(
12879
+ "id-ID",
12880
+ {
12881
+ style: "currency",
12882
+ currency: "IDR",
12883
+ minimumFractionDigits: 0
12884
+ }
12885
+ ).format(0);
12886
+ })()
12887
+ }
12888
+ )
12889
+ ] });
12862
12890
  }
12863
- return /* @__PURE__ */ jsxs(Col, { md: 3, children: [
12864
- /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
12865
- /* @__PURE__ */ jsxs(
12866
- "div",
12867
- {
12868
- style: {
12869
- display: "flex",
12870
- alignItems: "center",
12871
- border: `1px solid ${tokens.colorNeutralStroke1}`,
12872
- borderRadius: tokens.borderRadiusMedium,
12873
- height: "40px",
12874
- padding: "0 12px",
12875
- backgroundColor: tokens.colorNeutralBackground1
12876
- },
12877
- children: [
12878
- /* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
12879
- /* @__PURE__ */ jsxs(
12880
- "div",
12881
- {
12882
- style: {
12883
- display: "flex",
12884
- alignItems: "center",
12885
- gap: "12px"
12886
- },
12887
- children: [
12888
- /* @__PURE__ */ jsx(
12889
- Button,
12890
- {
12891
- appearance: "transparent",
12892
- disabled,
12893
- icon: /* @__PURE__ */ jsx(
12894
- Icon,
12895
- {
12896
- icon: "fluent:subtract-circle-24-regular",
12897
- style: {
12898
- fontSize: "24px",
12899
- color: tokens.colorNeutralForeground4
12891
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
12892
+ /* @__PURE__ */ jsxs(Col, { md: 3, children: [
12893
+ /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
12894
+ /* @__PURE__ */ jsxs(
12895
+ "div",
12896
+ {
12897
+ style: {
12898
+ display: "flex",
12899
+ alignItems: "center",
12900
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
12901
+ borderRadius: tokens.borderRadiusMedium,
12902
+ height: "40px",
12903
+ padding: "0 12px",
12904
+ backgroundColor: tokens.colorNeutralBackground1
12905
+ },
12906
+ children: [
12907
+ /* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
12908
+ /* @__PURE__ */ jsxs(
12909
+ "div",
12910
+ {
12911
+ style: {
12912
+ display: "flex",
12913
+ alignItems: "center",
12914
+ gap: "12px"
12915
+ },
12916
+ children: [
12917
+ /* @__PURE__ */ jsx(
12918
+ Button,
12919
+ {
12920
+ appearance: "transparent",
12921
+ disabled,
12922
+ icon: /* @__PURE__ */ jsx(
12923
+ Icon,
12924
+ {
12925
+ icon: "fluent:subtract-circle-24-regular",
12926
+ style: {
12927
+ fontSize: "24px",
12928
+ color: tokens.colorNeutralForeground4
12929
+ }
12900
12930
  }
12931
+ ),
12932
+ "aria-label": mergedLabels.decrementQuantityAriaLabel,
12933
+ size: "small",
12934
+ onClick: () => {
12935
+ const currentVal = getValues(
12936
+ `owners.${index}.cargo.${cargoIndex}.quantity`
12937
+ ) || 0;
12938
+ const currentQty = Number(currentVal);
12939
+ if (currentQty > 0) {
12940
+ const newVal = currentQty - 1;
12941
+ setValue(
12942
+ `owners.${index}.cargo.${cargoIndex}.quantity`,
12943
+ newVal
12944
+ );
12945
+ onUpdateCargoQuantity(
12946
+ owner.id,
12947
+ cargo.id,
12948
+ newVal
12949
+ );
12950
+ }
12951
+ },
12952
+ style: {
12953
+ minWidth: "32px",
12954
+ padding: "0"
12955
+ }
12956
+ }
12957
+ ),
12958
+ /* @__PURE__ */ jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsx(
12959
+ Controller,
12960
+ {
12961
+ name: `owners.${index}.cargo.${cargoIndex}.quantity`,
12962
+ control,
12963
+ disabled,
12964
+ render: ({ field }) => /* @__PURE__ */ jsx(
12965
+ "input",
12966
+ {
12967
+ ...field,
12968
+ min: 1,
12969
+ type: "number",
12970
+ style: {
12971
+ border: "none",
12972
+ width: "100%",
12973
+ textAlign: "center",
12974
+ outline: "none",
12975
+ backgroundColor: "transparent",
12976
+ color: tokens.colorNeutralForeground1,
12977
+ fontSize: tokens.fontSizeBase400,
12978
+ fontFamily: tokens.fontFamilyBase
12979
+ },
12980
+ onWheel: (e) => e.target.blur(),
12981
+ onChange: (e) => {
12982
+ const newVal = Number(
12983
+ e.target.value
12984
+ );
12985
+ field.onChange(e);
12986
+ onUpdateCargoQuantity(
12987
+ owner.id,
12988
+ cargo.id,
12989
+ newVal
12990
+ );
12991
+ }
12992
+ }
12993
+ ),
12994
+ rules: {
12995
+ required: true,
12996
+ min: 1
12901
12997
  }
12902
- ),
12903
- "aria-label": mergedLabels.decrementQuantityAriaLabel,
12904
- size: "small",
12905
- onClick: () => {
12906
- const currentVal = getValues(
12907
- `owners.${index}.cargo.${cargoIndex}.quantity`
12908
- ) || 0;
12909
- const currentQty = Number(currentVal);
12910
- if (currentQty > 0) {
12911
- const newVal = currentQty - 1;
12998
+ }
12999
+ ) }),
13000
+ /* @__PURE__ */ jsx(
13001
+ Button,
13002
+ {
13003
+ appearance: "transparent",
13004
+ disabled,
13005
+ icon: /* @__PURE__ */ jsx(
13006
+ Icon,
13007
+ {
13008
+ icon: "fluent:add-circle-24-regular",
13009
+ style: {
13010
+ fontSize: "24px",
13011
+ color: tokens.colorBrandStroke1
13012
+ }
13013
+ }
13014
+ ),
13015
+ "aria-label": mergedLabels.incrementQuantityAriaLabel,
13016
+ size: "small",
13017
+ onClick: () => {
13018
+ const currentVal = getValues(
13019
+ `owners.${index}.cargo.${cargoIndex}.quantity`
13020
+ ) || 0;
13021
+ const currentQty = Number(currentVal);
13022
+ const newVal = currentQty + 1;
12912
13023
  setValue(
12913
13024
  `owners.${index}.cargo.${cargoIndex}.quantity`,
12914
13025
  newVal
@@ -12918,137 +13029,69 @@ var CardVehicleOwnerForm = ({
12918
13029
  cargo.id,
12919
13030
  newVal
12920
13031
  );
13032
+ },
13033
+ style: {
13034
+ minWidth: "32px",
13035
+ padding: "0"
12921
13036
  }
12922
- },
12923
- style: {
12924
- minWidth: "32px",
12925
- padding: "0"
12926
- }
12927
- }
12928
- ),
12929
- /* @__PURE__ */ jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsx(
12930
- Controller,
12931
- {
12932
- name: `owners.${index}.cargo.${cargoIndex}.quantity`,
12933
- control,
12934
- disabled,
12935
- render: ({ field }) => /* @__PURE__ */ jsx(
12936
- "input",
12937
- {
12938
- ...field,
12939
- min: 1,
12940
- type: "number",
12941
- style: {
12942
- border: "none",
12943
- width: "100%",
12944
- textAlign: "center",
12945
- outline: "none",
12946
- backgroundColor: "transparent",
12947
- color: tokens.colorNeutralForeground1,
12948
- fontSize: tokens.fontSizeBase400,
12949
- fontFamily: tokens.fontFamilyBase
12950
- },
12951
- onWheel: (e) => e.target.blur(),
12952
- onChange: (e) => {
12953
- const newVal = Number(e.target.value);
12954
- field.onChange(e);
12955
- onUpdateCargoQuantity(
12956
- owner.id,
12957
- cargo.id,
12958
- newVal
12959
- );
12960
- }
12961
- }
12962
- )
12963
- }
12964
- ) }),
12965
- /* @__PURE__ */ jsx(
12966
- Button,
12967
- {
12968
- appearance: "transparent",
12969
- disabled,
12970
- icon: /* @__PURE__ */ jsx(
12971
- Icon,
12972
- {
12973
- icon: "fluent:add-circle-24-regular",
12974
- style: {
12975
- fontSize: "24px",
12976
- color: tokens.colorBrandStroke1
12977
- }
12978
- }
12979
- ),
12980
- "aria-label": mergedLabels.incrementQuantityAriaLabel,
12981
- size: "small",
12982
- onClick: () => {
12983
- const currentVal = getValues(
12984
- `owners.${index}.cargo.${cargoIndex}.quantity`
12985
- ) || 0;
12986
- const currentQty = Number(currentVal);
12987
- const newVal = currentQty + 1;
12988
- setValue(
12989
- `owners.${index}.cargo.${cargoIndex}.quantity`,
12990
- newVal
12991
- );
12992
- onUpdateCargoQuantity(
12993
- owner.id,
12994
- cargo.id,
12995
- newVal
12996
- );
12997
- },
12998
- style: {
12999
- minWidth: "32px",
13000
- padding: "0"
13001
13037
  }
13002
- }
13003
- )
13004
- ]
13005
- }
13006
- ),
13007
- /* @__PURE__ */ jsx(
13008
- "div",
13009
- {
13010
- style: {
13011
- flex: 1,
13012
- textAlign: "left",
13013
- color: tokens.colorNeutralForeground1,
13014
- fontSize: tokens.fontSizeBase300,
13015
- paddingRight: "8px"
13016
- },
13017
- children: (() => {
13018
- const type2 = watch(
13019
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13020
- );
13021
- const selectedLoadType2 = loadTypes.find(
13022
- (loadType) => loadType.id === type2
13023
- );
13024
- return selectedLoadType2?.unit?.name || "87";
13025
- })()
13026
- }
13027
- )
13028
- ]
13029
- }
13030
- )
13031
- ] });
13032
- })(),
13033
- /* @__PURE__ */ jsxs(Col, { md: 3, children: [
13034
- /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13035
- /* @__PURE__ */ jsx(Body2, { style: { marginTop: "0.5rem" }, children: (() => {
13036
- return new Intl.NumberFormat(
13037
- language === "id" ? "id-ID" : "en-US",
13038
- {
13039
- style: "currency",
13040
- currency: language === "id" ? "IDR" : "USD",
13041
- minimumFractionDigits: 0
13042
- }
13043
- ).format(
13044
- Number(
13045
- getValues(
13046
- `owners.${index}.cargo.${cargoIndex}.price`
13047
- ) || 1234567890
13038
+ )
13039
+ ]
13040
+ }
13041
+ ),
13042
+ /* @__PURE__ */ jsx(
13043
+ "div",
13044
+ {
13045
+ style: {
13046
+ flex: 1,
13047
+ textAlign: "left",
13048
+ color: tokens.colorNeutralForeground1,
13049
+ fontSize: tokens.fontSizeBase300,
13050
+ paddingRight: "8px"
13051
+ },
13052
+ children: (() => {
13053
+ const type2 = watch(
13054
+ `owners.${index}.cargo.${cargoIndex}.cargoType`
13055
+ );
13056
+ const selectedLoadType2 = loadTypes.find(
13057
+ (loadType) => loadType.id === type2
13058
+ );
13059
+ return selectedLoadType2?.unit?.name || "----87----";
13060
+ })()
13061
+ }
13062
+ )
13063
+ ]
13064
+ }
13048
13065
  )
13049
- );
13050
- })() })
13051
- ] })
13066
+ ] }),
13067
+ /* @__PURE__ */ jsxs(Col, { md: 3, children: [
13068
+ /* @__PURE__ */ jsx("div", { style: { flex: 0.5 } }),
13069
+ /* @__PURE__ */ jsx(Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13070
+ /* @__PURE__ */ jsx(
13071
+ Body2,
13072
+ {
13073
+ style: { marginTop: "0.5rem" },
13074
+ children: (() => {
13075
+ return new Intl.NumberFormat(
13076
+ "id-ID",
13077
+ {
13078
+ style: "currency",
13079
+ currency: "IDR",
13080
+ minimumFractionDigits: 0
13081
+ }
13082
+ ).format(
13083
+ Number(
13084
+ getValues(
13085
+ `owners.${index}.cargo.${cargoIndex}.quantity`
13086
+ ) || 0
13087
+ ) * (selectedLoadType?.price || 0)
13088
+ );
13089
+ })()
13090
+ }
13091
+ )
13092
+ ] })
13093
+ ] });
13094
+ })()
13052
13095
  ] }),
13053
13096
  /* @__PURE__ */ jsxs(Row, { children: [
13054
13097
  /* @__PURE__ */ jsxs(Col, { md: 6, children: [