@lango-project/lango-client 0.2.0 → 0.4.0

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 (232) hide show
  1. package/LICENSE +1 -0
  2. package/NOTICE +5 -1
  3. package/README.md +571 -855
  4. package/cli/.lango/localization.mjs +108 -0
  5. package/{dist/node → cli}/.lango/runtime.mjs +112 -19
  6. package/cli/.lango/vendor/i18next.LICENSE +21 -0
  7. package/cli/.lango/vendor/i18next.mjs +2434 -0
  8. package/cli/create.mjs +62 -0
  9. package/cli/create.mjs.map +1 -0
  10. package/dist/.lango/localization.mjs +108 -0
  11. package/dist/.lango/runtime.mjs +112 -19
  12. package/dist/.lango/vendor/i18next.LICENSE +21 -0
  13. package/dist/.lango/vendor/i18next.mjs +2434 -0
  14. package/dist/accordion.mjs +277 -0
  15. package/dist/accordion.mjs.map +1 -0
  16. package/dist/activities.mjs +185 -0
  17. package/dist/activities.mjs.map +1 -0
  18. package/dist/app.mjs +636 -0
  19. package/dist/app.mjs.map +1 -0
  20. package/dist/boot.mjs +24 -0
  21. package/dist/boot.mjs.map +1 -0
  22. package/dist/bootstrap-LICENSE +21 -0
  23. package/dist/bootstrap.min.css +6 -0
  24. package/dist/bootstrap.min.css.map +1 -0
  25. package/dist/button.mjs +77 -0
  26. package/dist/button.mjs.map +1 -0
  27. package/dist/chip.mjs +134 -0
  28. package/dist/chip.mjs.map +1 -0
  29. package/dist/client.css +95 -0
  30. package/dist/collections.mjs +77 -0
  31. package/dist/collections.mjs.map +1 -0
  32. package/dist/combo_box.mjs +408 -0
  33. package/dist/combo_box.mjs.map +1 -0
  34. package/dist/content.mjs +123 -0
  35. package/dist/content.mjs.map +1 -0
  36. package/dist/control.mjs +139 -0
  37. package/dist/control.mjs.map +1 -0
  38. package/dist/date_input.mjs +242 -0
  39. package/dist/date_input.mjs.map +1 -0
  40. package/dist/error_reporter.mjs +136 -0
  41. package/dist/error_reporter.mjs.map +1 -0
  42. package/dist/fields.mjs +454 -0
  43. package/dist/fields.mjs.map +1 -0
  44. package/dist/file_input.mjs +227 -0
  45. package/dist/file_input.mjs.map +1 -0
  46. package/dist/form.mjs +272 -0
  47. package/dist/form.mjs.map +1 -0
  48. package/dist/heartbeat.mjs +167 -254
  49. package/dist/heartbeat.mjs.map +1 -1
  50. package/dist/index.html +18 -0
  51. package/dist/indicators.mjs +127 -0
  52. package/dist/indicators.mjs.map +1 -0
  53. package/dist/input_changes.mjs +58 -0
  54. package/dist/input_changes.mjs.map +1 -0
  55. package/dist/input_group.mjs +38 -0
  56. package/dist/input_group.mjs.map +1 -0
  57. package/dist/layouts.mjs +195 -0
  58. package/dist/layouts.mjs.map +1 -0
  59. package/dist/library.mjs +130 -775
  60. package/dist/library.mjs.map +1 -1
  61. package/dist/longpoll.mjs +254 -0
  62. package/dist/longpoll.mjs.map +1 -0
  63. package/dist/main.mjs +138 -0
  64. package/dist/main.mjs.map +1 -0
  65. package/dist/markdown.mjs +61 -0
  66. package/dist/markdown.mjs.map +1 -0
  67. package/dist/menus.mjs +468 -0
  68. package/dist/menus.mjs.map +1 -0
  69. package/dist/navigation.mjs +260 -410
  70. package/dist/navigation.mjs.map +1 -1
  71. package/dist/numeric_input.mjs +181 -0
  72. package/dist/numeric_input.mjs.map +1 -0
  73. package/dist/otp_input.mjs +113 -0
  74. package/dist/otp_input.mjs.map +1 -0
  75. package/dist/presentations.mjs +852 -0
  76. package/dist/presentations.mjs.map +1 -0
  77. package/dist/renderer.mjs +293 -0
  78. package/dist/renderer.mjs.map +1 -0
  79. package/dist/rich_content.mjs +99 -0
  80. package/dist/rich_content.mjs.map +1 -0
  81. package/dist/tables.mjs +369 -0
  82. package/dist/tables.mjs.map +1 -0
  83. package/dist/tabs.mjs +205 -0
  84. package/dist/tabs.mjs.map +1 -0
  85. package/dist/templates.mjs +46 -0
  86. package/dist/templates.mjs.map +1 -0
  87. package/dist/vendor/DOMPurify-LICENSE +202 -0
  88. package/dist/vendor/dompurify.mjs +2540 -0
  89. package/dist/vendor/flatpickr-LICENSE.md +21 -0
  90. package/dist/vendor/flatpickr.min.css +13 -0
  91. package/dist/vendor/flatpickr.mjs +2340 -0
  92. package/dist/vendor/flatpickr.mjs.map +7 -0
  93. package/dist/vendor/marked-LICENSE.md +44 -0
  94. package/dist/vendor/marked.esm.js.map +7 -0
  95. package/dist/vendor/marked.mjs +85 -0
  96. package/dist/vendor/purify.es.mjs.map +1 -0
  97. package/dist/widgets.mjs +197 -0
  98. package/dist/widgets.mjs.map +1 -0
  99. package/docs/implementation.md +42 -0
  100. package/package.json +26 -40
  101. package/src/accordion.lango +198 -0
  102. package/src/activities.lango +132 -0
  103. package/src/app.lango +508 -0
  104. package/src/boot.lango +12 -0
  105. package/src/button.lango +49 -0
  106. package/src/chip.lango +94 -0
  107. package/src/collections.lango +46 -0
  108. package/src/combo_box.lango +298 -0
  109. package/src/content.lango +75 -0
  110. package/src/control.lango +100 -0
  111. package/src/create.lango +42 -0
  112. package/src/date_input.lango +215 -0
  113. package/src/error_reporter.lango +95 -0
  114. package/src/fields.lango +327 -0
  115. package/src/file_input.lango +175 -0
  116. package/src/form.lango +195 -0
  117. package/src/heartbeat.lango +136 -199
  118. package/src/indicators.lango +94 -0
  119. package/src/input_changes.lango +33 -0
  120. package/src/input_group.lango +22 -0
  121. package/src/layouts.lango +137 -0
  122. package/src/library.lango +194 -571
  123. package/src/longpoll.lango +187 -0
  124. package/src/main.lango +109 -0
  125. package/src/markdown.lango +48 -0
  126. package/src/menus.lango +336 -0
  127. package/src/navigation.lango +209 -299
  128. package/src/numeric_input.lango +131 -0
  129. package/src/otp_input.lango +83 -0
  130. package/src/presentations.lango +617 -0
  131. package/src/renderer.lango +288 -0
  132. package/src/rich_content.lango +66 -0
  133. package/src/tables.lango +271 -0
  134. package/src/tabs.lango +144 -0
  135. package/src/templates.lango +29 -0
  136. package/src/widgets.lango +141 -0
  137. package/web/client.css +95 -0
  138. package/web/index.html +18 -0
  139. package/dist/application.mjs +0 -429
  140. package/dist/application.mjs.map +0 -1
  141. package/dist/coordinator.mjs +0 -91
  142. package/dist/coordinator.mjs.map +0 -1
  143. package/dist/demo.mjs +0 -110
  144. package/dist/demo.mjs.map +0 -1
  145. package/dist/demo_controls.mjs +0 -59
  146. package/dist/demo_controls.mjs.map +0 -1
  147. package/dist/errors.mjs +0 -201
  148. package/dist/errors.mjs.map +0 -1
  149. package/dist/form_state.mjs +0 -266
  150. package/dist/form_state.mjs.map +0 -1
  151. package/dist/inheritance.mjs +0 -240
  152. package/dist/inheritance.mjs.map +0 -1
  153. package/dist/input_values.mjs +0 -65
  154. package/dist/input_values.mjs.map +0 -1
  155. package/dist/node/.lango/xmldom/conventions.js +0 -429
  156. package/dist/node/.lango/xmldom/dom-parser.js +0 -591
  157. package/dist/node/.lango/xmldom/dom.js +0 -3759
  158. package/dist/node/.lango/xmldom/entities.js +0 -2171
  159. package/dist/node/.lango/xmldom/errors.js +0 -205
  160. package/dist/node/.lango/xmldom/grammar.js +0 -559
  161. package/dist/node/.lango/xmldom/index.js +0 -41
  162. package/dist/node/.lango/xmldom/package.json +0 -1
  163. package/dist/node/.lango/xmldom/sax.js +0 -983
  164. package/dist/node/.lango/xmldom.LICENSE.md +0 -8
  165. package/dist/node/browser_host.mjs +0 -351
  166. package/dist/node/browser_host.mjs.map +0 -1
  167. package/dist/node/create_app.mjs +0 -118
  168. package/dist/node/create_app.mjs.map +0 -1
  169. package/dist/presentation.mjs +0 -89
  170. package/dist/presentation.mjs.map +0 -1
  171. package/dist/protocol.mjs +0 -706
  172. package/dist/protocol.mjs.map +0 -1
  173. package/dist/session.mjs +0 -431
  174. package/dist/session.mjs.map +0 -1
  175. package/dist/tokens.mjs +0 -298
  176. package/dist/tokens.mjs.map +0 -1
  177. package/examples/contacts.lango +0 -302
  178. package/examples/contacts_flow.lango +0 -174
  179. package/examples/contacts_store.lango +0 -109
  180. package/examples/contacts_store_test.lango +0 -65
  181. package/examples/demo.css +0 -72
  182. package/examples/demo_test.lango +0 -356
  183. package/examples/index.html +0 -28
  184. package/examples/pages.lango +0 -180
  185. package/examples/server.lango +0 -189
  186. package/examples/worker.lango +0 -142
  187. package/src/application.lango +0 -327
  188. package/src/browser_host.lango +0 -276
  189. package/src/coordinator.lango +0 -57
  190. package/src/demo.lango +0 -110
  191. package/src/demo_controls.lango +0 -53
  192. package/src/errors.lango +0 -149
  193. package/src/errors_test.lango +0 -157
  194. package/src/form_state.lango +0 -168
  195. package/src/heartbeat_test.lango +0 -479
  196. package/src/inheritance.lango +0 -167
  197. package/src/input_values.lango +0 -37
  198. package/src/logout_test.lango +0 -564
  199. package/src/navigation_test.lango +0 -556
  200. package/src/presentation.lango +0 -55
  201. package/src/protocol.lango +0 -787
  202. package/src/renderer_test.lango +0 -1986
  203. package/src/session.lango +0 -313
  204. package/src/session_test.lango +0 -455
  205. package/src/tabs_test.lango +0 -216
  206. package/src/tokens.lango +0 -215
  207. package/template/.vscode/extensions.json +0 -3
  208. package/template/.vscode/settings.json +0 -9
  209. package/template/README.md +0 -40
  210. package/template/gitignore +0 -4
  211. package/template/package.json +0 -22
  212. package/template/public/app.css +0 -4
  213. package/template/public/index.html +0 -24
  214. package/template/src/client.lango +0 -78
  215. package/template/src/pages.lango +0 -55
  216. package/template/src/server.lango +0 -24
  217. package/template/src/worker.lango +0 -77
  218. package/template/test/app.lango +0 -9
  219. package/tools/create_app.lango +0 -88
  220. package/tools/create_app_test.lango +0 -43
  221. package/tools/starter_test.lango +0 -227
  222. /package/{dist/node → cli}/.lango/bignumber.mjs +0 -0
  223. /package/{dist → cli}/.lango/xmldom/conventions.js +0 -0
  224. /package/{dist → cli}/.lango/xmldom/dom-parser.js +0 -0
  225. /package/{dist → cli}/.lango/xmldom/dom.js +0 -0
  226. /package/{dist → cli}/.lango/xmldom/entities.js +0 -0
  227. /package/{dist → cli}/.lango/xmldom/errors.js +0 -0
  228. /package/{dist → cli}/.lango/xmldom/grammar.js +0 -0
  229. /package/{dist → cli}/.lango/xmldom/index.js +0 -0
  230. /package/{dist → cli}/.lango/xmldom/package.json +0 -0
  231. /package/{dist → cli}/.lango/xmldom/sax.js +0 -0
  232. /package/{dist → cli}/.lango/xmldom.LICENSE.md +0 -0
package/dist/library.mjs CHANGED
@@ -1,792 +1,147 @@
1
- import { collectValues, applyResponse } from "./protocol.mjs";
2
- import { normalizeInheritance } from "./inheritance.mjs";
3
- import { classNames, styleMap, validateProperty } from "./presentation.mjs";
4
- import { selectItems, selectIndex } from "./input_values.mjs";
5
- import { rulesFor, validationMessage, sameValue } from "./form_state.mjs";
1
+ import { DateInput as DateInputClass } from "./date_input.mjs";
2
+ import { NumericInput as NumericInputClass } from "./numeric_input.mjs";
3
+ import { FileInput as FileInputClass } from "./file_input.mjs";
4
+ import { OTPInput as OTPInputClass } from "./otp_input.mjs";
5
+ import { Chip as ChipClass } from "./chip.mjs";
6
+ import { ComboBox as ComboBoxClass } from "./combo_box.mjs";
7
+ import { Avatar as AvatarClass, FormSpinner as FormSpinnerClass } from "./indicators.mjs";
8
+ import { Button as ButtonClass } from "./button.mjs";
9
+ import { InputGroup as InputGroupClass } from "./input_group.mjs";
10
+ import { Markdown as MarkdownClass } from "./markdown.mjs";
11
+ import { Accordion as AccordionClass, AccordionItem as AccordionItemClass } from "./accordion.mjs";
12
+ import { ListGroup as ListGroupClass } from "./collections.mjs";
13
+ import { Menu as MenuClass, MenuItem as MenuItemClass } from "./menus.mjs";
14
+ import { Card as CardClass, CardGroup as CardGroupClass, Image as ImageClass, Badge as BadgeClass, Toolbar as ToolbarClass } from "./layouts.mjs";
15
+ import { Table as TableClass, TableHeader as TableHeaderClass, TableRow as TableRowClass, TableCell as TableCellClass, TableCol as TableColClass, TableDivider as TableDividerClass } from "./tables.mjs";
16
+ import { Tab as TabClass, TabItem as TabItemClass } from "./tabs.mjs";
17
+ import { Nav as NavClass, NavBar as NavBarClass, NavItem as NavItemClass, NavBarItem as NavBarItemClass, Breadcrumb as BreadcrumbClass, BreadcrumbItem as BreadcrumbItemClass } from "./navigation.mjs";
18
+ import { App as AppClass } from "./app.mjs";
19
+ import { Form as FormClass } from "./form.mjs";
20
+ import { BootstrapRenderer as RendererClass } from "./renderer.mjs";
21
+ import { Control as ControlClass, Value as ValueClass } from "./control.mjs";
22
+ import { Field as FieldClass, Input as InputClass, Checkbox as CheckboxClass, Switch as SwitchClass, Range as RangeClass, Select as SelectClass, Radio as RadioClass } from "./fields.mjs";
23
+ import { createTemplate as makeTemplate, cloneTemplate as copyTemplate } from "./templates.mjs";
24
+ import { Alert as AlertClass, Progress as ProgressClass } from "./widgets.mjs";
25
+ import { Toast as ToastClass, ToastStack as ToastStackClass, Dialog as DialogClass } from "./presentations.mjs";
6
26
  import {
7
- contextGet as __contextGet,
8
- contextSet as __contextSet,
9
- contextRestore as __contextRestore,
10
- fromJson as __fromJson,
11
- toJson as __toJson,
12
- getClass as __getClass,
13
- isKindof as __isKindof,
14
- isNumber as __isNumber,
15
- isString as __isString,
16
- isBool as __isBool,
17
- isObject as __isObject,
18
- isArray as __isArray,
19
- includes as __includes,
20
- entries as __entries,
21
- remove as __remove,
22
- clear as __clear,
23
- requireBoolean as __requireBoolean,
24
- normalize as __normalize,
25
27
  boundary as __boundary,
26
28
  requireArity as __requireArity,
27
- withArity as __withArity,
28
29
  } from "./.lango/runtime.mjs";
29
30
 
30
- export class Types {
31
- #types;
32
- #classes;
33
- #sealed;
34
- constructor(options = null) {
35
- options = __boundary(options);
36
- if (__requireBoolean(__requireBoolean(options !== null) && __requireBoolean(__requireBoolean(!__requireBoolean(__isObject(options))) || __requireBoolean(__isArray(options))))) {
37
- throw "UiControlRegistryOptionsMustBeMap";
38
- }
39
- this.#types = { };
40
- this.#classes = { };
41
- this.#sealed = false;
42
- if (__requireBoolean(__requireBoolean(options !== null) && __requireBoolean(__normalize(options.classes) !== null))) {
43
- if (__requireBoolean(__requireBoolean(!__requireBoolean(__isObject(__normalize(options.classes)))) || __requireBoolean(__isArray(__normalize(options.classes))))) {
44
- throw "UiThemeClassesMustBeMap";
45
- }
46
- for (const [name, classes] of __entries(__normalize(options.classes))) {
47
- this.#classes[name] = classNames(classes);
48
- }
49
- }
50
- }
51
- registerType(name, type) {
52
- __requireArity(arguments.length, [0, 1], "registerType");
53
- name = __boundary(name);
54
- type = __boundary(type);
55
- if (__requireBoolean(__normalize(this.#sealed))) {
56
- throw "UiControlRegistrySealed";
57
- }
58
- if (__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(!__requireBoolean(__isString(name))) || __requireBoolean(name === "")) || __requireBoolean(name === "__proto__")) || __requireBoolean(name === "prototype")) || __requireBoolean(name === "constructor")) || __requireBoolean(!__requireBoolean(__isKindof(type, Function))))) {
59
- throw "UiControlTypeRequiresNameAndConstructor";
60
- }
61
- if (__requireBoolean(__includes(name, __normalize(this.#types)))) {
62
- throw `UiDuplicateControlType: ${name}`;
63
- }
64
- this.#types[name] = type;
65
- return this;
66
- return null;
67
- }
68
- create(document, definition) {
69
- __requireArity(arguments.length, [0, 1], "create");
70
- document = __boundary(document);
71
- definition = __boundary(definition);
72
- this.#sealed = true;
73
- if (__requireBoolean(__requireBoolean(!__requireBoolean(__isObject(definition))) || __requireBoolean(!__requireBoolean(__isString(__normalize(definition.type)))))) {
74
- throw "UiControlRequiresDefinition";
75
- }
76
- let prepared = { };
77
- for (const [name, value] of __entries(definition)) {
78
- prepared[name] = value;
79
- }
80
- let defaults = __normalize(this.#classes[__normalize(definition.type)]);
81
- if (__requireBoolean(defaults !== null)) {
82
- prepared.classes = classNames(__normalize(defaults.concat(classNames(__normalize(definition.classes)))));
83
- }
84
- let type = Control;
85
- if (__requireBoolean(__includes(__normalize(definition.type), __normalize(this.#types)))) {
86
- type = __normalize(this.#types[__normalize(definition.type)]);
87
- }
88
- let control = new type(document, prepared, this);
89
- if (__requireBoolean(!__requireBoolean(__isKindof(control, Control)))) {
90
- throw "UiCustomControlMustExtendControl";
91
- }
92
- return control;
93
- return null;
94
- }
95
- }
31
+ export let OTPInput = OTPInputClass;
96
32
 
97
- export class Binding {
98
- #form;
99
- #session;
100
- #errors;
101
- #disposed;
102
- #listener;
103
- constructor(form, session, errors = null) {
104
- __requireArity(arguments.length, [0, 1], "constructor");
105
- form = __boundary(form);
106
- session = __boundary(session);
107
- errors = __boundary(errors);
108
- this.#form = form;
109
- this.#session = session;
110
- this.#errors = errors;
111
- this.#disposed = false;
112
- let root = __normalize(form.element);
113
- if (__requireBoolean(__normalize(root.langoBinding) !== null)) {
114
- throw "UiFormAlreadyBound";
115
- }
116
- let listener = __withArity((event) => {
117
- event = __boundary(event);
118
- this.handle(event);
119
- return null;
120
- }, [0], "closure");
121
- this.#listener = listener;
122
- for (const type of ["click", "change", "input"]) {
123
- __normalize(root.addEventListener(type, listener));
124
- }
125
- root.langoBinding = this;
126
- }
127
- handle(event) {
128
- __requireArity(arguments.length, [0], "handle");
129
- event = __boundary(event);
130
- if (__requireBoolean(__normalize(this.#disposed))) {
131
- return null;
132
- }
133
- let root = __normalize(this.#form.element);
134
- let element = __normalize(event.target);
135
- let target = null;
136
- let current = element;
137
- __loop1: while (__requireBoolean(current !== null)) {
138
- if (__requireBoolean(__requireBoolean(__requireBoolean(__normalize(current.inert) === true) || __requireBoolean(__normalize(current.disabled) === true)) || __requireBoolean(__normalize(current.hidden) === true))) {
139
- return null;
140
- }
141
- if (__requireBoolean(current === root)) {
142
- break;
143
- }
144
- if (__requireBoolean(__normalize(current.langoFormRoot) === true)) {
145
- return null;
146
- }
147
- if (__requireBoolean(target === null)) {
148
- target = eventTarget(__normalize(this.#form.controls), current, [], __normalize(event.type));
149
- }
150
- current = __normalize(current.parentNode);
151
- }
152
- if (__requireBoolean(current !== root)) {
153
- return null;
154
- }
155
- if (__requireBoolean(__requireBoolean(__normalize(event.type) === "input") || __requireBoolean(__normalize(event.type) === "change"))) {
156
- validateEvent(__normalize(this.#form.controls), __normalize(event.target), root);
157
- }
158
- if (__requireBoolean(target === null)) {
159
- return null;
160
- }
161
- try {
162
- __normalize(event.preventDefault());
163
- if (__requireBoolean(__requireBoolean(__normalize(this.#errors) !== null) && __requireBoolean(__normalize(this.#errors.clear) !== null))) {
164
- __clear(this.#errors);
165
- }
166
- let session = __normalize(this.#session);
167
- return __normalize(session.send(__normalize(target.url), __normalize(event.type), __normalize(target.name))).catch(__withArity((error) => {
168
- error = __boundary(error);
169
- this.report(error);
170
- return null;
171
- }, [0], "closure"));
172
- } catch (error) {
173
- this.report(error);
174
- }
175
- return null;
176
- return null;
177
- }
178
- report(error) {
179
- const __contextScope = [];
180
- try {
181
- __requireArity(arguments.length, [0], "report");
182
- error = __boundary(error);
183
- if (__requireBoolean(__normalize(this.#disposed))) {
184
- return null;
185
- }
186
- if (__requireBoolean(__normalize(this.#errors) !== null)) {
187
- __normalize(this.#errors.error(error));
188
- } else {
189
- __normalize(__contextGet("log").err(error));
190
- }
191
- return null;
192
- return null;
193
- } finally {
194
- __contextRestore(__contextScope);
195
- }
196
- }
197
- dispose() {
198
- if (__requireBoolean(__normalize(this.#disposed))) {
199
- return null;
200
- }
201
- this.#disposed = true;
202
- let root = __normalize(this.#form.element);
203
- for (const type of ["click", "change", "input"]) {
204
- __normalize(root.removeEventListener(type, __normalize(this.#listener)));
205
- }
206
- root.langoBinding = null;
207
- return null;
208
- return null;
209
- }
210
- }
33
+ export let FileInput = FileInputClass;
211
34
 
212
- export class Renderer {
213
- #document;
214
- #types;
215
- constructor(document, types = null) {
216
- __requireArity(arguments.length, [0], "constructor");
217
- document = __boundary(document);
218
- types = __boundary(types);
219
- this.#document = document;
220
- this.#types = types;
221
- if (__requireBoolean(__normalize(this.#types) === null)) {
222
- this.#types = new Types();
223
- }
224
- }
225
- create(definition) {
226
- __requireArity(arguments.length, [0], "create");
227
- definition = __boundary(definition);
228
- return __normalize(this.#types.create(__normalize(this.#document), definition));
229
- return null;
230
- }
231
- release(control) {
232
- __requireArity(arguments.length, [0], "release");
233
- control = __boundary(control);
234
- releaseControl(control);
235
- return null;
236
- return null;
237
- }
238
- replace(old, replacement) {
239
- __requireArity(arguments.length, [0, 1], "replace");
240
- old = __boundary(old);
241
- replacement = __boundary(replacement);
242
- let element = __normalize(old.element);
243
- __normalize(element.parentNode.replaceChild(__normalize(replacement.element), element));
244
- return null;
245
- return null;
246
- }
247
- remove(control) {
248
- __requireArity(arguments.length, [0], "remove");
249
- control = __boundary(control);
250
- __remove(control.element);
251
- return null;
252
- return null;
253
- }
254
- capture(control) {
255
- __requireArity(arguments.length, [0], "capture");
256
- control = __boundary(control);
257
- let element = __normalize(control.element);
258
- return { element: element, parent: __normalize(element.parentNode), next: __normalize(element.nextSibling) };
259
- return null;
260
- }
261
- restore(snapshot, operation) {
262
- __requireArity(arguments.length, [0, 1], "restore");
263
- snapshot = __boundary(snapshot);
264
- operation = __boundary(operation);
265
- if (__requireBoolean(__normalize(operation.type) === "replace")) {
266
- let replacement = __normalize(operation.new);
267
- __remove(replacement.element);
268
- }
269
- if (__requireBoolean(__normalize(snapshot.parent) !== null)) {
270
- __normalize(snapshot.parent.insertBefore(__normalize(snapshot.element), __normalize(snapshot.next)));
271
- }
272
- return null;
273
- return null;
274
- }
275
- focus(control) {
276
- __requireArity(arguments.length, [0], "focus");
277
- control = __boundary(control);
278
- __normalize(control.element.focus());
279
- return null;
280
- return null;
281
- }
282
- toast(level, text) {
283
- __requireArity(arguments.length, [0, 1], "toast");
284
- level = __boundary(level);
285
- text = __boundary(text);
286
- let element = __normalize(this.#document.createElement("div"));
287
- __normalize(element.setAttribute("role", "status"));
288
- element.textContent = text;
289
- __normalize(this.#document.body.appendChild(element));
290
- return null;
291
- return null;
292
- }
293
- }
35
+ export let NumericInput = NumericInputClass;
294
36
 
295
- export class Control {
296
- name;
297
- element;
298
- controls;
299
- events;
300
- inherit;
301
- validates;
302
- confirms;
303
- #type;
304
- #value;
305
- #clean;
306
- #error;
307
- #pendingError;
308
- #rules;
309
- #tracked;
310
- #items;
311
- #classes;
312
- #style;
313
- constructor(document, definition, types = null, options = null) {
314
- __requireArity(arguments.length, [0, 1], "constructor");
315
- document = __boundary(document);
316
- definition = __boundary(definition);
317
- types = __boundary(types);
318
- options = __boundary(options);
319
- this.name = __normalize(definition.name);
320
- this.#type = __normalize(definition.type);
321
- this.controls = null;
322
- this.#value = __normalize(definition.value);
323
- this.#clean = null;
324
- this.#error = null;
325
- this.#pendingError = false;
326
- this.#rules = rulesFor(__normalize(definition.validation));
327
- this.#tracked = __normalize(definition.trackChanges);
328
- if (__requireBoolean(__normalize(this.#tracked) === null)) {
329
- this.#tracked = __requireBoolean(__requireBoolean(__normalize(this.#type) === "Text") || __requireBoolean(__normalize(this.#type) === "Select")) || __requireBoolean(__normalize(this.#type) === "Checkbox");
330
- }
331
- if (__requireBoolean(!__requireBoolean(__isBool(__normalize(this.#tracked))))) {
332
- throw "UiTrackChangesMustBeBoolean";
333
- }
334
- this.validates = __normalize(definition.validate);
335
- if (__requireBoolean(__normalize(this.validates) === null)) {
336
- this.validates = false;
337
- }
338
- if (__requireBoolean(!__requireBoolean(__isBool(__normalize(this.validates))))) {
339
- throw "UiValidateEventMustBeBoolean";
340
- }
341
- this.confirms = __normalize(definition.confirmDirty);
342
- if (__requireBoolean(__normalize(this.confirms) === null)) {
343
- this.confirms = false;
344
- }
345
- if (__requireBoolean(!__requireBoolean(__isBool(__normalize(this.confirms))))) {
346
- throw "UiConfirmDirtyMustBeBoolean";
347
- }
348
- this.#items = [];
349
- if (__requireBoolean(__normalize(this.#type) === "Select")) {
350
- this.#items = selectItems(__normalize(definition.options));
351
- }
352
- this.events = controlEvents(definition);
353
- this.inherit = normalizeInheritance(__normalize(definition.inherit));
354
- this.#classes = classNames(__normalize(definition.classes));
355
- this.#style = styleMap(__normalize(definition.style));
356
- let registry = types;
357
- if (__requireBoolean(registry === null)) {
358
- registry = new Types();
359
- }
360
- if (__requireBoolean(__requireBoolean(__normalize(definition.inherit) !== null) && __requireBoolean(__normalize(this.#type) !== "Form"))) {
361
- throw "UiInheritanceRequiresForm";
362
- }
363
- let tag = "div";
364
- if (__requireBoolean(__requireBoolean(__normalize(this.#type) === "Text") || __requireBoolean(__normalize(this.#type) === "Checkbox"))) {
365
- tag = "input";
366
- }
367
- if (__requireBoolean(__normalize(this.#type) === "Select")) {
368
- tag = "select";
369
- }
370
- if (__requireBoolean(__normalize(this.#type) === "Button")) {
371
- tag = "button";
372
- }
373
- if (__requireBoolean(options !== null)) {
374
- tag = __normalize(options.tag);
375
- if (__requireBoolean(__requireBoolean(!__requireBoolean(__isString(tag))) || __requireBoolean(tag === ""))) {
376
- throw "UiCustomControlRequiresTag";
377
- }
378
- }
379
- if (__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(options === null) && __requireBoolean(__normalize(this.#type) !== "Text")) && __requireBoolean(__normalize(this.#type) !== "Button")) && __requireBoolean(__normalize(this.#type) !== "Value")) && __requireBoolean(__normalize(this.#type) !== "Panel")) && __requireBoolean(__normalize(this.#type) !== "Container")) && __requireBoolean(__normalize(this.#type) !== "Form")) && __requireBoolean(__normalize(this.#type) !== "Select")) && __requireBoolean(__normalize(this.#type) !== "Checkbox"))) {
380
- throw "UiClientUnknownControlType";
381
- }
382
- this.element = __normalize(document.createElement(tag));
383
- let element = __normalize(this.element);
384
- if (__requireBoolean(__normalize(this.#type) === "Form")) {
385
- element.langoFormRoot = true;
386
- }
387
- if (__requireBoolean(__normalize(this.#type) === "Button")) {
388
- element.type = "button";
389
- element.textContent = __normalize(definition.text);
390
- }
391
- if (__requireBoolean(__normalize(this.#type) === "Value")) {
392
- element.hidden = true;
393
- }
394
- if (__requireBoolean(__normalize(this.#type) === "Checkbox")) {
395
- element.type = "checkbox";
396
- }
397
- if (__requireBoolean(__normalize(definition.label) !== null)) {
398
- if (__requireBoolean(!__requireBoolean(__isString(__normalize(definition.label))))) {
399
- throw "UiControlLabelMustBeString";
400
- }
401
- __normalize(element.setAttribute("aria-label", __normalize(definition.label)));
402
- }
403
- let container = __requireBoolean(__requireBoolean(__normalize(this.#type) === "Panel") || __requireBoolean(__normalize(this.#type) === "Container")) || __requireBoolean(__normalize(this.#type) === "Form");
404
- if (__requireBoolean(__requireBoolean(options !== null) && __requireBoolean(__normalize(options.container) === true))) {
405
- container = true;
406
- }
407
- if (__requireBoolean(container)) {
408
- this.controls = [];
409
- }
410
- try {
411
- if (__requireBoolean(__normalize(this.#type) === "Select")) {
412
- for (const item of __normalize(this.#items)) {
413
- let option = __normalize(document.createElement("option"));
414
- option.value = __normalize(item.value);
415
- option.textContent = __normalize(item.text);
416
- option.disabled = __normalize(item.disabled);
417
- __normalize(element.appendChild(option));
418
- }
419
- }
420
- if (__requireBoolean(__requireBoolean(container) && __requireBoolean(__isArray(__normalize(definition.controls))))) {
421
- for (const childDefinition of __normalize(definition.controls)) {
422
- let child = __normalize(registry.create(document, childDefinition));
423
- this.controls.push(child);
424
- __normalize(element.appendChild(__normalize(child.element)));
425
- }
426
- }
427
- if (__requireBoolean(__normalize(definition.classes) !== null)) {
428
- this.applyProperty("classes", __normalize(definition.classes));
429
- }
430
- if (__requireBoolean(__normalize(definition.style) !== null)) {
431
- this.applyProperty("style", __normalize(definition.style));
432
- }
433
- if (__requireBoolean(__normalize(definition.enabled) !== null)) {
434
- this.applyProperty("enabled", __normalize(definition.enabled));
435
- }
436
- if (__requireBoolean(__normalize(definition.visible) !== null)) {
437
- this.applyProperty("visible", __normalize(definition.visible));
438
- }
439
- let initial = __normalize(definition.value);
440
- if (__requireBoolean(__requireBoolean(__normalize(this.#type) === "Checkbox") && __requireBoolean(initial === null))) {
441
- initial = false;
442
- }
443
- this.setValue(initial);
444
- this.markClean();
445
- } catch (error) {
446
- if (__requireBoolean(__isArray(__normalize(this.controls)))) {
447
- for (const child of __normalize(this.controls)) {
448
- releaseControl(child);
449
- }
450
- }
451
- throw error;
452
- }
453
- }
454
- getValue() {
455
- if (__requireBoolean(__isArray(__normalize(this.controls)))) {
456
- return collectValues(__normalize(this.controls));
457
- }
458
- if (__normalize(this.#type) === "Text") {
459
- return __normalize(this.element.value);
460
- } else if (__normalize(this.#type) === "Checkbox") {
461
- return __normalize(this.element.checked);
462
- } else if (__normalize(this.#type) === "Select") {
463
- let index = __normalize(this.element.selectedIndex);
464
- if (__requireBoolean(__requireBoolean(index < 0) || __requireBoolean(index >= __normalize(this.#items.length)))) {
465
- return null;
466
- }
467
- return __normalize(__normalize(this.#items[index]).value);
468
- } else {
469
- return __normalize(this.#value);
470
- }
471
- return null;
472
- }
473
- setValue(value) {
474
- __requireArity(arguments.length, [0], "setValue");
475
- value = __boundary(value);
476
- if (__normalize(this.#type) === "Text") {
477
- let text = value;
478
- if (__requireBoolean(value === null)) {
479
- text = "";
480
- }
481
- this.element.value = text;
482
- } else if (__normalize(this.#type) === "Checkbox") {
483
- if (__requireBoolean(!__requireBoolean(__isBool(value)))) {
484
- throw "UiCheckboxValueMustBeBoolean";
485
- }
486
- this.element.checked = value;
487
- } else if (__normalize(this.#type) === "Select") {
488
- this.element.selectedIndex = selectIndex(__normalize(this.#items), value);
489
- }
490
- this.#value = value;
491
- if (__requireBoolean(__normalize(this.#error) !== null)) {
492
- this.validate();
493
- }
494
- return null;
495
- return null;
496
- }
497
- isDirty() {
498
- if (__requireBoolean(__isArray(__normalize(this.controls)))) {
499
- for (const child of __normalize(this.controls)) {
500
- if (__requireBoolean(__normalize(child.isDirty) !== null)) {
501
- if (__requireBoolean(__normalize(child.isDirty()))) {
502
- return true;
503
- }
504
- }
505
- }
506
- return false;
507
- }
508
- if (__requireBoolean(!__requireBoolean(__normalize(this.#tracked)))) {
509
- return false;
510
- }
511
- let current = __fromJson(__toJson(this.getValue()));
512
- return !__requireBoolean(sameValue(current, __normalize(this.#clean)));
513
- return null;
514
- }
515
- markClean() {
516
- if (__requireBoolean(__isArray(__normalize(this.controls)))) {
517
- for (const child of __normalize(this.controls)) {
518
- if (__requireBoolean(__normalize(child.markClean) !== null)) {
519
- __normalize(child.markClean());
520
- }
521
- }
522
- } else {
523
- this.acceptSaved(this.getValue());
524
- }
525
- return null;
526
- return null;
527
- }
528
- acceptSaved(value) {
529
- __requireArity(arguments.length, [0], "acceptSaved");
530
- value = __boundary(value);
531
- this.#clean = __fromJson(__toJson(value));
532
- return null;
533
- return null;
534
- }
535
- validate() {
536
- this.#pendingError = false;
537
- this.#error = validationMessage(__normalize(this.#rules), this.getValue());
538
- this.#renderError();
539
- return __normalize(this.#error);
540
- return null;
541
- }
542
- #renderError() {
543
- let text = __normalize(this.#error);
544
- if (__requireBoolean(text === null)) {
545
- text = "";
546
- }
547
- __normalize(this.element.setAttribute("aria-invalid", `${__normalize(this.#error) !== null}`));
548
- __normalize(this.element.setAttribute("data-lango-error", text));
549
- if (__requireBoolean(__normalize(this.element.setCustomValidity) !== null)) {
550
- __normalize(this.element.setCustomValidity(text));
551
- }
552
- return null;
553
- return null;
554
- }
555
- reportValidity() {
556
- if (__requireBoolean(__normalize(this.element.reportValidity) !== null)) {
557
- return __normalize(this.element.reportValidity());
558
- }
559
- return __normalize(this.#error) === null;
560
- return null;
561
- }
562
- reportPendingError() {
563
- if (__requireBoolean(!__requireBoolean(__normalize(this.#pendingError)))) {
564
- return false;
565
- }
566
- let current = __normalize(this.element);
567
- __loop2: while (__requireBoolean(current !== null)) {
568
- if (__requireBoolean(__requireBoolean(__requireBoolean(__normalize(current.disabled) === true) || __requireBoolean(__normalize(current.hidden) === true)) || __requireBoolean(__normalize(current.inert) === true))) {
569
- return false;
570
- }
571
- current = __normalize(current.parentNode);
572
- }
573
- this.#pendingError = false;
574
- this.reportValidity();
575
- return true;
576
- return null;
577
- }
578
- applyProperty(name, value) {
579
- __requireArity(arguments.length, [0, 1], "applyProperty");
580
- name = __boundary(name);
581
- value = __boundary(value);
582
- validateProperty(name, value);
583
- if (name === "enabled") {
584
- this.element.disabled = !__requireBoolean(value);
585
- this.element.inert = !__requireBoolean(value);
586
- } else if (name === "visible") {
587
- this.element.hidden = __requireBoolean(!__requireBoolean(value)) || __requireBoolean(__normalize(this.#type) === "Value");
588
- } else if (name === "classes") {
589
- this.#classes = classNames(value);
590
- this.element.className = __normalize(this.#classes.join(" "));
591
- } else if (name === "style") {
592
- let styles = styleMap(value);
593
- for (const [property, text] of __entries(__normalize(this.#style))) {
594
- __normalize(this.element.style.removeProperty(property));
595
- }
596
- for (const [property, text] of __entries(styles)) {
597
- __normalize(this.element.style.setProperty(property, text));
598
- }
599
- this.#style = styles;
600
- } else if (name === "savedValue") {
601
- this.acceptSaved(value);
602
- } else if (name === "error") {
603
- this.#error = value;
604
- this.#pendingError = value !== null;
605
- this.#renderError();
606
- this.reportPendingError();
607
- }
608
- return null;
609
- return null;
610
- }
611
- snapshotState() {
612
- return { value: __normalize(this.#value), text: __normalize(this.element.value), checked: __normalize(this.element.checked), selectedIndex: __normalize(this.element.selectedIndex), disabled: __normalize(this.element.disabled), hidden: __normalize(this.element.hidden), inert: __normalize(this.element.inert), classes: __normalize(this.element.className), style: __normalize(this.element.style.cssText), managedStyle: __normalize(this.#style), managedClasses: __normalize(this.#classes), clean: __normalize(this.#clean), error: __normalize(this.#error), pendingError: __normalize(this.#pendingError) };
613
- return null;
614
- }
615
- restoreState(snapshot) {
616
- __requireArity(arguments.length, [0], "restoreState");
617
- snapshot = __boundary(snapshot);
618
- this.setValue(__normalize(snapshot.value));
619
- if (__requireBoolean(__normalize(this.#type) === "Text")) {
620
- this.element.value = __normalize(snapshot.text);
621
- }
622
- if (__requireBoolean(__normalize(this.#type) === "Checkbox")) {
623
- this.element.checked = __normalize(snapshot.checked);
624
- }
625
- if (__requireBoolean(__normalize(this.#type) === "Select")) {
626
- this.element.selectedIndex = __normalize(snapshot.selectedIndex);
627
- }
628
- this.element.disabled = __normalize(snapshot.disabled);
629
- this.element.hidden = __normalize(snapshot.hidden);
630
- this.element.inert = __normalize(snapshot.inert);
631
- this.element.className = __normalize(snapshot.classes);
632
- this.element.style.cssText = __normalize(snapshot.style);
633
- this.#style = __normalize(snapshot.managedStyle);
634
- this.#classes = __normalize(snapshot.managedClasses);
635
- this.#clean = __normalize(snapshot.clean);
636
- this.#error = __normalize(snapshot.error);
637
- this.#pendingError = __normalize(snapshot.pendingError);
638
- this.#renderError();
639
- return null;
640
- return null;
641
- }
642
- dispose() {
643
- return null;
644
- return null;
645
- }
646
- }
647
- function validateEvent(controls, element, root) {
648
- __requireArity(arguments.length, [0, 1, 2], "validateEvent");
649
- controls = __boundary(controls);
650
- element = __boundary(element);
651
- root = __boundary(root);
652
- let current = element;
653
- __loop3: while (__requireBoolean(__requireBoolean(current !== null) && __requireBoolean(current !== root))) {
654
- let control = elementControl(controls, current);
655
- if (__requireBoolean(__requireBoolean(control !== null) && __requireBoolean(__normalize(control.validate) !== null))) {
656
- __normalize(control.validate());
657
- return null;
658
- }
659
- current = __normalize(current.parentNode);
660
- }
661
- return null;
662
- return null;
663
- }
37
+ export let DateInput = DateInputClass;
664
38
 
665
- function elementControl(controls, element) {
666
- __requireArity(arguments.length, [0, 1], "elementControl");
667
- controls = __boundary(controls);
668
- element = __boundary(element);
669
- for (const control of controls) {
670
- if (__requireBoolean(control.element.langoFormRoot === true)) {
671
- continue;
672
- }
673
- if (__requireBoolean(__normalize(control.element) === element)) {
674
- return control;
675
- }
676
- if (__requireBoolean(__isArray(__normalize(control.controls)))) {
677
- let found = elementControl(__normalize(control.controls), element);
678
- if (__requireBoolean(found !== null)) {
679
- return found;
680
- }
681
- }
682
- }
683
- return null;
684
- return null;
685
- }
39
+ export let Chip = ChipClass;
686
40
 
687
- function eventTarget(controls, element, parentPath, type) {
688
- __requireArity(arguments.length, [0, 1, 2, 3], "eventTarget");
689
- controls = __boundary(controls);
690
- element = __boundary(element);
691
- parentPath = __boundary(parentPath);
692
- type = __boundary(type);
693
- for (const control of controls) {
694
- let path = __normalize(parentPath.slice());
695
- if (__requireBoolean(__requireBoolean(__normalize(control.name) !== null) && __requireBoolean(__normalize(control.name) !== ""))) {
696
- path[__normalize(path.length)] = __normalize(control.name);
697
- }
698
- if (__requireBoolean(__normalize(control.element) === element)) {
699
- let events = __normalize(control.events);
700
- if (__requireBoolean(__includes(type, events))) {
701
- let name = path;
702
- if (__requireBoolean(__normalize(path.length) === 1)) {
703
- name = __normalize(path[0]);
704
- }
705
- if (__requireBoolean(__normalize(path.length) === 0)) {
706
- name = null;
707
- }
708
- return { url: __normalize(events[type]), name: name };
709
- }
710
- }
711
- if (__requireBoolean(__isArray(__normalize(control.controls)))) {
712
- let target = eventTarget(__normalize(control.controls), element, path, type);
713
- if (__requireBoolean(target !== null)) {
714
- return target;
715
- }
716
- }
717
- }
718
- return null;
719
- return null;
720
- }
41
+ export let ComboBox = ComboBoxClass;
721
42
 
722
- function controlEvents(definition) {
723
- __requireArity(arguments.length, [0], "controlEvents");
724
- definition = __boundary(definition);
725
- let type;
726
- let events = { };
727
- if (__requireBoolean(__normalize(definition.event) !== null)) {
728
- type = "change";
729
- if (__requireBoolean(__normalize(definition.type) === "Button")) {
730
- type = "click";
731
- }
732
- events[type] = __normalize(definition.event);
733
- }
734
- if (__requireBoolean(__normalize(definition.events) !== null)) {
735
- if (__requireBoolean(!__requireBoolean(__isObject(__normalize(definition.events))))) {
736
- throw "UiClientEventsMustBeMap";
737
- }
738
- for (const [type, url] of __entries(__normalize(definition.events))) {
739
- if (__requireBoolean(__requireBoolean(__requireBoolean(type !== "click") && __requireBoolean(type !== "change")) && __requireBoolean(type !== "input"))) {
740
- throw "UiClientUnsupportedEventType";
741
- }
742
- events[type] = url;
743
- }
744
- }
745
- for (const [type, url] of __entries(events)) {
746
- if (__requireBoolean(__requireBoolean(__requireBoolean(__requireBoolean(!__requireBoolean(__isString(url))) || __requireBoolean(!__requireBoolean(__normalize(url.startsWith("/"))))) || __requireBoolean(__normalize(url.startsWith("//")))) || __requireBoolean(__normalize(url.includes("\\"))))) {
747
- throw "UiClientEventRequiresSameOriginPath";
748
- }
749
- }
750
- return events;
751
- return null;
752
- }
43
+ export let Avatar = AvatarClass;
44
+
45
+ export let FormSpinner = FormSpinnerClass;
46
+
47
+ export let Button = ButtonClass;
48
+
49
+ export let InputGroup = InputGroupClass;
753
50
 
754
- function releaseControl(control) {
755
- const __contextScope = [];
756
- try {
757
- __requireArity(arguments.length, [0], "releaseControl");
758
- control = __boundary(control);
759
- if (__requireBoolean(__isArray(__normalize(control.controls)))) {
760
- for (const child of __normalize(control.controls)) {
761
- releaseControl(child);
762
- }
763
- }
764
- try {
765
- if (__requireBoolean(__normalize(control.dispose) !== null)) {
766
- __normalize(control.dispose());
767
- }
768
- } catch (error) {
769
- __normalize(__contextGet("log").err(`Control disposal failed: ${error}`));
770
- }
771
- return null;
772
- return null;
773
- } finally {
774
- __contextRestore(__contextScope);
775
- }
51
+ export let Markdown = MarkdownClass;
52
+
53
+ export let Accordion = AccordionClass;
54
+
55
+ export let AccordionItem = AccordionItemClass;
56
+
57
+ export let ListGroup = ListGroupClass;
58
+
59
+ export let Menu = MenuClass;
60
+
61
+ export let MenuItem = MenuItemClass;
62
+
63
+ export let Card = CardClass;
64
+
65
+ export let CardGroup = CardGroupClass;
66
+
67
+ export let Image = ImageClass;
68
+
69
+ export let Badge = BadgeClass;
70
+
71
+ export let Toolbar = ToolbarClass;
72
+
73
+ export let Table = TableClass;
74
+
75
+ export let TableHeader = TableHeaderClass;
76
+
77
+ export let TableRow = TableRowClass;
78
+
79
+ export let TableCell = TableCellClass;
80
+
81
+ export let TableCol = TableColClass;
82
+
83
+ export let TableDivider = TableDividerClass;
84
+
85
+ export let Tab = TabClass;
86
+
87
+ export let TabItem = TabItemClass;
88
+
89
+ export let Nav = NavClass;
90
+
91
+ export let NavBar = NavBarClass;
92
+
93
+ export let NavItem = NavItemClass;
94
+
95
+ export let NavBarItem = NavBarItemClass;
96
+
97
+ export let Breadcrumb = BreadcrumbClass;
98
+
99
+ export let BreadcrumbItem = BreadcrumbItemClass;
100
+
101
+ export let App = AppClass;
102
+
103
+ export let Form = FormClass;
104
+
105
+ export let BootstrapRenderer = RendererClass;
106
+
107
+ export let Control = ControlClass;
108
+
109
+ export let Value = ValueClass;
110
+
111
+ export let Field = FieldClass;
112
+
113
+ export let Input = InputClass;
114
+
115
+ export let Checkbox = CheckboxClass;
116
+
117
+ export let Switch = SwitchClass;
118
+
119
+ export let Range = RangeClass;
120
+
121
+ export let Select = SelectClass;
122
+
123
+ export let Radio = RadioClass;
124
+
125
+ export let Alert = AlertClass;
126
+
127
+ export let Progress = ProgressClass;
128
+
129
+ export let Toast = ToastClass;
130
+
131
+ export let ToastStack = ToastStackClass;
132
+
133
+ export let Dialog = DialogClass;
134
+ export function createTemplate(xml) {
135
+ __requireArity(arguments.length, [0], "createTemplate");
136
+ xml = __boundary(xml);
137
+ return makeTemplate(xml);
138
+ return null;
776
139
  }
777
140
 
778
- export function mount(document, root, definition, types = null) {
779
- __requireArity(arguments.length, [0, 1, 2], "mount");
780
- document = __boundary(document);
781
- root = __boundary(root);
782
- definition = __boundary(definition);
783
- types = __boundary(types);
784
- if (__requireBoolean(types === null)) {
785
- types = new Types();
786
- }
787
- let control = __normalize(types.create(document, definition));
788
- __normalize(root.appendChild(__normalize(control.element)));
789
- return control;
141
+ export function cloneTemplate(template) {
142
+ __requireArity(arguments.length, [0], "cloneTemplate");
143
+ template = __boundary(template);
144
+ return copyTemplate(template);
790
145
  return null;
791
146
  }
792
147
  //# sourceMappingURL=library.mjs.map