Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@svelte-plugins/datepicker

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@svelte-plugins/datepicker - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

dist/datepicker.d.ts

@@ -89,2 +89,8 @@ import type { SvelteComponent } from 'svelte';

/**
* Callback function to handle the navigation click event for months and years
* @type {(event: Object) => void}
*/
onNavigationChange?: (event: Object) => void;
/**
* Indicates whether the date picker should always be shown.

@@ -145,5 +151,5 @@ */

export interface DatePickerSlots {
default: {};
default?: {};
}
export default class DatePicker extends SvelteComponent<DatePickerProps, DatePickerEvents, DatePickerSlots> {}

@@ -52,6 +52,54 @@ import { render } from '@testing-library/svelte';

it('should render the component', () => {
it('should render a single datepicker', () => {
const { container } = TestHarness(config);
expect(container).toMatchSnapshot();
});
it('should render a range picker', () => {
const { container } = TestHarness({ ...config, isRange: true, isMultipane: true });
expect(container).toMatchSnapshot();
});
it('should render a date picker with time selection', () => {
const { container } = TestHarness({ ...config, showTimePicker: true });
expect(container).toMatchSnapshot();
});
it('should render a range picker with presets', () => {
const { container } = TestHarness({ ...config, isRange: true, showPresets: true });
expect(container).toMatchSnapshot();
});
it('should render a date picker without year controls', () => {
const { container } = TestHarness({ ...config, showYearControls: false });
expect(container).toMatchSnapshot();
});
it('should render a date picker with Monday as start of week', () => {
const { container } = TestHarness({ ...config, startOfWeek: 1 });
expect(container).toMatchSnapshot();
});
it('should render a date picker with my custom locale', () => {
const { container } = TestHarness({
...config,
dowLabels: ['Au', 'Bo', 'Cu', 'De', 'Eh', 'Fr', 'Ga'],
monthLabels: [
'Qanuary',
'Webruary',
'Earch',
'Rpril',
'Tay',
'Yune',
'Uuly',
'Iugust',
'Oeptember',
'Pctober',
'Aovember',
'Secember'
]
});
expect(container).toMatchSnapshot();
});
});

13

package.json
{
"name": "@svelte-plugins/datepicker",
"description": "A simple datepicker component designed for Svelte.",
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",

@@ -29,6 +29,11 @@ "author": "Kieran Boyle (https://github.com/dysfunc)",

"datepicker",
"rangepicker",
"timepicker",
"daterange",
"timepicker",
"date picker",
"time picker",
"range picker",
"date range",
"calendar",
"date-time",
"picker",
"svelte",

@@ -42,3 +47,3 @@ "components",

"build:docs": "npm --prefix ./docs run build",
"deploy": "pnpm build:docs && npx gh-pages -d docs/build",
"deploy:docs": "pnpm build:docs && npx gh-pages -d docs/build",
"check": "svelte-check --tsconfig ./tsconfig.json",

@@ -45,0 +50,0 @@ "lint": "eslint -c ./.eslintrc.json --fix \"src/**/*.{test.js,js,ts,json,svelte}\"",

@@ -81,2 +81,8 @@ # @svelte-plugins/datepicker

### Events
| Prop | Description | Default |
| :----------------- | :------------------------------------------------------------------------------------ | :-------------------------- |
| onDayClick | Callback function to handle day click events. | `function`
| onNavigationChange | Callback function to handle the navigation click event for months and years | `function`
## Theming

@@ -83,0 +89,0 @@ You can customize DatePicker theme using several methods:

@@ -89,2 +89,8 @@ import type { SvelteComponent } from 'svelte';

/**
* Callback function to handle the navigation click event for months and years
* @type {(event: Object) => void}
*/
onNavigationChange?: (event: Object) => void;
/**
* Indicates whether the date picker should always be shown.

@@ -91,0 +97,0 @@ */

@@ -52,6 +52,54 @@ import { render } from '@testing-library/svelte';

it('should render the component', () => {
it('should render a single datepicker', () => {
const { container } = TestHarness(config);
expect(container).toMatchSnapshot();
});
it('should render a range picker', () => {
const { container } = TestHarness({ ...config, isRange: true, isMultipane: true });
expect(container).toMatchSnapshot();
});
it('should render a date picker with time selection', () => {
const { container } = TestHarness({ ...config, showTimePicker: true });
expect(container).toMatchSnapshot();
});
it('should render a range picker with presets', () => {
const { container } = TestHarness({ ...config, isRange: true, showPresets: true });
expect(container).toMatchSnapshot();
});
it('should render a date picker without year controls', () => {
const { container } = TestHarness({ ...config, showYearControls: false });
expect(container).toMatchSnapshot();
});
it('should render a date picker with Monday as start of week', () => {
const { container } = TestHarness({ ...config, startOfWeek: 1 });
expect(container).toMatchSnapshot();
});
it('should render a date picker with my custom locale', () => {
const { container } = TestHarness({
...config,
dowLabels: ['Au', 'Bo', 'Cu', 'De', 'Eh', 'Fr', 'Ga'],
monthLabels: [
'Qanuary',
'Webruary',
'Earch',
'Rpril',
'Tay',
'Yune',
'Uuly',
'Iugust',
'Oeptember',
'Pctober',
'Aovember',
'Secember'
]
});
expect(container).toMatchSnapshot();
});
});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc