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
@@ -32,14 +32,14 @@ class ProgressRing {
32
32
  #root = document.createElement("chui_progress_ring");
33
33
  #svg = undefined;
34
34
  #track = undefined;
35
- #value_arc = undefined;
35
+ #valueArc = undefined;
36
36
  #text = document.createElement("progress_ring_text");
37
37
  #id = undefined;
38
38
  #value = 0;
39
39
  #max = 100;
40
40
  #size = ProgressRing.DEFAULT_SIZE;
41
41
  #thickness = ProgressRing.DEFAULT_THICKNESS;
42
- #show_value = true;
42
+ #showValue = true;
43
43
  #indeterminate = false;
44
44
  #label = undefined;
45
45
  #format = undefined;
@@ -66,7 +66,7 @@ class ProgressRing {
66
66
  if (options.max !== undefined) this.#max = options.max;
67
67
  if (options.size !== undefined) this.#size = options.size;
68
68
  if (options.thickness !== undefined) this.#thickness = options.thickness;
69
- this.#show_value = options.showValue !== false;
69
+ this.#showValue = options.showValue !== false;
70
70
  this.#format = options.format;
71
71
  this.#build();
72
72
  if (options.color !== undefined) this.setColor(options.color);
@@ -111,7 +111,7 @@ class ProgressRing {
111
111
  }
112
112
 
113
113
  isValueVisible() {
114
- return this.#show_value;
114
+ return this.#showValue;
115
115
  }
116
116
 
117
117
  // SET
@@ -149,7 +149,7 @@ class ProgressRing {
149
149
 
150
150
  /** Показывать ли процент внутри кольца */
151
151
  setShowValue(visible = Boolean()) {
152
- this.#show_value = visible === true;
152
+ this.#showValue = visible === true;
153
153
  this.#render();
154
154
  return this;
155
155
  }
@@ -202,13 +202,13 @@ class ProgressRing {
202
202
  this.#track.setAttribute("cx", "50");
203
203
  this.#track.setAttribute("cy", "50");
204
204
  this.#track.setAttribute("r", "45");
205
- this.#value_arc = document.createElementNS(namespace, "circle");
206
- this.#value_arc.setAttribute("class", "progress_ring_value");
207
- this.#value_arc.setAttribute("cx", "50");
208
- this.#value_arc.setAttribute("cy", "50");
209
- this.#value_arc.setAttribute("r", "45");
205
+ this.#valueArc = document.createElementNS(namespace, "circle");
206
+ this.#valueArc.setAttribute("class", "progress_ring_value");
207
+ this.#valueArc.setAttribute("cx", "50");
208
+ this.#valueArc.setAttribute("cy", "50");
209
+ this.#valueArc.setAttribute("r", "45");
210
210
  this.#svg.appendChild(this.#track);
211
- this.#svg.appendChild(this.#value_arc);
211
+ this.#svg.appendChild(this.#valueArc);
212
212
  this.#text.setAttribute("aria-hidden", "true");
213
213
  this.#root.appendChild(this.#svg);
214
214
  this.#root.appendChild(this.#text);
@@ -230,13 +230,13 @@ class ProgressRing {
230
230
  const radius = 50 - thickness / 2;
231
231
  this.#svg.style.setProperty("--progress_ring_thickness", String(thickness));
232
232
  this.#track.setAttribute("r", String(radius));
233
- this.#value_arc.setAttribute("r", String(radius));
233
+ this.#valueArc.setAttribute("r", String(radius));
234
234
  // Длина окружности: dasharray — периметр, dashoffset — доля от него.
235
235
  // У неопределённого прогресса дуга фиксированной длины, а крутит её CSS-анимация
236
236
  const circuit = 2 * Math.PI * radius;
237
- this.#value_arc.style.strokeDasharray = this.#indeterminate ? "60 230" : String(circuit);
238
- this.#value_arc.style.strokeDashoffset = this.#indeterminate ? "0" : String(circuit * (1 - this.getRatio()));
239
- this.#text.hidden = !this.#show_value;
237
+ this.#valueArc.style.strokeDasharray = this.#indeterminate ? "60 230" : String(circuit);
238
+ this.#valueArc.style.strokeDashoffset = this.#indeterminate ? "0" : String(circuit * (1 - this.getRatio()));
239
+ this.#text.hidden = !this.#showValue;
240
240
  this.#text.innerText = this.#indeterminate ? "" : this.#valueText();
241
241
  this.#root.setAttribute("aria-valuemin", String(0));
242
242
  this.#root.setAttribute("aria-valuemax", String(this.#max));
@@ -34,7 +34,7 @@ chui_progress_ring {
34
34
  .progress_ring_value {
35
35
  stroke: var(--progress_ring_color);
36
36
  stroke-linecap: round;
37
- transition: stroke-dashoffset 0.25s ease;
37
+ transition: stroke-dashoffset var(--motion_base) var(--motion_ease);
38
38
  }
39
39
 
40
40
  chui_progress_ring.progress_ring_indeterminate .progress_ring_value {
@@ -64,14 +64,14 @@ class QRCode {
64
64
  #margin = QRCode.DEFAULT_MARGIN;
65
65
  #level = QR.LEVEL.MEDIUM;
66
66
  #mode = QR.MODE.AUTO;
67
- #min_version = undefined;
67
+ #minVersion = undefined;
68
68
  #mask = undefined;
69
69
  #dark = QRCode.DEFAULT_DARK;
70
70
  #light = QRCode.DEFAULT_LIGHT;
71
71
  #label = undefined;
72
- #empty_text = undefined;
72
+ #emptyText = undefined;
73
73
  #code = undefined;
74
- #error_text = undefined;
74
+ #errorMessage = undefined;
75
75
 
76
76
  constructor(
77
77
  options = {
@@ -98,7 +98,7 @@ class QRCode {
98
98
  this.#hint.setAttribute("role", "status");
99
99
  this.#hint.setAttribute("aria-live", "polite");
100
100
  this.#label = options.label;
101
- this.#empty_text = options.emptyText;
101
+ this.#emptyText = options.emptyText;
102
102
  this.#root.appendChild(this.#canvas);
103
103
  this.#root.appendChild(this.#hint);
104
104
  // Пустая заготовка опции равносильна отсутствующей: `String()` в описании опций
@@ -108,7 +108,7 @@ class QRCode {
108
108
  if (optionOr(options.level, undefined) !== undefined) this.#level = QRCode.#toLevel(options.level);
109
109
  if (optionOr(options.mode, undefined) !== undefined) this.#mode = QRCode.#toMode(options.mode);
110
110
  if (Number.isInteger(Number(options.minVersion)) && Number(options.minVersion) > 0) {
111
- this.#min_version = QRCode.#toVersion(options.minVersion);
111
+ this.#minVersion = QRCode.#toVersion(options.minVersion);
112
112
  }
113
113
  if (Number.isInteger(Number(options.mask)) && Number(options.mask) >= 0)
114
114
  this.#mask = QRCode.#toMask(options.mask);
@@ -140,7 +140,7 @@ class QRCode {
140
140
  return this.#code === undefined ? this.#mode : this.#code.mode;
141
141
  }
142
142
  getMinVersion() {
143
- return this.#min_version;
143
+ return this.#minVersion;
144
144
  }
145
145
  /** Маска готового кода (0…7); без кода — заданная опция или `undefined` при автоподборе */
146
146
  getMask() {
@@ -174,7 +174,7 @@ class QRCode {
174
174
  }
175
175
  /** Текст незаданного состояния или ошибки; `undefined`, если код построен */
176
176
  getError() {
177
- return this.#error_text;
177
+ return this.#errorMessage;
178
178
  }
179
179
 
180
180
  // SET
@@ -215,7 +215,7 @@ class QRCode {
215
215
  }
216
216
  /** Наименьшая версия кода; `undefined` — подбирать самому */
217
217
  setMinVersion(version = undefined) {
218
- this.#min_version = version === undefined || version === "" ? undefined : QRCode.#toVersion(version);
218
+ this.#minVersion = version === undefined || version === "" ? undefined : QRCode.#toVersion(version);
219
219
  this.#render();
220
220
  return this;
221
221
  }
@@ -240,7 +240,7 @@ class QRCode {
240
240
  }
241
241
  /** Текст подсказки при пустом значении */
242
242
  setEmptyText(text = String()) {
243
- this.#empty_text = text;
243
+ this.#emptyText = text;
244
244
  this.#render();
245
245
  return this;
246
246
  }
@@ -263,12 +263,12 @@ class QRCode {
263
263
  if (String(value).trim() === "") {
264
264
  this.#code = undefined;
265
265
  this.#clear();
266
- this.#setHint(this.#empty_text === undefined ? I18n.t("graphics.qrEmpty") : this.#empty_text);
266
+ this.#setHint(this.#emptyText === undefined ? I18n.t("graphics.qrEmpty") : this.#emptyText);
267
267
  this.#setLabel(I18n.t("graphics.qrLabel"));
268
268
  return this;
269
269
  }
270
270
  const options = { level: this.#level, mode: this.#mode };
271
- if (this.#min_version !== undefined) options.minVersion = this.#min_version;
271
+ if (this.#minVersion !== undefined) options.minVersion = this.#minVersion;
272
272
  if (this.#mask !== undefined) options.mask = this.#mask;
273
273
  const result = QR.encode(value, options);
274
274
  if (result.ok !== true) {
@@ -334,7 +334,7 @@ class QRCode {
334
334
  }
335
335
 
336
336
  #setHint(text) {
337
- this.#error_text = text === "" ? undefined : text;
337
+ this.#errorMessage = text === "" ? undefined : text;
338
338
  this.#hint.innerText = text;
339
339
  return this;
340
340
  }
@@ -151,20 +151,20 @@ class QueryBuilder {
151
151
  #fields = [];
152
152
  #value = undefined;
153
153
  #listeners = [];
154
- #on_change = undefined;
155
- #max_depth = QueryBuilder.MAX_DEPTH;
154
+ #onChange = undefined;
155
+ #maxDepth = QueryBuilder.MAX_DEPTH;
156
156
  #disabled = false;
157
- #error_shown = false;
158
- #node_counter = 0;
159
- #rule_counter = 0;
157
+ #errorShown = false;
158
+ #nodeCounter = 0;
159
+ #ruleCounter = 0;
160
160
  // Переключатели «И/ИЛИ» живут по группе: при перерисовке пересобираются вместе с узлами
161
161
  #combinators = new Map();
162
162
  // Готовые поля условий: их нужно гасить, снимать у них слушатели окна и уметь закрыть
163
163
  // раскрытый список при возврате фокуса после пересборки
164
164
  #controls = [];
165
- #title_text = undefined;
166
- #label_text = undefined;
167
- #empty_text = undefined;
165
+ #titleText = undefined;
166
+ #labelText = undefined;
167
+ #emptyText = undefined;
168
168
 
169
169
  constructor(
170
170
  options = {
@@ -189,11 +189,11 @@ class QueryBuilder {
189
189
  this.#name = options.name;
190
190
  this.#root.id = this.#id;
191
191
  this.#root.setAttribute("role", "group");
192
- this.#label_text = options.label;
193
- this.#on_change = options.onChange;
194
- if (options.emptyText !== undefined) this.#empty_text = String(options.emptyText);
195
- else this.#empty_text = I18n.t("queryBuilder.empty");
196
- if (options.maxDepth !== undefined) this.#max_depth = Math.max(1, Number(options.maxDepth));
192
+ this.#labelText = options.label;
193
+ this.#onChange = options.onChange;
194
+ if (options.emptyText !== undefined) this.#emptyText = String(options.emptyText);
195
+ else this.#emptyText = I18n.t("queryBuilder.empty");
196
+ if (options.maxDepth !== undefined) this.#maxDepth = Math.max(1, Number(options.maxDepth));
197
197
  this.#title.className = "query_builder_title";
198
198
  this.#title.id = `${this.#id}_title`;
199
199
  this.#tree.className = "query_builder_tree";
@@ -207,7 +207,7 @@ class QueryBuilder {
207
207
  this.#root.appendChild(this.#status);
208
208
  if (options.title !== undefined) this.setTitle(options.title);
209
209
  else this.#title.hidden = true;
210
- this.setLabel(this.#label_text === undefined ? I18n.t("queryBuilder.title") : this.#label_text);
210
+ this.setLabel(this.#labelText === undefined ? I18n.t("queryBuilder.title") : this.#labelText);
211
211
  this.setFields(options.fields === undefined ? [] : options.fields);
212
212
  if (options.value === undefined) this.clear(true);
213
213
  else this.setValue(options.value);
@@ -220,9 +220,9 @@ class QueryBuilder {
220
220
  () => (this.isEmpty() ? "" : this.getText()),
221
221
  this.#tree
222
222
  );
223
- const base_validate = this.validate;
223
+ const baseValidate = this.validate;
224
224
  this.validate = () => {
225
- const result = base_validate();
225
+ const result = baseValidate();
226
226
  if (result.valid === false) return result;
227
227
  const empty = this.#rules().find(
228
228
  (rule) => this.#needsValue(rule.operator) && this.#isEmptyValue(rule.value)
@@ -244,11 +244,11 @@ class QueryBuilder {
244
244
  }
245
245
 
246
246
  getTitle() {
247
- return this.#title_text;
247
+ return this.#titleText;
248
248
  }
249
249
 
250
250
  getLabel() {
251
- return this.#label_text;
251
+ return this.#labelText;
252
252
  }
253
253
 
254
254
  /** Имя запроса для формы: с ним `Form.getValues()`/`setValues()` знают, куда класть дерево */
@@ -304,7 +304,7 @@ class QueryBuilder {
304
304
  }
305
305
 
306
306
  getMaxDepth() {
307
- return this.#max_depth;
307
+ return this.#maxDepth;
308
308
  }
309
309
 
310
310
  isDisabled() {
@@ -312,7 +312,7 @@ class QueryBuilder {
312
312
  }
313
313
 
314
314
  getEmptyText() {
315
- return this.#empty_text;
315
+ return this.#emptyText;
316
316
  }
317
317
 
318
318
  /** Запрос словами: «Статус равно «Оплачен» И Сумма больше 1000» */
@@ -331,7 +331,7 @@ class QueryBuilder {
331
331
 
332
332
  /** Подпись над запросом; `undefined` её убирает (имя тогда даёт `label`) */
333
333
  setTitle(text = undefined) {
334
- this.#title_text = text;
334
+ this.#titleText = text;
335
335
  if (text === undefined || text === "") {
336
336
  this.#title.hidden = true;
337
337
  this.#title.innerText = "";
@@ -346,7 +346,7 @@ class QueryBuilder {
346
346
 
347
347
  /** Имя запроса, когда подписи в разметке нет */
348
348
  setLabel(text = undefined) {
349
- this.#label_text = text;
349
+ this.#labelText = text;
350
350
  this.#syncLabel();
351
351
  return this;
352
352
  }
@@ -389,7 +389,7 @@ class QueryBuilder {
389
389
 
390
390
  /** Дерево запроса; `silent` (как у полей формы) — молча, без уведомления слушателей */
391
391
  setValue(value = Object(), silent = false) {
392
- this.#node_counter = 0;
392
+ this.#nodeCounter = 0;
393
393
  this.#value = this.#toGroup(value, 1);
394
394
  this.#render();
395
395
  if (silent === false) this.#notify();
@@ -397,13 +397,13 @@ class QueryBuilder {
397
397
  }
398
398
 
399
399
  setMaxDepth(depth = Number()) {
400
- this.#max_depth = Math.max(1, Number(depth));
400
+ this.#maxDepth = Math.max(1, Number(depth));
401
401
  this.#render();
402
402
  return this;
403
403
  }
404
404
 
405
405
  setEmptyText(text = String()) {
406
- this.#empty_text = text === undefined ? "" : String(text);
406
+ this.#emptyText = text === undefined ? "" : String(text);
407
407
  this.#render();
408
408
  return this;
409
409
  }
@@ -449,7 +449,7 @@ class QueryBuilder {
449
449
  addGroup(groupId = undefined) {
450
450
  const group = groupId === undefined ? this.#value : this.#group(groupId);
451
451
  if (group === undefined) return undefined;
452
- if (this.#depthOf(group) >= this.#max_depth) return undefined;
452
+ if (this.#depthOf(group) >= this.#maxDepth) return undefined;
453
453
  const field = this.#fields[0];
454
454
  if (field === undefined) return undefined;
455
455
  const nested = {
@@ -531,12 +531,12 @@ class QueryBuilder {
531
531
  check() {
532
532
  const result = this.validate();
533
533
  if (result.valid) {
534
- this.#error_shown = false;
534
+ this.#errorShown = false;
535
535
  this.clearError();
536
536
  this.#announce(this.isEmpty() ? I18n.t("queryBuilder.empty") : I18n.t("queryBuilder.valid"));
537
537
  return this;
538
538
  }
539
- this.#error_shown = true;
539
+ this.#errorShown = true;
540
540
  this.setError(result.message);
541
541
  this.#syncErrors();
542
542
  this.#announce(result.message);
@@ -562,8 +562,8 @@ class QueryBuilder {
562
562
 
563
563
  // === ВНУТРЕННЕЕ ===
564
564
  #nextId(prefix = String()) {
565
- this.#node_counter += 1;
566
- return `${this.#id}_${prefix}_${this.#node_counter}`;
565
+ this.#nodeCounter += 1;
566
+ return `${this.#id}_${prefix}_${this.#nodeCounter}`;
567
567
  }
568
568
 
569
569
  #emptyRule(field = Object()) {
@@ -598,7 +598,7 @@ class QueryBuilder {
598
598
  for (const child of children) {
599
599
  if (child === undefined || child === null || typeof child !== "object") continue;
600
600
  if (child.children !== undefined || child.combinator !== undefined) {
601
- if (depth >= this.#max_depth) continue;
601
+ if (depth >= this.#maxDepth) continue;
602
602
  group.children.push(this.#toGroup(child, depth + 1));
603
603
  continue;
604
604
  }
@@ -713,17 +713,17 @@ class QueryBuilder {
713
713
  this.#destroyControls();
714
714
  this.#tree.innerHTML = "";
715
715
  this.#combinators.clear();
716
- this.#rule_counter = 0;
716
+ this.#ruleCounter = 0;
717
717
  if (this.#value === undefined || this.#fields.length === 0) {
718
718
  this.#tree.hidden = true;
719
719
  this.#empty.hidden = false;
720
- this.#empty.innerText = this.#fields.length === 0 ? I18n.t("queryBuilder.noFields") : this.#empty_text;
720
+ this.#empty.innerText = this.#fields.length === 0 ? I18n.t("queryBuilder.noFields") : this.#emptyText;
721
721
  return this;
722
722
  }
723
723
  this.#tree.appendChild(this.#groupNode(this.#value, 0));
724
724
  this.#tree.hidden = false;
725
725
  this.#empty.hidden = true;
726
- this.#empty.innerText = this.#empty_text;
726
+ this.#empty.innerText = this.#emptyText;
727
727
  this.#syncErrors();
728
728
  if (mark !== undefined) {
729
729
  const node = this.#tree.querySelector(`[data-id="${CSS.escape(mark.owner)}"] ${mark.control}`);
@@ -761,8 +761,8 @@ class QueryBuilder {
761
761
  const own = list.length > 0 ? `.${CSS.escape(list[0])}` : node.tagName.toLowerCase();
762
762
  const holder = node.closest(".query_builder_field, .query_builder_operator, .query_builder_value");
763
763
  if (holder === null) return own;
764
- const holder_class = [...holder.classList].find((name) => name.startsWith("query_builder_"));
765
- return holder_class === undefined ? own : `.${CSS.escape(holder_class)} ${own}`;
764
+ const holderClass = [...holder.classList].find((name) => name.startsWith("query_builder_"));
765
+ return holderClass === undefined ? own : `.${CSS.escape(holderClass)} ${own}`;
766
766
  }
767
767
 
768
768
  #groupNode(group = Object(), depth = Number()) {
@@ -836,7 +836,7 @@ class QueryBuilder {
836
836
  if (group.children.length === 0) {
837
837
  const note = document.createElement("query_builder_group_empty");
838
838
  note.className = "query_builder_group_empty";
839
- note.innerText = this.#empty_text;
839
+ note.innerText = this.#emptyText;
840
840
  list.appendChild(note);
841
841
  return list;
842
842
  }
@@ -859,7 +859,7 @@ class QueryBuilder {
859
859
  onClick: () => this.addRule(group.id),
860
860
  })
861
861
  );
862
- if (this.#depthOf(group) < this.#max_depth) {
862
+ if (this.#depthOf(group) < this.#maxDepth) {
863
863
  foot.appendChild(
864
864
  this.#addButton({
865
865
  title: I18n.t("queryBuilder.groupShort"),
@@ -934,8 +934,8 @@ class QueryBuilder {
934
934
  }
935
935
 
936
936
  #ruleNode(rule = Object()) {
937
- this.#rule_counter += 1;
938
- const index = this.#rule_counter;
937
+ this.#ruleCounter += 1;
938
+ const index = this.#ruleCounter;
939
939
  const field = this.#fieldOf(rule.field);
940
940
  const node = document.createElement("query_builder_rule");
941
941
  node.className = "query_builder_rule";
@@ -1126,7 +1126,7 @@ class QueryBuilder {
1126
1126
  }
1127
1127
 
1128
1128
  #syncLabel() {
1129
- if (this.#title_text !== undefined && this.#title_text !== "") {
1129
+ if (this.#titleText !== undefined && this.#titleText !== "") {
1130
1130
  this.#root.setAttribute("aria-labelledby", this.#title.id);
1131
1131
  this.#root.removeAttribute("aria-label");
1132
1132
  } else {
@@ -1137,8 +1137,8 @@ class QueryBuilder {
1137
1137
  }
1138
1138
 
1139
1139
  #accessibleName() {
1140
- if (this.#title_text !== undefined && this.#title_text !== "") return this.#title_text;
1141
- if (this.#label_text !== undefined && this.#label_text !== "") return this.#label_text;
1140
+ if (this.#titleText !== undefined && this.#titleText !== "") return this.#titleText;
1141
+ if (this.#labelText !== undefined && this.#labelText !== "") return this.#labelText;
1142
1142
  return I18n.t("queryBuilder.title");
1143
1143
  }
1144
1144
 
@@ -1157,10 +1157,10 @@ class QueryBuilder {
1157
1157
 
1158
1158
  /** После правки показанная ошибка пересчитывается: она не должна пережить своё условие */
1159
1159
  #refreshErrors() {
1160
- if (this.#error_shown === false) return this;
1160
+ if (this.#errorShown === false) return this;
1161
1161
  const result = this.validate();
1162
1162
  if (result.valid) {
1163
- this.#error_shown = false;
1163
+ this.#errorShown = false;
1164
1164
  this.clearError();
1165
1165
  return this;
1166
1166
  }
@@ -1177,7 +1177,7 @@ class QueryBuilder {
1177
1177
  #notify() {
1178
1178
  const value = this.getValue();
1179
1179
  for (const listener of [...this.#listeners]) listener(value, this);
1180
- if (this.#on_change !== undefined) this.#on_change(value, this);
1180
+ if (this.#onChange !== undefined) this.#onChange(value, this);
1181
1181
  return this;
1182
1182
  }
1183
1183
  }
@@ -6,14 +6,14 @@ chui_query_builder {
6
6
  box-sizing: border-box;
7
7
  width: -webkit-fill-available;
8
8
  max-width: 100%;
9
- margin: var(--margin);
9
+ margin: var(--block_margin);
10
10
  color: var(--text_color);
11
11
  }
12
12
 
13
13
  .query_builder_title {
14
14
  display: block;
15
15
  width: max-content;
16
- margin: var(--margin);
16
+ margin: var(--block_margin);
17
17
  color: var(--text_color);
18
18
  font-family: system-ui, sans-serif;
19
19
  font-size: var(--font_labels_size);
@@ -43,7 +43,7 @@ chui_query_builder {
43
43
  width: -webkit-fill-available;
44
44
  padding: 8px;
45
45
  border: 1px solid var(--border_color);
46
- border-radius: var(--border_radius);
46
+ border-radius: var(--radius_sm);
47
47
  background: var(--element_background);
48
48
  margin-inline-start: calc(var(--query_builder_depth, 0) * 14px);
49
49
  }
@@ -97,7 +97,7 @@ chui_query_builder {
97
97
  }
98
98
 
99
99
  /* Контролы условия — готовые поля фреймворка (Select, TextInput, NumberInput, DateInput).
100
- Их вид (35 px, --border_radius, hairline, фокус и запрет) держит сам компонент,
100
+ Их вид (35 px, --radius_sm, hairline, фокус и запрет) держит сам компонент,
101
101
  а строка условия задаёт только долю ширины и нулевой отступ. */
102
102
  .query_builder_field,
103
103
  .query_builder_operator,
@@ -12,5 +12,5 @@ chui_radio_group.radio_group_disabled {
12
12
 
13
13
  /* Общий класс ошибки полей: рамка не должна липнуть к флажкам */
14
14
  chui_radio_group.error_border {
15
- border-radius: var(--border_radius);
15
+ border-radius: var(--radius_sm);
16
16
  }
@@ -64,9 +64,9 @@ class Result {
64
64
  #actions = document.createElement("result_actions");
65
65
  #id = undefined;
66
66
  #style = Result.STYLE.INFO;
67
- #title_value = undefined;
68
- #title_hidden = false;
69
- #icon_custom = undefined;
67
+ #titleValue = undefined;
68
+ #titleHidden = false;
69
+ #iconCustom = undefined;
70
70
 
71
71
  constructor(
72
72
  options = {
@@ -94,8 +94,8 @@ class Result {
94
94
  this.#root.appendChild(this.#actions);
95
95
  this.setStyle(optionOr(options.style, Result.STYLE.INFO));
96
96
  if (options.icon !== undefined) this.setIcon(options.icon);
97
- this.#title_hidden = options.title === null;
98
- if (typeof options.title === "string" && options.title !== "") this.#title_value = options.title;
97
+ this.#titleHidden = options.title === null;
98
+ if (typeof options.title === "string" && options.title !== "") this.#titleValue = options.title;
99
99
  this.#renderTitle();
100
100
  this.setDescription(optionOr(options.description, ""));
101
101
  this.setSize(optionOr(options.size, Result.SIZE.DEFAULT));
@@ -114,7 +114,7 @@ class Result {
114
114
 
115
115
  /** Заголовок на экране (`""`, если он убран) */
116
116
  getTitle() {
117
- return this.#title_hidden ? "" : this.#title.innerText;
117
+ return this.#titleHidden ? "" : this.#title.innerText;
118
118
  }
119
119
 
120
120
  getDescription() {
@@ -150,7 +150,7 @@ class Result {
150
150
  const assertive = known === Result.STYLE.ERROR;
151
151
  this.#root.setAttribute("role", assertive ? "alert" : "status");
152
152
  this.#root.setAttribute("aria-live", assertive ? "assertive" : "polite");
153
- if (this.#icon_custom === undefined) this.#renderStyleIcon();
153
+ if (this.#iconCustom === undefined) this.#renderStyleIcon();
154
154
  // Заголовок не задавали — он тоже описывает состояние
155
155
  this.#renderTitle();
156
156
  return this;
@@ -159,25 +159,25 @@ class Result {
159
159
  /** Свой значок (имя из `Icons`, `Icon`, компонент или узел); `undefined` возвращает значок состояния */
160
160
  setIcon(icon = undefined) {
161
161
  if (icon === undefined || icon === null || icon === "") {
162
- this.#icon_custom = undefined;
162
+ this.#iconCustom = undefined;
163
163
  this.#renderStyleIcon();
164
164
  return this;
165
165
  }
166
- this.#icon_custom =
166
+ this.#iconCustom =
167
167
  typeof icon === "string"
168
168
  ? new Icon(icon, "36px").set()
169
169
  : typeof icon.set === "function"
170
170
  ? icon.set()
171
171
  : icon;
172
172
  this.#icon.innerHTML = "";
173
- this.#icon.appendChild(this.#icon_custom);
173
+ this.#icon.appendChild(this.#iconCustom);
174
174
  return this;
175
175
  }
176
176
 
177
177
  /** Заголовок; пустая строка — заголовок состояния, `null` — без заголовка */
178
178
  setTitle(text = undefined) {
179
- this.#title_hidden = text === null;
180
- this.#title_value = typeof text === "string" && text !== "" ? text : undefined;
179
+ this.#titleHidden = text === null;
180
+ this.#titleValue = typeof text === "string" && text !== "" ? text : undefined;
181
181
  this.#renderTitle();
182
182
  return this;
183
183
  }
@@ -228,9 +228,9 @@ class Result {
228
228
  }
229
229
 
230
230
  #renderTitle() {
231
- const text = this.#title_value === undefined ? Result.TITLE[this.#style] : this.#title_value;
232
- this.#title.hidden = this.#title_hidden;
233
- this.#title.innerText = this.#title_hidden ? "" : text;
231
+ const text = this.#titleValue === undefined ? Result.TITLE[this.#style] : this.#titleValue;
232
+ this.#title.hidden = this.#titleHidden;
233
+ this.#title.innerText = this.#titleHidden ? "" : text;
234
234
  }
235
235
  }
236
236
 
@@ -72,17 +72,17 @@ result_actions:empty {
72
72
 
73
73
  /* Стили состояния красят плашку значка — заливку блока они не трогают */
74
74
  chui_result.result_success result_icon {
75
- background: var(--badge_success_back);
75
+ background: var(--badge_success_background);
76
76
  color: var(--badge_success_text);
77
77
  }
78
78
 
79
79
  chui_result.result_warning result_icon {
80
- background: var(--badge_warning_back);
80
+ background: var(--badge_warning_background);
81
81
  color: var(--badge_warning_text);
82
82
  }
83
83
 
84
84
  chui_result.result_error result_icon {
85
- background: var(--badge_error_back);
85
+ background: var(--badge_error_background);
86
86
  color: var(--badge_error_text);
87
87
  }
88
88