2.2.0 • Published 3 years ago

saffroncodejs v2.2.0

Weekly downloads
410
License
MIT
Repository
github
Last release
3 years ago

npm install saffroncodejs

ui

import {ui} from 'saffroncodejs'

Preloader

1- Set the Preloader color,size and animation speed once in index.js ui.Preloader.setUp("#777777ff",200,200,0.2) 2- and then use it every where like below: <ui.Preloader/> ☺

Input

This is just like html input tag but it has better control on patterns and it will correct the user's mismatches character

TagForInput

this component displayes a tag name on top corner of the input element passed to it (as a child component) the element can be an input, a textArea or a select input supports rtl and ltr direction to use inside a react app:

<ui.TagForInput tagName="title">
  <input />
</ui.TagForInput>

Properties:

rtl : boolean ---> whether the tagName should be on left corner or right -- default is false tagName: string ---> the tag title tagBackGround: string ---> the background color of the tag span -- default is white tagColor: string ---> tagName color -- default is black

ItemSlider

DEMO to use inside a react app:

<ui.ItemsSlider rtl id="slider1">
 <div className="item"></div>
 <div className="item"></div>
 <div className="item"></div>
 <div className="item"></div>
</ui.ItemsSlider>

libs

Pure JS functions and classes import {libs} from 'saffroncodejs'

StringFunctions

Full list of libs.StringFunctions functions:

clearDoubleQuartmarksOnJSON(str:string=""):string clearHTMLTags(ReferText:string=""):string clearSpacesAndTabs(str:string=""):string clearSpacesAndTabsAndArrows(str:string="") compairFarsiString(str1:string="",str2:string=""):number correctInputString(str:string=""):string correctUTF(utfWord:string=""):string currancyPrint(inputcurencynumber:string):string fileSizeInString(fileSizeInByte:number=0):string findMainDomain(url:string="",removeHTTPPart:boolean=true):string findPortOfURL(url:string=""):number generateLinks(str:string="",linkColors:number=-1):string htmlCharacterEncoder(str:string=""):string isArabic(str:string=""):boolean isEmail(email:string=""):boolean isLocation(str:string=""):boolean isNullOrEmpty(value:string):boolean isPersian(str:string="",stringLength:number=NaN):boolean isURL(str:string=""):boolean jsonCorrector(oldJson:string=""):string KaafYe(str:string=""):string makeHTMLWithSize(pureHML:string="", defaultFontSize:number=0):string numCorrection(str:string=""):string numToString(num:number,numberLenght:number=2):string removeHTML(ReferText:string=""):string removeNumberFromBegining(str:string=""):string removeSpacesFromTwoSides(str:string=""):string returnLasNumberPartInInteger(str:string=""):number search(str:string="",searchedWord:string="",fineAll:boolean = true,arabic:boolean=false, arabic2:boolean=false) short(str:string="",len:number=10,removeEntersWith:string='') stringToColor(str:string=""):number timeInString(seconds:number=0):string utfToUnicode(utfString:string=""):string

framework

import {framework} from 'saffroncodejs'

EventDispatcher

var dispatcher = new EventDispatcher();

//How to add and remove an EventListner on an dispatcher

dispatcher.addEventListner(type:string,trigger:(eventType?:string,param?:any)=>any):void;

//sample : dispatcher.addEventListner("LOGGED_IN",this.userIsLoggedIn)

dispatcher.removeEventListner(type:string,trigger:(eventType?:string,param?:any)=>any):void;

//sample : dispatcher.removeEventListner("LOGGED_IN",this.userIsLoggedIn)

//How to dispatch an event on your dispatcher

dispatcher.dispatchEvent(type:string,param:any=null):void;

//sample : dispatcher.dispatchEvent("LOGGED_IN",userTocken)

PageManager(ReactRouter's Assist)

dispatcher:new EventDispatcher()

PAGE_CHANGED : "PAGE_CHANGED"

routerParamList:''

changePage:changePage

decodePageParams:decodePageParams

getCurrentPage:getCurrentPage

registerPage:registerPage

PageData

url:string;

pageName:string;

component?:React.ComponentClass;

pageData:any;
2.2.0

3 years ago

2.1.9

3 years ago

2.1.6

3 years ago

2.1.8

3 years ago

2.1.5

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

1.9.9

3 years ago

1.9.7

3 years ago

1.9.6

3 years ago

1.9.5

3 years ago

1.9.4

3 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.9

3 years ago

1.8.8

3 years ago

1.8.7

3 years ago

1.8.6

3 years ago

1.8.5

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.0

3 years ago

1.7.9

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.3

3 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.5.10

5 years ago

1.5.9

6 years ago

1.5.8

6 years ago

1.5.7

6 years ago

1.5.6

6 years ago

1.5.5

6 years ago

1.5.4

6 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.6

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.11

6 years ago

1.3.10

6 years ago

1.3.9

6 years ago

1.3.8

6 years ago

1.3.7

6 years ago

1.3.6

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.15

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.9

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago