forked from khoanguyen123/aurelia-ui-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-page.js
152 lines (152 loc) · 6.38 KB
/
ui-page.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
define(["require", "exports", "aurelia-framework", "../utils/ui-utils"], function (require, exports, aurelia_framework_1, ui_utils_1) {
"use strict";
var UIPage = (function () {
function UIPage(element) {
this.element = element;
}
UIPage.prototype.toast = function (config) {
if (typeof config === 'string')
config = { message: config };
config.extraClass = 'ui-page-toast';
ui_utils_1.UIUtils.showToast(this.__body, config);
};
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', String)
], UIPage.prototype, "pageTitle", void 0);
UIPage = __decorate([
aurelia_framework_1.customElement('ui-page'),
__metadata('design:paramtypes', [Element])
], UIPage);
return UIPage;
}());
exports.UIPage = UIPage;
var UISection = (function () {
function UISection(element) {
this.element = element;
}
UISection.prototype.bind = function () {
if (this.element.hasAttribute('column')) {
this.element.classList.add('ui-section-column');
}
else {
this.element.classList.add('ui-section-row');
}
};
UISection = __decorate([
aurelia_framework_1.customElement('ui-section'),
aurelia_framework_1.inlineView('<template class="ui-section"><content></content></template>'),
__metadata('design:paramtypes', [Element])
], UISection);
return UISection;
}());
exports.UISection = UISection;
var UIContent = (function () {
function UIContent(element) {
this.element = element;
}
UIContent.prototype.bind = function () {
if (this.element.hasAttribute('auto')) {
this.element.classList.add('ui-auto-fit');
}
else if (this.element.hasAttribute('scroll')) {
this.element.classList.add('ui-scroll');
}
if (this.element.hasAttribute('padded'))
this.element.classList.add('ui-pad-all');
};
UIContent = __decorate([
aurelia_framework_1.customElement('ui-content'),
aurelia_framework_1.inlineView('<template class="ui-content"><content></content></template>'),
__metadata('design:paramtypes', [Element])
], UIContent);
return UIContent;
}());
exports.UIContent = UIContent;
var UISidebar = (function () {
function UISidebar(element) {
this.element = element;
this.collapsible = false;
this.width = '220px';
}
UISidebar.prototype.bind = function () {
this.collapsible = this.element.hasAttribute('collapsible');
if (this.element.hasAttribute('scroll'))
this.element.classList.add('ui-scroll');
if (this.element.hasAttribute('padded'))
this.element.classList.add('ui-pad-all');
};
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', String)
], UISidebar.prototype, "width", void 0);
UISidebar = __decorate([
aurelia_framework_1.customElement('ui-sidebar'),
aurelia_framework_1.inlineView("<template class=\"ui-sidebar\" role=\"sidebar\" css.bind=\"{'flex-basis':width}\"><content></content></template>"),
__metadata('design:paramtypes', [Element])
], UISidebar);
return UISidebar;
}());
exports.UISidebar = UISidebar;
var UIDivider = (function () {
function UIDivider() {
}
UIDivider = __decorate([
aurelia_framework_1.customElement('ui-divider'),
aurelia_framework_1.inlineView('<template class="ui-divider" role="separator"></template>'),
__metadata('design:paramtypes', [])
], UIDivider);
return UIDivider;
}());
exports.UIDivider = UIDivider;
var UIToolbar = (function () {
function UIToolbar() {
}
UIToolbar = __decorate([
aurelia_framework_1.customElement('ui-toolbar'),
aurelia_framework_1.inlineView("<template class=\"ui-toolbar ui-button-bar\" role=\"toolbar\"><content></content></template>"),
__metadata('design:paramtypes', [])
], UIToolbar);
return UIToolbar;
}());
exports.UIToolbar = UIToolbar;
var UIStatsbar = (function () {
function UIStatsbar() {
}
UIStatsbar = __decorate([
aurelia_framework_1.customElement('ui-statsbar'),
aurelia_framework_1.inlineView("<template class=\"ui-statsbar\"><content></content></template>"),
__metadata('design:paramtypes', [])
], UIStatsbar);
return UIStatsbar;
}());
exports.UIStatsbar = UIStatsbar;
var UIStat = (function () {
function UIStat() {
}
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', Object)
], UIStat.prototype, "value", void 0);
__decorate([
aurelia_framework_1.bindable(),
__metadata('design:type', Object)
], UIStat.prototype, "icon", void 0);
UIStat = __decorate([
aurelia_framework_1.customElement('ui-stat'),
aurelia_framework_1.inlineView('<template class="ui-stat"><span class="${icon}" if.bind="icon"></span><div><h1>${value}</h1><h6><content></content></h6></div></template>'),
__metadata('design:paramtypes', [])
], UIStat);
return UIStat;
}());
exports.UIStat = UIStat;
});