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,91 @@
|
|
|
1
|
+
import { NO } from "./UIObject"
|
|
2
|
+
import { UITextField } from "./UITextField"
|
|
3
|
+
import { UITextView } from "./UITextView"
|
|
4
|
+
import { UIViewAddControlEventTargetObject } from "./UIView"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export class UITextArea extends UITextField {
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
constructor(elementID, viewHTMLElement = null) {
|
|
17
|
+
|
|
18
|
+
super(elementID, viewHTMLElement, UITextView.type.textArea)
|
|
19
|
+
|
|
20
|
+
this._class = UITextArea
|
|
21
|
+
this.superclass = UITextField
|
|
22
|
+
|
|
23
|
+
this.viewHTMLElement.removeAttribute("type")
|
|
24
|
+
|
|
25
|
+
this.style.overflow = "auto"
|
|
26
|
+
|
|
27
|
+
this.style.webkitUserSelect = "text"
|
|
28
|
+
|
|
29
|
+
this.pausesPointerEvents = NO
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
get addControlEventTarget(): UIViewAddControlEventTargetObject<typeof UITextArea.controlEvent> {
|
|
35
|
+
|
|
36
|
+
return super.addControlEventTarget as any;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
get viewHTMLElement(): HTMLTextAreaElement {
|
|
42
|
+
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
return super.viewHTMLElement
|
|
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
|
+
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { UIColor } from "./UIColor"
|
|
2
|
+
import { UICore } from "./UICore"
|
|
3
|
+
import { nil, NO, YES } from "./UIObject"
|
|
4
|
+
import { UITextView } from "./UITextView"
|
|
5
|
+
import { UIView, UIViewAddControlEventTargetObject, UIViewBroadcastEvent } from "./UIView"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export class UITextField extends UITextView {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
_placeholderTextKey: string
|
|
15
|
+
_defaultPlaceholderText: string
|
|
16
|
+
|
|
17
|
+
_viewHTMLElement: HTMLInputElement
|
|
18
|
+
|
|
19
|
+
constructor(elementID?: string, viewHTMLElement = null, type = UITextView.type.textField) {
|
|
20
|
+
|
|
21
|
+
super(elementID, type, viewHTMLElement)
|
|
22
|
+
|
|
23
|
+
this._class = UITextField
|
|
24
|
+
this.superclass = UITextView
|
|
25
|
+
|
|
26
|
+
this.viewHTMLElement.setAttribute("type", "text")
|
|
27
|
+
|
|
28
|
+
this.backgroundColor = UIColor.whiteColor
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
this.addTargetForControlEvent(UIView.controlEvent.PointerUpInside, function (sender, event) {
|
|
33
|
+
|
|
34
|
+
sender.focus()
|
|
35
|
+
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
this.viewHTMLElement.oninput = (event) => {
|
|
40
|
+
this.sendControlEventForKey(UITextField.controlEvent.TextChange, event)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
this.style.webkitUserSelect = "text"
|
|
45
|
+
|
|
46
|
+
this.nativeSelectionEnabled = YES
|
|
47
|
+
|
|
48
|
+
this.pausesPointerEvents = NO
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
static controlEvent = Object.assign({}, UIView.controlEvent, {
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
"TextChange": "TextChange"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
get addControlEventTarget(): UIViewAddControlEventTargetObject<typeof UITextField.controlEvent> {
|
|
69
|
+
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
return super.addControlEventTarget as any;
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public get viewHTMLElement() {
|
|
76
|
+
return this._viewHTMLElement
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
public set text(text: string) {
|
|
82
|
+
|
|
83
|
+
this.viewHTMLElement.value = text
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
public get text(): string {
|
|
89
|
+
|
|
90
|
+
return this.viewHTMLElement.value
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
public set placeholderText(text: string) {
|
|
96
|
+
|
|
97
|
+
this.viewHTMLElement.placeholder = text
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
public get placeholderText(): string {
|
|
103
|
+
|
|
104
|
+
return this.viewHTMLElement.placeholder
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
setPlaceholderText(key: string, defaultString: string) {
|
|
110
|
+
|
|
111
|
+
this._placeholderTextKey = key
|
|
112
|
+
this._defaultPlaceholderText = defaultString
|
|
113
|
+
|
|
114
|
+
const languageName = UICore.languageService.currentLanguageKey
|
|
115
|
+
this.placeholderText = UICore.languageService.stringForKey(key, languageName, defaultString, nil)
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
didReceiveBroadcastEvent(event: UIViewBroadcastEvent) {
|
|
122
|
+
|
|
123
|
+
super.didReceiveBroadcastEvent(event)
|
|
124
|
+
|
|
125
|
+
if (event.name == UIView.broadcastEventName.LanguageChanged || event.name ==
|
|
126
|
+
UIView.broadcastEventName.AddedToViewTree) {
|
|
127
|
+
|
|
128
|
+
this._setPlaceholderFromKeyIfPossible()
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
willMoveToSuperview(superview: UIView) {
|
|
136
|
+
|
|
137
|
+
super.willMoveToSuperview(superview)
|
|
138
|
+
|
|
139
|
+
this._setPlaceholderFromKeyIfPossible()
|
|
140
|
+
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
_setPlaceholderFromKeyIfPossible() {
|
|
144
|
+
|
|
145
|
+
if (this._placeholderTextKey && this._defaultPlaceholderText) {
|
|
146
|
+
|
|
147
|
+
this.setPlaceholderText(this._placeholderTextKey, this._defaultPlaceholderText)
|
|
148
|
+
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
public get isSecure(): boolean {
|
|
155
|
+
|
|
156
|
+
const result = (this.viewHTMLElement.type == "password")
|
|
157
|
+
|
|
158
|
+
return result
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
public set isSecure(secure: boolean) {
|
|
165
|
+
|
|
166
|
+
var type = "text"
|
|
167
|
+
|
|
168
|
+
if (secure) {
|
|
169
|
+
|
|
170
|
+
type = "password"
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
this.viewHTMLElement.type = type
|
|
175
|
+
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|