##// END OF EJS Templates
Merge
Merge

File last commit:

r146:af4f8424e83d v1.9.0 default
r148:63f3ad8e6cff merge v1.10.0 default
Show More
MainWidget.tsx
87 lines | 2.9 KiB | text/x-typescript | TypeScriptLexer
cin
Added priorities to render tasks, revisited rendering scheduler...
r146 import { id as mid } from "module";
cin
Working on WatchForRendition
r107 import { djbase, djclass } from "@implab/djx/declare";
import { DjxWidgetBase } from "@implab/djx/tsx/DjxWidgetBase";
cin
added form/Form widget and form/_FormMixin, this is a rewritten version of the corresponding dojo classed....
r134 import { attach, bind, createElement, prop, watch, watchFor } from "@implab/djx/tsx";
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 import MainModel from "../model/MainModel";
cin
added reduce() and next() methods to observable...
r116 import { Observable } from "@implab/djx/observable";
import { OrderedUpdate } from "@implab/djx/store";
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 import { Appointment } from "../model/Appointment";
import { LocalDate } from "@js-joda/core";
cin
Working on WatchForRendition
r107 import Button = require("dijit/form/Button");
cin
added form/Form widget and form/_FormMixin, this is a rewritten version of the corresponding dojo classed....
r134 import NewAppointment from "./NewAppointment";
cin
Added priorities to render tasks, revisited rendering scheduler...
r146 import { TraceSource } from "@implab/core-amd/log/TraceSource";
const trace = TraceSource.get(mid);
cin
linting
r109
cin
Working on WatchForRendition
r107 @djclass
export default class MainWidget extends djbase(DjxWidgetBase) {
cin
added reduce() and next() methods to observable...
r116 appointments?: Observable<OrderedUpdate<Appointment>>;
cin
corrected tear down logic handling in observables. Added support for observable query results
r110
model: MainModel;
cin
Working on WatchForRendition
r107
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 dateTo?: LocalDate;
cin
Working on WatchForRendition
r107
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 dateFrom?: LocalDate;
cin
Working on WatchForRendition
r107
cin
added form/Form widget and form/_FormMixin, this is a rewritten version of the corresponding dojo classed....
r134 toolbarNode?: HTMLDivElement;
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 constructor(opts?: Partial<MainWidget> & ThisType<MainWidget>, srcNode?: string | Node) {
super(opts, srcNode);
cin
Working on WatchForRendition
r107
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 const model = this.model = new MainModel();
this.own(model);
model.subscribe({ next: x => this.set(x) });
}
cin
Working on WatchForRendition
r107
render() {
return <div className="tundra">
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 <h2 ref={bind("innerHTML", prop(this, "title"))} />
{watch(prop(this, "appointments"), items => items &&
<ul>
{watchFor(items, ({ id, title, getMembers }) =>
<li>{title}
<ul>
{watchFor(getMembers(), ({ role, name, position }) =>
<li className={role}>{name}({position})</li>
)}
</ul>
<div>
<Button onClick={() => this._onAddMemberClick(id)}>Add member</Button>
cin
Added priorities to render tasks, revisited rendering scheduler...
r146 <Button onClick={() => this._onRemoveAppointmentClick(id)}>Remove appointment</Button>
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 </div>
</li>
)}
</ul>
)}
cin
added form/Form widget and form/_FormMixin, this is a rewritten version of the corresponding dojo classed....
r134 <NewAppointment/>
<div ref={attach(this, "toolbarNode")}>
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 <Button onClick={this._onAddAppointmentClick}>Add new appointment</Button>
</div>
cin
Working on WatchForRendition
r107 </div>;
}
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 load() {
cin
Added priorities to render tasks, revisited rendering scheduler...
r146 trace.log("Loading data");
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 this.model.load();
cin
Working on WatchForRendition
r107 }
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 private readonly _onAddMemberClick = (appointmentId: string) => {
this.model.addMember(appointmentId, {
email: "some-mail",
name: "Member Name",
position: "Member position",
role: "participant"
});
cin
linting
r109 };
cin
Working on WatchForRendition
r107
cin
Added priorities to render tasks, revisited rendering scheduler...
r146 private readonly _onRemoveAppointmentClick = (appointmentId: string) => {
this.model.removeAppointment(appointmentId);
};
cin
corrected tear down logic handling in observables. Added support for observable query results
r110 private readonly _onAddAppointmentClick = () => {
this.model.addAppointment("Appointment", new Date, 30);
cin
linting
r109 };
cin
Working on WatchForRendition
r107 }