@eeplatform/nuxt-layer-common 1.7.39 → 1.7.41

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,18 @@
1
1
  # @eeplatform/nuxt-layer-common
2
2
 
3
+ ## 1.7.41
4
+
5
+ ### Patch Changes
6
+
7
+ - f3dafc4: Fix enrollment form gwa and subject validatioin
8
+ - 992133e: Fix enrollment validations
9
+
10
+ ## 1.7.40
11
+
12
+ ### Patch Changes
13
+
14
+ - bb9a841: Update enrollment form input validations
15
+
3
16
  ## 1.7.39
4
17
 
5
18
  ### Patch Changes
@@ -206,7 +206,7 @@
206
206
  <v-col cols="12">
207
207
  <v-text-field
208
208
  v-model.number="enrollment.gwa"
209
- :rules="[requiredRule, (v:any) => v >= selectedProgram.gwa || `Required GWA is equal or greater than ${selectedProgram.gwa}`]"
209
+ :rules="[requiredRule, (v:any) => v >= selectedProgram.gwa || `Required GWA is equal or greater than ${selectedProgram.gwa}`, (v:any) => v <= 100 || 'GWA must be less than or equal to 100']"
210
210
  type="number"
211
211
  ></v-text-field>
212
212
  </v-col>
@@ -240,6 +240,7 @@
240
240
  (v:any) =>
241
241
  v >= selectedProgram.subjects[programSubjectIndex].grade ||
242
242
  `Required grade is equal or greater than ${selectedProgram.subjects[programSubjectIndex].grade}`,
243
+ (v:any) => v <= 100 || 'Grade must be less than or equal to 100',
243
244
  ]"
244
245
  >
245
246
  </v-text-field>
@@ -767,9 +768,12 @@
767
768
  <v-row no-gutters>
768
769
  <InputLabel class="text-capitalize" title="Zip Code" />
769
770
  <v-col cols="12">
770
- <v-text-field
771
+ <v-mask-input
771
772
  v-model="enrollment.address.current.zipCode"
772
- ></v-text-field>
773
+ mask="####"
774
+ placeholder="e.g., 1000"
775
+ :rules="[validZipCode]"
776
+ ></v-mask-input>
773
777
  </v-col>
774
778
  </v-row>
775
779
  </v-col>
@@ -940,10 +944,13 @@
940
944
  <v-row no-gutters>
941
945
  <InputLabel class="text-capitalize" title="Zip Code" />
942
946
  <v-col cols="12">
943
- <v-text-field
947
+ <v-mask-input
944
948
  v-model="enrollment.address.permanent.zipCode"
945
949
  :readonly="sameAsCurrentAddress"
946
- ></v-text-field>
950
+ mask="####"
951
+ placeholder="e.g., 1000"
952
+ :rules="[validZipCode]"
953
+ ></v-mask-input>
947
954
  </v-col>
948
955
  </v-row>
949
956
  </v-col>
@@ -1469,7 +1476,20 @@ if (prop.school) {
1469
1476
 
1470
1477
  enrollment.value.createdBy = useCookie("user", cookieConfig).value ?? "";
1471
1478
 
1479
+ function validZipCode(value: string) {
1480
+ if (value && value.length < 4) {
1481
+ return "Zip code must be at least 4 digits.";
1482
+ }
1483
+ return true;
1484
+ }
1485
+
1472
1486
  function validContactNumber(value: string) {
1487
+ // Contact number must start with '09' and be followed by 9 digits
1488
+ const pattern = /^09\d{9}$/;
1489
+ if (value && !pattern.test(value)) {
1490
+ return "Contact number must start with '09' and be followed by 9 digits.";
1491
+ }
1492
+
1473
1493
  if (value && value.length < 11) {
1474
1494
  return "Contact number must be at least 11 digits.";
1475
1495
  }
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.41",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"