2020-10-09 20:10:21 +02:00
|
|
|
import {UIElement} from "./UIElement";
|
|
|
|
import OpeningHoursVisualization from "./OhVisualization";
|
|
|
|
import {UIEventSource} from "../Logic/UIEventSource";
|
|
|
|
|
|
|
|
export default class SpecialVisualizations {
|
|
|
|
|
2020-10-11 22:37:55 +02:00
|
|
|
public static specialVisualizations: {
|
|
|
|
funcName: string,
|
|
|
|
constr: ((tagSource: UIEventSource<any>, argument: string[]) => UIElement),
|
|
|
|
docs: string,
|
|
|
|
args: {name: string, defaultValue: string, doc: string}[]
|
|
|
|
}[] =
|
2020-10-09 20:10:21 +02:00
|
|
|
|
|
|
|
[{
|
|
|
|
funcName: "opening_hours_table",
|
2020-10-11 22:37:55 +02:00
|
|
|
docs: "Creates an opening-hours table. Usage: {opening_hours_table(opening_hours)} to create a table of the tag 'opening_hours'.",
|
|
|
|
args:[{name:"key", defaultValue: "opening_hours", doc: "The tag from which the table is constructed"}],
|
|
|
|
constr: (tagSource: UIEventSource<any>, args) => {
|
|
|
|
let keyname = args[0];
|
|
|
|
if (keyname === undefined || keyname === "") {
|
|
|
|
keyname = keyname ?? "opening_hours"
|
|
|
|
}
|
2020-10-09 20:10:21 +02:00
|
|
|
return new OpeningHoursVisualization(tagSource, keyname)
|
|
|
|
}
|
2020-10-11 22:37:55 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
]
|
2020-10-09 20:10:21 +02:00
|
|
|
|
|
|
|
}
|