From dfa1ba85548508e680f68200ea521be95c3eafe0 Mon Sep 17 00:00:00 2001
From: Corentin THOMASSET <corentin.thomasset74@gmail.com>
Date: Mon, 7 Aug 2023 17:30:00 +0200
Subject: 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
---
 src/ui/c-select/c-select.demo.vue | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/ui/c-select/c-select.demo.vue

(limited to 'src/ui/c-select/c-select.demo.vue')

diff --git a/src/ui/c-select/c-select.demo.vue b/src/ui/c-select/c-select.demo.vue
new file mode 100644
index 0000000..ae553bb
--- /dev/null
+++ b/src/ui/c-select/c-select.demo.vue
@@ -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>
-- 
cgit v1.2.3

