0.4.0 • Published 4 years ago

react-table-time-picker v0.4.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-table-time-picker

npm.io

Description

Time picker represented in table form

Dependencies

  • React.JS
  • Moment.JS

Installation

npm run install --save react-table-time-picker

Usage

import React, { useState } from 'react';
import { render } from 'react-dom';
import moment from 'moment';
import TimePicker from 'react-table-time-picker';

function App() {
  return (
    <div>
      <TimePicker
        attachElement={(
          <input />
        )}
      />
    </div>
  );
}
render(<App />, document.getElementById('root'));

API

NameTypeDefaultDescription
zIndexNumber1css z-index
maxWidthNumberundefinedcss max-width
maxHeightNumberundefinedcss max-height
position'top','right','bottom','left'mediumposition of the time picker relative to its attach element
defaultValuemoment,momentmoment(), moment()moment instance of begin time and end time
onValueChangeFunction() => {}call back when both start time and end time are selected,two-tuple [moment,moment] which represents start and end time will be passed as arguments
size'small','medium','big'mediumsize of the time picker
widthNumberaccording to sizeif you are not satisfied with the preset width according to size props,custom it with this prop
heightNumberaccording to sizeif you are not satisfied with the preset height according to size props,custom it with this prop
fontSizeNumberaccording to sizeif you are not satisfied with the preset fontSize according to size props,custom it with this prop
attachElementHTMLElement-the attachment for the time picker
originColorCSS Color#66ccffcolor of the table cell
includedColorCSS Colorrgba(102, 204, 255, 0.5)color of the table cell when included between the begin time and end time
selectedColorCSS Color#458badcolor of the table cell when selected as begin time or end time
confirmModalBooleantruewhether to pop up a confirm modal when begin time and end time are both selected
classNameStringempty stringclassName of the time picker wrapper element, note that this prop is designed to help detecting the propagation of events produced inside the time picker
hourStepNumber1hour interval option
minuteStepNumber1minute interval option

New Features

  • Interval options are now supported
  • Tooltips will now give a explicit hint in cross day cases
  • Tooltip hiding option supported

demo

demo

0.4.0

4 years ago

0.3.0

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.2

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago