@fy-/fws-vue 0.1.2 → 0.1.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.
@@ -8,6 +8,7 @@ import Textarea from "primevue/textarea";
8
8
  import Calendar from "primevue/calendar";
9
9
  import Password from "primevue/password";
10
10
  import Checkbox from "primevue/checkbox";
11
+ import Dropdown from "primevue/dropdown";
11
12
 
12
13
  type modelValueType = string | number | string[] | number[] | undefined;
13
14
 
@@ -57,6 +58,12 @@ const checkErrors = computed(() => {
57
58
  return null;
58
59
  });
59
60
 
61
+ const formattedOptions = computed(() => {
62
+ return props.options.map((option) => {
63
+ return { optionLabel: option[0], optionValue: option[1] };
64
+ });
65
+ });
66
+
60
67
  const focus = () => {
61
68
  if (inputRef.value) inputRef.value.focus();
62
69
  };
@@ -177,6 +184,20 @@ defineExpose({ focus, getInputRef });
177
184
  toggleMask
178
185
  v-if="type == 'password'"
179
186
  />
187
+ <!-- @vue-skip -->
188
+ <Dropdown
189
+ :id="id"
190
+ v-model="model"
191
+ :options="formattedOptions"
192
+ :placeholder="placeholder"
193
+ :invalid="checkErrors ? true : false"
194
+ :aria-describedby="
195
+ help && !['checkbox', 'radio'].includes(type)
196
+ ? `${id}-help`
197
+ : undefined
198
+ "
199
+ v-if="type == 'select'"
200
+ />
180
201
  <small
181
202
  :id="`${id}-help`"
182
203
  v-if="help && !['checkbox', 'radio'].includes(type)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {