x4js 1.5.18 → 1.5.20

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 (242) hide show
  1. package/lib/{README.md → README.txt} +0 -0
  2. package/lib/cjs/index.js +39 -103
  3. package/lib/cjs/index.js.map +7 -0
  4. package/lib/esm/index.mjs +39 -87
  5. package/lib/esm/index.mjs.map +7 -0
  6. package/lib/{license.md → licence.md} +0 -0
  7. package/lib/src/MIT-license.md +14 -0
  8. package/lib/{types/action.d.ts → src/action.ts} +64 -33
  9. package/lib/src/alpha.jpg +0 -0
  10. package/lib/src/app_sockets.ts +81 -0
  11. package/lib/src/application.ts +251 -0
  12. package/lib/src/autocomplete.ts +197 -0
  13. package/lib/src/base64.ts +166 -0
  14. package/lib/src/base_component.ts +152 -0
  15. package/lib/src/button.ts +355 -0
  16. package/lib/src/calendar.ts +328 -0
  17. package/lib/src/canvas.ts +505 -0
  18. package/lib/src/cardview.ts +227 -0
  19. package/lib/src/checkbox.ts +188 -0
  20. package/lib/src/color.ts +752 -0
  21. package/lib/src/colorpicker.ts +1639 -0
  22. package/lib/src/combobox.ts +465 -0
  23. package/lib/src/component.ts +2329 -0
  24. package/lib/{esm/dom_events.js → src/copyright.txt} +27 -29
  25. package/lib/src/datastore.ts +1322 -0
  26. package/lib/src/dialog.ts +656 -0
  27. package/lib/src/dom_events.ts +315 -0
  28. package/lib/src/drag_manager.ts +199 -0
  29. package/lib/src/drawtext.ts +355 -0
  30. package/lib/src/fileupload.ts +213 -0
  31. package/lib/src/form.ts +375 -0
  32. package/lib/src/formatters.ts +105 -0
  33. package/lib/src/gridview.ts +1185 -0
  34. package/lib/src/i18n.ts +346 -0
  35. package/lib/src/icon.ts +335 -0
  36. package/lib/src/image.ts +204 -0
  37. package/lib/src/index.ts +89 -0
  38. package/lib/src/input.ts +249 -0
  39. package/lib/src/label.ts +128 -0
  40. package/lib/src/layout.ts +430 -0
  41. package/lib/src/link.ts +86 -0
  42. package/lib/src/listview.ts +765 -0
  43. package/lib/{esm/md5.js → src/md5.ts} +438 -403
  44. package/lib/src/menu.ts +425 -0
  45. package/lib/src/messagebox.ts +224 -0
  46. package/lib/src/panel.ts +86 -0
  47. package/lib/src/popup.ts +494 -0
  48. package/lib/src/property_editor.ts +337 -0
  49. package/lib/src/radiobtn.ts +197 -0
  50. package/lib/src/rating.ts +135 -0
  51. package/lib/src/request.ts +300 -0
  52. package/lib/src/router.ts +185 -0
  53. package/lib/src/settings.ts +77 -0
  54. package/lib/src/sidebarview.ts +103 -0
  55. package/lib/src/spreadsheet.ts +1449 -0
  56. package/lib/src/styles.ts +343 -0
  57. package/lib/src/svgcomponent.ts +577 -0
  58. package/lib/src/tabbar.ts +151 -0
  59. package/lib/src/tabview.ts +110 -0
  60. package/lib/src/textarea.ts +235 -0
  61. package/lib/src/textedit.ts +544 -0
  62. package/lib/src/toaster.ts +80 -0
  63. package/lib/src/tools.ts +1473 -0
  64. package/lib/src/tooltips.ts +191 -0
  65. package/lib/src/treeview.ts +716 -0
  66. package/lib/{esm/version.js → src/version.ts} +30 -29
  67. package/lib/{styles → src}/x4.less +0 -0
  68. package/lib/src/x4dom.ts +57 -0
  69. package/lib/src/x4events.ts +585 -0
  70. package/lib/src/x4react.ts +90 -0
  71. package/package.json +52 -46
  72. package/lib/cjs/action.js +0 -58
  73. package/lib/cjs/app_sockets.js +0 -74
  74. package/lib/cjs/application.js +0 -182
  75. package/lib/cjs/autocomplete.js +0 -155
  76. package/lib/cjs/base_component.js +0 -124
  77. package/lib/cjs/button.js +0 -263
  78. package/lib/cjs/calendar.js +0 -254
  79. package/lib/cjs/canvas.js +0 -361
  80. package/lib/cjs/cardview.js +0 -161
  81. package/lib/cjs/checkbox.js +0 -139
  82. package/lib/cjs/color.js +0 -591
  83. package/lib/cjs/colorpicker.js +0 -1468
  84. package/lib/cjs/combobox.js +0 -349
  85. package/lib/cjs/component.js +0 -1719
  86. package/lib/cjs/datastore.js +0 -985
  87. package/lib/cjs/dialog.js +0 -478
  88. package/lib/cjs/dom_events.js +0 -30
  89. package/lib/cjs/drag_manager.js +0 -145
  90. package/lib/cjs/drawtext.js +0 -276
  91. package/lib/cjs/fileupload.js +0 -167
  92. package/lib/cjs/form.js +0 -304
  93. package/lib/cjs/formatters.js +0 -90
  94. package/lib/cjs/gridview.js +0 -881
  95. package/lib/cjs/i18n.js +0 -266
  96. package/lib/cjs/icon.js +0 -272
  97. package/lib/cjs/image.js +0 -157
  98. package/lib/cjs/input.js +0 -174
  99. package/lib/cjs/label.js +0 -95
  100. package/lib/cjs/layout.js +0 -322
  101. package/lib/cjs/link.js +0 -64
  102. package/lib/cjs/listview.js +0 -546
  103. package/lib/cjs/md5.js +0 -403
  104. package/lib/cjs/menu.js +0 -301
  105. package/lib/cjs/messagebox.js +0 -177
  106. package/lib/cjs/panel.js +0 -68
  107. package/lib/cjs/popup.js +0 -383
  108. package/lib/cjs/property_editor.js +0 -252
  109. package/lib/cjs/radiobtn.js +0 -140
  110. package/lib/cjs/rating.js +0 -102
  111. package/lib/cjs/request.js +0 -246
  112. package/lib/cjs/router.js +0 -139
  113. package/lib/cjs/settings.js +0 -69
  114. package/lib/cjs/sidebarview.js +0 -82
  115. package/lib/cjs/spreadsheet.js +0 -1084
  116. package/lib/cjs/styles.js +0 -275
  117. package/lib/cjs/svgcomponent.js +0 -447
  118. package/lib/cjs/tabbar.js +0 -111
  119. package/lib/cjs/tabview.js +0 -85
  120. package/lib/cjs/textarea.js +0 -165
  121. package/lib/cjs/textedit.js +0 -415
  122. package/lib/cjs/toaster.js +0 -64
  123. package/lib/cjs/tools.js +0 -1197
  124. package/lib/cjs/tooltips.js +0 -157
  125. package/lib/cjs/treeview.js +0 -535
  126. package/lib/cjs/version.js +0 -32
  127. package/lib/cjs/x4dom.js +0 -32
  128. package/lib/cjs/x4events.js +0 -384
  129. package/lib/cjs/x4react.js +0 -72
  130. package/lib/esm/action.js +0 -53
  131. package/lib/esm/app_sockets.js +0 -70
  132. package/lib/esm/application.js +0 -184
  133. package/lib/esm/autocomplete.js +0 -155
  134. package/lib/esm/base_component.js +0 -107
  135. package/lib/esm/button.js +0 -257
  136. package/lib/esm/calendar.js +0 -249
  137. package/lib/esm/canvas.js +0 -358
  138. package/lib/esm/cardview.js +0 -159
  139. package/lib/esm/checkbox.js +0 -134
  140. package/lib/esm/color.js +0 -588
  141. package/lib/esm/colorpicker.js +0 -1475
  142. package/lib/esm/combobox.js +0 -351
  143. package/lib/esm/component.js +0 -1711
  144. package/lib/esm/datastore.js +0 -990
  145. package/lib/esm/dialog.js +0 -490
  146. package/lib/esm/drag_manager.js +0 -147
  147. package/lib/esm/drawtext.js +0 -271
  148. package/lib/esm/fileupload.js +0 -163
  149. package/lib/esm/form.js +0 -304
  150. package/lib/esm/formatters.js +0 -81
  151. package/lib/esm/gridview.js +0 -889
  152. package/lib/esm/i18n.js +0 -257
  153. package/lib/esm/icon.js +0 -261
  154. package/lib/esm/image.js +0 -154
  155. package/lib/esm/input.js +0 -182
  156. package/lib/esm/label.js +0 -90
  157. package/lib/esm/layout.js +0 -310
  158. package/lib/esm/link.js +0 -59
  159. package/lib/esm/listview.js +0 -534
  160. package/lib/esm/menu.js +0 -300
  161. package/lib/esm/messagebox.js +0 -161
  162. package/lib/esm/panel.js +0 -65
  163. package/lib/esm/popup.js +0 -379
  164. package/lib/esm/property_editor.js +0 -251
  165. package/lib/esm/radiobtn.js +0 -136
  166. package/lib/esm/rating.js +0 -97
  167. package/lib/esm/request.js +0 -224
  168. package/lib/esm/router.js +0 -136
  169. package/lib/esm/settings.js +0 -66
  170. package/lib/esm/sidebarview.js +0 -79
  171. package/lib/esm/spreadsheet.js +0 -1097
  172. package/lib/esm/styles.js +0 -270
  173. package/lib/esm/svgcomponent.js +0 -450
  174. package/lib/esm/tabbar.js +0 -107
  175. package/lib/esm/tabview.js +0 -83
  176. package/lib/esm/textarea.js +0 -160
  177. package/lib/esm/textedit.js +0 -412
  178. package/lib/esm/toaster.js +0 -62
  179. package/lib/esm/tools.js +0 -1158
  180. package/lib/esm/tooltips.js +0 -153
  181. package/lib/esm/treeview.js +0 -527
  182. package/lib/esm/x4dom.js +0 -29
  183. package/lib/esm/x4events.js +0 -376
  184. package/lib/esm/x4react.js +0 -71
  185. package/lib/types/app_sockets.d.ts +0 -29
  186. package/lib/types/application.d.ts +0 -104
  187. package/lib/types/autocomplete.d.ts +0 -58
  188. package/lib/types/base_component.d.ts +0 -88
  189. package/lib/types/button.d.ts +0 -151
  190. package/lib/types/calendar.d.ts +0 -82
  191. package/lib/types/canvas.d.ts +0 -92
  192. package/lib/types/cardview.d.ts +0 -87
  193. package/lib/types/checkbox.d.ts +0 -77
  194. package/lib/types/color.d.ts +0 -148
  195. package/lib/types/colorpicker.d.ts +0 -107
  196. package/lib/types/combobox.d.ts +0 -107
  197. package/lib/types/component.d.ts +0 -601
  198. package/lib/types/datastore.d.ts +0 -396
  199. package/lib/types/dialog.d.ts +0 -175
  200. package/lib/types/dom_events.d.ts +0 -302
  201. package/lib/types/drag_manager.d.ts +0 -54
  202. package/lib/types/drawtext.d.ts +0 -48
  203. package/lib/types/fileupload.d.ts +0 -64
  204. package/lib/types/form.d.ts +0 -133
  205. package/lib/types/formatters.d.ts +0 -35
  206. package/lib/types/gridview.d.ts +0 -175
  207. package/lib/types/i18n.d.ts +0 -73
  208. package/lib/types/icon.d.ts +0 -64
  209. package/lib/types/image.d.ts +0 -55
  210. package/lib/types/index.d.ts +0 -84
  211. package/lib/types/input.d.ts +0 -91
  212. package/lib/types/label.d.ts +0 -58
  213. package/lib/types/layout.d.ts +0 -87
  214. package/lib/types/link.d.ts +0 -50
  215. package/lib/types/listview.d.ts +0 -178
  216. package/lib/types/md5.d.ts +0 -61
  217. package/lib/types/menu.d.ts +0 -130
  218. package/lib/types/messagebox.d.ts +0 -69
  219. package/lib/types/panel.d.ts +0 -47
  220. package/lib/types/popup.d.ts +0 -75
  221. package/lib/types/property_editor.d.ts +0 -71
  222. package/lib/types/radiobtn.d.ts +0 -73
  223. package/lib/types/rating.d.ts +0 -53
  224. package/lib/types/request.d.ts +0 -52
  225. package/lib/types/router.d.ts +0 -42
  226. package/lib/types/settings.d.ts +0 -37
  227. package/lib/types/sidebarview.d.ts +0 -49
  228. package/lib/types/spreadsheet.d.ts +0 -222
  229. package/lib/types/styles.d.ts +0 -85
  230. package/lib/types/svgcomponent.d.ts +0 -215
  231. package/lib/types/tabbar.d.ts +0 -58
  232. package/lib/types/tabview.d.ts +0 -49
  233. package/lib/types/textarea.d.ts +0 -77
  234. package/lib/types/textedit.d.ts +0 -123
  235. package/lib/types/toaster.d.ts +0 -42
  236. package/lib/types/tools.d.ts +0 -394
  237. package/lib/types/tooltips.d.ts +0 -46
  238. package/lib/types/treeview.d.ts +0 -144
  239. package/lib/types/version.d.ts +0 -29
  240. package/lib/types/x4dom.d.ts +0 -49
  241. package/lib/types/x4events.d.ts +0 -269
  242. package/lib/types/x4react.d.ts +0 -41
