This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function preventDefault (func, ...args) { | |
return e => { | |
e.preventDefault() | |
func(...args) | |
} | |
} | |
export function targetValue (func, ...args) { | |
return e => { | |
func(e.target.value, ...args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function imageFileToDataUri (file: File) { | |
return new Promise<string>(done => { | |
const reader = new FileReader() | |
reader.onloadend = () => done(reader.result) | |
reader.readAsDataURL(file) | |
}) | |
} | |
export function imageSrcToImageData (imageSrc: string) { | |
return new Promise<ImageData>(resolve => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'react-svg-pan-zoom' { | |
import * as React from 'react' | |
type Tool = 'auto' | 'none' | 'pan' | 'zoom-in' | 'zoom-out' | |
type ToolBarPosition = 'none' | 'top' | 'right' | 'bottom' | 'left' | |
export const ReactSVGPanZoom: ReactSVGPanZoom | |
interface ReactSVGPanZoom extends React.ComponentClass<ReactSVGPanZoomProps> {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'react-dnd-touch-backend' { | |
import { Backend } from 'react-dnd' | |
declare const Backend: Backend | |
export default Backend | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'react-dimensions' { | |
import * as React from 'react' | |
interface Dimensions { | |
<P extends React.Props<any>>(options?: Options): (component: React.ComponentClass<P>) => React.ComponentClass<P> | |
} | |
declare const Dimensions: Dimensions | |
export default Dimensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stylus --sourcemap --use ./node_modules/axis --out build app/index.styl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as _ from 'underscore'; | |
import * as moment from 'moment'; | |
import * as jwt from 'jwt-simple'; | |
import * as config from 'config'; | |
import * as Log from './Log'; | |
/** | |
* エンコードする | |
* 有効期限を付与する | |
* @param data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ラジオボタンを生成する | |
* @param {[type]} args: {value: string; label: string }[] [description] | |
* @param {[type]} name: string [description] | |
* @param {[type]} currentValue: string [description] | |
* @param {[type]} callback: (value:string)=>void [description] | |
* @return {[type]} [description] | |
*/ | |
export function radios(args: { value: string; label: string }[], name: string, currentValue: string, callback: (value: string) => void) { | |
if (args.length === 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="select"> | |
<select> | |
<option value="a">AAA</option> | |
<option value="b">BBB</option> | |
<option value="c">CCC</option> | |
</select> | |
</div> |