Skip to content

Commit

Permalink
More work on #6651
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Oct 26, 2024
1 parent 25ac573 commit b34c4ec
Show file tree
Hide file tree
Showing 43 changed files with 456 additions and 64 deletions.
66 changes: 30 additions & 36 deletions apps/showcase/doc/autocomplete/SizesDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<p>AutoComplete provides <i>small</i> and <i>large</i> sizes as alternatives to the base.</p>
</DocSectionText>
<div class="card flex flex-col items-center gap-4">
<AutoComplete v-model="value1" :suggestions="items1" @complete="search" size="small" placeholder="Small" />
<AutoComplete v-model="value2" :suggestions="items2" @complete="search" placeholder="Normal" />
<AutoComplete v-model="value3" :suggestions="items3" @complete="search" size="large" placeholder="Large" />
<AutoComplete v-model="value1" :suggestions="items" @complete="search" size="small" placeholder="Small" dropdown />
<AutoComplete v-model="value2" :suggestions="items" @complete="search" placeholder="Normal" dropdown />
<AutoComplete v-model="value3" :suggestions="items" @complete="search" size="large" placeholder="Large" dropdown />
</div>
<DocSectionCode :code="code" />
</template>
Expand All @@ -14,42 +14,38 @@
export default {
data() {
return {
value1: '',
value2: '',
value3: '',
items1: [],
items2: [],
items3: [],
value1: null,
value2: null,
value3: null,
items: [],
code: {
basic: `
<AutoComplete v-model="value1" :suggestions="items1" @complete="search" size="small" placeholder="Small" />
<AutoComplete v-model="value2" :suggestions="items2" @complete="search" placeholder="Normal" />
<AutoComplete v-model="value3" :suggestions="items3" @complete="search" size="large" placeholder="Large" />
<AutoComplete v-model="value1" :suggestions="items" @complete="search" size="small" placeholder="Small" dropdown />
<AutoComplete v-model="value2" :suggestions="items" @complete="search" placeholder="Normal" dropdown />
<AutoComplete v-model="value3" :suggestions="items" @complete="search" size="large" placeholder="Large" dropdown />
`,
options: `
<template>
<div class="card flex flex-col items-center gap-4">
<AutoComplete v-model="value1" :suggestions="items1" @complete="search" size="small" placeholder="Small" />
<AutoComplete v-model="value2" :suggestions="items2" @complete="search" placeholder="Normal" />
<AutoComplete v-model="value3" :suggestions="items3" @complete="search" size="large" placeholder="Large" />
<AutoComplete v-model="value1" :suggestions="items" @complete="search" size="small" placeholder="Small" dropdown />
<AutoComplete v-model="value2" :suggestions="items" @complete="search" placeholder="Normal" dropdown />
<AutoComplete v-model="value3" :suggestions="items" @complete="search" size="large" placeholder="Large" dropdown />
</div>
</template>
<script>
export default {
data() {
return {
value1: '',
value2: '',
value3: '',
items1: [],
items2: [],
items3: [],
value1: null,
value2: null,
value3: null,
items: [],
};
},
methods: {
search(event) {
this.items = [...Array(10).keys()].map((item) => event.query + '-' + item);
search() {
this.items = [];
}
}
};
Expand All @@ -58,33 +54,31 @@ export default {
composition: `
<template>
<div class="card flex flex-col items-center gap-4">
<AutoComplete v-model="value1" :suggestions="items1" @complete="search" size="small" placeholder="Small" />
<AutoComplete v-model="value2" :suggestions="items2" @complete="search" placeholder="Normal" />
<AutoComplete v-model="value3" :suggestions="items3" @complete="search" size="large" placeholder="Large" />
<AutoComplete v-model="value1" :suggestions="items" @complete="search" size="small" placeholder="Small" dropdown />
<AutoComplete v-model="value2" :suggestions="items" @complete="search" placeholder="Normal" dropdown />
<AutoComplete v-model="value3" :suggestions="items" @complete="search" size="large" placeholder="Large" dropdown />
</div>
</template>
<script setup>
import { ref } from "vue";
const value1 = ref("");
const value2 = ref("");
const value3 = ref("");
const items1 = ref([]);
const items2 = ref([]);
const items3 = ref([]);
const value1 = ref(null);
const value2 = ref(null);
const value3 = ref(null);
const items = ref([]);
const search = (event) => {
items.value = [...Array(10).keys()].map((item) => event.query + '-' + item);
const search = () => {
items.value = [];
}
<\/script>
`
}
};
},
methods: {
search(event) {
this.items = [...Array(10).keys()].map((item) => event.query + '-' + item);
search() {
this.items = [];
}
}
};
Expand Down
24 changes: 12 additions & 12 deletions apps/showcase/doc/datepicker/SizesDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<p>DatePicker provides <i>small</i> and <i>large</i> sizes as alternatives to the base.</p>
</DocSectionText>
<div class="card flex flex-col items-center gap-4">
<DatePicker v-model="value1" size="small" placeholder="Small" />
<DatePicker v-model="value2" placeholder="Normal" />
<DatePicker v-model="value3" size="large" placeholder="Large" />
<DatePicker v-model="value1" size="small" placeholder="Small" showIcon iconDisplay="input" />
<DatePicker v-model="value2" placeholder="Normal" showIcon iconDisplay="input" />
<DatePicker v-model="value3" size="large" placeholder="Large" showIcon iconDisplay="input" />
</div>
<DocSectionCode :code="code" />
</template>
Expand All @@ -19,16 +19,16 @@ export default {
value3: null,
code: {
basic: `
<DatePicker v-model="value1" size="small" placeholder="Small" />
<DatePicker v-model="value2" placeholder="Normal" />
<DatePicker v-model="value3" size="large" placeholder="Large" />
<DatePicker v-model="value1" size="small" placeholder="Small" showIcon iconDisplay="input" />
<DatePicker v-model="value2" placeholder="Normal" showIcon iconDisplay="input" />
<DatePicker v-model="value3" size="large" placeholder="Large" showIcon iconDisplay="input" />
`,
options: `
<template>
<div class="card flex flex-col items-center gap-4">
<DatePicker v-model="value1" size="small" placeholder="Small" />
<DatePicker v-model="value2" placeholder="Normal" />
<DatePicker v-model="value3" size="large" placeholder="Large" />
<DatePicker v-model="value1" size="small" placeholder="Small" showIcon iconDisplay="input" />
<DatePicker v-model="value2" placeholder="Normal" showIcon iconDisplay="input" />
<DatePicker v-model="value3" size="large" placeholder="Large" showIcon iconDisplay="input" />
</div>
</template>
Expand All @@ -47,9 +47,9 @@ export default {
composition: `
<template>
<div class="card flex flex-col items-center gap-4">
<DatePicker v-model="value1" size="small" placeholder="Small" />
<DatePicker v-model="value2" placeholder="Normal" />
<DatePicker v-model="value3" size="large" placeholder="Large" />
<DatePicker v-model="value1" size="small" placeholder="Small" showIcon iconDisplay="input" />
<DatePicker v-model="value2" placeholder="Normal" showIcon iconDisplay="input" />
<DatePicker v-model="value3" size="large" placeholder="Large" showIcon iconDisplay="input" />
</div>
</template>
Expand Down
8 changes: 4 additions & 4 deletions apps/showcase/doc/selectbutton/BasicDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>
</DocSectionText>
<div class="card flex justify-center">
<SelectButton v-model="value" :options="options" aria-labelledby="basic" />
<SelectButton v-model="value" :options="options" />
</div>
<DocSectionCode :code="code" />
</template>
Expand All @@ -19,12 +19,12 @@ export default {
options: ['One-Way', 'Return'],
code: {
basic: `
<SelectButton v-model="value" :options="options" aria-labelledby="basic" />
<SelectButton v-model="value" :options="options" />
`,
options: `
<template>
<div class="card flex justify-center">
<SelectButton v-model="value" :options="options" aria-labelledby="basic" />
<SelectButton v-model="value" :options="options" />
</div>
</template>
Expand All @@ -42,7 +42,7 @@ export default {
composition: `
<template>
<div class="card flex justify-center">
<SelectButton v-model="value" :options="options" aria-labelledby="basic" />
<SelectButton v-model="value" :options="options" />
</div>
</template>
Expand Down
71 changes: 71 additions & 0 deletions apps/showcase/doc/selectbutton/SizesDoc.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<DocSectionText v-bind="$attrs">
<p>SelectButton provides <i>small</i> and <i>large</i> sizes as alternatives to the base.</p>
</DocSectionText>
<div class="card flex flex-col items-center gap-4">
<SelectButton v-model="value1" :options="options" size="small" />
<SelectButton v-model="value2" :options="options" />
<SelectButton v-model="value3" :options="options" size="large" />
</div>
<DocSectionCode :code="code" />
</template>

<script>
export default {
data() {
return {
value1: null,
value2: 'Beginner',
value3: 'Expert',
options: ['Beginner', 'Expert'],
code: {
basic: `
<SelectButton v-model="value1" :options="options" size="small" />
<SelectButton v-model="value2" :options="options" />
<SelectButton v-model="value3" :options="options" size="large" />
`,
options: `
<template>
<div class="card flex flex-col items-center gap-4">
<SelectButton v-model="value1" :options="options" size="small" />
<SelectButton v-model="value2" :options="options" />
<SelectButton v-model="value3" :options="options" size="large" />
</div>
</template>
<script>
export default {
data() {
return {
value1: null,
value2: 'Beginner',
value3: 'Expert',
options: ['Beginner', 'Expert'],
}
}
}
<\/script>
`,
composition: `
<template>
<div class="card flex flex-col items-center gap-4">
<SelectButton v-model="value1" :options="options" size="small" />
<SelectButton v-model="value2" :options="options" />
<SelectButton v-model="value3" :options="options" size="large" />
</div>
</template>
<script setup>
import { ref } from 'vue';
const value1 = ref(null);
const value2 = ref('Beginner');
const value3 = ref('Expert');
const options = ref(['Beginner', 'Expert']);
<\/script>
`
}
};
}
};
</script>
68 changes: 68 additions & 0 deletions apps/showcase/doc/togglebutton/SizesDoc.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<template>
<DocSectionText v-bind="$attrs">
<p>ToggleButton provides <i>small</i> and <i>large</i> sizes as alternatives to the base.</p>
</DocSectionText>
<div class="card flex flex-col items-center gap-4">
<ToggleButton v-model="value1" onLabel="On" offLabel="Off" size="small" class="min-w-16" />
<ToggleButton v-model="value2" onLabel="On" offLabel="Off" class="min-w-20" />
<ToggleButton v-model="value3" onLabel="On" offLabel="Off" size="large" class="min-w-24" />
</div>
<DocSectionCode :code="code" />
</template>

<script>
export default {
data() {
return {
value1: false,
value2: false,
value3: false,
code: {
basic: `
<ToggleButton v-model="value1" onLabel="On" offLabel="Off" size="small" class="min-w-16" />
<ToggleButton v-model="value2" onLabel="On" offLabel="Off" class="min-w-20" />
<ToggleButton v-model="value3" onLabel="On" offLabel="Off" size="large" class="min-w-24" />
`,
options: `
<template>
<div class="card flex flex-col items-center gap-4">
<ToggleButton v-model="value1" onLabel="On" offLabel="Off" size="small" class="min-w-16" />
<ToggleButton v-model="value2" onLabel="On" offLabel="Off" class="min-w-20" />
<ToggleButton v-model="value3" onLabel="On" offLabel="Off" size="large" class="min-w-24" />
</div>
</template>
<script>
export default {
data() {
return {
value1: false,
value2: false,
value3: false
}
}
}
<\/script>
`,
composition: `
<template>
<div class="card flex flex-col items-center gap-4">
<ToggleButton v-model="value1" onLabel="On" offLabel="Off" size="small" class="min-w-16" />
<ToggleButton v-model="value2" onLabel="On" offLabel="Off" class="min-w-20" />
<ToggleButton v-model="value3" onLabel="On" offLabel="Off" size="large" class="min-w-24" />
</div>
</template>
<script setup>
import { ref } from 'vue';
const value1 = ref(false);
const value2 = ref(false);
const value3 = ref(false);
<\/script>
`
}
};
}
};
</script>
2 changes: 1 addition & 1 deletion apps/showcase/pages/datepicker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
component: IftaLabelDoc
},
{
id: 'sizez',
id: 'sizes',
label: 'Sizes',
component: SizesDoc
},
Expand Down
6 changes: 6 additions & 0 deletions apps/showcase/pages/selectbutton/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import BasicDoc from '@/doc/selectbutton/BasicDoc.vue';
import DisabledDoc from '@/doc/selectbutton/DisabledDoc.vue';
import FormsDoc from '@/doc/selectbutton/FormsDoc.vue';
import ImportDoc from '@/doc/selectbutton/ImportDoc.vue';
import SizesDoc from '@/doc/selectbutton/SizesDoc.vue';
import InvalidDoc from '@/doc/selectbutton/InvalidDoc.vue';
import MultipleDoc from '@/doc/selectbutton/MultipleDoc.vue';
import TemplateDoc from '@/doc/selectbutton/TemplateDoc.vue';
Expand Down Expand Up @@ -51,6 +52,11 @@ export default {
label: 'Template',
component: TemplateDoc
},
{
id: 'sizes',
label: 'Sizes',
component: SizesDoc
},
{
id: 'invalid',
label: 'Invalid',
Expand Down
6 changes: 6 additions & 0 deletions apps/showcase/pages/togglebutton/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import CustomizedDoc from '@/doc/togglebutton/CustomizedDoc.vue';
import DisabledDoc from '@/doc/togglebutton/DisabledDoc.vue';
import FormsDoc from '@/doc/togglebutton/FormsDoc.vue';
import ImportDoc from '@/doc/togglebutton/ImportDoc.vue';
import SizesDoc from '@/doc/togglebutton/SizesDoc.vue';
import InvalidDoc from '@/doc/togglebutton/InvalidDoc.vue';
import PTComponent from '@/doc/togglebutton/pt/index.vue';
import ThemingDoc from '@/doc/togglebutton/theming/index.vue';
Expand Down Expand Up @@ -45,6 +46,11 @@ export default {
label: 'Customized',
component: CustomizedDoc
},
{
id: 'sizes',
label: 'Sizes',
component: SizesDoc
},
{
id: 'invalid',
label: 'Invalid',
Expand Down
Loading

0 comments on commit b34c4ec

Please sign in to comment.