feat(ui): added c-select in the ui lib (#550)

* feat(ui): added c-select in the ui lib

* refactor(ui): switched n-select to c-select
This commit is contained in:
Corentin THOMASSET 2023-08-07 17:30:00 +02:00 committed by GitHub
parent 6498c9b0fa
commit dfa1ba8554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 666 additions and 199 deletions

View file

@ -0,0 +1,36 @@
<script lang="ts" setup>
const optionsA = [
{ label: 'Option A', value: 'a' },
{ label: 'Option B', value: 'b' },
{ label: 'Option C', value: 'c' },
];
const optionsBig = Array.from({ length: 1000 }, (_, i) => ({ label: `Option ${i}`, value: i }));
const sizes = ['small', 'medium', 'large'] as const;
const value = ref('');
</script>
<template>
<h2>Sizes</h2>
<c-select v-for="size in sizes" :key="size" v-model:value="value" :options="optionsA" :size="size" mb-2 />
<h2>Searchable</h2>
<c-select v-for="size in sizes" :key="size" v-model:value="value" :options="optionsA" :size="size" searchable mb-2 />
<h2>Big list</h2>
<c-select v-model:value="value" :options="optionsBig" searchable />
<h2>Empty</h2>
<c-select :options="[]" />
<h2>String array as options</h2>
<c-select v-model:value="value" :options="['a', 'Option B', 'Option C']" />
<h2>Labels</h2>
<c-select label="Label" mb-2 />
<c-select label="Label" label-position="left" mb-2 />
<c-select label="Label" label-position="left" label-align="left" mb-2 label-width="200px" />
<c-select label="Label" label-position="left" label-align="center" mb-2 label-width="200px" />
<c-select label="Label" label-position="left" label-align="right" mb-2 label-width="200px" />
</template>