@asdp/ferryui 0.1.22-dev.8663 → 0.1.22-dev.8694
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 +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +86 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2196,6 +2196,8 @@ interface ModalPassengerFormLabels {
|
|
|
2196
2196
|
ticketClassLabel: string;
|
|
2197
2197
|
saveButton: string;
|
|
2198
2198
|
cancelButton: string;
|
|
2199
|
+
idTypeOtherLabel: string;
|
|
2200
|
+
idTypeOtherPlaceholder: string;
|
|
2199
2201
|
errors: {
|
|
2200
2202
|
requiredTitle: string;
|
|
2201
2203
|
requiredName: string;
|
|
@@ -2287,10 +2289,6 @@ interface ModalPassengerFormProps {
|
|
|
2287
2289
|
* Options for title select field
|
|
2288
2290
|
*/
|
|
2289
2291
|
titleOptions: SelectOption[];
|
|
2290
|
-
/**
|
|
2291
|
-
* Options for ID type select field
|
|
2292
|
-
*/
|
|
2293
|
-
idTypeOptions: SelectOption[];
|
|
2294
2292
|
/**
|
|
2295
2293
|
* Options for city select field
|
|
2296
2294
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -2196,6 +2196,8 @@ interface ModalPassengerFormLabels {
|
|
|
2196
2196
|
ticketClassLabel: string;
|
|
2197
2197
|
saveButton: string;
|
|
2198
2198
|
cancelButton: string;
|
|
2199
|
+
idTypeOtherLabel: string;
|
|
2200
|
+
idTypeOtherPlaceholder: string;
|
|
2199
2201
|
errors: {
|
|
2200
2202
|
requiredTitle: string;
|
|
2201
2203
|
requiredName: string;
|
|
@@ -2287,10 +2289,6 @@ interface ModalPassengerFormProps {
|
|
|
2287
2289
|
* Options for title select field
|
|
2288
2290
|
*/
|
|
2289
2291
|
titleOptions: SelectOption[];
|
|
2290
|
-
/**
|
|
2291
|
-
* Options for ID type select field
|
|
2292
|
-
*/
|
|
2293
|
-
idTypeOptions: SelectOption[];
|
|
2294
2292
|
/**
|
|
2295
2293
|
* Options for city select field
|
|
2296
2294
|
*/
|
package/dist/index.js
CHANGED
|
@@ -2036,7 +2036,7 @@ var useStyles7 = reactComponents.makeStyles({
|
|
|
2036
2036
|
display: "none"
|
|
2037
2037
|
},
|
|
2038
2038
|
"& .fui-Radio__label": {
|
|
2039
|
-
padding: "10px
|
|
2039
|
+
padding: "5px 10px",
|
|
2040
2040
|
border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
|
|
2041
2041
|
borderRadius: reactComponents.tokens.borderRadiusCircular,
|
|
2042
2042
|
cursor: "pointer",
|
|
@@ -7828,6 +7828,8 @@ var DEFAULT_LABELS22 = {
|
|
|
7828
7828
|
ticketClassLabel: "Kelas penumpang",
|
|
7829
7829
|
saveButton: "Simpan",
|
|
7830
7830
|
cancelButton: "Batal",
|
|
7831
|
+
idTypeOtherLabel: "Tanggal lahir",
|
|
7832
|
+
idTypeOtherPlaceholder: "DD/MM/YYYY",
|
|
7831
7833
|
errors: {
|
|
7832
7834
|
requiredTitle: "Title harus dipilih",
|
|
7833
7835
|
requiredName: "Nama lengkap harus diisi",
|
|
@@ -7861,6 +7863,8 @@ var DEFAULT_LABELS22 = {
|
|
|
7861
7863
|
ticketClassLabel: "Passenger Class",
|
|
7862
7864
|
saveButton: "Save",
|
|
7863
7865
|
cancelButton: "Cancel",
|
|
7866
|
+
idTypeOtherLabel: "Date of Birth",
|
|
7867
|
+
idTypeOtherPlaceholder: "DD/MM/YYYY",
|
|
7864
7868
|
errors: {
|
|
7865
7869
|
requiredTitle: "Title is required",
|
|
7866
7870
|
requiredName: "Full name is required",
|
|
@@ -7876,6 +7880,24 @@ var DEFAULT_LABELS22 = {
|
|
|
7876
7880
|
}
|
|
7877
7881
|
}
|
|
7878
7882
|
};
|
|
7883
|
+
var TYPE_OPTIONS = [
|
|
7884
|
+
{
|
|
7885
|
+
label: "KTP",
|
|
7886
|
+
value: "ktp"
|
|
7887
|
+
},
|
|
7888
|
+
{
|
|
7889
|
+
label: "SIM",
|
|
7890
|
+
value: "sim"
|
|
7891
|
+
},
|
|
7892
|
+
{
|
|
7893
|
+
label: "Paspor",
|
|
7894
|
+
value: "paspor"
|
|
7895
|
+
},
|
|
7896
|
+
{
|
|
7897
|
+
label: "Lainnya",
|
|
7898
|
+
value: "lainnya"
|
|
7899
|
+
}
|
|
7900
|
+
];
|
|
7879
7901
|
var useStyles22 = reactComponents.makeStyles({
|
|
7880
7902
|
dialogSurface: {
|
|
7881
7903
|
maxWidth: "600px",
|
|
@@ -7904,7 +7926,6 @@ var ModalPassengerForm = ({
|
|
|
7904
7926
|
defaultValues,
|
|
7905
7927
|
isAdultForm = true,
|
|
7906
7928
|
titleOptions,
|
|
7907
|
-
idTypeOptions,
|
|
7908
7929
|
cityOptions,
|
|
7909
7930
|
ticketClassOptions
|
|
7910
7931
|
}) => {
|
|
@@ -7915,12 +7936,18 @@ var ModalPassengerForm = ({
|
|
|
7915
7936
|
...labels?.errors
|
|
7916
7937
|
};
|
|
7917
7938
|
const displayTitle = title || mergedLabels.title;
|
|
7918
|
-
const { control, handleSubmit, reset } = reactHookForm.useForm({
|
|
7939
|
+
const { control, handleSubmit, reset, watch, setValue } = reactHookForm.useForm({
|
|
7919
7940
|
defaultValues
|
|
7920
7941
|
});
|
|
7942
|
+
const idType = watch("idType");
|
|
7921
7943
|
React5.useEffect(() => {
|
|
7922
7944
|
reset(defaultValues);
|
|
7923
7945
|
}, [defaultValues, reset]);
|
|
7946
|
+
React5.useEffect(() => {
|
|
7947
|
+
if (idType) {
|
|
7948
|
+
setValue("idNumber", "");
|
|
7949
|
+
}
|
|
7950
|
+
}, [idType, setValue]);
|
|
7924
7951
|
const handleFormSubmit = (data) => {
|
|
7925
7952
|
onSubmit(data);
|
|
7926
7953
|
reset();
|
|
@@ -7976,6 +8003,45 @@ var ModalPassengerForm = ({
|
|
|
7976
8003
|
}
|
|
7977
8004
|
}
|
|
7978
8005
|
),
|
|
8006
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8007
|
+
InputDynamic_default,
|
|
8008
|
+
{
|
|
8009
|
+
name: "age",
|
|
8010
|
+
control,
|
|
8011
|
+
type: "number",
|
|
8012
|
+
label: mergedLabels.ageLabel,
|
|
8013
|
+
placeholder: mergedLabels.agePlaceholder,
|
|
8014
|
+
size: "large",
|
|
8015
|
+
required: true,
|
|
8016
|
+
validationRules: {
|
|
8017
|
+
required: mergedErrors.requiredAge,
|
|
8018
|
+
min: {
|
|
8019
|
+
value: 1,
|
|
8020
|
+
message: mergedErrors.minAge
|
|
8021
|
+
},
|
|
8022
|
+
max: {
|
|
8023
|
+
value: 150,
|
|
8024
|
+
message: mergedErrors.maxAge
|
|
8025
|
+
}
|
|
8026
|
+
}
|
|
8027
|
+
}
|
|
8028
|
+
),
|
|
8029
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8030
|
+
InputDynamic_default,
|
|
8031
|
+
{
|
|
8032
|
+
name: "cityId",
|
|
8033
|
+
control,
|
|
8034
|
+
type: "select",
|
|
8035
|
+
label: mergedLabels.cityLabel,
|
|
8036
|
+
options: cityOptions,
|
|
8037
|
+
placeholder: mergedLabels.cityPlaceholder,
|
|
8038
|
+
size: "large",
|
|
8039
|
+
required: true,
|
|
8040
|
+
validationRules: {
|
|
8041
|
+
required: mergedErrors.requiredCity
|
|
8042
|
+
}
|
|
8043
|
+
}
|
|
8044
|
+
),
|
|
7979
8045
|
isAdultForm ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7980
8046
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7981
8047
|
InputDynamic_default,
|
|
@@ -7985,7 +8051,7 @@ var ModalPassengerForm = ({
|
|
|
7985
8051
|
type: "select",
|
|
7986
8052
|
label: mergedLabels.idTypeLabel,
|
|
7987
8053
|
placeholder: mergedLabels.idTypePlaceholder,
|
|
7988
|
-
options:
|
|
8054
|
+
options: TYPE_OPTIONS,
|
|
7989
8055
|
size: "large",
|
|
7990
8056
|
required: true,
|
|
7991
8057
|
validationRules: {
|
|
@@ -7993,48 +8059,40 @@ var ModalPassengerForm = ({
|
|
|
7993
8059
|
}
|
|
7994
8060
|
}
|
|
7995
8061
|
),
|
|
7996
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8062
|
+
idType ? idType === "lainnya" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7997
8063
|
InputDynamic_default,
|
|
7998
8064
|
{
|
|
7999
8065
|
name: "idNumber",
|
|
8000
8066
|
control,
|
|
8001
|
-
type: "
|
|
8002
|
-
label: mergedLabels.
|
|
8003
|
-
placeholder: mergedLabels.
|
|
8067
|
+
type: "date",
|
|
8068
|
+
label: mergedLabels.idTypeOtherLabel,
|
|
8069
|
+
placeholder: mergedLabels.idTypeOtherPlaceholder,
|
|
8004
8070
|
size: "large",
|
|
8005
8071
|
required: true,
|
|
8072
|
+
max: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
8006
8073
|
validationRules: {
|
|
8007
|
-
required: mergedErrors.
|
|
8008
|
-
minLength: {
|
|
8009
|
-
value: 6,
|
|
8010
|
-
message: mergedErrors.minLengthIdNumber
|
|
8011
|
-
}
|
|
8074
|
+
required: mergedErrors.requiredDate
|
|
8012
8075
|
}
|
|
8013
8076
|
}
|
|
8014
|
-
)
|
|
8015
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8077
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8016
8078
|
InputDynamic_default,
|
|
8017
8079
|
{
|
|
8018
|
-
name: "
|
|
8080
|
+
name: "idNumber",
|
|
8019
8081
|
control,
|
|
8020
|
-
type: "number",
|
|
8021
|
-
label: mergedLabels.
|
|
8022
|
-
placeholder: mergedLabels.
|
|
8082
|
+
type: idType === "ktp" ? "number" : "text",
|
|
8083
|
+
label: mergedLabels.idNumberLabel,
|
|
8084
|
+
placeholder: mergedLabels.idNumberPlaceholder,
|
|
8023
8085
|
size: "large",
|
|
8024
8086
|
required: true,
|
|
8025
8087
|
validationRules: {
|
|
8026
|
-
required: mergedErrors.
|
|
8027
|
-
|
|
8028
|
-
value:
|
|
8029
|
-
message: mergedErrors.
|
|
8030
|
-
},
|
|
8031
|
-
max: {
|
|
8032
|
-
value: 150,
|
|
8033
|
-
message: mergedErrors.maxAge
|
|
8088
|
+
required: mergedErrors.requiredIdNumber,
|
|
8089
|
+
minLength: {
|
|
8090
|
+
value: 6,
|
|
8091
|
+
message: mergedErrors.minLengthIdNumber
|
|
8034
8092
|
}
|
|
8035
8093
|
}
|
|
8036
8094
|
}
|
|
8037
|
-
)
|
|
8095
|
+
) : null
|
|
8038
8096
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8039
8097
|
InputDynamic_default,
|
|
8040
8098
|
{
|
|
@@ -8050,22 +8108,6 @@ var ModalPassengerForm = ({
|
|
|
8050
8108
|
}
|
|
8051
8109
|
}
|
|
8052
8110
|
) }),
|
|
8053
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8054
|
-
InputDynamic_default,
|
|
8055
|
-
{
|
|
8056
|
-
name: "cityId",
|
|
8057
|
-
control,
|
|
8058
|
-
type: "select",
|
|
8059
|
-
label: mergedLabels.cityLabel,
|
|
8060
|
-
options: cityOptions,
|
|
8061
|
-
placeholder: mergedLabels.cityPlaceholder,
|
|
8062
|
-
size: "large",
|
|
8063
|
-
required: true,
|
|
8064
|
-
validationRules: {
|
|
8065
|
-
required: mergedErrors.requiredCity
|
|
8066
|
-
}
|
|
8067
|
-
}
|
|
8068
|
-
),
|
|
8069
8111
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
8070
8112
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, {}),
|
|
8071
8113
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|