Skip to content

Commit bc7228e

Browse files
committed
init
0 parents  commit bc7228e

File tree

22 files changed

+2699
-0
lines changed

22 files changed

+2699
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
indent_style = space
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- run: npm i -g --force corepack@latest && corepack enable
23+
24+
- name: Install dependencies
25+
run: npx nypm@latest i
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: 20
39+
40+
- run: npm i -g --force corepack@latest && corepack enable
41+
42+
- name: Install dependencies
43+
run: npx nypm@latest i
44+
45+
- name: Playground prepare
46+
run: npm run dev:prepare
47+
48+
- name: Test
49+
run: npm run test

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Dependencies
2+
node_modules
3+
4+
# Logs
5+
*.log*
6+
7+
# Temp directories
8+
.temp
9+
.tmp
10+
.cache
11+
12+
# Yarn
13+
**/.yarn/cache
14+
**/.yarn/*state*
15+
16+
# Generated dirs
17+
dist
18+
19+
# Nuxt
20+
.nuxt
21+
.output
22+
.data
23+
.vercel_build_output
24+
.build-*
25+
.netlify
26+
27+
# Env
28+
.env
29+
30+
# Testing
31+
reports
32+
coverage
33+
*.lcov
34+
.nyc_output
35+
36+
# VSCode
37+
.vscode/*
38+
!.vscode/settings.json
39+
!.vscode/tasks.json
40+
!.vscode/launch.json
41+
!.vscode/extensions.json
42+
!.vscode/*.code-snippets
43+
44+
# Intellij idea
45+
*.iml
46+
.idea
47+
48+
# OSX
49+
.DS_Store
50+
.AppleDouble
51+
.LSOverride
52+
.AppleDB
53+
.AppleDesktop
54+
Network Trash Folder
55+
Temporary Items
56+
.apdisk

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.experimental.useFlatConfig": true
3+
}

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<!--
2+
Get your module up and running quickly.
3+
4+
Find and replace all on all files (CMD+SHIFT+F):
5+
- Name: My Module
6+
- Package name: my-module
7+
- Description: My new Nuxt module
8+
-->
9+
10+
# My Module
11+
12+
[![npm version][npm-version-src]][npm-version-href]
13+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
14+
[![License][license-src]][license-href]
15+
[![Nuxt][nuxt-src]][nuxt-href]
16+
17+
My new Nuxt module for doing amazing things.
18+
19+
- [&nbsp;Release Notes](/CHANGELOG.md)
20+
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21+
<!-- - [📖 &nbsp;Documentation](https://example.com) -->
22+
23+
## Features
24+
25+
<!-- Highlight some of the features your module provide here -->
26+
-&nbsp;Foo
27+
- 🚠 &nbsp;Bar
28+
- 🌲 &nbsp;Baz
29+
30+
## Quick Setup
31+
32+
Install the module to your Nuxt application with one command:
33+
34+
```bash
35+
npx nuxi module add my-module
36+
```
37+
38+
That's it! You can now use My Module in your Nuxt app ✨
39+
40+
41+
## Contribution
42+
43+
<details>
44+
<summary>Local development</summary>
45+
46+
```bash
47+
# Install dependencies
48+
npm install
49+
50+
# Generate type stubs
51+
npm run dev:prepare
52+
53+
# Develop with the playground
54+
npm run dev
55+
56+
# Build the playground
57+
npm run dev:build
58+
59+
# Run ESLint
60+
npm run lint
61+
62+
# Run Vitest
63+
npm run test
64+
npm run test:watch
65+
66+
# Release new version
67+
npm run release
68+
```
69+
70+
</details>
71+
72+
73+
<!-- Badges -->
74+
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
75+
[npm-version-href]: https://npmjs.com/package/my-module
76+
77+
[npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
78+
[npm-downloads-href]: https://npm.chart.dev/my-module
79+
80+
[license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
81+
[license-href]: https://npmjs.com/package/my-module
82+
83+
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
84+
[nuxt-href]: https://nuxt.com

bun.lock

Lines changed: 2239 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @ts-check
2+
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
3+
4+
// Run `npx @eslint/config-inspector` to inspect the resolved config interactively
5+
export default createConfigForNuxt({
6+
features: {
7+
// Rules for module authors
8+
tooling: true,
9+
// Rules for formatting
10+
stylistic: true,
11+
},
12+
dirs: {
13+
src: [
14+
'./playground',
15+
],
16+
},
17+
})
18+
.append(
19+
// your custom flat config here...
20+
)

package.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "nuxt-vue-dragscroll",
3+
"version": "1.0.0",
4+
"description": "Nuxt module for vue-dragscroll",
5+
"repository": "nuxt-vue-dragscroll",
6+
"license": "MIT",
7+
"type": "module",
8+
"exports": {
9+
".": {
10+
"types": "./dist/types.d.mts",
11+
"import": "./dist/module.mjs"
12+
}
13+
},
14+
"main": "./dist/module.mjs",
15+
"typesVersions": {
16+
"*": {
17+
".": [
18+
"./dist/types.d.mts"
19+
]
20+
}
21+
},
22+
"files": [
23+
"dist"
24+
],
25+
"scripts": {
26+
"prepack": "nuxt-module-build build",
27+
"dev": "npm run dev:prepare && nuxi dev playground",
28+
"dev:build": "nuxi build playground",
29+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
30+
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
31+
"lint": "eslint .",
32+
"test": "vitest run",
33+
"test:watch": "vitest watch",
34+
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
35+
},
36+
"dependencies": {
37+
"@nuxt/kit": "^4.0.1",
38+
"vue-dragscroll": "^4.0.6"
39+
},
40+
"devDependencies": {
41+
"@nuxt/devtools": "^2.6.2",
42+
"@nuxt/eslint-config": "^1.6.0",
43+
"@nuxt/module-builder": "^1.0.1",
44+
"@nuxt/schema": "^4.0.1",
45+
"@nuxt/test-utils": "^3.19.2",
46+
"@types/node": "latest",
47+
"changelogen": "^0.6.2",
48+
"eslint": "^9.31.0",
49+
"nuxt": "^4.0.1",
50+
"typescript": "~5.8.3",
51+
"vitest": "^3.2.4",
52+
"vue-tsc": "^3.0.3"
53+
}
54+
}

playground/app.vue

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<template>
2+
<div class="container" v-dragscroll>
3+
<!-- Контейнер с фиксированными размерами и скроллом -->
4+
<div class="grid-container" v-dragscroll>
5+
<!-- Внутренний контейнер с сеткой -->
6+
<div class="grid-wrapper" v-dragscroll>
7+
<div
8+
v-for="index in 2500"
9+
:key="index"
10+
class="grid-cell"
11+
:title="`Ячейка ${index}`"
12+
tabindex="0"
13+
>
14+
{{ index }}
15+
</div>
16+
</div>
17+
</div>
18+
</div>
19+
</template>
20+
21+
<style>
22+
.container {
23+
min-height: 100vh;
24+
background-color: #f3f4f6;
25+
padding: 1rem;
26+
}
27+
28+
.title {
29+
font-size: 1.5rem;
30+
font-weight: bold;
31+
color: #1f2937;
32+
margin-bottom: 1rem;
33+
text-align: center;
34+
}
35+
36+
.grid-container {
37+
width: 100%;
38+
height: 24rem;
39+
border: 2px solid #d1d5db;
40+
border-radius: 0.5rem;
41+
overflow: auto;
42+
background-color: white;
43+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
44+
margin: 0 auto;
45+
max-width: 64rem;
46+
}
47+
48+
.grid-wrapper {
49+
display: grid;
50+
grid-template-columns: repeat(50, 2rem);
51+
gap: 0.25rem;
52+
padding: 1rem;
53+
min-width: max-content;
54+
}
55+
56+
.grid-cell {
57+
width: 2rem;
58+
height: 2rem;
59+
background-color: #dbeafe;
60+
border: 1px solid #93c5fd;
61+
border-radius: 0.25rem;
62+
display: flex;
63+
align-items: center;
64+
justify-content: center;
65+
font-size: 0.75rem;
66+
color: #2563eb;
67+
font-weight: 500;
68+
cursor: pointer;
69+
transition: background-color 0.2s ease;
70+
user-select: none;
71+
}
72+
73+
.grid-cell:hover {
74+
background-color: #bfdbfe;
75+
}
76+
77+
.grid-cell:focus {
78+
outline: 2px solid #3b82f6;
79+
outline-offset: 1px;
80+
}
81+
82+
.info {
83+
margin-top: 1rem;
84+
font-size: 0.875rem;
85+
color: #6b7280;
86+
text-align: center;
87+
}
88+
89+
.info p {
90+
margin: 0.25rem 0;
91+
}
92+
</style>

0 commit comments

Comments
 (0)