bobflux-monitor
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -14,2 +14,2 @@ import * as b from 'bobril'; | ||
} | ||
export declare let create: (data: IData, children?: boolean | string | b.IBobrilNode | (boolean | string | b.IBobrilNode)[]) => b.IBobrilNode; | ||
export declare let create: (data?: IData, children?: boolean | string | b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren | b.IBobrilChildArray) => b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren; |
{ | ||
"name": "bobflux-monitor", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Component for time travelling in bobflux application state history.", | ||
@@ -26,3 +26,2 @@ "main": "./index.js", | ||
}, | ||
"main": "index.js", | ||
"keywords": [ | ||
@@ -29,0 +28,0 @@ "bobflux", |
@@ -10,4 +10,4 @@ # bobflux-monitor | ||
```typescript | ||
import { bootstrap } from 'node_modules/bobflux/dist/src/index'; | ||
import * as bobfluxMonitor from 'node_modules/bobflux-monitor/index'; | ||
import { bootstrap } from 'bobflux'; | ||
import * as bobfluxMonitor from 'bobflux-monitor'; | ||
@@ -25,5 +25,7 @@ bootstrap(createDefaultState(), bobfluxMonitor.init()); | ||
`npm i bobril-build -g` | ||
`npm i` | ||
`gulp watch` | ||
`bb` | ||
@@ -30,0 +32,0 @@ Go to [localhost](http:\\localhost:8000) . |
@@ -10,2 +10,2 @@ import * as b from 'bobril'; | ||
} | ||
export declare let create: (data: IData, children?: boolean | string | b.IBobrilNode | (boolean | string | b.IBobrilNode)[]) => b.IBobrilNode; | ||
export declare let create: (data?: IData, children?: boolean | string | b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren | b.IBobrilChildArray) => b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren; |
@@ -14,3 +14,3 @@ define(["require", "exports", 'bobril', './button'], function (require, exports, b, button) { | ||
borderStyle: 'solid', | ||
borderWidth: '3px', | ||
borderWidth: '3px' | ||
}); | ||
@@ -17,0 +17,0 @@ let actionButtonsContainer = b.styleDef({}); |
24
row.ts
@@ -18,3 +18,3 @@ import * as b from 'bobril'; | ||
borderStyle: 'solid', | ||
borderWidth: '3px', | ||
borderWidth: '3px' | ||
}); | ||
@@ -34,3 +34,3 @@ | ||
interface ICtx extends b.IBobrilCtx { | ||
data: IData | ||
data: IData; | ||
} | ||
@@ -40,9 +40,9 @@ | ||
render(ctx: ICtx, me: b.IBobrilNode) { | ||
me.tag = 'li' | ||
me.tag = 'li'; | ||
b.style(me, rowStyle); | ||
if(ctx.data.isActive){ | ||
if (ctx.data.isActive) { | ||
b.style(me, active); | ||
} | ||
me.children = [ | ||
@@ -52,8 +52,10 @@ { tag: 'div', children: 'Order: ' + ctx.data.header }, | ||
{ tag: 'div', children: 'Frames: ' + ctx.data.frames }, | ||
b.styledDiv([ | ||
button.create({ title: 'GO', style: button.style.actionButton, onClick: ctx.data.onGo, float: 'left', width: '50%' }), | ||
button.create({ title: 'COPY', style: button.style.actionButton, onClick: ctx.data.onCopy }) | ||
], actionButtonsContainer) | ||
b.styledDiv( | ||
[ | ||
button.create({ title: 'GO', style: button.style.actionButton, onClick: ctx.data.onGo, float: 'left', width: '50%' }), | ||
button.create({ title: 'COPY', style: button.style.actionButton, onClick: ctx.data.onCopy }) | ||
], | ||
actionButtonsContainer) | ||
]; | ||
} | ||
}) | ||
}); |
@@ -6,2 +6,2 @@ import * as b from 'bobril'; | ||
} | ||
export declare let create: (data: IData, children?: boolean | string | b.IBobrilNode | (boolean | string | b.IBobrilNode)[]) => b.IBobrilNode; | ||
export declare let create: (data?: IData, children?: boolean | string | b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren | b.IBobrilChildArray) => b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren; |
@@ -17,6 +17,6 @@ define(["require", "exports", 'bobril', './row'], function (require, exports, b, row) { | ||
tag: 'ul', | ||
children: !!ctx.data.rows && ctx.data.rows.map(row.create) | ||
children: !!ctx.data.rows && ctx.data.rows.map(rd => row.create(rd)) | ||
}, rowsStyle); | ||
}, | ||
} | ||
}); | ||
}); |
18
rows.ts
@@ -14,3 +14,3 @@ import * as b from 'bobril'; | ||
let rowsWrapperStyle = b.styleDef({ | ||
}) | ||
}); | ||
@@ -22,3 +22,3 @@ export interface IData { | ||
interface ICtx extends b.IBobrilCtx { | ||
data: IData | ||
data: IData; | ||
} | ||
@@ -30,7 +30,9 @@ | ||
b.style(me, rowsWrapperStyle); | ||
me.children = b.style({ | ||
tag: 'ul', | ||
children: !!ctx.data.rows && ctx.data.rows.map(row.create) | ||
}, rowsStyle); | ||
}, | ||
}) | ||
me.children = b.style( | ||
{ | ||
tag: 'ul', | ||
children: !!ctx.data.rows && ctx.data.rows.map(rd => row.create(rd)) | ||
}, | ||
rowsStyle); | ||
} | ||
}); |
@@ -13,2 +13,2 @@ import * as b from 'bobril'; | ||
} | ||
export declare let create: (data: IData, children?: boolean | string | b.IBobrilNode | (boolean | string | b.IBobrilNode)[]) => b.IBobrilNode; | ||
export declare let create: (data?: IData, children?: boolean | string | b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren | b.IBobrilChildArray) => b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren; |
@@ -5,3 +5,3 @@ define(["require", "exports", 'bobril'], function (require, exports, b) { | ||
width: '150px', | ||
height: '28px', | ||
height: '28px' | ||
}) | ||
@@ -17,6 +17,8 @@ }; | ||
render(ctx, me) { | ||
if (ctx.data.value !== undefined && ctx.data.value !== null) | ||
if (ctx.data.value !== undefined && ctx.data.value !== null) { | ||
ctx.value = ctx.data.value; | ||
else | ||
} | ||
else { | ||
ctx.value = ''; | ||
} | ||
me.tag = 'input'; | ||
@@ -23,0 +25,0 @@ me.attrs = { type: 'text', value: ctx.value }; |
@@ -6,5 +6,5 @@ import * as b from 'bobril'; | ||
width: '150px', | ||
height: '28px', | ||
height: '28px' | ||
}) | ||
} | ||
}; | ||
@@ -15,5 +15,5 @@ export interface IData { | ||
onChange?: (value: string) => void; | ||
style?: b.IBobrilStyle, | ||
setFocus?: boolean, | ||
float?: string | ||
style?: b.IBobrilStyle; | ||
setFocus?: boolean; | ||
float?: string; | ||
} | ||
@@ -31,10 +31,11 @@ | ||
} | ||
} | ||
}; | ||
export let create = b.createComponent<IData>({ | ||
render(ctx: ICtx, me: b.IBobrilNode) { | ||
if (ctx.data.value !== undefined && ctx.data.value !== null) | ||
if (ctx.data.value !== undefined && ctx.data.value !== null) { | ||
ctx.value = ctx.data.value; | ||
else | ||
} else { | ||
ctx.value = ''; | ||
} | ||
@@ -41,0 +42,0 @@ me.tag = 'input'; |
23095
601
35