1.2.25 • Published 3 years ago

osome-kit v1.2.25

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

NPM JavaScript Style Guide

Table of Contents

About The Project

This project support you can switching calendar & gantt easily.

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
npm install npm@latest -g
  • react
npm install --save react react-dom

Installation

  1. Npm install
    npm install --save osome-kit

Usage

1. Before using osome-kit please import module.

import { OSCalendar, OSGantt } from 'osome-kit'

2. Implement below codes in the react render method.

Calendar

 <OSCalendar
            options={this.state.options}
            categories={this.state.categories}
            onClickSchedule={this.onClickSchedule}
            onChangedSchedule={this.onChangedSchedule}
            onDragEndTile={(start, end, renderOption) => {
              const order = Math.round(Math.random() * 10) % (this.state.categories.length || 1)
              const category = this.state.categories[order]
              const index = category.events.length
              const data = (category === undefined) ? { title: 'This is Title', detail: 'This is Detail', style: { color: '#fff', backgroundColor: '#f00' }, index: index, order: order, startDate: start, endDate: end } : {
                title: category.content.title, detail: '', style: { color: '#fff', backgroundColor: category.content.style.color }, index: index, order: order, startDate: start, endDate: end
              }
              this.setState(update(this.state, { categories: { [order]: { events: { $push: [data] } } } }))
            }} />

Gantt

<OSGantt style={{width: '100%', padding: '0'}} ref={this.osGantt} categories={this.state.categories} options={this.state.options}
          onChangedSchedule={this.onChangedSchedule}
          onChangedCategory={this.onChangedCategory}
          onClickSchedule={this.onClickSchedule}
          onDragEndTile={(row, start, end, renderOption) => {
            const category = this.state.categories[row]
            const data = { title: category.content.title, detail: 'This is Detail', style: { color: '#fff', backgroundColor: category.content.style.color }, order: row, startDate: start, endDate: end, index: category.events.length }
            this.setState(update(this.state, { categories: { [row]: { events: { $push: [data] } } } }))
          }}
        />

Supported Props

OSCalendar Props

ProptypeDescription
categoriesobjectEvent data
optionsobjectCalendar's option
onClickSchedulefunction(element, category, event)When click schedule block. it will be fired.
onChangedSchedulefunction(order, event, afterEvent)When Schedule changed user interaction. such as move,resize it will be fired.
onClickMoreButtonfunction(element, events)When click more button. ( more button will be appeared when you set maxEvent in options)

OSGantt Props

ProptypeDescription
categoriesobjectEvent data (same with above calnedar events)
optionsobjectGantt's option
onClickSchedulefunction(element, category, event)When click schedule block. it will be fired.
onMouseRightClickfunction(element, event)When click mouse right button on left continaer's rows.
onDragEndTilefunction(start, end, renderOption)When mouse down and up in right container's row tiles it will be fired. (create schedule by dragging)
onChangedSchedulefunction(order, event, afterEvent)When schedule changed by user interaction. such as move,resize it will be fired.
onChangedCategoryfunction(categories, afterCategories)When category changed by user interaction. such as move category it will be fired.
onChangeContainerfunction(left, right)When container size changging. it will be fired every resized time.
onCompleteContainerResizefunction(left, right)When container's resize finished. it will be fired.

More Info

Options
PropertytypeDescription
typestringGantt Only currently only exist 'row', Default row
fixedboolGantt Only fixed gantt resizable left, right container. Default false
disabledboolGantt Only disable all event.
styleobjectGantt & Calendar style of elements.
countrystringGantt & Calendar for localizing. Default ko
daysobjectGantt & Calendar for localizing. Default { ko: ['일', '월', '화', '수', '목', '금', '토'], jp: ['日', '月', '火', '水', '木', '金', '土']}
todaydateGantt & Calendar Today's date. Default new Date()
yearnumberGantt & Calendar Today's year. Default new Date().getFullYear()
monthnumberGantt & Calendar Today's month. Default new Date().getMonth()
handleMinnumberGantt Only the minimum limit of left container's width percentage number.Default 5 (It mean 5%)
handleMaxnumberGantt Only the minimum limit of left container's width percentage number.Default 35 (It mean 35%)
maxEventnumberCalendar Only the limit of schedules can be displayed on calendar grid. if more than this number, more button will be shown.Default 2000
moreButtonobjectCalendar Only more button text.Default { ko: '+ 더보기', jp: '+ もっと見る' }
refreshboolGantt & Calendar after categories modified. calendar,gantt reset or saving offset y of scroll offset.
Categories
PropertytypeDescription
contentobjectIt is just wrapper key. it includes below properties
Content
PropertytypeDescription
typestringGantt Only you can set main, sub type of calendar.Default main
ordergantt orderGantt Only gantt chart's order
styleobjectGantt & Calendar react style object of calendar
eventsarrayGantt & Calendar events
  • In Example
Events
PropertytypeDescription
idstringGantt & Caldnear this is schedule id key!
indexnumberGantt & Caldnear this is schedule's index of schedule array
titlestringGantt & Calendar this is schedule title
styleobjectGantt & Calendar style of schedule block
startDatestringGantt & Calendar when the schedule start
endDatestringGantt & Calendar when the schedule end
  • In Example

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

GiPyeong Lee - @gipyeong - gipyeong.lee@gmail.com

Project Link: https://github.com/gipyeong-lee/osome-kit

Reference

Best Readme Template

1.2.25

3 years ago

1.2.24

3 years ago

1.2.23

5 years ago

1.2.22

5 years ago

1.2.21

5 years ago

1.2.20

5 years ago

1.2.19

5 years ago

1.2.18

5 years ago

1.2.17

5 years ago

1.2.16

5 years ago

1.2.15

5 years ago

1.2.14

5 years ago

1.2.13

5 years ago

1.2.12

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.50

5 years ago

1.1.49

5 years ago

1.1.48

5 years ago

1.1.47

5 years ago

1.1.46

5 years ago

1.1.45

5 years ago

1.1.44

5 years ago

1.1.43

5 years ago

1.1.42

5 years ago

1.1.41

5 years ago

1.1.40

5 years ago

1.1.39

5 years ago

1.1.38

5 years ago

1.1.37

5 years ago

1.1.36

5 years ago

1.1.35

5 years ago

1.1.34

5 years ago

1.1.33

5 years ago

1.1.32

5 years ago

1.1.31

5 years ago

1.1.30

5 years ago

1.1.29

5 years ago

1.1.28

5 years ago

1.1.27

5 years ago

1.1.26

5 years ago

1.1.25

5 years ago

1.1.24

5 years ago

1.1.23

5 years ago

1.1.22

5 years ago

1.1.21

5 years ago

1.1.20

5 years ago

1.1.19

5 years ago

1.1.18

5 years ago

1.1.17

5 years ago

1.1.16

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.50

5 years ago

1.0.49

5 years ago

1.0.48

5 years ago

1.0.47

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago