Skip to content

Commit

Permalink
Merge pull request #175 from solfacil/feature/has-scroll-property
Browse files Browse the repository at this point in the history
feat: adding hasScroll property
  • Loading branch information
Gabriel Araujo committed Nov 10, 2022
2 parents a45017e + e86b71f commit 9cdb863
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Configure git
uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN_ACTION }}
token: ${{ secrets.REGISTRY_PERSONAL_TOKEN }}

- name: cache dependencies
uses: actions/cache@v2
Expand All @@ -34,14 +34,14 @@ jobs:
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.TOKEN_ACTION }}
github-token: ${{ secrets.REGISTRY_PERSONAL_TOKEN }}
output-file: "false"

- name: Create Release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_ACTION }}
GITHUB_TOKEN: ${{ secrets.REGISTRY_PERSONAL_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Configure git
uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN_ACTION }}
token: ${{ secrets.REGISTRY_PERSONAL_TOKEN }}

- name: cache dependencies
uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion src/assets/scss/_selectinput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
}

.options-list {
@apply bg-white w-full overflow-y-auto pr-3 pt-1 mt-2;
@apply bg-white w-full pr-3 pt-1 mt-2;
max-height: 160px;

/* width */
Expand Down
25 changes: 25 additions & 0 deletions src/components/SelectInput/SelectInput.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ const Template = (args, { argTypes }) => ({
value: '2',
name: 'Sou um integrador e quero tirar dúvidas',
},
{
value: '3',
name: 'Sou um integrador e quero tirar dúvidas',
},
{
value: '4',
name: 'Sou um integrador e quero tirar dúvidas',
},
{
value: '5',
name: 'Sou um integrador e quero tirar dúvidas',
},
{
value: '6',
name: 'Sou um integrador e quero tirar dúvidas',
},
{
value: '7',
name: 'Sou um integrador e quero tirar dúvidas',
},
{
value: '8',
name: 'Sou um integrador e quero tirar dúvidas',
},
],
inputModel: '2',
};
Expand All @@ -46,4 +70,5 @@ Default.args = {
id: 'select',
searchable: true,
placeholder: 'Selecione',
hasScroll: true,
};
14 changes: 13 additions & 1 deletion src/components/SelectInput/SelectInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
placeholder="Busque aqui"
class="shadow-none"
/>
<ul class="options-list">
<ul class="options-list" :class="scrollClass">
<li
v-for="item in searchItems(searchString)"
:key="item.value"
Expand Down Expand Up @@ -161,6 +161,12 @@ export default {
type: Boolean,
default: false,
},
/** Specify whether show scroll or not */
hasScroll: {
type: Boolean,
default: true,
},
},
data: () => ({
Expand All @@ -169,6 +175,12 @@ export default {
searchString: '',
}),
computed: {
scrollClass() {
return this.hasScroll ? 'overflow-y-auto' : 'overflow-hidden';
},
},
watch: {
options() {
const action = [
Expand Down

0 comments on commit 9cdb863

Please sign in to comment.