@asdp/ferryui 0.1.22-dev.8663 → 0.1.22-dev.8697

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
@@ -1871,6 +1871,69 @@ var DEFAULT_LABELS7 = {
1871
1871
  emailOrPhoneRequiredError: "Email or phone number is required"
1872
1872
  }
1873
1873
  };
1874
+
1875
+ // src/components/InputDynamic/countries.constants.ts
1876
+ var COUNTRIES = [
1877
+ { value: "ID", label: "Indonesia", flag: "twemoji:flag-indonesia" },
1878
+ { value: "MY", label: "Malaysia", flag: "twemoji:flag-malaysia" },
1879
+ { value: "SG", label: "Singapore", flag: "twemoji:flag-singapore" },
1880
+ { value: "TH", label: "Thailand", flag: "twemoji:flag-thailand" },
1881
+ { value: "PH", label: "Philippines", flag: "twemoji:flag-philippines" },
1882
+ { value: "VN", label: "Vietnam", flag: "twemoji:flag-vietnam" },
1883
+ { value: "BN", label: "Brunei", flag: "twemoji:flag-brunei" },
1884
+ { value: "KH", label: "Cambodia", flag: "twemoji:flag-cambodia" },
1885
+ { value: "LA", label: "Laos", flag: "twemoji:flag-laos" },
1886
+ { value: "MM", label: "Myanmar", flag: "twemoji:flag-myanmar-burma" },
1887
+ { value: "TL", label: "Timor-Leste", flag: "twemoji:flag-timor-leste" },
1888
+ // Major countries
1889
+ { value: "US", label: "United States", flag: "twemoji:flag-united-states" },
1890
+ { value: "GB", label: "United Kingdom", flag: "twemoji:flag-united-kingdom" },
1891
+ { value: "AU", label: "Australia", flag: "twemoji:flag-australia" },
1892
+ { value: "CN", label: "China", flag: "twemoji:flag-china" },
1893
+ { value: "JP", label: "Japan", flag: "twemoji:flag-japan" },
1894
+ { value: "KR", label: "South Korea", flag: "twemoji:flag-south-korea" },
1895
+ { value: "IN", label: "India", flag: "twemoji:flag-india" },
1896
+ { value: "SA", label: "Saudi Arabia", flag: "twemoji:flag-saudi-arabia" },
1897
+ { value: "AE", label: "United Arab Emirates", flag: "twemoji:flag-united-arab-emirates" },
1898
+ { value: "QA", label: "Qatar", flag: "twemoji:flag-qatar" },
1899
+ // European countries
1900
+ { value: "DE", label: "Germany", flag: "twemoji:flag-germany" },
1901
+ { value: "FR", label: "France", flag: "twemoji:flag-france" },
1902
+ { value: "IT", label: "Italy", flag: "twemoji:flag-italy" },
1903
+ { value: "ES", label: "Spain", flag: "twemoji:flag-spain" },
1904
+ { value: "NL", label: "Netherlands", flag: "twemoji:flag-netherlands" },
1905
+ { value: "BE", label: "Belgium", flag: "twemoji:flag-belgium" },
1906
+ { value: "CH", label: "Switzerland", flag: "twemoji:flag-switzerland" },
1907
+ { value: "AT", label: "Austria", flag: "twemoji:flag-austria" },
1908
+ { value: "SE", label: "Sweden", flag: "twemoji:flag-sweden" },
1909
+ { value: "NO", label: "Norway", flag: "twemoji:flag-norway" },
1910
+ { value: "DK", label: "Denmark", flag: "twemoji:flag-denmark" },
1911
+ { value: "FI", label: "Finland", flag: "twemoji:flag-finland" },
1912
+ { value: "PL", label: "Poland", flag: "twemoji:flag-poland" },
1913
+ { value: "RU", label: "Russia", flag: "twemoji:flag-russia" },
1914
+ { value: "TR", label: "Turkey", flag: "twemoji:flag-turkey" },
1915
+ { value: "GR", label: "Greece", flag: "twemoji:flag-greece" },
1916
+ { value: "PT", label: "Portugal", flag: "twemoji:flag-portugal" },
1917
+ { value: "IE", label: "Ireland", flag: "twemoji:flag-ireland" },
1918
+ // Americas
1919
+ { value: "CA", label: "Canada", flag: "twemoji:flag-canada" },
1920
+ { value: "MX", label: "Mexico", flag: "twemoji:flag-mexico" },
1921
+ { value: "BR", label: "Brazil", flag: "twemoji:flag-brazil" },
1922
+ { value: "AR", label: "Argentina", flag: "twemoji:flag-argentina" },
1923
+ { value: "CL", label: "Chile", flag: "twemoji:flag-chile" },
1924
+ { value: "CO", label: "Colombia", flag: "twemoji:flag-colombia" },
1925
+ { value: "PE", label: "Peru", flag: "twemoji:flag-peru" },
1926
+ // Africa
1927
+ { value: "ZA", label: "South Africa", flag: "twemoji:flag-south-africa" },
1928
+ { value: "EG", label: "Egypt", flag: "twemoji:flag-egypt" },
1929
+ { value: "NG", label: "Nigeria", flag: "twemoji:flag-nigeria" },
1930
+ { value: "KE", label: "Kenya", flag: "twemoji:flag-kenya" },
1931
+ { value: "MA", label: "Morocco", flag: "twemoji:flag-morocco" },
1932
+ // Oceania
1933
+ { value: "NZ", label: "New Zealand", flag: "twemoji:flag-new-zealand" },
1934
+ { value: "FJ", label: "Fiji", flag: "twemoji:flag-fiji" },
1935
+ { value: "PG", label: "Papua New Guinea", flag: "twemoji:flag-papua-new-guinea" }
1936
+ ];
1874
1937
  var PhoneInput = PhoneInputComponent.default || PhoneInputComponent;
