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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eherve/angular-material-range-selector

v22.0.0

Published

```sh npm install @eherve/angular-material-range-selector moment @angular/material-moment-adapter ```

Readme

Angular Material Range Selector

npm install @eherve/angular-material-range-selector moment @angular/material-moment-adapter

Angular/Material/CDK 22.2+, Moment 2.30 and RxJS 7.8 are peer dependencies. Import the standalone RangeSelectorComponent or RangeSelectorModule from @eherve/angular-material-range-selector. Configure the application's Material theme and icons as usual. No sésiO services, layout directives, chart library or FullCalendar dependency is required.

<app-range-selector display="toolbar" (stateChanged)="setPeriod($event)">
  <button rangeActions mat-button (click)="refresh()">Actualiser</button>
  <app-report [period]="period()" />
</app-range-selector>

Public contract

  • display: card (default) or toolbar.
  • kind: past (default) or future, for rolling amount/unit presets.
  • ranges: optional RangeSelectorOption[]; defaults to year/month/week/day. Options have id, label and either view, amount/unit, or a range callback returning { start: Date, end: Date }. HTML labels are sanitized by Angular.
  • selected: optional initial/current preset, matched by stable identity.
  • defaultView: month by default; allowAllDates and showToday default to true.
  • navigation: optional RangeSelectorNavigation, whose selectedId, title, disableToday, select, previous, next and today belong to the host calendar. This mode delegates navigation without initializing or emitting calculated dates.
  • datepickerPanelClass: optional class(es) applied to the datepicker overlay.
  • changed: emits RangeDate only when finite date bounds change.
  • stateChanged: emits { allDates, view, dateRange }; all-dates has a null range.
  • setRange, changeView, prev, next, today, showAllDates remain public.

Calendar periods use local inclusive start/end-of-period boundaries. Manual ranges are normalized to inclusive whole days. Rolling ranges retain their existing past/future semantics. Week boundaries follow the configured Moment locale.

Project business actions with [rangeActions] and associated charts, tables, calendars, loading indicators and errors into the default content slot. Elements marked #rangeElement may implement RangeSelectorElement: optional setExtremes(range, redraw, trigger) and clearExtremes(redraw, trigger) methods are called with trigger range-selector. Charts remain owned by the application.

Inherited theme

The component includes its styles. Set public tokens on the component or any ancestor; existing instances respond to changes without input updates.

| Token | Default / role | | --- | --- | | --ngx-mat-range-selector-header-background | Material primary | | --ngx-mat-range-selector-header-text | Material on-primary | | --ngx-mat-range-selector-selected-background | Shared accent, then Material primary-container | | --ngx-mat-range-selector-selected-text | Shared on-accent, then Material on-primary-container | | --ngx-mat-range-selector-control-border | Translucent header text | | --ngx-mat-range-selector-control-height | Shared control-height, then 32px | | --ngx-mat-extended-space-1 … space-3 | 4 / 8 / 16px | | --ngx-mat-extended-radius | 8px | | --ngx-mat-extended-surface | Material surface | | --ngx-mat-extended-text | Material on-surface | | --range-selector-content-gap | Shared space-2 | | --ngx-mat-range-selector-toolbar-margin | 0px; toolbar margin when --card-margin is unset | | --card-margin | Shared space-2 in card mode |

.brand-panel {
  --ngx-mat-range-selector-header-background: var(--brand-primary);
  --ngx-mat-range-selector-header-text: var(--brand-on-primary);
  --ngx-mat-range-selector-selected-background: var(--brand-accent);
  --ngx-mat-range-selector-selected-text: var(--brand-on-accent);
}

All styles are scoped under app-range-selector, including projected toolbar controls. Material components use public Sass override APIs. The datepicker popup inherits the application's Material theme through the CDK overlay container. For a subtree-specific theme, apply its public Material theme/datepicker overrides to a global class passed as datepickerPanelClass; ancestor CSS variables do not automatically cross into an overlay attached to the document body.

Labels and date formats

Provide RangeSelectorIntl (or update its typed messages dictionary and call changes.next()) to translate default presets, buttons, accessible navigation labels and date placeholders. Defaults are French. Refreshing labels preserves selected dates and custom presets. The package does not require $localize.

The component provides a Moment date adapter, inherits MAT_DATE_LOCALE and uses French numeric date formats by default. Configure Moment locales in the host. Override RANGE_SELECTOR_DATE_FORMATS with a MatDateFormats value to change parsing/display formats without replacing the application's date adapter. This package intentionally uses Moment; a native/Day.js adapter is not supported.

Validation and demo

npm run test:range-selector
npm run build:range-selector

The demo application's /range-selector route demonstrates card/toolbar displays, custom periods, projected actions and independently themed instances.