chuijs 3.6.2 → 3.6.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.
- package/LICENSE +21 -21
- package/README.md +1203 -162
- package/framework/appLayout/default/chui_app_layout.js +747 -747
- package/framework/appLayout/default/global_style.css +592 -568
- package/framework/appLayout/default/main_theme_style.css +118 -101
- package/framework/components/chui_accordion/accordion.js +63 -63
- package/framework/components/chui_accordion/styles.css +79 -75
- package/framework/components/chui_badge/badge.js +55 -55
- package/framework/components/chui_badge/styles.css +29 -29
- package/framework/components/chui_button/button.js +48 -48
- package/framework/components/chui_button/styles.css +75 -70
- package/framework/components/chui_calendar/calendar.js +97 -97
- package/framework/components/chui_card/card.js +87 -0
- package/framework/components/chui_card/styles.css +72 -0
- package/framework/components/chui_code/code.js +18 -18
- package/framework/components/chui_code/styles.css +9 -9
- package/framework/components/chui_console/console.js +27 -27
- package/framework/components/chui_console/styles.css +31 -31
- package/framework/components/chui_content_block/content_block.js +51 -51
- package/framework/components/chui_content_block/styles.css +2 -2
- package/framework/components/chui_context_menu/context_menu.js +230 -0
- package/framework/components/chui_context_menu/styles.css +136 -0
- package/framework/components/chui_custom_element/custom_element.js +24 -24
- package/framework/components/chui_details/details.js +85 -85
- package/framework/components/chui_details/styles.css +70 -66
- package/framework/components/chui_fieldset/fieldset.js +40 -40
- package/framework/components/chui_fieldset/styles.css +24 -24
- package/framework/components/chui_form/form.js +40 -40
- package/framework/components/chui_form/styles.css +21 -21
- package/framework/components/chui_graphs/graphs.js +234 -190
- package/framework/components/chui_graphs/styles.css +37 -32
- package/framework/components/chui_hero/hero.js +98 -0
- package/framework/components/chui_hero/styles.css +91 -0
- package/framework/components/chui_html_block/html_block.js +16 -16
- package/framework/components/chui_html_block/styles.css +5 -5
- package/framework/components/chui_hx/hx.js +15 -15
- package/framework/components/chui_hx/styles.css +38 -38
- package/framework/components/chui_icons/icons.js +2144 -2144
- package/framework/components/chui_icons/styles.css +13 -13
- package/framework/components/chui_inputs/chui_check_box/check_box.js +32 -32
- package/framework/components/chui_inputs/chui_check_box/styles.css +91 -86
- package/framework/components/chui_inputs/chui_combo_box/combo_box.js +166 -150
- package/framework/components/chui_inputs/chui_combo_box/styles.css +113 -107
- package/framework/components/chui_inputs/chui_date/date.js +177 -174
- package/framework/components/chui_inputs/chui_date/styles.css +163 -128
- package/framework/components/chui_inputs/chui_email/email.js +61 -61
- package/framework/components/chui_inputs/chui_email/styles.css +69 -71
- package/framework/components/chui_inputs/chui_file/file.js +76 -76
- package/framework/components/chui_inputs/chui_file/styles.css +99 -99
- package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +295 -295
- package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +212 -235
- package/framework/components/chui_inputs/chui_number/number.js +108 -108
- package/framework/components/chui_inputs/chui_number/styles.css +84 -84
- package/framework/components/chui_inputs/chui_password/password.js +99 -99
- package/framework/components/chui_inputs/chui_password/styles.css +97 -97
- package/framework/components/chui_inputs/chui_radio_button/radio_button.js +45 -45
- package/framework/components/chui_inputs/chui_radio_button/styles.css +76 -73
- package/framework/components/chui_inputs/chui_select_box/select_box.js +187 -170
- package/framework/components/chui_inputs/chui_select_box/styles.css +123 -117
- package/framework/components/chui_inputs/chui_text/styles.css +83 -84
- package/framework/components/chui_inputs/chui_text/text.js +91 -91
- package/framework/components/chui_inputs/chui_text_area/styles.css +57 -57
- package/framework/components/chui_inputs/chui_text_area/text_area.js +61 -61
- package/framework/components/chui_inputs/chui_toggle/styles.css +66 -61
- package/framework/components/chui_inputs/chui_toggle/toggle.js +36 -36
- package/framework/components/chui_label/label.js +54 -54
- package/framework/components/chui_label/styles.css +11 -11
- package/framework/components/chui_media/audio.js +908 -908
- package/framework/components/chui_media/audio_styles.css +458 -458
- package/framework/components/chui_media/image.js +105 -105
- package/framework/components/chui_media/image_styles.css +61 -61
- package/framework/components/chui_media/video.js +248 -248
- package/framework/components/chui_media/video_styles.css +160 -160
- package/framework/components/chui_menu_bar/menu_bar.js +66 -74
- package/framework/components/chui_menu_bar/styles.css +114 -76
- package/framework/components/chui_modal/modal.js +142 -135
- package/framework/components/chui_modal/styles.css +36 -36
- package/framework/components/chui_notification/notification.js +72 -72
- package/framework/components/chui_notification/notification_download.js +78 -78
- package/framework/components/chui_notification/notification_download_progress.css +119 -123
- package/framework/components/chui_notification/notification_download_progress.js +105 -105
- package/framework/components/chui_notification/notification_update.js +54 -54
- package/framework/components/chui_notification/styles.css +91 -91
- package/framework/components/chui_notification/styles_download.css +85 -85
- package/framework/components/chui_notification/styles_update.css +73 -73
- package/framework/components/chui_paragraph/paragraph.js +14 -14
- package/framework/components/chui_paragraph/styles.css +6 -6
- package/framework/components/chui_popups/popups.js +250 -250
- package/framework/components/chui_popups/styles.css +129 -115
- package/framework/components/chui_progress_bar/progress_bar.js +28 -28
- package/framework/components/chui_progress_bar/styles.css +28 -28
- package/framework/components/chui_radio_group/radio_group.js +57 -57
- package/framework/components/chui_radio_group/styles.css +3 -3
- package/framework/components/chui_slideshow/slideshow.js +75 -75
- package/framework/components/chui_slideshow/styles.css +94 -85
- package/framework/components/chui_spinner/spinner.js +45 -45
- package/framework/components/chui_spinner/styles.css +23 -23
- package/framework/components/chui_table/styles.css +42 -42
- package/framework/components/chui_table/table.js +234 -234
- package/framework/components/chui_tabs/chui_tabs.js +77 -77
- package/framework/components/chui_tabs/styles.css +54 -48
- package/framework/components/chui_text_editor/styles.css +217 -217
- package/framework/components/chui_text_editor/text_editor.js +144 -144
- package/framework/components/chui_text_editor/text_editor_panel.js +568 -568
- package/framework/components/chui_tree_view/styles.css +81 -75
- package/framework/components/chui_tree_view/tree_view.js +90 -90
- package/framework/components/chui_webview/styles.css +27 -27
- package/framework/components/chui_webview/webview.js +103 -103
- package/framework/components/telegram_bot/chui_telegram_bot.js +183 -183
- package/framework/modules/chui_animations/animations.js +121 -121
- package/framework/modules/chui_animations/styles.css +79 -79
- package/framework/modules/chui_fonts.js +7129 -6974
- package/framework/modules/chui_functions.js +106 -78
- package/framework/modules/chui_logger/chui_logger.js +53 -53
- package/framework/modules/chui_page/page.js +86 -86
- package/framework/modules/chui_page/styles.css +9 -9
- package/framework/tray_bar/chui_menu_items.js +48 -48
- package/index.js +570 -555
- package/package.json +51 -46
package/index.js
CHANGED
|
@@ -1,555 +1,570 @@
|
|
|
1
|
-
// === ИНСТРУМЕНТЫ ===
|
|
2
|
-
const {app, BrowserWindow, Menu, Tray, ipcMain, ipcRenderer, shell, nativeTheme, session, webContents, systemPreferences} = require('electron');
|
|
3
|
-
const { dialog } = require('@electron/remote/main');
|
|
4
|
-
const Store = require("electron-store");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const os = require("os");
|
|
8
|
-
|
|
9
|
-
const request = require('@cypress/request');
|
|
10
|
-
const {transliterate} = require("transliteration");
|
|
11
|
-
let downloadSession = undefined;
|
|
12
|
-
// === === ===
|
|
13
|
-
// process.env
|
|
14
|
-
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = "true";
|
|
15
|
-
// === === ===
|
|
16
|
-
|
|
17
|
-
//ПОЛЯ ВВОДА
|
|
18
|
-
const {TextInput} = require('./framework/components/chui_inputs/chui_text/text');
|
|
19
|
-
const {DateInput} = require('./framework/components/chui_inputs/chui_date/date');
|
|
20
|
-
const {NumberInput} = require('./framework/components/chui_inputs/chui_number/number');
|
|
21
|
-
const {EmailInput} = require('./framework/components/chui_inputs/chui_email/email');
|
|
22
|
-
const {PasswordInput} = require('./framework/components/chui_inputs/chui_password/password');
|
|
23
|
-
const {Select} = require('./framework/components/chui_inputs/chui_select_box/select_box');
|
|
24
|
-
const {ComboBox} = require('./framework/components/chui_inputs/chui_combo_box/combo_box');
|
|
25
|
-
const {TextArea} = require('./framework/components/chui_inputs/chui_text_area/text_area');
|
|
26
|
-
const {RadioButton} = require('./framework/components/chui_inputs/chui_radio_button/radio_button');
|
|
27
|
-
const {CheckBox} = require('./framework/components/chui_inputs/chui_check_box/check_box');
|
|
28
|
-
const {RadioGroup} = require('./framework/components/chui_radio_group/radio_group');
|
|
29
|
-
//==========
|
|
30
|
-
const {MenuItem} = require('./framework/tray_bar/chui_menu_items');
|
|
31
|
-
const {AppLayout, Route} = require('./framework/appLayout/default/chui_app_layout');
|
|
32
|
-
const {Page} = require('./framework/modules/chui_page/page');
|
|
33
|
-
const {WebView} = require('./framework/components/chui_webview/webview');
|
|
34
|
-
const {Button} = require('./framework/components/chui_button/button');
|
|
35
|
-
const {Spinner} = require('./framework/components/chui_spinner/spinner');
|
|
36
|
-
const {Icon, Icons} = require('./framework/components/chui_icons/icons');
|
|
37
|
-
const {TextEditor} = require('./framework/components/chui_text_editor/text_editor');
|
|
38
|
-
const {Badge} = require('./framework/components/chui_badge/badge');
|
|
39
|
-
const {Calendar} = require('./framework/components/chui_calendar/calendar');
|
|
40
|
-
const {Notification} = require('./framework/components/chui_notification/notification');
|
|
41
|
-
const {UpdateNotification} = require("./framework/components/chui_notification/notification_update");
|
|
42
|
-
const {DownloadNotification} = require("./framework/components/chui_notification/notification_download");
|
|
43
|
-
const {Tabs, Tab} = require('./framework/components/chui_tabs/chui_tabs');
|
|
44
|
-
const {BarGraph, PieGraph} = require('./framework/components/chui_graphs/graphs');
|
|
45
|
-
const {Toggle} = require('./framework/components/chui_inputs/chui_toggle/toggle');
|
|
46
|
-
const {ContentBlock} = require('./framework/components/chui_content_block/content_block');
|
|
47
|
-
const {
|
|
48
|
-
const {
|
|
49
|
-
const {
|
|
50
|
-
const {
|
|
51
|
-
const {
|
|
52
|
-
const {
|
|
53
|
-
const {
|
|
54
|
-
const {
|
|
55
|
-
const {
|
|
56
|
-
const {
|
|
57
|
-
const {
|
|
58
|
-
const {
|
|
59
|
-
const {
|
|
60
|
-
const {
|
|
61
|
-
const {
|
|
62
|
-
const {
|
|
63
|
-
const {
|
|
64
|
-
const {
|
|
65
|
-
const {
|
|
66
|
-
const {
|
|
67
|
-
const {
|
|
68
|
-
const {
|
|
69
|
-
const {
|
|
70
|
-
const {
|
|
71
|
-
const {
|
|
72
|
-
const {
|
|
73
|
-
const {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#
|
|
85
|
-
//
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
|
|
89
|
-
#
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
-
|
|
96
|
-
#
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this.#app_icon =
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
app.commandLine.appendSwitch('enable-
|
|
128
|
-
app.commandLine.appendSwitch('
|
|
129
|
-
app.commandLine.appendSwitch('enable-
|
|
130
|
-
app.commandLine.appendSwitch(
|
|
131
|
-
app.commandLine.appendSwitch('
|
|
132
|
-
app.commandLine.appendSwitch('
|
|
133
|
-
app.commandLine.appendSwitch('
|
|
134
|
-
app.commandLine.appendSwitch('
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.#
|
|
150
|
-
this.#
|
|
151
|
-
this.#
|
|
152
|
-
this.#
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
this.#
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
this.#
|
|
262
|
-
} else
|
|
263
|
-
this.#window.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
static
|
|
414
|
-
static
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
return
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
static
|
|
462
|
-
static
|
|
463
|
-
static
|
|
464
|
-
|
|
465
|
-
static
|
|
466
|
-
static
|
|
467
|
-
static
|
|
468
|
-
static
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
//
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
1
|
+
// === ИНСТРУМЕНТЫ ===
|
|
2
|
+
const {app, BrowserWindow, Menu, Tray, ipcMain, ipcRenderer, shell, nativeTheme, session, webContents, systemPreferences} = require('electron');
|
|
3
|
+
const { dialog } = require('@electron/remote/main');
|
|
4
|
+
const Store = require("electron-store");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const os = require("os");
|
|
8
|
+
|
|
9
|
+
const request = require('@cypress/request');
|
|
10
|
+
const {transliterate} = require("transliteration");
|
|
11
|
+
let downloadSession = undefined;
|
|
12
|
+
// === === ===
|
|
13
|
+
// process.env
|
|
14
|
+
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = "true";
|
|
15
|
+
// === === ===
|
|
16
|
+
|
|
17
|
+
//ПОЛЯ ВВОДА
|
|
18
|
+
const {TextInput} = require('./framework/components/chui_inputs/chui_text/text');
|
|
19
|
+
const {DateInput} = require('./framework/components/chui_inputs/chui_date/date');
|
|
20
|
+
const {NumberInput} = require('./framework/components/chui_inputs/chui_number/number');
|
|
21
|
+
const {EmailInput} = require('./framework/components/chui_inputs/chui_email/email');
|
|
22
|
+
const {PasswordInput} = require('./framework/components/chui_inputs/chui_password/password');
|
|
23
|
+
const {Select} = require('./framework/components/chui_inputs/chui_select_box/select_box');
|
|
24
|
+
const {ComboBox} = require('./framework/components/chui_inputs/chui_combo_box/combo_box');
|
|
25
|
+
const {TextArea} = require('./framework/components/chui_inputs/chui_text_area/text_area');
|
|
26
|
+
const {RadioButton} = require('./framework/components/chui_inputs/chui_radio_button/radio_button');
|
|
27
|
+
const {CheckBox} = require('./framework/components/chui_inputs/chui_check_box/check_box');
|
|
28
|
+
const {RadioGroup} = require('./framework/components/chui_radio_group/radio_group');
|
|
29
|
+
//==========
|
|
30
|
+
const {MenuItem} = require('./framework/tray_bar/chui_menu_items');
|
|
31
|
+
const {AppLayout, Route} = require('./framework/appLayout/default/chui_app_layout');
|
|
32
|
+
const {Page} = require('./framework/modules/chui_page/page');
|
|
33
|
+
const {WebView} = require('./framework/components/chui_webview/webview');
|
|
34
|
+
const {Button} = require('./framework/components/chui_button/button');
|
|
35
|
+
const {Spinner} = require('./framework/components/chui_spinner/spinner');
|
|
36
|
+
const {Icon, Icons} = require('./framework/components/chui_icons/icons');
|
|
37
|
+
const {TextEditor} = require('./framework/components/chui_text_editor/text_editor');
|
|
38
|
+
const {Badge} = require('./framework/components/chui_badge/badge');
|
|
39
|
+
const {Calendar} = require('./framework/components/chui_calendar/calendar');
|
|
40
|
+
const {Notification} = require('./framework/components/chui_notification/notification');
|
|
41
|
+
const {UpdateNotification} = require("./framework/components/chui_notification/notification_update");
|
|
42
|
+
const {DownloadNotification} = require("./framework/components/chui_notification/notification_download");
|
|
43
|
+
const {Tabs, Tab} = require('./framework/components/chui_tabs/chui_tabs');
|
|
44
|
+
const {BarGraph, PieGraph} = require('./framework/components/chui_graphs/graphs');
|
|
45
|
+
const {Toggle} = require('./framework/components/chui_inputs/chui_toggle/toggle');
|
|
46
|
+
const {ContentBlock} = require('./framework/components/chui_content_block/content_block');
|
|
47
|
+
const {Card} = require('./framework/components/chui_card/card');
|
|
48
|
+
const {Hero} = require('./framework/components/chui_hero/hero');
|
|
49
|
+
const {ProgressBar} = require('./framework/components/chui_progress_bar/progress_bar');
|
|
50
|
+
const {Label} = require('./framework/components/chui_label/label');
|
|
51
|
+
const {Dialog} = require('./framework/components/chui_modal/modal');
|
|
52
|
+
const {Paragraph} = require('./framework/components/chui_paragraph/paragraph');
|
|
53
|
+
const {H} = require('./framework/components/chui_hx/hx');
|
|
54
|
+
const {Table} = require('./framework/components/chui_table/table');
|
|
55
|
+
const {Details} = require('./framework/components/chui_details/details');
|
|
56
|
+
const {Accordion} = require('./framework/components/chui_accordion/accordion')
|
|
57
|
+
const {CodeBlock} = require('./framework/components/chui_code/code')
|
|
58
|
+
const {HtmlBlock} = require('./framework/components/chui_html_block/html_block')
|
|
59
|
+
const {sleep, render, getDefaultIcon, formatBytes} = require('./framework/modules/chui_functions');
|
|
60
|
+
const {FileInput, AcceptTypes} = require("./framework/components/chui_inputs/chui_file/file");
|
|
61
|
+
const {TreeView} = require("./framework/components/chui_tree_view/tree_view");
|
|
62
|
+
const {Form} = require("./framework/components/chui_form/form");
|
|
63
|
+
const {SlideShow} = require("./framework/components/chui_slideshow/slideshow");
|
|
64
|
+
const {FieldSet} = require("./framework/components/chui_fieldset/fieldset");
|
|
65
|
+
const {Popup} = require("./framework/components/chui_popups/popups");
|
|
66
|
+
const {TelegramBot} = require("./framework/components/telegram_bot/chui_telegram_bot");
|
|
67
|
+
const {MenuBar} = require("./framework/components/chui_menu_bar/menu_bar");
|
|
68
|
+
const { ContextMenu } = require("./framework/components/chui_context_menu/context_menu");
|
|
69
|
+
const {Image} = require('./framework/components/chui_media/image');
|
|
70
|
+
const {Audio} = require("./framework/components/chui_media/audio");
|
|
71
|
+
const {Video} = require("./framework/components/chui_media/video");
|
|
72
|
+
const {CustomElement} = require("./framework/components/chui_custom_element/custom_element");
|
|
73
|
+
const {Console} = require("./framework/components/chui_console/console");
|
|
74
|
+
const {DownloadProgressNotification} = require("./framework/components/chui_notification/notification_download_progress");
|
|
75
|
+
const {MultiComboBox} = require("./framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box");
|
|
76
|
+
const {Log} = require("./framework/modules/chui_logger/chui_logger");
|
|
77
|
+
const url = require("node:url");
|
|
78
|
+
|
|
79
|
+
//VARS
|
|
80
|
+
let isQuiting = false;
|
|
81
|
+
let context = null;
|
|
82
|
+
|
|
83
|
+
class Main {
|
|
84
|
+
#tray = undefined;
|
|
85
|
+
//
|
|
86
|
+
#app_icon = undefined;
|
|
87
|
+
#window = undefined;
|
|
88
|
+
//
|
|
89
|
+
#appName = undefined;
|
|
90
|
+
#height = undefined;
|
|
91
|
+
#width = undefined;
|
|
92
|
+
#minHeight = undefined;
|
|
93
|
+
#minWidth = undefined;
|
|
94
|
+
#renderer = undefined;
|
|
95
|
+
#devTools = false;
|
|
96
|
+
#devToolsOpened = false;
|
|
97
|
+
#webSecurity = true;
|
|
98
|
+
#resizable = true;
|
|
99
|
+
// ПУТИ
|
|
100
|
+
#downloadPath = undefined;
|
|
101
|
+
|
|
102
|
+
constructor(options = {
|
|
103
|
+
name: String(),
|
|
104
|
+
sizes: { height: Number(), width: Number(), minHeight: Number(), minWidth: Number() },
|
|
105
|
+
render: String(),
|
|
106
|
+
devTools: Boolean(),
|
|
107
|
+
webSecurity: Boolean(),
|
|
108
|
+
resizable: Boolean(),
|
|
109
|
+
paths: {
|
|
110
|
+
downloadPath: String(),
|
|
111
|
+
}
|
|
112
|
+
}) {
|
|
113
|
+
this.#app_icon = options.icon;
|
|
114
|
+
if (this.#app_icon === undefined) {
|
|
115
|
+
if (process.platform === "darwin") {
|
|
116
|
+
this.#app_icon = Main.#resizeIconTray(getDefaultIcon())
|
|
117
|
+
} else {
|
|
118
|
+
this.#app_icon = getDefaultIcon();
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
if (process.platform === "darwin") {
|
|
122
|
+
this.#app_icon = Main.#resizeIconTray(options.icon)
|
|
123
|
+
} else {
|
|
124
|
+
this.#app_icon = options.icon;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// app.commandLine.appendSwitch('--enable-features', 'OverlayScrollbar')
|
|
128
|
+
app.commandLine.appendSwitch('disable-hid-blocklist')
|
|
129
|
+
app.commandLine.appendSwitch('enable-features=OverlayScrollbar')
|
|
130
|
+
// app.commandLine.appendSwitch("disable-http-cache");
|
|
131
|
+
app.commandLine.appendSwitch('enable-transparent-visuals');
|
|
132
|
+
app.commandLine.appendSwitch('enable-gpu-rasterization', "true");
|
|
133
|
+
app.commandLine.appendSwitch('enable-native-gpu-memory-buffers', "true");
|
|
134
|
+
app.commandLine.appendSwitch('high-dpi-support', "true");
|
|
135
|
+
app.commandLine.appendSwitch('device-scale-factor', "true");
|
|
136
|
+
app.commandLine.appendSwitch('disable-touch-adjustment', "true");
|
|
137
|
+
app.commandLine.appendSwitch('main-frame-resizes-are-orientation-changes', "true");
|
|
138
|
+
app.commandLine.appendSwitch('disable-pinch', "true");
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
this.#downloadPath = options.paths.downloadPath;
|
|
142
|
+
} catch (e) {
|
|
143
|
+
this.#downloadPath = App.downloadsPath();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');
|
|
147
|
+
|
|
148
|
+
// Options
|
|
149
|
+
this.#appName = options.name;
|
|
150
|
+
this.#height = options.sizes.height;
|
|
151
|
+
this.#width = options.sizes.width;
|
|
152
|
+
this.#minHeight = options.sizes.minHeight;
|
|
153
|
+
this.#minWidth = options.sizes.minWidth;
|
|
154
|
+
this.#renderer = options.render;
|
|
155
|
+
this.#webSecurity = options.webSecurity;
|
|
156
|
+
this.#resizable = options.resizable;
|
|
157
|
+
this.#devTools = options.devTools;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
static #resizeIconTray(image) {
|
|
161
|
+
return require('electron').nativeImage.createFromPath(image).resize({width: 16, height: 16});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static #keyToChangeLower(obj, keyToChange, value) {
|
|
165
|
+
let keyToChangeLower = keyToChange.toLowerCase();
|
|
166
|
+
for (const key of Object.keys(obj)) {
|
|
167
|
+
if (key.toLowerCase() === keyToChangeLower) {
|
|
168
|
+
obj[key] = value;
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
obj[keyToChange] = value;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#createWindow(hideOnClose = Boolean()) {
|
|
176
|
+
this.#window = new BrowserWindow({
|
|
177
|
+
transparent: false,
|
|
178
|
+
width: this.#width,
|
|
179
|
+
height: this.#height,
|
|
180
|
+
minHeight: this.#minHeight,
|
|
181
|
+
minWidth: this.#minWidth,
|
|
182
|
+
name: this.#appName,
|
|
183
|
+
title: this.#appName,
|
|
184
|
+
show: false,
|
|
185
|
+
icon: this.#app_icon,
|
|
186
|
+
roundedCorners: true,
|
|
187
|
+
webPreferences: {
|
|
188
|
+
plugins: false,
|
|
189
|
+
nodeIntegration: true,
|
|
190
|
+
contextIsolation: false,
|
|
191
|
+
preload: this.#renderer,
|
|
192
|
+
spellcheck: false,
|
|
193
|
+
webviewTag: true,
|
|
194
|
+
enableRemoteModule: true,
|
|
195
|
+
webSecurity: this.#webSecurity,
|
|
196
|
+
nodeIntegrationInSubFrames: true,
|
|
197
|
+
},
|
|
198
|
+
frame: false,
|
|
199
|
+
resizable: this.#resizable,
|
|
200
|
+
minimizable: true,
|
|
201
|
+
maximizable: true,
|
|
202
|
+
center: true,
|
|
203
|
+
hasShadow: true
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
if (!this.#webSecurity) {
|
|
207
|
+
this.#window.webContents.session.webRequest.onBeforeSendHeaders((details, callback) => {
|
|
208
|
+
const {requestHeaders} = details;
|
|
209
|
+
Main.#keyToChangeLower(requestHeaders, 'Access-Control-Allow-Origin', ['*']);
|
|
210
|
+
Main.#keyToChangeLower(requestHeaders, 'X-Frame-Options', ['*']);
|
|
211
|
+
callback({requestHeaders});
|
|
212
|
+
},);
|
|
213
|
+
this.#window.webContents.session.webRequest.onHeadersReceived((details, callback) => {
|
|
214
|
+
const {responseHeaders} = details;
|
|
215
|
+
Main.#keyToChangeLower(responseHeaders, 'Access-Control-Allow-Origin', ['*']);
|
|
216
|
+
Main.#keyToChangeLower(responseHeaders, 'Access-Control-Allow-Headers', ['*']);
|
|
217
|
+
Main.#keyToChangeLower(responseHeaders, 'X-Frame-Options', ['*']);
|
|
218
|
+
callback({
|
|
219
|
+
responseHeaders, cancel: false
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
this.#window.loadURL(url.format({
|
|
225
|
+
pathname: path.join(__dirname, 'index.html'),
|
|
226
|
+
protocol: 'file:',
|
|
227
|
+
slashes: true
|
|
228
|
+
})).then(r => {
|
|
229
|
+
app.on('before-quit', () => {
|
|
230
|
+
isQuiting = true;
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
if (this.#devTools) {
|
|
235
|
+
this.#window.webContents.openDevTools();
|
|
236
|
+
this.#devToolsOpened = true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
this.#window.on("ready-to-show", () => setTimeout(() => {
|
|
240
|
+
this.#window.show()
|
|
241
|
+
// let data = fs.readFileSync(path.join(__dirname, "cam_test.js"), 'utf8');
|
|
242
|
+
// this.#window.webContents.executeJavaScript(data)
|
|
243
|
+
}, 650))
|
|
244
|
+
|
|
245
|
+
if (hideOnClose) {
|
|
246
|
+
this.#window.on('close', (evt) => {
|
|
247
|
+
if (!isQuiting) evt.preventDefault();
|
|
248
|
+
this.#window.hide();
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
if (this.#resizable === false) {
|
|
252
|
+
this.#window.webContents.on("did-finish-load", () => {
|
|
253
|
+
this.#window.webContents.send("chui_resizable_false")
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
toggleDevTools() {
|
|
259
|
+
if (this.#devToolsOpened) {
|
|
260
|
+
this.#window.webContents.closeDevTools();
|
|
261
|
+
this.#devToolsOpened = false;
|
|
262
|
+
} else {
|
|
263
|
+
this.#window.webContents.openDevTools();
|
|
264
|
+
this.#devToolsOpened = true;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
#hideAndShow() {
|
|
269
|
+
let visible = this.#window.isVisible()
|
|
270
|
+
let focus = this.#window.isFocused()
|
|
271
|
+
|
|
272
|
+
if (visible && focus) {
|
|
273
|
+
this.#window.hide()
|
|
274
|
+
} else if (!visible && !focus) {
|
|
275
|
+
this.#window.show()
|
|
276
|
+
} else {
|
|
277
|
+
this.#window.focus()
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
stop() {
|
|
282
|
+
if (process.platform !== 'darwin') {
|
|
283
|
+
app.quit();
|
|
284
|
+
} else {
|
|
285
|
+
app.exit(0)
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
restart() {
|
|
290
|
+
app.relaunch();
|
|
291
|
+
app.exit(0)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
getWindow() {
|
|
295
|
+
return this.#window;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
start(options = {hideOnClose: Boolean(), globalMenu: [], tray: [], extensions: []}) {
|
|
299
|
+
nativeTheme.themeSource = "system";
|
|
300
|
+
|
|
301
|
+
app.whenReady().then(() => {
|
|
302
|
+
session.defaultSession.setPermissionRequestHandler((webContents, permission, callback) => {
|
|
303
|
+
if (permission === 'media') {
|
|
304
|
+
callback(true); // Approve microphone/camera access
|
|
305
|
+
} else {
|
|
306
|
+
callback(false);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
if (options.extensions) {
|
|
311
|
+
for (let extension of options.extensions) session.defaultSession.loadExtension(extension).then(r => Log.info(r)).catch(e => Log.error(e))
|
|
312
|
+
}
|
|
313
|
+
if (options.tray) {
|
|
314
|
+
this.#tray = new Tray(this.#app_icon);
|
|
315
|
+
const context = Menu.buildFromTemplate(options.tray);
|
|
316
|
+
this.#tray.setContextMenu(context);
|
|
317
|
+
|
|
318
|
+
this.#tray.on("click", () => this.#hideAndShow())
|
|
319
|
+
}
|
|
320
|
+
if (options.globalMenu) {
|
|
321
|
+
const menu = Menu.buildFromTemplate(options.globalMenu)
|
|
322
|
+
Menu.setApplicationMenu(menu)
|
|
323
|
+
} else {
|
|
324
|
+
Menu.setApplicationMenu(null)
|
|
325
|
+
}
|
|
326
|
+
this.#createWindow(options.hideOnClose);
|
|
327
|
+
ipcMain.on("show_system_notification", (e, title, body) => {
|
|
328
|
+
let {Notification} = require('electron');
|
|
329
|
+
new Notification({title, body}).show();
|
|
330
|
+
})
|
|
331
|
+
require("@electron/remote/main").initialize();
|
|
332
|
+
require("@electron/remote/main").enable(this.#window.webContents);
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
ipcMain.on("SEND_LOG_TEXT", (e, text, type) => {
|
|
336
|
+
if (type === "info") {
|
|
337
|
+
console.info(text)
|
|
338
|
+
} else if (type === "error") {
|
|
339
|
+
console.error(text)
|
|
340
|
+
}
|
|
341
|
+
this.#writeLog(text)
|
|
342
|
+
})
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
#writeLog(text) {
|
|
346
|
+
let today = new Date().toLocaleDateString().replace("/", ".")
|
|
347
|
+
let log_dir_path = path.join(app.getPath("userData"), "logs")
|
|
348
|
+
let log_file_path = path.join(log_dir_path, `app_${today}.log`)
|
|
349
|
+
|
|
350
|
+
if (!fs.existsSync(log_dir_path)) {
|
|
351
|
+
fs.mkdirSync(log_dir_path, { recursive: true });
|
|
352
|
+
fs.writeFileSync(log_file_path, "", "utf-8");
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
fs.writeFile(log_file_path, `${text}\n`, { flag: 'a+' }, err => {
|
|
356
|
+
if (err) console.error(err);
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
enableAutoUpdateApp(start = Number()) {
|
|
361
|
+
setTimeout(async () => {
|
|
362
|
+
const {autoUpdater} = require("electron-updater");
|
|
363
|
+
autoUpdater.autoInstallOnAppQuit = false;
|
|
364
|
+
let updates = await autoUpdater.checkForUpdates();
|
|
365
|
+
if (updates !== null) {
|
|
366
|
+
if (updates.versionInfo.version > app.getVersion()) {
|
|
367
|
+
await this.#sendNotificationUpdateLoad(this.#appName, `Загрузка новой версии ${updates.versionInfo.version}`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
autoUpdater.on('update-downloaded', async () => {
|
|
371
|
+
await this.#sendNotificationUpdateLoadClose();
|
|
372
|
+
await this.#sendNotificationUpdate(this.#appName, `Загрузка завершена`);
|
|
373
|
+
setTimeout(async () => await this.#sendNotificationUpdateClose(), 3000);
|
|
374
|
+
Log.info("Обновление скачано!");
|
|
375
|
+
this.#window.webContents.send("checkUpdatesTrue", true, updates.versionInfo.version);
|
|
376
|
+
ipcMain.on("updateInstallConfirm", (e, check) => {
|
|
377
|
+
if (check) {
|
|
378
|
+
Log.info("Установка обновления...");
|
|
379
|
+
autoUpdater.quitAndInstall();
|
|
380
|
+
}
|
|
381
|
+
})
|
|
382
|
+
});
|
|
383
|
+
}, start);
|
|
384
|
+
}
|
|
385
|
+
async #sendNotificationUpdateLoad(text, body) {
|
|
386
|
+
this.#window.webContents.send("sendNotificationUpdateLoad", text, body);
|
|
387
|
+
}
|
|
388
|
+
async #sendNotificationUpdateLoadClose() {
|
|
389
|
+
this.#window.webContents.send("sendNotificationUpdateLoadClose");
|
|
390
|
+
}
|
|
391
|
+
async #sendNotificationUpdate(text, body) {
|
|
392
|
+
this.#window.webContents.send("sendNotificationUpdate", text, body);
|
|
393
|
+
}
|
|
394
|
+
async #sendNotificationUpdateClose() {
|
|
395
|
+
this.#window.webContents.send("sendNotificationUpdateClose");
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
sendDownload(text, body) {
|
|
399
|
+
setTimeout(() => this.#window.webContents.send("sendNotificationDownload", text, body), 1)
|
|
400
|
+
}
|
|
401
|
+
sendDownloadUpdate(text, body) {
|
|
402
|
+
setTimeout(() => this.#window.webContents.send("sendNotificationDownloadUpdate", text, body), 1)
|
|
403
|
+
}
|
|
404
|
+
sendDownloadComplete(text, body) {
|
|
405
|
+
setTimeout(() => this.#window.webContents.send("sendNotificationDownloadComplete", text, body), 250)
|
|
406
|
+
}
|
|
407
|
+
sendDownloadError(text, body) {
|
|
408
|
+
setTimeout(() => this.#window.webContents.send("sendNotificationDownloadError", text, body), 250)
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
class Styles {
|
|
413
|
+
static WORD_BREAK = {NORMAL: "normal", BREAK_ALL: "break-all", KEEP_ALL: "keep-all", BREAK_WORD: "break-word"}
|
|
414
|
+
static TEXT_ALIGN = {CENTER: 'center', END: 'end', START: 'start'};
|
|
415
|
+
static ALIGN = {CENTER: 'center', END: 'flex-end', START: 'flex-start', BASELINE: 'baseline', STRETCH: 'stretch'};
|
|
416
|
+
static JUSTIFY = {
|
|
417
|
+
CENTER: 'center',
|
|
418
|
+
END: 'flex-end',
|
|
419
|
+
START: 'flex-start',
|
|
420
|
+
SPACE_AROUND: 'space-around',
|
|
421
|
+
SPACE_BEETWEEN: 'space-between',
|
|
422
|
+
SPACE_EVENLY: 'space-evenly'
|
|
423
|
+
};
|
|
424
|
+
static DIRECTION = {ROW: 'row', COLUMN: 'column'};
|
|
425
|
+
static WRAP = {NOWRAP: 'nowrap', WRAP: 'wrap'};
|
|
426
|
+
static SIZE = {
|
|
427
|
+
AUTO: 'auto',
|
|
428
|
+
FIT_CONTENT: 'fit-content',
|
|
429
|
+
MAX_CONTENT: 'max-content',
|
|
430
|
+
MIN_CONTENT: 'min-content',
|
|
431
|
+
WEBKIT_FILL: '-webkit-fill-available',
|
|
432
|
+
INHERIT: 'inherit'
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
class Application {
|
|
437
|
+
getApp() {
|
|
438
|
+
if (process && process.type === 'renderer') {
|
|
439
|
+
return require("@electron/remote").app;
|
|
440
|
+
} else {
|
|
441
|
+
return app;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
getSession() {
|
|
445
|
+
if (process && process.type === 'renderer') {
|
|
446
|
+
return require("@electron/remote").session;
|
|
447
|
+
} else {
|
|
448
|
+
return session;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
getWebContents() {
|
|
452
|
+
if (process && process.type === 'renderer') {
|
|
453
|
+
return require("@electron/remote").webContents;
|
|
454
|
+
} else {
|
|
455
|
+
return webContents;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
class App {
|
|
461
|
+
static get() { return new Application().getApp() }
|
|
462
|
+
static getSession() { return new Application().getSession() }
|
|
463
|
+
static getWebContents() { return new Application().getWebContents() }
|
|
464
|
+
// ПУТИ
|
|
465
|
+
static homePath() { return new Application().getApp().getPath("home") }
|
|
466
|
+
static appDataPath() { return new Application().getApp().getPath("appData") }
|
|
467
|
+
static userDataPath() { return new Application().getApp().getPath("userData") }
|
|
468
|
+
static sessionDataPath() { return new Application().getApp().getPath("sessionData") }
|
|
469
|
+
static logsPath() { return new Application().getApp().getPath("logs") }
|
|
470
|
+
static tempPath() { return new Application().getApp().getPath("temp") }
|
|
471
|
+
static exePath() { return new Application().getApp().getPath("exe") }
|
|
472
|
+
static modulePath() { return new Application().getApp().getPath("module") }
|
|
473
|
+
static desktopPath() { return new Application().getApp().getPath("desktop") }
|
|
474
|
+
static documentsPath() { return new Application().getApp().getPath("documents") }
|
|
475
|
+
static downloadsPath() { return new Application().getApp().getPath("downloads") }
|
|
476
|
+
static musicPath() { return new Application().getApp().getPath("music") }
|
|
477
|
+
static picturesPath() { return new Application().getApp().getPath("pictures") }
|
|
478
|
+
static videosPath() { return new Application().getApp().getPath("videos") }
|
|
479
|
+
static recentPath() { return new Application().getApp().getPath("recent") }
|
|
480
|
+
static crashDumpsPath() { return new Application().getApp().getPath("crashDumps") }
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
module.exports = {
|
|
484
|
+
Main: Main,
|
|
485
|
+
sleep: sleep,
|
|
486
|
+
render: render,
|
|
487
|
+
formatBytes: formatBytes,
|
|
488
|
+
MenuItem: MenuItem,
|
|
489
|
+
Styles: Styles,
|
|
490
|
+
AppLayout: AppLayout,
|
|
491
|
+
Route: Route,
|
|
492
|
+
Page: Page,
|
|
493
|
+
WebView: WebView,
|
|
494
|
+
Button: Button,
|
|
495
|
+
Spinner: Spinner,
|
|
496
|
+
TextInput: TextInput,
|
|
497
|
+
DateInput: DateInput,
|
|
498
|
+
NumberInput: NumberInput,
|
|
499
|
+
EmailInput: EmailInput,
|
|
500
|
+
PasswordInput: PasswordInput,
|
|
501
|
+
Select: Select,
|
|
502
|
+
Calendar: Calendar,
|
|
503
|
+
Badge: Badge,
|
|
504
|
+
TextEditor: TextEditor,
|
|
505
|
+
Icon: Icon,
|
|
506
|
+
Icons: Icons,
|
|
507
|
+
TextArea: TextArea,
|
|
508
|
+
CheckBox: CheckBox,
|
|
509
|
+
RadioButton: RadioButton,
|
|
510
|
+
Details: Details,
|
|
511
|
+
Table: Table,
|
|
512
|
+
H: H,
|
|
513
|
+
Paragraph: Paragraph,
|
|
514
|
+
Dialog: Dialog,
|
|
515
|
+
Label: Label,
|
|
516
|
+
ContentBlock: ContentBlock,
|
|
517
|
+
Card: Card,
|
|
518
|
+
Hero: Hero,
|
|
519
|
+
ProgressBar: ProgressBar,
|
|
520
|
+
Toggle: Toggle,
|
|
521
|
+
Image: Image,
|
|
522
|
+
BarGraph: BarGraph,
|
|
523
|
+
PieGraph: PieGraph,
|
|
524
|
+
Tabs: Tabs,
|
|
525
|
+
Tab: Tab,
|
|
526
|
+
Notification: Notification,
|
|
527
|
+
ComboBox: ComboBox,
|
|
528
|
+
MultiComboBox: MultiComboBox,
|
|
529
|
+
RadioGroup: RadioGroup,
|
|
530
|
+
Accordion: Accordion,
|
|
531
|
+
CodeBlock: CodeBlock,
|
|
532
|
+
HtmlBlock: HtmlBlock,
|
|
533
|
+
FileInput: FileInput,
|
|
534
|
+
AcceptTypes: AcceptTypes,
|
|
535
|
+
TreeView: TreeView,
|
|
536
|
+
Form: Form,
|
|
537
|
+
SlideShow: SlideShow,
|
|
538
|
+
FieldSet: FieldSet,
|
|
539
|
+
Popup: Popup,
|
|
540
|
+
MenuBar: MenuBar,
|
|
541
|
+
ContextMenu: ContextMenu,
|
|
542
|
+
UpdateNotification: UpdateNotification,
|
|
543
|
+
DownloadNotification: DownloadNotification,
|
|
544
|
+
DownloadProgressNotification: DownloadProgressNotification,
|
|
545
|
+
Audio: Audio,
|
|
546
|
+
Video: Video,
|
|
547
|
+
CustomElement: CustomElement,
|
|
548
|
+
Console: Console,
|
|
549
|
+
//
|
|
550
|
+
TelegramBot: TelegramBot,
|
|
551
|
+
//
|
|
552
|
+
BrowserWindow: BrowserWindow,
|
|
553
|
+
ipcMain: ipcMain,
|
|
554
|
+
ipcRenderer: ipcRenderer,
|
|
555
|
+
shell: shell,
|
|
556
|
+
path: path,
|
|
557
|
+
fs: fs,
|
|
558
|
+
os: os,
|
|
559
|
+
request: request,
|
|
560
|
+
transliterate: transliterate,
|
|
561
|
+
store: new Store(),
|
|
562
|
+
//
|
|
563
|
+
App: App,
|
|
564
|
+
//
|
|
565
|
+
downloadSession: downloadSession,
|
|
566
|
+
Log: Log,
|
|
567
|
+
chooseFile: dialog,
|
|
568
|
+
//
|
|
569
|
+
systemPreferences: systemPreferences
|
|
570
|
+
}
|