0.2.6 • Published 4 years ago

react-new-first-lib v0.2.6

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

DESKERA-UI-LIBRARY

deskera-ui-library is a set of React components, so understanding how React fits into web development is important.

Installing

Install the package in your project directory with:

// with npm
npm install deskera-ui-library

// with yarn
yarn add deskera-ui-library

List of components

showAlert

Alert box

Props

PropertyTypeRequiredValue
titleStringtrueempty
messageString
classNameString

Event

EventArgumentsDescription
onClickEmitted when clicked on button

Example

import { showAlert } from "deskera-ui-library";

showAlert("Updated successfully")

DKButton

Use button

Props

PropertyTypeRequiredValue
titleStringtrueempty
iconString
classNameString
styleString
isReverseBoolean

Event

EventArgumentsDescription
onClickEmitted when clicked on button

Example

import { DKButton } from "deskera-ui-library";

//simple button
<DKButton title="Try Now" className="text-white"/>

//button with icon
<DKButton title="Try Now" className="text-white" icon={`image_path`} />

DKCheckMark

Use Checkbox

Props

PropertyTypeRequiredValue
titleStringtrueempty
colorString
classNameString
isSelectedBoolean

Event

EventArgumentsDescription
onClickEmitted when clicked on check/uncheck

Example

import { DKCheckMark } from "deskera-ui-library";

<DKCheckMark title="Try Now" isSelected = {`true`} className="text-black"/>

DKContactIcon

Contact Icon

Props

PropertyTypeRequiredValue
titleStringtrueempty
classNameString

Example

import { DKContactIcon } from "deskera-ui-library";

<DKContactIcon title="Contact" />

DKHeader

Header Text

Props

PropertyTypeRequiredValue
textStringtrue
classNameString

Example

import { DKHeader } from "deskera-ui-library";

<DKHeader text="Heading title" />

DKIcon

Icon

Props

PropertyTypeRequiredValue
srcStringtrue
classNameString
styleString

Event

EventArgumentsDescription
onClickEmitted when clicked on check/uncheck

Example

import { DKIcon } from "deskera-ui-library";

<DKIcon src={`icon_path`} />

DKLabel

Label

Props

PropertyTypeRequiredValue
textStringtrue
classNameString
styleString

Example

import { DKLabel } from "deskera-ui-library";

<DKLabel text="Enter your phone no" />

DKLine

Line

Props

PropertyTypeRequiredValue
classNameString
styleString

Example

import { DKLine } from "deskera-ui-library";

<DKLine className="mt-m"/>

DKListPicker

List picker

Props

PropertyTypeRequiredValue
titleStringtrue-
classNameString
styleString
dataObject
buttonTitleString
needIconString

Event

EventArgumentsDescription
onSelectEmitted when select an option
onCloseEmitted when click on close button
buttonOnClickEmitted when click on button

Example

import { DKListPicker } from "deskera-ui-library";

<DKListPicker title="List Title" data={["Option1", "Option2", "Option3"]}  onSelect={(index, value)=>{}} />;

DKSectionHeader

Section of header

Props

PropertyTypeRequiredValue
textStringtrue
classNameString
styleString

Example

import { DKSectionHeader } from "deskera-ui-library";

<DKSectionHeader text="Header Title" />

DKSpaceH

Space Horizontal

Props

PropertyTypeRequiredValue
valueIntegertrue10

Example

import { DKSpaceH } from "deskera-ui-library";

<DKSpaceH value="10" />

DKSpaceV

Space Horizontal

Props

PropertyTypeRequiredValue
valueIntegertrue10

Example

import { DKSpaceV } from "deskera-ui-library";

<DKSpaceV value="10" />

DKSpinner

Spinner

Props

PropertyTypeRequiredValue
titleString--
classNameString--

Example

import { DKSpinner } from "deskera-ui-library";

//only spinner
<DKSpinner />


//spinner with title
<DKSpinner title="Loading" />

DKStatus

Status

Props

PropertyTypeRequiredValue
titleStringtrue-
classNameString--
colorString--

Example

import { DKStatus } from "deskera-ui-library";

<DKStatus title="Pending" color="bg-red"/>

DKSubLabel

Sub label

Props

PropertyTypeRequiredValue
textStringtrue-
classNameString--

Example

import { DKSubLabel } from "deskera-ui-library";

<DKSubLabel text="List of items"/>

DKTable

Table

Props

PropertyTypeRequiredValue
header {title, type, width} true-
values val1, val2, .... ]true-
isUpdatingBoolean--
classNameString--

Event

EventArgumentsDescription
onRowClickEmitted when click on row
onActionEmitted when click on action
onColumnShiftEmitted when column change
onSortEmitted when click on sort

Example

import { DKTable } from "deskera-ui-library";

<DKTable header="[{ title: "Name", width: 14.2, ... }]" values="["James",...]"/>

DKTextarea

Text area

Props

PropertyTypeRequiredValue
placeHolderString--
valueany--
classNameString--
isEditableBoolean--
isUpperCaseBoolean--
typeText/Number/Static/Password--

Event

EventArgumentsDescription
onChangeEmitted when text change
onClickEmitted when click on

Example

import { DKTextarea } from "deskera-ui-library";

<DKTextarea  type="Text" placeHolder="Message" value="" onChange={(value) => {}}/>

DKTextField

Text Field

Props

PropertyTypeRequiredValue
placeHolderString--
valueany--
classNameString--
isEditableBoolean--
isUpperCaseBoolean--
typeText/Number/Static/Password--

Event

EventArgumentsDescription
onChangeEmitted when text change
onClickEmitted when click on

Example

import { DKTextField } from "deskera-ui-library";

<DKTextField  type="Text" placeHolder="Message" value="" onChange={(value) => {}}/>

Input

Input Field

Props

PropertyTypeRequiredValue
needHeaderBoolean--
nameString--
placeholderString--
valueString--
classNameString--
requiredBoolean--
disabledBoolean--
invalidBoolean--
patternString--
styleString--
typeText/Number/Static/Password--

Event

EventArgumentsDescription
onChangeEmitted when text change

Example

import { Input } from "deskera-ui-library";

<Input name="fullName" value="" onChange={(value) => {}}/>

Toggle

Toggle

Props

PropertyTypeRequiredValue
isOnBoolean--
classNameString--

Event

EventArgumentsDescription
onChangeEmitted when click on button

Example

import { Toggle } from "deskera-ui-library";

<Toggle isOn={`true`}/>

DKDataGrid

Data Grid

Props

PropertyTypeRequiredValue
columns{key, name, type, width, options}--
rows{key: value}--
titleString--

Event

EventArgumentsDescription
onRowUpdaterowIndex, rowData, columnKeyEmitted when change of row
onColumnUpdatecolumnIndex, columnDataEmitted when change of coloumn
onRowAddrowDataEmitted when change of add row
onColumnAddcolumnDataEmitted when change of add column
onColumnDeletecolumnIndex, columnDataEmitted when column delete
onColumnShiftnewIndex, oldIndexEmitted when column shift
onFilterquery: {}Emitted when on search

Example

import { DKDataGrid } from "deskera-ui-library";

<DKDataGrid columns=[{ key: "name", name: "Name", type: "Text", width: 10.2}, ....] rows=[{name: "Zahir Rout"},...]/>

DKCalendar

Calendar

Props

PropertyTypeRequiredValue
selectedDateDate--
monthnumber--
yearnumber--
selectedDateString[]--
isDateRangeBoolean--
selectedStartDateDate--
selectedEndDateDate--

Event

EventArgumentsDescription
onSelectDateRangeEmitted when data range

Example

import { DKCalendar } from "deskera-ui-library";

<DKCalendar selectedDate={value} onSelectDate={(date) => {}} />

showLoader

Show loader

Props

PropertyTypeRequiredValue
titleString--

Example

import { showLoader } from "deskera-ui-library";

showLoader("Loading...")

removeLoader

Remove loader

Example

import { removeLoader } from "deskera-ui-library";

removeLoader()

showToast

Show toast

Props

PropertyTypeRequiredValue
messageString--
typedefault,success,failure,warning--
directiontop,bottom--

Example

import { showToast } from "deskera-ui-library";

showToast("Please enter valid email", "failure", "top")

DataEntryPopup

Data Entry Popup

Props

PropertyTypeRequiredValue
formElementsArray--

Event

EventArgumentsDescription
onCancelEmitted when click on cancel button
onSubmitEmitted when click on submit button

Example

import { DataEntryPopup } from "deskera-ui-library";

<DataEntryPopup formElements=[{name: "Email", floatLabel: false, required: true, type: 'email', value: "", requestKey: "email"}, ...], />

DKSelectBox

Select Box

Props

PropertyTypeRequiredValue
nameStringtrue-
valueany--
optionsany--
descriptionString--
classNameString--
invalidBoolean--
requiredBoolean--

Event

EventArgumentsDescription
onSelectEmitted when it selected

Example

import { DKSelectBox } from "deskera-ui-library";

<DKSelectBox  name="Please select"  options=["val1", "val2", ...] value=""/>

FormPopup

Form Popup

Props

PropertyTypeRequiredValue
formElementsObjecttrue-

Event

EventArgumentsDescription
onCancelEmitted when click on cancel button
onSubmitEmitted when click on submit button

Example

import { FormPopup } from "deskera-ui-library";

<FormPopup  formElements=[{name: "Email", floatLabel: false, required: true, type: 'email', value: "", requestKey: "email"}, ...]/>

Border

// Border 
.border-none 
.border-s 
.border-m 
.border-red 
.border-green 
.border-orange 
.border-blue 

// Border Radius 
.border-radius-s 
.border-radius-m 
.border-radius-r 
.border-radius-l 
.border-radius-xxl 
.border-radius-none 

Colors

// Background color
.bg-menu 
.bg-dark-gray 
.bg-gray 
.bg-gray1
.bg-gray2
.bg-gray3
.bg-gray4
.bg-gray5
.bg-line
.bg-line-2
.bg-red
.bg-yellow
.bg-green
.bg-white
.bg-blue
.bg-orange
.bg-transparent
.bg-whats-app
.bg-telegram
.bg-india-shield
.bg-deskera
.bg-erp
.bg-crm
.bg-people
.bg-aio
.bg-deskera-secondary
.bg-erp-secondary
.bg-crm-secondary
.bg-people-secondary
.bg-aio-secondary
.bg-chip-gray
.bg-chip-green
.bg-chip-blue
.bg-chip-red
.bg-chip-orange

// Text color
.text-gray
.text-dark-gray
.text-white
.text-royalblue
.text-green
.text-orange
.text-blue
.text-red
.text-cut
.text-line-through

Common

.main-holder 
.app-font-family
.transparent-background
.transparent-background-light
.popup-window

// Position 
.position-absolute 
.position-relative 

// Display 
.border-box
.display-block
.display-none
.circle

// Responsive
.display-only-web
.display-only-mobile
.scroll-y-only-web

.listPickerBG
.listPickerBG:hover
::-webkit-scrollbar
.hide-scroll-bar

// Responsive MR, ML
.pr-r-only-web 
.ml-l-only-web 
.main-holder-p-horizontal 
.main-holder-p-vertical

.blur
.unselectable

Cursor

.cursor-hand 
.cursor-move
.cursor-col-resize

DataGrid

