npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ggc12319/simple-vue-time-schedule

v1.0.2

Published

A simple, drag-and-drop time schedule selector for Vue 3.

Readme

simple-vue-time-schedule

A simple, drag-and-drop time schedule selector for Vue 3.

Simple Vue Time Schedule

Features

  • 📅 Drag-and-drop time selection
  • 🚫 Support for disabled time ranges
  • 🌍 Internationalization (i18n) support
  • 🎨 Customizable theme via CSS variables
  • 📦 TypeScript support
  • 📱 Responsive design

Installation

npm install @ggc12319/simple-vue-time-schedule
# or
pnpm add @ggc12319/simple-vue-time-schedule
# or
yarn add @ggc12319/simple-vue-time-schedule

Usage

Global Registration

import { createApp } from 'vue'
import App from './App.vue'
import SimpleTimeSchedule from '@ggc12319/simple-vue-time-schedule'
import '@ggc12319/simple-vue-time-schedule/style.css'

const app = createApp(App)
app.use(SimpleTimeSchedule)
app.mount('#app')

Local Registration

<script setup>
import { ref } from 'vue'
import { TimeSchedule } from '@ggc12319/simple-vue-time-schedule'
import '@ggc12319/simple-vue-time-schedule/style.css'

const schedule = ref([])
</script>

<template>
  <TimeSchedule v-model="schedule" />
</template>

API

Props

| Name | Type | Default | Description | | -------------------- | ------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- | | modelValue | string[][] | [] | The selected time ranges. Two-dimensional array where index corresponds to the day (0-6). Example: [['09:00~12:00'], [], ...] | | disabled | string[][] | [] | Disabled time ranges. Same format as modelValue. | | labels | string[] | ['星期一', ...] | Labels for the rows (e.g., days of the week). | | readonly | boolean | false | If true, disables interaction. | | canDrop | boolean | true | Whether drag-and-drop is enabled (currently behaves same as readonly for selection). | | canOverlapDisabled | boolean | false | If true, allows selecting time ranges that overlap with disabled areas (removes disabled status). | | showFooter | boolean | true | Whether to show the footer with selected ranges summary. | | showHeader | boolean | true | Whether to show the header with time labels. | | showCheckbox | boolean | false | Whether to show checkboxes for selecting entire rows. | | showDateLabel | boolean | true | Whether to show the row labels column. | | labelWidth | number | 75 | Width of the label column in pixels. | | textConfig | object | {} | Configuration for text strings (i18n). See below. | | theme | object | {} | Theme configuration object. See below. |

Events

| Name | Arguments | Description | | ------------------- | --------------------- | ----------------------------------------------------------------------- | | update:modelValue | (value: string[][]) | Emitted when selection changes. Used for v-model. | | change | (value: string[][]) | Alias for update:modelValue. | | error | (message: string) | Emitted when an error occurs (e.g., trying to select an invalid range). |

Text Configuration (textConfig)

Default values:

{
  am: '00:00 - 12:00',
  pm: '12:00 - 24:00',
  error: '选择的时间有冲突' // 'Time conflict detected'
}

Theme Configuration (theme)

You can pass a theme prop or provide it globally via plugin options.

{
  primaryColor: '#338aff',   // Selected color
  errorColor: '#f70909',     // Error/Overlap color
  disabledColor: '#ddd',     // Disabled color
  hoverBg: '#f0f0f0',        // Hover background
  borderColor: '#ebebeb',    // Border color
  textColor: '#333',         // Main text color
  subtextColor: '#666'       // Secondary text color
}

Customization

CSS Variables

You can also override styles using CSS variables in your parent component:

.schedule {
  --schedule-primary-color: #338aff;
  --schedule-error-color: #f70909;
  --schedule-disabled-color: #ddd;
  --schedule-hover-bg: #f0f0f0;
  --schedule-border-color: #ebebeb;
  --schedule-text-color: #333;
  --schedule-subtext-color: #666;
}

License

MIT