Browse Source

push v0.1.1 version

tripeur 4 years ago
parent
commit
2b65d4ab86

+ 0 - 1
.gitignore

@@ -5,6 +5,5 @@ node_modules/
 
 
 #Exclude tsc generated files
-lib/
 lib-esm/
 _bundles/

+ 30 - 0
lib/Event.d.ts

@@ -0,0 +1,30 @@
+import Selectable from './utils/selectable';
+export interface IEvent {
+    id: string;
+    start: Date;
+    end: Date;
+    ressourceId: string;
+    title?: string;
+    editable?: boolean | null;
+    ressourceEditable?: boolean | null;
+    bgColor?: string;
+}
+export declare class Event implements IEvent, Selectable {
+    id: string;
+    start: Date;
+    end: Date;
+    title: string;
+    ressourceId: string;
+    isDisplayed: boolean;
+    offset: number;
+    editable: boolean | null;
+    ressourceEditable: boolean | null;
+    moving: boolean;
+    selected: boolean;
+    bgColor?: string;
+    constructor(obj: IEvent);
+    get startStr(): string;
+    get endStr(): string;
+    static toTimeSlot(obj: IEvent): Event;
+}
+export default Event;

+ 36 - 0
lib/Event.js

@@ -0,0 +1,36 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Event = void 0;
+class Event {
+    constructor(obj) {
+        this.id = obj.id;
+        this.start = obj.start;
+        this.end = obj.end;
+        this.ressourceId = obj.ressourceId;
+        this.title = (obj === null || obj === void 0 ? void 0 : obj.title) || this.id;
+        this.isDisplayed = false;
+        this.offset = 0;
+        this.editable = (obj === null || obj === void 0 ? void 0 : obj.editable) === undefined ? null : obj.editable;
+        this.ressourceEditable = (obj === null || obj === void 0 ? void 0 : obj.ressourceEditable) === undefined ? null : obj.ressourceEditable;
+        this.moving = false;
+        this.selected = false;
+        this.bgColor = obj.bgColor;
+    }
+    get startStr() {
+        return this.start.toISOString();
+    }
+    get endStr() {
+        return this.end.toISOString();
+    }
+    static toTimeSlot(obj) {
+        if (obj instanceof Event) {
+            return obj;
+        }
+        else {
+            return new Event(obj);
+        }
+    }
+}
+exports.Event = Event;
+exports.default = Event;
+//# sourceMappingURL=Event.js.map

+ 1 - 0
lib/Event.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"Event.js","sourceRoot":"","sources":["../src/Event.ts"],"names":[],"mappings":";;;AAaA,MAAa,KAAK;IAcd,YAAY,GAAU;QACpB,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,KAAI,IAAI,CAAC,EAAE,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,MAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClE,IAAI,CAAC,iBAAiB,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,iBAAiB,MAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAC7F,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAA;IAE5B,CAAC;IACD,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;IACnC,CAAC;IACD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAU;QACxB,IAAI,GAAG,YAAY,KAAK,EAAC;YACrB,OAAO,GAAG,CAAA;SACb;aAAI;YACD,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;SACzB;IACL,CAAC;CACJ;AA3CD,sBA2CC;AAED,kBAAe,KAAK,CAAA"}

+ 34 - 0
lib/Ressource.d.ts

@@ -0,0 +1,34 @@
+import Selectable from './utils/selectable';
+export interface IRessource {
+    id: string;
+    title?: string;
+    children?: Array<IRessource>;
+    collapseChildren?: boolean;
+    parent?: IRessource;
+    parentId?: string;
+    height?: number;
+    eventEditable?: boolean;
+    eventRessourceEditable?: boolean;
+    eventBgColor?: string;
+}
+export declare class Ressource implements IRessource, Selectable {
+    id: string;
+    title: string;
+    children: Array<Ressource>;
+    collapseChildren: boolean;
+    parent?: Ressource;
+    height?: number;
+    eventEditable: boolean;
+    eventRessourceEditable: boolean;
+    eventBgColor?: string;
+    selected: boolean;
+    constructor(obj: IRessource);
+    get parentId(): string;
+    get depth(): number;
+    get show(): boolean;
+    descendantOf(potentialParent: IRessource): boolean;
+    toPlainObject(parent: IRessource | undefined): IRessource;
+    toJSON(): IRessource;
+    static toRessource(obj: IRessource): Ressource;
+}
+export default Ressource;

+ 67 - 0
lib/Ressource.js

@@ -0,0 +1,67 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Ressource = void 0;
+class Ressource {
+    constructor(obj) {
+        this.id = obj.id;
+        this.title = obj.title || obj.id;
+        if (obj.children) {
+            this.children = obj.children.map(Ressource.toRessource);
+        }
+        else {
+            this.children = [];
+        }
+        this.collapseChildren = obj.collapseChildren ? obj.collapseChildren : false;
+        this.parent = obj.parent ? Ressource.toRessource(obj.parent) : undefined;
+        this.height = obj.height;
+        this.eventEditable = (obj === null || obj === void 0 ? void 0 : obj.eventEditable) === undefined ? true : obj.eventEditable;
+        this.eventRessourceEditable = (obj === null || obj === void 0 ? void 0 : obj.eventRessourceEditable) === undefined ? true : obj.eventRessourceEditable;
+        this.eventBgColor = obj.eventBgColor;
+        this.selected = false;
+        this.children.forEach(o => o.parent = this);
+    }
+    get parentId() {
+        var _a;
+        return ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.id) || "";
+    }
+    get depth() {
+        return this.parent ? this.parent.depth + 1 : 0;
+    }
+    get show() {
+        return this.parent === undefined ? true : (this.parent.show && !this.parent.collapseChildren);
+    }
+    descendantOf(potentialParent) {
+        return this.parent === undefined ? false : (this.parent.id === potentialParent.id || this.parent.descendantOf(potentialParent));
+    }
+    toPlainObject(parent) {
+        return {
+            id: this.id,
+            title: this.title,
+            children: this.children.map(o => o.toPlainObject(this)),
+            parent: parent
+        };
+    }
+    toJSON() {
+        return {
+            id: this.id,
+            title: this.title,
+            collapseChildren: this.collapseChildren,
+            parent: this.parent,
+            height: this.height,
+            eventEditable: this.eventEditable,
+            eventRessourceEditable: this.eventRessourceEditable,
+            eventBgColor: this.eventBgColor
+        };
+    }
+    static toRessource(obj) {
+        if (obj instanceof Ressource) {
+            return obj;
+        }
+        else {
+            return new Ressource(obj);
+        }
+    }
+}
+exports.Ressource = Ressource;
+exports.default = Ressource;
+//# sourceMappingURL=Ressource.js.map

File diff suppressed because it is too large
+ 0 - 0
lib/Ressource.js.map


+ 79 - 0
lib/Timeline.d.ts

