New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-calendar-timeline

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-calendar-timeline - npm Package Compare versions

Comparing version 0.0.13 to 0.1.1

esm2020/lib/divisions-adaptor/base-division-adaptor.mjs

3

lib/formatters/day-scale-formatter.d.ts

@@ -1,3 +0,2 @@

import { IScaleColumn, IScaleGroup } from "../scale-generator/models";
import { IScaleFormatter } from "./scale-formatter.interface";
import { IScaleColumn, IScaleFormatter, IScaleGroup } from "../models";
import { InjectionToken } from "@angular/core";

@@ -4,0 +3,0 @@ import * as i0 from "@angular/core";

@@ -1,3 +0,2 @@

import { IScaleColumn, IScaleGroup } from "../scale-generator/models";
import { IScaleFormatter } from "./scale-formatter.interface";
import { IScaleColumn, IScaleFormatter, IScaleGroup } from "../models";
import { InjectionToken } from "@angular/core";

@@ -4,0 +3,0 @@ import * as i0 from "@angular/core";

@@ -1,3 +0,2 @@

import { IScaleColumn, IScaleGroup } from "../scale-generator/models";
import { IScaleFormatter } from "./scale-formatter.interface";
import { IScaleColumn, IScaleFormatter, IScaleGroup } from "../models";
import { InjectionToken } from "@angular/core";

@@ -4,0 +3,0 @@ import * as i0 from "@angular/core";

@@ -1,3 +0,2 @@

