chuijs 4.0.3 → 4.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 (258) hide show
  1. package/CHANGELOG.md +536 -0
  2. package/framework/appLayout/default/chui_app_layout.js +361 -303
  3. package/framework/appLayout/default/global_style.css +243 -89
  4. package/framework/appLayout/default/main_theme_style.css +188 -101
  5. package/framework/components/chui_accordion/accordion.js +17 -17
  6. package/framework/components/chui_accordion/styles.css +7 -7
  7. package/framework/components/chui_action_sheet/action_sheet.js +35 -32
  8. package/framework/components/chui_action_sheet/styles.css +10 -4
  9. package/framework/components/chui_actions_bar/actions_bar.js +338 -0
  10. package/framework/components/chui_actions_bar/styles.css +139 -0
  11. package/framework/components/chui_affix/affix.js +4 -4
  12. package/framework/components/chui_affix/styles.css +5 -0
  13. package/framework/components/chui_alert/alert.js +11 -5
  14. package/framework/components/chui_alert/styles.css +7 -0
  15. package/framework/components/chui_avatar/avatar.js +13 -13
  16. package/framework/components/chui_avatar/styles.css +1 -1
  17. package/framework/components/chui_avatar_group/avatar_group.js +4 -4
  18. package/framework/components/chui_avatar_group/styles.css +1 -1
  19. package/framework/components/chui_backtop/backtop.js +25 -2
  20. package/framework/components/chui_backtop/styles.css +21 -0
  21. package/framework/components/chui_badge/badge.js +15 -15
  22. package/framework/components/chui_badge/styles.css +6 -6
  23. package/framework/components/chui_banner/banner.js +222 -0
  24. package/framework/components/chui_banner/styles.css +170 -0
  25. package/framework/components/chui_breadcrumb/styles.css +1 -1
  26. package/framework/components/chui_button/button.js +24 -28
  27. package/framework/components/chui_button/styles.css +5 -5
  28. package/framework/components/chui_calendar/calendar.js +6 -6
  29. package/framework/components/chui_card/card.js +14 -14
  30. package/framework/components/chui_card_scroll/card_scroll.js +169 -0
  31. package/framework/components/chui_card_scroll/styles.css +86 -0
  32. package/framework/components/chui_chat/chat.js +73 -51
  33. package/framework/components/chui_chat/styles.css +18 -7
  34. package/framework/components/chui_clipboard_history/clipboard_history.js +25 -20
  35. package/framework/components/chui_clipboard_history/styles.css +10 -8
  36. package/framework/components/chui_code/code.js +8 -8
  37. package/framework/components/chui_code/styles.css +2 -2
  38. package/framework/components/chui_code_editor/code_editor.js +26 -26
  39. package/framework/components/chui_code_editor/styles.css +3 -3
  40. package/framework/components/chui_command_palette/command_palette.js +29 -29
  41. package/framework/components/chui_command_palette/styles.css +5 -5
  42. package/framework/components/chui_console/console.js +9 -9
  43. package/framework/components/chui_console/styles.css +5 -2
  44. package/framework/components/chui_content_block/content_block.js +2 -2
  45. package/framework/components/chui_context_menu/context_menu.js +162 -54
  46. package/framework/components/chui_context_menu/styles.css +82 -8
  47. package/framework/components/chui_custom_element/custom_element.js +11 -11
  48. package/framework/components/chui_data_grid/data_grid.js +268 -268
  49. package/framework/components/chui_data_grid/styles.css +14 -14
  50. package/framework/components/chui_descriptions/styles.css +1 -1
  51. package/framework/components/chui_details/details.js +12 -12
  52. package/framework/components/chui_details/styles.css +7 -7
  53. package/framework/components/chui_diff_viewer/diff_viewer.js +88 -88
  54. package/framework/components/chui_diff_viewer/styles.css +9 -9
  55. package/framework/components/chui_divider/divider.js +6 -6
  56. package/framework/components/chui_divider/styles.css +2 -2
  57. package/framework/components/chui_drawer/drawer.js +37 -14
  58. package/framework/components/chui_drawer/styles.css +18 -4
  59. package/framework/components/chui_drop_zone/drop_zone.js +6 -6
  60. package/framework/components/chui_drop_zone/styles.css +10 -6
  61. package/framework/components/chui_fieldset/fieldset.js +6 -6
  62. package/framework/components/chui_fieldset/styles.css +5 -5
  63. package/framework/components/chui_file_explorer/file_explorer.js +115 -115
  64. package/framework/components/chui_file_explorer/styles.css +6 -6
  65. package/framework/components/chui_form/form.js +11 -11
  66. package/framework/components/chui_gantt/gantt.js +41 -41
  67. package/framework/components/chui_gantt/styles.css +5 -5
  68. package/framework/components/chui_graphs/graphs.js +82 -46
  69. package/framework/components/chui_graphs/styles.css +26 -5
  70. package/framework/components/chui_hero/hero.js +63 -20
  71. package/framework/components/chui_hero/styles.css +176 -7
  72. package/framework/components/chui_html_block/html_block.js +5 -5
  73. package/framework/components/chui_html_block/styles.css +1 -1
  74. package/framework/components/chui_hx/styles.css +2 -2
  75. package/framework/components/chui_icons/icons.js +7 -7
  76. package/framework/components/chui_icons/styles.css +2 -1
  77. package/framework/components/chui_inputs/chui_check_box/styles.css +12 -3
  78. package/framework/components/chui_inputs/chui_chips/chips.js +92 -31
  79. package/framework/components/chui_inputs/chui_chips/styles.css +28 -5
  80. package/framework/components/chui_inputs/chui_color_picker/color_picker.js +20 -15
  81. package/framework/components/chui_inputs/chui_color_picker/styles.css +7 -7
  82. package/framework/components/chui_inputs/chui_combo_box/combo_box.js +58 -58
  83. package/framework/components/chui_inputs/chui_combo_box/styles.css +9 -9
  84. package/framework/components/chui_inputs/chui_date/date.js +93 -95
  85. package/framework/components/chui_inputs/chui_date/styles.css +8 -8
  86. package/framework/components/chui_inputs/chui_date_range/date_range.js +22 -22
  87. package/framework/components/chui_inputs/chui_date_range/styles.css +3 -3
  88. package/framework/components/chui_inputs/chui_datetime/datetime.js +12 -12
  89. package/framework/components/chui_inputs/chui_datetime/styles.css +3 -3
  90. package/framework/components/chui_inputs/chui_email/email.js +10 -10
  91. package/framework/components/chui_inputs/chui_email/styles.css +6 -6
  92. package/framework/components/chui_inputs/chui_file/file.js +8 -8
  93. package/framework/components/chui_inputs/chui_file/styles.css +12 -9
  94. package/framework/components/chui_inputs/chui_hotkey/hotkey.js +39 -39
  95. package/framework/components/chui_inputs/chui_hotkey/styles.css +6 -6
  96. package/framework/components/chui_inputs/chui_masked/masked.js +44 -44
  97. package/framework/components/chui_inputs/chui_masked/styles.css +5 -5
  98. package/framework/components/chui_inputs/chui_mention/mention.js +13 -13
  99. package/framework/components/chui_inputs/chui_mention/styles.css +14 -8
  100. package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +147 -137
  101. package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +14 -8
  102. package/framework/components/chui_inputs/chui_number/number.js +42 -45
  103. package/framework/components/chui_inputs/chui_number/styles.css +6 -6
  104. package/framework/components/chui_inputs/chui_otp/otp.js +32 -32
  105. package/framework/components/chui_inputs/chui_otp/styles.css +5 -5
  106. package/framework/components/chui_inputs/chui_password/password.js +30 -36
  107. package/framework/components/chui_inputs/chui_password/styles.css +7 -7
  108. package/framework/components/chui_inputs/chui_radio_button/styles.css +2 -2
  109. package/framework/components/chui_inputs/chui_rating/rating.js +28 -28
  110. package/framework/components/chui_inputs/chui_rating/styles.css +3 -3
  111. package/framework/components/chui_inputs/chui_select_box/select_box.js +54 -54
  112. package/framework/components/chui_inputs/chui_select_box/styles.css +10 -10
  113. package/framework/components/chui_inputs/chui_slider/slider.js +14 -14
  114. package/framework/components/chui_inputs/chui_slider/styles.css +5 -4
  115. package/framework/components/chui_inputs/chui_text/styles.css +7 -7
  116. package/framework/components/chui_inputs/chui_text/text.js +13 -17
  117. package/framework/components/chui_inputs/chui_text_area/styles.css +8 -8
  118. package/framework/components/chui_inputs/chui_text_area/text_area.js +23 -23
  119. package/framework/components/chui_inputs/chui_time/styles.css +13 -17
  120. package/framework/components/chui_inputs/chui_time/time.js +35 -24
  121. package/framework/components/chui_inputs/chui_toggle/styles.css +10 -3
  122. package/framework/components/chui_inputs/chui_toggle/toggle.js +16 -16
  123. package/framework/components/chui_json_editor/json_editor.js +87 -87
  124. package/framework/components/chui_json_editor/styles.css +5 -5
  125. package/framework/components/chui_json_viewer/json_viewer.js +80 -80
  126. package/framework/components/chui_json_viewer/styles.css +6 -6
  127. package/framework/components/chui_kanban/kanban.js +27 -27
  128. package/framework/components/chui_kanban/styles.css +8 -4
  129. package/framework/components/chui_kbd/styles.css +1 -1
  130. package/framework/components/chui_label/label.js +17 -17
  131. package/framework/components/chui_label/styles.css +1 -1
  132. package/framework/components/chui_link/link.js +9 -9
  133. package/framework/components/chui_link/styles.css +11 -4
  134. package/framework/components/chui_list/list.js +11 -11
  135. package/framework/components/chui_list/styles.css +2 -2
  136. package/framework/components/chui_markdown_editor/markdown_editor.js +66 -66
  137. package/framework/components/chui_markdown_editor/styles.css +5 -5
  138. package/framework/components/chui_media/audio.js +240 -246
  139. package/framework/components/chui_media/audio_styles.css +41 -23
  140. package/framework/components/chui_media/image.js +49 -46
  141. package/framework/components/chui_media/image_compare.js +35 -35
  142. package/framework/components/chui_media/image_compare_styles.css +5 -5
  143. package/framework/components/chui_media/image_styles.css +1 -1
  144. package/framework/components/chui_media/video.js +148 -148
  145. package/framework/components/chui_media/video_styles.css +27 -11
  146. package/framework/components/chui_menu_bar/menu_bar.js +54 -54
  147. package/framework/components/chui_menu_bar/styles.css +10 -10
  148. package/framework/components/chui_message_bar/message_bar.js +551 -0
  149. package/framework/components/chui_message_bar/styles.css +248 -0
  150. package/framework/components/chui_modal/modal.js +37 -13
  151. package/framework/components/chui_notification/notification.js +76 -54
  152. package/framework/components/chui_notification/notification_download.js +26 -81
  153. package/framework/components/chui_notification/notification_download_card.js +115 -0
  154. package/framework/components/chui_notification/notification_download_progress.css +2 -2
  155. package/framework/components/chui_notification/notification_download_progress.js +70 -108
  156. package/framework/components/chui_notification/notification_update.js +31 -31
  157. package/framework/components/chui_notification/status_plate.css +3 -3
  158. package/framework/components/chui_notification/styles.css +6 -1
  159. package/framework/components/chui_notification/styles_download.css +1 -1
  160. package/framework/components/chui_notification/styles_update.css +2 -2
  161. package/framework/components/chui_org_chart/org_chart.js +29 -29
  162. package/framework/components/chui_org_chart/styles.css +2 -2
  163. package/framework/components/chui_pagination/pagination.js +3 -3
  164. package/framework/components/chui_pagination/styles.css +1 -1
  165. package/framework/components/chui_paragraph/styles.css +2 -2
  166. package/framework/components/chui_popover/popover.js +29 -23
  167. package/framework/components/chui_popover/styles.css +1 -1
  168. package/framework/components/chui_popups/popups.js +124 -124
  169. package/framework/components/chui_popups/styles.css +5 -5
  170. package/framework/components/chui_print_button/print_button.js +15 -10
  171. package/framework/components/chui_progress_bar/progress_bar.js +34 -12
  172. package/framework/components/chui_progress_bar/styles.css +4 -4
  173. package/framework/components/chui_progress_ring/progress_ring.js +15 -15
  174. package/framework/components/chui_progress_ring/styles.css +1 -1
  175. package/framework/components/chui_qrcode/qrcode.js +12 -12
  176. package/framework/components/chui_query_builder/query_builder.js +46 -46
  177. package/framework/components/chui_query_builder/styles.css +4 -4
  178. package/framework/components/chui_radio_group/styles.css +1 -1
  179. package/framework/components/chui_result/result.js +15 -15
  180. package/framework/components/chui_result/styles.css +3 -3
  181. package/framework/components/chui_scheduler/scheduler.js +74 -74
  182. package/framework/components/chui_scheduler/styles.css +5 -5
  183. package/framework/components/chui_screen_spinner/screen_spinner.js +167 -0
  184. package/framework/components/chui_screen_spinner/styles.css +49 -0
  185. package/framework/components/chui_segmented_control/segmented_control.js +63 -6
  186. package/framework/components/chui_segmented_control/styles.css +32 -6
  187. package/framework/components/chui_settings/settings.js +45 -46
  188. package/framework/components/chui_settings/styles.css +4 -4
  189. package/framework/components/chui_shortcut_help/shortcut_help.js +32 -34
  190. package/framework/components/chui_sidebar_nav/sidebar_nav.js +98 -29
  191. package/framework/components/chui_sidebar_nav/styles.css +9 -3
  192. package/framework/components/chui_slideshow/slideshow.js +85 -85
  193. package/framework/components/chui_slideshow/styles.css +6 -6
  194. package/framework/components/chui_spinner/spinner.js +10 -10
  195. package/framework/components/chui_split_button/split_button.js +30 -12
  196. package/framework/components/chui_split_button/styles.css +21 -5
  197. package/framework/components/chui_splitter/splitter.js +11 -11
  198. package/framework/components/chui_splitter/styles.css +2 -2
  199. package/framework/components/chui_statistic/statistic.js +47 -47
  200. package/framework/components/chui_status_bar/styles.css +2 -2
  201. package/framework/components/chui_stepper/stepper.js +202 -31
  202. package/framework/components/chui_stepper/styles.css +79 -14
  203. package/framework/components/chui_sticky_bar/sticky_bar.js +44 -13
  204. package/framework/components/chui_sticky_bar/styles.css +10 -8
  205. package/framework/components/chui_tabs/chui_tabs.js +74 -26
  206. package/framework/components/chui_tabs/styles.css +40 -12
  207. package/framework/components/chui_text_editor/styles.css +7 -7
  208. package/framework/components/chui_text_editor/text_editor.js +56 -56
  209. package/framework/components/chui_text_editor/text_editor_panel.js +173 -174
  210. package/framework/components/chui_theme_toggle/theme_toggle.js +21 -5
  211. package/framework/components/chui_timeline/styles.css +3 -1
  212. package/framework/components/chui_toast_queue/styles.css +11 -11
  213. package/framework/components/chui_toast_queue/toast_queue.js +30 -27
  214. package/framework/components/chui_toolbar/styles.css +2 -2
  215. package/framework/components/chui_tooltip/styles.css +2 -2
  216. package/framework/components/chui_tooltip/tooltip.js +3 -3
  217. package/framework/components/chui_tour/styles.css +8 -8
  218. package/framework/components/chui_tour/tour.js +72 -72
  219. package/framework/components/chui_transfer/styles.css +6 -6
  220. package/framework/components/chui_transfer/transfer.js +93 -106
  221. package/framework/components/chui_tree_table/styles.css +4 -4
  222. package/framework/components/chui_tree_table/tree_table.js +45 -45
  223. package/framework/components/chui_tree_view/styles.css +10 -8
  224. package/framework/components/chui_tree_view/tree_view.js +185 -183
  225. package/framework/components/chui_user_bar/styles.css +145 -0
  226. package/framework/components/chui_user_bar/user_bar.js +402 -0
  227. package/framework/components/chui_user_list_bar/styles.css +173 -0
  228. package/framework/components/chui_user_list_bar/user_list_bar.js +485 -0
  229. package/framework/components/chui_watermark/watermark.js +17 -17
  230. package/framework/components/chui_webview/webview.js +9 -9
  231. package/framework/components/chui_write_bar/styles.css +172 -0
  232. package/framework/components/chui_write_bar/write_bar.js +320 -0
  233. package/framework/main_window.js +1234 -0
  234. package/framework/modules/chui_a11y/chui_a11y.js +78 -79
  235. package/framework/modules/chui_animations/animations.js +77 -15
  236. package/framework/modules/chui_animations/motion.js +120 -0
  237. package/framework/modules/chui_animations/styles.css +36 -3
  238. package/framework/modules/chui_functions.js +31 -27
  239. package/framework/modules/chui_highlight/styles.css +13 -10
  240. package/framework/modules/chui_i18n/chui_i18n.js +3 -3
  241. package/framework/modules/chui_i18n/locales/feedback.js +62 -0
  242. package/framework/modules/chui_i18n/locales/navigation.js +4 -0
  243. package/framework/modules/chui_json/chui_json.js +2 -2
  244. package/framework/modules/chui_logger/chui_logger.js +23 -8
  245. package/framework/modules/chui_page/page.js +10 -10
  246. package/framework/modules/chui_palette/palette.js +61 -0
  247. package/framework/modules/chui_qr/chui_qr.js +23 -23
  248. package/framework/modules/chui_scrollbar/chui_scrollbar.js +45 -45
  249. package/framework/modules/chui_scrollbar/styles.css +3 -3
  250. package/framework/modules/chui_services/chui_services.js +8 -8
  251. package/framework/modules/chui_services/desktop.js +77 -71
  252. package/framework/modules/chui_sortable/chui_sortable.js +17 -17
  253. package/framework/modules/chui_validate/chui_validate.js +3 -3
  254. package/framework/tray_bar/chui_menu_items.js +2 -2
  255. package/index.d.ts +266 -34
  256. package/index.js +20 -1168
  257. package/package.json +6 -4
  258. package/framework/components/telegram_bot/chui_telegram_bot.js +0 -191
@@ -161,11 +161,11 @@ class QR {
161
161
  * `version` по умолчанию — 40: это предел всего формата.
162
162
  */
163
163
  static capacity(version = MAX_VERSION, level = LEVELS.MEDIUM, mode = MODES.AUTO) {
164
- const checked_level = QR.#checkLevel(QR.#option(level));
164
+ const checkedLevel = QR.#checkLevel(QR.#option(level));
165
165
  const chosen = QR.#option(mode);
166
- const checked_mode = chosen === undefined || chosen === MODES.AUTO ? MODES.BYTE : QR.#checkMode(chosen);
167
- const checked_version = QR.#checkVersion(QR.#option(version) === undefined ? MAX_VERSION : version);
168
- return QR.#capacity(checked_version, checked_level, checked_mode);
166
+ const checkedMode = chosen === undefined || chosen === MODES.AUTO ? MODES.BYTE : QR.#checkMode(chosen);
167
+ const checkedVersion = QR.#checkVersion(QR.#option(version) === undefined ? MAX_VERSION : version);
168
+ return QR.#capacity(checkedVersion, checkedLevel, checkedMode);
169
169
  }
170
170
 
171
171
  /** Режим, который выберет `AUTO` для этой строки: цифры, буквы и цифры или байты */
@@ -217,10 +217,10 @@ class QR {
217
217
  const level = QR.#checkLevel(QR.#option(options.level));
218
218
  const requested = QR.#option(options.mode);
219
219
  const mode = requested === undefined || requested === MODES.AUTO ? MODES.AUTO : QR.#checkMode(requested);
220
- const min_version = QR.#option(options.minVersion);
221
- const max_version = QR.#option(options.maxVersion);
222
- const first = QR.#checkVersion(min_version === undefined ? MIN_VERSION : min_version);
223
- const last = QR.#checkVersion(max_version === undefined ? MAX_VERSION : max_version);
220
+ const minVersion = QR.#option(options.minVersion);
221
+ const maxVersion = QR.#option(options.maxVersion);
222
+ const first = QR.#checkVersion(minVersion === undefined ? MIN_VERSION : minVersion);
223
+ const last = QR.#checkVersion(maxVersion === undefined ? MAX_VERSION : maxVersion);
224
224
  if (first > last) throw new RangeError("QR: minVersion больше maxVersion");
225
225
  const mask = QR.#option(options.mask) === undefined ? undefined : QR.#checkMask(options.mask);
226
226
 
@@ -254,15 +254,15 @@ class QR {
254
254
  const size = QR.size(version);
255
255
  const pattern = QR.#functionPatterns(version, level);
256
256
  QR.#placeData(pattern.modules, pattern.isFunction, codewords, size);
257
- const chosen_mask = mask === undefined ? QR.#bestMask(pattern.modules, pattern.isFunction, size, level) : mask;
258
- QR.#applyMask(pattern.modules, pattern.isFunction, size, chosen_mask);
259
- QR.#drawFormat(pattern.modules, pattern.isFunction, size, level, chosen_mask);
257
+ const chosenMask = mask === undefined ? QR.#bestMask(pattern.modules, pattern.isFunction, size, level) : mask;
258
+ QR.#applyMask(pattern.modules, pattern.isFunction, size, chosenMask);
259
+ QR.#drawFormat(pattern.modules, pattern.isFunction, size, level, chosenMask);
260
260
  return {
261
261
  ok: true,
262
262
  matrix: pattern.modules,
263
263
  size: size,
264
264
  version: version,
265
- mask: chosen_mask,
265
+ mask: chosenMask,
266
266
  level: level,
267
267
  mode: payload.mode,
268
268
  length: payload.length,
@@ -343,27 +343,27 @@ class QR {
343
343
  */
344
344
  static #interleave(data = [], version = MIN_VERSION, level = LEVELS.MEDIUM) {
345
345
  const blocks = EC_BLOCKS[LEVEL_INFO[level].index][version - 1];
346
- const ec_length = EC_CODEWORDS[LEVEL_INFO[level].index][version - 1];
346
+ const errorCorrectionLength = EC_CODEWORDS[LEVEL_INFO[level].index][version - 1];
347
347
  const total = QR.#rawDataModules(version) >> 3;
348
- const short_length = Math.floor(total / blocks) - ec_length;
349
- const short_blocks = blocks - (total % blocks);
350
- const divisor = QR.#divisor(ec_length);
348
+ const shortLength = Math.floor(total / blocks) - errorCorrectionLength;
349
+ const shortBlocks = blocks - (total % blocks);
350
+ const divisor = QR.#divisor(errorCorrectionLength);
351
351
  const chunks = [];
352
352
  let offset = 0;
353
353
  for (let index = 0; index < blocks; index += 1) {
354
- const length = short_length + (index < short_blocks ? 0 : 1);
354
+ const length = shortLength + (index < shortBlocks ? 0 : 1);
355
355
  const chunk = data.slice(offset, offset + length);
356
356
  offset += length;
357
357
  chunks.push({ data: chunk, ec: QR.#remainder(chunk, divisor) });
358
358
  }
359
359
  const result = [];
360
- const longest = short_length + 1;
360
+ const longest = shortLength + 1;
361
361
  for (let position = 0; position < longest; position += 1) {
362
362
  for (const chunk of chunks) {
363
363
  if (position < chunk.data.length) result.push(chunk.data[position]);
364
364
  }
365
365
  }
366
- for (let position = 0; position < ec_length; position += 1) {
366
+ for (let position = 0; position < errorCorrectionLength; position += 1) {
367
367
  for (const chunk of chunks) result.push(chunk.ec[position]);
368
368
  }
369
369
  return result;
@@ -371,7 +371,7 @@ class QR {
371
371
 
372
372
  /** Порождающий полином коррекции степени `degree` (без старшего члена) */
373
373
  static #divisor(degree = Number()) {
374
- let result = new Array(degree).fill(0);
374
+ const result = new Array(degree).fill(0);
375
375
  result[degree - 1] = 1;
376
376
  let root = 1;
377
377
  for (let index = 0; index < degree; index += 1) {
@@ -578,14 +578,14 @@ class QR {
578
578
  /** Маска с наименьшим штрафом; повторное применение снимает маску */
579
579
  static #bestMask(modules = [], isFunction = [], size = Number(), level = LEVELS.MEDIUM) {
580
580
  let best = 0;
581
- let best_score = Infinity;
581
+ let bestScore = Infinity;
582
582
  for (let mask = 0; mask < 8; mask += 1) {
583
583
  QR.#applyMask(modules, isFunction, size, mask);
584
584
  QR.#drawFormat(modules, isFunction, size, level, mask);
585
585
  const score = QR.#penalty(modules, size);
586
- if (score < best_score) {
586
+ if (score < bestScore) {
587
587
  best = mask;
588
- best_score = score;
588
+ bestScore = score;
589
589
  }
590
590
  QR.#applyMask(modules, isFunction, size, mask);
591
591
  }
@@ -122,22 +122,22 @@ class Scrollbar {
122
122
  #listeners = [];
123
123
  #thickness = THICKNESS;
124
124
  #inset = INSET;
125
- #inset_cache = undefined;
126
- #z_index = 0;
125
+ #insetCache = undefined;
126
+ #zIndex = 0;
127
127
  #hovered = false;
128
128
  #dragging = undefined;
129
- #should_show = false;
129
+ #shouldShow = false;
130
130
  #timer = 0;
131
131
  #frame = 0;
132
- #drag_start = 0;
133
- #drag_scroll = 0;
132
+ #dragStart = 0;
133
+ #dragScroll = 0;
134
134
 
135
135
  constructor(element = undefined, options = { thickness: Number(), inset: Number(), zIndex: Number() }) {
136
136
  setStyles(__dirname + "/styles.css", "chUiJS_Scrollbar");
137
137
  this.#element = element;
138
138
  this.#thickness = Scrollbar.#numberOr(options.thickness, THICKNESS);
139
139
  this.#inset = Scrollbar.#numberOr(options.inset, INSET);
140
- this.#z_index = Scrollbar.#zIndexFor(element, options.zIndex);
140
+ this.#zIndex = Scrollbar.#zIndexFor(element, options.zIndex);
141
141
  // Нативная полоса скрыта: место под неё не резервируется, иначе содержимое уезжало бы
142
142
  // из центра, а поверх системной полосы лёг бы второй глиф
143
143
  element.classList.add(HOST_CLASS);
@@ -203,7 +203,7 @@ class Scrollbar {
203
203
  thumb = document.createElement("chui_scrollbar_thumb");
204
204
  thumb.dataset.axis = axis;
205
205
  thumb.setAttribute("aria-hidden", "true");
206
- thumb.style.zIndex = String(this.#z_index);
206
+ thumb.style.zIndex = String(this.#zIndex);
207
207
  document.body.appendChild(thumb);
208
208
  this.#thumbs.set(axis, thumb);
209
209
  this.#listen(thumb, "pointerenter", () => this.#onEnter());
@@ -229,24 +229,24 @@ class Scrollbar {
229
229
  * `refreshInsets()` (наблюдатель за размерами и resize окна).
230
230
  */
231
231
  #insets() {
232
- if (this.#inset_cache !== undefined) return this.#inset_cache;
232
+ if (this.#insetCache !== undefined) return this.#insetCache;
233
233
  const style = getComputedStyle(this.#element);
234
234
  const read = (name) => {
235
235
  const value = Number.parseFloat(style.getPropertyValue(name));
236
236
  return Number.isFinite(value) === true && value > 0 ? value : 0;
237
237
  };
238
- this.#inset_cache = {
238
+ this.#insetCache = {
239
239
  top: read("--scrollbar_inset_top"),
240
240
  right: read("--scrollbar_inset_right"),
241
241
  bottom: read("--scrollbar_inset_bottom"),
242
242
  left: read("--scrollbar_inset_left"),
243
243
  };
244
- return this.#inset_cache;
244
+ return this.#insetCache;
245
245
  }
246
246
 
247
247
  /** Сбросить кэш отступов и пересчитать: вместе с раскладкой мог смениться и токен */
248
248
  refreshInsets() {
249
- this.#inset_cache = undefined;
249
+ this.#insetCache = undefined;
250
250
  this.#render();
251
251
  return this;
252
252
  }
@@ -269,13 +269,13 @@ class Scrollbar {
269
269
  // ползунок не доезжает до конца (замер: недоезд 14px на странице 2917px).
270
270
  const overflow = content - view;
271
271
  if (track <= 0 || overflow <= 1) return undefined;
272
- const thumb_size = Math.max(MIN_THUMB, Math.round((track * track) / content));
272
+ const thumbSize = Math.max(MIN_THUMB, Math.round((track * track) / content));
273
273
  return {
274
274
  track: track,
275
275
  content: content,
276
276
  overflow: overflow,
277
- thumb_size: thumb_size,
278
- travel: track - thumb_size,
277
+ thumb_size: thumbSize,
278
+ travel: track - thumbSize,
279
279
  offset: vertical ? element.scrollTop : element.scrollLeft,
280
280
  start: vertical ? insets.top : insets.left,
281
281
  end: vertical ? insets.bottom : insets.right,
@@ -321,7 +321,7 @@ class Scrollbar {
321
321
  return;
322
322
  }
323
323
  const rect = element.getBoundingClientRect();
324
- const on_screen =
324
+ const onScreen =
325
325
  rect.width > 0 &&
326
326
  rect.height > 0 &&
327
327
  rect.bottom > 0 &&
@@ -330,7 +330,7 @@ class Scrollbar {
330
330
  rect.left < window.innerWidth;
331
331
  // Узел за пределами окна (его вытянет прокрутка родителя): писать в глифы нечего,
332
332
  // кроме снятия видимости при уходе — иначе на каждый узел приходился бы reflow
333
- if (on_screen === false) {
333
+ if (onScreen === false) {
334
334
  if (this.#ready.size === 0) return;
335
335
  this.#ready.clear();
336
336
  this.#paint();
@@ -350,16 +350,16 @@ class Scrollbar {
350
350
  for (const axis of AXES) {
351
351
  const thumb = this.#thumbs.get(axis);
352
352
  if (thumb === undefined) continue;
353
- const shown = this.#should_show === true && this.#ready.has(axis) === true;
353
+ const shown = this.#shouldShow === true && this.#ready.has(axis) === true;
354
354
  // Лишняя запись класса — тоже изменение разметки, поэтому только по факту смены
355
355
  if (thumb.classList.contains(VISIBLE_CLASS) !== shown) thumb.classList.toggle(VISIBLE_CLASS, shown);
356
356
  }
357
- if (this.#should_show === true && this.#ready.size > 0) this.#startFollowFrame();
357
+ if (this.#shouldShow === true && this.#ready.size > 0) this.#startFollowFrame();
358
358
  else this.#stopFollowFrame();
359
359
  }
360
360
 
361
361
  #onScroll() {
362
- this.#should_show = true;
362
+ this.#shouldShow = true;
363
363
  this.#render();
364
364
  // Курсор над узлом — глиф и так держится наведением; иначе показываем и убираем
365
365
  if (this.#hovered === false) this.#scheduleHide(HIDE_DELAY);
@@ -367,7 +367,7 @@ class Scrollbar {
367
367
 
368
368
  #onEnter() {
369
369
  this.#hovered = true;
370
- this.#should_show = true;
370
+ this.#shouldShow = true;
371
371
  this.#cancelHide();
372
372
  this.#render();
373
373
  }
@@ -383,7 +383,7 @@ class Scrollbar {
383
383
  this.#timer = setTimeout(() => {
384
384
  this.#timer = 0;
385
385
  if (this.#hovered === true || this.#dragging !== undefined) return;
386
- this.#should_show = false;
386
+ this.#shouldShow = false;
387
387
  this.#paint();
388
388
  }, delay);
389
389
  }
@@ -415,14 +415,14 @@ class Scrollbar {
415
415
  // Без preventDefault указатель увёл бы фокус и начал выделение текста под глифом
416
416
  event.preventDefault();
417
417
  this.#dragging = axis;
418
- this.#should_show = true;
418
+ this.#shouldShow = true;
419
419
  this.#cancelHide();
420
420
  const thumb = this.#thumbFor(axis);
421
421
  thumb.classList.add(DRAGGING_CLASS);
422
422
  if (typeof thumb.setPointerCapture === "function") thumb.setPointerCapture(event.pointerId);
423
423
  const vertical = axis === AXIS.VERTICAL;
424
- this.#drag_start = vertical ? event.clientY : event.clientX;
425
- this.#drag_scroll = vertical ? this.#element.scrollTop : this.#element.scrollLeft;
424
+ this.#dragStart = vertical ? event.clientY : event.clientX;
425
+ this.#dragScroll = vertical ? this.#element.scrollTop : this.#element.scrollLeft;
426
426
  this.#render();
427
427
  }
428
428
 
@@ -434,9 +434,9 @@ class Scrollbar {
434
434
  const vertical = axis === AXIS.VERTICAL;
435
435
  const pointer = vertical ? event.clientY : event.clientX;
436
436
  // Глиф проходит `travel` пикселей, содержимое за это время — `overflow`: отсюда масштаб
437
- const delta = (pointer - this.#drag_start) * (metrics.overflow / metrics.travel);
438
- if (vertical) this.#element.scrollTop = this.#drag_scroll + delta;
439
- else this.#element.scrollLeft = this.#drag_scroll + delta;
437
+ const delta = (pointer - this.#dragStart) * (metrics.overflow / metrics.travel);
438
+ if (vertical) this.#element.scrollTop = this.#dragScroll + delta;
439
+ else this.#element.scrollLeft = this.#dragScroll + delta;
440
440
  }
441
441
 
442
442
  #onDragEnd(event = Object()) {
@@ -467,8 +467,8 @@ class OverlayScrollbars {
467
467
  /** Что перепроверить в ближайшем кадре: узел → надо ли обойти его поддерево */
468
468
  static #pending = new Map();
469
469
  static #frame = 0;
470
- static #scroll_frame = 0;
471
- static #scan_frame = 0;
470
+ static #scrollFrame = 0;
471
+ static #scanFrame = 0;
472
472
  /** Прокрутка и изменение окна: глифы надо догнать (прокрутка родителя двигает и детей) */
473
473
  static #onViewportChange = () => OverlayScrollbars.#scheduleRefresh();
474
474
  /*
@@ -489,9 +489,9 @@ class OverlayScrollbars {
489
489
  };
490
490
 
491
491
  static #scheduleScan() {
492
- if (OverlayScrollbars.#scan_frame !== 0) return;
493
- OverlayScrollbars.#scan_frame = requestAnimationFrame(() => {
494
- OverlayScrollbars.#scan_frame = 0;
492
+ if (OverlayScrollbars.#scanFrame !== 0) return;
493
+ OverlayScrollbars.#scanFrame = requestAnimationFrame(() => {
494
+ OverlayScrollbars.#scanFrame = 0;
495
495
  OverlayScrollbars.refreshAll();
496
496
  OverlayScrollbars.scan(document.body);
497
497
  });
@@ -562,11 +562,11 @@ class OverlayScrollbars {
562
562
  OverlayScrollbars.#observer = undefined;
563
563
  OverlayScrollbars.#resize = undefined;
564
564
  if (OverlayScrollbars.#frame !== 0) cancelAnimationFrame(OverlayScrollbars.#frame);
565
- if (OverlayScrollbars.#scroll_frame !== 0) cancelAnimationFrame(OverlayScrollbars.#scroll_frame);
566
- if (OverlayScrollbars.#scan_frame !== 0) cancelAnimationFrame(OverlayScrollbars.#scan_frame);
565
+ if (OverlayScrollbars.#scrollFrame !== 0) cancelAnimationFrame(OverlayScrollbars.#scrollFrame);
566
+ if (OverlayScrollbars.#scanFrame !== 0) cancelAnimationFrame(OverlayScrollbars.#scanFrame);
567
567
  OverlayScrollbars.#frame = 0;
568
- OverlayScrollbars.#scroll_frame = 0;
569
- OverlayScrollbars.#scan_frame = 0;
568
+ OverlayScrollbars.#scrollFrame = 0;
569
+ OverlayScrollbars.#scanFrame = 0;
570
570
  OverlayScrollbars.#pending.clear();
571
571
  for (const element of [...OverlayScrollbars.#instances]) OverlayScrollbars.#detach(element);
572
572
  return OverlayScrollbars;
@@ -582,9 +582,9 @@ class OverlayScrollbars {
582
582
  }
583
583
 
584
584
  static #scheduleRefresh() {
585
- if (OverlayScrollbars.#scroll_frame !== 0) return;
586
- OverlayScrollbars.#scroll_frame = requestAnimationFrame(() => {
587
- OverlayScrollbars.#scroll_frame = 0;
585
+ if (OverlayScrollbars.#scrollFrame !== 0) return;
586
+ OverlayScrollbars.#scrollFrame = requestAnimationFrame(() => {
587
+ OverlayScrollbars.#scrollFrame = 0;
588
588
  OverlayScrollbars.refreshAll();
589
589
  });
590
590
  }
@@ -634,13 +634,13 @@ class OverlayScrollbars {
634
634
  if (node === document.body || node === document.documentElement) return false;
635
635
  if (node.tagName === "CHUI_SCROLLBAR_THUMB") return false;
636
636
  // Быстрая отсечка до чтения стилей: переполнения нет — прокручивать нечего
637
- const overflow_y = node.scrollHeight - node.clientHeight > 1;
638
- const overflow_x = node.scrollWidth - node.clientWidth > 1;
639
- if (overflow_y === false && overflow_x === false) return false;
637
+ const overflowY = node.scrollHeight - node.clientHeight > 1;
638
+ const overflowX = node.scrollWidth - node.clientWidth > 1;
639
+ if (overflowY === false && overflowX === false) return false;
640
640
  const style = getComputedStyle(node);
641
- const scrolls_y = overflow_y === true && (style.overflowY === "auto" || style.overflowY === "scroll");
642
- const scrolls_x = overflow_x === true && (style.overflowX === "auto" || style.overflowX === "scroll");
643
- return scrolls_y === true || scrolls_x === true;
641
+ const scrollsY = overflowY === true && (style.overflowY === "auto" || style.overflowY === "scroll");
642
+ const scrollsX = overflowX === true && (style.overflowX === "auto" || style.overflowX === "scroll");
643
+ return scrollsY === true || scrollsX === true;
644
644
  }
645
645
 
646
646
  static #onMutations(records = []) {
@@ -15,7 +15,7 @@ chui_scrollbar_thumb {
15
15
  z-index: 900;
16
16
  display: block;
17
17
  box-sizing: border-box;
18
- border-radius: var(--border_radius);
18
+ border-radius: var(--radius_sm);
19
19
  background: var(--scrollbar_thumb);
20
20
  /* Пока глиф не виден, он не должен перехватывать курсор: наведение ловит сам узел */
21
21
  pointer-events: none;
@@ -23,8 +23,8 @@ chui_scrollbar_thumb {
23
23
  /* Плавно только появление и цвет: `top`/`left`/`width`/`height` анимировать нельзя —
24
24
  глиф отставал бы от прокрутки и «плыл» за содержимым */
25
25
  transition:
26
- opacity var(--transition_time) ease,
27
- background-color var(--transition_time) ease;
26
+ opacity var(--motion_fast) var(--motion_ease),
27
+ background-color var(--motion_fast) var(--motion_ease);
28
28
  }
29
29
 
30
30
  chui_scrollbar_thumb.chui_scrollbar_visible {
@@ -52,9 +52,9 @@ class Shell {
52
52
  */
53
53
  class Shortcuts {
54
54
  #registered = new Map();
55
- #bound_quit = false;
55
+ #boundQuit = false;
56
56
  #destroyed = false;
57
- #on_quit = () => this.unregisterAll();
57
+ #onQuit = () => this.unregisterAll();
58
58
 
59
59
  /**
60
60
  * `register("Mod+Shift+P", () => {})` — вернёт `false`, если комбинацию уже занял
@@ -113,15 +113,15 @@ class Shortcuts {
113
113
  }
114
114
 
115
115
  #bindQuit() {
116
- if (this.#bound_quit) return;
117
- this.#bound_quit = true;
118
- app.on("will-quit", this.#on_quit);
116
+ if (this.#boundQuit) return;
117
+ this.#boundQuit = true;
118
+ app.on("will-quit", this.#onQuit);
119
119
  }
120
120
 
121
121
  #unbindQuit() {
122
- if (!this.#bound_quit) return;
123
- this.#bound_quit = false;
124
- app.removeListener("will-quit", this.#on_quit);
122
+ if (!this.#boundQuit) return;
123
+ this.#boundQuit = false;
124
+ app.removeListener("will-quit", this.#onQuit);
125
125
  }
126
126
  }
127
127