@@ -0,0 +1,79 @@
+import { Dayjs } from 'dayjs';
+import { LitElement, TemplateResult } from 'lit-element';
+import { Event, IEvent } from './Event';
+import { Ressource, IRessource } from './Ressource';
+export { HorizontalResizer } from './components/horizontal-resizer';
+export interface TimelineOptions {
+    ressources?: Array<IRessource>;
+    items?: Array<IEvent>;
+}
+interface TimelineContent {
+    ressources: Array<Ressource>;
+    items: Array<Event>;
+}
+declare type dayjsUnit = "y" | "M" | "d" | "h" | "m" | 's';
+export declare type UnitLegend = {
+    [k in dayjsUnit]: string;
+};
+declare class Timeline extends LitElement {
+    static styles: import("lit-element").CSSResult[];
+    private rows;
+    private items;
+    private selectedList;
+    ressourceWidth: number;
+    private _start;
+    get start(): string;
+    set start(value: string);
+    private _end;
+    get end(): string;
+    set end(value: string);
+    private _slotDuration;
+    get slotDuration(): number;
+    set slotDuration(value: number);
+    private _legendSpan;
+    get legendSpan(): number;
+    set legendSpan(value: number);
+    private rowHeight;
+    slotWidth: number;
+    private rowsTitle;
+    private legendUnitFormat;
+    private legend;
+    constructor(options?: TimelineOptions);
+    set defaultBackground(value: string);
+    get defaultBackground(): string;
+    setLegendUnitFormatAll(legend: Partial<UnitLegend>): void;
+    setLegendUnitFormat(unit: dayjsUnit, format: string): void;
+    addRessources(list: Array<IRessource>): Array<Ressource>;
+    addRessource(ressource: IRessource): Ressource;
+    removeRessourceById(id: string): TimelineContent;
+    _removeRessourceById(id: string, depth?: number): TimelineContent;
+    getRessources(): Array<Ressource>;
+    getRessourceFromId(id: string): Ressource | null;
+    setRowsTitle(title: string): void;
+    getEventById(id: string): Event | undefined;
+    addEvents(list: Array<IEvent>): Array<Event | undefined>;
+    addEvent(event: IEvent): Event | undefined;
+    removeEventById(id: string): Array<Event>;
+    updateEventById(id: string): Event | null;
+    private _updateEventPosition;
+    getEvents(): Array<Event>;
+    updateLegend(): void;
+    _handleResizeX(e: CustomEvent<number>): void;
+    _grabHeader(e: MouseEvent): void;
+    _getEventResizerHandler(slot: Event, direction: "end" | "start"): (evt: MouseEvent) => void;
+    _getEventGrabHandler(slot: Event, editable: boolean, ressourceEditable: boolean, callback: (e: MouseEvent, wasModified: boolean) => void): (evt: MouseEvent) => void;
+    private _clearSelectedItems;
+    private _clearSelectionHandler;
+    private _getEventClickHandler;
+    firstUpdated(): void;
+    renderTimeslot(evt: Event): TemplateResult;
+    _getCollapseRessourceHandler(item: Ressource): (e: MouseEvent) => void;
+    _onRessourceDragStart(item: Ressource): (event: DragEvent) => void;
+    _onRessourceDragEnter(event: DragEvent): void;
+    _onRessourceDragLeave(event: DragEvent): void;
+    _onRessourceDrop(event: DragEvent): void;
+    renderRessource(item: Ressource): TemplateResult;
+    renderGridRow(columns: Array<Dayjs>, rowId?: number, height?: number): TemplateResult;
+    render(): TemplateResult;
+}
+export default Timeline;

+ 686 - 0
lib/Timeline.js

