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

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