Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
Fitz committed Aug 1, 2019
1 parent ba85795 commit ce9a2f6
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 294 deletions.
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@
node_modules/
npm-debug.log*
.idea

src/**/*.js
demo
dev
temp
lib

cloc.exe
.vscode

/yarn-error.log

package-lock.json
dist/main.js

example/mian.js
68 changes: 33 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# TypePicker

##### uh! naming project is the most difficult thing of the world

A date picker use in web and react-native

## OPTIONS

| OPTION | REQUIRED | TYPE | DESC | Default /Possible Value |
| --------- | -------- | ------ | --------------------------- | ----------------------- |
| size | NO | number | Display views of DatePicker | 1 |
| selection | NO | number | Size of dates can be picked | 1 |
| OPTION | REQUIRED | TYPE | DESC | Default |
| --------- | -------- | ------ | ------------------ |----------------|
| size | NO | number | Size of data created | 1 |
| selection | NO | number | Size of data picked | 1 |



Expand All @@ -18,26 +17,27 @@ A date picker use in web and react-native
```typescript


public apply={
select :(date:Date)=>void
date :(date:Date)=>void
dates :(dates:Date[])=>void
update :()=>void;
disableDate :(date:Date)=>boolean

};

public listen(({type,types,payload})=>void)
apply.select(date:Date)=>void

apply.date(date:Date)=>void

apply.dates(dates:Date[])=>void

apply.update()=>void;

apply.disableDate((date:Date)=>boolean)

listen(({type,types,payload})=>void)




```

## HOW TO USE
### EXAMPLE

### use build tools,like webpack

[Full Example](./example/createPicker.ts)



Expand All @@ -48,21 +48,21 @@ A date picker use in web and react-native


const config = {
size:1,
selection:1
size:1,
selection:1
}

interface TypePickerDate {
date: Date;
invalid: boolean;
disabled: boolean;
status?: {
isActive?: boolean;
isStart?: boolean;
isEnd?: Boolean;
inRange?: Boolean;
};
}
interface TypePickerDate {
date: Date;
invalid: boolean;
disabled: boolean;
status?: {
isActive?: boolean;
isStart?: boolean;
isEnd?: Boolean;
inRange?: Boolean;
};
}


const typepicker= new TypePicker(config);
Expand All @@ -73,17 +73,15 @@ A date picker use in web and react-native
}
const onDataUpdate =(data:[])=>{


const renderData =data.map(item=>{
return {
year: <number>item.year
month: <number> item.month,
dates: <TypePickerDate>item.dates }
})


//here goes how your datepicker ui render
//example document.getElementById('picker') .innerHTML =template(renderData)
//here goes how your datepicker ui render
//example
//document.getElementById('picker') .innerHTML=template(renderData)



Expand Down
4 changes: 2 additions & 2 deletions dist/typepicker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ce9a2f6

Please # to comment.