diff --git a/src/components/timebar/Timebar.stories.mdx b/src/components/timebar/Timebar.stories.mdx new file mode 100644 index 0000000..4cf21cc --- /dev/null +++ b/src/components/timebar/Timebar.stories.mdx @@ -0,0 +1,5 @@ +import { Meta, ArgsTable } from '@storybook/addon-docs'; +import { Timebar } from '@famiprog-foundation/react-gantt'; +import { encodeApiDocURIForSubpath, parametersDocPage } from '../StorybookUtils'; + + diff --git a/src/components/timebar/Timebar.stories.tsx b/src/components/timebar/Timebar.stories.tsx new file mode 100644 index 0000000..2341e2c --- /dev/null +++ b/src/components/timebar/Timebar.stories.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import Timebar, { HourTimeUnit, MinuteTimeUnit } from './Timebar'; +import moment from 'moment'; + +export default { + title: 'Features/Timebar' +}; + +export const Main = () => { + return ; +}; diff --git a/src/components/timebar/Timebar.tsx b/src/components/timebar/Timebar.tsx new file mode 100644 index 0000000..fcb49b4 --- /dev/null +++ b/src/components/timebar/Timebar.tsx @@ -0,0 +1,68 @@ +import moment from "moment"; +import React from "react"; + +export type TimebarProps = { + start: moment.Moment | number; + end: moment.Moment | number; + cursorTime?: moment.Moment | number; + // the maximum size for this array was 2, anothers elements was ignored + timeUnits?: TimeUnit[]; + minLabelSizeInPixels?: number; + width: number; +} + +export default class Timebar extends React.Component { + + render() { + // render 2 timbars, + // the timeUnits to get the segments on timebars + // width for component + // minLabelSizeInPixels, ce facem cand e mai mare si nu incap toate intervalele, incrementam unitatea? + return null; + } +} + + +export class TimeUnit { + multiple!: number; + + constructor(value: Partial) { + Object.assign(this, value); + } +} + +export class SecondTimeUnit extends TimeUnit { + constructor(value: Partial) { + super(value); + } +} + +export class MinuteTimeUnit extends TimeUnit { + constructor(value: Partial) { + super(value); + } +} + +export class HourTimeUnit extends TimeUnit { + constructor(value: Partial) { + super(value); + } +} + +export class DayTimeUnit extends TimeUnit { + constructor(value: Partial) { + super(value); + } +} + +export class MonthTimeUnit extends TimeUnit { + constructor(value: Partial) { + super(value); + } +} + +export class YearTimeUnit extends TimeUnit { + constructor(value: Partial) { + super(value); + } +}