@eeplatform/nuxt-layer-common 1.4.1 → 1.4.3

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,17 @@
1
1
  # @eeplatform/nuxt-layer-common
2
2
 
3
+ ## 1.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 80b1f7f: Remove enrollment preset data
8
+
9
+ ## 1.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 75c5e38: Revise EnrollmentForm.vue implementation
14
+
3
15
  ## 1.4.1
4
16
 
5
17
  ### Patch Changes
@@ -7,7 +7,7 @@
7
7
  <InputLabel class="text-capitalize" title="Region" />
8
8
  <v-col cols="12">
9
9
  <v-autocomplete
10
- v-model="region"
10
+ v-model="enrollment.region"
11
11
  :items="regions"
12
12
  item-title="name"
13
13
  item-value="code"
@@ -23,7 +23,7 @@
23
23
  <InputLabel class="text-capitalize" title="Province" />
24
24
  <v-col cols="12">
25
25
  <v-autocomplete
26
- v-model="province"
26
+ v-model="enrollment.province"
27
27
  :items="provinces"
28
28
  item-title="name"
29
29
  item-value="code"
@@ -39,7 +39,7 @@
39
39
  <InputLabel class="text-capitalize" title="City/Municipality" />
40
40
  <v-col cols="12">
41
41
  <v-autocomplete
42
- v-model="cityMunicipality"
42
+ v-model="enrollment.cityMunicipality"
43
43
  :items="citiesMunicipalities"
44
44
  item-title="name"
45
45
  item-value="code"
@@ -60,7 +60,7 @@
60
60
  <InputLabel class="text-capitalize" title="School" required />
61
61
  <v-col cols="12">
62
62
  <v-combobox
63
- v-model="enrollment.school"
63
+ v-model="selectedSchool"
64
64
  v-model:search="searchSchool"
65
65
  :rules="[requiredRule]"
66
66
  :items="schools"
@@ -131,14 +131,14 @@
131
131
 
132
132
  <v-col cols="12">
133
133
  <v-checkbox
134
- v-model="returningLearner"
134
+ v-model="enrollment.returningLearner"
135
135
  label="Returning Learner(Balik-Aral)"
136
136
  hide-details
137
137
  density="compact"
138
138
  ></v-checkbox>
139
139
  </v-col>
140
140
 
141
- <v-col v-if="!returningLearner" cols="12">
141
+ <v-col v-if="!enrollment.returningLearner" cols="12">
142
142
  <v-row no-gutters>
143
143
  <v-col cols="12" class="mt-4">
144
144
  <v-row>
@@ -162,14 +162,14 @@
162
162
  <InputLabel
163
163
  class="text-capitalize"
164
164
  title="Leaner Reference Number"
165
- required
165
+ :required="enrollment.returningLearner"
166
166
  />
167
167
  <v-col cols="12">
168
- <v-text-field
169
- v-model="enrollment.learnerInfo.learnerReferenceNumber"
170
- :rules="[requiredRule]"
171
- type="number"
172
- ></v-text-field>
168
+ <v-mask-input
169
+ v-model="enrollment.learnerInfo.lrn"
170
+ :rules="enrollment.returningLearner ? [requiredRule] : []"
171
+ mask="####-####-####"
172
+ ></v-mask-input>
173
173
  </v-col>
174
174
  </v-row>
175
175
  </v-col>
@@ -309,6 +309,8 @@
309
309
  v-model="enrollment.learnerInfo.placeOfBirth"
310
310
  :rules="[requiredRule]"
311
311
  :items="citiesMunicipalities"
312
+ item-title="name"
313
+ items-value="name"
312
314
  :hide-no-data="false"
313
315
  >
314
316
  <template v-slot:no-data>
@@ -398,14 +400,14 @@
398
400
 
399
401
  <v-col cols="12">
400
402
  <v-checkbox
401
- v-model="withDisability"
403
+ v-model="enrollment.learnerInfo.withDisability"
402
404
  label="Learner with Disability"
403
405
  hide-details
404
406
  density="compact"
405
407
  ></v-checkbox>
406
408
  </v-col>
407
409
 
408
- <v-col v-if="withDisability" cols="12">
410
+ <v-col v-if="enrollment.learnerInfo.withDisability" cols="12">
409
411
  <v-row no-gutters>
410
412
  <v-col cols="12">
411
413
  <v-checkbox
@@ -1089,6 +1091,75 @@
1089
1091
  </v-col>
1090
1092
  </v-row>
1091
1093
  </v-col>
1094
+
1095
+ <v-col v-if="isSeniorHighSchool" cols="12" class="mt-2">
1096
+ <v-row no-gutters>
1097
+ <v-col cols="12">
1098
+ <span class="font-weight-bold text-subtitle-1">
1099
+ For Learners in Senior High School
1100
+ </span>
1101
+ </v-col>
1102
+
1103
+ <v-col v-if="enrollment.seniorHighInfo" cols="12">
1104
+ <v-row no-gutters>
1105
+ <v-col cols="12" class="mt-4">
1106
+ <v-row no-gutters>
1107
+ <InputLabel
1108
+ class="text-capitalize"
1109
+ title="Semester"
1110
+ required
1111
+ />
1112
+ <v-col cols="12">
1113
+ <v-radio-group
1114
+ v-model="enrollment.seniorHighInfo.semester"
1115
+ density="compact"
1116
+ >
1117
+ <v-radio label="1st" value="1st"></v-radio>
1118
+ <v-radio label="2nd" value="2nd"></v-radio>
1119
+ </v-radio-group>
1120
+ </v-col>
1121
+ </v-row>
1122
+ </v-col>
1123
+
1124
+ <v-col cols="12">
1125
+ <v-row>
1126
+ <v-col cols="4">
1127
+ <v-row no-gutters>
1128
+ <InputLabel
1129
+ class="text-capitalize"
1130
+ title="Track"
1131
+ required
1132
+ />
1133
+ <v-col cols="12">
1134
+ <v-autocomplete
1135
+ v-model="enrollment.seniorHighInfo.track"
1136
+ :items="tracks"
1137
+ ></v-autocomplete>
1138
+ </v-col>
1139
+ </v-row>
1140
+ </v-col>
1141
+
1142
+ <v-col cols="6">
1143
+ <v-row no-gutters>
1144
+ <InputLabel
1145
+ class="text-capitalize"
1146
+ title="Strand"
1147
+ required
1148
+ />
1149
+ <v-col cols="12">
1150
+ <v-autocomplete
1151
+ v-model="enrollment.seniorHighInfo.strand"
1152
+ :items="selectedTrackStrands"
1153
+ ></v-autocomplete>
1154
+ </v-col>
1155
+ </v-row>
1156
+ </v-col>
1157
+ </v-row>
1158
+ </v-col>
1159
+ </v-row>
1160
+ </v-col>
1161
+ </v-row>
1162
+ </v-col>
1092
1163
  </v-row>
1093
1164
  </v-col>
1094
1165
 
@@ -1215,6 +1286,10 @@ const prop = defineProps({
1215
1286
  import { VMaskInput } from "vuetify/labs/VMaskInput";
1216
1287
  const { requiredRule } = useUtils();
1217
1288
 
1289
+ const enrollment = defineModel<TBasicEducEnrForm>({
1290
+ default: () => useEnrollment().enrollment,
1291
+ });
1292
+
1218
1293
  const { getAll: getAllPSGC } = usePSGC();
1219
1294
 
1220
1295
  const region = ref("");
@@ -1307,6 +1382,8 @@ const searchSchool = ref("");
1307
1382
 
1308
1383
  const { getAll: getAllSchools } = useSchool();
1309
1384
 
1385
+ const selectedCity = computed(() => enrollment.value.cityMunicipality);
1386
+
1310
1387
  const psgcSchool = computed(() => {
1311
1388
  let prefix = "";
1312
1389
  if (region.value) {
@@ -1317,8 +1394,8 @@ const psgcSchool = computed(() => {
1317
1394
  prefix = province.value.slice(0, 5);
1318
1395
  }
1319
1396
 
1320
- if (cityMunicipality.value) {
1321
- prefix = cityMunicipality.value.slice(0, 7);
1397
+ if (selectedCity.value) {
1398
+ prefix = selectedCity.value.slice(0, 7);
1322
1399
  }
1323
1400
 
1324
1401
  return prefix;
@@ -1351,26 +1428,63 @@ watchEffect(() => {
1351
1428
  }
1352
1429
  });
1353
1430
 
1354
- const {
1355
- gradeLevels,
1356
- generateSchoolYears,
1357
- getPhilippineCities,
1358
- getPhilippineMunicipalities,
1359
- motherTongueOptions,
1360
- } = useBasicEdu();
1431
+ const selectedSchool = ref<TSchool>({
1432
+ id: "",
1433
+ name: "",
1434
+ });
1361
1435
 
1362
- const effectiveSchoolYearOptions = generateSchoolYears();
1363
- const lastSchoolYearOptions = generateSchoolYears(50).reverse();
1436
+ watch(selectedSchool, (val) => {
1437
+ if (val.id) {
1438
+ enrollment.value.school = val.id;
1439
+ }
1364
1440
 
1365
- const { data: citiesData } = await useLazyAsyncData("getCities", () =>
1366
- getPhilippineCities()
1367
- );
1441
+ enrollment.value.cityMunicipality = val.cityMunicipalityPSGC ?? "";
1442
+
1443
+ if (val.province) {
1444
+ enrollment.value.province = val.province;
1445
+ }
1446
+
1447
+ const regionPSGC = val.cityMunicipalityPSGC
1448
+ ? val.cityMunicipalityPSGC.slice(0, 2) + "00000000"
1449
+ : "";
1450
+
1451
+ if (val.region && regionPSGC) {
1452
+ enrollment.value.region = regionPSGC;
1453
+ }
1454
+
1455
+ if (val.regionName) {
1456
+ enrollment.value.regionName = val.regionName;
1457
+ }
1458
+
1459
+ if (val.division) {
1460
+ enrollment.value.division = val.cityMunicipalityPSGC
1461
+ ? val.cityMunicipalityPSGC.slice(0, 5) + "00000"
1462
+ : "";
1463
+ }
1368
1464
 
1369
- const { data: municipalitiesData } = await useLazyAsyncData(
1370
- "getMunicipalities",
1371
- () => getPhilippineMunicipalities()
1465
+ if (val.divisionName) {
1466
+ enrollment.value.divisionName = val.divisionName;
1467
+ }
1468
+ });
1469
+
1470
+ const { gradeLevels, generateSchoolYears, motherTongueOptions, tracks } =
1471
+ useBasicEdu();
1472
+
1473
+ const selectedTrackStrands = computed(
1474
+ () =>
1475
+ tracks.find(
1476
+ (track) => track.value === enrollment.value.seniorHighInfo?.track
1477
+ )?.strands || []
1372
1478
  );
1373
1479
 
1480
+ const isSeniorHighSchool = computed(() => {
1481
+ const gradeLevel = enrollment.value.gradeLevel;
1482
+ return ["grade-11", "grade-12"].includes(gradeLevel);
1483
+ });
1484
+
1485
+ const effectiveSchoolYearOptions = generateSchoolYears();
1486
+ const lastSchoolYearOptions = generateSchoolYears(50).reverse();
1487
+
1374
1488
  const indigenousCommunitiesPhilippines = [
1375
1489
  // Luzon (Northern Philippines) - Cordillera Groups (Igorot Subgroups)
1376
1490
  "Ifugao",
@@ -1414,8 +1528,6 @@ const indigenousCommunitiesPhilippines = [
1414
1528
  "Sama-Bajau",
1415
1529
  ];
1416
1530
 
1417
- const returningLearner = ref(false);
1418
- const withDisability = ref(false);
1419
1531
  const sameAsCurrentAddress = ref(false);
1420
1532
  const fatherLegalGuardianSame = ref(false);
1421
1533
  const motherLegalGuardianSame = ref(false);
@@ -1430,14 +1542,11 @@ const alternativeLearning = [
1430
1542
  "Homeschooling",
1431
1543
  ];
1432
1544
 
1433
- const enrollment = defineModel<TBasicEducEnrForm>({
1434
- default: () => useEnrollment().enrollment,
1435
- });
1436
-
1437
- watch(returningLearner, (val) => {
1545
+ watch(enrollment, (val) => {
1438
1546
  if (val) {
1547
+ enrollment.value.returningLearner = false;
1439
1548
  enrollment.value.learnerInfo.psaBirthCertificateNo = "";
1440
- enrollment.value.learnerInfo.learnerReferenceNumber = "";
1549
+ enrollment.value.learnerInfo.lrn = "";
1441
1550
  enrollment.value.learnerInfo.firstName = "";
1442
1551
  enrollment.value.learnerInfo.middleName = "";
1443
1552
  enrollment.value.learnerInfo.lastName = "";
@@ -1447,6 +1556,7 @@ watch(returningLearner, (val) => {
1447
1556
  enrollment.value.learnerInfo.sex = "";
1448
1557
  enrollment.value.learnerInfo.motherTongue = "";
1449
1558
  enrollment.value.learnerInfo.age = 0;
1559
+ enrollment.value.learnerInfo.withDisability = false;
1450
1560
  enrollment.value.learnerInfo.disabilities = [];
1451
1561
  enrollment.value.learnerInfo.indigenousCommunity = "";
1452
1562
  enrollment.value.learnerInfo.fourPsHouseholdId = "";
@@ -1550,6 +1660,7 @@ watchEffect(() => {
1550
1660
  });
1551
1661
 
1552
1662
  import { useMask } from "vuetify";
1663
+ import { fa } from "zod/v4/locales";
1553
1664
 
1554
1665
  watchEffect(() => {
1555
1666
  const mask = useMask({ mask: "##/##/####" });
@@ -9,10 +9,11 @@ export default function useEnrollment() {
9
9
  province: "",
10
10
  cityMunicipality: "",
11
11
  schoolYear: "",
12
- gradeLevel: "",
12
+ gradeLevel: "K1",
13
+ returningLearner: false,
13
14
  learnerInfo: {
14
15
  psaBirthCertificateNo: "",
15
- learnerReferenceNumber: "",
16
+ lrn: "",
16
17
  firstName: "",
17
18
  middleName: "",
18
19
  lastName: "",
@@ -22,6 +23,7 @@ export default function useEnrollment() {
22
23
  sex: "",
23
24
  motherTongue: "",
24
25
  age: 0,
26
+ withDisability: false,
25
27
  disabilities: [],
26
28
  indigenousCommunity: "",
27
29
  fourPsHouseholdId: "",
@@ -54,7 +56,7 @@ export default function useEnrollment() {
54
56
  barangay: "",
55
57
  municipalityCity: "",
56
58
  province: "",
57
- country: "Philippines",
59
+ country: "",
58
60
  zipCode: "",
59
61
  },
60
62
  permanent: {
@@ -74,19 +76,10 @@ export default function useEnrollment() {
74
76
  lastSchoolAttended: "",
75
77
  lastSchoolId: "",
76
78
  },
77
- seniorHighInfo: {
78
- track: "",
79
- strand: "",
80
- semester: "",
81
- },
82
- preferredLearningModalities: [],
83
- lastGradeLevelCompleted: "",
84
- lastSchoolYearCompleted: "",
85
- lastSchoolAttended: "",
86
- lastSchoolId: "",
79
+ seniorHighInfo: { track: "", strand: "", semester: "" },
87
80
  remarks: "",
88
81
  alternativeLearningOptions: [],
89
- isCertifiedAndConsented: false,
82
+ isCertifiedAndConsented: true,
90
83
  });
91
84
 
92
85
  function add(value: TBasicEducEnrForm) {
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.4.1",
5
+ "version": "1.4.3",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -12,12 +12,12 @@ declare type TBasicEducEnrForm = {
12
12
  schoolName?: string;
13
13
  schoolYear: string; // e.g., "2025-2026"
14
14
  gradeLevel: string; // e.g., "Grade 7"
15
+ returningLearner: boolean;
15
16
  learnerInfo: EnrLearnerInfo;
16
17
  parentGuardianInfo: EnrParentGuardianInfo;
17
18
  address: AddressInformation;
18
19
  returningLearnerInfo?: EnrReturningLearnerInfo;
19
20
  seniorHighInfo?: EnrSeniorHighInformation;
20
- preferredLearningModalities?: string[];
21
21
  lastGradeLevelCompleted?: string;
22
22
  lastSchoolYearCompleted?: string;
23
23
  lastSchoolAttended?: string;
@@ -37,7 +37,7 @@ declare type TBasicEducEnrForm = {
37
37
 
38
38
  declare type EnrLearnerInfo = {
39
39
  psaBirthCertificateNo?: string;
40
- learnerReferenceNumber?: string; // Learner Reference Number
40
+ lrn?: string; // Learner Reference Number
41
41
  lastName: string;
42
42
  firstName: string;
43
43
  middleName?: string;
@@ -49,6 +49,7 @@ declare type EnrLearnerInfo = {
49
49
  motherTongue?: string;
50
50
  fourPsHouseholdId?: string;
51
51
  indigenousCommunity?: string;
52
+ withDisability: boolean;
52
53
  disabilities?: string[];
53
54
  };
54
55
 
package/types/school.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare type TSchool = {
2
2
  _id?: string;
3
- id?: string;
3
+ id: string;
4
4
  name: string;
5
5
  country?: string;
6
6
  address?: string;