radh-ui
Version:
Stencil Component Starter
32 lines (31 loc) • 1.22 kB
JavaScript
import { r as registerInstance, c as createEvent, h } from './index-a9700b09.js';
var radhGitlabUsersCss = "";
var RadhGitlabUsers = /** @class */ (function () {
function RadhGitlabUsers(hostRef) {
registerInstance(this, hostRef);
this.toasted = createEvent(this, "toasted", 7);
}
RadhGitlabUsers.prototype.getUserSelected = function (ev) {
this.toasted.emit(ev.detail);
};
RadhGitlabUsers.prototype.fetchGitLabUsers = function () {
var _this = this;
fetch("/assets/data/users.json")
.then(function (resp) { return resp.json(); })
.then(function (data) { return (_this.userData = data); });
};
RadhGitlabUsers.prototype.componentWillLoad = function () {
this.fetchGitLabUsers();
};
RadhGitlabUsers.prototype.render = function () {
if (!this.userData) {
return null;
}
return [
h("radh-fluid-grid", null, this.userData.map(function (user) { return (h("radh-user", { avatar: true, user: JSON.stringify(user) })); }))
];
};
return RadhGitlabUsers;
}());
RadhGitlabUsers.style = radhGitlabUsersCss;
export { RadhGitlabUsers as radh_gitlab_users };