.data-grid-right-border 
.data-grid-bottom-border
.data-grid-top-border 
.data-grid-header 
.data-grid-header:hover
.data-grid-selected-bg
.data-grid-badge-color-1 
.data-grid-badge-color-2 
.data-grid-badge-color-3 
.data-grid-badge-color-4 
.data-grid-badge-color-5 
.data-grid-badge-color-6 
.data-grid-badge-color-7 
.data-grid-badge-color-8 
.data-grid-badge-color-9 
.data-grid-badge-color-10 
.data-grid-filter-arrow 

Flex

.row 
.row-reverse 
.column 
.row-responsive 
.flex-wrap
.flex-1

.justify-content-around 
.justify-content-center
.justify-content-start 
.justify-content-end 
.justify-content-between 

.align-items-center 
.align-items-baseline 
.align-items-start 
.align-items-end
.align-items-stretch 

.align-self-center 
.align-self-start 
.align-self-end 

.justify-self-center 
.justify-self-start
.justify-self-end 

Font

.fs-r
.fs-xs
.fs-s
.fs-m
.fs-l
.fs-xl
.fs-xl-2
.fs-xxl
.fs-xxxl

// Font weight 
.fw-l
.fw-r
.fw-m
.fw-b
.fw-h

// Text alignment
.text-wrap-none
.text-wrap
.text-trailing
.text-align-left
.text-align-center
.text-align-right
.text-align-justify

Icon

.ic-r
.ic-xs
.ic-xs-2
.ic-s
.ic-s-2
.ic-m
.ic-r-2
.ic-r-3 
.ic-l
.ic-xl
.ic-contact-r 

Zindex

.z-index-1
.z-index-2
.z-index-3
.z-index-4
.z-index-5
.z-index-6

Text Field

.textField
.textField:focus
.textField-warning
.textField-invalid
.TextFieldFilter
.TextFieldFilterError
.textarea-resize
.textarea-resize

Sizes

.screen-width
.screen-height
.parent-width
.parent-height
.parent-size
.width-auto
.width-80
.width-90

Shadow

.shadow-s
.shadow-m
.shadow-l
.shadow-red-m

Padding

 // Padding - r
.p-r
.p-h-r
.p-v-r
.pl-r
.pr-r
.pt-r
.pb-r

 // Padding - xs
.p-xs
.p-h-xs
.p-v-xs
.pl-xs
.pr-xs
.pt-xs
.pb-xs

 // Padding - s
.p-s
.p-h-s
.p-v-s
.pl-s
.pr-s
.pt-s
.pb-s

 // Padding - m
.p-m
.p-h-m
.p-v-m
.pl-m
.pr-m
.pt-m
.pb-m

 // Padding - l
.p-l
.p-h-l
.p-v-l
.pl-l
.pr-l
.pt-l
.pb-l

 // Padding - xl
.p-xl
.p-h-xl
.p-v-xl
.pl-xl
.pr-xl
.pt-xl
.pb-xl

 // Padding - xxl
.p-xxl
.p-h-xxl
.p-v-xxl
.pl-xxl
.pr-xxl
.pt-xxl
.pb-xxl

Margin

 // Margin - r
.m-r
.m-h-r
.m-v-r
.ml-r
.mr-r
.mt-r
.mb-r

 // Margin - xs
.m-xs
.m-h-xs
.m-v-xs
.ml-xs
.mr-xs
.mt-xs
.mb-xs

 // Margin - s
.m-s
.m-h-s
.m-v-s
.ml-s
.mr-s
.mt-s
.mb-s

 // Margin - m
.m-m
.m-h-m
.m-v-m
.ml-m
.mr-m
.mt-m
.mb-m

 //Margin - l
.m-l
.m-h-l
.m-v-l
.ml-l
.mr-l
.mt-l
.mb-l

 // Margin - xl
.m-xl
.m-h-xl
.m-v-xl
.ml-xl
.mr-xl
.mt-xl
.mb-xl

 // Margin - xxl
.m-xxl
.m-h-xxl
.m-v-xxl
.ml-xxl
.mr-xxl
.mt-xxl
.mb-xxl