UNPKG

zcatalyst-integ-cliq

Version:

Node.js SDK for integrating Zoho Catalyst with Zoho Cliq

130 lines (129 loc) 2.99 kB
import ButtonObject from './button-object.js'; import Form from './form.js'; export default class WidgetResponse { constructor() { this.type = 'applet'; } newWidgetTab(id, label) { return new WidgetTab(id, label); } addTab(...tab) { if (this.tabs === undefined) { this.tabs = tab; return this.tabs.length; } return this.tabs.push(...tab); } newWidgetSection() { return new WidgetSection(); } addSection(...WidgetSection) { if (this.sections === undefined) { this.sections = WidgetSection; return this.sections.length; } return this.sections.push(...WidgetSection); } newWidgetInfo() { return new WidgetInfo(); } newWidgetForm() { return new Form(true); } newWidgetMap() { return new WidgetMap(); } newWidgetWebView(url) { return new WidgetWebView(url); } } class WidgetElement { newWidgetButton() { return new WidgetButton(); } addWidgetButton(...button) { if (this.buttons === undefined) { this.buttons = button; return this.buttons.length; } return this.buttons.push(...button); } newButtonObject() { return new ButtonObject(); } addButtonReference(name, button) { if (this.button_references === undefined) { this.button_references = {}; } this.button_references[name] = button; } newWidgetElementStyle() { return new WidgetElementStyle(); } } class WidgetSection { newWidgetElement() { return new WidgetElement(); } addElement(...element) { if (this.elements === undefined) { this.elements = element; return this.elements.length; } return this.elements.push(...element); } } class WidgetSectionStatus { } class WidgetTab { constructor(id, label) { this.label = label; this.id = id; } } class WidgetButton { setApi(api, id) { this.api = api.replace('{{id}}', id); } } class AxisInfo { constructor(title) { this.title = title; } } class WidgetElementStyle { addWidth(...width) { if (this.width === undefined) { this.width = width; return this.width.length; } return this.width.push(...width); } addAlignment(...alignment) { if (this.align === undefined) { this.align = alignment; return this.align.length; } return this.align.push(...alignment); } newAxisInfo(title) { return new AxisInfo(title); } } class WidgetInfo { newWidgetButton() { return new WidgetButton(); } } class WidgetWebView { constructor(url) { this.url = url; } } class WidgetMap { newMapTicker() { return new MapTicker(); } } class MapTicker { }