0.9.24 • Published 7 years ago

timeslot-picker v0.9.24

Weekly downloads
101
License
SEE LICENSE IN 'L...
Repository
github
Last release
7 years ago

\<timeslot-picker>

NOT YET PRODUCTION READY

A polymer element for choosing timeslots. Timeslots can be variable.

The element can be used to display a slider with timeslots at 30 minutes interval. User can select a slot (Max 6 units). An overlay is shown as slider to select slots

As Polymer 3 demos are not working right now, Please check the demo here.

Properties

Propertytyperequiredreflected *notify *description
bookingsArrayyesfalsefalseSet of slots already booked
chosenStartTimeStringnotruetrueStarting time slot value
chosenEndTimeStringnotruetrueEnding time slot value
chosenUnitsNumbernotruetrueNumber of slots chosen
noCloseOnOverlayTapBooleannofalsedisable the closing of slider on overlay tap
maxLimitNumbernofalseMaximum number of slots allowed to book. default value = 6

bookings property must be an Array of meetings

    bookings: [{
            meetingName: 'Sai\'s Meeting',
            meetingId: 'bbcks',
            meetingStartTime: '3:00 PM',
            units: 4
          },
          {
            meetingName: 'Ranveer\'s Meeting',
            meetingId: 'wqqps',
            meetingStartTime: '7:00 PM',
            units: 2
          },
          {
            meetingName: 'Daman\'s Meeting',
            meetingId: 'kisoe',
            meetingStartTime: '8:00 PM',
            units: 1
          }
        ]

* Please note:

Property with notify: true fires a property-changed event when the value is changed. Example: PropertyName fires property-name-changed event on value change

Reflected attributes updates the element with property attribute when the value changes. Example: PropertyName updates the attribute as property-name="value"

Methods

Method NameArgumentsDescription
open()slotNumberToBeSelected: NumberOpens the slider on the mentioned slot
close()undefinedCloses the slider

Events

EventDetail ObjectDescription
closenot requiredCloses the Slider
openslot: <number>Opens the slider at the mentioned slot

dispatch Event to this element Example:

document.querySelector('timeslot-picker').dispatchEvent(new CustomEvent('open', {
    detail: {
          slot: 2
        }
}))

Styling

CSS variabledescriptiondefault
--timeslot-unit-heightTimeslot unit height50px
--timeslot-unit-widthTimeslot unit width50px
--timeslot-available-bgTimeslot Available background color#fff
--timeslot-disabled-bgTimeslot Available background color#fff
--timeslot-unavailable-bgTimeslot Unavailable background color#666
--timeslot-font-sizeTimeslot indicators and slots text size10px
--timeslot-picker-tooltip-backgroundTooltip bubble background color#000
--timeslot-picker-tooltip-colorTooltip bubble text color#fff
--timeslot-picker-scroll-btn-backgroundLeft and right scroll buttons background#fff
--timeslot-picker-scroll-btn-colorLeft and right scroll text background#000
--timeslot-overlay-backgroundBackground color for overlay over the timeslot unitsbase64PNG
--timeslot-overlay-container-backgroundBackground color for the container which contains slider#777
--timeslot-overlay-container-border-leftTimeslot indicators left bordernone
--timeslot-overlay-container-border-rightTimeslot indicators right bordernone
--timeslot-slider-thumb-backgroundSlider thumb backgroud colorbase64SVG
--timeslot-unit-borderTimeslot Unit Border1px solid #000
--timeslot-border-radiusTimeslot Unit border radius0
--timeslot-picker-scroll-left-btn-border-radiusLeft Scroll button border0
--timeslot-picker-scroll-right-btn-border-radiusRight Scroll button border0
--timeslot-picker-scroll-btn-fontfont shorthand for Scroll Buttonnone
--timeslot-overlay-indicators-colorText color for text in overlay slider#000
--timeslot-unit-text-marginMargin for Text being displayed in a timeslot2px

npmjs.org

github.com

webcomponents.org

0.9.24

7 years ago

0.9.23

7 years ago

0.9.22

7 years ago

0.9.21

7 years ago

0.9.20

7 years ago

0.9.19

7 years ago

0.9.18

7 years ago

0.9.17

7 years ago

0.9.16

7 years ago

0.9.15

7 years ago

0.9.14

7 years ago

0.9.13

7 years ago

0.9.12

7 years ago

0.9.11

7 years ago

0.9.10

7 years ago

0.9.9

7 years ago

0.9.8

7 years ago

0.9.7

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.0

7 years ago

0.9.1

7 years ago