@7365admin1/layer-common 3.0.31-staging.19 → 3.0.31-staging.20

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.
@@ -12,7 +12,7 @@
12
12
  <div class="w-100 d-flex justify-space-between ga-2">
13
13
  <span class="text-subtitle-1 w-100 font-weight-bold mb-3">{{
14
14
  formTitle
15
- }}</span>
15
+ }}</span>
16
16
  <span v-if="withStep2 || withStep3" class="text-subtitle-2 font-weight-bold" style="text-wrap: nowrap">Step
17
17
  <span class="text-primary-button">{{ contractorStep }}</span>/{{ withStep3 ? 3 : withStep2 ? 2 : 1 }}</span>
18
18
  </div>
@@ -92,7 +92,7 @@
92
92
  </v-row>
93
93
  </v-col>
94
94
 
95
- <v-col v-if="shouldShowField('contractorType')" cols="12">
95
+ <v-col v-if="shouldShowField('contractorType')" cols="12">
96
96
  <InputLabel class="text-capitalize" title="Contractor Type" required />
97
97
  <v-combobox v-model="contractorTypeObj" v-model:search="contractorTypeInput" ref="contractorTypeCombo"
98
98
  autocomplete="off" :hide-no-data="false" @update:focused="handleFocusedContractorType"
@@ -104,7 +104,7 @@
104
104
  <v-list-item-title @click.stop="handleAddNewContractorType" class="d-flex align-center ga-1">
105
105
  <span><v-icon icon="mdi-plus" /></span> Add "<strong>{{
106
106
  contractorTypeInput
107
- }}</strong>" as custom contractor type.
107
+ }}</strong>" as custom contractor type.
108
108
  </v-list-item-title>
109
109
  </v-list-item>
110
110
  </template>
@@ -137,8 +137,8 @@
137
137
  <InputLabel class="text-capitalize" title="Company Name" />
138
138
  <v-combobox v-model="visitor.company" v-model:search="companyNameInput" ref="companyCombo"
139
139
  autocomplete="off" :hide-no-data="false" :items="companyNames" item-value="value"
140
- @update:model-value="handleSelectCompanyName" variant="outlined"
141
- density="comfortable" persistent-hint small-chips>
140
+ @update:model-value="handleSelectCompanyName" variant="outlined" density="comfortable" persistent-hint
141
+ small-chips>
142
142
  <!-- <template v-slot:no-data>
143
143
  <v-list-item>
144
144
  <v-list-item-title v-if="companyNameInput" @click.stop="handleAddNewCompany"
@@ -175,7 +175,7 @@
175
175
  class="d-flex align-center ga-1">
176
176
  <span><v-icon icon="mdi-plus" /></span>Add "<strong>{{
177
177
  companyNameInput
178
- }}</strong>" as new company.
178
+ }}</strong>" as new company.
179
179
  </v-list-item-title>
180
180
  <v-list-item-title v-else-if="!companyNameInput && companyNames.length === 0">
181
181
  Start typing to search for companies.
@@ -929,23 +929,34 @@ function getPersonPlateOptions(item: Partial<TPeople>) {
929
929
  function findMatchingContactOption(options: string[], value?: string | null) {
930
930
  const normalizedValue = value?.trim();
931
931
  if (!normalizedValue) return "";
932
+ const compactValue = normalizedValue.replace(/\s/g, "");
932
933
 
933
934
  return (
934
935
  options.find((option) => option.trim() === normalizedValue) ||
935
- options.find((option) => option.replace(/\s/g, "") === normalizedValue.replace(/\s/g, "")) ||
936
+ options.find((option) => option.replace(/\s/g, "") === compactValue) ||
937
+ options.find((option) => option.trim().includes(normalizedValue)) ||
938
+ options.find((option) => option.replace(/\s/g, "").includes(compactValue)) ||
936
939
  ""
937
940
  );
938
941
  }
939
942
 
943
+ function normalizePlateNumber(value?: string | null) {
944
+ return (value ?? "").replace(/[^A-Z0-9]/gi, "").toUpperCase();
945
+ }
946
+
940
947
  function normalizePlateOption(value?: string | null) {
941
948
  return (value || "").replace(/[^A-Z0-9]/gi, "").toUpperCase();
942
949
  }
943
950
 
944
951
  function findMatchingPlateOption(options: string[], value?: string | null) {
945
- const normalizedValue = normalizePlateOption(value);
952
+ const normalizedValue = normalizePlateNumber(value);
946
953
  if (!normalizedValue) return "";
947
954
 
948
- return options.find((option) => normalizePlateOption(option) === normalizedValue) || "";
955
+ return (
956
+ options.find((option) => normalizePlateNumber(option) === normalizedValue) ||
957
+ options.find((option) => normalizePlateNumber(option).includes(normalizedValue)) ||
958
+ ""
959
+ );
949
960
  }
950
961
 
951
962
  function applyNricSearchResult(
@@ -969,11 +980,11 @@ function applyNricSearchResult(
969
980
 
970
981
  companyNames.value = Array.isArray(item.companyName) ? item.companyName : [];
971
982
 
972
- if(item.companyName && item.companyName.length === 1) {
983
+ if (item.companyName && item.companyName.length === 1) {
973
984
  visitor.company = item.companyName?.[0] || visitor.company;
974
985
  }
975
986
 
976
- if(item.companyName && item.companyName.length > 1){
987
+ if (item.companyName && item.companyName.length > 1) {
977
988
  visitor.company = ""
978
989
  }
979
990
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "3.0.31-staging.19",
5
+ "version": "3.0.31-staging.20",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "publishConfig": {