@mixd-id/web-scaffold 0.1.230406089 → 0.1.230406090

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406089",
4
+ "version": "0.1.230406090",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -171,6 +171,10 @@ export default {
171
171
  @apply appearance-none outline-none p-2 bg-transparent cursor-pointer w-full;
172
172
  }
173
173
 
174
+ .dropdown option[disabled]{
175
+ @apply text-text-300;
176
+ }
177
+
174
178
  .arrow{
175
179
  @apply absolute right-0 pointer-events-none px-2;
176
180
  top: 50%;
@@ -44,7 +44,8 @@
44
44
  </Dropdown>
45
45
 
46
46
  <Dropdown v-else-if="field.type === 'provinceName'" v-model="form[field.type]" class="text-xl">
47
- <option v-for="item in field.items" :value="item.text">{{ item.text }}</option>
47
+ <option disabled selected value="">Propinsi</option>
48
+ <option v-for="item in field.provinces" :value="item.alias">{{ item.alias }}</option>
48
49
  </Dropdown>
49
50
 
50
51
  <Dropdown v-else-if="field.type === 'education'" v-model="form[field.type]" class="text-xl">
@@ -62,7 +63,7 @@
62
63
  </div>
63
64
  </div>
64
65
 
65
- <CitySelector ref="citySelector" @change="(city) => form['birthPlace'] = city.alias"/>
66
+ <CitySelector ref="citySelector" @change="setCity"/>
66
67
 
67
68
  <Button ref="submitBtn" class="w-full" @click="submitForm" :state="!canSubmit ? -1 : 1">
68
69
  <h5>{{ completed ? 'Form berhasil dikirim' : 'Kirim' }}</h5>
@@ -124,6 +125,16 @@ export default{
124
125
  .then(_ => this.completed = true)
125
126
  .catch(err => this.alert(err))
126
127
  .finally(_ => this.$refs.submitBtn.resetState(2))
128
+ },
129
+
130
+ setCity(city){
131
+ const provinceIdx = this.fields.findIndex((_) => _.type === 'birthDate')
132
+ if(provinceIdx >= 0){
133
+ this.form['birthPlace'] = city.alias;
134
+ if(city.longitude && city.latitude){
135
+ this.form['birthPlaceCoord'] = `https://www.google.com/maps?q=${city.latitude},${city.longitude}`;
136
+ }
137
+ }
127
138
  }
128
139
 
129
140
  },