@@ -1,394 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \_/ / / _
4
- * \ / /_| |_
5
- * / _ \____ _|
6
- * /__/ \__\ |_|
7
- *
8
- * @file tools.ts
9
- * @author Etienne Cochard
10
- *
11
- * Copyright (c) 2019-2022 R-libre ingenierie
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
- * of the Software, and to permit persons to whom the Software is furnished to do so,
18
- * subject to the following conditions:
19
- * The above copyright notice and this permission notice shall be included in all copies
20
- * or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- **/
29
- /**
30
- * @return true is the device has touch
31
- */
32
- export declare function isTouchDevice(): boolean;
33
- /**
34
- * round to a given number of decimals
35
- * @param num numbre to round
36
- * @param ndec number of decimals
37
- * @returns number rounded
38
- */
39
- export declare function roundTo(num: number, ndec: number): number;
40
- /**
41
- * parse an intl formatted number
42
- * understand grouping and ',' separator
43
- * @review us format: grouping = ','
44
- * @param num
45
- */
46
- export declare function parseIntlFloat(num: string): number;
47
- /**
48
- * inverse of camel case
49
- * theThingToCase -> the-thing-to-case
50
- * @param {String} str
51
- */
52
- export declare function pascalCase(string: string): string;
53
- export declare function camelCase(text: string): string;
54
- export type Constructor<T> = new (...args: any[]) => T;
55
- export declare class Point {
56
- x: number;
57
- y: number;
58
- constructor(x?: number, y?: number);
59
- }
60
- export declare class Size {
61
- width: number;
62
- height: number;
63
- constructor(w?: number, h?: number);
64
- }
65
- export declare class Rect {
66
- left: number;
67
- top: number;
68
- width: number;
69
- height: number;
70
- constructor();
71
- constructor(rc: Rect);
72
- constructor(rc: DOMRect);
73
- constructor(left: number, top: number, width: number, height: number);
74
- set(left: number, top: number, width: number, height: number): void;
75
- get bottom(): number;
76
- set bottom(bottom: number);
77
- get right(): number;
78
- set right(right: number);
79
- get topLeft(): Point;
80
- get bottomRight(): Point;
81
- get size(): Size;
82
- moveTo(left: number, top: number): this;
83
- movedTo(left: number, top: number): Rect;
84
- moveBy(dx: number, dy: number): this;
85
- movedBy(dx: number, dy: number): Rect;
86
- isEmpty(): boolean;
87
- normalize(): this;
88
- normalized(): Rect;
89
- /**
90
- * @deprecated
91
- */
92
- containsPt(x: number, y: number): boolean;
93
- contains(pt: Point): boolean;
94
- contains(rc: Rect): boolean;
95
- touches(rc: Rect): boolean;
96
- inflate(dx: number, dy?: number): void;
97
- inflatedBy(dx: number, dy?: number): Rect;
98
- combine(rc: Rect): void;
99
- }
100
- /**
101
- * replace {0..9} by given arguments
102
- * @param format string
103
- * @param args
104
- *
105
- * @example ```ts
106
- *
107
- * console.log( sprintf( 'here is arg 1 {1} and arg 0 {0}', 'argument 0', 'argument 1' ) )
108
- */
109
- export declare function sprintf(format: string, ...args: any[]): string;
110
- /**
111
- * replace special characters for display
112
- * @param unsafe
113
- *
114
- * console.log( escapeHtml('<div style="width:50px; height: 50px; background-color:red"></div>') );
115
- */
116
- export declare function escapeHtml(unsafe: string, nl_br?: boolean): string;
117
- /**
118
- * replace special characters for display
119
- * @author Steven Levithan <http://slevithan.com/>
120
- * @param unsafe
121
- *
122
- * console.log( removeHtmlTags('<h1>sss</h1>') );
123
- */
124
- export declare function removeHtmlTags(unsafe: string, nl_br?: boolean): string;
125
- /**
126
- * change the current locale for misc translations (date...)
127
- * @param locale
128
- */
129
- export declare function _date_set_locale(locale: string): void;
130
- /**
131
- *
132
- * @param date
133
- * @param options
134
- * @example
135
- * let date = new Date( );
136
- * let options = { day: 'numeric', month: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric' };
137
- * let text = date_format( date, options );
138
- */
139
- export declare function date_format(date: Date, options?: any): string;
140
- /**
141
- *
142
- * @param date
143
- * @param options
144
- */
145
- export declare function date_diff(date1: Date, date2: Date, options?: any): string;
146
- export declare function date_to_sql(date: Date, withHours: boolean): string;
147
- /**
148
- * construct a date from an utc date time (sql format)
149
- * YYYY-MM-DD HH:MM:SS
150
- */
151
- export declare function date_sql_utc(date: string): Date;
152
- /**
153
- * return a number that is a representation of the date
154
- * this number can be compared with another hash
155
- */
156
- export declare function date_hash(date: Date): number;
157
- /**
158
- * return a copy of a date
159
- */
160
- export declare function date_clone(date: Date): Date;
161
- /**
162
- * return the week number of a date
163
- */
164
- export declare function date_calc_weeknum(date: Date): number;
165
- /**
166
- * parse a date according to the given format
167
- * @param value - string date to parse
168
- * @param fmts - format list - i18 tranlation by default
169
- * allowed format specifiers:
170
- * d or D: date (1 or 2 digits)
171
- * m or M: month (1 or 2 digits)
172
- * y or Y: year (2 or 4 digits)
173
- * h or H: hours (1 or 2 digits)
174
- * i or I: minutes (1 or 2 digits)
175
- * s or S: seconds (1 or 2 digits)
176
- * <space>: 1 or more spaces
177
- * any other char: <0 or more spaces><the char><0 or more spaces>
178
- * each specifiers is separated from other by a pipe (|)
179
- * more specific at first
180
- * @example
181
- * 'd/m/y|d m Y|dmy|y-m-d h:i:s|y-m-d'
182
- */
183
- export declare function parseIntlDate(value: string, fmts?: string): Date;
184
- /**
185
- * format a date as string
186
- * @param date - date to format
187
- * @param fmt - format
188
- * format specifiers:
189
- * d: date
190
- * D: 2 digits date padded with 0
191
- * j: day of week short mode 'mon'
192
- * J: day of week long mode 'monday'
193
- * w: week number
194
- * m: month
195
- * M: 2 digits month padded with 0
196
- * o: month short mode 'jan'
197
- * O: month long mode 'january'
198
- * y or Y: year
199
- * h: hour (24 format)
200
- * H: 2 digits hour (24 format) padded with 0
201
- * i: minutes
202
- * I: 2 digits minutes padded with 0
203
- * s: seconds
204
- * S: 2 digits seconds padded with 0
205
- * a: am or pm
206
- * anything else is inserted
207
- * if you need to insert some text, put it between {}
208
- *
209
- * @example
210
- *
211
- * 01/01/1970 11:25:00 with '{this is my demo date formatter: }H-i*M'
212
- * "this is my demo date formatter: 11-25*january"
213
- */
214
- export declare function formatIntlDate(date: Date, fmt?: string): string;
215
- export declare function calcAge(birth: Date, ref?: Date): number;
216
- /**
217
- * date object patch
218
- */
219
- declare global {
220
- interface Date {
221
- hash(): number;
222
- clone(): Date;
223
- weekNum(): number;
224
- format(format: string): string;
225
- isSameDay(date: Date): boolean;
226
- addDays(days: number): any;
227
- }
228
- }
229
- /**
230
- *
231
- * @param data data to export
232
- * @param mimetype - 'text/plain'
233
- */
234
- export declare function downloadData(data: any, mimetype: string, filename: string): void;
235
- /**
236
- * check if a value is a string
237
- * @param val
238
- */
239
- export declare function isString(val: any): val is string;
240
- /**
241
- * check is a value is an array
242
- * @param val
243
- */
244
- export declare function isArray(val: any): val is any[];
245
- /**
246
- *
247
- */
248
- export declare function isFunction(val: any): val is Function;
249
- /**
250
- *
251
- */
252
- export declare function isLiteralObject(val: any): boolean;
253
- /**
254
- * prepend 0 to a value to a given length
255
- * @param value
256
- * @param length
257
- */
258
- export declare function pad(what: unknown, size: number, ch?: string): string;
259
- /**
260
- * return true if val is a finite number
261
- */
262
- export declare function isNumber(val: any): val is number;
263
- /**
264
- *
265
- * @param name
266
- */
267
- export declare function waitFontLoading(name: string): Promise<void>;
268
- /**
269
- *
270
- * @param fn
271
- * @param tm
272
- *
273
- * @example:
274
- *
275
- * defer( ( ) => {
276
- * console.log( x );
277
- * } )( );
278
- */
279
- export declare function deferCall(fn: Function, tm?: number, ...args: any[]): void;
280
- /**
281
- *
282
- */
283
- export declare function asap(cb: (time: number) => void): void;
284
- /**
285
- * micro md to html
286
- *
287
- * understand:
288
- * **bold**
289
- * *italic*
290
- *
291
- * > quote
292
- * - list
293
- * # title lvl 1
294
- * ## title lvl 2
295
- * ### title lvl 3 ...
296
- *
297
- */
298
- export declare function markdownToHtml(text: string): string;
299
- /**
300
- *
301
- */
302
- export declare class NetworkError extends Error {
303
- private m_code;
304
- constructor(response: Response);
305
- constructor(code: number, text: string);
306
- get code(): number;
307
- }
308
- /**
309
- * return the mouse pos in client coordinates
310
- * handle correctly touch & mouse
311
- */
312
- export declare function getMousePos(ev: UIEvent, fromDoc: boolean): Point;
313
- /**
314
- * clamp a value
315
- * @param v - value to clamp
316
- * @param min - min value
317
- * @param max - max value
318
- * @returns clamped value
319
- */
320
- export declare function clamp(v: number, min: number, max: number): number;
321
- /**
322
- *
323
- */
324
- export interface IDisposable {
325
- dispose(): any;
326
- }
327
- export declare class HtmlString extends String {
328
- constructor(text: string);
329
- static from(text: string): HtmlString;
330
- }
331
- export declare function html(a: any, ...b: any[]): HtmlString;
332
- export declare function isHtmlString(val: any): val is HtmlString;
333
- export declare class Clipboard {
334
- static copy(data: any): void;
335
- static paste(cb: (data: string) => void): void;
336
- }
337
- /**
338
- * Calculates the CRC32 checksum of a string.
339
- * taken from: https://gist.github.com/wqli78/1330293/6d85cc967f32cccfcbad94ae7d088a3dcfc14bd9
340
- *
341
- * @param {String} str
342
- * @param {Boolean} hex
343
- * @return {String} checksum
344
- * @api public
345
- */
346
- export declare function crc32(str: any): number;
347
- /**
348
- * taken from this excellent article:
349
- * https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/
350
- *
351
- * @example:
352
- * class MyClass extends mix(MyBaseClass).with(Mixin1, Mixin2) {
353
- * }
354
- **/
355
- export declare const mix: (superclass: any) => MixinBuilder;
356
- declare class MixinBuilder {
357
- private superclass;
358
- constructor(superclass: any);
359
- with(...mixins: any[]): any;
360
- }
361
- /**
362
- * @example
363
- *
364
- * ```
365
- * const cls = classNames( 'class1 class2', {
366
- * 'class3': false,
367
- * 'class4': true,
368
- * });
369
- *
370
- * // even shorter
371
- * const class1 = true, class2 = false;
372
- * const cls = classNames( { class1, class2 } ); // cls = "class1"
373
- *
374
- * ```
375
- *
376
- * @returns
377
- */
378
- export declare function classNames(...args: (string | any)[]): string;
379
- /**
380
- *
381
- */
382
- interface PasswordRule {
383
- chars: string;
384
- min: number;
385
- }
386
- export declare function generatePassword(length: number, rules?: PasswordRule[]): string;
387
- /**
388
- * taken from live-server
389
- * https://github.com/tapio/live-server
390
- * @param host
391
- * @param port
392
- */
393
- export declare function installHMR(host?: string, port?: string, reloadCallback?: Function): void;
394
- export {};
@@ -1,46 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \_/ / / _
4
- * \ / /_| |_
5
- * / _ \____ _|
6
- * /__/ \__\ |_|
7
- *
8
- * @file tooltips.ts
9
- * @author Etienne Cochard
10
- *
11
- * Copyright (c) 2019-2022 R-libre ingenierie
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
- * of the Software, and to permit persons to whom the Software is furnished to do so,
18
- * subject to the following conditions:
19
- * The above copyright notice and this permission notice shall be included in all copies
20
- * or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- **/
29
- import { Component } from './component';
30
- /**
31
- *
32
- */
33
- export declare class Tooltip extends Component {
34
- private m_text;
35
- set text(text: any);
36
- /** @ignore */
37
- render(): void;
38
- /**
39
- * display the menu at a specific position
40
- * @param x
41
- * @param y
42
- */
43
- displayAt(x: number, y: number, align?: string): void;
44
- }
45
- export type TooltipHandler = (text: string) => void;
46
- export declare function initTooltips(cb?: TooltipHandler): void;
@@ -1,144 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \_/ / / _
4
- * \ / /_| |_
5
- * / _ \____ _|
6
- * /__/ \__\ |_|
7
- *
8
- * @file treeview.ts
9
- * @author Etienne Cochard
10
- *
11
- * Copyright (c) 2019-2022 R-libre ingenierie
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
- * of the Software, and to permit persons to whom the Software is furnished to do so,
18
- * subject to the following conditions:
19
- * The above copyright notice and this permission notice shall be included in all copies
20
- * or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- **/
29
- import { Component, Container, ContainerEventMap, ContainerProps, EvDblClick, EventHandler } from './component';
30
- import { HtmlString } from './tools';
31
- import { IconID } from './icon';
32
- import { VLayout } from './layout';
33
- import { EvClick, BasicEvent, EvDrag, EvSelectionChange, EvContextMenu } from './x4events';
34
- export interface EvExpand extends BasicEvent {
35
- node: TreeNode;
36
- }
37
- export interface HierarchicalNode {
38
- id: number;
39
- name: string;
40
- parent?: number;
41
- cls?: string;
42
- leaf?: boolean;
43
- icon?: string;
44
- data?: any;
45
- }
46
- export interface TreeNode {
47
- id: any;
48
- text?: string | HtmlString;
49
- icon?: IconID;
50
- children?: TreeNode[];
51
- open?: boolean;
52
- data?: any;
53
- parent?: number;
54
- cls?: string;
55
- }
56
- interface TreeViewEventMap extends ContainerEventMap {
57
- click: EvClick;
58
- dblclick: EvDblClick;
59
- expand: EvExpand;
60
- drag: EvDrag;
61
- selectionchange: EvSelectionChange;
62
- contextMenu: EvContextMenu;
63
- }
64
- export interface TreeViewProps extends ContainerProps<TreeViewEventMap> {
65
- root: TreeNode;
66
- indent?: number;
67
- gadgets?: Component[];
68
- sort?: boolean;
69
- canDragItems?: boolean;
70
- renderItem?: (itm: TreeNode) => Component;
71
- dblclick?: EventHandler<EvDblClick>;
72
- selectionchange?: EventHandler<EvSelectionChange>;
73
- drag?: EventHandler<EvDrag>;
74
- contextMenu?: EventHandler<EvContextMenu>;
75
- }
76
- /**
77
- *
78
- */
79
- export declare class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
80
- m_view: Container;
81
- m_container: Container;
82
- m_selection: {
83
- id: any;
84
- el: Component;
85
- };
86
- constructor(props: TreeViewProps);
87
- private _dragEnter;
88
- private _dragLeave;
89
- private _drop;
90
- render(): void;
91
- private __update;
92
- updateElement(id: any): void;
93
- set root(root: TreeNode);
94
- openAll(open?: boolean): void;
95
- /**
96
- * same as root = xxx but keep elements open
97
- */
98
- refreshRoot(root: TreeNode): void;
99
- private _buildBranch;
100
- private _renderDef;
101
- private _makeNode;
102
- /**
103
- *
104
- */
105
- forEach(cb: (node: TreeNode) => boolean | void): any;
106
- ensureVisible(id: any): void;
107
- set selection(id: any);
108
- /**
109
- * care, component should have been created, to select an item at startup,
110
- * use something like
111
- * componentCreated( ) {
112
- * mytree.select( id );
113
- * }
114
- */
115
- select(id: any, notify?: boolean): void;
116
- private _getNode;
117
- get selection(): any;
118
- getNodeWithId(id: any): TreeNode;
119
- /**
120
- *
121
- */
122
- private _click;
123
- private _handleCtxMenu;
124
- /**
125
- * constructs a tree node from an array of strings
126
- * elements are organized like folders (separator = /)
127
- * @example
128
- * let root = TreeView.buildFromString( [
129
- * 'this/is/a/final/file'
130
- * 'this/is/another/file'
131
- * ] );
132
- */
133
- static buildFromStrings(paths: string[], separator?: string): TreeNode;
134
- /**
135
- * constructs a tree node from an array of nodes like
136
- * node {
137
- * id: number,
138
- * parent: number,
139
- * name: string
140
- * }
141
- */
142
- static buildFromHierarchy(nodes: HierarchicalNode[], cb?: (node: TreeNode) => void): TreeNode;
143
- }
144
- export {};
@@ -1,29 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \_/ / / _
4
- * \ / /_| |_
5
- * / _ \____ _|
6
- * /__/ \__\ |_|
7
- *
8
- * @file version.ts
9
- * @author Etienne Cochard
10
- *
11
- * Copyright (c) 2019-2022 R-libre ingenierie
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
- * of the Software, and to permit persons to whom the Software is furnished to do so,
18
- * subject to the following conditions:
19
- * The above copyright notice and this permission notice shall be included in all copies
20
- * or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- **/
29
- export declare const x4js_version = "1.5.18";
@@ -1,49 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \_/ / / _
4
- * \ / /_| |_
5
- * / _ \____ _|
6
- * /__/ \__\ |_|
7
- *
8
- * @file x4events.ts
9
- * @author Etienne Cochard
10
- *
11
- * Copyright (c) 2019-2022 R-libre ingenierie
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
- * of the Software, and to permit persons to whom the Software is furnished to do so,
18
- * subject to the following conditions:
19
- * The above copyright notice and this permission notice shall be included in all copies
20
- * or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- **/
29
- /**
30
- * SSR preparation
31
- */
32
- interface IX4Document {
33
- createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];
34
- createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element;
35
- createTextNode(data: string): Text;
36
- addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
37
- removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
38
- querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
39
- querySelector<E extends Element = Element>(selectors: string): E | null;
40
- get body(): HTMLElement;
41
- get activeElement(): Element;
42
- get location(): Location;
43
- get styleSheets(): StyleSheetList;
44
- get head(): HTMLHeadElement;
45
- get documentElement(): HTMLElement;
46
- set title(title: string);
47
- }
48
- export declare let x4document: IX4Document;
49
- export {};