uicore-ts 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/uicore.iml +9 -0
- package/.idea/vcs.xml +6 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/compiledScripts/UIActionIndicator.d.ts +12 -0
- package/compiledScripts/UIActionIndicator.js +54 -0
- package/compiledScripts/UIActionIndicator.js.map +1 -0
- package/compiledScripts/UIBaseButton.d.ts +52 -0
- package/compiledScripts/UIBaseButton.js +268 -0
- package/compiledScripts/UIBaseButton.js.map +1 -0
- package/compiledScripts/UIButton.d.ts +54 -0
- package/compiledScripts/UIButton.js +247 -0
- package/compiledScripts/UIButton.js.map +1 -0
- package/compiledScripts/UIColor.d.ts +41 -0
- package/compiledScripts/UIColor.js +286 -0
- package/compiledScripts/UIColor.js.map +1 -0
- package/compiledScripts/UICore.d.ts +27 -0
- package/compiledScripts/UICore.js +105 -0
- package/compiledScripts/UICore.js.map +1 -0
- package/compiledScripts/UICoreExtensions.d.ts +60 -0
- package/compiledScripts/UICoreExtensions.js +527 -0
- package/compiledScripts/UICoreExtensions.js.map +1 -0
- package/compiledScripts/UIDateTimeInput.d.ts +40 -0
- package/compiledScripts/UIDateTimeInput.js +38 -0
- package/compiledScripts/UIDateTimeInput.js.map +1 -0
- package/compiledScripts/UIDialogView.d.ts +23 -0
- package/compiledScripts/UIDialogView.js +118 -0
- package/compiledScripts/UIDialogView.js.map +1 -0
- package/compiledScripts/UIImageView.d.ts +36 -0
- package/compiledScripts/UIImageView.js +170 -0
- package/compiledScripts/UIImageView.js.map +1 -0
- package/compiledScripts/UIKeyValueStringFilter.d.ts +21 -0
- package/compiledScripts/UIKeyValueStringFilter.js +98 -0
- package/compiledScripts/UIKeyValueStringFilter.js.map +1 -0
- package/compiledScripts/UIKeyValueStringSorter.d.ts +38 -0
- package/compiledScripts/UIKeyValueStringSorter.js +117 -0
- package/compiledScripts/UIKeyValueStringSorter.js.map +1 -0
- package/compiledScripts/UILayoutGrid.d.ts +8 -0
- package/compiledScripts/UILayoutGrid.js +22 -0
- package/compiledScripts/UILayoutGrid.js.map +1 -0
- package/compiledScripts/UILink.d.ts +25 -0
- package/compiledScripts/UILink.js +81 -0
- package/compiledScripts/UILink.js.map +1 -0
- package/compiledScripts/UILinkButton.d.ts +18 -0
- package/compiledScripts/UILinkButton.js +60 -0
- package/compiledScripts/UILinkButton.js.map +1 -0
- package/compiledScripts/UINativeScrollView.d.ts +20 -0
- package/compiledScripts/UINativeScrollView.js +121 -0
- package/compiledScripts/UINativeScrollView.js.map +1 -0
- package/compiledScripts/UIObject.d.ts +69 -0
- package/compiledScripts/UIObject.js +442 -0
- package/compiledScripts/UIObject.js.map +1 -0
- package/compiledScripts/UIPoint.d.ts +18 -0
- package/compiledScripts/UIPoint.js +68 -0
- package/compiledScripts/UIPoint.js.map +1 -0
- package/compiledScripts/UIRectangle.d.ts +61 -0
- package/compiledScripts/UIRectangle.js +421 -0
- package/compiledScripts/UIRectangle.js.map +1 -0
- package/compiledScripts/UIRoute.d.ts +39 -0
- package/compiledScripts/UIRoute.js +202 -0
- package/compiledScripts/UIRoute.js.map +1 -0
- package/compiledScripts/UIScrollView.d.ts +19 -0
- package/compiledScripts/UIScrollView.js +121 -0
- package/compiledScripts/UIScrollView.js.map +1 -0
- package/compiledScripts/UISlideScrollerView.d.ts +40 -0
- package/compiledScripts/UISlideScrollerView.js +242 -0
- package/compiledScripts/UISlideScrollerView.js.map +1 -0
- package/compiledScripts/UIStringFilter.d.ts +26 -0
- package/compiledScripts/UIStringFilter.js +107 -0
- package/compiledScripts/UIStringFilter.js.map +1 -0
- package/compiledScripts/UITableView.d.ts +61 -0
- package/compiledScripts/UITableView.js +383 -0
- package/compiledScripts/UITableView.js.map +1 -0
- package/compiledScripts/UITextArea.d.ts +7 -0
- package/compiledScripts/UITextArea.js +27 -0
- package/compiledScripts/UITextArea.js.map +1 -0
- package/compiledScripts/UITextField.d.ts +44 -0
- package/compiledScripts/UITextField.js +83 -0
- package/compiledScripts/UITextField.js.map +1 -0
- package/compiledScripts/UITextView.d.ts +89 -0
- package/compiledScripts/UITextView.js +237 -0
- package/compiledScripts/UITextView.js.map +1 -0
- package/compiledScripts/UITimer.d.ts +13 -0
- package/compiledScripts/UITimer.js +45 -0
- package/compiledScripts/UITimer.js.map +1 -0
- package/compiledScripts/UIView.d.ts +330 -0
- package/compiledScripts/UIView.js +1533 -0
- package/compiledScripts/UIView.js.map +1 -0
- package/compiledScripts/UIViewController.d.ts +38 -0
- package/compiledScripts/UIViewController.js +153 -0
- package/compiledScripts/UIViewController.js.map +1 -0
- package/compiledScripts/index.d.ts +29 -0
- package/compiledScripts/index.js +46 -0
- package/compiledScripts/index.js.map +1 -0
- package/package.json +36 -0
- package/scripts/UIActionIndicator.ts +139 -0
- package/scripts/UIBaseButton.ts +563 -0
- package/scripts/UIButton.ts +552 -0
- package/scripts/UIColor.ts +427 -0
- package/scripts/UICore.ts +223 -0
- package/scripts/UICoreExtensions.ts +949 -0
- package/scripts/UIDateTimeInput.ts +109 -0
- package/scripts/UIDialogView.ts +297 -0
- package/scripts/UIImageView.ts +366 -0
- package/scripts/UIKeyValueStringFilter.ts +260 -0
- package/scripts/UIKeyValueStringSorter.ts +337 -0
- package/scripts/UILayoutGrid.ts +83 -0
- package/scripts/UILink.ts +292 -0
- package/scripts/UILinkButton.ts +238 -0
- package/scripts/UINativeScrollView.ts +254 -0
- package/scripts/UIObject.ts +827 -0
- package/scripts/UIPoint.ts +123 -0
- package/scripts/UIRectangle.ts +730 -0
- package/scripts/UIRoute.ts +391 -0
- package/scripts/UIScrollView.ts +290 -0
- package/scripts/UISlideScrollerView.ts +530 -0
- package/scripts/UIStringFilter.ts +293 -0
- package/scripts/UITableView.ts +790 -0
- package/scripts/UITextArea.ts +91 -0
- package/scripts/UITextField.ts +218 -0
- package/scripts/UITextView.ts +561 -0
- package/scripts/UITimer.ts +107 -0
- package/scripts/UIView.ts +2789 -0
- package/scripts/UIViewController.ts +304 -0
- package/scripts/index.ts +36 -0
- package/tsconfig.json +59 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIButton = void 0;
|
|
4
|
+
const UIBaseButton_1 = require("./UIBaseButton");
|
|
5
|
+
const UIColor_1 = require("./UIColor");
|
|
6
|
+
const UIImageView_1 = require("./UIImageView");
|
|
7
|
+
const UIObject_1 = require("./UIObject");
|
|
8
|
+
const UIRectangle_1 = require("./UIRectangle");
|
|
9
|
+
const UITextView_1 = require("./UITextView");
|
|
10
|
+
class UIButton extends UIBaseButton_1.UIBaseButton {
|
|
11
|
+
constructor(elementID, elementType, titleType = UITextView_1.UITextView.type.span) {
|
|
12
|
+
super(elementID, elementType, { "titleType": titleType });
|
|
13
|
+
this.usesAutomaticTitleFontSize = UIObject_1.NO;
|
|
14
|
+
this.minAutomaticFontSize = UIObject_1.nil;
|
|
15
|
+
this.maxAutomaticFontSize = 25;
|
|
16
|
+
this._class = UIButton;
|
|
17
|
+
this.superclass = UIBaseButton_1.UIBaseButton;
|
|
18
|
+
}
|
|
19
|
+
initView(elementID, viewHTMLElement, initViewData) {
|
|
20
|
+
this.class.superclass = UIBaseButton_1.UIBaseButton;
|
|
21
|
+
// Instance variables
|
|
22
|
+
this.colors = {
|
|
23
|
+
titleLabel: {
|
|
24
|
+
normal: UIColor_1.UIColor.whiteColor,
|
|
25
|
+
highlighted: UIColor_1.UIColor.whiteColor,
|
|
26
|
+
selected: UIColor_1.UIColor.whiteColor
|
|
27
|
+
},
|
|
28
|
+
background: {
|
|
29
|
+
normal: UIColor_1.UIColor.blueColor,
|
|
30
|
+
highlighted: UIColor_1.UIColor.greenColor,
|
|
31
|
+
selected: UIColor_1.UIColor.redColor
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this._imageView = new UIImageView_1.UIImageView(elementID + "ImageView");
|
|
35
|
+
this._imageView.hidden = UIObject_1.YES;
|
|
36
|
+
this.addSubview(this.imageView);
|
|
37
|
+
this.imageView.fillMode = UIImageView_1.UIImageView.fillMode.aspectFitIfLarger;
|
|
38
|
+
if ((0, UIObject_1.IS_NOT_NIL)(initViewData.titleType)) {
|
|
39
|
+
this._titleLabel = new UITextView_1.UITextView(elementID + "TitleLabel", initViewData.titleType);
|
|
40
|
+
this.titleLabel.style.whiteSpace = "nowrap";
|
|
41
|
+
this.addSubview(this.titleLabel);
|
|
42
|
+
this.titleLabel.userInteractionEnabled = UIObject_1.NO;
|
|
43
|
+
}
|
|
44
|
+
this.contentPadding = 10;
|
|
45
|
+
this.imageView.userInteractionEnabled = UIObject_1.NO;
|
|
46
|
+
this.titleLabel.textAlignment = UITextView_1.UITextView.textAlignment.center;
|
|
47
|
+
this.titleLabel.nativeSelectionEnabled = UIObject_1.NO;
|
|
48
|
+
}
|
|
49
|
+
get contentPadding() {
|
|
50
|
+
return this._contentPadding.integerValue;
|
|
51
|
+
}
|
|
52
|
+
set contentPadding(contentPadding) {
|
|
53
|
+
this._contentPadding = contentPadding;
|
|
54
|
+
this.setNeedsLayout();
|
|
55
|
+
}
|
|
56
|
+
set hovered(hovered) {
|
|
57
|
+
this._hovered = hovered;
|
|
58
|
+
this.updateContentForCurrentState();
|
|
59
|
+
}
|
|
60
|
+
get hovered() {
|
|
61
|
+
return this._hovered;
|
|
62
|
+
}
|
|
63
|
+
set highlighted(highlighted) {
|
|
64
|
+
this._highlighted = highlighted;
|
|
65
|
+
this.updateContentForCurrentState();
|
|
66
|
+
}
|
|
67
|
+
get highlighted() {
|
|
68
|
+
return this._highlighted;
|
|
69
|
+
}
|
|
70
|
+
set focused(focused) {
|
|
71
|
+
this._focused = focused;
|
|
72
|
+
if (focused) {
|
|
73
|
+
this.focus();
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.blur();
|
|
77
|
+
}
|
|
78
|
+
this.updateContentForCurrentState();
|
|
79
|
+
}
|
|
80
|
+
get focused() {
|
|
81
|
+
return this._focused;
|
|
82
|
+
}
|
|
83
|
+
set selected(selected) {
|
|
84
|
+
this._selected = selected;
|
|
85
|
+
this.updateContentForCurrentState();
|
|
86
|
+
}
|
|
87
|
+
get selected() {
|
|
88
|
+
return this._selected;
|
|
89
|
+
}
|
|
90
|
+
updateContentForCurrentState() {
|
|
91
|
+
var updateFunction = this.updateContentForNormalState;
|
|
92
|
+
if (this.selected && this.highlighted) {
|
|
93
|
+
updateFunction = this.updateContentForSelectedAndHighlightedState;
|
|
94
|
+
}
|
|
95
|
+
else if (this.selected) {
|
|
96
|
+
updateFunction = this.updateContentForSelectedState;
|
|
97
|
+
}
|
|
98
|
+
else if (this.focused) {
|
|
99
|
+
updateFunction = this.updateContentForFocusedState;
|
|
100
|
+
}
|
|
101
|
+
else if (this.highlighted) {
|
|
102
|
+
updateFunction = this.updateContentForHighlightedState;
|
|
103
|
+
}
|
|
104
|
+
else if (this.hovered) {
|
|
105
|
+
updateFunction = this.updateContentForHoveredState;
|
|
106
|
+
}
|
|
107
|
+
if (!(0, UIObject_1.IS)(updateFunction)) {
|
|
108
|
+
this.titleLabel.textColor = UIColor_1.UIColor.nilColor;
|
|
109
|
+
this.backgroundColor = UIColor_1.UIColor.nilColor;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
updateFunction.call(this);
|
|
113
|
+
}
|
|
114
|
+
this.updateContentForCurrentEnabledState();
|
|
115
|
+
}
|
|
116
|
+
updateContentForNormalState() {
|
|
117
|
+
this.backgroundColor = this.colors.background.normal;
|
|
118
|
+
this.titleLabel.textColor = this.colors.titleLabel.normal;
|
|
119
|
+
}
|
|
120
|
+
updateContentForHoveredState() {
|
|
121
|
+
this.updateContentForNormalState();
|
|
122
|
+
if (this.colors.background.hovered) {
|
|
123
|
+
this.backgroundColor = this.colors.background.hovered;
|
|
124
|
+
}
|
|
125
|
+
if (this.colors.titleLabel.hovered) {
|
|
126
|
+
this.titleLabel.textColor = this.colors.titleLabel.hovered;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
updateContentForFocusedState() {
|
|
130
|
+
this.updateContentForHoveredState();
|
|
131
|
+
if (this.colors.background.focused) {
|
|
132
|
+
this.backgroundColor = this.colors.background.focused;
|
|
133
|
+
}
|
|
134
|
+
if (this.colors.titleLabel.focused) {
|
|
135
|
+
this.titleLabel.textColor = this.colors.titleLabel.focused;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
updateContentForHighlightedState() {
|
|
139
|
+
this.backgroundColor = this.colors.background.highlighted;
|
|
140
|
+
this.titleLabel.textColor = this.colors.titleLabel.highlighted;
|
|
141
|
+
}
|
|
142
|
+
updateContentForSelectedState() {
|
|
143
|
+
this.backgroundColor = this.colors.background.selected;
|
|
144
|
+
this.titleLabel.textColor = this.colors.titleLabel.selected;
|
|
145
|
+
}
|
|
146
|
+
updateContentForSelectedAndHighlightedState() {
|
|
147
|
+
this.updateContentForSelectedState();
|
|
148
|
+
if (this.colors.background.selectedAndHighlighted) {
|
|
149
|
+
this.backgroundColor = this.colors.background.selectedAndHighlighted;
|
|
150
|
+
}
|
|
151
|
+
if (this.colors.titleLabel.selectedAndHighlighted) {
|
|
152
|
+
this.titleLabel.textColor = this.colors.titleLabel.selectedAndHighlighted;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
set enabled(enabled) {
|
|
156
|
+
// @ts-ignore
|
|
157
|
+
super.enabled = enabled;
|
|
158
|
+
this.updateContentForCurrentState();
|
|
159
|
+
}
|
|
160
|
+
get enabled() {
|
|
161
|
+
// @ts-ignore
|
|
162
|
+
return super.enabled;
|
|
163
|
+
}
|
|
164
|
+
updateContentForCurrentEnabledState() {
|
|
165
|
+
if (this.enabled) {
|
|
166
|
+
this.alpha = 1;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.alpha = 0.5;
|
|
170
|
+
}
|
|
171
|
+
this.userInteractionEnabled = this.enabled;
|
|
172
|
+
}
|
|
173
|
+
addStyleClass(styleClassName) {
|
|
174
|
+
super.addStyleClass(styleClassName);
|
|
175
|
+
if (this.styleClassName != styleClassName) {
|
|
176
|
+
this.updateContentForCurrentState.call(this);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
get titleLabel() {
|
|
180
|
+
return this._titleLabel;
|
|
181
|
+
}
|
|
182
|
+
get imageView() {
|
|
183
|
+
return this._imageView;
|
|
184
|
+
}
|
|
185
|
+
layoutSubviews() {
|
|
186
|
+
super.layoutSubviews();
|
|
187
|
+
var bounds = this.bounds;
|
|
188
|
+
this.hoverText = this.titleLabel.text;
|
|
189
|
+
// Image only if text is not present
|
|
190
|
+
if ((0, UIObject_1.IS_NOT)(this.imageView.hidden) && !(0, UIObject_1.IS)(this.titleLabel.text)) {
|
|
191
|
+
this.imageView.frame = bounds;
|
|
192
|
+
}
|
|
193
|
+
// Text only if image is not present
|
|
194
|
+
if ((0, UIObject_1.IS)(this.imageView.hidden) && (0, UIObject_1.IS)(this.titleLabel.text)) {
|
|
195
|
+
var titleElement = this.titleLabel.viewHTMLElement;
|
|
196
|
+
this.titleLabel.style.left = this.contentPadding;
|
|
197
|
+
this.titleLabel.style.right = this.contentPadding;
|
|
198
|
+
// this.titleLabel.style.marginLeft = ""
|
|
199
|
+
// this.titleLabel.style.right = this.contentPadding
|
|
200
|
+
this.titleLabel.style.top = "50%";
|
|
201
|
+
this.titleLabel.style.transform = "translateY(-50%)";
|
|
202
|
+
this.titleLabel.frame = new UIRectangle_1.UIRectangle(UIObject_1.nil, UIObject_1.nil, UIObject_1.nil, UIObject_1.nil);
|
|
203
|
+
if (this.usesAutomaticTitleFontSize) {
|
|
204
|
+
var hidden = this.titleLabel.hidden;
|
|
205
|
+
this.titleLabel.hidden = UIObject_1.YES;
|
|
206
|
+
this.titleLabel.fontSize = 15;
|
|
207
|
+
this.titleLabel.fontSize = UITextView_1.UITextView.automaticallyCalculatedFontSize(new UIRectangle_1.UIRectangle(0, 0, this.bounds.height, 1 *
|
|
208
|
+
this.titleLabel.viewHTMLElement.offsetWidth), this.titleLabel.intrinsicContentSize(), this.titleLabel.fontSize, this.minAutomaticFontSize, this.maxAutomaticFontSize);
|
|
209
|
+
this.titleLabel.hidden = hidden;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Image and text both present
|
|
213
|
+
if ((0, UIObject_1.IS_NOT)(this.imageView.hidden) && (0, UIObject_1.IS)(this.titleLabel.text)) {
|
|
214
|
+
const imageShareOfWidth = 0.25;
|
|
215
|
+
bounds = bounds.rectangleWithInset(this.contentPadding);
|
|
216
|
+
const imageFrame = bounds.copy();
|
|
217
|
+
imageFrame.width = bounds.height - this.contentPadding * 0.5;
|
|
218
|
+
this.imageView.frame = imageFrame;
|
|
219
|
+
var titleElement = this.titleLabel.viewHTMLElement;
|
|
220
|
+
this.titleLabel.style.left = imageFrame.max.x + this.contentPadding;
|
|
221
|
+
this.titleLabel.style.right = this.contentPadding;
|
|
222
|
+
this.titleLabel.style.top = "50%";
|
|
223
|
+
this.titleLabel.style.transform = "translateY(-50%)";
|
|
224
|
+
if (this.usesAutomaticTitleFontSize) {
|
|
225
|
+
var hidden = this.titleLabel.hidden;
|
|
226
|
+
this.titleLabel.hidden = UIObject_1.YES;
|
|
227
|
+
this.titleLabel.fontSize = 15;
|
|
228
|
+
this.titleLabel.fontSize = UITextView_1.UITextView.automaticallyCalculatedFontSize(new UIRectangle_1.UIRectangle(0, 0, this.bounds.height, 1 *
|
|
229
|
+
this.titleLabel.viewHTMLElement.offsetWidth), this.titleLabel.intrinsicContentSize(), this.titleLabel.fontSize, this.minAutomaticFontSize, this.maxAutomaticFontSize);
|
|
230
|
+
this.titleLabel.hidden = hidden;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
this.applyClassesAndStyles();
|
|
234
|
+
}
|
|
235
|
+
initViewStyleSelectors() {
|
|
236
|
+
this.initStyleSelector("." + this.styleClassName, "background-color: lightblue;");
|
|
237
|
+
// var selectorWithoutImage = "." + this.styleClassName + " ." + this.imageView.styleClassName + " + ." + this.titleLabel.styleClassName;
|
|
238
|
+
// this.initStyleSelector(
|
|
239
|
+
// selectorWithoutImage,
|
|
240
|
+
// "left: " + this.contentPadding + ";" +
|
|
241
|
+
// "right: " + this.contentPadding + ";" +
|
|
242
|
+
// "top: 50%;" +
|
|
243
|
+
// "transform: translateY(-50%);");
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
exports.UIButton = UIButton;
|
|
247
|
+
//# sourceMappingURL=UIButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIButton.js","sourceRoot":"","sources":["../scripts/UIButton.ts"],"names":[],"mappings":";;;AACA,iDAA6C;AAC7C,uCAAmC;AACnC,+CAA2C;AAC3C,yCAAiE;AACjE,+CAA2C;AAC3C,6CAAyC;AAwBzC,MAAa,QAAS,SAAQ,2BAAY;IAatC,YAAY,SAAiB,EAAE,WAAoB,EAAE,SAAS,GAAG,uBAAU,CAAC,IAAI,CAAC,IAAI;QAEjF,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAA;QAT7D,+BAA0B,GAAG,aAAE,CAAA;QAC/B,yBAAoB,GAAW,cAAG,CAAA;QAClC,yBAAoB,GAAW,EAAE,CAAA;QAS7B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,2BAAY,CAAA;IAGlC,CAAC;IAMD,QAAQ,CAAC,SAAS,EAAE,eAAe,EAAE,YAAmC;QAEpE,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,2BAAY,CAAA;QAEpC,qBAAqB;QAErB,IAAI,CAAC,MAAM,GAAG;YAEV,UAAU,EAAE;gBAER,MAAM,EAAE,iBAAO,CAAC,UAAU;gBAC1B,WAAW,EAAE,iBAAO,CAAC,UAAU;gBAC/B,QAAQ,EAAE,iBAAO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CAAC;IAED,sBAAsB;QAElB,IAAI,CAAC,iBAAiB,CAAC,GAAG,GAAG,IAAI,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAA;QAEjF,yIAAyI;QAEzI,0BAA0B;QAC1B,4BAA4B;QAC5B,6CAA6C;QAC7C,8CAA8C;QAC9C,oBAAoB;QACpB,uCAAuC;IAE3C,CAAC;CAMJ;AA5aD,4BA4aC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { UIObject } from "./UIObject";
|
|
2
|
+
export interface UIColorDescriptor {
|
|
3
|
+
red: number;
|
|
4
|
+
green: number;
|
|
5
|
+
blue: number;
|
|
6
|
+
alpha?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class UIColor extends UIObject {
|
|
9
|
+
stringValue: string;
|
|
10
|
+
constructor(stringValue: string);
|
|
11
|
+
toString(): string;
|
|
12
|
+
static get redColor(): UIColor;
|
|
13
|
+
static get blueColor(): UIColor;
|
|
14
|
+
static get greenColor(): UIColor;
|
|
15
|
+
static get yellowColor(): UIColor;
|
|
16
|
+
static get blackColor(): UIColor;
|
|
17
|
+
static get brownColor(): UIColor;
|
|
18
|
+
static get whiteColor(): UIColor;
|
|
19
|
+
static get greyColor(): UIColor;
|
|
20
|
+
static get lightGreyColor(): UIColor;
|
|
21
|
+
static get transparentColor(): UIColor;
|
|
22
|
+
static get undefinedColor(): UIColor;
|
|
23
|
+
static get nilColor(): UIColor;
|
|
24
|
+
static nameToHex(name: string): string;
|
|
25
|
+
static hexToDescriptor(c: string): UIColorDescriptor;
|
|
26
|
+
static rgbToDescriptor(colorString: string): {
|
|
27
|
+
red: number;
|
|
28
|
+
green: number;
|
|
29
|
+
blue: number;
|
|
30
|
+
alpha: number;
|
|
31
|
+
};
|
|
32
|
+
get colorDescriptor(): UIColorDescriptor;
|
|
33
|
+
colorWithRed(red: number): UIColor;
|
|
34
|
+
colorWithGreen(green: number): UIColor;
|
|
35
|
+
colorWithBlue(blue: number): UIColor;
|
|
36
|
+
colorWithAlpha(alpha: number): UIColor;
|
|
37
|
+
static colorWithRGBA(red: number, green: number, blue: number, alpha?: number): UIColor;
|
|
38
|
+
static colorWithDescriptor(descriptor: UIColorDescriptor): UIColor;
|
|
39
|
+
private static defaultAlphaToOne;
|
|
40
|
+
colorByMultiplyingRGB(multiplier: number): UIColor;
|
|
41
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIColor = void 0;
|
|
4
|
+
const UIObject_1 = require("./UIObject");
|
|
5
|
+
class UIColor extends UIObject_1.UIObject {
|
|
6
|
+
constructor(stringValue) {
|
|
7
|
+
super();
|
|
8
|
+
this.stringValue = stringValue;
|
|
9
|
+
this._class = UIColor;
|
|
10
|
+
this.superclass = UIObject_1.UIObject;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
return this.stringValue;
|
|
14
|
+
}
|
|
15
|
+
static get redColor() {
|
|
16
|
+
return new UIColor("red");
|
|
17
|
+
}
|
|
18
|
+
static get blueColor() {
|
|
19
|
+
return new UIColor("blue");
|
|
20
|
+
}
|
|
21
|
+
static get greenColor() {
|
|
22
|
+
return new UIColor("green");
|
|
23
|
+
}
|
|
24
|
+
static get yellowColor() {
|
|
25
|
+
return new UIColor("yellow");
|
|
26
|
+
}
|
|
27
|
+
static get blackColor() {
|
|
28
|
+
return new UIColor("black");
|
|
29
|
+
}
|
|
30
|
+
static get brownColor() {
|
|
31
|
+
return new UIColor("brown");
|
|
32
|
+
}
|
|
33
|
+
static get whiteColor() {
|
|
34
|
+
return new UIColor("white");
|
|
35
|
+
}
|
|
36
|
+
static get greyColor() {
|
|
37
|
+
return new UIColor("grey");
|
|
38
|
+
}
|
|
39
|
+
static get lightGreyColor() {
|
|
40
|
+
return new UIColor("lightgrey");
|
|
41
|
+
}
|
|
42
|
+
static get transparentColor() {
|
|
43
|
+
return new UIColor("transparent");
|
|
44
|
+
}
|
|
45
|
+
static get undefinedColor() {
|
|
46
|
+
return new UIColor("");
|
|
47
|
+
}
|
|
48
|
+
static get nilColor() {
|
|
49
|
+
return new UIColor("");
|
|
50
|
+
}
|
|
51
|
+
static nameToHex(name) {
|
|
52
|
+
return {
|
|
53
|
+
"aliceblue": "#f0f8ff",
|
|
54
|
+
"antiquewhite": "#faebd7",
|
|
55
|
+
"aqua": "#00ffff",
|
|
56
|
+
"aquamarine": "#7fffd4",
|
|
57
|
+
"azure": "#f0ffff",
|
|
58
|
+
"beige": "#f5f5dc",
|
|
59
|
+
"bisque": "#ffe4c4",
|
|
60
|
+
"black": "#000000",
|
|
61
|
+
"blanchedalmond": "#ffebcd",
|
|
62
|
+
"blue": "#0000ff",
|
|
63
|
+
"blueviolet": "#8a2be2",
|
|
64
|
+
"brown": "#a52a2a",
|
|
65
|
+
"burlywood": "#deb887",
|
|
66
|
+
"cadetblue": "#5f9ea0",
|
|
67
|
+
"chartreuse": "#7fff00",
|
|
68
|
+
"chocolate": "#d2691e",
|
|
69
|
+
"coral": "#ff7f50",
|
|
70
|
+
"cornflowerblue": "#6495ed",
|
|
71
|
+
"cornsilk": "#fff8dc",
|
|
72
|
+
"crimson": "#dc143c",
|
|
73
|
+
"cyan": "#00ffff",
|
|
74
|
+
"darkblue": "#00008b",
|
|
75
|
+
"darkcyan": "#008b8b",
|
|
76
|
+
"darkgoldenrod": "#b8860b",
|
|
77
|
+
"darkgray": "#a9a9a9",
|
|
78
|
+
"darkgreen": "#006400",
|
|
79
|
+
"darkkhaki": "#bdb76b",
|
|
80
|
+
"darkmagenta": "#8b008b",
|
|
81
|
+
"darkolivegreen": "#556b2f",
|
|
82
|
+
"darkorange": "#ff8c00",
|
|
83
|
+
"darkorchid": "#9932cc",
|
|
84
|
+
"darkred": "#8b0000",
|
|
85
|
+
"darksalmon": "#e9967a",
|
|
86
|
+
"darkseagreen": "#8fbc8f",
|
|
87
|
+
"darkslateblue": "#483d8b",
|
|
88
|
+
"darkslategray": "#2f4f4f",
|
|
89
|
+
"darkturquoise": "#00ced1",
|
|
90
|
+
"darkviolet": "#9400d3",
|
|
91
|
+
"deeppink": "#ff1493",
|
|
92
|
+
"deepskyblue": "#00bfff",
|
|
93
|
+
"dimgray": "#696969",
|
|
94
|
+
"dodgerblue": "#1e90ff",
|
|
95
|
+
"firebrick": "#b22222",
|
|
96
|
+
"floralwhite": "#fffaf0",
|
|
97
|
+
"forestgreen": "#228b22",
|
|
98
|
+
"fuchsia": "#ff00ff",
|
|
99
|
+
"gainsboro": "#dcdcdc",
|
|
100
|
+
"ghostwhite": "#f8f8ff",
|
|
101
|
+
"gold": "#ffd700",
|
|
102
|
+
"goldenrod": "#daa520",
|
|
103
|
+
"gray": "#808080",
|
|
104
|
+
"green": "#008000",
|
|
105
|
+
"greenyellow": "#adff2f",
|
|
106
|
+
"honeydew": "#f0fff0",
|
|
107
|
+
"hotpink": "#ff69b4",
|
|
108
|
+
"indianred ": "#cd5c5c",
|
|
109
|
+
"indigo": "#4b0082",
|
|
110
|
+
"ivory": "#fffff0",
|
|
111
|
+
"khaki": "#f0e68c",
|
|
112
|
+
"lavender": "#e6e6fa",
|
|
113
|
+
"lavenderblush": "#fff0f5",
|
|
114
|
+
"lawngreen": "#7cfc00",
|
|
115
|
+
"lemonchiffon": "#fffacd",
|
|
116
|
+
"lightblue": "#add8e6",
|
|
117
|
+
"lightcoral": "#f08080",
|
|
118
|
+
"lightcyan": "#e0ffff",
|
|
119
|
+
"lightgoldenrodyellow": "#fafad2",
|
|
120
|
+
"lightgrey": "#d3d3d3",
|
|
121
|
+
"lightgreen": "#90ee90",
|
|
122
|
+
"lightpink": "#ffb6c1",
|
|
123
|
+
"lightsalmon": "#ffa07a",
|
|
124
|
+
"lightseagreen": "#20b2aa",
|
|
125
|
+
"lightskyblue": "#87cefa",
|
|
126
|
+
"lightslategray": "#778899",
|
|
127
|
+
"lightsteelblue": "#b0c4de",
|
|
128
|
+
"lightyellow": "#ffffe0",
|
|
129
|
+
"lime": "#00ff00",
|
|
130
|
+
"limegreen": "#32cd32",
|
|
131
|
+
"linen": "#faf0e6",
|
|
132
|
+
"magenta": "#ff00ff",
|
|
133
|
+
"maroon": "#800000",
|
|
134
|
+
"mediumaquamarine": "#66cdaa",
|
|
135
|
+
"mediumblue": "#0000cd",
|
|
136
|
+
"mediumorchid": "#ba55d3",
|
|
137
|
+
"mediumpurple": "#9370d8",
|
|
138
|
+
"mediumseagreen": "#3cb371",
|
|
139
|
+
"mediumslateblue": "#7b68ee",
|
|
140
|
+
"mediumspringgreen": "#00fa9a",
|
|
141
|
+
"mediumturquoise": "#48d1cc",
|
|
142
|
+
"mediumvioletred": "#c71585",
|
|
143
|
+
"midnightblue": "#191970",
|
|
144
|
+
"mintcream": "#f5fffa",
|
|
145
|
+
"mistyrose": "#ffe4e1",
|
|
146
|
+
"moccasin": "#ffe4b5",
|
|
147
|
+
"navajowhite": "#ffdead",
|
|
148
|
+
"navy": "#000080",
|
|
149
|
+
"oldlace": "#fdf5e6",
|
|
150
|
+
"olive": "#808000",
|
|
151
|
+
"olivedrab": "#6b8e23",
|
|
152
|
+
"orange": "#ffa500",
|
|
153
|
+
"orangered": "#ff4500",
|
|
154
|
+
"orchid": "#da70d6",
|
|
155
|
+
"palegoldenrod": "#eee8aa",
|
|
156
|
+
"palegreen": "#98fb98",
|
|
157
|
+
"paleturquoise": "#afeeee",
|
|
158
|
+
"palevioletred": "#d87093",
|
|
159
|
+
"papayawhip": "#ffefd5",
|
|
160
|
+
"peachpuff": "#ffdab9",
|
|
161
|
+
"peru": "#cd853f",
|
|
162
|
+
"pink": "#ffc0cb",
|
|
163
|
+
"plum": "#dda0dd",
|
|
164
|
+
"powderblue": "#b0e0e6",
|
|
165
|
+
"purple": "#800080",
|
|
166
|
+
"red": "#ff0000",
|
|
167
|
+
"rosybrown": "#bc8f8f",
|
|
168
|
+
"royalblue": "#4169e1",
|
|
169
|
+
"saddlebrown": "#8b4513",
|
|
170
|
+
"salmon": "#fa8072",
|
|
171
|
+
"sandybrown": "#f4a460",
|
|
172
|
+
"seagreen": "#2e8b57",
|
|
173
|
+
"seashell": "#fff5ee",
|
|
174
|
+
"sienna": "#a0522d",
|
|
175
|
+
"silver": "#c0c0c0",
|
|
176
|
+
"skyblue": "#87ceeb",
|
|
177
|
+
"slateblue": "#6a5acd",
|
|
178
|
+
"slategray": "#708090",
|
|
179
|
+
"snow": "#fffafa",
|
|
180
|
+
"springgreen": "#00ff7f",
|
|
181
|
+
"steelblue": "#4682b4",
|
|
182
|
+
"tan": "#d2b48c",
|
|
183
|
+
"teal": "#008080",
|
|
184
|
+
"thistle": "#d8bfd8",
|
|
185
|
+
"tomato": "#ff6347",
|
|
186
|
+
"turquoise": "#40e0d0",
|
|
187
|
+
"violet": "#ee82ee",
|
|
188
|
+
"wheat": "#f5deb3",
|
|
189
|
+
"white": "#ffffff",
|
|
190
|
+
"whitesmoke": "#f5f5f5",
|
|
191
|
+
"yellow": "#ffff00",
|
|
192
|
+
"yellowgreen": "#9acd32"
|
|
193
|
+
}[name.toLowerCase()];
|
|
194
|
+
}
|
|
195
|
+
static hexToDescriptor(c) {
|
|
196
|
+
if (c[0] === "#") {
|
|
197
|
+
c = c.substr(1);
|
|
198
|
+
}
|
|
199
|
+
const r = parseInt(c.slice(0, 2), 16);
|
|
200
|
+
const g = parseInt(c.slice(2, 4), 16);
|
|
201
|
+
const b = parseInt(c.slice(4, 6), 16);
|
|
202
|
+
const a = parseInt(c.slice(6, 8), 16);
|
|
203
|
+
const result = { "red": r, "green": g, "blue": b, "alpha": a };
|
|
204
|
+
return result;
|
|
205
|
+
//return 'rgb(' + r + ',' + g + ',' + b + ')';
|
|
206
|
+
}
|
|
207
|
+
static rgbToDescriptor(colorString) {
|
|
208
|
+
if (colorString.startsWith("rgba(")) {
|
|
209
|
+
colorString = colorString.slice(5, colorString.length - 1);
|
|
210
|
+
}
|
|
211
|
+
if (colorString.startsWith("rgb(")) {
|
|
212
|
+
colorString = colorString.slice(4, colorString.length - 1) + ", 0";
|
|
213
|
+
}
|
|
214
|
+
const components = colorString.split(",");
|
|
215
|
+
const result = {
|
|
216
|
+
"red": Number(components[0]),
|
|
217
|
+
"green": Number(components[1]),
|
|
218
|
+
"blue": Number(components[2]),
|
|
219
|
+
"alpha": Number(components[3])
|
|
220
|
+
};
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
get colorDescriptor() {
|
|
224
|
+
var descriptor;
|
|
225
|
+
const colorHEXFromName = UIColor.nameToHex(this.stringValue);
|
|
226
|
+
if (this.stringValue.startsWith("rgb")) {
|
|
227
|
+
descriptor = UIColor.rgbToDescriptor(this.stringValue);
|
|
228
|
+
}
|
|
229
|
+
else if (colorHEXFromName) {
|
|
230
|
+
descriptor = UIColor.hexToDescriptor(colorHEXFromName);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
descriptor = UIColor.hexToDescriptor(this.stringValue);
|
|
234
|
+
}
|
|
235
|
+
return descriptor;
|
|
236
|
+
}
|
|
237
|
+
colorWithRed(red) {
|
|
238
|
+
const descriptor = this.colorDescriptor;
|
|
239
|
+
const result = new UIColor("rgba(" + red + "," + descriptor.green + "," + descriptor.blue + "," +
|
|
240
|
+
descriptor.alpha + ")");
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
243
|
+
colorWithGreen(green) {
|
|
244
|
+
const descriptor = this.colorDescriptor;
|
|
245
|
+
const result = new UIColor("rgba(" + descriptor.red + "," + green + "," + descriptor.blue + "," +
|
|
246
|
+
descriptor.alpha + ")");
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
colorWithBlue(blue) {
|
|
250
|
+
const descriptor = this.colorDescriptor;
|
|
251
|
+
const result = new UIColor("rgba(" + descriptor.red + "," + descriptor.green + "," + blue + "," +
|
|
252
|
+
descriptor.alpha + ")");
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
255
|
+
colorWithAlpha(alpha) {
|
|
256
|
+
const descriptor = this.colorDescriptor;
|
|
257
|
+
const result = new UIColor("rgba(" + descriptor.red + "," + descriptor.green + "," + descriptor.blue + "," +
|
|
258
|
+
alpha + ")");
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
static colorWithRGBA(red, green, blue, alpha = 1) {
|
|
262
|
+
const result = new UIColor("rgba(" + red + "," + green + "," + blue + "," + alpha + ")");
|
|
263
|
+
return result;
|
|
264
|
+
}
|
|
265
|
+
static colorWithDescriptor(descriptor) {
|
|
266
|
+
const result = new UIColor("rgba(" + descriptor.red.toFixed(0) + "," + descriptor.green.toFixed(0) + "," +
|
|
267
|
+
descriptor.blue.toFixed(0) + "," + this.defaultAlphaToOne(descriptor.alpha) + ")");
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
static defaultAlphaToOne(value = 1) {
|
|
271
|
+
if (value != value) {
|
|
272
|
+
value = 1;
|
|
273
|
+
}
|
|
274
|
+
return value;
|
|
275
|
+
}
|
|
276
|
+
colorByMultiplyingRGB(multiplier) {
|
|
277
|
+
const descriptor = this.colorDescriptor;
|
|
278
|
+
descriptor.red = descriptor.red * multiplier;
|
|
279
|
+
descriptor.green = descriptor.green * multiplier;
|
|
280
|
+
descriptor.blue = descriptor.blue * multiplier;
|
|
281
|
+
const result = UIColor.colorWithDescriptor(descriptor);
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
exports.UIColor = UIColor;
|
|
286
|
+
//# sourceMappingURL=UIColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIColor.js","sourceRoot":"","sources":["../scripts/UIColor.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAgBrC,MAAa,OAAQ,SAAQ,mBAAQ;IAGjC,YAAmB,WAAmB;QAElC,KAAK,EAAE,CAAA;QAFQ,gBAAW,GAAX,WAAW,CAAQ;QAIlC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAA;QACrB,IAAI,CAAC,UAAU,GAAG,mBAAQ,CAAA;I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AChB,KAAK,GAAG,CAAC,CAAA;SACZ;QACD,OAAO,KAAK,CAAA;IAChB,CAAC;IAID,qBAAqB,CAAC,UAAkB;QAEpC,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAA;QAEvC,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,GAAG,UAAU,CAAA;QAC5C,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAA;QAChD,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,GAAG,UAAU,CAAA;QAE9C,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAA;QAEtD,OAAO,MAAM,CAAA;IAEjB,CAAC;CAMJ;AA5YD,0BA4YC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UIObject } from "./UIObject";
|
|
2
|
+
import { UIViewController } from "./UIViewController";
|
|
3
|
+
import "./UICoreExtensions";
|
|
4
|
+
export interface UILanguageService {
|
|
5
|
+
currentLanguageKey: string;
|
|
6
|
+
stringForKey(key: string, languageName: string, defaultString: string, parameters: {
|
|
7
|
+
[x: string]: string | UILocalizedTextObject;
|
|
8
|
+
}): string | undefined;
|
|
9
|
+
stringForCurrentLanguage(localizedTextObject: UILocalizedTextObject): any;
|
|
10
|
+
}
|
|
11
|
+
export interface UILocalizedTextObject {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class UICore extends UIObject {
|
|
15
|
+
rootViewController: UIViewController;
|
|
16
|
+
static RootViewControllerClass: any;
|
|
17
|
+
static main: UICore;
|
|
18
|
+
static languageService: UILanguageService;
|
|
19
|
+
constructor(rootDivElementID: string, rootViewControllerClass: typeof UIViewController);
|
|
20
|
+
static broadcastEventName: {
|
|
21
|
+
RouteDidChange: string;
|
|
22
|
+
WindowDidResize: string;
|
|
23
|
+
};
|
|
24
|
+
static loadClass(className: string): void;
|
|
25
|
+
}
|
|
26
|
+
export declare const IS_FIREFOX: boolean;
|
|
27
|
+
export declare const IS_SAFARI: boolean;
|