@lango-project/lango-client 0.0.0-stage → 0.2.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.
Files changed (112) hide show
  1. package/LICENSE +200 -0
  2. package/NOTICE +2 -0
  3. package/README.md +929 -2
  4. package/dist/.lango/bignumber.mjs +3119 -0
  5. package/dist/.lango/runtime.mjs +607 -0
  6. package/dist/.lango/xmldom/conventions.js +429 -0
  7. package/dist/.lango/xmldom/dom-parser.js +591 -0
  8. package/dist/.lango/xmldom/dom.js +3759 -0
  9. package/dist/.lango/xmldom/entities.js +2171 -0
  10. package/dist/.lango/xmldom/errors.js +205 -0
  11. package/dist/.lango/xmldom/grammar.js +559 -0
  12. package/dist/.lango/xmldom/index.js +41 -0
  13. package/dist/.lango/xmldom/package.json +1 -0
  14. package/dist/.lango/xmldom/sax.js +983 -0
  15. package/dist/.lango/xmldom.LICENSE.md +8 -0
  16. package/dist/application.mjs +429 -0
  17. package/dist/application.mjs.map +1 -0
  18. package/dist/coordinator.mjs +91 -0
  19. package/dist/coordinator.mjs.map +1 -0
  20. package/dist/demo.mjs +110 -0
  21. package/dist/demo.mjs.map +1 -0
  22. package/dist/demo_controls.mjs +59 -0
  23. package/dist/demo_controls.mjs.map +1 -0
  24. package/dist/errors.mjs +201 -0
  25. package/dist/errors.mjs.map +1 -0
  26. package/dist/form_state.mjs +266 -0
  27. package/dist/form_state.mjs.map +1 -0
  28. package/dist/heartbeat.mjs +330 -0
  29. package/dist/heartbeat.mjs.map +1 -0
  30. package/dist/inheritance.mjs +240 -0
  31. package/dist/inheritance.mjs.map +1 -0
  32. package/dist/input_values.mjs +65 -0
  33. package/dist/input_values.mjs.map +1 -0
  34. package/dist/library.mjs +824 -0
  35. package/dist/library.mjs.map +1 -0
  36. package/dist/navigation.mjs +466 -0
  37. package/dist/navigation.mjs.map +1 -0
  38. package/dist/node/.lango/bignumber.mjs +3119 -0
  39. package/dist/node/.lango/runtime.mjs +609 -0
  40. package/dist/node/.lango/xmldom/conventions.js +429 -0
  41. package/dist/node/.lango/xmldom/dom-parser.js +591 -0
  42. package/dist/node/.lango/xmldom/dom.js +3759 -0
  43. package/dist/node/.lango/xmldom/entities.js +2171 -0
  44. package/dist/node/.lango/xmldom/errors.js +205 -0
  45. package/dist/node/.lango/xmldom/grammar.js +559 -0
  46. package/dist/node/.lango/xmldom/index.js +41 -0
  47. package/dist/node/.lango/xmldom/package.json +1 -0
  48. package/dist/node/.lango/xmldom/sax.js +983 -0
  49. package/dist/node/.lango/xmldom.LICENSE.md +8 -0
  50. package/dist/node/browser_host.mjs +351 -0
  51. package/dist/node/browser_host.mjs.map +1 -0
  52. package/dist/node/create_app.mjs +118 -0
  53. package/dist/node/create_app.mjs.map +1 -0
  54. package/dist/presentation.mjs +89 -0
  55. package/dist/presentation.mjs.map +1 -0
  56. package/dist/protocol.mjs +706 -0
  57. package/dist/protocol.mjs.map +1 -0
  58. package/dist/session.mjs +471 -0
  59. package/dist/session.mjs.map +1 -0
  60. package/dist/tokens.mjs +298 -0
  61. package/dist/tokens.mjs.map +1 -0
  62. package/examples/contacts.lango +293 -0
  63. package/examples/contacts_flow.lango +174 -0
  64. package/examples/contacts_store.lango +109 -0
  65. package/examples/contacts_store_test.lango +65 -0
  66. package/examples/demo.css +87 -0
  67. package/examples/demo_test.lango +356 -0
  68. package/examples/index.html +32 -0
  69. package/examples/pages.lango +174 -0
  70. package/examples/server.lango +189 -0
  71. package/examples/worker.lango +142 -0
  72. package/package.json +68 -4
  73. package/src/application.lango +327 -0
  74. package/src/browser_host.lango +276 -0
  75. package/src/coordinator.lango +57 -0
  76. package/src/demo.lango +110 -0
  77. package/src/demo_controls.lango +53 -0
  78. package/src/errors.lango +149 -0
  79. package/src/errors_test.lango +157 -0
  80. package/src/form_state.lango +168 -0
  81. package/src/heartbeat.lango +230 -0
  82. package/src/heartbeat_test.lango +479 -0
  83. package/src/inheritance.lango +167 -0
  84. package/src/input_values.lango +37 -0
  85. package/src/library.lango +599 -0
  86. package/src/logout_test.lango +564 -0
  87. package/src/navigation.lango +309 -0
  88. package/src/navigation_test.lango +556 -0
  89. package/src/presentation.lango +55 -0
  90. package/src/protocol.lango +787 -0
  91. package/src/renderer_test.lango +2047 -0
  92. package/src/session.lango +343 -0
  93. package/src/session_test.lango +455 -0
  94. package/src/tabs_test.lango +216 -0
  95. package/src/tokens.lango +215 -0
  96. package/template/.vscode/extensions.json +3 -0
  97. package/template/.vscode/settings.json +9 -0
  98. package/template/README.md +44 -0
  99. package/template/gitignore +4 -0
  100. package/template/package.json +22 -0
  101. package/template/public/app.css +10 -0
  102. package/template/public/index.html +24 -0
  103. package/template/src/client.lango +78 -0
  104. package/template/src/pages.lango +55 -0
  105. package/template/src/server.lango +24 -0
  106. package/template/src/worker.lango +77 -0
  107. package/template/test/app.lango +9 -0
  108. package/tools/browser_runner.lango +32 -0
  109. package/tools/browser_test.lango +343 -0
  110. package/tools/create_app.lango +88 -0
  111. package/tools/create_app_test.lango +43 -0
  112. package/tools/starter_test.lango +227 -0
@@ -0,0 +1,599 @@
1
+ import js global crypto
2
+ import "./protocol"
3
+ collectValues(controls)
4
+ applyResponse(controls, response, formId, seqno, effects)
5
+ import "./inheritance"
6
+ normalizeInheritance(spec)
7
+ import "./presentation"
8
+ classNames(value)
9
+ styleMap(value)
10
+ validateProperty(name, value)
11
+ import "./input_values"
12
+ selectItems(options)
13
+ selectIndex(items, value)
14
+ import "./form_state"
15
+ rulesFor(value)
16
+ validationMessage(rules, value)
17
+ sameValue(left, right)
18
+
19
+ export mount(document, root, definition, types = null)
20
+
21
+ export class Types
22
+ methods
23
+ registerType(name, type)
24
+ create(document, definition)
25
+
26
+ Types(options = null)
27
+ if options != null and (!is_object(options) or is_array(options))
28
+ throw "UiControlRegistryOptionsMustBeMap"
29
+ @types = {
30
+ }
31
+ @classes = {
32
+ }
33
+ @sealed = false
34
+ if options != null and options.classes != null
35
+ if !is_object(options.classes) or is_array(options.classes)
36
+ throw "UiThemeClassesMustBeMap"
37
+ for options.classes as name: classes
38
+ @classes[name] = classNames(classes)
39
+
40
+ Types:registerType(name, type)
41
+ if @sealed
42
+ throw "UiControlRegistrySealed"
43
+ if !is_string(name) or name == "" or name == "__proto__" or name == "prototype" or name == "constructor" or !is_kindof(type, Function)
44
+ throw "UiControlTypeRequiresNameAndConstructor"
45
+ if name in @types
46
+ throw "UiDuplicateControlType: ${name}"
47
+ @types[name] = type
48
+ return @this
49
+
50
+ Types:create(document, definition)
51
+ @sealed = true
52
+ if !is_object(definition) or !is_string(definition.type)
53
+ throw "UiControlRequiresDefinition"
54
+ prepared = {
55
+ }
56
+ for definition as name: value
57
+ prepared[name] = value
58
+ defaults = @classes[definition.type]
59
+ if defaults != null
60
+ prepared.classes = classNames(defaults.concat(classNames(definition.classes)))
61
+ type = Control
62
+ if definition.type in @types
63
+ type = @types[definition.type]
64
+ control = new type(document, prepared, @this)
65
+ if !is_kindof(control, Control)
66
+ throw "UiCustomControlMustExtendControl"
67
+ return control
68
+
69
+ export class Binding
70
+ methods
71
+ handle(event)
72
+ report(error)
73
+ dispose()
74
+
75
+ Binding(form, session, errors = null)
76
+ @form = form
77
+ @session = session
78
+ @errors = errors
79
+ @disposed = false
80
+ root = form.element
81
+ if root.langoBinding != null
82
+ throw "UiFormAlreadyBound"
83
+ listener = (event)
84
+ handle(event)
85
+ @listener = listener
86
+ for ["click", "change", "input"] as type
87
+ root.addEventListener(type, listener)
88
+ root.langoBinding = @this
89
+
90
+ Binding:handle(event)
91
+ if @disposed
92
+ return null
93
+ root = @form.element
94
+ element = event.target
95
+ target = null
96
+ current = element
97
+ loop while current != null
98
+ if current.inert == true or current.disabled == true or current.hidden == true
99
+ return null
100
+ if current == root
101
+ break
102
+ if current.langoFormRoot == true
103
+ return null
104
+ if target == null
105
+ target = eventTarget(@form.controls, current, [], event.type)
106
+ current = current.parentNode
107
+ if current != root
108
+ return null
109
+ if event.type == "input" or event.type == "change"
110
+ validateEvent(@form.controls, event.target, root)
111
+ if target == null
112
+ return null
113
+ try
114
+ event.preventDefault()
115
+ if @errors != null and @errors.clear != null
116
+ @errors.clear()
117
+ session = @session
118
+ return session.send(target.url, event.type, target.name).catch((error)
119
+ report(error)
120
+ )
121
+ catch error
122
+ report(error)
123
+ return null
124
+
125
+ validateEvent(controls, element, root)
126
+ current = element
127
+ loop while current != null and current != root
128
+ control = elementControl(controls, current)
129
+ if control != null and control.validate != null
130
+ control.validate()
131
+ return null
132
+ current = current.parentNode
133
+ return null
134
+
135
+ elementControl(controls, element)
136
+ for controls as control
137
+ if control.element.langoFormRoot == true
138
+ continue
139
+ if control.element == element
140
+ return control
141
+ if is_array(control.controls)
142
+ found = elementControl(control.controls, element)
143
+ if found != null
144
+ return found
145
+ return null
146
+
147
+ Binding:report(error)
148
+ if @disposed
149
+ return null
150
+ if @errors != null
151
+ @errors.error(error)
152
+ else
153
+ context log
154
+ log.err(error)
155
+ return null
156
+
157
+ Binding:dispose()
158
+ if @disposed
159
+ return null
160
+ @disposed = true
161
+ root = @form.element
162
+ for ["click", "change", "input"] as type
163
+ root.removeEventListener(type, @listener)
164
+ root.langoBinding = null
165
+ return null
166
+
167
+ eventTarget(controls, element, parentPath, type)
168
+ for controls as control
169
+ path = parentPath.slice()
170
+ if control.name != null and control.name != ""
171
+ path[path.length] = control.name
172
+ if control.element == element
173
+ events = control.events
174
+ if type in events
175
+ name = path
176
+ if path.length == 1
177
+ name = path[0]
178
+ if path.length == 0
179
+ name = null
180
+ return {
181
+ url: events[type]
182
+ name: name
183
+ }
184
+ if is_array(control.controls)
185
+ target = eventTarget(control.controls, element, path, type)
186
+ if target != null
187
+ return target
188
+ return null
189
+
190
+ controlEvents(definition)
191
+ events = {
192
+ }
193
+ if definition.event != null
194
+ type = "change"
195
+ if definition.type == "Button"
196
+ type = "click"
197
+ events[type] = definition.event
198
+ if definition.events != null
199
+ if not is_object(definition.events)
200
+ throw "UiClientEventsMustBeMap"
201
+ for definition.events as type: url
202
+ if type != "click" and type != "change" and type != "input"
203
+ throw "UiClientUnsupportedEventType"
204
+ events[type] = url
205
+ for events as type: url
206
+ if !is_string(url) or !url.startsWith("/") or url.startsWith("//") or url.includes("\\")
207
+ throw "UiClientEventRequiresSameOriginPath"
208
+ return events
209
+
210
+ export class Renderer
211
+ methods
212
+ create(definition)
213
+ replace(old, replacement)
214
+ remove(control)
215
+ capture(control)
216
+ restore(snapshot, operation)
217
+ focus(control)
218
+ toast(level, text)
219
+ release(control)
220
+
221
+ Renderer(document, types = null)
222
+ @document = document
223
+ @types = types
224
+ if @types == null
225
+ @types = new Types()
226
+
227
+ Renderer:create(definition)
228
+ return @types.create(@document, definition)
229
+
230
+ Renderer:release(control)
231
+ releaseControl(control)
232
+ return null
233
+
234
+ releaseControl(control)
235
+ if is_array(control.controls)
236
+ for control.controls as child
237
+ releaseControl(child)
238
+ try
239
+ if control.dispose != null
240
+ control.dispose()
241
+ catch error
242
+ context log
243
+ log.err("Control disposal failed: ${error}")
244
+ return null
245
+
246
+ Renderer:replace(old, replacement)
247
+ element = old.node
248
+ element.parentNode.replaceChild(replacement.node, element)
249
+ return null
250
+
251
+ Renderer:remove(control)
252
+ control.node.remove()
253
+ return null
254
+
255
+ Renderer:capture(control)
256
+ element = control.node
257
+ return {
258
+ element: element
259
+ parent: element.parentNode
260
+ next: element.nextSibling
261
+ }
262
+
263
+ Renderer:restore(snapshot, operation)
264
+ if operation.type == "replace"
265
+ replacement = operation.new
266
+ replacement.node.remove()
267
+ if snapshot.parent != null
268
+ snapshot.parent.insertBefore(snapshot.element, snapshot.next)
269
+ return null
270
+
271
+ Renderer:focus(control)
272
+ control.element.focus()
273
+ return null
274
+
275
+ Renderer:toast(level, text)
276
+ element = @document.createElement("div")
277
+ element.setAttribute("role", "status")
278
+ element.textContent = text
279
+ @document.body.appendChild(element)
280
+ return null
281
+
282
+ export class Control
283
+ properties
284
+ name
285
+ element
286
+ node
287
+ controls
288
+ events
289
+ inherit
290
+ validates
291
+ confirms
292
+ methods
293
+ getValue()
294
+ setValue(value)
295
+ applyProperty(name, value)
296
+ snapshotState()
297
+ restoreState(snapshot)
298
+ dispose()
299
+ isDirty()
300
+ markClean()
301
+ acceptSaved(value)
302
+ validate()
303
+ reportValidity()
304
+ reportPendingError()
305
+
306
+ Control(document, definition, types = null, options = null)
307
+ @name = definition.name
308
+ @type = definition.type
309
+ @controls = null
310
+ @value = definition.value
311
+ @clean = null
312
+ @error = null
313
+ @pendingError = false
314
+ @rules = rulesFor(definition.validation)
315
+ @tracked = definition.trackChanges
316
+ if @tracked == null
317
+ @tracked = @type == "Text" or @type == "Select" or @type == "Checkbox"
318
+ if !is_bool(@tracked)
319
+ throw "UiTrackChangesMustBeBoolean"
320
+ @validates = definition.validate
321
+ if @validates == null
322
+ @validates = false
323
+ if !is_bool(@validates)
324
+ throw "UiValidateEventMustBeBoolean"
325
+ @confirms = definition.confirmDirty
326
+ if @confirms == null
327
+ @confirms = false
328
+ if !is_bool(@confirms)
329
+ throw "UiConfirmDirtyMustBeBoolean"
330
+ @items = []
331
+ if @type == "Select"
332
+ @items = selectItems(definition.options)
333
+ @events = controlEvents(definition)
334
+ @inherit = normalizeInheritance(definition.inherit)
335
+ @classes = classNames(definition.classes)
336
+ @style = styleMap(definition.style)
337
+ registry = types
338
+ if registry == null
339
+ registry = new Types()
340
+ if definition.inherit != null and @type != "Form"
341
+ throw "UiInheritanceRequiresForm"
342
+ tag = "div"
343
+ if @type == "Text" or @type == "Checkbox"
344
+ tag = "input"
345
+ if @type == "Select"
346
+ tag = "select"
347
+ if @type == "Button"
348
+ tag = "button"
349
+ if options != null
350
+ tag = options.tag
351
+ if !is_string(tag) or tag == ""
352
+ throw "UiCustomControlRequiresTag"
353
+ if options == null and @type != "Text" and @type != "Button" and @type != "Value" and @type != "Panel" and @type != "Container" and @type != "Form" and @type != "Select" and @type != "Checkbox"
354
+ throw "UiClientUnknownControlType"
355
+ @element = document.createElement(tag)
356
+ @node = @element
357
+ @errorElement = null
358
+ element = @element
359
+ if @type == "Form"
360
+ element.langoFormRoot = true
361
+ if @type == "Button"
362
+ element.type = "button"
363
+ element.textContent = definition.text
364
+ if @type == "Value"
365
+ element.hidden = true
366
+ if @type == "Checkbox"
367
+ element.type = "checkbox"
368
+ if definition.label != null
369
+ if !is_string(definition.label)
370
+ throw "UiControlLabelMustBeString"
371
+ element.setAttribute("aria-label", definition.label)
372
+ if tag == "input" or tag == "select"
373
+ @node = document.createElement("label")
374
+ @node.className = "lango-field"
375
+ @node.setAttribute("data-lango-control", @type)
376
+ caption = document.createElement("span")
377
+ caption.className = "lango-caption"
378
+ caption.textContent = definition.label
379
+ @node.appendChild(caption)
380
+ @node.appendChild(element)
381
+ @errorElement = document.createElement("span")
382
+ @errorElement.className = "lango-field-error"
383
+ @errorElement.id = "lango-error-${crypto/randomUUID()}"
384
+ @errorElement.hidden = true
385
+ element.setAttribute("aria-describedby", @errorElement.id)
386
+ @node.appendChild(@errorElement)
387
+ if tag == "input" or tag == "select"
388
+ element.setAttribute("aria-required", "${@rules.required == true}")
389
+ container = @type == "Panel" or @type == "Container" or @type == "Form"
390
+ if options != null and options.container == true
391
+ container = true
392
+ if container
393
+ @controls = []
394
+ try
395
+ if @type == "Select"
396
+ for @items as item
397
+ option = document.createElement("option")
398
+ option.value = item.value
399
+ option.textContent = item.text
400
+ option.disabled = item.disabled
401
+ element.appendChild(option)
402
+ if container and is_array(definition.controls)
403
+ for definition.controls as childDefinition
404
+ child = registry.create(document, childDefinition)
405
+ @controls.add(child)
406
+ element.appendChild(child.node)
407
+ if definition.classes != null
408
+ applyProperty("classes", definition.classes)
409
+ if definition.style != null
410
+ applyProperty("style", definition.style)
411
+ if definition.enabled != null
412
+ applyProperty("enabled", definition.enabled)
413
+ if definition.visible != null
414
+ applyProperty("visible", definition.visible)
415
+ initial = definition.value
416
+ if @type == "Checkbox" and initial == null
417
+ initial = false
418
+ setValue(initial)
419
+ markClean()
420
+ catch error
421
+ if is_array(@controls)
422
+ for @controls as child
423
+ releaseControl(child)
424
+ throw error
425
+
426
+ Control:getValue()
427
+ if is_array(@controls)
428
+ return collectValues(@controls)
429
+ switch @type
430
+ case "Text"
431
+ return @element.value
432
+ case "Checkbox"
433
+ return @element.checked
434
+ case "Select"
435
+ index = @element.selectedIndex
436
+ if index < 0 or index >= @items.length
437
+ return null
438
+ return @items[index].value
439
+ else
440
+ return @value
441
+
442
+ Control:setValue(value)
443
+ switch @type
444
+ case "Text"
445
+ text = value
446
+ if value == null
447
+ text = ""
448
+ @element.value = text
449
+ case "Checkbox"
450
+ if !is_bool(value)
451
+ throw "UiCheckboxValueMustBeBoolean"
452
+ @element.checked = value
453
+ case "Select"
454
+ @element.selectedIndex = selectIndex(@items, value)
455
+ @value = value
456
+ if @error != null
457
+ validate()
458
+ return null
459
+
460
+ Control:isDirty()
461
+ if is_array(@controls)
462
+ for @controls as child
463
+ if child.isDirty != null
464
+ if child.isDirty()
465
+ return true
466
+ return false
467
+ if !@tracked
468
+ return false
469
+ current = from_json(to_json(getValue()))
470
+ return !sameValue(current, @clean)
471
+
472
+ Control:markClean()
473
+ if is_array(@controls)
474
+ for @controls as child
475
+ if child.markClean != null
476
+ child.markClean()
477
+ else
478
+ acceptSaved(getValue())
479
+ return null
480
+
481
+ Control:acceptSaved(value)
482
+ @clean = from_json(to_json(value))
483
+ return null
484
+
485
+ Control:validate()
486
+ @pendingError = false
487
+ @error = validationMessage(@rules, getValue())
488
+ renderError()
489
+ return @error
490
+
491
+ Control:renderError()
492
+ text = @error
493
+ if text == null
494
+ text = ""
495
+ @element.setAttribute("aria-invalid", "${@error != null}")
496
+ @element.setAttribute("data-lango-error", text)
497
+ if @errorElement != null
498
+ @errorElement.textContent = text
499
+ @errorElement.hidden = @error == null
500
+ if @element.setCustomValidity != null
501
+ @element.setCustomValidity(text)
502
+ return null
503
+
504
+ Control:reportValidity()
505
+ if @element.reportValidity != null
506
+ return @element.reportValidity()
507
+ return @error == null
508
+
509
+ Control:reportPendingError()
510
+ if !@pendingError
511
+ return false
512
+ current = @element
513
+ loop while current != null
514
+ if current.disabled == true or current.hidden == true or current.inert == true
515
+ return false
516
+ current = current.parentNode
517
+ @pendingError = false
518
+ reportValidity()
519
+ return true
520
+
521
+ Control:applyProperty(name, value)
522
+ validateProperty(name, value)
523
+ switch name
524
+ case "enabled"
525
+ @element.disabled = !value
526
+ @element.inert = !value
527
+ @node.inert = !value
528
+ case "visible"
529
+ @element.hidden = !value or @type == "Value"
530
+ @node.hidden = @element.hidden
531
+ case "classes"
532
+ @classes = classNames(value)
533
+ @element.className = @classes.join(" ")
534
+ case "style"
535
+ styles = styleMap(value)
536
+ for @style as property: text
537
+ @element.style.removeProperty(property)
538
+ for styles as property: text
539
+ @element.style.setProperty(property, text)
540
+ @style = styles
541
+ case "savedValue"
542
+ acceptSaved(value)
543
+ case "error"
544
+ @error = value
545
+ @pendingError = value != null
546
+ renderError()
547
+ reportPendingError()
548
+ return null
549
+
550
+ Control:snapshotState()
551
+ return {
552
+ value: @value
553
+ text: @element.value
554
+ checked: @element.checked
555
+ selectedIndex: @element.selectedIndex
556
+ disabled: @element.disabled
557
+ hidden: @element.hidden
558
+ inert: @element.inert
559
+ classes: @element.className
560
+ style: @element.style.cssText
561
+ managedStyle: @style
562
+ managedClasses: @classes
563
+ clean: @clean
564
+ error: @error
565
+ pendingError: @pendingError
566
+ }
567
+
568
+ Control:restoreState(snapshot)
569
+ setValue(snapshot.value)
570
+ if @type == "Text"
571
+ @element.value = snapshot.text
572
+ if @type == "Checkbox"
573
+ @element.checked = snapshot.checked
574
+ if @type == "Select"
575
+ @element.selectedIndex = snapshot.selectedIndex
576
+ @element.disabled = snapshot.disabled
577
+ @element.hidden = snapshot.hidden
578
+ @element.inert = snapshot.inert
579
+ @node.hidden = snapshot.hidden
580
+ @node.inert = snapshot.inert
581
+ @element.className = snapshot.classes
582
+ @element.style.cssText = snapshot.style
583
+ @style = snapshot.managedStyle
584
+ @classes = snapshot.managedClasses
585
+ @clean = snapshot.clean
586
+ @error = snapshot.error
587
+ @pendingError = snapshot.pendingError
588
+ renderError()
589
+ return null
590
+
591
+ Control:dispose()
592
+ return null
593
+
594
+ mount(document, root, definition, types = null)
595
+ if types == null
596
+ types = new Types()
597
+ control = types.create(document, definition)
598
+ root.appendChild(control.node)
599
+ return control