Skip to content

Commit a831ce5

Browse files
authored
Merge pull request #502 from VividLemon/dev
chore(playground): better the playground
2 parents e47d4c6 + d42e8fd commit a831ce5

File tree

15 files changed

+318
-101
lines changed

15 files changed

+318
-101
lines changed
File renamed without changes.

.github/workflows/docs-github-pages-deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
push:
77
paths:
88
- 'apps/docs/**'
9-
- '.github/workflows/docs-github-pages-deploy.yml'
9+
- '.github/workflows/docs-github-pages-deploy.yaml'
1010
branches:
1111
- main
1212
jobs:

.github/workflows/release-please.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ name: release-please
66

77
on:
88
push:
9+
paths:
10+
- 'packages/bootstrap-vue-3/**'
11+
- '.github/workflows/release-please.yaml'
912
branches:
1013
- main
1114

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ stats.html
4141
*.njsproj
4242
*.sln
4343
*.sw?
44-

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
strict-peer-dependencies=false
1+
strict-peer-dependencies=false

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ Released under the MIT [Licence](./LICENSE). Copyright (c) BootstrapVue3.
8080

8181
# Making a new release
8282

83-
Bootstrap Vue 3 uses [release-please](https://github.com/googleapis/release-please) to automate releases using workflows. The `.github/workflows/release-please.yml` workflow will auto generate releases when using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). We encourage your commit message to follow conventional commit guidelines to keep commits clean and automate releases
83+
Bootstrap Vue 3 uses [release-please](https://github.com/googleapis/release-please) to automate releases using workflows. The `.github/workflows/release-please.yaml` workflow will auto generate releases when using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). We encourage your commit message to follow conventional commit guidelines to keep commits clean and automate releases
8484

85-
The workflow `.github/workflows/npm-publish.yml` will then auto-publish at <https://www.npmjs.com/package/bootstrap-vue-3>
85+
The workflow `.github/workflows/npm-publish.yaml` will then auto-publish at <https://www.npmjs.com/package/bootstrap-vue-3>
8686

8787
## Manual releases
8888

apps/playground/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Vite + Vue + TS</title>
88
</head>

apps/playground/src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<b-container id="container" ref="container" :toast="{root: true}" class="mt-4" fluid="sm">
3+
<router-view />
34
</b-container>
45
</template>
56

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<template>
2+
<b-row>
3+
<b-col>
4+
<b-container fluid>
5+
<b-row>
6+
<b-col>
7+
<b-form-input v-model="searchQuery" placeholder="Search" />
8+
</b-col>
9+
</b-row>
10+
<b-row>
11+
<b-col>
12+
<b-button variant="danger" @click="clearActiveList">Clear all</b-button>
13+
<b-button
14+
v-for="(comp, index) in filteredSearch"
15+
:key="index"
16+
class="m-1"
17+
:disabled="comp.disabled"
18+
:variant="active.includes(comp.name) ? 'primary' : 'secondary'"
19+
@click="switchActive(comp.name)"
20+
>
21+
{{ comp.name }}
22+
</b-button>
23+
</b-col>
24+
</b-row>
25+
<b-row>
26+
<b-col>
27+
<b-container v-for="(comp, index) in filteredActive" :key="index" fluid>
28+
<b-row>
29+
<b-col>
30+
<h1>{{ comp.name }}</h1>
31+
</b-col>
32+
</b-row>
33+
<b-row>
34+
<b-col>
35+
<component :is="comp.is" />
36+
</b-col>
37+
</b-row>
38+
<b-row>
39+
<b-col>
40+
<hr />
41+
</b-col>
42+
</b-row>
43+
</b-container>
44+
</b-col>
45+
</b-row>
46+
</b-container>
47+
</b-col>
48+
</b-row>
49+
</template>
50+
51+
<script setup lang="ts">
52+
import {computed, onMounted, ref} from 'vue'
53+
import TAccordion from '../components/Comps/TAccordion.vue'
54+
import TAlert from '../components/Comps/TAlert.vue'
55+
import TAvatar from '../components/Comps/TAvatar.vue'
56+
import TBadge from '../components/Comps/TBadge.vue'
57+
import TBLink from '../components/Comps/TBLink.vue'
58+
import TBreadcrumb from '../components/Comps/TBreadcrumb.vue'
59+
import TButton from '../components/Comps/TButton.vue'
60+
import TCard from '../components/Comps/TCard.vue'
61+
import TCarousel from '../components/Comps/TCarousel.vue'
62+
import TDropdown from '../components/Comps/TDropdown.vue'
63+
import TForm from '../components/Comps/TForm.vue'
64+
import TFormCheckbox from '../components/Comps/TFormCheckbox.vue'
65+
import TFormCheckboxGroup from '../components/Comps/TFormCheckboxGroup.vue'
66+
import TFormFloatingLabel from '../components/Comps/TFormFloatingLabel.vue'
67+
import TFormGroup from '../components/Comps/TFormGroup.vue'
68+
import TFormInput from '../components/Comps/TFormInput.vue'
69+
import TFormRadio from '../components/Comps/TFormRadio.vue'
70+
import TFormRadioGroup from '../components/Comps/TFormRadioGroup.vue'
71+
import TFormSelect from '../components/Comps/TFormSelect.vue'
72+
import TFormTextarea from '../components/Comps/TFormTextarea.vue'
73+
import TImg from '../components/Comps/TImg.vue'
74+
import TInputGroup from '../components/Comps/TInputGroup.vue'
75+
import TLayout from '../components/Comps/TLayout.vue'
76+
import TListGroup from '../components/Comps/TListGroup.vue'
77+
import TModal from '../components/Comps/TModal.vue'
78+
import TNav from '../components/Comps/TNav.vue'
79+
import TOverlay from '../components/Comps/TOverlay.vue'
80+
import TPagination from '../components/Comps/TPagination.vue'
81+
import TPopover from '../components/Comps/TPopover.vue'
82+
import TSkeleton from '../components/Comps/TSkeleton.vue'
83+
import TSkeletonIcon from '../components/Comps/TSkeletonIcon.vue'
84+
import TSkeletonTable from '../components/Comps/TSkeletonTable.vue'
85+
import TSkeletonWrapper from '../components/Comps/TSkeletonWrapper.vue'
86+
import TTable from '../components/Comps/TTable.vue'
87+
import TTableSimple from '../components/Comps/TTableSimple.vue'
88+
import TTabs from '../components/Comps/TTabs.vue'
89+
import TToast from '../components/Comps/TToast.vue'
90+
import TTooltip from '../components/Comps/TTooltip.vue'
91+
import TVisible from '../components/Directives/TVisible.vue'
92+
93+
const comps: Array<{name: string; is: unknown; disabled?: true}> = [
94+
{name: 'Visible', is: TVisible, disabled: true},
95+
{name: 'Accordion', is: TAccordion},
96+
{name: 'Alert', is: TAlert},
97+
{name: 'Avatar', is: TAvatar},
98+
{name: 'TBadge', is: TBadge},
99+
{name: 'BLink', is: TBLink},
100+
{name: 'Breadcrumb', is: TBreadcrumb},
101+
{name: 'Button', is: TButton},
102+
{name: 'Card', is: TCard},
103+
{name: 'Carousel', is: TCarousel},
104+
{name: 'Dropdown', is: TDropdown},
105+
{name: 'Form', is: TForm},
106+
{name: 'FormCheckbox', is: TFormCheckbox},
107+
{name: 'FormCheckboxGroup', is: TFormCheckboxGroup},
108+
{name: 'FormFloatingLabel', is: TFormFloatingLabel},
109+
{name: 'FormGroup', is: TFormGroup},
110+
{name: 'FormInput', is: TFormInput},
111+
{name: 'FormRadio', is: TFormRadio},
112+
{name: 'FormRadioGroup', is: TFormRadioGroup},
113+
{name: 'FormSelect', is: TFormSelect},
114+
{name: 'FormTextarea', is: TFormTextarea},
115+
{name: 'Img', is: TImg},
116+
{name: 'InputGroup', is: TInputGroup},
117+
{name: 'ListGroup', is: TListGroup},
118+
{name: 'Layout', is: TLayout},
119+
{name: 'Modal', is: TModal},
120+
{name: 'Nav', is: TNav},
121+
{name: 'Overlay', is: TOverlay},
122+
{name: 'Pagination', is: TPagination},
123+
{name: 'Popover', is: TPopover},
124+
{name: 'Skeleton', is: TSkeleton},
125+
{name: 'SkeletonIcon', is: TSkeletonIcon},
126+
{name: 'SkeletonTable', is: TSkeletonTable},
127+
{name: 'SkeletonWrapper', is: TSkeletonWrapper},
128+
{name: 'Table', is: TTable},
129+
{name: 'TableSimple', is: TTableSimple},
130+
{name: 'Tabs', is: TTabs},
131+
{name: 'Toast', is: TToast},
132+
{name: 'Tooltip', is: TTooltip},
133+
]
134+
135+
const searchQuery = ref('')
136+
137+
const active = ref<Array<string>>([])
138+
139+
const filteredSearch = computed(() =>
140+
searchQuery.value.trim() !== ''
141+
? comps.filter((item) =>
142+
searchQuery.value
143+
.toLowerCase()
144+
.split(' ')
145+
.every((v) => item.name.toLowerCase().includes(v))
146+
)
147+
: comps
148+
)
149+
150+
const filteredActive = computed(() => comps.filter((el) => active.value.includes(el.name)))
151+
152+
const switchActive = (name: string): void => {
153+
const comp = comps.find((el) => el.name === name)
154+
if (comp === undefined || comp.disabled === true) return
155+
const value = comp.name
156+
const ind = active.value.findIndex((el) => el === value)
157+
ind !== -1 ? active.value.splice(ind, 1) : active.value.push(value)
158+
if (active.value.length === 0) {
159+
localStorage.removeItem('bv3-playground-dev-active-list')
160+
return
161+
}
162+
localStorage.setItem('bv3-playground-dev-active-list', JSON.stringify(active.value))
163+
}
164+
165+
const clearActiveList = () => {
166+
localStorage.removeItem('bv3-playground-dev-active-list')
167+
active.value = []
168+
}
169+
170+
onMounted(() => {
171+
const activeList = localStorage.getItem('bv3-playground-dev-active-list')
172+
if (activeList !== null) {
173+
active.value = JSON.parse(activeList)
174+
}
175+
})
176+
</script>
Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,36 @@
11
<template>
2-
<div class="my-2">
3-
<h2 id="content" class="bd-title">Accordion</h2>
4-
<p class="bd-lead">
5-
Build vertically collapsing accordions in combination with our Collapse JavaScript plugin.
6-
</p>
2+
<b-container fluid>
3+
<b-row>
4+
<b-col>
5+
<b-accordion flush>
6+
<b-accordion-item id="iddddd" title="Accordion Item #1" visible>
7+
<strong>This is the first item's accordion body.</strong> It is shown by default, until
8+
the collapse plugin adds the appropriate classes that we use to style each element.
9+
These classes control the overall appearance, as well as the showing and hiding via CSS
10+
transitions. You can modify any of this with custom CSS or overriding our default
11+
variables. It's also worth noting that just about any HTML can go within the
12+
<code>.accordion-body</code>, though the transition does limit overflow.
13+
</b-accordion-item>
714

8-
<b-card no-body title="holaprop" sub-title="sdf" header="hola" footer="chau">
9-
<template #footer>
10-
<em>Footer Slot</em>
11-
</template>
15+
<b-accordion-item title="Accordion Item #2">
16+
<strong>This is the second item's accordion body.</strong> It is hidden by default,
17+
until the collapse plugin adds the appropriate classes that we use to style each
18+
element. These classes control the overall appearance, as well as the showing and hiding
19+
via CSS transitions. You can modify any of this with custom CSS or overriding our
20+
default variables. It's also worth noting that just about any HTML can go within the
21+
<code>.accordion-body</code>, though the transition does limit overflow.
22+
</b-accordion-item>
1223

13-
<b-card-body>
14-
<b-card-title>Card title</b-card-title>
15-
<b-card-sub-title>Card subtitle</b-card-sub-title>
16-
</b-card-body>
17-
<b-accordion flush>
18-
<b-accordion-item id="iddddd" title="Accordion Item #1" visible>
19-
<strong>This is the first item's accordion body.</strong> It is shown by default, until
20-
the collapse plugin adds the appropriate classes that we use to style each element. These
21-
classes control the overall appearance, as well as the showing and hiding via CSS
22-
transitions. You can modify any of this with custom CSS or overriding our default
23-
variables. It's also worth noting that just about any HTML can go within the
24-
<code>.accordion-body</code>, though the transition does limit overflow.
25-
</b-accordion-item>
26-
27-
<b-accordion-item title="Accordion Item #2">
28-
<strong>This is the second item's accordion body.</strong> It is hidden by default, until
29-
the collapse plugin adds the appropriate classes that we use to style each element. These
30-
classes control the overall appearance, as well as the showing and hiding via CSS
31-
transitions. You can modify any of this with custom CSS or overriding our default
32-
variables. It's also worth noting that just about any HTML can go within the
33-
<code>.accordion-body</code>, though the transition does limit overflow.
34-
</b-accordion-item>
35-
36-
<b-accordion-item title="Accordion Item #3">
37-
<strong>This is the third item's accordion body.</strong> It is hidden by default, until
38-
the collapse plugin adds the appropriate classes that we use to style each element. These
39-
classes control the overall appearance, as well as the showing and hiding via CSS
40-
transitions. You can modify any of this with custom CSS or overriding our default
41-
variables. It's also worth noting that just about any HTML can go within the
42-
<code>.accordion-body</code>, though the transition does limit overflow.
43-
</b-accordion-item>
44-
</b-accordion>
45-
</b-card>
46-
</div>
24+
<b-accordion-item title="Accordion Item #3">
25+
<strong>This is the third item's accordion body.</strong> It is hidden by default, until
26+
the collapse plugin adds the appropriate classes that we use to style each element.
27+
These classes control the overall appearance, as well as the showing and hiding via CSS
28+
transitions. You can modify any of this with custom CSS or overriding our default
29+
variables. It's also worth noting that just about any HTML can go within the
30+
<code>.accordion-body</code>, though the transition does limit overflow.
31+
</b-accordion-item>
32+
</b-accordion>
33+
</b-col>
34+
</b-row>
35+
</b-container>
4736
</template>

0 commit comments

Comments
 (0)