create-nexwire 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +233 -0
- package/express/.dockerignore +14 -0
- package/express/.env +44 -0
- package/express/.env.example +42 -0
- package/express/.vscode/settings.json +26 -0
- package/express/LICENSE +21 -0
- package/express/README.md +211 -0
- package/express/biome.json +66 -0
- package/express/drizzle.config.ts +25 -0
- package/express/gitignore-stub +24 -0
- package/express/package.json +108 -0
- package/express/public/.gitkeep +0 -0
- package/express/src/config/app.ts +41 -0
- package/express/src/config/auth.ts +12 -0
- package/express/src/config/cache.ts +16 -0
- package/express/src/config/cookie.ts +15 -0
- package/express/src/config/cors.ts +12 -0
- package/express/src/config/database.ts +29 -0
- package/express/src/config/index.ts +83 -0
- package/express/src/config/jwt.ts +19 -0
- package/express/src/config/logging.ts +13 -0
- package/express/src/config/mail.ts +24 -0
- package/express/src/config/openapi.ts +54 -0
- package/express/src/config/queue.ts +30 -0
- package/express/src/config/rateLimit.ts +17 -0
- package/express/src/config/realtime.ts +15 -0
- package/express/src/config/redis.ts +18 -0
- package/express/src/config/security.ts +44 -0
- package/express/src/config/session.ts +17 -0
- package/express/src/config/storage.ts +22 -0
- package/express/src/config/validate.ts +40 -0
- package/express/src/database/migrations/sqlite/0000_init.sql +61 -0
- package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +412 -0
- package/express/src/database/migrations/sqlite/meta/_journal.json +13 -0
- package/express/src/database/schema.ts +3 -0
- package/express/src/env.ts +76 -0
- package/express/src/framework/cache/cache.ts +81 -0
- package/express/src/framework/circuit-breaker/cb.ts +60 -0
- package/express/src/framework/database/connection.ts +196 -0
- package/express/src/framework/database/migrate-hooks.ts +87 -0
- package/express/src/framework/database/paginate.ts +227 -0
- package/express/src/framework/database/schema.ts +20 -0
- package/express/src/framework/database/seed.ts +139 -0
- package/express/src/framework/events/dispatcher.ts +49 -0
- package/express/src/framework/facade.ts +48 -0
- package/express/src/framework/http/app.ts +107 -0
- package/express/src/framework/http/cors.ts +7 -0
- package/express/src/framework/http/logger.ts +69 -0
- package/express/src/framework/http/metrics.ts +22 -0
- package/express/src/framework/http/openapi.ts +54 -0
- package/express/src/framework/http/ratelimiter.ts +16 -0
- package/express/src/framework/http/router.ts +178 -0
- package/express/src/framework/http/security.ts +23 -0
- package/express/src/framework/http/static.ts +23 -0
- package/express/src/framework/http/validation.ts +18 -0
- package/express/src/framework/kernel.ts +52 -0
- package/express/src/framework/maker-cli/db/core.mjs +288 -0
- package/express/src/framework/maker-cli/db/index.mjs +204 -0
- package/express/src/framework/maker-cli/deploy/core.mjs +1047 -0
- package/express/src/framework/maker-cli/deploy/index.mjs +91 -0
- package/express/src/framework/maker-cli/index.mjs +53 -0
- package/express/src/framework/maker-cli/middleware/core.mjs +47 -0
- package/express/src/framework/maker-cli/middleware/index.mjs +17 -0
- package/express/src/framework/maker-cli/module/core.mjs +684 -0
- package/express/src/framework/maker-cli/module/index.mjs +140 -0
- package/express/src/framework/maker-cli/runtime/build-ui.mjs +16 -0
- package/express/src/framework/maker-cli/runtime/core.mjs +543 -0
- package/express/src/framework/maker-cli/runtime/index.mjs +104 -0
- package/express/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
- package/express/src/framework/maker-cli/stubs/controller/openapi.ts.stub +47 -0
- package/express/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +48 -0
- package/express/src/framework/maker-cli/stubs/controller/plain.ts.stub +54 -0
- package/express/src/framework/maker-cli/stubs/controller/schema.plain.ts.stub +14 -0
- package/express/src/framework/maker-cli/stubs/controller/schema.ts.stub +33 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
- package/express/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
- package/express/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
- package/express/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
- package/express/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
- package/express/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
- package/express/src/framework/maker-cli/stubs/example/console.ts.stub +34 -0
- package/express/src/framework/maker-cli/stubs/example/controller.ts.stub +418 -0
- package/express/src/framework/maker-cli/stubs/example/job.ts.stub +75 -0
- package/express/src/framework/maker-cli/stubs/example/route.api.ts.stub +207 -0
- package/express/src/framework/maker-cli/stubs/example/route.plain.ts.stub +18 -0
- package/express/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +42 -0
- package/express/src/framework/maker-cli/stubs/example/schema.ts.stub +42 -0
- package/express/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
- package/express/src/framework/maker-cli/stubs/middleware/name.ts.stub +14 -0
- package/express/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/notification/controller.ts.stub +77 -0
- package/express/src/framework/maker-cli/stubs/notification/job.ts.stub +13 -0
- package/express/src/framework/maker-cli/stubs/notification/route.api.ts.stub +50 -0
- package/express/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +12 -0
- package/express/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
- package/express/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
- package/express/src/framework/maker-cli/stubs/route/api.ts.stub +80 -0
- package/express/src/framework/maker-cli/stubs/route/plain.ts.stub +11 -0
- package/express/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
- package/express/src/framework/maker-cli/stubs/seeder/name.ts.stub +20 -0
- package/express/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
- package/express/src/framework/maker-cli/utils/env-config.mjs +44 -0
- package/express/src/framework/maker-cli/utils/env-db.mjs +61 -0
- package/express/src/framework/maker-cli/utils/file-ops.mjs +30 -0
- package/express/src/framework/maker-cli/utils/flags.mjs +14 -0
- package/express/src/framework/maker-cli/utils/help.mjs +50 -0
- package/express/src/framework/maker-cli/utils/naming.mjs +13 -0
- package/express/src/framework/maker-cli/utils/process.mjs +52 -0
- package/express/src/framework/modules/discover.ts +54 -0
- package/express/src/framework/modules/routes.ts +21 -0
- package/express/src/framework/notification/index.ts +116 -0
- package/express/src/framework/queue/clear.ts +22 -0
- package/express/src/framework/queue/queue.ts +342 -0
- package/express/src/framework/queue/ui.ts +187 -0
- package/express/src/framework/queue/worker.ts +61 -0
- package/express/src/framework/realtime/broadcast.ts +46 -0
- package/express/src/framework/realtime/index.ts +2 -0
- package/express/src/framework/realtime/socket-cookie.ts +71 -0
- package/express/src/framework/realtime/socket.ts +119 -0
- package/express/src/framework/realtime/types.ts +6 -0
- package/express/src/framework/realtime/ui.ts +16 -0
- package/express/src/framework/redis/client.ts +151 -0
- package/express/src/framework/runtime/runtime.ts +23 -0
- package/express/src/framework/runtime/server-adapter.ts +34 -0
- package/express/src/framework/scheduler/lock.ts +116 -0
- package/express/src/framework/scheduler/run.ts +48 -0
- package/express/src/framework/scheduler/scheduler.ts +155 -0
- package/express/src/framework/server.ts +177 -0
- package/express/src/framework/session/session.ts +98 -0
- package/express/src/framework/storage/storage.ts +785 -0
- package/express/src/framework/support/cookie.ts +62 -0
- package/express/src/framework/support/jwt.ts +33 -0
- package/express/src/framework/support/lifecycle.ts +35 -0
- package/express/src/framework/support/logger.ts +148 -0
- package/express/src/framework/support/mail.ts +48 -0
- package/express/src/framework/support/password.ts +23 -0
- package/express/src/framework/support/upload.ts +160 -0
- package/express/src/framework/support/url.ts +41 -0
- package/express/src/middlewares/auth-middleware.ts +98 -0
- package/express/src/middlewares/role-middleware.ts +25 -0
- package/express/src/modules/auth/controllers/auth.controller.ts +358 -0
- package/express/src/modules/auth/controllers/auth.helpers.ts +104 -0
- package/express/src/modules/auth/controllers/auth.schema.ts +102 -0
- package/express/src/modules/auth/controllers/role.controller.ts +15 -0
- package/express/src/modules/auth/database/models/notifications.ts +24 -0
- package/express/src/modules/auth/database/models/role.ts +14 -0
- package/express/src/modules/auth/database/models/user.ts +46 -0
- package/express/src/modules/auth/database/seeders/role.ts +18 -0
- package/express/src/modules/auth/database/seeders/user.ts +35 -0
- package/express/src/modules/auth/jobs/forgetpass.ts +20 -0
- package/express/src/modules/auth/jobs/registeruser.ts +23 -0
- package/express/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/express/src/modules/auth/routes/api.ts +150 -0
- package/express/src/modules/auth/routes/role.ts +33 -0
- package/express/src/resources/index.html +17 -0
- package/express/src/resources/src/App.vue +5 -0
- package/express/src/resources/src/assets/css/styles.css +14761 -0
- package/express/src/resources/src/assets/css/styles.css.map +1 -0
- package/express/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
- package/express/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
- package/express/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/express/src/resources/src/assets/images/logo.png +0 -0
- package/express/src/resources/src/assets/scss/custom.css +217 -0
- package/express/src/resources/src/assets/scss/custom.css.map +1 -0
- package/express/src/resources/src/assets/scss/custom.scss +1346 -0
- package/express/src/resources/src/components/Button.vue +32 -0
- package/express/src/resources/src/components/Checkbox.vue +29 -0
- package/express/src/resources/src/components/Datepicker.vue +106 -0
- package/express/src/resources/src/components/FeatureButton.vue +53 -0
- package/express/src/resources/src/components/FloatButton.vue +33 -0
- package/express/src/resources/src/components/Href.vue +32 -0
- package/express/src/resources/src/components/Input.vue +223 -0
- package/express/src/resources/src/components/InputGroup.vue +145 -0
- package/express/src/resources/src/components/InputPasswordToggle.vue +213 -0
- package/express/src/resources/src/components/Modal.vue +55 -0
- package/express/src/resources/src/components/Pagebar.vue +26 -0
- package/express/src/resources/src/components/Select.vue +384 -0
- package/express/src/resources/src/components/Spinner.vue +42 -0
- package/express/src/resources/src/components/Switch.vue +65 -0
- package/express/src/resources/src/components/TextArea.vue +117 -0
- package/express/src/resources/src/components/Toast.vue +56 -0
- package/express/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
- package/express/src/resources/src/components/datatable/Pagination.vue +147 -0
- package/express/src/resources/src/components/datatable/SelectOpption.vue +64 -0
- package/express/src/resources/src/components/datatable/index.vue +199 -0
- package/express/src/resources/src/composables/useAuth.ts +52 -0
- package/express/src/resources/src/helpers/nformatter.ts +10 -0
- package/express/src/resources/src/helpers/utils.ts +75 -0
- package/express/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/express/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/express/src/resources/src/layouts/Layout/Header.vue +105 -0
- package/express/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/express/src/resources/src/layouts/Layout/index.vue +87 -0
- package/express/src/resources/src/main.ts +26 -0
- package/express/src/resources/src/pages/auth/forgetPassword.vue +82 -0
- package/express/src/resources/src/pages/auth/login.vue +99 -0
- package/express/src/resources/src/pages/auth/register.vue +133 -0
- package/express/src/resources/src/pages/auth/resetPassword.vue +118 -0
- package/express/src/resources/src/pages/auth/verifyEmail.vue +68 -0
- package/express/src/resources/src/pages/dashboard/index.vue +66 -0
- package/express/src/resources/src/plugins/axios.ts +31 -0
- package/express/src/resources/src/plugins/browserDetect.ts +55 -0
- package/express/src/resources/src/plugins/dialog.ts +216 -0
- package/express/src/resources/src/plugins/gum.ts +367 -0
- package/express/src/resources/src/plugins/pulse.ts +147 -0
- package/express/src/resources/src/plugins/routeProgress.ts +87 -0
- package/express/src/resources/src/router/index.ts +85 -0
- package/express/src/resources/src/stores/admin-ui.ts +148 -0
- package/express/src/resources/src/stores/auth.ts +164 -0
- package/express/src/resources/tsconfig.json +19 -0
- package/express/src/resources/vite.config.ts +46 -0
- package/express/src/storage/app/private/.gitkeep +0 -0
- package/express/src/storage/app/public/.gitkeep +0 -0
- package/express/src/storage/app/tmp/generated/.gitkeep +0 -0
- package/express/src/storage/database/nexwire.sqlite +0 -0
- package/express/src/storage/logs/.gitkeep +0 -0
- package/express/src/storage/tmp/.gitkeep +0 -0
- package/express/src/storage/trash/modules/.gitkeep +0 -0
- package/express/src/types/global.d.ts +26 -0
- package/express/tsconfig.json +19 -0
- package/express/vitest.config.ts +23 -0
- package/hono/.dockerignore +14 -0
- package/hono/.env +44 -0
- package/hono/.env.example +42 -0
- package/hono/.vscode/settings.json +26 -0
- package/hono/LICENSE +21 -0
- package/hono/README.md +211 -0
- package/hono/biome.json +76 -0
- package/hono/drizzle.config.ts +25 -0
- package/hono/gitignore-stub +24 -0
- package/hono/package.json +99 -0
- package/hono/public/.gitkeep +0 -0
- package/hono/src/config/app.ts +41 -0
- package/hono/src/config/auth.ts +12 -0
- package/hono/src/config/cache.ts +16 -0
- package/hono/src/config/cookie.ts +15 -0
- package/hono/src/config/cors.ts +12 -0
- package/hono/src/config/database.ts +29 -0
- package/hono/src/config/index.ts +83 -0
- package/hono/src/config/jwt.ts +19 -0
- package/hono/src/config/logging.ts +13 -0
- package/hono/src/config/mail.ts +24 -0
- package/hono/src/config/openapi.ts +54 -0
- package/hono/src/config/queue.ts +30 -0
- package/hono/src/config/rateLimit.ts +17 -0
- package/hono/src/config/realtime.ts +15 -0
- package/hono/src/config/redis.ts +18 -0
- package/hono/src/config/security.ts +44 -0
- package/hono/src/config/session.ts +17 -0
- package/hono/src/config/storage.ts +22 -0
- package/hono/src/config/validate.ts +40 -0
- package/hono/src/database/migrations/sqlite/0000_init.sql +61 -0
- package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +412 -0
- package/hono/src/database/migrations/sqlite/meta/_journal.json +13 -0
- package/hono/src/database/schema.ts +3 -0
- package/hono/src/env.ts +76 -0
- package/hono/src/framework/cache/cache.ts +81 -0
- package/hono/src/framework/circuit-breaker/cb.ts +60 -0
- package/hono/src/framework/database/connection.ts +196 -0
- package/hono/src/framework/database/migrate-hooks.ts +87 -0
- package/hono/src/framework/database/paginate.ts +253 -0
- package/hono/src/framework/database/schema.ts +20 -0
- package/hono/src/framework/database/seed.ts +139 -0
- package/hono/src/framework/events/dispatcher.ts +49 -0
- package/hono/src/framework/facade.ts +29 -0
- package/hono/src/framework/http/app.ts +109 -0
- package/hono/src/framework/http/cors.ts +19 -0
- package/hono/src/framework/http/logger.ts +81 -0
- package/hono/src/framework/http/metrics.ts +22 -0
- package/hono/src/framework/http/openapi.ts +42 -0
- package/hono/src/framework/http/ratelimiter.ts +172 -0
- package/hono/src/framework/http/router.ts +76 -0
- package/hono/src/framework/http/security.ts +23 -0
- package/hono/src/framework/http/static.ts +70 -0
- package/hono/src/framework/http/validation.ts +21 -0
- package/hono/src/framework/kernel.ts +48 -0
- package/hono/src/framework/maker-cli/db/core.mjs +288 -0
- package/hono/src/framework/maker-cli/db/index.mjs +204 -0
- package/hono/src/framework/maker-cli/deploy/core.mjs +1038 -0
- package/hono/src/framework/maker-cli/deploy/index.mjs +91 -0
- package/hono/src/framework/maker-cli/index.mjs +53 -0
- package/hono/src/framework/maker-cli/middleware/core.mjs +47 -0
- package/hono/src/framework/maker-cli/middleware/index.mjs +12 -0
- package/hono/src/framework/maker-cli/module/core.mjs +684 -0
- package/hono/src/framework/maker-cli/module/index.mjs +140 -0
- package/hono/src/framework/maker-cli/runtime/build-ui.mjs +17 -0
- package/hono/src/framework/maker-cli/runtime/core.mjs +543 -0
- package/hono/src/framework/maker-cli/runtime/index.mjs +104 -0
- package/hono/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
- package/hono/src/framework/maker-cli/stubs/controller/openapi.ts.stub +57 -0
- package/hono/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +58 -0
- package/hono/src/framework/maker-cli/stubs/controller/plain.ts.stub +59 -0
- package/hono/src/framework/maker-cli/stubs/controller/schema.plain.ts.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/controller/schema.ts.stub +33 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
- package/hono/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
- package/hono/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
- package/hono/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
- package/hono/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
- package/hono/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
- package/hono/src/framework/maker-cli/stubs/example/console.ts.stub +34 -0
- package/hono/src/framework/maker-cli/stubs/example/controller.ts.stub +505 -0
- package/hono/src/framework/maker-cli/stubs/example/job.ts.stub +75 -0
- package/hono/src/framework/maker-cli/stubs/example/route.api.ts.stub +207 -0
- package/hono/src/framework/maker-cli/stubs/example/route.plain.ts.stub +18 -0
- package/hono/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +42 -0
- package/hono/src/framework/maker-cli/stubs/example/schema.ts.stub +42 -0
- package/hono/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/middleware/name.ts.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/notification/controller.ts.stub +86 -0
- package/hono/src/framework/maker-cli/stubs/notification/job.ts.stub +13 -0
- package/hono/src/framework/maker-cli/stubs/notification/route.api.ts.stub +50 -0
- package/hono/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +12 -0
- package/hono/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
- package/hono/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
- package/hono/src/framework/maker-cli/stubs/route/api.ts.stub +80 -0
- package/hono/src/framework/maker-cli/stubs/route/plain.ts.stub +11 -0
- package/hono/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
- package/hono/src/framework/maker-cli/stubs/seeder/name.ts.stub +20 -0
- package/hono/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
- package/hono/src/framework/maker-cli/utils/env-config.mjs +44 -0
- package/hono/src/framework/maker-cli/utils/env-db.mjs +61 -0
- package/hono/src/framework/maker-cli/utils/file-ops.mjs +30 -0
- package/hono/src/framework/maker-cli/utils/flags.mjs +14 -0
- package/hono/src/framework/maker-cli/utils/help.mjs +50 -0
- package/hono/src/framework/maker-cli/utils/naming.mjs +13 -0
- package/hono/src/framework/maker-cli/utils/process.mjs +52 -0
- package/hono/src/framework/modules/discover.ts +54 -0
- package/hono/src/framework/modules/routes.ts +24 -0
- package/hono/src/framework/notification/index.ts +116 -0
- package/hono/src/framework/queue/clear.ts +22 -0
- package/hono/src/framework/queue/queue.ts +342 -0
- package/hono/src/framework/queue/ui.ts +214 -0
- package/hono/src/framework/queue/worker.ts +61 -0
- package/hono/src/framework/realtime/broadcast.ts +46 -0
- package/hono/src/framework/realtime/index.ts +2 -0
- package/hono/src/framework/realtime/socket-cookie.ts +68 -0
- package/hono/src/framework/realtime/socket.ts +196 -0
- package/hono/src/framework/realtime/types.ts +6 -0
- package/hono/src/framework/realtime/ui.ts +16 -0
- package/hono/src/framework/redis/client.ts +151 -0
- package/hono/src/framework/runtime/runtime.ts +23 -0
- package/hono/src/framework/runtime/server-adapter.ts +94 -0
- package/hono/src/framework/scheduler/lock.ts +116 -0
- package/hono/src/framework/scheduler/run.ts +48 -0
- package/hono/src/framework/scheduler/scheduler.ts +155 -0
- package/hono/src/framework/server.ts +183 -0
- package/hono/src/framework/session/session.ts +116 -0
- package/hono/src/framework/storage/storage.ts +785 -0
- package/hono/src/framework/support/cookie.ts +99 -0
- package/hono/src/framework/support/jwt.ts +45 -0
- package/hono/src/framework/support/lifecycle.ts +35 -0
- package/hono/src/framework/support/logger.ts +148 -0
- package/hono/src/framework/support/mail.ts +48 -0
- package/hono/src/framework/support/password.ts +23 -0
- package/hono/src/framework/support/url.ts +41 -0
- package/hono/src/middlewares/auth-middleware.ts +98 -0
- package/hono/src/middlewares/role-middleware.ts +25 -0
- package/hono/src/modules/auth/controllers/auth.controller.ts +413 -0
- package/hono/src/modules/auth/controllers/auth.helpers.ts +128 -0
- package/hono/src/modules/auth/controllers/auth.schema.ts +102 -0
- package/hono/src/modules/auth/controllers/role.controller.ts +25 -0
- package/hono/src/modules/auth/database/models/notifications.ts +24 -0
- package/hono/src/modules/auth/database/models/role.ts +14 -0
- package/hono/src/modules/auth/database/models/user.ts +46 -0
- package/hono/src/modules/auth/database/seeders/role.ts +18 -0
- package/hono/src/modules/auth/database/seeders/user.ts +35 -0
- package/hono/src/modules/auth/jobs/forgetpass.ts +20 -0
- package/hono/src/modules/auth/jobs/registeruser.ts +23 -0
- package/hono/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/hono/src/modules/auth/routes/api.ts +150 -0
- package/hono/src/modules/auth/routes/role.ts +33 -0
- package/hono/src/resources/index.html +17 -0
- package/hono/src/resources/src/App.vue +5 -0
- package/hono/src/resources/src/assets/css/styles.css +14913 -0
- package/hono/src/resources/src/assets/css/styles.css.map +1 -0
- package/hono/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
- package/hono/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
- package/hono/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/hono/src/resources/src/assets/images/logo.png +0 -0
- package/hono/src/resources/src/assets/scss/custom.css +217 -0
- package/hono/src/resources/src/assets/scss/custom.css.map +1 -0
- package/hono/src/resources/src/assets/scss/custom.scss +1346 -0
- package/hono/src/resources/src/components/Button.vue +32 -0
- package/hono/src/resources/src/components/Checkbox.vue +29 -0
- package/hono/src/resources/src/components/Datepicker.vue +106 -0
- package/hono/src/resources/src/components/FeatureButton.vue +53 -0
- package/hono/src/resources/src/components/FloatButton.vue +33 -0
- package/hono/src/resources/src/components/Href.vue +32 -0
- package/hono/src/resources/src/components/Input.vue +234 -0
- package/hono/src/resources/src/components/InputGroup.vue +149 -0
- package/hono/src/resources/src/components/InputPasswordToggle.vue +222 -0
- package/hono/src/resources/src/components/Modal.vue +55 -0
- package/hono/src/resources/src/components/Pagebar.vue +26 -0
- package/hono/src/resources/src/components/Select.vue +415 -0
- package/hono/src/resources/src/components/Spinner.vue +42 -0
- package/hono/src/resources/src/components/Switch.vue +65 -0
- package/hono/src/resources/src/components/TextArea.vue +121 -0
- package/hono/src/resources/src/components/Toast.vue +56 -0
- package/hono/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
- package/hono/src/resources/src/components/datatable/Pagination.vue +147 -0
- package/hono/src/resources/src/components/datatable/SelectOpption.vue +64 -0
- package/hono/src/resources/src/components/datatable/index.vue +199 -0
- package/hono/src/resources/src/composables/useAuth.ts +52 -0
- package/hono/src/resources/src/helpers/nformatter.ts +10 -0
- package/hono/src/resources/src/helpers/utils.ts +75 -0
- package/hono/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/hono/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/hono/src/resources/src/layouts/Layout/Header.vue +105 -0
- package/hono/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/hono/src/resources/src/layouts/Layout/index.vue +87 -0
- package/hono/src/resources/src/main.ts +26 -0
- package/hono/src/resources/src/pages/auth/forgetPassword.vue +82 -0
- package/hono/src/resources/src/pages/auth/login.vue +99 -0
- package/hono/src/resources/src/pages/auth/register.vue +133 -0
- package/hono/src/resources/src/pages/auth/resetPassword.vue +118 -0
- package/hono/src/resources/src/pages/auth/verifyEmail.vue +68 -0
- package/hono/src/resources/src/pages/dashboard/index.vue +66 -0
- package/hono/src/resources/src/plugins/axios.ts +31 -0
- package/hono/src/resources/src/plugins/browserDetect.ts +55 -0
- package/hono/src/resources/src/plugins/dialog.ts +216 -0
- package/hono/src/resources/src/plugins/gum.ts +367 -0
- package/hono/src/resources/src/plugins/pulse.ts +147 -0
- package/hono/src/resources/src/plugins/routeProgress.ts +87 -0
- package/hono/src/resources/src/router/index.ts +85 -0
- package/hono/src/resources/src/stores/admin-ui.ts +148 -0
- package/hono/src/resources/src/stores/auth.ts +164 -0
- package/hono/src/resources/tsconfig.json +19 -0
- package/hono/src/resources/vite.config.ts +46 -0
- package/hono/src/storage/app/private/.gitkeep +0 -0
- package/hono/src/storage/app/public/.gitkeep +0 -0
- package/hono/src/storage/app/tmp/generated/.gitkeep +0 -0
- package/hono/src/storage/database/nexwire.sqlite +0 -0
- package/hono/src/storage/logs/.gitkeep +0 -0
- package/hono/src/storage/tmp/.gitkeep +0 -0
- package/hono/src/storage/trash/modules/.gitkeep +0 -0
- package/hono/src/types/global.d.ts +26 -0
- package/hono/tsconfig.json +20 -0
- package/hono/vitest.config.ts +23 -0
- package/package.json +238 -0
- package/src/index.js +204 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-100" v-bind="$attrs">
|
|
3
|
+
<div class="h-100 d-flex align-items-center justify-content-center">
|
|
4
|
+
<div class="spinner-grow" :style="spinnerStyle" role="status">
|
|
5
|
+
<span class="visually-hidden">Loading...</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="fw-bold ms-2">
|
|
8
|
+
<span v-if="props.text" :class="props.textsize" :style="textStyle">
|
|
9
|
+
{{ props.text }}
|
|
10
|
+
</span>
|
|
11
|
+
<span v-else>Loading...</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { computed } from "vue";
|
|
19
|
+
|
|
20
|
+
defineOptions({ name: "Spinner", inheritAttrs: false });
|
|
21
|
+
|
|
22
|
+
interface SpinnerProps {
|
|
23
|
+
size?: string;
|
|
24
|
+
text?: string;
|
|
25
|
+
textsize?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const props = withDefaults(defineProps<SpinnerProps>(), {
|
|
29
|
+
size: "3rem",
|
|
30
|
+
text: "",
|
|
31
|
+
textsize: ""
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const spinnerStyle = computed(() => ({
|
|
35
|
+
width: props.size,
|
|
36
|
+
height: props.size
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
const textStyle = computed(() => ({
|
|
40
|
+
fontSize: props.textsize || undefined
|
|
41
|
+
}));
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="wrapperClass">
|
|
3
|
+
<label :class="props.vertical ? 'form-check-label d-block' : 'd-none'">
|
|
4
|
+
<span v-html="statusHtml"></span>
|
|
5
|
+
</label>
|
|
6
|
+
<div class="form-check form-switch d-inline-block">
|
|
7
|
+
<input
|
|
8
|
+
class="form-check-input shadow-none border-primary"
|
|
9
|
+
type="checkbox"
|
|
10
|
+
role="switch"
|
|
11
|
+
:checked="isChecked"
|
|
12
|
+
v-bind="$attrs" />
|
|
13
|
+
<label :class="props.vertical ? 'd-none' : 'form-check-label'">
|
|
14
|
+
<span v-html="statusHtml"></span>
|
|
15
|
+
</label>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { computed, useAttrs } from "vue";
|
|
22
|
+
|
|
23
|
+
defineOptions({ name: "Switch", inheritAttrs: false });
|
|
24
|
+
|
|
25
|
+
interface SwitchProps {
|
|
26
|
+
modelValue?: string | number | boolean;
|
|
27
|
+
value?: unknown[] | Record<string, unknown> | string | number | boolean;
|
|
28
|
+
vertical?: boolean;
|
|
29
|
+
checked?: boolean | number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const $attrs = useAttrs();
|
|
33
|
+
const props = defineProps<SwitchProps>();
|
|
34
|
+
|
|
35
|
+
const textLabel = computed(() => ($attrs.text as string | undefined) || "");
|
|
36
|
+
const blankLabel = computed(() => ($attrs.blank as string | undefined) || "");
|
|
37
|
+
const topclass = computed(() => ($attrs.topclass as string | undefined) || "");
|
|
38
|
+
|
|
39
|
+
const isChecked = computed(() => Boolean(props.checked));
|
|
40
|
+
|
|
41
|
+
const wrapperClass = computed(() => (props.vertical ? `text-center ${topclass.value}`.trim() : ""));
|
|
42
|
+
|
|
43
|
+
const statusHtml = computed(() => {
|
|
44
|
+
if (isChecked.value) {
|
|
45
|
+
return `<div class='d-flex justify-content-center'><span>${textLabel.value}</span><div class='rounded-circle bg-success indicator'></div></div>`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return `<div class='d-flex justify-content-center'><span>${blankLabel.value}</span><div class='rounded-circle bg-danger indicator'></div></div>`;
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style lang="scss">
|
|
53
|
+
.indicator {
|
|
54
|
+
width: 4px;
|
|
55
|
+
height: 4px;
|
|
56
|
+
margin-left: 2px;
|
|
57
|
+
margin-top: 5px;
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
60
|
+
<style lang="scss" scoped>
|
|
61
|
+
label,
|
|
62
|
+
input {
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="wrapperClass">
|
|
3
|
+
<div class="position-relative">
|
|
4
|
+
<div class="position-relative mb-1">
|
|
5
|
+
<span class="text-capitalize" v-html="inputLabel"></span>
|
|
6
|
+
<span
|
|
7
|
+
class="position-absolute text-danger rounded-circle bg-danger must"
|
|
8
|
+
:class="{ 'd-none': !props.must }"></span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="form-floating h-100">
|
|
11
|
+
<textarea
|
|
12
|
+
:value="props.modelValue"
|
|
13
|
+
class="form-control mb-0 h-100"
|
|
14
|
+
:maxlength="maxLengthAttr"
|
|
15
|
+
:aria-describedby="`${inputId}Help`"
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
rows="3"
|
|
18
|
+
@input="updateModel">
|
|
19
|
+
</textarea>
|
|
20
|
+
<label
|
|
21
|
+
:for="inputId"
|
|
22
|
+
class="d-block placeholder-label border-0"
|
|
23
|
+
:class="{ 'd-none': !placeholderText }">
|
|
24
|
+
{{ placeholderText }}
|
|
25
|
+
</label>
|
|
26
|
+
</div>
|
|
27
|
+
<label
|
|
28
|
+
class="position-absolute end-0 pe-1 text-secondary max"
|
|
29
|
+
:class="{ 'd-none': !max }"
|
|
30
|
+
style="top: 28px">
|
|
31
|
+
{{ maxCounter }}
|
|
32
|
+
</label>
|
|
33
|
+
</div>
|
|
34
|
+
<div :id="`${inputId}Help`" class="form-text text-danger" :class="{ 'd-none': !props.err }">
|
|
35
|
+
{{ props.err }}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import { computed, nextTick, onMounted, useAttrs } from "vue";
|
|
42
|
+
|
|
43
|
+
defineOptions({ name: "TextArea", inheritAttrs: false });
|
|
44
|
+
|
|
45
|
+
const $attrs = useAttrs();
|
|
46
|
+
interface TextAreaProps {
|
|
47
|
+
focus?: boolean;
|
|
48
|
+
must?: boolean;
|
|
49
|
+
err?: string | boolean;
|
|
50
|
+
modelValue?: string | number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const props = withDefaults(defineProps<TextAreaProps>(), {
|
|
54
|
+
modelValue: ""
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const inputId = computed(() => ($attrs.id as string | undefined) || "");
|
|
58
|
+
const inputLabel = computed(() => ($attrs.label as string | undefined) || "");
|
|
59
|
+
const placeholderText = computed(() => ($attrs.placeholder as string | undefined) || "");
|
|
60
|
+
const topclass = computed(() => ($attrs.topclass as string | undefined) || "");
|
|
61
|
+
|
|
62
|
+
const wrapperClass = computed(() => (topclass.value ? `${topclass.value} position-relative` : "mb-2"));
|
|
63
|
+
|
|
64
|
+
const max = computed<number | null>(() => {
|
|
65
|
+
const raw = $attrs.maxlength as string | number | undefined;
|
|
66
|
+
return raw != null ? Number(raw) : null;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const maxLengthAttr = computed<number | undefined>(() => max.value ?? undefined);
|
|
70
|
+
const maxCounter = computed(() => (max.value == null ? "" : max.value - String(props.modelValue).length));
|
|
71
|
+
|
|
72
|
+
const emit = defineEmits<(event: "update:modelValue", value: string) => void>();
|
|
73
|
+
const updateModel = (e: Event) => {
|
|
74
|
+
const target = e.target as HTMLTextAreaElement;
|
|
75
|
+
emit("update:modelValue", target.value);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
onMounted(() => {
|
|
79
|
+
if (!props.focus || !inputId.value) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
nextTick(() => {
|
|
84
|
+
const textarea = document.querySelector(`#${inputId.value}`) as HTMLTextAreaElement | null;
|
|
85
|
+
textarea?.focus();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style lang="scss" scoped>
|
|
91
|
+
.form-floating {
|
|
92
|
+
label {
|
|
93
|
+
top: -1px;
|
|
94
|
+
left: 1px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
textarea:focus+label,
|
|
98
|
+
textarea:not(:placeholder-shown)+label {
|
|
99
|
+
top: -6px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.placeholder-label {
|
|
104
|
+
color: #cccccc !important;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.must {
|
|
108
|
+
width: 4px;
|
|
109
|
+
height: 4px;
|
|
110
|
+
margin-left: 2px;
|
|
111
|
+
margin-top: 5px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.max {
|
|
115
|
+
font-size: 0.6rem;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Teleport to="#toast-show">
|
|
3
|
+
<div
|
|
4
|
+
ref="notify"
|
|
5
|
+
class="toast position-fixed"
|
|
6
|
+
role="alert"
|
|
7
|
+
aria-live="assertive"
|
|
8
|
+
aria-atomic="true"
|
|
9
|
+
style="z-index: 1000000; top: 10px; right: 23px"
|
|
10
|
+
data-bs-delay="2000">
|
|
11
|
+
<div :class="`text-bg-${bgcolor} align-items-center rounded-1 shadow-sm`">
|
|
12
|
+
<div class="d-flex">
|
|
13
|
+
<div class="toast-body">
|
|
14
|
+
{{ message }}
|
|
15
|
+
</div>
|
|
16
|
+
<button
|
|
17
|
+
type="button"
|
|
18
|
+
class="btn-close btn-close-white me-2 m-auto"
|
|
19
|
+
data-bs-dismiss="toast"
|
|
20
|
+
aria-label="Close"></button>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</Teleport>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import Toast from "bootstrap/js/dist/toast.js";
|
|
29
|
+
import { ref } from "vue";
|
|
30
|
+
|
|
31
|
+
defineOptions({ name: "Toast", inheritAttrs: false });
|
|
32
|
+
|
|
33
|
+
interface ToastProps {
|
|
34
|
+
icon?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
defineProps<ToastProps>();
|
|
38
|
+
|
|
39
|
+
const notify = ref<HTMLElement | null>(null);
|
|
40
|
+
const message = ref("");
|
|
41
|
+
const bgcolor = ref("primary");
|
|
42
|
+
|
|
43
|
+
const toastme = (msg: string, bg: string) => {
|
|
44
|
+
message.value = msg;
|
|
45
|
+
bgcolor.value = bg;
|
|
46
|
+
if (!notify.value) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const toast = Toast.getOrCreateInstance(notify.value);
|
|
50
|
+
toast.show();
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
defineExpose({ toastme });
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="skeleton card border">
|
|
3
|
+
<div class="card-header border-bottom-0 pb-0 px-2 px-sm-3">
|
|
4
|
+
<div class="row align-items-center">
|
|
5
|
+
<div class="col-12 col-sm-6 col-lg-3 col-xl-3 mb-2 mb-lg-0 d-flex">
|
|
6
|
+
<div class="py-2 rounded-1 border bg-custom ps-3 me-2"></div>
|
|
7
|
+
<div class="form-control py-2 bg-custom"></div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="col-12 col-sm-6 col-lg-4 col-xl-5 mb-2 mb-lg-0">
|
|
10
|
+
<slot name="extra-option"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="col-12 col-lg-5 col-xl-4">
|
|
13
|
+
<div class="row gx-1">
|
|
14
|
+
<div class="col-2 col-sm-4 col-md-6 col-lg-2 text-start text-lg-end">
|
|
15
|
+
<span class="form-control py-2 bg-custom"></span>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="mb-2 mb-sm-0 text-start col-6 col-sm-6 col-md-4 col-lg-7">
|
|
18
|
+
<span class="form-control py-2 bg-custom"></span>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="col-4 col-sm-2 col-md-2 col-lg-3 text-end">
|
|
21
|
+
<span class="bg-custom form-control py-2"></span>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="card-body py-3 px-2 px-sm-3">
|
|
28
|
+
<div class="table-responsive rounded-1">
|
|
29
|
+
<table class="table table-bordered table-striped table-sm align-middle m-0">
|
|
30
|
+
<thead>
|
|
31
|
+
<tr>
|
|
32
|
+
<th v-for="dt in colCount" :key="`h-${dt}`" class="bg-custom py-2"></th>
|
|
33
|
+
</tr>
|
|
34
|
+
</thead>
|
|
35
|
+
<tbody>
|
|
36
|
+
<tr v-for="r in rowCount" :key="`r-${r}`">
|
|
37
|
+
<td v-for="c in colCount" :key="`c-${r}-${c}`" class="bg-custom py-2"></td>
|
|
38
|
+
</tr>
|
|
39
|
+
</tbody>
|
|
40
|
+
</table>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="card-footer border-top-0 pt-0 px-2 px-sm-3">
|
|
44
|
+
<div class="row align-items-center">
|
|
45
|
+
<div class="col-12 col-md-5 mb-2 mb-md-0"></div>
|
|
46
|
+
<div class="col-12 col-md-7 text-center text-md-end">
|
|
47
|
+
<span class="form-control bg-custom py-2"></span>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup lang="ts">
|
|
55
|
+
import { computed, useAttrs } from "vue";
|
|
56
|
+
|
|
57
|
+
defineOptions({ inheritAttrs: false });
|
|
58
|
+
|
|
59
|
+
const $attrs = useAttrs();
|
|
60
|
+
const colCount = computed(() => Number($attrs.col ?? 1));
|
|
61
|
+
const rowCount = computed(() => Number($attrs.row ?? 1));
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style lang="scss" scoped>
|
|
65
|
+
table,
|
|
66
|
+
tr,
|
|
67
|
+
th,
|
|
68
|
+
td {
|
|
69
|
+
border-color: #cccccc;
|
|
70
|
+
animation: anim 3s infinite;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.bg-custom {
|
|
74
|
+
animation: anim 3s infinite;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@keyframes anim {
|
|
78
|
+
0% {
|
|
79
|
+
background-color: #efefef;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
25% {
|
|
83
|
+
background-color: #f8f8f8;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
50% {
|
|
87
|
+
background-color: #efefef;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
75% {
|
|
91
|
+
background-color: #f8f8f8;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
100% {
|
|
95
|
+
background-color: #efefef;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="row">
|
|
3
|
+
<div class="col-12 col-md-6 mb-3 mb-md-0">
|
|
4
|
+
<div class="py-2 text-black-50 text-center text-md-start">
|
|
5
|
+
Showing {{ page.from }} to {{ page.to }} of {{ nFormatter(page.total) }} entries
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="col-12 col-md-6">
|
|
9
|
+
<nav :class="['datatable-pagination', `pagination-${variant}`]" aria-label="Page navigation">
|
|
10
|
+
<ul class="pagination justify-content-center justify-content-md-end">
|
|
11
|
+
<!-- First -->
|
|
12
|
+
<li :class="['page-item', { disabled: noPreviousPage }]">
|
|
13
|
+
<button type="button" class="page-link" :aria-disabled="noPreviousPage ? 'true' : 'false'"
|
|
14
|
+
:tabindex="noPreviousPage ? -1 : 0" @click.prevent="!noPreviousPage && loadPage(1)">
|
|
15
|
+
<i class="bi bi-chevron-double-left"></i>
|
|
16
|
+
</button>
|
|
17
|
+
</li>
|
|
18
|
+
|
|
19
|
+
<!-- Prev -->
|
|
20
|
+
<li :class="['page-item', { disabled: noPreviousPage }]">
|
|
21
|
+
<button type="button" class="page-link" :aria-disabled="noPreviousPage ? 'true' : 'false'"
|
|
22
|
+
:tabindex="noPreviousPage ? -1 : 0"
|
|
23
|
+
@click.prevent="!noPreviousPage && loadPage(props.data.current_page - 1)">
|
|
24
|
+
<i class="bi bi-chevron-left"></i>
|
|
25
|
+
</button>
|
|
26
|
+
</li>
|
|
27
|
+
|
|
28
|
+
<li class="page-item">
|
|
29
|
+
<div class="input-group input-group-sm">
|
|
30
|
+
<Input v-model="page.page" type="text" category="number" topclass="m-0" class="text-center"
|
|
31
|
+
style="width: 100px" @keyup.enter="loadPage(page.page)" />
|
|
32
|
+
</div>
|
|
33
|
+
</li>
|
|
34
|
+
|
|
35
|
+
<li class="page-item">
|
|
36
|
+
<span class="page-link text-nowrap"> of {{ nFormatter(props.data.last_page) }} </span>
|
|
37
|
+
</li>
|
|
38
|
+
|
|
39
|
+
<!-- Next -->
|
|
40
|
+
<li :class="['page-item', { disabled: noNextPage }]">
|
|
41
|
+
<button type="button" class="page-link" :aria-disabled="noNextPage ? 'true' : 'false'"
|
|
42
|
+
:tabindex="noNextPage ? -1 : 0" @click.prevent="!noNextPage && loadPage(props.data.current_page + 1)">
|
|
43
|
+
<i class="bi bi-chevron-right"></i>
|
|
44
|
+
</button>
|
|
45
|
+
</li>
|
|
46
|
+
|
|
47
|
+
<!-- Last -->
|
|
48
|
+
<li :class="['page-item', { disabled: noNextPage }]">
|
|
49
|
+
<button type="button" class="page-link" :aria-disabled="noNextPage ? 'true' : 'false'"
|
|
50
|
+
:tabindex="noNextPage ? -1 : 0" @click.prevent="!noNextPage && loadPage(props.data.last_page)">
|
|
51
|
+
<i class="bi bi-chevron-double-right"></i>
|
|
52
|
+
</button>
|
|
53
|
+
</li>
|
|
54
|
+
</ul>
|
|
55
|
+
</nav>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { computed, reactive, watchEffect } from "vue";
|
|
62
|
+
import { useRoute } from "vue-router";
|
|
63
|
+
import Input from "@/components/Input.vue";
|
|
64
|
+
import { formatCompactNumber } from "@/helpers/nformatter";
|
|
65
|
+
import { useGum } from "@/plugins/gum";
|
|
66
|
+
|
|
67
|
+
interface PaginationData {
|
|
68
|
+
current_page: number;
|
|
69
|
+
last_page: number;
|
|
70
|
+
per_page: number;
|
|
71
|
+
total: number;
|
|
72
|
+
path: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface PaginationProps {
|
|
76
|
+
data: PaginationData;
|
|
77
|
+
selectedoption?: string | number;
|
|
78
|
+
search?: string;
|
|
79
|
+
variant?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const props = withDefaults(defineProps<PaginationProps>(), {
|
|
83
|
+
search: "",
|
|
84
|
+
variant: "dark"
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const gum = useGum();
|
|
88
|
+
const route = useRoute();
|
|
89
|
+
|
|
90
|
+
const page = reactive({ page: 1, from: 0, to: 0, total: 0 });
|
|
91
|
+
|
|
92
|
+
const noPreviousPage = computed(() => props.data.current_page - 1 <= 0);
|
|
93
|
+
const noNextPage = computed(() => props.data.current_page + 1 > props.data.last_page);
|
|
94
|
+
|
|
95
|
+
const loadPage = (pageNo: string | number) => {
|
|
96
|
+
let p = parseInt(String(pageNo), 10);
|
|
97
|
+
|
|
98
|
+
// fallback if NaN
|
|
99
|
+
if (Number.isNaN(p)) p = props.data.current_page;
|
|
100
|
+
|
|
101
|
+
const last = Number(props.data.last_page) || 1;
|
|
102
|
+
|
|
103
|
+
// clamp between 1 and last
|
|
104
|
+
if (p < 1) p = 1;
|
|
105
|
+
if (p > last) p = last;
|
|
106
|
+
|
|
107
|
+
return gum.get(props.data.path, {
|
|
108
|
+
query: { page: p, size: props.selectedoption, search: props.search },
|
|
109
|
+
routePath: route.path,
|
|
110
|
+
preserveState: true,
|
|
111
|
+
preserveScroll: true,
|
|
112
|
+
skipFetch: true
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const nFormatter = formatCompactNumber;
|
|
117
|
+
|
|
118
|
+
watchEffect(() => {
|
|
119
|
+
// "Showing {$from} to {$to} of {$total} entries"
|
|
120
|
+
page.page = props.data.current_page;
|
|
121
|
+
page.from = (props.data.current_page - 1) * props.data.per_page + 1;
|
|
122
|
+
page.to = Math.min(props.data.current_page * props.data.per_page, props.data.total);
|
|
123
|
+
page.total = props.data.total;
|
|
124
|
+
});
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<style lang="scss" scoped>
|
|
128
|
+
ul.pagination {
|
|
129
|
+
margin: 0;
|
|
130
|
+
|
|
131
|
+
:deep(.page-item.disabled .page-link),
|
|
132
|
+
:deep(.page-link:disabled),
|
|
133
|
+
:deep(.page-link[aria-disabled="true"]) {
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
cursor: not-allowed;
|
|
136
|
+
opacity: 0.5;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.page-link {
|
|
140
|
+
border-radius: 5px !important;
|
|
141
|
+
margin-left: 0;
|
|
142
|
+
border-color: #cdcdcd !important;
|
|
143
|
+
color: inherit;
|
|
144
|
+
box-shadow: none;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="d-flex align-items-center justify-content-center justify-content-md-start mb-2 mb-md-0" :class="{ 'd-none': !props.isOptions }">
|
|
3
|
+
Show
|
|
4
|
+
<select
|
|
5
|
+
v-model="selectedoption"
|
|
6
|
+
class="form-select shadow-none w-auto mx-2"
|
|
7
|
+
@change="selectOption">
|
|
8
|
+
<option v-for="(val, i) in props.option" :key="i" :value="val">{{ val }}</option>
|
|
9
|
+
</select>
|
|
10
|
+
entries
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { ref, watch } from "vue";
|
|
16
|
+
import { useRoute } from "vue-router";
|
|
17
|
+
import { useGum } from "@/plugins/gum";
|
|
18
|
+
|
|
19
|
+
interface DataPage {
|
|
20
|
+
path: string;
|
|
21
|
+
current_page: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface SelectOptionProps {
|
|
25
|
+
data: DataPage;
|
|
26
|
+
search?: string;
|
|
27
|
+
isOptions?: boolean;
|
|
28
|
+
option?: Array<string | number>;
|
|
29
|
+
selectedoption?: string | number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const props = withDefaults(defineProps<SelectOptionProps>(), {
|
|
33
|
+
search: "",
|
|
34
|
+
isOptions: true,
|
|
35
|
+
option: () => []
|
|
36
|
+
});
|
|
37
|
+
const gum = useGum();
|
|
38
|
+
const route = useRoute();
|
|
39
|
+
|
|
40
|
+
// select option and pass SelectOption component
|
|
41
|
+
const selectedoption = ref<string | number | undefined>(props.selectedoption);
|
|
42
|
+
|
|
43
|
+
watch(
|
|
44
|
+
() => props.selectedoption,
|
|
45
|
+
(value) => {
|
|
46
|
+
selectedoption.value = value;
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const selectOption = (e: Event) => {
|
|
51
|
+
const target = e.target as HTMLSelectElement;
|
|
52
|
+
selectedoption.value = target.value;
|
|
53
|
+
|
|
54
|
+
return gum.get(props.data.path, {
|
|
55
|
+
query: { page: props.data.current_page, size: selectedoption.value, search: props.search },
|
|
56
|
+
routePath: route.path,
|
|
57
|
+
preserveState: true,
|
|
58
|
+
preserveScroll: true,
|
|
59
|
+
skipFetch: true
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style lang="scss" scoped></style>
|