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
@@ -50,7 +50,7 @@ class SplitButton {
50
50
  #title = "";
51
51
  #icon = undefined;
52
52
  #disabled = false;
53
- #is_open = false;
53
+ #isOpen = false;
54
54
  #destroyed = false;
55
55
 
56
56
  constructor(
@@ -74,10 +74,10 @@ class SplitButton {
74
74
  this.#caret.type = "button";
75
75
  this.#caret.className = "split_button_caret";
76
76
  this.#caret.setAttribute("aria-label", I18n.t("navigation.moreActions"));
77
- const caret_glyph = new Icon(Icons.NAVIGATION.EXPAND_MORE, SplitButton.ICON_SIZE).set();
77
+ const caretGlyph = new Icon(Icons.NAVIGATION.EXPAND_MORE, SplitButton.ICON_SIZE).set();
78
78
  // Каретка — украшение: имя даёт aria-label кнопки
79
- caret_glyph.setAttribute("aria-hidden", "true");
80
- this.#caret.appendChild(caret_glyph);
79
+ caretGlyph.setAttribute("aria-hidden", "true");
80
+ this.#caret.appendChild(caretGlyph);
81
81
  this.#caret.setAttribute("aria-haspopup", "menu");
82
82
  this.#caret.setAttribute("aria-controls", `${this.#id}_menu`);
83
83
  this.#menu.id = `${this.#id}_menu`;
@@ -127,7 +127,7 @@ class SplitButton {
127
127
  }
128
128
 
129
129
  get isOpen() {
130
- return this.#is_open;
130
+ return this.#isOpen;
131
131
  }
132
132
 
133
133
  getDisabled() {
@@ -197,11 +197,12 @@ class SplitButton {
197
197
 
198
198
  // ОТКРЫТИЕ МЕНЮ
199
199
  open() {
200
- if (this.#destroyed || this.#is_open || this.#disabled) return this;
201
- this.#is_open = true;
200
+ if (this.#destroyed || this.#isOpen || this.#disabled) return this;
201
+ this.#isOpen = true;
202
202
  // Показ меню — классом: базовое `display: none` и вид задаёт CSS
203
203
  this.#menu.classList.add("split_button_menu_open");
204
204
  this.#positionMenu();
205
+ this.#menu.classList.remove("split_button_menu_leaving");
205
206
  this.#caret.classList.add("split_button_caret_active");
206
207
  window.addEventListener("click", this.#onWindowClick);
207
208
  window.addEventListener("resize", this.#onWindowChange);
@@ -212,9 +213,9 @@ class SplitButton {
212
213
  }
213
214
 
214
215
  close() {
215
- if (!this.#is_open) return this;
216
- this.#is_open = false;
217
- this.#menu.classList.remove("split_button_menu_open");
216
+ if (!this.#isOpen) return this;
217
+ this.#isOpen = false;
218
+ this.#hideMenu();
218
219
  this.#caret.classList.remove("split_button_caret_active");
219
220
  window.removeEventListener("click", this.#onWindowClick);
220
221
  window.removeEventListener("resize", this.#onWindowChange);
@@ -223,6 +224,23 @@ class SplitButton {
223
224
  return this;
224
225
  }
225
226
 
227
+ /**
228
+ * Уход меню идёт движением: класс показа снимается по концу кадра, поэтому меню не
229
+ * пропадает рывком. Открытие за время ухода отменяет снятие — иначе меню погасло бы
230
+ * уже открытым.
231
+ */
232
+ #hideMenu() {
233
+ this.#menu.classList.add("split_button_menu_leaving");
234
+ const done = (event) => {
235
+ if (event.target !== this.#menu) return;
236
+ this.#menu.removeEventListener("animationend", done);
237
+ if (this.#menu.classList.contains("split_button_menu_leaving") === false) return;
238
+ this.#menu.classList.remove("split_button_menu_leaving");
239
+ this.#menu.classList.remove("split_button_menu_open");
240
+ };
241
+ this.#menu.addEventListener("animationend", done);
242
+ }
243
+
226
244
  destroy() {
227
245
  if (this.#destroyed) return this;
228
246
  this.#destroyed = true;
@@ -318,12 +336,12 @@ class SplitButton {
318
336
  };
319
337
 
320
338
  #onCaretClick = () => {
321
- if (this.#is_open) this.close();
339
+ if (this.#isOpen) this.close();
322
340
  else this.open();
323
341
  };
324
342
 
325
343
  #onWindowChange = () => {
326
- if (!this.#is_open) return;
344
+ if (!this.#isOpen) return;
327
345
  this.#positionMenu();
328
346
  };
329
347
 
@@ -6,9 +6,9 @@ chui_split_button {
6
6
  align-items: stretch;
7
7
  width: max-content;
8
8
  height: max-content;
9
- margin: var(--margin);
9
+ margin: var(--block_margin);
10
10
  border: 1px solid var(--button_border_color);
11
- border-radius: var(--border_radius);
11
+ border-radius: var(--radius_sm);
12
12
  overflow: hidden;
13
13
  background: var(--button_background);
14
14
  color: var(--text_color);
@@ -25,7 +25,7 @@ chui_split_button {
25
25
  /* Компактный шаг и зазор — как у Button: 5px по вертикали дают
26
26
  те же 29px высоты контрола */
27
27
  gap: var(--control_padding);
28
- padding: var(--main_padding_sm);
28
+ padding: var(--block_padding_sm);
29
29
  border: none;
30
30
  background: transparent;
31
31
  color: inherit;
@@ -143,7 +143,7 @@ chui_split_menu {
143
143
  padding: 6px;
144
144
  gap: 2px;
145
145
  border: 1px solid var(--border_color);
146
- border-radius: var(--border_radius);
146
+ border-radius: var(--radius_sm);
147
147
  background: var(--header_background);
148
148
  backdrop-filter: var(--global_blur);
149
149
  box-shadow: var(--box_shadow_drop);
@@ -152,9 +152,25 @@ chui_split_menu {
152
152
  }
153
153
 
154
154
  /* Показ меню: базовое состояние — `display: none` выше. Класс ставит компонент при
155
- открытии (прежде показ задавал JS инлайном, дублируя это правило) */
155
+ открытии (прежде показ задавал JS инлайном, дублируя это правило), а появление ведёт
156
+ общий кадр панели: прежде меню возникало готовым, кадр был только у ухода */
156
157
  chui_split_menu.split_button_menu_open {
157
158
  display: flex;
159
+ animation: chui_panel_in var(--motion_base) var(--motion_spring);
160
+ }
161
+
162
+ /* Уход меню: оно гаснет и сходит вверх, а класс показа снимается по концу кадра.
163
+ Оба класса названы намеренно: показ задан селектором с элементом, и короткое
164
+ `.split_button_menu_leaving` проиграло бы ему по специфичности — кадр ухода не
165
+ проиграл бы вовсе, `animationend` не пришёл бы, и меню осталось бы открытым
166
+ навсегда (`close()` уже снял `#is_open`, поэтому каретка читалась бы закрытой) */
167
+ /* Уход меню: оно гаснет и сходит вверх, а класс показа снимается по концу кадра.
168
+ Оба класса названы намеренно: показ задан селектором с элементом, и короткое
169
+ `.split_button_menu_leaving` проиграло бы ему по специфичности — кадр ухода не
170
+ проиграл бы вовсе, `animationend` не пришёл бы, и меню осталось бы открытым
171
+ навсегда (сторож — `test/chui_motion.test.js`) */
172
+ chui_split_menu.split_button_menu_open.split_button_menu_leaving {
173
+ animation: chui_leave_up var(--motion_fast) var(--motion_ease) forwards;
158
174
  }
159
175
 
160
176
  .split_menu_item {
@@ -48,9 +48,9 @@ class Splitter {
48
48
  #disabled = false;
49
49
  #label = I18n.t("a11y.resizePanel");
50
50
  #step = Splitter.DEFAULT_STEP;
51
- #on_resize = undefined;
52
- #on_resize_end = undefined;
53
- #on_reset = undefined;
51
+ #onResize = undefined;
52
+ #onResizeEnd = undefined;
53
+ #onReset = undefined;
54
54
  #dragging = undefined;
55
55
 
56
56
  constructor(
@@ -79,9 +79,9 @@ class Splitter {
79
79
  this.#direction = options.direction === undefined ? Splitter.DIRECTION.HORIZONTAL : options.direction;
80
80
  this.#min = options.min === undefined ? [] : Array.isArray(options.min) ? options.min : [options.min];
81
81
  this.#step = options.step === undefined ? Splitter.DEFAULT_STEP : options.step;
82
- this.#on_resize = options.onResize;
83
- this.#on_resize_end = options.onResizeEnd;
84
- this.#on_reset = options.onReset;
82
+ this.#onResize = options.onResize;
83
+ this.#onResizeEnd = options.onResizeEnd;
84
+ this.#onReset = options.onReset;
85
85
  this.#root.dataset.direction = this.#direction;
86
86
  this.setLabel(optionOr(options.label, this.#label));
87
87
  if (options.width !== undefined) this.setWidth(options.width);
@@ -202,7 +202,7 @@ class Splitter {
202
202
  const values = sizes.map((size) => Number(size)).map((size) => (Number.isFinite(size) && size > 0 ? size : 1));
203
203
  const count = this.#panes.length;
204
204
  if (count === 0) return this;
205
- let next = values.slice(0, count);
205
+ const next = values.slice(0, count);
206
206
  while (next.length < count) next.push(1);
207
207
  const sum = next.reduce((total, size) => total + size, 0);
208
208
  this.#sizes = sum === 0 ? this.#equalSizes() : next.map((size) => (size / sum) * 100);
@@ -320,7 +320,7 @@ class Splitter {
320
320
  const pairShare = this.#sizes[index] + this.#sizes[index + 1];
321
321
  const minBefore = Math.min(this.getMin(index), pairSize);
322
322
  const minAfter = Math.min(this.getMin(index + 1), pairSize - minBefore);
323
- let beforePx = Math.max(minBefore, Math.min(position - beforeStart, pairSize - minAfter));
323
+ const beforePx = Math.max(minBefore, Math.min(position - beforeStart, pairSize - minAfter));
324
324
  const beforeShare = (beforePx / pairSize) * pairShare;
325
325
  const next = [...this.#sizes];
326
326
  next[index] = beforeShare;
@@ -353,15 +353,15 @@ class Splitter {
353
353
  }
354
354
 
355
355
  #emitResize() {
356
- if (this.#on_resize !== undefined) this.#on_resize(this.getSizes());
356
+ if (this.#onResize !== undefined) this.#onResize(this.getSizes());
357
357
  }
358
358
 
359
359
  #emitResizeEnd() {
360
- if (this.#on_resize_end !== undefined) this.#on_resize_end(this.getSizes());
360
+ if (this.#onResizeEnd !== undefined) this.#onResizeEnd(this.getSizes());
361
361
  }
362
362
 
363
363
  #emitReset() {
364
- if (this.#on_reset !== undefined) this.#on_reset(this.getSizes());
364
+ if (this.#onReset !== undefined) this.#onReset(this.getSizes());
365
365
  this.#emitResizeEnd();
366
366
  }
367
367
 
@@ -3,9 +3,9 @@ chui_splitter {
3
3
  display: grid;
4
4
  width: -webkit-fill-available;
5
5
  box-sizing: border-box;
6
- margin: var(--margin);
6
+ margin: var(--block_margin);
7
7
  border: 1px solid var(--border_color);
8
- border-radius: var(--border_radius);
8
+ border-radius: var(--radius_sm);
9
9
  background: var(--element_background_2);
10
10
  overflow: hidden;
11
11
  }
@@ -62,16 +62,16 @@ class Statistic {
62
62
  #root = document.createElement("chui_statistic");
63
63
  #head = document.createElement("statistic_head");
64
64
  #icon = document.createElement("statistic_icon");
65
- #icon_node = undefined;
65
+ #iconNode = undefined;
66
66
  #title = document.createElement("statistic_title");
67
- #value_node = document.createElement("statistic_value");
68
- #trend_node = document.createElement("statistic_trend");
69
- #trend_icon = document.createElement("statistic_trend_icon");
70
- #trend_value = document.createElement("statistic_trend_value");
71
- #trend_label = document.createElement("statistic_trend_label");
67
+ #valueNode = document.createElement("statistic_value");
68
+ #trendNode = document.createElement("statistic_trend");
69
+ #trendIcon = document.createElement("statistic_trend_icon");
70
+ #trendValue = document.createElement("statistic_trend_value");
71
+ #trendLabel = document.createElement("statistic_trend_label");
72
72
  #status = document.createElement("statistic_status");
73
73
  #id = undefined;
74
- #title_value = undefined;
74
+ #titleValue = undefined;
75
75
  #label = undefined;
76
76
  #value = 0;
77
77
  #displayed = 0;
@@ -83,7 +83,7 @@ class Statistic {
83
83
  #animated = false;
84
84
  #duration = Statistic.#DEFAULT_DURATION;
85
85
  #style = Statistic.STYLE.DEFAULT;
86
- #animation_id = undefined;
86
+ #animationId = undefined;
87
87
 
88
88
  constructor(
89
89
  options = {
@@ -115,15 +115,15 @@ class Statistic {
115
115
  this.#icon.setAttribute("aria-hidden", "true");
116
116
  // Плашка значка создаётся всегда, но без опции icon её не видно
117
117
  this.#icon.hidden = true;
118
- this.#trend_icon.setAttribute("aria-hidden", "true");
118
+ this.#trendIcon.setAttribute("aria-hidden", "true");
119
119
  this.#head.appendChild(this.#icon);
120
120
  this.#head.appendChild(this.#title);
121
121
  this.#root.appendChild(this.#head);
122
- this.#root.appendChild(this.#value_node);
123
- this.#trend_node.appendChild(this.#trend_icon);
124
- this.#trend_node.appendChild(this.#trend_value);
125
- this.#trend_node.appendChild(this.#trend_label);
126
- this.#root.appendChild(this.#trend_node);
122
+ this.#root.appendChild(this.#valueNode);
123
+ this.#trendNode.appendChild(this.#trendIcon);
124
+ this.#trendNode.appendChild(this.#trendValue);
125
+ this.#trendNode.appendChild(this.#trendLabel);
126
+ this.#root.appendChild(this.#trendNode);
127
127
  this.#root.appendChild(this.#status);
128
128
  this.setStyle(optionOr(options.style, Statistic.STYLE.DEFAULT));
129
129
  this.setSize(optionOr(options.size, Statistic.SIZE.DEFAULT));
@@ -150,7 +150,7 @@ class Statistic {
150
150
 
151
151
  /** Подпись такая, какой её задали: вразрядку её рисует CSS, а не значение */
152
152
  getTitle() {
153
- return this.#title_value;
153
+ return this.#titleValue;
154
154
  }
155
155
 
156
156
  /** Значение (цель анимации) */
@@ -165,7 +165,7 @@ class Statistic {
165
165
 
166
166
  /** Строка значения вместе с префиксом и суффиксом — то, что видно на экране */
167
167
  getDisplayValue() {
168
- return this.#value_node.innerText;
168
+ return this.#valueNode.innerText;
169
169
  }
170
170
 
171
171
  getPrefix() {
@@ -209,7 +209,7 @@ class Statistic {
209
209
  }
210
210
 
211
211
  isAnimating() {
212
- return this.#animation_id !== undefined;
212
+ return this.#animationId !== undefined;
213
213
  }
214
214
 
215
215
  // SET
@@ -221,9 +221,9 @@ class Statistic {
221
221
 
222
222
  /** Подпись показателя; пустая убирает её */
223
223
  setTitle(text = String()) {
224
- this.#title_value = String(text);
225
- this.#title.innerText = this.#title_value;
226
- this.#title.hidden = this.#title_value === "";
224
+ this.#titleValue = String(text);
225
+ this.#title.innerText = this.#titleValue;
226
+ this.#title.hidden = this.#titleValue === "";
227
227
  this.#syncAria();
228
228
  return this;
229
229
  }
@@ -319,19 +319,19 @@ class Statistic {
319
319
  /** Значок показателя (имя из `Icons`, `Icon`, компонент или узел); `undefined` убирает его */
320
320
  setIcon(icon = undefined) {
321
321
  if (icon === undefined || icon === null || icon === "") {
322
- this.#icon_node = undefined;
322
+ this.#iconNode = undefined;
323
323
  this.#icon.innerHTML = "";
324
324
  this.#icon.hidden = true;
325
325
  return this;
326
326
  }
327
- this.#icon_node =
327
+ this.#iconNode =
328
328
  typeof icon === "string"
329
329
  ? new Icon(icon, "16px").set()
330
330
  : typeof icon.set === "function"
331
331
  ? icon.set()
332
332
  : icon;
333
333
  this.#icon.innerHTML = "";
334
- this.#icon.appendChild(this.#icon_node);
334
+ this.#icon.appendChild(this.#iconNode);
335
335
  this.#icon.hidden = false;
336
336
  return this;
337
337
  }
@@ -406,9 +406,9 @@ class Statistic {
406
406
  }
407
407
 
408
408
  #cancel() {
409
- if (this.#animation_id === undefined) return;
410
- cancelAnimationFrame(this.#animation_id);
411
- this.#animation_id = undefined;
409
+ if (this.#animationId === undefined) return;
410
+ cancelAnimationFrame(this.#animationId);
411
+ this.#animationId = undefined;
412
412
  }
413
413
 
414
414
  /** Ease-out: счётчик быстро разгоняется и мягко доезжает до цели */
@@ -420,14 +420,14 @@ class Statistic {
420
420
  const eased = 1 - Math.pow(1 - progress, 3);
421
421
  this.#applyValue(from + (target - from) * eased);
422
422
  if (progress < 1) {
423
- this.#animation_id = requestAnimationFrame(step);
423
+ this.#animationId = requestAnimationFrame(step);
424
424
  return;
425
425
  }
426
- this.#animation_id = undefined;
426
+ this.#animationId = undefined;
427
427
  this.#applyValue(target);
428
428
  if (silent !== true) this.#announce();
429
429
  };
430
- this.#animation_id = requestAnimationFrame(step);
430
+ this.#animationId = requestAnimationFrame(step);
431
431
  }
432
432
 
433
433
  #applyValue(value = Number()) {
@@ -436,19 +436,19 @@ class Statistic {
436
436
  }
437
437
 
438
438
  #renderValue() {
439
- this.#value_node.innerText = `${this.#prefix}${this.#formatNumber(this.#displayed)}${this.#suffix}`;
439
+ this.#valueNode.innerText = `${this.#prefix}${this.#formatNumber(this.#displayed)}${this.#suffix}`;
440
440
  }
441
441
 
442
442
  #syncTrend() {
443
443
  const trend = this.#trend;
444
- this.#trend_node.hidden = trend === undefined;
444
+ this.#trendNode.hidden = trend === undefined;
445
445
  if (trend === undefined) {
446
- this.#trend_node.removeAttribute("aria-label");
447
- this.#trend_value.innerText = "";
448
- this.#trend_label.innerText = "";
449
- this.#trend_icon.innerHTML = "";
450
- this.#trend_node.removeAttribute("data-direction");
451
- this.#trend_node.removeAttribute("data-style");
446
+ this.#trendNode.removeAttribute("aria-label");
447
+ this.#trendValue.innerText = "";
448
+ this.#trendLabel.innerText = "";
449
+ this.#trendIcon.innerHTML = "";
450
+ this.#trendNode.removeAttribute("data-direction");
451
+ this.#trendNode.removeAttribute("data-style");
452
452
  return;
453
453
  }
454
454
  const direction = trend.direction;
@@ -457,16 +457,16 @@ class Statistic {
457
457
  trend.text === undefined
458
458
  ? `${sign}${this.#formatNumber(trend.value === undefined ? 0 : trend.value, trend.precision)}${trend.suffix}`
459
459
  : trend.text;
460
- this.#trend_value.innerText = number;
461
- this.#trend_label.innerText = trend.label;
462
- this.#trend_label.hidden = trend.label === "";
463
- this.#trend_icon.innerHTML = new Icon(
460
+ this.#trendValue.innerText = number;
461
+ this.#trendLabel.innerText = trend.label;
462
+ this.#trendLabel.hidden = trend.label === "";
463
+ this.#trendIcon.innerHTML = new Icon(
464
464
  TREND_ICONS[direction] === undefined ? TREND_ICONS.flat : TREND_ICONS[direction],
465
465
  "14px"
466
466
  ).getHTML();
467
- this.#trend_node.dataset.direction = direction;
468
- if (trend.style === undefined) this.#trend_node.removeAttribute("data-style");
469
- else this.#trend_node.dataset.style = trend.style;
467
+ this.#trendNode.dataset.direction = direction;
468
+ if (trend.style === undefined) this.#trendNode.removeAttribute("data-style");
469
+ else this.#trendNode.dataset.style = trend.style;
470
470
  // Направление читается словами: стрелка-глиф скрыта от скринридера
471
471
  const phrase =
472
472
  direction === Statistic.TREND.UP
@@ -474,11 +474,11 @@ class Statistic {
474
474
  : direction === Statistic.TREND.DOWN
475
475
  ? I18n.t("data.statisticTrendDown", { value: number })
476
476
  : I18n.t("data.statisticTrendFlat");
477
- this.#trend_node.setAttribute("aria-label", trend.label === "" ? phrase : `${phrase} ${trend.label}`);
477
+ this.#trendNode.setAttribute("aria-label", trend.label === "" ? phrase : `${phrase} ${trend.label}`);
478
478
  }
479
479
 
480
480
  #announce() {
481
- const title = this.#title_value === undefined ? "" : this.#title_value;
481
+ const title = this.#titleValue === undefined ? "" : this.#titleValue;
482
482
  this.#status.innerText =
483
483
  title === ""
484
484
  ? this.getDisplayValue()
@@ -486,7 +486,7 @@ class Statistic {
486
486
  }
487
487
 
488
488
  #syncAria() {
489
- const name = optionOr(this.#label, optionOr(this.#title_value, I18n.t("data.statistic")));
489
+ const name = optionOr(this.#label, optionOr(this.#titleValue, I18n.t("data.statistic")));
490
490
  this.#root.setAttribute("aria-label", name);
491
491
  }
492
492
  }
@@ -6,13 +6,13 @@ chui_status_bar {
6
6
  gap: 10px;
7
7
  box-sizing: border-box;
8
8
  width: -webkit-fill-available;
9
- margin: var(--margin);
9
+ margin: var(--block_margin);
10
10
  padding: 4px 10px;
11
11
  color: var(--text_color);
12
12
  font-size: var(--font_default_size);
13
13
  background: var(--element_background_2);
14
14
  border: 1px solid var(--border_color);
15
- border-radius: var(--border_radius);
15
+ border-radius: var(--radius_sm);
16
16
  }
17
17
 
18
18
  status_bar_section {