@synerise/ds-logic
TypeScript icon, indicating that this package has built-in type declarations

0.8.47 • Public • Published

id: logic title: Logic

Logic UI Component

Installation

npm i @synerise/ds-logic
or
yarn add @synerise/ds-logic

Usage of Login

import Logic from '@synerise/ds-logic'

<Logic value={'AND'} onChange={handleChange} />

Usage of Matching

import Logic from '@synerise/ds-logic'

<Logic.Matching matching={true} onChange={handleChange} sentence="Find all items #MATCHING_TOGGLE# this condition." />

Demo

<iframe src="/storybook-static/iframe.html?id=components-logic--default"></iframe>

API

Property Description Type Default
value Value of logic component string -
onChange Function called when user change the value (value: string) => void -
options Custom list of options LogicOperator[] [{value: 'AND', label: 'And'}, {value: 'OR', label: 'Or'}]

LogicOperator

Property Description Type Default
value Value of logic option string -
label Label of logic option string \ React.ReactNode -

Logic.Matching

Property Description Type Default
matching Value of Matching component boolean false
sentence Custom sentence require #MATCHING_TOGGLE#, which will be replaced by Toggle component string -
onChange Function called when user click on Toggle component (matching: boolean) => void -
texts Custom labels of Matching, Not matching MatchingTexts -

MatchingTexts

Property Description Type Default
matching Label of Toggle component, visible when matching is true string matching
notMatching Label of Toggle component, visible when matching is false string not matching

/@synerise/ds-logic/

    Package Sidebar

    Install

    npm i @synerise/ds-logic

    Weekly Downloads

    94

    Version

    0.8.47

    License

    ISC

    Unpacked Size

    46.8 kB

    Total Files

    25

    Last publish

    Collaborators

    • synerise