import { IItemsBuilder } from "./items-builder.interface";
import { ITimelineItem } from "../models";
import { ITimelineItem, IItemsBuilder } from "../models";
export declare class ItemsBuilder implements IItemsBuilder {

@@ -4,0 +3,0 @@ private _items;

@@ -5,1 +5,5 @@ export * from "./id-object";

export * from "./date-input";
export * from "./division-adapter";
export * from "./scale";
export * from "./items-builder";
export * from "./zooms-builder";
import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from "@angular/core";
import { ResizeEvent } from "angular-resizable-element";
import { ITimelineItem } from "../models/item";
import { IIdObject } from "../models/id-object";
import { ITimelineItem, IIdObject } from "../models";
import * as i0 from "@angular/core";

@@ -6,0 +5,0 @@ export declare class TimelinePanelComponent implements OnChanges {

@@ -1,6 +0,3 @@

import { IScale, IScaleGenerator } from "./models";
import { IScale, IScaleFormatter, IScaleGenerator, DateInput, IItemsBuilder } from "../models";
import { Injector } from "@angular/core";
import { IScaleFormatter } from "../formatters/scale-formatter.interface";
import { IItemsBuilder } from "../items-builder/items-builder.interface";
import { DateInput } from "../models/date-input";
import * as i0 from "@angular/core";

@@ -7,0 +4,0 @@ export declare abstract class BaseScaleGenerator implements IScaleGenerator {

import { BaseScaleGenerator } from './base-scale-generator';
import { IScale, IScaleColumn, IScaleGenerator, IScaleGroup } from './models';
import { IScale, IScaleColumn, IScaleGenerator, IScaleGroup } from '../models/scale';
import { DateInput } from "../models/date-input";
import * as i0 from "@angular/core";
export declare class DefaultDayScaleGenerator extends BaseScaleGenerator implements IScaleGenerator {
formatter: import("../formatters/scale-formatter.interface").IScaleFormatter;
formatter: import("../models/scale").IScaleFormatter;
protected readonly countOfMonthsAfterLastItem = 5;

@@ -8,0 +8,0 @@ protected readonly countOfMonthsBeforeFirstItem = 1;

import { BaseScaleGenerator } from './base-scale-generator';
import { IScale, IScaleColumn, IScaleGenerator, IScaleGroup } from './models';
import { IScale, IScaleColumn, IScaleGenerator, IScaleGroup } from '../models/scale';
import { DateInput } from "../models";
import * as i0 from "@angular/core";
export declare class DefaultMonthScaleGenerator extends BaseScaleGenerator implements IScaleGenerator {
formatter: import("../formatters/scale-formatter.interface").IScaleFormatter;
formatter: import("../models").IScaleFormatter;
protected readonly countOfYearsAfterLastItem = 2;

@@ -8,0 +8,0 @@ protected readonly countOfYearsBeforeFirstItem = 2;

import { BaseScaleGenerator } from './base-scale-generator';
import { IScale, IScaleGenerator } from './models';
import { IScale, IScaleGenerator } from '../models/scale';
import { DateInput } from "../models/date-input";
import * as i0 from "@angular/core";
export declare class DefaultWeekScaleGenerator extends BaseScaleGenerator implements IScaleGenerator {
formatter: import("../formatters/scale-formatter.interface").IScaleFormatter;
formatter: import("../models/scale").IScaleFormatter;
protected readonly countOfWeeksAfterLastItem = 24;

@@ -8,0 +8,0 @@ protected readonly countOfWeeksBeforeFirstItem = 4;

@@ -1,5 +0,2 @@

import { IScale, IScaleColumn, IScaleGroup } from '../scale-generator/models';
import { IScaleFormatter } from "../formatters/scale-formatter.interface";
import { IIdObject } from "../models/id-object";
import { ITimelineZoom } from "../models/zoom";
import { IIdObject, ITimelineZoom, IScale, IScaleColumn, IScaleFormatter, IScaleGroup } from "../models";
import * as i0 from "@angular/core";

@@ -6,0 +3,0 @@ export declare class TimelineScaleHeaderComponent {

import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, TemplateRef } from '@angular/core';
import { ScaleGeneratorsManager } from './scale-generator/scale-generators-manager';
import { ResizeEvent } from 'angular-resizable-element';
import { DivisionsAdaptorsManager } from './divisions-calculator/divisions-adaptors-factory';
import { IScale, IScaleGenerator } from './scale-generator/models';
import { IDivisionAdaptor } from "./divisions-calculator/base-divisions-adaptor";
import { IItemsBuilder } from "./items-builder/items-builder.interface";
import { IDivisionAdaptor, IIdObject, IItemsBuilder, IScale, IScaleGenerator, ITimelineItem, ITimelineZoom } from './models';
import { ZoomsBuilder } from "./zooms-builder/zooms-builder";
import { DragEndEvent } from "angular-draggable-droppable/lib/draggable.directive";
import { ITimelineZoom, IIdObject, ITimelineItem } from "./models";
import { StrategyManager } from "./strategy-manager";
import * as i0 from "@angular/core";
export declare class TimelineComponent implements AfterViewInit, OnDestroy {
private _cdr;
private _divisionsAdaptorsFactory;
private _scaleGeneratorsFactory;
private _strategyManager;
private _elementRef;

@@ -22,2 +17,10 @@ private _platformId;

currentDate: Date;
/**
* Scale generator changes depending on current view type.
*/
scaleGenerator: IScaleGenerator;
/**
* Division adapter changes depending on current view type.
*/
divisionAdaptor: IDivisionAdaptor;
dateMarkerLeftPosition: number;

@@ -116,10 +119,2 @@ scale: IScale | undefined;

/**
* Get scale generator depending on current zoom.
*/
get scaleGenerator(): IScaleGenerator;
/**
* Get division adapter depending on current division type in zoom.
*/
get divisionAdaptor(): IDivisionAdaptor;
/**
* Active zoom.

@@ -132,3 +127,3 @@ */

get zooms(): ITimelineZoom[];
constructor(_cdr: ChangeDetectorRef, _divisionsAdaptorsFactory: DivisionsAdaptorsManager, _scaleGeneratorsFactory: ScaleGeneratorsManager, _elementRef: ElementRef, _platformId: object);
constructor(_cdr: ChangeDetectorRef, _strategyManager: StrategyManager, _elementRef: ElementRef, _platformId: object);
ngAfterViewInit(): void;

@@ -180,2 +175,3 @@ /**

private _recalculateDateMarkerPosition;
private _setStrategies;
ngOnDestroy(): void;

@@ -182,0 +178,0 @@ static ɵfac: i0.ɵɵFactoryDeclaration<TimelineComponent, never>;

import { ModuleWithProviders, Provider } from '@angular/core';
import { IScaleFormatter } from "./formatters/scale-formatter.interface";
import { ITimelineZoom } from "./models";
import { IScaleFormatter, ITimelineZoom } from "./models";
import * as i0 from "@angular/core";

@@ -15,12 +14,7 @@ import * as i1 from "./timeline.component";

/**
* Provide it when you want to extend current timeline logic and add some new divisions.
* Should be provided ScaleGeneratorsManager class with IScaleGeneratorsManager implementation.
* Provide it when you want to extend current timeline logic and add some new view types.
* Should be provided StrategyManager class with IStrategyManager implementation.
*/
scaleGeneratorsManager?: Provider;
strategyManager?: Provider;
/**
* If you added some new division types, you should also add new custom calculation logic to this divisions.
* You can do it by providing new DivisionsAdaptorsManager class with IDivisionsAdaptorsManager implementation.
*/
divisionsAdaptorsManager?: Provider;
/**
* Should be provided DayScaleGenerator class with IScaleGenerator implementation.

@@ -27,0 +21,0 @@ */

import { Observable } from "rxjs";
import { ITimelineZoom } from "../models/zoom";
import { IZoomsBuilder } from "../models";
interface IIndexedZoom extends ITimelineZoom {
index: number;
}
export declare class ZoomsBuilder {
export declare class ZoomsBuilder implements IZoomsBuilder {
private _zooms;

@@ -8,0 +9,0 @@ private _activeZoom$;

import { InjectionToken } from "@angular/core";
import { ITimelineZoom, TimelineDivisionType } from "../models/zoom";
import { ITimelineZoom, TimelineDivisionType } from "../models";
export declare const ZOOMS: InjectionToken<ITimelineZoom<TimelineDivisionType>[]>;
export declare const DefaultZooms: ITimelineZoom[];
{
"name": "angular-calendar-timeline",
"version": "0.0.13",
"version": "0.1.1",
"description": "A timeline for angular 13 that shows tasks or events on a timeline in different modes: days, weeks, and months.",

@@ -5,0 +5,0 @@ "author": "Andrii Krashivskyi",

export * from './lib/timeline.module';
export * from './lib/timeline.component';
export * from './lib/models';
export { TimeInMilliseconds } from "./lib/date-helpers";
export { ITimelineItem } from "./lib/models/item";
export { IIdObject } from "./lib/models/id-object";
export { ITimelineZoom } from "./lib/models/zoom";
export { TimelineDivisionType } from "./lib/models";
export * from './lib/strategy-manager';
export { DayScaleGenerator } from "./lib/scale-generator/day-scale-generator";
export { WeekScaleGenerator } from "./lib/scale-generator/week-scale-generator";
export { MonthScaleGenerator } from "./lib/scale-generator/month-scale-generator";

@@ -143,12 +143,7 @@ <div align="center">

The library allows you to add custom view modes, for example, years, hours, minutes, etc. All you have to do is extends two
classes: <b>ScaleGeneratorsManager</b> and <b>DivisionsAdaptorsManager</b>.
The library allows you to add custom view modes, for example, years, hours, minutes, etc. All you have to do is extends <b>StrategyManager</b>
class.
Based on the current view type it returns different strategies with a common interface which needs for calculating operations between dates and generating scale.
<b>ScaleGeneratorsManager</b> returns a scale generator depending on the current zoom. The function of this generator is to build the
header with columns and dates inside each column.
Each view mode has its own generator, so it is the reason why we need some "manager".
<b>DivisionsAdaptorsManager</b> contains adaptors for different view modes. Those Adaptors use a common interface, and
they are necessary for calculating operations with dates.
Here is an example of how it should look, when you want to add some additional view modes:

@@ -162,7 +157,4 @@

IScaleFormatter,
IScaleGenerator,
ScaleGeneratorsManager,
IScaleGeneratorsManager,
DivisionsAdaptorsManager,
IDivisionsAdaptorsManager
IStrategyManager,
StrategyManager,
} from 'angular-timeline-calendar';

@@ -177,4 +169,3 @@

class CustomScaleGeneratorsManager extends ScaleGeneratorsManager
implements IScaleGeneratorsManager<CustomZoomDivisionsType> {
class CustomStrategyManager extends StrategyManager implements IStrategyManager<CustomZoomDivisionsType> {
getGenerator(division: CustomZoomDivisionsType): IScaleGenerator {

@@ -187,6 +178,3 @@ if (division === CustomZoomDivisionsType.Custom) {

};
}
class CustomDivisionsAdaptorsManager extends DivisionsAdaptorsManager
implements IDivisionsAdaptorsManager<CustomZoomDivisionsType> {
getAdaptor(division: CustomZoomDivisionsType): IDivisionAdaptor {

@@ -204,6 +192,9 @@ if (division === CustomZoomDivisionsType.Custom) {

TimelineModule.forChild({
scaleGeneratorsManager: CustomScaleGeneratorsManager,
divisionsAdaptorsManager: CustomDivisionsAdaptorsManager,
strategyManager: StrategyManager,
}),
],
providers: [{
provide: StrategyManager,
useClass: CustomStrategyManager,
}],
})

@@ -210,0 +201,0 @@ export class MyModule {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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