@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.d.mts CHANGED
@@ -1733,6 +1733,9 @@ type MANIFEST_ENTITY_TYPE = typeof MANIFEST_ENTITY[keyof typeof MANIFEST_ENTITY]
1733
1733
  interface LoadType {
1734
1734
  id: number;
1735
1735
  name: string;
1736
+ price: number;
1737
+ currency: string;
1738
+ formattedPrice: string;
1736
1739
  unit?: {
1737
1740
  id: string;
1738
1741
  name: string;
@@ -1741,6 +1744,7 @@ interface LoadType {
1741
1744
  declare const HARDCODED_ID: {
1742
1745
  readonly FAQ_ID_PEMESANAN_TIKET: 1;
1743
1746
  readonly COMPANY_ID_LAINNYA: "999999";
1747
+ readonly LOAD_TYPE_ID_LAINNYA: 87;
1744
1748
  };
1745
1749
 
1746
1750
  interface TypeOfServiceChild {
@@ -3047,8 +3051,12 @@ interface CardVehicleOwnerFormProps {
3047
3051
  /**
3048
3052
  * Options for load type select inputs
3049
3053
  */
3050
- loadTypeOptions?: SelectOption[];
3051
- loadTypes?: LoadType[];
3054
+ loadTypeOptions?: (LoadType & {
3055
+ commodityId: number;
3056
+ })[];
3057
+ loadTypes?: (LoadType & {
3058
+ commodityId: number;
3059
+ })[];
3052
3060
  /**
3053
3061
  * Options for industry select inputs
3054
3062
  */
package/dist/index.d.ts CHANGED
@@ -1733,6 +1733,9 @@ type MANIFEST_ENTITY_TYPE = typeof MANIFEST_ENTITY[keyof typeof MANIFEST_ENTITY]
1733
1733
  interface LoadType {
1734
1734
  id: number;
1735
1735
  name: string;
1736
+ price: number;
1737
+ currency: string;
1738
+ formattedPrice: string;
1736
1739
  unit?: {
1737
1740
  id: string;
1738
1741
  name: string;
@@ -1741,6 +1744,7 @@ interface LoadType {
1741
1744
  declare const HARDCODED_ID: {
1742
1745
  readonly FAQ_ID_PEMESANAN_TIKET: 1;
1743
1746
  readonly COMPANY_ID_LAINNYA: "999999";
1747
+ readonly LOAD_TYPE_ID_LAINNYA: 87;
1744
1748
  };
1745
1749
 
1746
1750
  interface TypeOfServiceChild {
@@ -3047,8 +3051,12 @@ interface CardVehicleOwnerFormProps {
3047
3051
  /**
3048
3052
  * Options for load type select inputs
3049
3053
  */
3050
- loadTypeOptions?: SelectOption[];
3051
- loadTypes?: LoadType[];
3054
+ loadTypeOptions?: (LoadType & {
3055
+ commodityId: number;
3056
+ })[];
3057
+ loadTypes?: (LoadType & {
3058
+ commodityId: number;
3059
+ })[];
3052
3060
  /**
3053
3061
  * Options for industry select inputs
3054
3062
  */
package/dist/index.js CHANGED
@@ -469,7 +469,8 @@ var MANIFEST_ENTITY = {
469
469
  };
470
470
  var HARDCODED_ID = {
471
471
  FAQ_ID_PEMESANAN_TIKET: 1,
472
- COMPANY_ID_LAINNYA: "999999"
472
+ COMPANY_ID_LAINNYA: "999999",
473
+ LOAD_TYPE_ID_LAINNYA: 87
473
474
  };
474
475
  var useStyles2 = reactComponents.makeStyles({
475
476
  carousel: {},
@@ -4241,7 +4242,8 @@ var InputDynamic = ({
4241
4242
  ...provided,
4242
4243
  minHeight: "40px",
4243
4244
  // fontSize: tokens.fontSizeBase400,
4244
- transition: "all 0.2s ease"
4245
+ transition: "all 0.2s ease",
4246
+ cursor: disabled ? "not-allowed" : "pointer"
4245
4247
  };
4246
4248
  if (currentAppearance === "outline") {
4247
4249
  return {
@@ -11923,7 +11925,7 @@ var CardPassengerList = ({
11923
11925
  /* @__PURE__ */ jsxRuntime.jsx(
11924
11926
  react.Icon,
11925
11927
  {
11926
- icon: "fluent:chevron-right-24-regular",
11928
+ icon: passenger.name && passenger.serviceName ? "fluent:edit-24-regular" : "fluent:chevron-right-24-regular",
11927
11929
  width: 20,
11928
11930
  height: 20
11929
11931
  }
@@ -12793,6 +12795,7 @@ var CardVehicleOwnerForm = ({
12793
12795
  onUpdateOwner(owner.id, {
12794
12796
  cargoItems: updatedCargoItems
12795
12797
  });
12798
+ setValue(`owners.${index}.cargo.${cargoIndex}.cargoType`, "");
12796
12799
  },
12797
12800
  options: commodityOptions,
12798
12801
  placeholder: mergedLabels.selectPlaceholder,
@@ -12826,7 +12829,9 @@ var CardVehicleOwnerForm = ({
12826
12829
  InputDynamic_default,
12827
12830
  {
12828
12831
  control,
12829
- disabled,
12832
+ disabled: disabled || (getValues(
12833
+ `owners.${index}.cargo.${cargoIndex}.commodity`
12834
+ ) || "") === "",
12830
12835
  name: `owners.${index}.cargo.${cargoIndex}.cargoType`,
12831
12836
  onChange: (val) => {
12832
12837
  const name = `owners.${index}.cargo.${cargoIndex}.cargoType`;
@@ -12841,7 +12846,12 @@ var CardVehicleOwnerForm = ({
12841
12846
  cargoItems: updatedCargoItems
12842
12847
  });
12843
12848
  },
12844
- options: loadTypeOptions,
12849
+ options: loadTypeOptions.filter((lt) => lt.commodityId === (getValues(
12850
+ `owners.${index}.cargo.${cargoIndex}.commodity`
12851
+ ) || "")).map((lt) => ({
12852
+ value: lt.id.toString(),
12853
+ label: `${lt.name} (${lt.unit?.name})`
12854
+ })),
12845
12855
  placeholder: mergedLabels.selectPlaceholder,
12846
12856
  required: true,
12847
12857
  size: "large",
@@ -12867,57 +12877,158 @@ var CardVehicleOwnerForm = ({
12867
12877
  (loadType) => loadType.id === type
12868
12878
  );
12869
12879
  if (!selectedLoadType) {
12870
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
12880
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
12881
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.priceLabel }),
12882
+ /* @__PURE__ */ jsxRuntime.jsx(
12883
+ reactComponents.Body2,
12884
+ {
12885
+ style: { marginTop: "0.5rem" },
12886
+ children: (() => {
12887
+ return new Intl.NumberFormat(
12888
+ "id-ID",
12889
+ {
12890
+ style: "currency",
12891
+ currency: "IDR",
12892
+ minimumFractionDigits: 0
12893
+ }
12894
+ ).format(0);
12895
+ })()
12896
+ }
12897
+ )
12898
+ ] });
12871
12899
  }
12872
- return /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
12873
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
12874
- /* @__PURE__ */ jsxRuntime.jsxs(
12875
- "div",
12876
- {
12877
- style: {
12878
- display: "flex",
12879
- alignItems: "center",
12880
- border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
12881
- borderRadius: reactComponents.tokens.borderRadiusMedium,
12882
- height: "40px",
12883
- padding: "0 12px",
12884
- backgroundColor: reactComponents.tokens.colorNeutralBackground1
12885
- },
12886
- children: [
12887
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
12888
- /* @__PURE__ */ jsxRuntime.jsxs(
12889
- "div",
12890
- {
12891
- style: {
12892
- display: "flex",
12893
- alignItems: "center",
12894
- gap: "12px"
12895
- },
12896
- children: [
12897
- /* @__PURE__ */ jsxRuntime.jsx(
12898
- reactComponents.Button,
12899
- {
12900
- appearance: "transparent",
12901
- disabled,
12902
- icon: /* @__PURE__ */ jsxRuntime.jsx(
12903
- react.Icon,
12904
- {
12905
- icon: "fluent:subtract-circle-24-regular",
12906
- style: {
12907
- fontSize: "24px",
12908
- color: reactComponents.tokens.colorNeutralForeground4
12900
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12901
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
12902
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.cargoQuantityLabel }),
12903
+ /* @__PURE__ */ jsxRuntime.jsxs(
12904
+ "div",
12905
+ {
12906
+ style: {
12907
+ display: "flex",
12908
+ alignItems: "center",
12909
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
12910
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
12911
+ height: "40px",
12912
+ padding: "0 12px",
12913
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1
12914
+ },
12915
+ children: [
12916
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
12917
+ /* @__PURE__ */ jsxRuntime.jsxs(
12918
+ "div",
12919
+ {
12920
+ style: {
12921
+ display: "flex",
12922
+ alignItems: "center",
12923
+ gap: "12px"
12924
+ },
12925
+ children: [
12926
+ /* @__PURE__ */ jsxRuntime.jsx(
12927
+ reactComponents.Button,
12928
+ {
12929
+ appearance: "transparent",
12930
+ disabled,
12931
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
12932
+ react.Icon,
12933
+ {
12934
+ icon: "fluent:subtract-circle-24-regular",
12935
+ style: {
12936
+ fontSize: "24px",
12937
+ color: reactComponents.tokens.colorNeutralForeground4
12938
+ }
12909
12939
  }
12940
+ ),
12941
+ "aria-label": mergedLabels.decrementQuantityAriaLabel,
12942
+ size: "small",
12943
+ onClick: () => {
12944
+ const currentVal = getValues(
12945
+ `owners.${index}.cargo.${cargoIndex}.quantity`
12946
+ ) || 0;
12947
+ const currentQty = Number(currentVal);
12948
+ if (currentQty > 0) {
12949
+ const newVal = currentQty - 1;
12950
+ setValue(
12951
+ `owners.${index}.cargo.${cargoIndex}.quantity`,
12952
+ newVal
12953
+ );
12954
+ onUpdateCargoQuantity(
12955
+ owner.id,
12956
+ cargo.id,
12957
+ newVal
12958
+ );
12959
+ }
12960
+ },
12961
+ style: {
12962
+ minWidth: "32px",
12963
+ padding: "0"
12964
+ }
12965
+ }
12966
+ ),
12967
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
12968
+ reactHookForm.Controller,
12969
+ {
12970
+ name: `owners.${index}.cargo.${cargoIndex}.quantity`,
12971
+ control,
12972
+ disabled,
12973
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
12974
+ "input",
12975
+ {
12976
+ ...field,
12977
+ min: 1,
12978
+ type: "number",
12979
+ style: {
12980
+ border: "none",
12981
+ width: "100%",
12982
+ textAlign: "center",
12983
+ outline: "none",
12984
+ backgroundColor: "transparent",
12985
+ color: reactComponents.tokens.colorNeutralForeground1,
12986
+ fontSize: reactComponents.tokens.fontSizeBase400,
12987
+ fontFamily: reactComponents.tokens.fontFamilyBase
12988
+ },
12989
+ onWheel: (e) => e.target.blur(),
12990
+ onChange: (e) => {
12991
+ const newVal = Number(
12992
+ e.target.value
12993
+ );
12994
+ field.onChange(e);
12995
+ onUpdateCargoQuantity(
12996
+ owner.id,
12997
+ cargo.id,
12998
+ newVal
12999
+ );
13000
+ }
13001
+ }
13002
+ ),
13003
+ rules: {
13004
+ required: true,
13005
+ min: 1
12910
13006
  }
12911
- ),
12912
- "aria-label": mergedLabels.decrementQuantityAriaLabel,
12913
- size: "small",
12914
- onClick: () => {
12915
- const currentVal = getValues(
12916
- `owners.${index}.cargo.${cargoIndex}.quantity`
12917
- ) || 0;
12918
- const currentQty = Number(currentVal);
12919
- if (currentQty > 0) {
12920
- const newVal = currentQty - 1;
13007
+ }
13008
+ ) }),
13009
+ /* @__PURE__ */ jsxRuntime.jsx(
13010
+ reactComponents.Button,
13011
+ {
13012
+ appearance: "transparent",
13013
+ disabled,
13014
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
13015
+ react.Icon,
13016
+ {
13017
+ icon: "fluent:add-circle-24-regular",
13018
+ style: {
13019
+ fontSize: "24px",
13020
+ color: reactComponents.tokens.colorBrandStroke1
13021
+ }
13022
+ }
13023
+ ),
13024
+ "aria-label": mergedLabels.incrementQuantityAriaLabel,
13025
+ size: "small",
13026
+ onClick: () => {
13027
+ const currentVal = getValues(
13028
+ `owners.${index}.cargo.${cargoIndex}.quantity`
13029
+ ) || 0;
13030
+ const currentQty = Number(currentVal);
13031
+ const newVal = currentQty + 1;
12921
13032
  setValue(
12922
13033
  `owners.${index}.cargo.${cargoIndex}.quantity`,
12923
13034
  newVal
@@ -12927,137 +13038,69 @@ var CardVehicleOwnerForm = ({
12927
13038
  cargo.id,
12928
13039
  newVal
12929
13040
  );
13041
+ },
13042
+ style: {
13043
+ minWidth: "32px",
13044
+ padding: "0"
12930
13045
  }
12931
- },
12932
- style: {
12933
- minWidth: "32px",
12934
- padding: "0"
12935
- }
12936
- }
12937
- ),
12938
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "40px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
12939
- reactHookForm.Controller,
12940
- {
12941
- name: `owners.${index}.cargo.${cargoIndex}.quantity`,
12942
- control,
12943
- disabled,
12944
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
12945
- "input",
12946
- {
12947
- ...field,
12948
- min: 1,
12949
- type: "number",
12950
- style: {
12951
- border: "none",
12952
- width: "100%",
12953
- textAlign: "center",
12954
- outline: "none",
12955
- backgroundColor: "transparent",
12956
- color: reactComponents.tokens.colorNeutralForeground1,
12957
- fontSize: reactComponents.tokens.fontSizeBase400,
12958
- fontFamily: reactComponents.tokens.fontFamilyBase
12959
- },
12960
- onWheel: (e) => e.target.blur(),
12961
- onChange: (e) => {
12962
- const newVal = Number(e.target.value);
12963
- field.onChange(e);
12964
- onUpdateCargoQuantity(
12965
- owner.id,
12966
- cargo.id,
12967
- newVal
12968
- );
12969
- }
12970
- }
12971
- )
12972
- }
12973
- ) }),
12974
- /* @__PURE__ */ jsxRuntime.jsx(
12975
- reactComponents.Button,
12976
- {
12977
- appearance: "transparent",
12978
- disabled,
12979
- icon: /* @__PURE__ */ jsxRuntime.jsx(
12980
- react.Icon,
12981
- {
12982
- icon: "fluent:add-circle-24-regular",
12983
- style: {
12984
- fontSize: "24px",
12985
- color: reactComponents.tokens.colorBrandStroke1
12986
- }
12987
- }
12988
- ),
12989
- "aria-label": mergedLabels.incrementQuantityAriaLabel,
12990
- size: "small",
12991
- onClick: () => {
12992
- const currentVal = getValues(
12993
- `owners.${index}.cargo.${cargoIndex}.quantity`
12994
- ) || 0;
12995
- const currentQty = Number(currentVal);
12996
- const newVal = currentQty + 1;
12997
- setValue(
12998
- `owners.${index}.cargo.${cargoIndex}.quantity`,
12999
- newVal
13000
- );
13001
- onUpdateCargoQuantity(
13002
- owner.id,
13003
- cargo.id,
13004
- newVal
13005
- );
13006
- },
13007
- style: {
13008
- minWidth: "32px",
13009
- padding: "0"
13010
13046
  }
13011
- }
13012
- )
13013
- ]
13014
- }
13015
- ),
13016
- /* @__PURE__ */ jsxRuntime.jsx(
13017
- "div",
13018
- {
13019
- style: {
13020
- flex: 1,
13021
- textAlign: "left",
13022
- color: reactComponents.tokens.colorNeutralForeground1,
13023
- fontSize: reactComponents.tokens.fontSizeBase300,
13024
- paddingRight: "8px"
13025
- },
13026
- children: (() => {
13027
- const type2 = watch(
13028
- `owners.${index}.cargo.${cargoIndex}.cargoType`
13029
- );
13030
- const selectedLoadType2 = loadTypes.find(
13031
- (loadType) => loadType.id === type2
13032
- );
13033
- return selectedLoadType2?.unit?.name || "87";
13034
- })()
13035
- }
13036
- )
13037
- ]
13038
- }
13039
- )
13040
- ] });
13041
- })(),
13042
- /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
13043
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13044
- /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body2, { style: { marginTop: "0.5rem" }, children: (() => {
13045
- return new Intl.NumberFormat(
13046
- language === "id" ? "id-ID" : "en-US",
13047
- {
13048
- style: "currency",
13049
- currency: language === "id" ? "IDR" : "USD",
13050
- minimumFractionDigits: 0
13051
- }
13052
- ).format(
13053
- Number(
13054
- getValues(
13055
- `owners.${index}.cargo.${cargoIndex}.price`
13056
- ) || 1234567890
13047
+ )
13048
+ ]
13049
+ }
13050
+ ),
13051
+ /* @__PURE__ */ jsxRuntime.jsx(
13052
+ "div",
13053
+ {
13054
+ style: {
13055
+ flex: 1,
13056
+ textAlign: "left",
13057
+ color: reactComponents.tokens.colorNeutralForeground1,
13058
+ fontSize: reactComponents.tokens.fontSizeBase300,
13059
+ paddingRight: "8px"
13060
+ },
13061
+ children: (() => {
13062
+ const type2 = watch(
13063
+ `owners.${index}.cargo.${cargoIndex}.cargoType`
13064
+ );
13065
+ const selectedLoadType2 = loadTypes.find(
13066
+ (loadType) => loadType.id === type2
13067
+ );
13068
+ return selectedLoadType2?.unit?.name || "----87----";
13069
+ })()
13070
+ }
13071
+ )
13072
+ ]
13073
+ }
13057
13074
  )
13058
- );
13059
- })() })
13060
- ] })
13075
+ ] }),
13076
+ /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 3, children: [
13077
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 0.5 } }),
13078
+ /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: styles.label, children: mergedLabels.priceLabel }),
13079
+ /* @__PURE__ */ jsxRuntime.jsx(
13080
+ reactComponents.Body2,
13081
+ {
13082
+ style: { marginTop: "0.5rem" },
13083
+ children: (() => {
13084
+ return new Intl.NumberFormat(
13085
+ "id-ID",
13086
+ {
13087
+ style: "currency",
13088
+ currency: "IDR",
13089
+ minimumFractionDigits: 0
13090
+ }
13091
+ ).format(
13092
+ Number(
13093
+ getValues(
13094
+ `owners.${index}.cargo.${cargoIndex}.quantity`
13095
+ ) || 0
13096
+ ) * (selectedLoadType?.price || 0)
13097
+ );
13098
+ })()
13099
+ }
13100
+ )
13101
+ ] })
13102
+ ] });
13103
+ })()
13061
13104
  ] }),
13062
13105
  /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
13063
13106
  /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { md: 6, children: [