@eeplatform/nuxt-layer-common 1.7.39 → 1.7.40

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eeplatform/nuxt-layer-common
2
2
 
3
+ ## 1.7.40
4
+
5
+ ### Patch Changes
6
+
7
+ - bb9a841: Update enrollment form input validations
8
+
3
9
  ## 1.7.39
4
10
 
5
11
  ### Patch Changes
@@ -767,9 +767,12 @@
767
767
  <v-row no-gutters>
768
768
  <InputLabel class="text-capitalize" title="Zip Code" />
769
769
  <v-col cols="12">
770
- <v-text-field
770
+ <v-mask-input
771
771
  v-model="enrollment.address.current.zipCode"
772
- ></v-text-field>
772
+ mask="####"
773
+ placeholder="e.g., 1000"
774
+ :rules="[validZipCode]"
775
+ ></v-mask-input>
773
776
  </v-col>
774
777
  </v-row>
775
778
  </v-col>
@@ -940,10 +943,13 @@
940
943
  <v-row no-gutters>
941
944
  <InputLabel class="text-capitalize" title="Zip Code" />
942
945
  <v-col cols="12">
943
- <v-text-field
946
+ <v-mask-input
944
947
  v-model="enrollment.address.permanent.zipCode"
945
948
  :readonly="sameAsCurrentAddress"
946
- ></v-text-field>
949
+ mask="####"
950
+ placeholder="e.g., 1000"
951
+ :rules="[validZipCode]"
952
+ ></v-mask-input>
947
953
  </v-col>
948
954
  </v-row>
949
955
  </v-col>
@@ -1469,7 +1475,20 @@ if (prop.school) {
1469
1475
 
1470
1476
  enrollment.value.createdBy = useCookie("user", cookieConfig).value ?? "";
1471
1477
 
1478
+ function validZipCode(value: string) {
1479
+ if (value && value.length < 4) {
1480
+ return "Zip code must be at least 4 digits.";
1481
+ }
1482
+ return true;
1483
+ }
1484
+
1472
1485
  function validContactNumber(value: string) {
1486
+ // Contact number must start with '09' and be followed by 9 digits
1487
+ const pattern = /^09\d{9}$/;
1488
+ if (value && !pattern.test(value)) {
1489
+ return "Contact number must start with '09' and be followed by 9 digits.";
1490
+ }
1491
+
1473
1492
  if (value && value.length < 11) {
1474
1493
  return "Contact number must be at least 11 digits.";
1475
1494
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@eeplatform/nuxt-layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.7.39",
5
+ "version": "1.7.40",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"