@@ -0,0 +1,686 @@
+"use strict";
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.HorizontalResizer = void 0;
+const dayjs_1 = __importDefault(require("dayjs"));
+const lit_element_1 = require("lit-element");
+const style_map_1 = require("lit-html/directives/style-map");
+const simplebar_1 = __importDefault(require("simplebar"));
+const SimplbeBar_styles_1 = require("./styles/SimplbeBar.styles");
+const Event_1 = require("./Event");
+const Ressource_1 = require("./Ressource");
+var horizontal_resizer_1 = require("./components/horizontal-resizer");
+Object.defineProperty(exports, "HorizontalResizer", { enumerable: true, get: function () { return horizontal_resizer_1.HorizontalResizer; } });
+const syncroScroll_1 = __importDefault(require("./utils/syncroScroll"));
+const Timeline_style_1 = require("./styles/Timeline.style");
+let Timeline = class Timeline extends lit_element_1.LitElement {
+    constructor(options = {}) {
+        super();
+        this._slotDuration = 30;
+        this._legendSpan = 2;
+        this.rowHeight = 32;
+        this.slotWidth = 20;
+        this.legendUnitFormat = { "y": "YYYY", "M": "MMMM", "d": 'D', "h": "H[h]", "m": "m'", 's': "s[s]" };
+        this._clearSelectionHandler = (_e) => {
+            this._clearSelectedItems();
+            window.removeEventListener("click", this._clearSelectionHandler);
+        };
+        this.rows = [];
+        this.items = [];
+        this._start = dayjs_1.default().startOf("day");
+        this._end = this._start.endOf("day");
+        this.rowsTitle = "Ressources";
+        this.ressourceWidth = 200;
+        this.selectedList = [];
+        this.legend = [];
+        this.defaultBackground = "";
+        if (options.ressources) {
+            this.addRessources(options.ressources);
+        }
+        if (options.items) {
+            this.addEvents(options.items);
+        }
+        this.updateLegend();
+        this.render();
+    }
+    get start() {
+        return this._start.toISOString();
+    }
+    set start(value) {
+        const d = dayjs_1.default(value);
+        if (d.isValid()) {
+            this._start = d < this._end ? d : this._end;
+            this.updateLegend();
+        }
+        else {
+            console.log("Invalid Date :", value);
+        }
+    }
+    get end() {
+        return this._end.toISOString();
+    }
+    set end(value) {
+        const d = dayjs_1.default(value);
+        if (d.isValid()) {
+            this._end = this._start < d ? d : this._start;
+            this.updateLegend();
+        }
+    }
+    get slotDuration() {
+        return this._slotDuration;
+    }
+    set slotDuration(value) {
+        this._slotDuration = value;
+        this.updateLegend();
+    }
+    get legendSpan() {
+        return this._legendSpan;
+    }
+    set legendSpan(value) {
+        this._legendSpan = value;
+        this.updateLegend();
+    }
+    set defaultBackground(value) {
+        this.style.setProperty("--default-background", value);
+    }
+    get defaultBackground() {
+        return this.style.getPropertyValue("--default-background");
+    }
+    setLegendUnitFormatAll(legend) {
+        this.legendUnitFormat = Object.assign(Object.assign({}, this.legendUnitFormat), legend);
+        this.updateLegend();
+    }
+    setLegendUnitFormat(unit, format) {
+        this.legendUnitFormat[unit] = format;
+        this.updateLegend();
+    }
+    addRessources(list) {
+        return list.map(r => this.addRessource(r));
+    }
+    addRessource(ressource) {
+        var _a;
+        const existingRessource = this.getRessourceFromId(ressource.id);
+        if (existingRessource) {
+            return existingRessource;
+        }
+        const r = Ressource_1.Ressource.toRessource(ressource);
+        if (r.parent !== undefined) {
+            r.parent = (_a = this.getRessourceFromId(r.parent.id)) !== null && _a !== void 0 ? _a : this.addRessource(r.parent);
+            const idx = this.rows.indexOf(r.parent);
+            if (idx > -1) {
+                this.rows[idx].children.push(r);
+                this.rows.splice(idx + 1, 0, r);
+            }
+            else {
+                throw new Error("Not able to create ressource parent.\n" + r.id);
+            }
+        }
+        else {
+            this.rows = [...this.rows, r];
+        }
+        this.addRessources(r.children);
+        this._updateEventPosition(r);
+        return r;
+    }
+    removeRessourceById(id) {
+        return this._removeRessourceById(id);
+    }
+    _removeRessourceById(id, depth = 0) {
+        const output = { ressources: [], items: [] };
+        for (let i = 0; i < this.rows.length; i) {
+            const ressource = this.rows[i];
+            if (ressource.id === id) {
+                output.ressources.push(ressource);
+                if (ressource.parent && depth === 0) {
+                    ressource.parent.children = ressource.parent.children.filter(o => o.id !== ressource.id);
+                }
+                this.rows.splice(i, 1);
+            }
+            else if (ressource.parentId === id) {
+                const partialOutput = this._removeRessourceById(ressource.id, depth + 1);
+                output.ressources.push(...partialOutput.ressources);
+                output.items.push(...partialOutput.items);
+            }
+            else {
+                i++;
+            }
+        }
+        output.items.push(...this.items.filter(i => i.ressourceId === id));
+        this.items = this.items.filter(i => i.ressourceId !== id);
+        return output;
+    }
+    getRessources() {
+        return this.rows;
+    }
+    getRessourceFromId(id) {
+        const tmp = this.rows.filter(r => r.id === id);
+        return tmp.length > 0 ? tmp[0] : null;
+    }
+    setRowsTitle(title) {
+        this.rowsTitle = title;
+    }
+    getEventById(id) {
+        return this.items.find(o => o.id == id);
+    }
+    addEvents(list) {
+        return list.map((e) => this.addEvent(e));
+    }
+    addEvent(event) {
+        const existingEvent = this.getEventById(event.id);
+        if (existingEvent) {
+            return existingEvent;
+        }
+        const ressource = this.rows.find(r => r.id === event.ressourceId);
+        if (ressource === undefined) {
+            return undefined;
+        }
+        const timeslot = Event_1.Event.toTimeSlot(event);
+        this.items = [...this.items, timeslot];
+        timeslot.isDisplayed = timeslot.end > this._start.toDate() || timeslot.start < this._end.toDate();
+        this._updateEventPosition(ressource);
+        return timeslot;
+    }
+    removeEventById(id) {
+        const output = this.items.filter(o => o.id === id);
+        this.items = this.items.filter(o => o.id !== id);
+        return output;
+    }
+    updateEventById(id) {
+        const output = this.removeEventById(id);
+        if (output.length > 0) {
+            this.addEvent(output[0]);
+            return output[0];
+        }
+        else {
+            return null;
+        }
+    }
+    _updateEventPosition(ressource) {
+        const timeslots = this.items.filter(i => i.ressourceId === ressource.id);
+        if (timeslots.length === 0) {
+            ressource.height = this.rowHeight + (ressource.collapseChildren ? 5 : 0);
+            return;
+        }
+        const start = this._start.toDate().getTime();
+        const end = this._end.toDate().getTime();
+        const points = [start, end];
+        const populateInterval = (d) => {
+            const t = d.getTime();
+            if (start < t && t < end && !points.includes(t)) {
+                points.push(t);
+            }
+        };
+        timeslots.forEach(element => {
+            populateInterval(element.start);
+            populateInterval(element.end);
+        });
+        points.sort();
+        const intervals = [];
+        for (let i = 0; i < points.length - 1; i++) {
+            const startTime = points[i];
+            const endTime = points[i + 1];
+            intervals.push({
+                start: points[i],
+                end: points[i + 1],
+                slots: timeslots.filter(slot => (slot.start.getTime() <= startTime && endTime <= slot.end.getTime()))
+            });
+        }
+        const lineCount = intervals.reduce((acc, interval) => Math.max(acc, interval.slots.length), 0);
+        ressource.height = this.rowHeight * Math.max(lineCount, 1) + (ressource.collapseChildren ? 5 : 0);
+        const sortTimeslots = (a, b) => {
+            const t = a.start.getTime() - b.start.getTime();
+            if (t === 0) {
+                const tend = b.end.getTime() - a.end.getTime();
+                return tend === 0 ? ('' + a.id).localeCompare(b.id) : tend;
+            }
+            return t;
+        };
+        timeslots.forEach(slot => slot.offset = -1);
+        timeslots.sort(sortTimeslots);
+        timeslots[0].offset = 0;
+        const potentialOffset = [];
+        for (let i = 0; i < lineCount; i++) {
+            potentialOffset.push(i);
+        }
+        intervals.forEach(intervals => {
+            intervals.slots.sort(sortTimeslots);
+            const usedOffset = intervals.slots.map(o => o.offset).filter(i => i > -1);
+            const availableOffset = potentialOffset.filter(i => !usedOffset.includes(i));
+            intervals.slots.forEach(slot => {
+                if (slot.offset === -1) {
+                    slot.offset = availableOffset.shift() || 0;
+                }
+            });
+        });
+    }
+    getEvents() {
+        return this.items;
+    }
+    updateLegend() {
+        const legend = [];
+        const legendUnitList = ["y", "M", "d", "h", "m", 's'];
+        const legendMinUnitSpan = this.slotDuration * this.legendSpan;
+        for (const legendUnit of legendUnitList) {
+            let currentDate = dayjs_1.default(this._start);
+            let nextColumn = currentDate.add(legendMinUnitSpan, "m");
+            const isLegendPossible = this._end.diff(this._start, legendUnit) > 0 &&
+                (nextColumn.format(this.legendUnitFormat[legendUnit]) !== currentDate.format(this.legendUnitFormat[legendUnit])
+                    || currentDate.add(1, legendUnit).diff(currentDate, "m") >= legendMinUnitSpan);
+            if (isLegendPossible) {
+                const row = [];
+                let i = 0;
+                while (currentDate.isBefore(this._end)) {
+                    i += this.legendSpan;
+                    if (nextColumn.diff(currentDate, legendUnit) > 0) {
+                        row.push({ colspan: i, title: '' + currentDate.format(this.legendUnitFormat[legendUnit]) });
+                        i = 0;
+                        currentDate = nextColumn;
+                    }
+                    nextColumn = nextColumn.add(legendMinUnitSpan, "m");
+                }
+                legend.push(row);
+            }
+        }
+        this.legend = legend;
+    }
+    _handleResizeX(e) {
+        e.stopPropagation();
+        this.ressourceWidth += e.detail;
+        if (this.ressourceWidth < 0) {
+            this.ressourceWidth = 0;
+        }
+    }
+    _grabHeader(e) {
+        const root = this.shadowRoot;
+        if (root !== null) {
+            const gridContainer = root.querySelector(".jc-timeline-grid-container");
+            const headerContainer = root.querySelector(".jc-timeline-grid-title-container");
+            let lastPosX = e.clientX;
+            const scroll = function (e) {
+                const scrollLeft = (lastPosX - e.clientX);
+                headerContainer.scrollLeft += scrollLeft;
+                gridContainer.scrollLeft += scrollLeft;
+                lastPosX = e.clientX;
+            };
+            const mouseUpListener = function (_e) {
+                window.removeEventListener("mousemove", scroll);
+                window.removeEventListener("mouseup", mouseUpListener);
+            };
+            window.addEventListener("mousemove", scroll);
+            window.addEventListener("mouseup", mouseUpListener);
+        }
+    }
+    _getEventResizerHandler(slot, direction) {
+        return (evt) => {
+            evt.stopPropagation();
+            evt.preventDefault();
+            const startPos = evt.clientX;
+            const localSlot = slot;
+            const localDir = direction;
+            const initialDate = slot[direction];
+            const resizeListener = (e) => {
+                const newDate = dayjs_1.default(initialDate).add(Math.round((e.clientX - startPos) / this.slotWidth) * this.slotDuration, "m").toDate();
+                if (direction === "start" ? (newDate < localSlot.end) : (localSlot.start < newDate)) {
+                    if (localSlot[localDir] !== newDate) {
+                        localSlot[localDir] = newDate;
+                        this.updateEventById(slot.id);
+                    }
+                }
+            };
+            const mouseUpListener = (_e) => {
+                window.removeEventListener("mousemove", resizeListener);
+                window.removeEventListener("mouseup", mouseUpListener);
+                localSlot.moving = false;
+                this.updateEventById(localSlot.id);
+                if (initialDate !== localSlot[localDir]) {
+                    const cEvt = new CustomEvent("event-change", {
+                        detail: { items: [localSlot] }
+                    });
+                    this.dispatchEvent(cEvt);
+                }
+            };
+            localSlot.moving = true;
+            window.addEventListener("mousemove", resizeListener);
+            window.addEventListener("mouseup", mouseUpListener);
+        };
+    }
+    _getEventGrabHandler(slot, editable, ressourceEditable, callback) {
+        return (evt) => {
+            evt.stopPropagation();
+            evt.preventDefault();
+            const startPos = evt.clientX;
+            let hasChanged = false;
+            const localSlot = slot;
+            let localSlots = this.selectedList.filter(s => s instanceof Event_1.Event).map(s => s);
+            if (!localSlots.includes(localSlot)) {
+                localSlots = [localSlot];
+            }
+            const startDates = localSlots.map(slot => slot.start);
+            const endDates = localSlots.map(slot => slot.end);
+            const updatePosition = editable ? (e) => {
+                const changeTime = Math.round((e.clientX - startPos) / this.slotWidth) * this.slotDuration;
+                return localSlots.map((slot, index) => {
+                    const prevStart = slot.start;
+                    slot.start = dayjs_1.default(startDates[index]).add(changeTime, "m").toDate();
+                    slot.end = dayjs_1.default(endDates[index]).add(changeTime, "m").toDate();
+                    return prevStart.getTime() !== slot.start.getTime();
+                }).reduce((prev, curr) => prev || curr);
+            } : (_e) => { return false; };
+            const updateRessource = ressourceEditable ? (e) => {
+                var _a, _b, _c;
+                const rowId = (_c = (_b = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.elementsFromPoint(e.clientX, e.clientY).find((e) => e.tagName == "TD")) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.getAttribute('row-id');
+                if (rowId) {
+                    const ressourceId = this.rows[Number(rowId)].id;
+                    if (ressourceId !== localSlot.ressourceId) {
+                        const oldRessource = this.getRessourceFromId(localSlot.ressourceId);
+                        localSlot.ressourceId = ressourceId;
+                        this._updateEventPosition(oldRessource);
+                        return true;
+                    }
+                }
+                return false;
+            } : (_e) => { return false; };
+            const moveListener = (e) => {
+                const a = updatePosition(e);
+                if (updateRessource(e) || a) {
+                    hasChanged = true;
+                    this.updateEventById(localSlot.id);
+                }
+            };
+            const mouseUpListener = (e) => {
+                window.removeEventListener("mousemove", moveListener);
+                window.removeEventListener("mouseup", mouseUpListener);
+                localSlot.moving = false;
+                this.updateEventById(slot.id);
+                if (hasChanged) {
+                    const cEvt = new CustomEvent("event-change", {
+                        detail: { items: localSlots }
+                    });
+                    this.dispatchEvent(cEvt);
+                }
+                callback(e, hasChanged);
+            };
+            localSlot.moving = true;
+            window.addEventListener("mousemove", moveListener);
+            window.addEventListener("mouseup", mouseUpListener);
+        };
+    }
+    _clearSelectedItems() {
+        this.selectedList.map(selectable => {
+            selectable.selected = false;
+            this.updateEventById(selectable.id);
+        });
+        this.selectedList = [];
+    }
+    _getEventClickHandler(clickedItem) {
+        const item = clickedItem;
+        return (e, wasModified = false) => {
+            e.stopPropagation();
+            const idx = this.selectedList.indexOf(item);
+            if (idx > -1) {
+                if (!wasModified) {
+                    if (e.ctrlKey) {
+                        this.selectedList.splice(idx, 1);
+                        item.selected = false;
+                        this.updateEventById(item.id);
+                    }
+                    else {
+                        this._clearSelectedItems();
+                    }
+                }
+            }
+            else {
+                if (this.selectedList.length > 0 && !e.ctrlKey) {
+                    this._clearSelectedItems();
+                }
+                item.selected = true;
+                this.selectedList.push(item);
+                this.updateEventById(item.id);
+            }
+            const myEvent = new CustomEvent('item-selected', {
+                detail: { items: this.selectedList },
+                bubbles: true,
+                composed: true
+            });
+            this.dispatchEvent(myEvent);
+        };
+    }
+    firstUpdated() {
+        const root = this.shadowRoot;
+        if (root !== null) {
+            const gridContainer = root.querySelector(".jc-timeline-grid-container");
+            const simplebar = new simplebar_1.default(gridContainer).getScrollElement();
+            syncroScroll_1.default([simplebar, root.querySelector(".jc-timeline-grid-title-container")], "h");
+            syncroScroll_1.default([simplebar, root.querySelector(".jc-timeline-rows")], "v");
+        }
+        if (this.defaultBackground === "") {
+            this.style.setProperty("--default-background", "SteelBlue");
+        }
+    }
+    renderTimeslot(evt) {
+        if (!evt.isDisplayed) {
+            return lit_element_1.html ``;
+        }
+        let rowTop = 0;
+        let ressource;
+        let i;
+        for (i = 0; i < this.rows.length && this.rows[i].id !== evt.ressourceId; i++) {
+            ressource = this.rows[i];
+            if (ressource.show) {
+                rowTop += ressource.height ? ressource.height : this.rowHeight;
+            }
+        }
+        ressource = this.rows[i];
+        const minute2pixel = this.slotWidth / this.slotDuration;
+        const left = dayjs_1.default(evt.start).diff(this._start, "m") * minute2pixel;
+        const right = -dayjs_1.default(evt.end).diff(this._end, "m") * minute2pixel;
+        const style = {
+            height: this.rowHeight - 4 + "px",
+            top: rowTop + evt.offset * this.rowHeight + "px",
+            left: left + "px",
+            right: right + "px",
+            backgroundColor: ""
+        };
+        const bgColor = evt.bgColor ? evt.bgColor : ressource.eventBgColor;
+        if (bgColor) {
+            style.backgroundColor = bgColor;
+        }
+        if (!ressource.show) {
+            style.height = "";
+            style.top = rowTop - 6 + "px";
+            return lit_element_1.html `<div class="jc-timeslot empty" style="${style_map_1.styleMap(style)}"></div>`;
+        }
+        let content = lit_element_1.html `${evt.title}`;
+        const resizer = evt.editable === null ? ressource.eventEditable : evt.editable;
+        const editableRessource = evt.ressourceEditable === null ? ressource.eventRessourceEditable : evt.ressourceEditable;
+        if (resizer) {
+            content = lit_element_1.html `<div class="jc-timeslot-resizer-start" @mousedown="${this._getEventResizerHandler(evt, "start")}"></div>${content}
+                            <div class="jc-timeslot-resizer-end" @mousedown="${this._getEventResizerHandler(evt, "end")}"></div>`;
+        }
+        return lit_element_1.html `<div class="jc-timeslot ${evt.moving ? "moving" : ""} ${evt.selected ? "selected" : ""}" 
+            start="${evt.start.getHours()}" 
+            end="${evt.end.getHours()}" 
+            style="${style_map_1.styleMap(style)}"
+            @mousedown="${this._getEventGrabHandler(evt, resizer, editableRessource, this._getEventClickHandler(evt))}"
+            >${content}</div>`;
+    }
+    _getCollapseRessourceHandler(item) {
+        return (_e) => {
+            item.collapseChildren = !item.collapseChildren;
+            this._updateEventPosition(item);
+            this.rows = [...this.rows];
+        };
+    }
+    _onRessourceDragStart(item) {
+        return (event) => {
+            var _a;
+            (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.setData("text", item.id);
+        };
+    }
+    _onRessourceDragEnter(event) {
+        if (event.target instanceof HTMLElement) {
+            const tgt = event.target;
+            tgt.classList.add("target");
+        }
+    }
+    _onRessourceDragLeave(event) {
+        if (event.target instanceof HTMLElement) {
+            event.target.classList.remove("target");
+        }
+    }
+    _onRessourceDrop(event) {
+        var _a, _b;
+        event.preventDefault();
+        if (event.target instanceof HTMLElement) {
+            event.target.classList.remove("target");
+            const srcId = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData("text");
+            const destinationId = (_b = event.target.parentElement) === null || _b === void 0 ? void 0 : _b.getAttribute("ressourceId");
+            if (srcId && destinationId && (destinationId !== srcId)) {
+                const src = this.getRessourceFromId(srcId);
+                const destination = this.getRessourceFromId(destinationId);
+                if (destination.descendantOf(src)) {
+                    return;
+                }
+                const movedContent = this.removeRessourceById(src.id);
+                if (event.target.classList.contains("jc-ressource")) {
+                    movedContent.ressources[0].parent = destination;
+                }
+                else {
+                    movedContent.ressources[0].parent = destination.parent;
+                    let idx = this.rows.findIndex(v => v.id === destinationId);
+                    if (event.target.classList.contains("jc-ressource-below")) {
+                        idx += 1;
+                        while ((idx < this.rows.length)
+                            && this.rows[idx].descendantOf(destination)) {
+                            idx += 1;
+                        }
+                    }
+                    const arr = this.rows;
+                    this.rows = [...arr.splice(0, idx), src, ...arr];
+                }
+                this.addRessources(movedContent.ressources);
+                this.addEvents(movedContent.items);
+                this.dispatchEvent(new CustomEvent("reorder-ressource", {
+                    detail: { ressources: this.rows }
+                }));
+            }
+        }
+    }
+    renderRessource(item) {
+        const depth = item.depth;
+        const style = `--depth:${depth};` + (item.height ? `height:${item.height}px;` : "");
+        const hasChild = item.children.length > 0;
+        const collapseHandler = this._getCollapseRessourceHandler(item);
+        return lit_element_1.html `<tr>
+                        <td class="${item.selected ? "jc-ressource-selected" : ""}" style="${style}" ressourceId="${item.id}" @click="${this._getEventClickHandler(item)}">
+                            <div class="jc-ressource-above"></div>    
+                            <div class="jc-ressource" draggable="true" @dragstart="${this._onRessourceDragStart(item)}">
+                            ${Array(depth).fill(0).map(_i => lit_element_1.html `<i class="jc-spacer"></i>`)}${hasChild ? lit_element_1.html `<i class="jc-spacer ${item.collapseChildren ? "extend" : "collapse"}" @click="${collapseHandler}"></i>` : lit_element_1.html `<i class="jc-spacer"></i>`}
+                            <span>${item.title}</span>
+                            </div>
+                            <div class="jc-ressource-below"></div>
+                        </td>
+                    </tr>`;
+    }
+    renderGridRow(columns, rowId = -1, height = 30) {
+        return lit_element_1.html `<tr row-id="${rowId}">${columns.map((d, i) => lit_element_1.html `<td style="height:${height}px;" class="jc-slot ${(i % this.legendSpan) === 0 ? "jc-major-slot" : ""}" start="${d.toISOString()}">&nbsp;</td>`)}</tr>`;
+    }
+    render() {
+        const nCol = Math.floor(this._end.diff(this._start, 'm') / this.slotDuration) + 1;
+        const columns = [];
+        for (let i = 0; i < nCol; i++) {
+            columns.push(this._start.add(this.slotDuration * i, 'm'));
+        }
+        const displayedRows = this.rows.map((r, i) => { return { i: i, r: r }; }).filter(o => o.r.show);
+        return lit_element_1.html `
+      <div class="jc-timeline-header">
+        <div class="jc-timeline-rows-title" style=${style_map_1.styleMap({ minWidth: this.ressourceWidth + "px", width: this.ressourceWidth + "px" })}>${this.rowsTitle}</div>
+        <horizontal-resizer @resize-x="${this._handleResizeX}"></horizontal-resizer>
+        <div class="jc-timeline-grid-title-container">
+          <table @mousedown="${this._grabHeader}"  style="width:${nCol * this.slotWidth}px;">
+              <colgroup>${columns.map(_o => lit_element_1.html `<col style="min-width:${this.slotWidth}px">`)}</colgroup>
+              <tbody>
+                  ${this.legend.map(arr => lit_element_1.html `<tr class="jc-timeline-grid-title">${arr.map(o => lit_element_1.html `<th colspan="${o.colspan}">${o.title}</th>`)}</tr>`)}
+              </tbody>
+          </table>
+        </div>
+      </div>
+      <div class="jc-timeline-content">
+        <table class="jc-timeline-rows"
+          style="${style_map_1.styleMap({ "--width": this.ressourceWidth + "px" })}"
+          @dragover="${(e) => e.preventDefault()}"
+          @dragenter="${this._onRessourceDragEnter}"
+          @dragleave="${this._onRessourceDragLeave}"
+          @drop="${this._onRessourceDrop}">
+          ${this.rows.length > 0 ? displayedRows.map(o => this.renderRessource(o.r)) : lit_element_1.html `<tr class="empty"><td>No ressource</td></tr>`}
+        </table>
+        <horizontal-resizer @resize-x="${this._handleResizeX}"></horizontal-resizer>
+        <div class="jc-timeline-grid-container">
+          <table style="width:${nCol * this.slotWidth}px;">
+              <colgroup>${columns.map(_o => lit_element_1.html `<col style="min-width:${this.slotWidth}px">`)}</colgroup>
+              
+              <tbody>
+                  ${this.rows.length > 0 ? displayedRows.map(o => this.renderGridRow(columns, o.i, o.r.height)) : this.renderGridRow(columns)}
+              </tbody>
+          </table>
+          <div class="jc-timeslots" style="width:${nCol * this.slotWidth}px;">
+            ${this.items.map(slot => this.renderTimeslot(slot))}
+          </div>
+        </div>
+      </div>
+    `;
+    }
+};
+Timeline.styles = [Timeline_style_1.TimelineStyle, SimplbeBar_styles_1.SimpleBarStyle];
+__decorate([
+    lit_element_1.internalProperty()
+], Timeline.prototype, "rows", void 0);
+__decorate([
+    lit_element_1.internalProperty()
+], Timeline.prototype, "items", void 0);
+__decorate([
+    lit_element_1.property({ type: Number })
+], Timeline.prototype, "ressourceWidth", void 0);
+__decorate([
+    lit_element_1.property({ type: Object })
+], Timeline.prototype, "_start", void 0);
+__decorate([
+    lit_element_1.property({ type: String })
+], Timeline.prototype, "start", null);
+__decorate([
+    lit_element_1.property({ type: String })
+], Timeline.prototype, "end", null);
+__decorate([
+    lit_element_1.property({ type: Number })
+], Timeline.prototype, "slotDuration", null);
+__decorate([
+    lit_element_1.property({ type: Number })
+], Timeline.prototype, "legendSpan", null);
+__decorate([
+    lit_element_1.property({ type: Number })
+], Timeline.prototype, "rowHeight", void 0);
+__decorate([
+    lit_element_1.property({ type: Number })
+], Timeline.prototype, "slotWidth", void 0);
+__decorate([
+    lit_element_1.property({ type: String })
+], Timeline.prototype, "rowsTitle", void 0);
+__decorate([
+    lit_element_1.property({ type: Array })
+], Timeline.prototype, "legend", void 0);
+__decorate([
+    lit_element_1.property({ type: String })
+], Timeline.prototype, "defaultBackground", null);
+Timeline = __decorate([
+    lit_element_1.customElement('jc-timeline')
+], Timeline);
+exports.default = Timeline;
+//# sourceMappingURL=Timeline.js.map

File diff suppressed because it is too large
+ 0 - 0
lib/Timeline.js.map


+ 15 - 0
lib/components/horizontal-resizer.d.ts

@@ -0,0 +1,15 @@
+import { LitElement, TemplateResult } from 'lit-element';
+export declare class HorizontalResizer extends LitElement {
+    static styles: import("lit-element").CSSResult;
+    private lastPosX;
+    constructor();
+    render(): TemplateResult;
+    _startResize(e: MouseEvent): void;
+    private _emitMove;
+    private _endResize;
+}
+declare global {
+    interface HTMLElementTagNameMap {
+        'horizontal-resizer': HorizontalResizer;
+    }
+}

+ 57 - 0
lib/components/horizontal-resizer.js

@@ -0,0 +1,57 @@
+"use strict";
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.HorizontalResizer = void 0;
+const lit_element_1 = require("lit-element");
+let HorizontalResizer = class HorizontalResizer extends lit_element_1.LitElement {
+    constructor() {
+        super();
+        this._emitMove = (e) => {
+            const n = e.clientX - this.lastPosX;
+            this.lastPosX = e.clientX;
+            const event = new CustomEvent('resize-x', {
+                detail: n,
+                bubbles: true,
+                composed: true
+            });
+            this.dispatchEvent(event);
+        };
+        this._endResize = () => {
+            this.lastPosX = -1;
+            window.removeEventListener("mousemove", this._emitMove);
+            window.removeEventListener("mouseup", this._endResize);
+        };
+        this.lastPosX = -1;
+    }
+    render() {
+        return lit_element_1.html `
+      <div @mousedown=${(e) => this._startResize(e)}></div>
+    `;
+    }
+    _startResize(e) {
+        this.lastPosX = e.clientX;
+        window.addEventListener("mousemove", this._emitMove);
+        window.addEventListener("mouseup", this._endResize);
+    }
+};
+HorizontalResizer.styles = lit_element_1.css `
+    :host {
+      min-width:3px;
+      background-color:lightgray;
+      cursor:col-resize;
+    }
+    div{
+      width:100%;
+      height:100%;
+    }
+  `;
+HorizontalResizer = __decorate([
+    lit_element_1.customElement('horizontal-resizer')
+], HorizontalResizer);
+exports.HorizontalResizer = HorizontalResizer;
+//# sourceMappingURL=horizontal-resizer.js.map

+ 1 - 0
lib/components/horizontal-resizer.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"horizontal-resizer.js","sourceRoot":"","sources":["../../src/components/horizontal-resizer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6CAAiF;AAGjF,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,wBAAU;IAa/C;QACE,KAAK,EAAE,CAAA;QAcD,cAAS,GAAG,CAAC,CAAY,EAAM,EAAE;YACvC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YACpC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,WAAW,CAAS,UAAU,EAAE;gBAChD,MAAM,EAAG,CAAC;gBACV,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;YACH,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC,CAAA;QACO,eAAU,GAAG,GAAO,EAAE;YAC5B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;YACnB,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;YACvD,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QACxD,CAAC,CAAA;QA3BC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAA;IACpB,CAAC;IAED,MAAM;QACJ,OAAO,kBAAI,CAAA;wBACS,CAAC,CAAY,EAAC,EAAE,CAAA,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;KACvD,CAAC;IACJ,CAAC;IACD,YAAY,CAAC,CAAY;QACvB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC;QAC1B,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACpD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;IACrD,CAAC;CAkBF,CAAA;AA5CQ,wBAAM,GAAG,iBAAG,CAAA;;;;;;;;;;GAUlB,CAAC;AAXS,iBAAiB;IAD7B,2BAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CA6C7B;AA7CY,8CAAiB"}

+ 3 - 0
lib/main.d.ts

@@ -0,0 +1,3 @@
+export * from './Ressource';
+export * from './Event';
+export * from './Timeline';

+ 16 - 0
lib/main.js

@@ -0,0 +1,16 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./Ressource"), exports);
+__exportStar(require("./Event"), exports);
+__exportStar(require("./Timeline"), exports);
+//# sourceMappingURL=main.js.map

+ 1 - 0
lib/main.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0CAAwB;AACxB,6CAA2B"}

+ 36 - 0
lib/stories/Timeline.stories.d.ts

@@ -0,0 +1,36 @@
+import { Story } from '@storybook/web-components';
+import { IEvent } from '../Event';
+import { IRessource } from '../Ressource';
+import { UnitLegend } from '../Timeline';
+declare const _default: {
+    title: string;
+    component: string;
+    argTypes: {
+        start: {
+            control: {
+                type: string;
+            };
+        };
+        end: {
+            control: {
+                type: string;
+            };
+        };
+    };
+};
+export default _default;
+interface TimelineProps {
+    start: string;
+    end: string;
+    slotduration: number;
+    legendSpan?: number;
+    slotWidth?: number;
+    legendFormat?: Partial<UnitLegend>;
+    ressources?: Array<IRessource>;
+    events?: Array<IEvent>;
+}
+export declare const Generic: Story<TimelineProps>;
+export declare const Week: Story<TimelineProps>;
+export declare const NestedRessource: Story<TimelineProps>;
+export declare const WithEvents: Story<TimelineProps>;
+export declare const Rainbow: Story<TimelineProps>;

+ 94 - 0
lib/stories/Timeline.stories.js

@@ -0,0 +1,94 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Rainbow = exports.WithEvents = exports.NestedRessource = exports.Week = exports.Generic = void 0;
+const Ressource_1 = __importDefault(require("../Ressource"));
+const Timeline_1 = __importDefault(require("../Timeline"));
+exports.default = {
+    title: 'Javascript/Timeline',
+    component: 'jc-timeline',
+    argTypes: {
+        start: {
+            control: { type: "date" }
+        },
+        end: {
+            control: { type: "date" }
+        }
+    }
+};
+const Template = (args) => {
+    const t = new Timeline_1.default();
+    t.start = args.start;
+    t.end = args.end;
+    if (args.legendSpan)
+        t.legendSpan = args.legendSpan;
+    if (args.slotduration)
+        t.slotDuration = args.slotduration;
+    if (args.slotWidth)
+        t.slotWidth = args.slotWidth;
+    if (args.legendSpan)
+        t.legendSpan = args.legendSpan;
+    if (args.legendFormat)
+        t.setLegendUnitFormatAll(args.legendFormat);
+    if (args.ressources)
+        t.addRessources(args.ressources);
+    if (args.events)
+        t.addEvents(args.events);
+    return t;
+};
+exports.Generic = Template.bind({});
+exports.Generic.args = {
+    start: "2021-04-04T22:00:00.000Z",
+    end: "2021-04-05T21:59:00.000Z",
+    ressources: [{ id: "1", title: "Ressource 1" }, { id: "2", title: "Ressource 2" }]
+};
+exports.Week = Template.bind({});
+exports.Week.args = {
+    start: "2021-04-04T22:00:00.000Z",
+    end: "2021-04-11T21:59:00.000Z",
+    slotduration: 360,
+    legendSpan: 4,
+    slotWidth: 30,
+    legendFormat: { "d": "MMM D" }
+};
+exports.NestedRessource = Template.bind({});
+exports.NestedRessource.args = {
+    start: "2021-04-05T05:00:00.000Z",
+    end: "2021-04-05T17:59:00.000Z",
+    ressources: [{ id: "2", title: "Ressource 2", parent: { id: "1", title: "Ressource 1" } }]
+};
+exports.WithEvents = Template.bind({});
+exports.WithEvents.args = {
+    start: "2021-04-05T05:00:00.000Z",
+    end: "2021-04-05T17:59:00.000Z",
+    ressources: [{ id: "1", title: "Ressource 1" }, { id: "2", title: "Ressource 2" }],
+    events: [
+        { id: '1', title: "Fixed ressource", ressourceId: '1', start: new Date("2021-04-05T05:00:00.000Z"), end: new Date("2021-04-05T07:59:00.000Z"), ressourceEditable: false, bgColor: "darkgreen" },
+        { id: '2', title: "Fixed time", ressourceId: '1', start: new Date("2021-04-05T09:00:00.000Z"), end: new Date("2021-04-05T10:59:00.000Z"), editable: false, bgColor: "FireBrick" },
+        { id: '3', ressourceId: '2', start: new Date("2021-04-05T10:00:00.000Z"), end: new Date("2021-04-05T11:59:00.000Z") },
+        { id: '4', ressourceId: '2', start: new Date("2021-04-05T11:00:00.000Z"), end: new Date("2021-04-05T12:59:00.000Z") },
+        { id: '5', ressourceId: '2', start: new Date("2021-04-05T12:00:00.000Z"), end: new Date("2021-04-05T13:59:00.000Z") }
+    ]
+};
+const nItem = 25;
+const date = (new Date("2021-04-05T05:00:00.000Z")).valueOf();
+exports.Rainbow = Template.bind({});
+exports.Rainbow.args = {
+    start: "2021-04-05T05:00:00.000Z",
+    end: "2021-04-05T17:59:00.000Z",
+    ressources: [Array(8).fill(0).map((_, i) => new Ressource_1.default({ id: "" + i, title: "level " + i }))
+            .reduce((acc, o) => { o.parent = acc; return o; }, undefined)],
+    events: Array(nItem).fill(0).map((_, i) => {
+        return {
+            id: "" + i,
+            ressourceId: "" + (i % 8),
+            title: "Item " + i,
+            start: new Date(date + 1800000 * i),
+            end: new Date(date + 3600000 + 1800000 * i),
+            bgColor: "hsl(" + Math.round(i / (nItem - 1) * 360) + ", 100%, 50%)"
+        };
+    })
+};
+//# sourceMappingURL=Timeline.stories.js.map

File diff suppressed because it is too large
+ 0 - 0
lib/stories/Timeline.stories.js.map


+ 2 - 0
lib/styles/SimplbeBar.styles.d.ts

@@ -0,0 +1,2 @@
+import { CSSResult } from "lit-element";
+export declare const SimpleBarStyle: CSSResult;

+ 216 - 0
lib/styles/SimplbeBar.styles.js

@@ -0,0 +1,216 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SimpleBarStyle = void 0;
+const lit_element_1 = require("lit-element");
+exports.SimpleBarStyle = lit_element_1.css `[data-simplebar] {
+    position: relative;
+    flex-direction: column;
+    flex-wrap: wrap;
+    justify-content: flex-start;
+    align-content: flex-start;
+    align-items: flex-start;
+  }
+  
+  .simplebar-wrapper {
+    overflow: hidden;
+    width: inherit;
+    height: inherit;
+    max-width: inherit;
+    max-height: inherit;
+  }
+  
+  .simplebar-mask {
+    direction: inherit;
+    position: absolute;
+    overflow: hidden;
+    padding: 0;
+    margin: 0;
+    left: 0;
+    top: 0;
+    bottom: 0;
+    right: 0;
+    width: auto !important;
+    height: auto !important;
+    z-index: 0;
+  }
+  
+  .simplebar-offset {
+    direction: inherit !important;
+    box-sizing: inherit !important;
+    resize: none !important;
+    position: absolute;
+    top: 0;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    padding: 0;
+    margin: 0;
+    -webkit-overflow-scrolling: touch;
+  }
+  
+  .simplebar-content-wrapper {
+    direction: inherit;
+    box-sizing: border-box !important;
+    position: relative;
+    display: block;
+    height: 100%; /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */
+    width: auto;
+    max-width: 100%; /* Not required for horizontal scroll to trigger */
+    max-height: 100%; /* Needed for vertical scroll to trigger */
+    scrollbar-width: none;
+    -ms-overflow-style: none;
+  }
+  
+  .simplebar-content-wrapper::-webkit-scrollbar,
+  .simplebar-hide-scrollbar::-webkit-scrollbar {
+    width: 0;
+    height: 0;
+  }
+  
+  .simplebar-content:before,
+  .simplebar-content:after {
+    content: ' ';
+    display: table;
+  }
+  
+  .simplebar-placeholder {
+    max-height: 100%;
+    max-width: 100%;
+    width: 100%;
+    pointer-events: none;
+  }
+  
+  .simplebar-height-auto-observer-wrapper {
+    box-sizing: inherit !important;
+    height: 100%;
+    width: 100%;
+    max-width: 1px;
+    position: relative;
+    float: left;
+    max-height: 1px;
+    overflow: hidden;
+    z-index: -1;
+    padding: 0;
+    margin: 0;
+    pointer-events: none;
+    flex-grow: inherit;
+    flex-shrink: 0;
+    flex-basis: 0;
+  }
+  
+  .simplebar-height-auto-observer {
+    box-sizing: inherit;
+    display: block;
+    opacity: 0;
+    position: absolute;
+    top: 0;
+    left: 0;
+    height: 1000%;
+    width: 1000%;
+    min-height: 1px;
+    min-width: 1px;
+    overflow: hidden;
+    pointer-events: none;
+    z-index: -1;
+  }
+  
+  .simplebar-track {
+    z-index: 1;
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    pointer-events: none;
+    overflow: hidden;
+  }
+  
+  [data-simplebar].simplebar-dragging .simplebar-content {
+    pointer-events: none;
+    user-select: none;
+    -webkit-user-select: none;
+  }
+  
+  [data-simplebar].simplebar-dragging .simplebar-track {
+    pointer-events: all;
+  }
+  
+  .simplebar-scrollbar {
+    position: absolute;
+    left: 0;
+    right: 0;
+    min-height: 10px;
+  }
+  
+  .simplebar-scrollbar:before {
+    position: absolute;
+    content: '';
+    background: black;
+    border-radius: 7px;
+    left: 2px;
+    right: 2px;
+    opacity: 0;
+    transition: opacity 0.2s linear;
+  }
+  
+  .simplebar-scrollbar.simplebar-visible:before {
+    /* When hovered, remove all transitions from drag handle */
+    opacity: 0.5;
+    transition: opacity 0s linear;
+  }
+  
+  .simplebar-track.simplebar-vertical {
+    top: 0;
+    width: 11px;
+  }
+  
+  .simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
+    top: 2px;
+    bottom: 2px;
+  }
+  
+  .simplebar-track.simplebar-horizontal {
+    left: 0;
+    height: 11px;
+  }
+  
+  .simplebar-track.simplebar-horizontal .simplebar-scrollbar:before {
+    height: 100%;
+    left: 2px;
+    right: 2px;
+  }
+  
+  .simplebar-track.simplebar-horizontal .simplebar-scrollbar {
+    right: auto;
+    left: 0;
+    top: 2px;
+    height: 7px;
+    min-height: 0;
+    min-width: 10px;
+    width: auto;
+  }
+  
+  /* Rtl support */
+  [data-simplebar-direction='rtl'] .simplebar-track.simplebar-vertical {
+    right: auto;
+    left: 0;
+  }
+  
+  .hs-dummy-scrollbar-size {
+    direction: rtl;
+    position: fixed;
+    opacity: 0;
+    visibility: hidden;
+    height: 500px;
+    width: 500px;
+    overflow-y: hidden;
+    overflow-x: scroll;
+  }
+  
+  .simplebar-hide-scrollbar {
+    position: fixed;
+    left: 0;
+    visibility: hidden;
+    overflow-y: scroll;
+    scrollbar-width: none;
+    -ms-overflow-style: none;
+  }`;
+//# sourceMappingURL=SimplbeBar.styles.js.map

+ 1 - 0
lib/styles/SimplbeBar.styles.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"SimplbeBar.styles.js","sourceRoot":"","sources":["../../src/styles/SimplbeBar.styles.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAEhC,QAAA,cAAc,GAAa,iBAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkNvC,CAAA"}

+ 2 - 0
lib/styles/Timeline.style.d.ts

@@ -0,0 +1,2 @@
+import { CSSResult } from "lit-element";
+export declare const TimelineStyle: CSSResult;

+ 245 - 0
lib/styles/Timeline.style.js

@@ -0,0 +1,245 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TimelineStyle = void 0;
+const lit_element_1 = require("lit-element");
+exports.TimelineStyle = lit_element_1.css `
+* {
+    font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
+    font-size: 16px;
+    font-weight: 400;
+}
+div {
+    box-sizing: border-box;
+}
+.jc-timeline-content,
+.jc-timeline-header{
+    width:100%;
+    position:relative;
+    display: flex;
+    flex-direction:row;
+    height:max-content;
+    align-items: stretch;
+}
+
+.jc-timeline-rows-title,
+.jc-timeline-rows > tr > td{        
+    padding: 8px;
+    min-width:40px;
+    box-sizing: border-box;
+}
+.jc-timeline-rows > tr > td {
+    max-width:calc( var(--width) - 8px );
+    padding: 0px; 
+    vertical-align:top;
+}
+.jc-timeline-rows > tr.empty > td{
+    padding: 6px 0px 4px 8px;
+}
+i.jc-spacer {
+    display:inline-block;
+    width : 1rem;
+    height: 1rem;
+    position:relative;
+    box-sizing: border-box;
+}
+i.jc-spacer:after{
+    content: " ";
+    position:absolute;
+    background-repeat: no-repeat;
+    background-size: 1.05rem;
+    width:  1.05rem;
+    height: 1.05rem;
+}
+.jc-spacer.extend,
+.jc-spacer.collapse    {
+    cursor:pointer;
+}
+i.jc-spacer.extend:after{
+    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMFYweiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik0xOSAzSDVjLTEuMTEgMC0yIC45LTIgMnYxNGMwIDEuMS44OSAyIDIgMmgxNGMxLjEgMCAyLS45IDItMlY1YzAtMS4xLS45LTItMi0yem0wIDE2SDVWNWgxNHYxNHptLTgtMmgydi00aDR2LTJoLTRWN2gtMnY0SDd2Mmg0eiIvPjwvc3ZnPg==")
+}
+i.jc-spacer.collapse:after{
+    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0Ij48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDNINWMtMS4xIDAtMiAuOS0yIDJ2MTRjMCAxLjEuOSAyIDIgMmgxNGMxLjEgMCAyLS45IDItMlY1YzAtMS4xLS45LTItMi0yem0wIDE2SDVWNWgxNHYxNHpNNyAxMWgxMHYySDd6Ii8+PC9zdmc+")
+}
+
+.jc-timeline-rows > tr{
+    box-sizing: border-box;
+    white-space: nowrap;
+    border: 1px solid grey;
+    border-style: solid none;
+}
+.jc-timeline-rows,
+.jc-timeline-rows-title{
+    height: inherit;
+    width:var(--width, 200px);
+    overflow: hidden;
+    border-collapse:collapse;
+}
+.jc-timeline-grid-title-container,
+.jc-timeline-grid-container{
+    position:relative;
+    width: 600px;
+    display: block;
+    overflow: hidden;
+}
+.jc-timeline-grid-container{
+    overflow-x: auto;
+}
+.jc-timeline-grid-title-container table,
+.jc-timeline-grid-container table {
+    width:100%;
+    table-layout: fixed;
+    border-collapse: collapse;
+    box-sizing: border-box;
+}
+
+.jc-timeline-grid-title-container {
+    white-space: nowrap;
+    cursor: grab;
+    user-select: none; /* supported by Chrome and Opera */
+    -webkit-user-select: none; /* Safari */
+    -khtml-user-select: none; /* Konqueror HTML */
+    -moz-user-select: none; /* Firefox */
+    -ms-user-select: none; /* Internet Explorer/Edge */
+}
+.jc-timeline-grid-title:first-child > th{
+    border-top:0;
+    border-left-color:#ffff;
+    border-right-color:#ffff;
+}    
+.jc-timeline-grid-title:first-child > th:before,
+.jc-timeline-grid-title:first-child > th:last-child:after {
+    content:" ";
+    display: block;
+    position:absolute;
+    left:-1px;
+    bottom:0px;
+    height: 8px;
+    border-left: 1px solid lightgrey;
+    z-index:2;
+}
+.jc-timeline-grid-title:first-child > th:last-child:after
+{
+    left:auto;
+    right:-1px;
+}
+.jc-timeline-grid-title:first-child:last-child >th{
+    padding:8px 0;
+}
+.jc-timeline-grid-title:last-child > th{
+    border-bottom:none;
+}
+.jc-timeline-grid-title > th,
+.jc-slot {      
+    height:100%;
+    border: solid 1px lightgrey;
+    border-left-style: dotted;
+    border-right:0;
+    text-align: center;
+    position:relative;
+    box-sizing: border-box;
+}
+.jc-timeline-grid-title > th:last-child,
+.jc-slot:last-child{
+    border-right:solid 1px lightgray;
+}
+.jc-timeline-grid-title > th,
+.jc-major-slot{
+    border-left-style: solid;
+}
+.jc-timeslots{
+    position:absolute;
+    top:0px;
+    left:0px;
+    bottom:0px;
+    overflow: hidden;
+}
+.jc-timeslot{
+    position:absolute;
+    white-space: nowrap;
+    overflow-x:hidden;
+    background-color:var(--default-background);
+    color:#fff;
+    border-radius:3px;
+    padding:4px;
+    margin:2px 0px;
+    font-size:14px;
+    font-weight:600;
+    z-index:1;
+    cursor:auto;
+}
+.jc-timeslot.empty{
+    height:5px;
+    padding:2px 2px;
+    margin:0px;
+    cursor:pointer;
+}
+.jc-timeslot.moving{
+    opacity:0.7;
+    cursor:grabbing;
+}
+.jc-timeslot.selected:before{
+    border:solid 2px black;
+    position:absolute;
+    top:0;
+    bottom:0;
+    left:0;
+    right:0;
+    content:" ";
+}
+.jc-timeslot-resizer-start,
+.jc-timeslot-resizer-end{
+    position:absolute;
+    top:0;
+    bottom:0;
+    width:4px;
+    min-width:4px;
+    display:block;
+    cursor: ew-resize;
+}
+.jc-timeslot-resizer-start,
+.jc-timeslot-resizer-end{
+    display:block;
+}
+.jc-timeslot-resizer-start{
+    left:0px;
+}
+.jc-timeslot-resizer-end{
+    right:0px;
+}
+.jc-timeline-rows > tr >td{
+    height:100%;
+}
+.jc-ressource{
+    padding-top: 2px;
+    height: calc( 100% - 8px);
+}
+.jc-ressource > span {
+    pointer-events: none;
+}
+.jc-ressource.target{
+    background-color: lightgrey;
+}
+.jc-ressource-selected{
+    border:1px solid var(--default-background, SteelBlue);
+    border-right:0;
+    border-left:0;
+    background-color:#4682b46b;
+}
+.jc-ressource-above{
+    height:4px;
+}
+.jc-ressource-above.target{
+    margin-left: calc( var(--depth) * 16px );
+    background-color: var(--default-background, SteelBlue);
+    border-radius: 0 0 0 4px;
+}
+.jc-ressource-below{
+    height:4px;
+}
+.jc-ressource-below.target{
+    margin-left: calc( var(--depth) * 16px);
+    background-color: var(--default-background, SteelBlue);
+    border-radius: 4px 0 0 0;
+}
+`;
+//# sourceMappingURL=Timeline.style.js.map

+ 1 - 0
lib/styles/Timeline.style.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"Timeline.style.js","sourceRoot":"","sources":["../../src/styles/Timeline.style.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAEhC,QAAA,aAAa,GAAa,iBAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+OzC,CAAC"}

+ 4 - 0
lib/utils/selectable.d.ts

@@ -0,0 +1,4 @@
+export default interface Selectable {
+    selected: boolean;
+    id: string;
+}

+ 3 - 0
lib/utils/selectable.js

@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=selectable.js.map

+ 1 - 0
lib/utils/selectable.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"selectable.js","sourceRoot":"","sources":["../../src/utils/selectable.ts"],"names":[],"mappings":""}

+ 3 - 0
lib/utils/syncroScroll.d.ts

@@ -0,0 +1,3 @@
+declare type scrollingDirection = "v" | "h" | "vh" | "hv";
+export default function syncronizeElementsScrolling(elements: Array<HTMLBaseElement>, direction?: scrollingDirection): void;
+export {};

+ 27 - 0
lib/utils/syncroScroll.js

@@ -0,0 +1,27 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+function syncronizeElementsScrolling(elements, direction = "vh") {
+    let activeScroller = null;
+    const bSyncroV = direction.indexOf("v") > -1;
+    const bSyncroH = direction.indexOf("h") > -1;
+    const applyListener = function (element) {
+        element.addEventListener("mouseenter", function (e) {
+            activeScroller = e.target;
+        });
+        element.addEventListener("scroll", function (e) {
+            if (e.target !== activeScroller)
+                return;
+            elements.forEach(function (element) {
+                if (activeScroller === element || activeScroller === null)
+                    return;
+                if (bSyncroV)
+                    element.scrollTop = activeScroller.scrollTop;
+                if (bSyncroH)
+                    element.scrollLeft = activeScroller.scrollLeft;
+            });
+        });
+    };
+    elements.forEach(applyListener);
+}
+exports.default = syncronizeElementsScrolling;
+//# sourceMappingURL=syncroScroll.js.map

+ 1 - 0
lib/utils/syncroScroll.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"syncroScroll.js","sourceRoot":"","sources":["../../src/utils/syncroScroll.ts"],"names":[],"mappings":";;AAEA,SAAwB,2BAA2B,CAAC,QAA+B,EAAE,YAA+B,IAAI;IACpH,IAAI,cAAc,GAAsB,IAAI,CAAC;IAC7C,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAE;IAC9C,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAE;IAC9C,MAAM,aAAa,GAAG,UAAS,OAAuB;QACpD,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,UAAS,CAAY;YAC1D,cAAc,GAAG,CAAC,CAAC,MAAqB,CAAC;QAC3C,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAS,CAAO;YACjD,IAAI,CAAC,CAAC,MAAM,KAAK,cAAc;gBAAE,OAAO;YACxC,QAAQ,CAAC,OAAO,CAAC,UAAS,OAAO;gBAC/B,IAAI,cAAc,KAAK,OAAO,IAAI,cAAc,KAAK,IAAI;oBAAE,OAAO;gBAClE,IAAI,QAAQ;oBAAE,OAAO,CAAC,SAAS,GAAG,cAAc,CAAC,SAAS,CAAC;gBAC3D,IAAI,QAAQ;oBAAE,OAAO,CAAC,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC;YAC/D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IACD,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;AACjC,CAAC;AAlBH,8CAkBG"}

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jc-timeline",
-  "version": "0.1.0",
+  "version": "0.1.1",
   "description": "web component to manage ressources in time",
   "main": "./lib/main.js",
   "types": "./lib/main.d.ts",

Some files were not shown because too many files changed in this diff