Skip to content

Commit

Permalink
Revert CountSelect and SortSelect.
Browse files Browse the repository at this point in the history
  • Loading branch information
Utar94 committed Apr 19, 2024
1 parent dcc99c8 commit d7a78d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
20 changes: 6 additions & 14 deletions frontend/src/components/shared/CountSelect.vue
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
<script setup lang="ts">
import { parsingUtils, type SelectOption } from "logitar-vue3-ui";
import { TarSelect, parsingUtils, type SelectOption } from "logitar-vue3-ui";
import { ref } from "vue";
import AppSelect from "./AppSelect.vue";
import { useI18n } from "vue-i18n";
const { parseNumber } = parsingUtils;
const { t } = useI18n();
defineProps<{
modelValue?: number;
}>();
const options = ref<SelectOption[]>([
{ text: "10", value: "10" },
{ text: "25", value: "25" },
{ text: "50", value: "50" },
{ text: "100", value: "100" },
]);
const options = ref<SelectOption[]>([{ text: "10" }, { text: "25" }, { text: "50" }, { text: "100" }]);
defineEmits<{
(e: "update:model-value", value?: number): void;
}>();
// TODO(fpion): always ignore validation
// TODO(fpion): does not work properly without option values
</script>

<template>
<AppSelect
<TarSelect
floating
id="count"
label="count"
:label="t('count')"
:model-value="modelValue?.toString()"
:options="options"
@update:model-value="$emit('update:model-value', parseNumber($event))"
Expand Down
15 changes: 5 additions & 10 deletions frontend/src/components/shared/SortSelect.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script setup lang="ts">
import { TarCheckbox, type SelectOption } from "logitar-vue3-ui";
import { TarCheckbox, TarSelect, type SelectOption } from "logitar-vue3-ui";
import { useI18n } from "vue-i18n";
import AppSelect from "./AppSelect.vue";
const { t } = useI18n();
withDefaults(
Expand All @@ -22,23 +20,20 @@ defineEmits<{
(e: "descending", value: boolean): void;
(e: "update:model-value", value?: string): void;
}>();
// TODO(fpion): always ignore validation
// TODO(fpion): sort resets when descending changes
</script>

<template>
<AppSelect
<TarSelect
floating
:id="id"
label="sort.select.label"
:label="t('sort.select.label')"
:model-value="modelValue"
:options="options"
placeholder="sort.select.placeholder"
:placeholder="t('sort.select.placeholder')"
@update:model-value="$emit('update:model-value', $event)"
>
<template #after>
<TarCheckbox :id="`${id}_desc`" :label="t('sort.isDescending')" :model-value="descending" @update:model-value="$emit('descending', $event)" />
</template>
</AppSelect>
</TarSelect>
</template>

0 comments on commit d7a78d3

Please sign in to comment.