1875
1938
  var useStyles7 = makeStyles({
1876
1939
  field: {
@@ -2027,7 +2090,7 @@ var useStyles7 = makeStyles({
2027
2090
  display: "none"
2028
2091
  },
2029
2092
  "& .fui-Radio__label": {
2030
- padding: "10px 24px",
2093
+ padding: "5px 10px",
2031
2094
  border: `1px solid ${tokens.colorNeutralStroke1}`,
2032
2095
  borderRadius: tokens.borderRadiusCircular,
2033
2096
  cursor: "pointer",
@@ -2115,7 +2178,8 @@ var InputDynamic = ({
2115
2178
  contentAfter,
2116
2179
  onChange,
2117
2180
  language = "id",
2118
- labels
2181
+ labels,
2182
+ menuPlacement
2119
2183
  }) => {
2120
2184
  const styles = useStyles7();
2121
2185
  const mergedLabels = { ...DEFAULT_LABELS7[language], ...labels };
@@ -2132,74 +2196,125 @@ var InputDynamic = ({
2132
2196
  const emailOrPhoneInputRef = useRef(null);
2133
2197
  const shouldFocusRef = useRef(false);
2134
2198
  const isBackspaceNavigationRef = useRef(false);
2135
- const getSelectStyles = (hasError2) => ({
2136
- menuPortal: (base) => ({
2137
- ...base,
2138
- zIndex: 9999999,
2139
- borderRadius: tokens.borderRadiusMedium
2140
- }),
2141
- control: (provided, state) => ({
2142
- ...provided,
2143
- borderColor: hasError2 ? tokens.colorPaletteRedBorder2 : state.isFocused ? tokens.colorBrandStroke1 : tokens.colorNeutralStroke1,
2144
- borderRadius: tokens.borderRadiusMedium,
2145
- minHeight: "40px",
2146
- fontSize: tokens.fontSizeBase400,
2147
- backgroundColor: tokens.colorNeutralBackground1,
2148
- boxShadow: state.isFocused ? `0 0 0 2px ${hasError2 ? tokens.colorPaletteRedBorder2 : tokens.colorBrandStroke1}` : "none",
2149
- "&:hover": {
2150
- borderColor: hasError2 ? tokens.colorPaletteRedBorder2 : tokens.colorNeutralStroke1Hover
2199
+ const getSelectStyles = (hasError2, selectAppearance) => {
2200
+ const currentAppearance = appearance || "outline";
2201
+ const getControlStyles = (provided, state) => {
2202
+ const baseStyles = {
2203
+ ...provided,
2204
+ minHeight: "40px",
2205
+ fontSize: tokens.fontSizeBase400,
2206
+ transition: "all 0.2s ease"
2207
+ };
2208
+ if (currentAppearance === "outline") {
2209
+ return {
2210
+ ...baseStyles,
2211
+ border: `1px solid ${hasError2 ? tokens.colorPaletteRedBorder2 : tokens.colorNeutralStroke1}`,
2212
+ borderBottom: `1px solid ${hasError2 ? tokens.colorPaletteRedBorder2 : state.isFocused ? tokens.colorBrandStroke1 : tokens.colorNeutralForeground3}`,
2213
+ borderRadius: tokens.borderRadiusMedium,
2214
+ backgroundColor: tokens.colorNeutralBackground1,
2215
+ boxShadow: "none",
2216
+ "&:hover": {
2217
+ borderColor: hasError2 ? tokens.colorPaletteRedBorder2 : tokens.colorNeutralStroke1Hover,
2218
+ borderBottom: `1px solid ${hasError2 ? tokens.colorPaletteRedBorder2 : state.isFocused ? tokens.colorBrandStroke1 : tokens.colorNeutralForeground3Hover}`
2219
+ }
2220
+ };
2151
2221
  }
2152
- }),
2153
- menu: (provided) => ({
2154
- ...provided,
2155
- border: `1px solid ${tokens.colorNeutralStroke1}`,
2156
- borderRadius: tokens.borderRadiusMedium,
2157
- zIndex: 9999
2158
- }),
2159
- menuList: (provided) => ({
2160
- ...provided,
2161
- padding: 0,
2162
- // Opsional: bersihkan padding agar scrollbar mepet ke pinggir
2163
- maxHeight: "300px",
2164
- // Pastikan ada limit height agar scrollbar muncul
2165
- /* Targetkan Webkit Scrollbar di menuList */
2166
- "&::-webkit-scrollbar": {
2167
- width: "8px",
2168
- display: "block"
2169
- // Pastikan tampil
2170
- },
2171
- "&::-webkit-scrollbar-track": {
2172
- backgroundColor: tokens.colorNeutralBackground2,
2173
- borderRadius: "4px"
2174
- },
2175
- "&::-webkit-scrollbar-thumb": {
2176
- backgroundColor: selectScrollbarColor || tokens.colorNeutralStroke2,
2177
- borderRadius: "4px"
2178
- },
2179
- "&::-webkit-scrollbar-thumb:hover": {
2180
- backgroundColor: selectScrollbarColor || tokens.colorBrandBackground
2181
- },
2182
- "&::-webkit-scrollbar-thumb:active": {
2183
- backgroundColor: selectScrollbarColor || tokens.colorBrandBackgroundPressed
2222
+ if (currentAppearance === "underline") {
2223
+ return {
2224
+ ...baseStyles,
2225
+ border: "none",
2226
+ borderBottom: `1px solid ${hasError2 ? tokens.colorPaletteRedBorder2 : state.isFocused ? tokens.colorBrandStroke1 : tokens.colorNeutralForeground3}`,
2227
+ borderRadius: 0,
2228
+ backgroundColor: "transparent",
2229
+ boxShadow: "none",
2230
+ "&:hover": {
2231
+ borderBottom: `1px solid ${hasError2 ? tokens.colorPaletteRedBorder2 : tokens.colorNeutralForeground3Hover}`
2232
+ }
2233
+ };
2184
2234
  }
2185
- }),
2186
- option: (provided, state) => ({
2187
- ...provided,
2188
- fontSize: tokens.fontSizeBase300,
2189
- color: state.isSelected ? tokens.colorNeutralForegroundOnBrand : tokens.colorNeutralForeground1,
2190
- backgroundColor: state.isSelected ? tokens.colorBrandBackground : state.isFocused ? tokens.colorNeutralBackground1Hover : "transparent"
2191
- }),
2192
- placeholder: (provided) => ({
2193
- ...provided,
2194
- color: tokens.colorNeutralForeground3,
2195
- fontSize: tokens.fontSizeBase400
2196
- }),
2197
- singleValue: (provided) => ({
2198
- ...provided,
2199
- color: tokens.colorNeutralForeground1,
2200
- fontSize: tokens.fontSizeBase400
2201
- })
2202
- });
2235
+ if (currentAppearance === "filled-darker") {
2236
+ return {
2237
+ ...baseStyles,
2238
+ border: "none",
2239
+ borderBottom: `1px solid ${hasError2 ? tokens.colorPaletteRedBorder2 : state.isFocused ? tokens.colorBrandStroke1 : "transparent"}`,
2240
+ borderRadius: `${tokens.borderRadiusMedium} ${tokens.borderRadiusMedium} 0 0`,
2241
+ backgroundColor: tokens.colorNeutralBackground3,
2242
+ boxShadow: "none",
2243
+ "&:hover": {
2244
+ backgroundColor: tokens.colorNeutralBackground3Hover
2245
+ }
2246
+ };
2247
+ }
2248
+ if (currentAppearance === "filled-lighter") {
2249
+ return {
2250
+ ...baseStyles,
2251
+ border: "none",
2252
+ borderBottom: `1px solid ${hasError2 ? tokens.colorPaletteRedBorder2 : state.isFocused ? tokens.colorBrandStroke1 : "transparent"}`,
2253
+ borderRadius: `${tokens.borderRadiusMedium} ${tokens.borderRadiusMedium} 0 0`,
2254
+ backgroundColor: tokens.colorNeutralBackground1,
2255
+ boxShadow: "none",
2256
+ "&:hover": {
2257
+ backgroundColor: tokens.colorNeutralBackground1Hover
2258
+ }
2259
+ };
2260
+ }
2261
+ return baseStyles;
2262
+ };
2263
+ return {
2264
+ menuPortal: (base) => ({
2265
+ ...base,
2266
+ zIndex: 9999999,
2267
+ borderRadius: tokens.borderRadiusMedium
2268
+ }),
2269
+ control: getControlStyles,
2270
+ menu: (provided) => ({
2271
+ ...provided,
2272
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
2273
+ borderRadius: tokens.borderRadiusMedium,
2274
+ zIndex: 9999
2275
+ }),
2276
+ menuList: (provided) => ({
2277
+ ...provided,
2278
+ padding: 0,
2279
+ maxHeight: "300px",
2280
+ /* Targetkan Webkit Scrollbar di menuList */
2281
+ "&::-webkit-scrollbar": {
2282
+ width: "8px",
2283
+ display: "block"
2284
+ },
2285
+ "&::-webkit-scrollbar-track": {
2286
+ backgroundColor: tokens.colorNeutralBackground2,
2287
+ borderRadius: "4px"
2288
+ },
2289
+ "&::-webkit-scrollbar-thumb": {
2290
+ backgroundColor: selectScrollbarColor || tokens.colorNeutralStroke2,
2291
+ borderRadius: "4px"
2292
+ },
2293
+ "&::-webkit-scrollbar-thumb:hover": {
2294
+ backgroundColor: selectScrollbarColor || tokens.colorBrandBackground
2295
+ },
2296
+ "&::-webkit-scrollbar-thumb:active": {
2297
+ backgroundColor: selectScrollbarColor || tokens.colorBrandBackgroundPressed
2298
+ }
2299
+ }),
2300
+ option: (provided, state) => ({
2301
+ ...provided,
2302
+ fontSize: tokens.fontSizeBase300,
2303
+ color: state.isSelected ? tokens.colorNeutralForegroundOnBrand : tokens.colorNeutralForeground1,
2304
+ backgroundColor: state.isSelected ? tokens.colorBrandBackground : state.isFocused ? tokens.colorNeutralBackground1Hover : "transparent"
2305
+ }),
2306
+ placeholder: (provided) => ({
2307
+ ...provided,
2308
+ color: tokens.colorNeutralForeground3,
2309
+ fontSize: tokens.fontSizeBase400
2310
+ }),
2311
+ singleValue: (provided) => ({
2312
+ ...provided,
2313
+ color: tokens.colorNeutralForeground1,
2314
+ fontSize: tokens.fontSizeBase400
2315
+ })
2316
+ };
2317
+ };
2203
2318
  useEffect(() => {
2204
2319
  if (shouldFocusRef.current) {
2205
2320
  setTimeout(() => {
@@ -2524,7 +2639,42 @@ var InputDynamic = ({
2524
2639
  },
2525
2640
  getOptionLabel: (option) => option.label,
2526
2641
  getOptionValue: (option) => option.value,
2527
- isOptionDisabled: (option) => option.disabled || false
2642
+ isOptionDisabled: (option) => option.disabled || false,
2643
+ menuPlacement
2644
+ }
2645
+ );
2646
+ case "country":
2647
+ return /* @__PURE__ */ jsx(
2648
+ Select,
2649
+ {
2650
+ ...field,
2651
+ name: `${String(name)}_${Math.random().toString(36).substring(7)}`,
2652
+ isDisabled: disabled,
2653
+ placeholder: placeholder || "Select country",
2654
+ options: COUNTRIES,
2655
+ styles: getSelectStyles(!!error),
2656
+ className: styles.reactSelect,
2657
+ classNamePrefix: "react-select",
2658
+ inputProps: {
2659
+ autoComplete: "new-password",
2660
+ autoCorrect: "off",
2661
+ autoCapitalize: "off",
2662
+ spellCheck: "false"
2663
+ },
2664
+ value: COUNTRIES.find((country) => country.value === field.value) || null,
2665
+ onChange: (selectedOption) => {
2666
+ field.onChange(selectedOption ? selectedOption.value : "");
2667
+ if (onChange) {
2668
+ onChange(selectedOption ? selectedOption.value : "");
2669
+ }
2670
+ },
2671
+ getOptionLabel: (option) => option.label,
2672
+ getOptionValue: (option) => option.value,
2673
+ formatOptionLabel: (option) => /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2674
+ /* @__PURE__ */ jsx(Icon, { icon: option.flag, width: 20, height: 20 }),
2675
+ /* @__PURE__ */ jsx("span", { children: option.label })
2676
+ ] }),
2677
+ menuPlacement
2528
2678
  }
2529
2679
  );
2530
2680
  case "phone": {
@@ -2973,248 +3123,6 @@ var InputDynamic = ({
2973
3123
  };
2974
3124
  var InputDynamic_default = InputDynamic;
2975
3125
 
2976
- // src/components/InputDynamic/constants.ts
2977
- var DEFAULT_COUNTRY_CODES = [
2978
- { code: "AF", name: "Afghanistan", dialCode: "+93", passportRegex: "^[A-Z][0-9]{7}$" },
2979
- { code: "AL", name: "Albania", dialCode: "+355", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2980
- { code: "DZ", name: "Algeria", dialCode: "+213", passportRegex: "^[0-9]{9}$" },
2981
- { code: "AS", name: "American Samoa", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
2982
- { code: "AD", name: "Andorra", dialCode: "+376", passportRegex: "^[A-Z0-9]{6,10}$" },
2983
- { code: "AO", name: "Angola", dialCode: "+244", passportRegex: "^[A-Z0-9]{6,10}$" },
2984
- { code: "AI", name: "Anguilla", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
2985
- { code: "AQ", name: "Antarctica", dialCode: "+672", passportRegex: "^[A-Z0-9]{6,10}$" },
2986
- { code: "AG", name: "Antigua and Barbuda", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2987
- { code: "AR", name: "Argentina", dialCode: "+54", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
2988
- { code: "AM", name: "Armenia", dialCode: "+374", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2989
- { code: "AW", name: "Aruba", dialCode: "+297", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
2990
- { code: "AU", name: "Australia", dialCode: "+61", passportRegex: "^[A-Z][0-9]{7}$" },
2991
- { code: "AT", name: "Austria", dialCode: "+43", passportRegex: "^[A-Z0-9]{8}$" },
2992
- { code: "AZ", name: "Azerbaijan", dialCode: "+994", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2993
- { code: "BS", name: "Bahamas", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2994
- { code: "BH", name: "Bahrain", dialCode: "+973", passportRegex: "^[A-Z][0-9]{7}$" },
2995
- { code: "BD", name: "Bangladesh", dialCode: "+880", passportRegex: "^[A-Z][0-9]{7}$" },
2996
- { code: "BB", name: "Barbados", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2997
- { code: "BY", name: "Belarus", dialCode: "+375", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2998
- { code: "BE", name: "Belgium", dialCode: "+32", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
2999
- { code: "BZ", name: "Belize", dialCode: "+501", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3000
- { code: "BJ", name: "Benin", dialCode: "+229", passportRegex: "^[A-Z0-9]{6,10}$" },
3001
- { code: "BM", name: "Bermuda", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
3002
- { code: "BT", name: "Bhutan", dialCode: "+975", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3003
- { code: "BO", name: "Bolivia", dialCode: "+591", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3004
- {
3005
- code: "BA",
3006
- name: "Bosnia and Herzegovina",
3007
- dialCode: "+387",
3008
- passportRegex: "^[A-Z]{2}[0-9]{6}$"
3009
- },
3010
- { code: "BW", name: "Botswana", dialCode: "+267", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3011
- { code: "BR", name: "Brazil", dialCode: "+55", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3012
- { code: "BN", name: "Brunei", dialCode: "+673", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3013
- { code: "BG", name: "Bulgaria", dialCode: "+359", passportRegex: "^[0-9]{9}$" },
3014
- { code: "BF", name: "Burkina Faso", dialCode: "+226", passportRegex: "^[A-Z0-9]{6,10}$" },
3015
- { code: "BI", name: "Burundi", dialCode: "+257", passportRegex: "^[A-Z0-9]{6,10}$" },
3016
- { code: "KH", name: "Cambodia", dialCode: "+855", passportRegex: "^[A-Z][0-9]{7}$" },
3017
- { code: "CM", name: "Cameroon", dialCode: "+237", passportRegex: "^[A-Z0-9]{6,10}$" },
3018
- { code: "CA", name: "Canada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3019
- { code: "CV", name: "Cape Verde", dialCode: "+238", passportRegex: "^[A-Z0-9]{6,10}$" },
3020
- { code: "KY", name: "Cayman Islands", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
3021
- {
3022
- code: "CF",
3023
- name: "Central African Republic",
3024
- dialCode: "+236",
3025
- passportRegex: "^[A-Z0-9]{6,10}$"
3026
- },
3027
- { code: "TD", name: "Chad", dialCode: "+235", passportRegex: "^[A-Z0-9]{6,10}$" },
3028
- { code: "CL", name: "Chile", dialCode: "+56", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3029
- { code: "CN", name: "China", dialCode: "+86", passportRegex: "^[0-9]{9}$" },
3030
- { code: "CO", name: "Colombia", dialCode: "+57", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
3031
- { code: "KM", name: "Comoros", dialCode: "+269", passportRegex: "^[A-Z0-9]{6,10}$" },
3032
- { code: "CG", name: "Congo", dialCode: "+242", passportRegex: "^[A-Z0-9]{6,10}$" },
3033
- { code: "CR", name: "Costa Rica", dialCode: "+506", passportRegex: "^[A-Z0-9]{6,10}$" },
3034
- { code: "HR", name: "Croatia", dialCode: "+385", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
3035
- { code: "CU", name: "Cuba", dialCode: "+53", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3036
- { code: "CY", name: "Cyprus", dialCode: "+357", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3037
- { code: "CZ", name: "Czech Republic", dialCode: "+420", passportRegex: "^[0-9]{8}$" },
3038
- { code: "DK", name: "Denmark", dialCode: "+45", passportRegex: "^[A-Z0-9]{9}$" },
3039
- { code: "DJ", name: "Djibouti", dialCode: "+253", passportRegex: "^[A-Z0-9]{6,10}$" },
3040
- { code: "DM", name: "Dominica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3041
- { code: "DO", name: "Dominican Republic", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
3042
- { code: "EC", name: "Ecuador", dialCode: "+593", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3043
- { code: "EG", name: "Egypt", dialCode: "+20", passportRegex: "^[A-Z][0-9]{7}$" },
3044
- { code: "SV", name: "El Salvador", dialCode: "+503", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3045
- { code: "GQ", name: "Equatorial Guinea", dialCode: "+240", passportRegex: "^[A-Z0-9]{6,10}$" },
3046
- { code: "ER", name: "Eritrea", dialCode: "+291", passportRegex: "^[A-Z0-9]{6,10}$" },
3047
- { code: "EE", name: "Estonia", dialCode: "+372", passportRegex: "^[A-Z0-9]{8}$" },
3048
- { code: "SZ", name: "Eswatini", dialCode: "+268", passportRegex: "^[A-Z0-9]{6,10}$" },
3049
- { code: "ET", name: "Ethiopia", dialCode: "+251", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3050
- { code: "FJ", name: "Fiji", dialCode: "+679", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3051
- { code: "FI", name: "Finland", dialCode: "+358", passportRegex: "^[A-Z0-9]{9}$" },
3052
- { code: "FR", name: "France", dialCode: "+33", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3053
- { code: "GA", name: "Gabon", dialCode: "+241", passportRegex: "^[A-Z0-9]{6,10}$" },
3054
- { code: "GM", name: "Gambia", dialCode: "+220", passportRegex: "^[A-Z0-9]{6,10}$" },
3055
- { code: "GE", name: "Georgia", dialCode: "+995", passportRegex: "^[A-Z0-9]{8}$" },
3056
- { code: "DE", name: "Germany", dialCode: "+49", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3057
- { code: "GH", name: "Ghana", dialCode: "+233", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3058
- { code: "GR", name: "Greece", dialCode: "+30", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3059
- { code: "GD", name: "Grenada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3060
- { code: "GT", name: "Guatemala", dialCode: "+502", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
3061
- { code: "GN", name: "Guinea", dialCode: "+224", passportRegex: "^[A-Z0-9]{6,10}$" },
3062
- { code: "GW", name: "Guinea-Bissau", dialCode: "+245", passportRegex: "^[A-Z0-9]{6,10}$" },
3063
- { code: "GY", name: "Guyana", dialCode: "+592", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3064
- { code: "HT", name: "Haiti", dialCode: "+509", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3065
- { code: "HN", name: "Honduras", dialCode: "+504", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3066
- { code: "HK", name: "Hong Kong", dialCode: "+852", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3067
- { code: "HU", name: "Hungary", dialCode: "+36", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3068
- { code: "IS", name: "Iceland", dialCode: "+354", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3069
- { code: "IN", name: "India", dialCode: "+91", passportRegex: "^[A-Z][0-9]{7}$" },
3070
- { code: "ID", name: "Indonesia", dialCode: "+62", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3071
- { code: "IR", name: "Iran", dialCode: "+98", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3072
- { code: "IQ", name: "Iraq", dialCode: "+964", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3073
- { code: "IE", name: "Ireland", dialCode: "+353", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
3074
- { code: "IL", name: "Israel", dialCode: "+972", passportRegex: "^[0-9]{8,9}$" },
3075
- { code: "IT", name: "Italy", dialCode: "+39", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3076
- { code: "JM", name: "Jamaica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3077
- { code: "JP", name: "Japan", dialCode: "+81", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3078
- { code: "JO", name: "Jordan", dialCode: "+962", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3079
- { code: "KZ", name: "Kazakhstan", dialCode: "+7", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3080
- { code: "KE", name: "Kenya", dialCode: "+254", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3081
- { code: "KI", name: "Kiribati", dialCode: "+686", passportRegex: "^[A-Z0-9]{6,10}$" },
3082
- { code: "KP", name: "North Korea", dialCode: "+850", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3083
- { code: "KR", name: "South Korea", dialCode: "+82", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
3084
- { code: "KW", name: "Kuwait", dialCode: "+965", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3085
- { code: "KG", name: "Kyrgyzstan", dialCode: "+996", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3086
- { code: "LA", name: "Laos", dialCode: "+856", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3087
- { code: "LV", name: "Latvia", dialCode: "+371", passportRegex: "^[A-Z0-9]{8}$" },
3088
- { code: "LB", name: "Lebanon", dialCode: "+961", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3089
- { code: "LS", name: "Lesotho", dialCode: "+266", passportRegex: "^[A-Z0-9]{6,10}$" },
3090
- { code: "LR", name: "Liberia", dialCode: "+231", passportRegex: "^[A-Z0-9]{6,10}$" },
3091
- { code: "LY", name: "Libya", dialCode: "+218", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3092
- { code: "LI", name: "Liechtenstein", dialCode: "+423", passportRegex: "^[A-Z0-9]{6,10}$" },
3093
- { code: "LT", name: "Lithuania", dialCode: "+370", passportRegex: "^[A-Z0-9]{8}$" },
3094
- { code: "LU", name: "Luxembourg", dialCode: "+352", passportRegex: "^[A-Z0-9]{8}$" },
3095
- { code: "MO", name: "Macau", dialCode: "+853", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3096
- { code: "MG", name: "Madagascar", dialCode: "+261", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3097
- { code: "MW", name: "Malawi", dialCode: "+265", passportRegex: "^[A-Z0-9]{6,10}$" },
3098
- { code: "MY", name: "Malaysia", dialCode: "+60", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
3099
- { code: "MV", name: "Maldives", dialCode: "+960", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3100
- { code: "ML", name: "Mali", dialCode: "+223", passportRegex: "^[A-Z0-9]{6,10}$" },
3101
- { code: "MT", name: "Malta", dialCode: "+356", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3102
- { code: "MH", name: "Marshall Islands", dialCode: "+692", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3103
- { code: "MQ", name: "Martinique", dialCode: "+596", passportRegex: "^[A-Z0-9]{6,10}$" },
3104
- { code: "MR", name: "Mauritania", dialCode: "+222", passportRegex: "^[A-Z0-9]{6,10}$" },
3105
- { code: "MU", name: "Mauritius", dialCode: "+230", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3106
- { code: "MX", name: "Mexico", dialCode: "+52", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
3107
- { code: "FM", name: "Micronesia", dialCode: "+691", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3108
- { code: "MD", name: "Moldova", dialCode: "+373", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3109
- { code: "MC", name: "Monaco", dialCode: "+377", passportRegex: "^[A-Z0-9]{6,10}$" },
3110
- { code: "MN", name: "Mongolia", dialCode: "+976", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3111
- { code: "ME", name: "Montenegro", dialCode: "+382", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3112
- { code: "MS", name: "Montserrat", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
3113
- { code: "MA", name: "Morocco", dialCode: "+212", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3114
- { code: "MZ", name: "Mozambique", dialCode: "+258", passportRegex: "^[A-Z0-9]{6,10}$" },
3115
- { code: "MM", name: "Myanmar", dialCode: "+95", passportRegex: "^[A-Z]{1}[0-9]{6,7}$" },
3116
- { code: "NA", name: "Namibia", dialCode: "+264", passportRegex: "^[A-Z0-9]{6,10}$" },
3117
- { code: "NR", name: "Nauru", dialCode: "+674", passportRegex: "^[A-Z0-9]{6,10}$" },
3118
- { code: "NP", name: "Nepal", dialCode: "+977", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3119
- { code: "NL", name: "Netherlands", dialCode: "+31", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3120
- { code: "NC", name: "New Caledonia", dialCode: "+687", passportRegex: "^[A-Z0-9]{6,10}$" },
3121
- { code: "NZ", name: "New Zealand", dialCode: "+64", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3122
- { code: "NI", name: "Nicaragua", dialCode: "+505", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
3123
- { code: "NE", name: "Niger", dialCode: "+227", passportRegex: "^[A-Z0-9]{6,10}$" },
3124
- { code: "NG", name: "Nigeria", dialCode: "+234", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3125
- { code: "NO", name: "Norway", dialCode: "+47", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3126
- { code: "OM", name: "Oman", dialCode: "+968", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3127
- { code: "PK", name: "Pakistan", dialCode: "+92", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3128
- { code: "PW", name: "Palau", dialCode: "+680", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3129
- { code: "PS", name: "Palestine", dialCode: "+970", passportRegex: "^[A-Z0-9]{6,10}$" },
3130
- { code: "PA", name: "Panama", dialCode: "+507", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3131
- { code: "PG", name: "Papua New Guinea", dialCode: "+675", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3132
- { code: "PY", name: "Paraguay", dialCode: "+595", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3133
- { code: "PE", name: "Peru", dialCode: "+51", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3134
- { code: "PH", name: "Philippines", dialCode: "+63", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3135
- { code: "PL", name: "Poland", dialCode: "+48", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
3136
- { code: "PT", name: "Portugal", dialCode: "+351", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3137
- { code: "RO", name: "Romania", dialCode: "+40", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3138
- { code: "RU", name: "Russia", dialCode: "+7", passportRegex: "^[0-9]{9}$" },
3139
- { code: "RW", name: "Rwanda", dialCode: "+250", passportRegex: "^[A-Z0-9]{6,10}$" },
3140
- {
3141
- code: "KN",
3142
- name: "Saint Kitts and Nevis",
3143
- dialCode: "+1",
3144
- passportRegex: "^[A-Z]{2}[0-9]{7}$"
3145
- },
3146
- { code: "LC", name: "Saint Lucia", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3147
- {
3148
- code: "VC",
3149
- name: "Saint Vincent and the Grenadines",
3150
- dialCode: "+1",
3151
- passportRegex: "^[A-Z]{2}[0-9]{7}$"
3152
- },
3153
- { code: "WS", name: "Samoa", dialCode: "+685", passportRegex: "^[A-Z0-9]{6,10}$" },
3154
- { code: "SM", name: "San Marino", dialCode: "+378", passportRegex: "^[A-Z0-9]{6,10}$" },
3155
- {
3156
- code: "ST",
3157
- name: "Sao Tome and Principe",
3158
- dialCode: "+239",
3159
- passportRegex: "^[A-Z0-9]{6,10}$"
3160
- },
3161
- { code: "SA", name: "Saudi Arabia", dialCode: "+966", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3162
- { code: "SN", name: "Senegal", dialCode: "+221", passportRegex: "^[A-Z0-9]{6,10}$" },
3163
- { code: "RS", name: "Serbia", dialCode: "+381", passportRegex: "^[A-Z0-9]{9}$" },
3164
- { code: "SC", name: "Seychelles", dialCode: "+248", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3165
- { code: "SL", name: "Sierra Leone", dialCode: "+232", passportRegex: "^[A-Z0-9]{6,10}$" },
3166
- { code: "SG", name: "Singapore", dialCode: "+65", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3167
- { code: "SK", name: "Slovakia", dialCode: "+421", passportRegex: "^[0-9]{9}$" },
3168
- { code: "SI", name: "Slovenia", dialCode: "+386", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3169
- { code: "SB", name: "Solomon Islands", dialCode: "+677", passportRegex: "^[A-Z0-9]{6,10}$" },
3170
- { code: "SO", name: "Somalia", dialCode: "+252", passportRegex: "^[A-Z0-9]{6,10}$" },
3171
- { code: "ZA", name: "South Africa", dialCode: "+27", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3172
- { code: "ES", name: "Spain", dialCode: "+34", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
3173
- { code: "LK", name: "Sri Lanka", dialCode: "+94", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3174
- { code: "SD", name: "Sudan", dialCode: "+249", passportRegex: "^[A-Z0-9]{6,10}$" },
3175
- { code: "SR", name: "Suriname", dialCode: "+597", passportRegex: "^[A-Z0-9]{6,10}$" },
3176
- { code: "SE", name: "Sweden", dialCode: "+46", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3177
- { code: "CH", name: "Switzerland", dialCode: "+41", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3178
- { code: "SY", name: "Syria", dialCode: "+963", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3179
- { code: "TW", name: "Taiwan", dialCode: "+886", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
3180
- { code: "TJ", name: "Tajikistan", dialCode: "+992", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3181
- { code: "TZ", name: "Tanzania", dialCode: "+255", passportRegex: "^[A-Z0-9]{6,10}$" },
3182
- { code: "TH", name: "Thailand", dialCode: "+66", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3183
- { code: "TL", name: "Timor-Leste", dialCode: "+670", passportRegex: "^[A-Z0-9]{6,10}$" },
3184
- { code: "TG", name: "Togo", dialCode: "+228", passportRegex: "^[A-Z0-9]{6,10}$" },
3185
- { code: "TO", name: "Tonga", dialCode: "+676", passportRegex: "^[A-Z0-9]{6,10}$" },
3186
- { code: "TT", name: "Trinidad and Tobago", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3187
- { code: "TN", name: "Tunisia", dialCode: "+216", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3188
- { code: "TR", name: "Turkey", dialCode: "+90", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3189
- { code: "TM", name: "Turkmenistan", dialCode: "+993", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3190
- {
3191
- code: "TC",
3192
- name: "Turks and Caicos Islands",
3193
- dialCode: "+1",
3194
- passportRegex: "^[A-Z0-9]{6,10}$"
3195
- },
3196
- { code: "TV", name: "Tuvalu", dialCode: "+688", passportRegex: "^[A-Z0-9]{6,10}$" },
3197
- { code: "UG", name: "Uganda", dialCode: "+256", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3198
- { code: "UA", name: "Ukraine", dialCode: "+380", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
3199
- {
3200
- code: "AE",
3201
- name: "United Arab Emirates",
3202
- dialCode: "+971",
3203
- passportRegex: "^[A-Z]{1}[0-9]{7}$"
3204
- },
3205
- { code: "GB", name: "United Kingdom", dialCode: "+44", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3206
- { code: "US", name: "United States", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
3207
- { code: "UY", name: "Uruguay", dialCode: "+598", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
3208
- { code: "UZ", name: "Uzbekistan", dialCode: "+998", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3209
- { code: "VU", name: "Vanuatu", dialCode: "+678", passportRegex: "^[A-Z0-9]{6,10}$" },
3210
- { code: "VA", name: "Vatican City", dialCode: "+379", passportRegex: "^[A-Z0-9]{6,10}$" },
3211
- { code: "VE", name: "Venezuela", dialCode: "+58", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
3212
- { code: "VN", name: "Vietnam", dialCode: "+84", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3213
- { code: "YE", name: "Yemen", dialCode: "+967", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
3214
- { code: "ZM", name: "Zambia", dialCode: "+260", passportRegex: "^[A-Z0-9]{6,10}$" },
3215
- { code: "ZW", name: "Zimbabwe", dialCode: "+263", passportRegex: "^[A-Z0-9]{6,10}$" }
3216
- ];
3217
-
3218
3126
  // src/components/CardTicketSearch/CardTicketSearch.constants.ts
3219
3127
  var DEFAULT_LABELS8 = {
3220
3128
  id: {
@@ -7819,6 +7727,10 @@ var DEFAULT_LABELS22 = {
7819
7727
  ticketClassLabel: "Kelas penumpang",
7820
7728
  saveButton: "Simpan",
7821
7729
  cancelButton: "Batal",
7730
+ idTypeOtherLabel: "Tanggal lahir",
7731
+ idTypeOtherPlaceholder: "DD/MM/YYYY",
7732
+ countryLabel: "Negara Penerbit Passport",
7733
+ countryPlaceholder: "Masukkan Negara",
7822
7734
  errors: {
7823
7735
  requiredTitle: "Title harus dipilih",
7824
7736
  requiredName: "Nama lengkap harus diisi",
@@ -7830,7 +7742,8 @@ var DEFAULT_LABELS22 = {
7830
7742
  minAge: "Usia minimal 1 tahun",
7831
7743
  maxAge: "Usia maksimal 150 tahun",
7832
7744
  requiredDate: "Tanggal lahir harus diisi",
7833
- requiredCity: "Kota/Kabupaten harus diisi"
7745
+ requiredCity: "Kota/Kabupaten harus diisi",
7746
+ requiredCountry: "Negara harus diisi"
7834
7747
  }
7835
7748
  },
7836
7749
  en: {
@@ -7852,6 +7765,10 @@ var DEFAULT_LABELS22 = {
7852
7765
  ticketClassLabel: "Passenger Class",
7853
7766
  saveButton: "Save",
7854
7767
  cancelButton: "Cancel",
7768
+ idTypeOtherLabel: "Date of Birth",
7769
+ idTypeOtherPlaceholder: "DD/MM/YYYY",
7770
+ countryLabel: "Country of Issue",
7771
+ countryPlaceholder: "Enter Country",
7855
7772
  errors: {
7856
7773
  requiredTitle: "Title is required",
7857
7774
  requiredName: "Full name is required",
@@ -7863,10 +7780,29 @@ var DEFAULT_LABELS22 = {
7863
7780
  minAge: "Age must be at least 1 year",
7864
7781
  maxAge: "Age must be at most 150 years",
7865
7782
  requiredDate: "Date of birth is required",
7866
- requiredCity: "City/Regency is required"
7783
+ requiredCity: "City/Regency is required",
7784
+ requiredCountry: "Country is required"
7867
7785
  }
7868
7786
  }
7869
7787
  };
7788
+ var TYPE_OPTIONS = [
7789
+ {
7790
+ label: "KTP",
7791
+ value: "ktp"
7792
+ },
7793
+ {
7794
+ label: "SIM",
7795
+ value: "sim"
7796
+ },
7797
+ {
7798
+ label: "Paspor",
7799
+ value: "paspor"
7800
+ },
7801
+ {
7802
+ label: "Lainnya",
7803
+ value: "lainnya"
7804
+ }
7805
+ ];
7870
7806
  var useStyles22 = makeStyles({
7871
7807
  dialogSurface: {
7872
7808
  maxWidth: "600px",
@@ -7895,7 +7831,6 @@ var ModalPassengerForm = ({
7895
7831
  defaultValues,
7896
7832
  isAdultForm = true,
7897
7833
  titleOptions,
7898
- idTypeOptions,
7899
7834
  cityOptions,
7900
7835
  ticketClassOptions
7901
7836
  }) => {
@@ -7906,12 +7841,18 @@ var ModalPassengerForm = ({
7906
7841
  ...labels?.errors
7907
7842
  };
7908
7843
  const displayTitle = title || mergedLabels.title;
7909
- const { control, handleSubmit, reset } = useForm({
7844
+ const { control, handleSubmit, reset, watch, setValue } = useForm({
7910
7845
  defaultValues
7911
7846
  });
7847
+ const idType = watch("idType");
7912
7848
  useEffect(() => {
7913
7849
  reset(defaultValues);
7914
7850
  }, [defaultValues, reset]);
7851
+ useEffect(() => {
7852
+ if (idType) {
7853
+ setValue("idNumber", "");
7854
+ }
7855
+ }, [idType, setValue]);
7915
7856
  const handleFormSubmit = (data) => {
7916
7857
  onSubmit(data);
7917
7858
  reset();
@@ -7967,6 +7908,45 @@ var ModalPassengerForm = ({
7967
7908
  }
7968
7909
  }
7969
7910
  ),
7911
+ /* @__PURE__ */ jsx(
7912
+ InputDynamic_default,
7913
+ {
7914
+ name: "age",
7915
+ control,
7916
+ type: "number",
7917
+ label: mergedLabels.ageLabel,
7918
+ placeholder: mergedLabels.agePlaceholder,
7919
+ size: "large",
7920
+ required: true,
7921
+ validationRules: {
7922
+ required: mergedErrors.requiredAge,
7923
+ min: {
7924
+ value: 1,
7925
+ message: mergedErrors.minAge
7926
+ },
7927
+ max: {
7928
+ value: 150,
7929
+ message: mergedErrors.maxAge
7930
+ }
7931
+ }
7932
+ }
7933
+ ),
7934
+ /* @__PURE__ */ jsx(
7935
+ InputDynamic_default,
7936
+ {
7937
+ name: "cityId",
7938
+ control,
7939
+ type: "select",
7940
+ label: mergedLabels.cityLabel,
7941
+ options: cityOptions,
7942
+ placeholder: mergedLabels.cityPlaceholder,
7943
+ size: "large",
7944
+ required: true,
7945
+ validationRules: {
7946
+ required: mergedErrors.requiredCity
7947
+ }
7948
+ }
7949
+ ),
7970
7950
  isAdultForm ? /* @__PURE__ */ jsxs(Fragment, { children: [
7971
7951
  /* @__PURE__ */ jsx(
7972
7952
  InputDynamic_default,
@@ -7976,7 +7956,7 @@ var ModalPassengerForm = ({
7976
7956
  type: "select",
7977
7957
  label: mergedLabels.idTypeLabel,
7978
7958
  placeholder: mergedLabels.idTypePlaceholder,
7979
- options: idTypeOptions,
7959
+ options: TYPE_OPTIONS,
7980
7960
  size: "large",
7981
7961
  required: true,
7982
7962
  validationRules: {
@@ -7984,48 +7964,43 @@ var ModalPassengerForm = ({
7984
7964
  }
7985
7965
  }
7986
7966
  ),
7987
- /* @__PURE__ */ jsx(
7967
+ idType ? idType === "lainnya" ? /* @__PURE__ */ jsx(
7988
7968
  InputDynamic_default,
7989
7969
  {
7990
7970
  name: "idNumber",
7991
7971
  control,
7992
- type: "text",
7993
- label: mergedLabels.idNumberLabel,
7994
- placeholder: mergedLabels.idNumberPlaceholder,
7972
+ type: "date",
7973
+ label: mergedLabels.idTypeOtherLabel,
7974
+ placeholder: mergedLabels.idTypeOtherPlaceholder,
7995
7975
  size: "large",
7996
7976
  required: true,
7977
+ max: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
7997
7978
  validationRules: {
7998
- required: mergedErrors.requiredIdNumber,
7999
- minLength: {
8000
- value: 6,
8001
- message: mergedErrors.minLengthIdNumber
8002
- }
7979
+ required: mergedErrors.requiredDate
8003
7980
  }
8004
7981
  }
8005
- ),
8006
- /* @__PURE__ */ 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
7982
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
7983
+ /* @__PURE__ */ jsx(
7984
+ InputDynamic_default,
7985
+ {
7986
+ name: "idNumber",
7987
+ control,
7988
+ type: idType === "ktp" ? "number" : "text",
7989
+ label: mergedLabels.idNumberLabel,
7990
+ placeholder: mergedLabels.idNumberPlaceholder,
7991
+ size: "large",
7992
+ required: true,
7993
+ validationRules: {
7994
+ required: mergedErrors.requiredIdNumber,
7995
+ minLength: {
7996
+ value: 6,
7997
+ message: mergedErrors.minLengthIdNumber
7998
+ }
8025
7999
  }
8026
8000
  }
8027
- }
8028
- )
8001
+ ),
8002
+ idType === "paspor" && /* @__PURE__ */ jsx(InputDynamic_default, { menuPlacement: "top", name: "country", control, type: "country", label: mergedLabels.countryLabel, placeholder: mergedLabels.countryPlaceholder, size: "large", required: true, validationRules: { required: mergedErrors.requiredCountry } })
8003
+ ] }) : null
8029
8004
  ] }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
8030
8005
  InputDynamic_default,
8031
8006
  {
@@ -8041,22 +8016,6 @@ var ModalPassengerForm = ({
8041
8016
  }
8042
8017
  }
8043
8018
  ) }),
8044
- /* @__PURE__ */ jsx(
8045
- InputDynamic_default,
8046
- {
8047
- name: "cityId",
8048
- control,
8049
- type: "select",
8050
- label: mergedLabels.cityLabel,
8051
- options: cityOptions,
8052
- placeholder: mergedLabels.cityPlaceholder,
8053
- size: "large",
8054
- required: true,
8055
- validationRules: {
8056
- required: mergedErrors.requiredCity
8057
- }
8058
- }
8059
- ),
8060
8019
  /* @__PURE__ */ jsx("br", {}),
8061
8020
  /* @__PURE__ */ jsx(Divider, {}),
8062
8021
  /* @__PURE__ */ jsx("br", {}),
@@ -11827,6 +11786,6 @@ var CardProfileMenu = ({
11827
11786
  ) });
11828
11787
  };
11829
11788
 
11830
- export { BackgroundTicketCard_default as BackgroundTicketCard, BackgroundTicketCardVertical_default as BackgroundTicketCardVertical, CardAddon, CardBanner, CardBookingTicket, CardFAQ, CardMealCatalog, CardOrdererInfo, CardPassengerList, CardPaymentGuide, CardPaymentInfo, CardPaymentMethodList, CardPriceDetails, CardProfileMenu, CardPromo, CardReview, CardReviewPassenger, CardServiceMenu, CardStatusOrder, CardTicket, CardTicketSearch, DEFAULT_LABELS8 as CardTicketSearchDefaultLabels, CardTicketSearchSummary, DEFAULT_LABELS9 as CardTicketSearchSummaryDefaultLabels, CardVehicleDetail, CardVehicleOwnerForm, CarouselWithCustomNav, DEFAULT_COUNTRY_CODES, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_CLASSES, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS17 as DateFilterDefaultLabels, InputDynamic_default as InputDynamic, MODAL_PRESETS, ModalFilterTicket, DEFAULT_LABELS16 as ModalFilterTicketDefaultLabels, ModalIllustration, ModalListPassenger, ModalPassengerForm, ModalPriceDetail, ModalSearchHarbor, ModalSearchTicket, ModalSelectDate, ModalService, ModalTotalPassengers, ModalTypeOfService, SortMenu, Stepper, getBadgeConfig, getModalPreset, getSortLabel };
11789
+ export { BackgroundTicketCard_default as BackgroundTicketCard, BackgroundTicketCardVertical_default as BackgroundTicketCardVertical, COUNTRIES, CardAddon, CardBanner, CardBookingTicket, CardFAQ, CardMealCatalog, CardOrdererInfo, CardPassengerList, CardPaymentGuide, CardPaymentInfo, CardPaymentMethodList, CardPriceDetails, CardProfileMenu, CardPromo, CardReview, CardReviewPassenger, CardServiceMenu, CardStatusOrder, CardTicket, CardTicketSearch, DEFAULT_LABELS8 as CardTicketSearchDefaultLabels, CardTicketSearchSummary, DEFAULT_LABELS9 as CardTicketSearchSummaryDefaultLabels, CardVehicleDetail, CardVehicleOwnerForm, CarouselWithCustomNav, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_CLASSES, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS17 as DateFilterDefaultLabels, InputDynamic_default as InputDynamic, MODAL_PRESETS, ModalFilterTicket, DEFAULT_LABELS16 as ModalFilterTicketDefaultLabels, ModalIllustration, ModalListPassenger, ModalPassengerForm, ModalPriceDetail, ModalSearchHarbor, ModalSearchTicket, ModalSelectDate, ModalService, ModalTotalPassengers, ModalTypeOfService, SortMenu, Stepper, getBadgeConfig, getModalPreset, getSortLabel };
11831
11790
  //# sourceMappingURL=index.mjs.map
11832
11791
  //# sourceMappingURL=index.mjs.map