1.0.10 • Published 2 years ago

heilsugreind-timalina v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

heilsugreind-timalina

Installation

Using npm:

$ npm i heilsugreind-timalina

In Node.js:

import { Timeline, Educational, TimeAndEdu } from "heilsugreind-timalina";

<TimeAndEdu data={data} />
<Timeline 
  lang="is" 
  activePhase={phase object} 
  phases={data.plan.phases} 
  changePhase={(args) => this.AnyFunction(args)} 
/>
 <Educational key={number} edu={gate object} activeColor={hex value for color} />

Props

Timeline

NameTypeRequiredValues Alloweddefault valuesDescription
phasesarraytruesee phasesdoes not applyEach phase for timeline
langstringfalse"is""en"Language for timeline
changePhasefunctiontruefunctionnoneFunction when phase clicked

phases

NameTypeRequiredValues Alloweddefault valuesDescription
namestringtrueAny stringdoes not applyName of phase for timeline
dateFromstringtrueYYYY-MM-DDdoes not applyStarting date of phase
dateTostringtrueYYYY-MM-DDdoes not applyStarting date of phase
overlappingbooleanfalseTrue or FalseFalseTrue on any phase that overlaps other phase
gatesarrayfalseedu objectsdoes not applyExtra info for educational

Educational

NameTypeRequiredValues Alloweddefault valuesDescription
keyintegertrueany integerdoes not applyNumber of educational table, only for visual numbering
eduobjecttruesee edudoes not applyInfo for each educational tile needs edu object
activeColorstringtruehex value for colordoes not applyWhat color to set as accent color

edu

NameTypeRequiredValues Alloweddefault valuesDescription
namestringtrueAny stringdoes not applyName of educational tile
textstringtrueAny stringdoes not applyInfo text for tile
myRolestringfalseAny stringdoes not applyExtra text info for tile
timeLimitsstringfalseAny stringdoes not applyExtra text info for tile
infoarrayfalse{text: string, link: <url>}does not applyLinks to other sources
stepintegerfalseAny integerdoes not applyVisual number of tile

TimeAndEdu

NameTypeRequiredValues Alloweddefault valuesDescription
dataobjecttrueplan: {phases: array} with gatesdoes not applyName of educational tile

Example of data

{
  "plan": {
    "phases": [
      {
        "name": "Lorem Ipsum",
        "overlapping": false,
        "dateFrom": "2020-12-18T00:00:00",
        "dateTo": "2021-02-17T00:00:00",
        "gates": [
          {
            "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
            "name": "Lorem Ipsum",
            "step": 1,
            "myRole": "Lorem Plorem",
            "timeLimits": null,
            "info": [
              {
                "text": "Link to stuff",
                "link": "/test"
              }
            ],
            "dates": [
              {
                "date": "2021-01-26T00:00:00"
              }
            ]
          }
        ]
      },
      {
        "name": "Excepteur sint",
        "overlapping": true,
        "dateFrom": "2021-01-18T00:00:00",
        "dateTo": "2021-05-17T00:00:00",
        "gates": [
          {
            "text":"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
            "name": "Excepteur sint",
            "step": 1,
            "myRole": null,
            "timeLimits": null,
            "info": [
              {
                "text": "Link to stuff",
                "link": "/test"
              }
            ],
            "dates": [
              {
                "date": "2021-02-13T00:00:00"
              }
            ]
          }
        ]
      }
    ]
  }
}
          
1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago