@componyx/ui 0.0.0-stage → 1.0.4

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 (169) hide show
  1. package/AppSkin/AppSkin.css +1268 -0
  2. package/AppSkin/AppSkin.js +2748 -0
  3. package/AppSkin/Themes/Default.css +241 -0
  4. package/Base/Base.js +3407 -0
  5. package/Base/ComponentIcons.css +66 -0
  6. package/Base/Font/ComponentIcons.woff +0 -0
  7. package/Base/Font/UI.woff +0 -0
  8. package/Base/Library.js +8432 -0
  9. package/Base/NavigationManager.js +462 -0
  10. package/Base/ResponsiveTemplates.js +371 -0
  11. package/Base/Sanitizer.js +288 -0
  12. package/Base/Themes/Default.css +255 -0
  13. package/Base/UI.css +618 -0
  14. package/Base/UIResourcePath.js +6 -0
  15. package/Bindary/Bindary.js +2011 -0
  16. package/Bindary/Modules/Connection.js +216 -0
  17. package/Bindary/Modules/Core.js +854 -0
  18. package/Bindary/Modules/DataUpdater.js +351 -0
  19. package/Bindary/Modules/ExpressionEngine.js +347 -0
  20. package/Bindary/Modules/ProxyManager.js +482 -0
  21. package/Bindary/Modules/Renderer.js +605 -0
  22. package/Bindary/Modules/Router.js +291 -0
  23. package/Bindary/Modules/Scroller.js +89 -0
  24. package/Bindary/Modules/Template.js +1273 -0
  25. package/BookmarkSpy/BookmarkSpy.js +430 -0
  26. package/Box/Box.css +36 -0
  27. package/Box/Box.js +1685 -0
  28. package/Button/Button.css +470 -0
  29. package/Button/Button.js +1398 -0
  30. package/Button/Themes/Default.css +200 -0
  31. package/Carousel/Carousel.css +273 -0
  32. package/Carousel/Carousel.js +607 -0
  33. package/ColorButton/ColorButton.css +39 -0
  34. package/ColorButton/ColorButton.js +336 -0
  35. package/ColorPicker/ColorPicker.css +359 -0
  36. package/ColorPicker/ColorPicker.js +972 -0
  37. package/ComboBox/ComboBox.css +357 -0
  38. package/ComboBox/ComboBox.js +2342 -0
  39. package/ComboBox/Themes/Default.css +23 -0
  40. package/DataPager/DataPager.css +72 -0
  41. package/DataPager/DataPager.js +674 -0
  42. package/DatePicker/DatePicker.css +227 -0
  43. package/DatePicker/DatePicker.js +1531 -0
  44. package/DatePicker/Themes/Default.css +26 -0
  45. package/Dialog/Dialog.css +106 -0
  46. package/Dialog/Dialog.js +572 -0
  47. package/Dialog/Themes/Default.css +10 -0
  48. package/Editor/Data/Emoji.json +8285 -0
  49. package/Editor/Data/Special.json +1042 -0
  50. package/Editor/Editor.css +1562 -0
  51. package/Editor/Editor.js +4058 -0
  52. package/Editor/Font/Editor.woff +0 -0
  53. package/Editor/Modules/ComponentFactory.js +565 -0
  54. package/Editor/Modules/ContentManager.js +748 -0
  55. package/Editor/Modules/DialogManager.js +1234 -0
  56. package/Editor/Modules/EventManager.js +458 -0
  57. package/Editor/Modules/Format.js +950 -0
  58. package/Editor/Modules/History.js +191 -0
  59. package/Editor/Modules/LayoutState.js +379 -0
  60. package/Editor/Modules/ListManager.js +296 -0
  61. package/Editor/Modules/MenuManager.js +388 -0
  62. package/Editor/Modules/NodeManager.js +681 -0
  63. package/Editor/Modules/ParagraphButtons.js +122 -0
  64. package/Editor/Modules/Resizer.js +176 -0
  65. package/Editor/Modules/SelectionRange.js +564 -0
  66. package/Editor/Modules/SourceViewBuilder.js +212 -0
  67. package/Editor/Modules/SymbolPicker.js +208 -0
  68. package/Editor/Modules/Table.js +2327 -0
  69. package/Editor/Modules/TableDialog.js +757 -0
  70. package/Editor/Modules/Toolbar.js +375 -0
  71. package/Editor/Modules/TooltipMenu.js +125 -0
  72. package/Editor/Modules/Utility.js +131 -0
  73. package/Editor/Themes/Default.css +204 -0
  74. package/FileUpload/FileUpload.css +156 -0
  75. package/FileUpload/FileUpload.js +898 -0
  76. package/FileUpload/Themes/Default.css +17 -0
  77. package/Form/Form.css +1934 -0
  78. package/Form/Form.js +4943 -0
  79. package/Form/Modules/ActionManager.js +368 -0
  80. package/Form/Modules/BuildPanelManager.js +319 -0
  81. package/Form/Modules/ComponentFactory.js +468 -0
  82. package/Form/Modules/ComponentPanel.js +265 -0
  83. package/Form/Modules/ConfigPanelManager.js +685 -0
  84. package/Form/Modules/DataBinder.js +602 -0
  85. package/Form/Modules/DataObserver.js +717 -0
  86. package/Form/Modules/Draggable.js +756 -0
  87. package/Form/Modules/OptionsPanel.js +342 -0
  88. package/Form/Modules/Renderer.js +1889 -0
  89. package/Form/Modules/RuleEngine.js +585 -0
  90. package/Form/Modules/RulesPanel.js +1158 -0
  91. package/Form/Modules/Types.js +1709 -0
  92. package/Form/Modules/ValidationManager.js +194 -0
  93. package/Form/Themes/Default.css +216 -0
  94. package/FormField/FormField.css +468 -0
  95. package/FormField/FormField.js +576 -0
  96. package/FormField/Themes/Default.css +99 -0
  97. package/Grid/Grid.css +544 -0
  98. package/Grid/Grid.js +3761 -0
  99. package/Grid/Themes/Default.css +43 -0
  100. package/LICENSE +126 -0
  101. package/MaskedTextBox/MaskedTextBox.css +28 -0
  102. package/MaskedTextBox/MaskedTextBox.js +642 -0
  103. package/MaskedTextBox/Themes/Default.css +6 -0
  104. package/Menu/Menu.css +328 -0
  105. package/Menu/Menu.js +2386 -0
  106. package/Menu/Themes/Default.css +24 -0
  107. package/NumericBox/NumericBox.css +120 -0
  108. package/NumericBox/NumericBox.js +984 -0
  109. package/PanelBar/PanelBar.css +123 -0
  110. package/PanelBar/PanelBar.js +505 -0
  111. package/PanelBar/Themes/Default.css +51 -0
  112. package/PieChart/PieChart.css +95 -0
  113. package/PieChart/PieChart.js +820 -0
  114. package/PieChart/Themes/Default.css +9 -0
  115. package/README.md +178 -3
  116. package/Slider/Slider.css +348 -0
  117. package/Slider/Slider.js +1306 -0
  118. package/Slider/Themes/Default.css +44 -0
  119. package/TabStrip/TabStrip.css +52 -0
  120. package/TabStrip/TabStrip.js +362 -0
  121. package/TabStrip/Themes/Default.css +35 -0
  122. package/TimePicker/Themes/Default.css +30 -0
  123. package/TimePicker/TimePicker.css +253 -0
  124. package/TimePicker/TimePicker.js +1485 -0
  125. package/TooltipManager/Themes/Default.css +21 -0
  126. package/TooltipManager/TooltipManager.css +227 -0
  127. package/TooltipManager/TooltipManager.js +791 -0
  128. package/Validator/Validator.css +54 -0
  129. package/Validator/Validator.js +2508 -0
  130. package/componyx.html-data.json +619 -0
  131. package/index.js +27 -0
  132. package/package.json +43 -4
  133. package/types/AppSkin.d.ts +842 -0
  134. package/types/Base.d.ts +1034 -0
  135. package/types/Bindary.d.ts +1196 -0
  136. package/types/BookmarkSpy.d.ts +112 -0
  137. package/types/Box.d.ts +374 -0
  138. package/types/Button.d.ts +455 -0
  139. package/types/Carousel.d.ts +136 -0
  140. package/types/ColorButton.d.ts +120 -0
  141. package/types/ColorPicker.d.ts +225 -0
  142. package/types/ComboBox.d.ts +507 -0
  143. package/types/DataPager.d.ts +152 -0
  144. package/types/DatePicker.d.ts +354 -0
  145. package/types/Dialog.d.ts +160 -0
  146. package/types/Editor.d.ts +1289 -0
  147. package/types/FileUpload.d.ts +206 -0
  148. package/types/Form.d.ts +3078 -0
  149. package/types/FormField.d.ts +204 -0
  150. package/types/Grid.d.ts +911 -0
  151. package/types/Library.d.ts +1899 -0
  152. package/types/MaskedTextBox.d.ts +91 -0
  153. package/types/Menu.d.ts +577 -0
  154. package/types/NumericBox.d.ts +310 -0
  155. package/types/PanelBar.d.ts +223 -0
  156. package/types/PieChart.d.ts +224 -0
  157. package/types/ResponsiveTemplates.d.ts +108 -0
  158. package/types/Slider.d.ts +227 -0
  159. package/types/TabStrip.d.ts +185 -0
  160. package/types/TimePicker.d.ts +265 -0
  161. package/types/TooltipManager.d.ts +178 -0
  162. package/types/UI.d.ts +29 -0
  163. package/types/Validator.d.ts +653 -0
  164. package/types/index.d.ts +59 -0
  165. package/ui.css +11783 -0
  166. package/ui.js +79477 -0
  167. package/ui.min.css +138 -0
  168. package/ui.min.js +264 -0
  169. package/ui.min.js.map +1 -0
@@ -0,0 +1,291 @@
1
+ /*! Componyx.UI | (c) E.H. Daanen / Componyx | BUSL-1.1 | componyx.com/license */
2
+ await (async function ()
3
+ {
4
+ await import(`${$UI.getScriptResourcePath('Base.Bindary.Core')}`);
5
+ await import(`${$UI.getScriptResourcePath('Base.Bindary.Connection')}`);
6
+ await import(`${$UI.getScriptResourcePath('Base.Bindary.DataUpdater')}`);
7
+ const core = componyx.bindary_modules.core;
8
+ const connection = componyx.bindary_modules.connection;
9
+ const dataUpdater = componyx.bindary_modules.dataUpdater;
10
+
11
+ const router = componyx.bindary_modules.router =
12
+ {
13
+ getRouteIndex: function (routePath)
14
+ {
15
+ if (routePath == null)
16
+ return -1;
17
+
18
+ let path, match, index = -1;
19
+
20
+ while (!match && ++index < $bindary.routes.length)
21
+ {
22
+ path = $bindary.routes[index].path;
23
+
24
+ if ($bindary.routes[index].pathExp)
25
+ match = routePath.match(path);
26
+ else
27
+ match = path === routePath;
28
+ }
29
+
30
+ if (match)
31
+ return index;
32
+ else
33
+ return -1;
34
+ },
35
+ load: function (routePath)
36
+ {
37
+ core.routeError = false;
38
+
39
+ let routeIndex = router.getRouteIndex(routePath);
40
+
41
+ router.trackHistory(routePath);
42
+
43
+ if (routeIndex == -1)
44
+ {
45
+ if ($bindary.routes.length && routePath) // with routes defined, a path that matches none of them is an error
46
+ router.error({ type: 'route', routePath: routePath });
47
+
48
+ return routeIndex;
49
+ }
50
+
51
+ if ($lib.isEmpty($bindary.routeIndex)) // first load
52
+ core.createTempViewContainer();
53
+ else if (router.unload($bindary.routeIndex, routePath) === false) // cancel unload when return value is false
54
+ return;
55
+
56
+ let route = $bindary.routes[routeIndex],
57
+ observing = ($lib.isEmpty(route.observing)) ? $bindary.observing : route.observing,
58
+ data = route.data,
59
+ viewURL = (core.parseExp(route, routePath, route.viewURL) || route.viewURL || ''),
60
+ controllerURL = (core.parseExp(route, routePath, route.controllerURL) || route.controllerURL || '');
61
+
62
+ // new route callback id
63
+ core.routeCallbackId = $lib.guid();
64
+
65
+ // store current route URL's
66
+ core.viewURL = (viewURL) ? $bindary.viewRootURL + viewURL : '';
67
+ core.controllerURL = (controllerURL) ? $bindary.controllerRootURL + controllerURL : '';
68
+
69
+ core.busy = true;
70
+ $bindary.route = route;
71
+ $bindary.routeIndex = routeIndex;
72
+ $bindary.routePath = routePath;
73
+ $bindary.controller = core.cache.controller[core.controllerURL];
74
+
75
+ core.routeRdy[routeIndex] = false;
76
+ core.data = undefined;
77
+ core.preLoad();
78
+
79
+ $bindary.routeData = core.cache.routeData[routeIndex] = (core.cache.routeData[routeIndex]) ? core.cache.routeData[routeIndex] : (observing) ? $bindary.observe({}, core.dataLabel[1]) : {};
80
+ $bindary.viewData = core.cache.viewData[routePath] = (core.cache.viewData[routePath]) ? core.cache.viewData[routePath] : (observing) ? $bindary.observe({}, core.dataLabel[2]) : {};
81
+
82
+ if (core.controllerURL && $bindary.controller)
83
+ core.srcState(core.controllerURL, true);
84
+
85
+ if (core.viewURL)
86
+ {
87
+ core.srcState(core.viewURL, false);
88
+
89
+ if (!core.cache.view[core.viewURL])
90
+ {
91
+ core.xhr.push($lib.load({
92
+ url: core.viewURL,
93
+ onSuccess: function (args)
94
+ {
95
+ core.srcState(core.viewURL, true);
96
+ core.cache.view[core.viewURL] =
97
+ {
98
+ data: args.data,
99
+ html: core.tempViewContainer.innerHTML,
100
+ script: args.script,
101
+ css: args.css,
102
+ title: args.title
103
+ };
104
+
105
+ core.tempViewContainer.innerHTML = '';
106
+ router.loaded();
107
+ },
108
+ onError: (args) => { router.error({ type: 'view', status: args.xhr?.status, url: core.viewURL }); }
109
+ }, core.tempViewContainer, null));
110
+ }
111
+ else
112
+ {
113
+ $lib.addHTML(core.cache.view[core.viewURL].data, null, null, function (args)
114
+ {
115
+ core.srcState(core.viewURL, true);
116
+ core.cache.view[core.viewURL].script = args.script;
117
+ core.cache.view[core.viewURL].css = args.css;
118
+ core.tempViewContainer.innerHTML = '';
119
+ router.loaded();
120
+ });
121
+ }
122
+ }
123
+
124
+ if (!$bindary.controller)
125
+ {
126
+ $bindary.controller = core.cache.controller[core.controllerURL] = {};
127
+
128
+ if (core.controllerURL)
129
+ {
130
+ core.srcState(core.controllerURL, false);
131
+ $lib.addScriptSource(core.controllerURL, null,
132
+ {
133
+ onComplete: function (args)
134
+ {
135
+ core.srcState(core.controllerURL, true);
136
+ router.loaded();
137
+ },
138
+ onError: function (args)
139
+ {
140
+ delete core.cache.controller[core.controllerURL]; // retry on a next visit instead of caching an empty controller
141
+ router.error({ type: 'controller', url: core.controllerURL });
142
+ }
143
+ });
144
+ }
145
+ }
146
+
147
+ let param =
148
+ {
149
+ dataRequest: connection.createDataRequestMsg(data, route.dataServerLoad, core.routeCallbackId, true),
150
+ routeReady: function (data) { router.loaded(data); }
151
+ };
152
+
153
+ if (core.fireEvent('dataRequest', [param]) !== false)
154
+ {
155
+ if (route.dataConnect != false && $bindary.dataServerURL)
156
+ connection.dataSend(param.dataRequest); // use default data retrieval
157
+ else
158
+ router.loaded(null); // no data source
159
+ }
160
+ },
161
+ loaded: function (dataMsg)
162
+ {
163
+ if (core.routeError)
164
+ return;
165
+
166
+ if (dataMsg !== undefined)
167
+ core.data = dataMsg;
168
+
169
+ if (core.data !== undefined && (!core.viewURL || core.cache.srcReady[core.viewURL]) && (!core.controllerURL || core.cache.srcReady[core.controllerURL]))
170
+ {
171
+ let error = router.isError(core.data);
172
+
173
+ core.busy = false;
174
+
175
+ if (core.data && !core.isRouteCallback(core.data) && !error) // null value means no data-source
176
+ return;
177
+
178
+ if (!error)
179
+ core.load();
180
+
181
+ dataUpdater.update(core.data);
182
+ }
183
+ },
184
+ unload: function (routeIndex, routePath, windowUnload)
185
+ {
186
+ let advance = core.fireEvent('unload', [routeIndex, routePath, windowUnload]);
187
+
188
+ if (advance === false)
189
+ {
190
+ window.history.replaceState({ routePath: $bindary.routePath }, '', getFullPath($bindary.routePath)); // rewrite URL to previous one
191
+ return advance;
192
+ }
193
+
194
+ // clear timers
195
+ clearTimeout(core.liveBindTimerId);
196
+ core.clearPendingUpdate();
197
+
198
+ // abort active xhr's
199
+ $lib.each(core.xhr, function (xhr) { xhr.abort(true); });
200
+
201
+ if (!$bindary.caching)
202
+ $bindary.clearCache();
203
+ else
204
+ {
205
+ if (!$bindary.cacheRouteData)
206
+ delete core.cache.routeData[$bindary.routeIndex];
207
+
208
+ if (!$bindary.cacheViewData)
209
+ delete core.cache.viewData[$bindary.routePath];
210
+
211
+ if (!$bindary.cacheInternalTags)
212
+ $bindary.clearCache(true, true, true, false, false);
213
+ }
214
+
215
+ core.viewURL = core.controllerURL = null;
216
+ core.callbacks = {};
217
+ core.viewTree = null;
218
+ core.xhr = []; // clear xhr array
219
+
220
+ if ($bindary.clearViewOnUnload && core.getViewContainer())
221
+ core.getViewContainer().innerHTML = '';
222
+
223
+ if ($bindary.route && $bindary.route.dataServerUnload)
224
+ {
225
+ if (windowUnload)
226
+ $bindary.unload(null, $bindary.route.dataServerUnload);
227
+ else
228
+ $bindary.dataSend(null, $bindary.route.dataServerUnload, null, null, false);
229
+ }
230
+ },
231
+ error: function (info)
232
+ {
233
+ if (core.routeError) // report only the first failure of a route load, view and controller may both fail
234
+ return;
235
+
236
+ core.routeError = true;
237
+ core.busy = false; // the route load has ended, so a next navigation (including Back) can proceed
238
+
239
+ if (core.tempViewContainer)
240
+ core.tempViewContainer.innerHTML = '';
241
+
242
+ $lib.each(core.xhr, (xhr) => { xhr.abort(true); }); // stop the remaining requests of this route
243
+
244
+ core.fireEvent('routeError', [Object.assign({ routePath: $bindary.routePath, route: $bindary.route }, info)]);
245
+ },
246
+ trackHistory: function (routePath)
247
+ {
248
+ core.historyAction = false;
249
+
250
+ if (core.allowHistoryScroll && window.history.length == core.historyLength && $bindary.routePath != routePath)
251
+ core.historyAction = true;
252
+
253
+ if ($lib.isEmpty($bindary.routeIndex)) // first load
254
+ {
255
+ let pos = window.JSON.parse(window.sessionStorage.getItem('scrollPosition'));
256
+
257
+ if (pos && pos.path === routePath)
258
+ {
259
+ core.historyAction = true;
260
+ core.scrollPos[routePath] = pos;
261
+ }
262
+ else
263
+ core.historyAction = false;
264
+ }
265
+
266
+ core.historyLength = window.history.length;
267
+ core.allowHistoryScroll = !$bindary.prettyURL; // defaults to true for hash routes and to false for prettyURL's
268
+ },
269
+ isError(dataMsg)
270
+ {
271
+ let isError = false;
272
+
273
+ if (!dataMsg)
274
+ return;
275
+
276
+ if (!$lib.isArray(dataMsg))
277
+ dataMsg = [dataMsg];
278
+
279
+ $lib.each(dataMsg, function (msg)
280
+ {
281
+ return !(isError = (msg.isError) ? true : false); // break when error is found
282
+ });
283
+
284
+ return isError;
285
+ }
286
+ };
287
+ })();
288
+
289
+ var Router = componyx.bindary_modules.router;
290
+
291
+ export { Router as default };
@@ -0,0 +1,89 @@
1
+ /*! Componyx.UI | (c) E.H. Daanen / Componyx | BUSL-1.1 | componyx.com/license */
2
+ await (async function ()
3
+ {
4
+ await import(`${$UI.getScriptResourcePath('Base.Bindary.Core')}`);
5
+ const core = componyx.bindary_modules.core;
6
+
7
+ const scroller = componyx.bindary_modules.scroller =
8
+ {
9
+ routePath: '',
10
+ timeout: null,
11
+ anchor: null,
12
+ pos: null,
13
+ timerId: null,
14
+
15
+ init(anchorScroll, routePath)
16
+ {
17
+ const pos = core.scrollPos[$bindary.routePath];
18
+
19
+ scroller.routePath = routePath;
20
+ core.scrollableRoot = core.scrollableRoot || $lib.scrollableRoot();
21
+ core.scrollableRoot.scrollTop = 0;
22
+ clearTimeout(scroller.timerId);
23
+ scroller.timeout = new Date().getTime() + $bindary.scrollRetryTimeout;
24
+
25
+ if (!core.historyAction)
26
+ {
27
+ if (anchorScroll || $bindary.anchorScroll)
28
+ {
29
+ scroller.anchor = core.getAnchor();
30
+
31
+ if (scroller.anchor)
32
+ {
33
+ scroller.timerId = setTimeout(scroller.scrollToAnchor, 0);
34
+ }
35
+ }
36
+
37
+ return;
38
+ }
39
+
40
+ if (!pos || !(pos.y + pos.x)) return;
41
+
42
+ scroller.pos = pos;
43
+ scroller.timerId = setTimeout(scroller.scrollToPosition, 0);
44
+ },
45
+
46
+ scrollToAnchor()
47
+ {
48
+ let el;
49
+ const { routePath, timeout, anchor } = scroller;
50
+
51
+ if ($bindary.routePath !== routePath) return;
52
+
53
+ if ((el = $lib('#' + anchor)) || (el = document.getElementsByName(anchor)[0]))
54
+ {
55
+ if (core.fireEvent('anchorScroll', [el], true) !== false)
56
+ {
57
+ $lib.scrollTo(el, null, 2);
58
+ }
59
+ } else if (new Date().getTime() <= timeout)
60
+ {
61
+ scroller.timerId = setTimeout(scroller.scrollToAnchor, 0);
62
+ }
63
+ },
64
+
65
+ scrollToPosition()
66
+ {
67
+ const { routePath, timeout, pos } = scroller;
68
+
69
+ if ($bindary.routePath !== routePath || !core.historyAction) return;
70
+
71
+ const height = core.scrollableRoot.scrollHeight;
72
+ const width = core.scrollableRoot.scrollWidth;
73
+
74
+ if (new Date().getTime() > timeout || (width >= pos.width && height >= pos.height))
75
+ {
76
+ window.scrollTo(pos.x, pos.y);
77
+ core.historyAction = false;
78
+ } else
79
+ {
80
+ scroller.timerId = setTimeout(scroller.scrollToPosition, 0);
81
+ }
82
+ }
83
+ };
84
+
85
+ })();
86
+
87
+ var Scroller = componyx.bindary_modules.scroller;
88
+
89
+ export { Scroller as default };