CompletedWithin

CompletedWithin UI Component

Installation

npm i @synerise/ds-completed-within
or
yarn add @synerise/ds-completed-within

Usage

import CompletedWithin from '@synerise/ds-completed-within'
<CompletedWithin
value={store.state.value}
onSetValue={handleSetValue}
/>

Demo

API

PropertyDescriptionTypeDefault
textCustom labels and tooltipsCompletedWithinTexts-
valueSelected valuePeriodValue{ value: undefined, period: 'YEARS'}
onSetValueFunction called when user has closed the settings with set value, and period(value: PeriodValue) => void-
periodsCustom list of periodsCustomPeriod[]-

CompletedWithinTexts

PropertyDescriptionTypeDefault
headerHeader of settingsstring \ React.ReactNodeCompleted within
completedLabelLabel of button with selected valuestring \ React.ReactNodeCompleted within
clearClear button tooltipstring \ React.ReactNodeClear
periodPlaceholderPlaceholder of period selectstring \ React.ReactNodeInterval

PeriodValue

PropertyDescriptionTypeDefault
valueNumerical valuenumber \ undefinedundefined
periodPeriod key, default options: SECONDS, MINUTES, HOURS, DAYS, MONTHS, YEARSstring \ undefinedundefined

CustomPeriod

PropertyDescriptionTypeDefault
valueKey of custom periodstring-
labelLabel of custom periodstring-