-
Notifications
You must be signed in to change notification settings - Fork 219
refactor: improved provide inject by using a single symbol #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2e1e513
chore(refactor): improved provide inject by using a single symbol
Tofandel 80a2721
Update src/components/Carousel.ts
Tofandel 4f96545
Update package.json
Tofandel 950f03f
Revert auto height calculation and fix reviews
Tofandel f7f0802
feat: final updates before merge
ismail9k 20d05ae
Update src/components/Icon.ts
ismail9k 522c85b
Update src/components/Icon.ts
ismail9k f155d93
Add tests for icon component
Tofandel 2b377a5
Fix duplicated deps
Tofandel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
|
||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| pull_request: | ||
| branches: [ "master" ] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x, 22.x] | ||
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: yarn | ||
| - run: yarn install --frozen-lockfile | ||
| - run: npm run lint | ||
| - run: npm run test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,3 +20,5 @@ yarn-error.log* | |
| *.sln | ||
| *.sw? | ||
| *cache | ||
|
|
||
| package-lock.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| <template> | ||
| <div> | ||
| <fieldset> | ||
| <label | ||
| >Snap Align | ||
| <select v-model="snapAlign"> | ||
| <option v-for="opt in SNAP_ALIGN_OPTIONS" :value="opt" :key="opt"> | ||
| {{ opt }} | ||
| </option> | ||
| </select> | ||
| </label> | ||
| <label | ||
| >Direction | ||
| <select v-model="dir"> | ||
| <option v-for="opt in Object.keys(DIR_MAP)" :value="opt" :key="opt"> | ||
| {{ opt }} | ||
| </option> | ||
| </select> | ||
| </label> | ||
| <label>Items to show: <input type="number" v-model="itemsToShow" /></label> | ||
| <label>Items to scroll: <input type="number" v-model="itemsToScroll" /></label> | ||
| <label>Height: <input v-model="height" type="number" /></label> | ||
| <label | ||
| >Autoplay time: | ||
| <input type="number" v-model="autoplay" step="100" min="0" max="10000" | ||
| /></label> | ||
| <label><input type="checkbox" v-model="wrapAround" />Wrap Around</label> | ||
| <label>Current slide: <input type="number" v-model="currentSlide" /></label> | ||
| </fieldset> | ||
| <div class="carousel-wrapper"> | ||
| <VueCarousel | ||
| v-model="currentSlide" | ||
| :items-to-show="itemsToShow" | ||
| :items-to-scroll="itemsToScroll" | ||
| :gap="10" | ||
| :height="height || 'auto'" | ||
| :autoplay="autoplay ? parseInt(autoplay) : null" | ||
| :pause-autoplay-on-hover="true" | ||
| :wrap-around="wrapAround" | ||
| :dir="dir" | ||
| :snap-align="snapAlign" | ||
| > | ||
| <CarouselSlide v-for="i in 10" :key="i" v-slot="{ isActive, isClone }"> | ||
| <div class="carousel__item">{{ i }}<button>This is a button</button></div> | ||
| </CarouselSlide> | ||
| <template #addons> | ||
| <CarouselPagination /> | ||
| <CarouselNavigation /> | ||
| </template> | ||
| </VueCarousel> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import '@/styles' | ||
| import { | ||
| Carousel as VueCarousel, | ||
| Slide as CarouselSlide, | ||
| Pagination as CarouselPagination, | ||
| Navigation as CarouselNavigation, | ||
| } from '@/index' | ||
| import { ref } from 'vue' | ||
|
|
||
| import { DIR_MAP, SNAP_ALIGN_OPTIONS } from '@/partials/defaults' | ||
|
|
||
| const currentSlide = ref(0) | ||
| const snapAlign = ref('center') | ||
| const itemsToScroll = ref(1) | ||
| const itemsToShow = ref(1) | ||
| const autoplay = ref() | ||
| const wrapAround = ref(true) | ||
| const height = ref('200') | ||
| const dir = ref('left-to-right') | ||
| </script> | ||
|
|
||
| <style lang="css"> | ||
| :root { | ||
| font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; | ||
| color-scheme: light dark; | ||
| background-color: #242424; | ||
| font-synthesis: none; | ||
| text-rendering: optimizeLegibility; | ||
| -webkit-font-smoothing: antialiased; | ||
| -moz-osx-font-smoothing: grayscale; | ||
|
|
||
| --brand-color: #535bf2; | ||
| } | ||
|
|
||
| fieldset { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 15px; | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| @keyframes pop-in { | ||
| 0% { | ||
| opacity: 0; | ||
| transform: scale(0); | ||
| } | ||
| 100% { | ||
| opacity: 1; | ||
| transform: scale(1); | ||
| } | ||
| } | ||
|
|
||
| .carousel-wrapper { | ||
| animation: pop-in 3s; | ||
| } | ||
|
|
||
| fieldset label { | ||
| display: inline-flex; | ||
| gap: 10px; | ||
| flex-grow: 1; | ||
| } | ||
|
|
||
| .carousel__item { | ||
| width: 100%; | ||
| height: 100%; | ||
| background-color: var(--brand-color); | ||
| color: #fff; | ||
| font-size: 20px; | ||
| border-radius: 8px; | ||
| flex-direction: column; | ||
| gap: 10px; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| } | ||
| </style> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <title>Vue3 Carousel playground</title> | ||
| <script type="module"> | ||
| import { createApp } from 'vue' | ||
| import App from './App.vue' | ||
|
|
||
| createApp(App).mount('#app') | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <div id="app"></div> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import {resolve} from 'node:path' | ||
|
|
||
| import vue from '@vitejs/plugin-vue' | ||
| import { defineConfig } from 'vite' | ||
|
|
||
| import { compilerOptions } from '../tsconfig.json' | ||
|
|
||
| const resolvePaths = () => { | ||
| return Object.fromEntries( | ||
| Object.entries(compilerOptions.paths || {}).map(([key, value]) => [ | ||
| key.replace('/*', ''), | ||
| resolve(__dirname, '..', value[0].replace('/*', '')), | ||
| ]) | ||
| ) | ||
| } | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [vue()], | ||
| resolve: { | ||
| alias: resolvePaths(), | ||
| extensions: ['.ts', '.tsx', '.js', '.json'], | ||
| }, | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,5 @@ | |
| # abort on errors | ||
| set -e | ||
|
|
||
| npm run build | ||
|
|
||
| npm publish | ||
| git push --tags | ||
| git push | ||
| npm publish | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.