@datagrok-libraries/utils
Advanced tools
Comparing version 4.1.23 to 4.1.24
@@ -11,3 +11,3 @@ { | ||
"fullName": "Utils", | ||
"version": "4.1.23", | ||
"version": "4.1.24", | ||
"description": "Common utilities", | ||
@@ -14,0 +14,0 @@ "dependencies": { |
@@ -0,4 +1,17 @@ | ||
import './u2.css'; | ||
export declare namespace u2 { | ||
function appHeader(iconPath: string, description: HTMLElement): HTMLElement; | ||
/** */ | ||
namespace panels { | ||
/** Vertically positioned items */ | ||
function vert(items: any[]): HTMLElement; | ||
/** Horizontally positioned items */ | ||
function horz(items: any[]): HTMLElement; | ||
} | ||
interface IAppInfo { | ||
iconPath: string; | ||
description: string; | ||
learnMoreUrl?: string; | ||
} | ||
function appHeader(header: IAppInfo): HTMLElement; | ||
} | ||
//# sourceMappingURL=u2.d.ts.map |
import * as ui from 'datagrok-api/ui'; | ||
import $ from 'cash-dom'; | ||
import './u2.css'; | ||
export var u2; | ||
(function (u2) { | ||
function appHeader(iconPath, description) { | ||
const icon = ui.iconImage('', iconPath); | ||
/** */ | ||
let panels; | ||
(function (panels) { | ||
/** Vertically positioned items */ | ||
function vert(items) { | ||
return ui.divV(items.map((item) => ui.render(item)), { classes: 'u2-panel' }); | ||
} | ||
panels.vert = vert; | ||
/** Horizontally positioned items */ | ||
function horz(items) { | ||
return ui.divH(items.map((item) => ui.render(item)), { classes: 'u2-panel' }); | ||
} | ||
panels.horz = horz; | ||
})(panels = u2.panels || (u2.panels = {})); | ||
function appHeader(header) { | ||
const icon = ui.iconImage('', header.iconPath); | ||
$(icon).addClass('ui-app-header-icon').css('margin-right', '20px'); | ||
return ui.divH([ | ||
return panels.horz([ | ||
icon, | ||
description | ||
panels.vert([ | ||
ui.markdown(header.description), | ||
header.learnMoreUrl ? ui.link('Learn more', header.learnMoreUrl) : null | ||
]) | ||
]); | ||
@@ -15,2 +33,2 @@ } | ||
})(u2 || (u2 = {})); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJ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AgaGVhZGVyLmxlYXJuTW9yZVVybCA/IHVpLmxpbmsoJ0xlYXJuIG1vcmUnLCBoZWFkZXIubGVhcm5Nb3JlVXJsKSA6IG51bGxcbiAgICAgIF0pXG4gICAgXSk7XG4gIH1cblxufSJdfQ== |
Sorry, the diff of this file is not supported yet
450286
61
3298