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
@@ -2,11 +2,11 @@ const { Button } = require("../chui_button/button");
2
2
 
3
3
  class Form {
4
4
  #id = require("randomstring").generate();
5
- #chui_form_main = document.createElement("chui_form_main");
5
+ #chuiFormMain = document.createElement("chui_form_main");
6
6
  #form = document.createElement("form");
7
7
  #components = [];
8
- #submit_event = undefined;
9
- #validate_on_submit = true;
8
+ #submitEvent = undefined;
9
+ #validateOnSubmit = true;
10
10
  constructor(
11
11
  options = {
12
12
  action: String(),
@@ -17,19 +17,19 @@ class Form {
17
17
  }
18
18
  ) {
19
19
  require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_Forms");
20
- this.#chui_form_main.id = this.#id;
21
- this.#chui_form_main.appendChild(this.#form);
20
+ this.#chuiFormMain.id = this.#id;
21
+ this.#chuiFormMain.appendChild(this.#form);
22
22
 
23
23
  // Установка компонентов в форму (частичный объект опций без components — пустая форма)
24
24
  this.#components = Array.isArray(options.components) ? options.components : [];
25
- for (let component of this.#components) this.#form.appendChild(component.set());
25
+ for (const component of this.#components) this.#form.appendChild(component.set());
26
26
  // ===
27
27
 
28
28
  //Установка опций
29
29
  if (options.action) this.#form.action = options.action;
30
30
  if (options.method) this.#form.method = options.method;
31
- if (options.validateOnSubmit !== undefined) this.#validate_on_submit = options.validateOnSubmit;
32
- this.#submit_event = options.submitEvent;
31
+ if (options.validateOnSubmit !== undefined) this.#validateOnSubmit = options.validateOnSubmit;
32
+ this.#submitEvent = options.submitEvent;
33
33
  // Своя валидация вместо нативной: свои тексты ошибок и разметка
34
34
  this.#form.setAttribute("novalidate", "true");
35
35
  this.#form.addEventListener("submit", this.#onSubmit);
@@ -37,14 +37,14 @@ class Form {
37
37
  }
38
38
  #onSubmit = (event) => {
39
39
  event.preventDefault();
40
- if (this.#validate_on_submit) {
40
+ if (this.#validateOnSubmit) {
41
41
  const result = this.validate();
42
42
  if (!result.valid) {
43
43
  if (result.first !== undefined && typeof result.first.focus === "function") result.first.focus();
44
44
  return;
45
45
  }
46
46
  }
47
- if (this.#submit_event !== undefined) this.#submit_event(event, this.getValues(), this);
47
+ if (this.#submitEvent !== undefined) this.#submitEvent(event, this.getValues(), this);
48
48
  };
49
49
  /** Проверить все поля формы: сами ошибки выставляются в поля */
50
50
  validate() {
@@ -118,7 +118,7 @@ class Form {
118
118
  }
119
119
  //addSubmitEvent(listener = () => {}) { this.#form.addEventListener("submit", listener); }
120
120
  set() {
121
- return this.#chui_form_main;
121
+ return this.#chuiFormMain;
122
122
  }
123
123
  static SubmitButton(title = String()) {
124
124
  return new SubmitButton(title);
@@ -48,7 +48,7 @@ class Gantt {
48
48
 
49
49
  #root = document.createElement("chui_gantt");
50
50
  #corner = document.createElement("gantt_corner");
51
- #scale_row = document.createElement("gantt_scale");
51
+ #scaleRow = document.createElement("gantt_scale");
52
52
  #scroll = document.createElement("gantt_scroll");
53
53
  #rows = document.createElement("gantt_rows");
54
54
  #links = undefined;
@@ -57,15 +57,15 @@ class Gantt {
57
57
  #from = undefined;
58
58
  #to = undefined;
59
59
  #scale = undefined;
60
- #first_day = 1;
61
- #row_height = Gantt.DEFAULT_ROW_HEIGHT;
62
- #bar_height = Gantt.DEFAULT_BAR_HEIGHT;
63
- #label_width = Gantt.DEFAULT_LABEL_WIDTH;
64
- #show_progress = true;
65
- #show_links = true;
60
+ #firstDay = 1;
61
+ #rowHeight = Gantt.DEFAULT_ROW_HEIGHT;
62
+ #barHeight = Gantt.DEFAULT_BAR_HEIGHT;
63
+ #labelWidth = Gantt.DEFAULT_LABEL_WIDTH;
64
+ #showProgress = true;
65
+ #showLinks = true;
66
66
  #label = undefined;
67
- #on_task_click = undefined;
68
- #rows_layout = [];
67
+ #onTaskClick = undefined;
68
+ #rowsLayout = [];
69
69
 
70
70
  constructor(
71
71
  options = {
@@ -94,28 +94,28 @@ class Gantt {
94
94
  this.#from = options.from;
95
95
  this.#to = options.to;
96
96
  this.#scale = Gantt.#knownScale(options.scale);
97
- this.#first_day = options.firstDay === undefined ? this.#first_day : options.firstDay;
98
- this.#row_height = options.rowHeight === undefined ? this.#row_height : options.rowHeight;
99
- this.#bar_height = options.barHeight === undefined ? this.#bar_height : options.barHeight;
100
- this.#label_width = options.labelWidth === undefined ? this.#label_width : options.labelWidth;
101
- this.#show_progress = options.showProgress !== false;
102
- this.#show_links = options.showLinks !== false;
103
- this.#on_task_click = options.onTaskClick;
97
+ this.#firstDay = options.firstDay === undefined ? this.#firstDay : options.firstDay;
98
+ this.#rowHeight = options.rowHeight === undefined ? this.#rowHeight : options.rowHeight;
99
+ this.#barHeight = options.barHeight === undefined ? this.#barHeight : options.barHeight;
100
+ this.#labelWidth = options.labelWidth === undefined ? this.#labelWidth : options.labelWidth;
101
+ this.#showProgress = options.showProgress !== false;
102
+ this.#showLinks = options.showLinks !== false;
103
+ this.#onTaskClick = options.onTaskClick;
104
104
  this.setLabel(optionOr(options.label, I18n.t("gantt.title")));
105
105
  this.setHeight(options.height);
106
106
  this.#corner.innerText = I18n.t("gantt.task");
107
107
  this.#corner.setAttribute("aria-hidden", "true");
108
108
  const head = document.createElement("gantt_head");
109
109
  head.appendChild(this.#corner);
110
- head.appendChild(this.#scale_row);
110
+ head.appendChild(this.#scaleRow);
111
111
  this.#root.appendChild(head);
112
112
  this.#rows.appendChild(this.#createLinks());
113
113
  this.#scroll.appendChild(this.#rows);
114
114
  this.#root.appendChild(this.#scroll);
115
115
  this.#root.addEventListener("click", this.#onClick);
116
- this.setProperty("--gantt_label_width", `${this.#label_width}px`);
117
- this.#root.style.setProperty("--gantt_row_height", `${this.#row_height}px`);
118
- this.#root.style.setProperty("--gantt_bar_height", `${this.#bar_height}px`);
116
+ this.setProperty("--gantt_label_width", `${this.#labelWidth}px`);
117
+ this.#root.style.setProperty("--gantt_row_height", `${this.#rowHeight}px`);
118
+ this.#root.style.setProperty("--gantt_bar_height", `${this.#barHeight}px`);
119
119
  this.#render();
120
120
  }
121
121
 
@@ -153,11 +153,11 @@ class Gantt {
153
153
  }
154
154
 
155
155
  getRowHeight() {
156
- return this.#row_height;
156
+ return this.#rowHeight;
157
157
  }
158
158
 
159
159
  getLabelWidth() {
160
- return this.#label_width;
160
+ return this.#labelWidth;
161
161
  }
162
162
 
163
163
  /** Полоса задачи на диаграмме (если задача показана) */
@@ -295,7 +295,7 @@ class Gantt {
295
295
  if (scale === Gantt.SCALE.MONTH) return new Date(date.getFullYear(), date.getMonth(), 1);
296
296
  const day = Gantt.#startOfDay(date);
297
297
  if (scale === Gantt.SCALE.WEEK) {
298
- const offset = (day.getDay() - this.#first_day + 7) % 7;
298
+ const offset = (day.getDay() - this.#firstDay + 7) % 7;
299
299
  day.setDate(day.getDate() - offset);
300
300
  }
301
301
  return day;
@@ -361,8 +361,8 @@ class Gantt {
361
361
 
362
362
  #renderScale(bounds = Object()) {
363
363
  const scale = this.getScale();
364
- this.#scale_row.innerHTML = "";
365
- this.#scale_row.style.gridTemplateColumns = `repeat(${bounds.columns.length}, minmax(0, 1fr))`;
364
+ this.#scaleRow.innerHTML = "";
365
+ this.#scaleRow.style.gridTemplateColumns = `repeat(${bounds.columns.length}, minmax(0, 1fr))`;
366
366
  this.#root.style.setProperty("--gantt_columns", String(bounds.columns.length));
367
367
  const today = Gantt.#startOfDay(new Date());
368
368
  for (const column of bounds.columns) {
@@ -380,18 +380,18 @@ class Gantt {
380
380
  if (scale === Gantt.SCALE.DAY && (column.from.getDay() === 0 || column.from.getDay() === 6))
381
381
  cell.classList.add("gantt_weekend");
382
382
  if (today >= column.from && today < column.to) cell.classList.add("gantt_today_cell");
383
- this.#scale_row.appendChild(cell);
383
+ this.#scaleRow.appendChild(cell);
384
384
  }
385
385
  }
386
386
 
387
387
  #renderRows(bounds = Object()) {
388
388
  // Заглушка "задач нет" тоже пересобирается: иначе она оставалась бы на диаграмме после setTasks()
389
389
  this.#rows.querySelectorAll("gantt_row, gantt_group_row, gantt_empty").forEach((row) => row.remove());
390
- this.#rows_layout = [];
390
+ this.#rowsLayout = [];
391
391
  const today = Gantt.#startOfDay(new Date());
392
392
  const todayFraction = today >= bounds.from && today < bounds.to ? this.#fraction(today, bounds) : undefined;
393
393
  let lastGroup = undefined;
394
- for (const [task_index, task] of this.#tasks.entries()) {
394
+ for (const [taskIndex, task] of this.#tasks.entries()) {
395
395
  if (task.group !== undefined && task.group !== lastGroup) {
396
396
  lastGroup = task.group;
397
397
  this.#rows.appendChild(this.#createGroupRow(task.group));
@@ -410,7 +410,7 @@ class Gantt {
410
410
  if (start !== undefined && end !== undefined && end > bounds.from && start < bounds.to) {
411
411
  const left = this.#fraction(start, bounds);
412
412
  const right = this.#fraction(end, bounds);
413
- track.appendChild(this.#createBar(task, start, end, left, Math.max(0.02, right - left), task_index));
413
+ track.appendChild(this.#createBar(task, start, end, left, Math.max(0.02, right - left), taskIndex));
414
414
  }
415
415
  if (todayFraction !== undefined) {
416
416
  const line = document.createElement("gantt_today_line");
@@ -421,7 +421,7 @@ class Gantt {
421
421
  row.appendChild(label);
422
422
  row.appendChild(track);
423
423
  this.#rows.appendChild(row);
424
- this.#rows_layout.push({ task: task, row: row });
424
+ this.#rowsLayout.push({ task: task, row: row });
425
425
  }
426
426
  if (this.#tasks.length === 0) {
427
427
  const empty = document.createElement("gantt_empty");
@@ -430,7 +430,7 @@ class Gantt {
430
430
  }
431
431
  this.#rows.style.setProperty(
432
432
  "--gantt_rows_height",
433
- `${Math.max(1, this.#rows_layout.length) * this.#row_height}px`
433
+ `${Math.max(1, this.#rowsLayout.length) * this.#rowHeight}px`
434
434
  );
435
435
  }
436
436
 
@@ -453,13 +453,13 @@ class Gantt {
453
453
  end = new Date(),
454
454
  left = Number(),
455
455
  width = Number(),
456
- task_index = Number()
456
+ taskIndex = Number()
457
457
  ) {
458
458
  const bar = document.createElement("button");
459
459
  bar.type = "button";
460
460
  bar.className = "gantt_bar";
461
461
  bar.dataset.id = task.id === undefined ? "" : String(task.id);
462
- bar.dataset.index = String(task_index);
462
+ bar.dataset.index = String(taskIndex);
463
463
  bar.style.left = `${left * 100}%`;
464
464
  bar.style.width = `${width * 100}%`;
465
465
  if (task.color !== undefined) bar.style.background = String(task.color);
@@ -467,7 +467,7 @@ class Gantt {
467
467
  title.innerText = task.title === undefined ? I18n.t("gantt.task") : String(task.title);
468
468
  bar.appendChild(title);
469
469
  const progress = this.#progress(task);
470
- if (this.#show_progress && progress !== undefined) {
470
+ if (this.#showProgress && progress !== undefined) {
471
471
  const fill = document.createElement("gantt_bar_progress");
472
472
  fill.style.width = `${progress}%`;
473
473
  bar.appendChild(fill);
@@ -510,18 +510,18 @@ class Gantt {
510
510
  #renderLinks(bounds = Object()) {
511
511
  if (this.#links === undefined) return;
512
512
  this.#links.innerHTML = "";
513
- if (!this.#show_links) return;
514
- const index = new Map(this.#rows_layout.map((entry, position) => [String(entry.task.id), position]));
515
- const height = Math.max(1, this.#rows_layout.length) * this.#row_height;
513
+ if (!this.#showLinks) return;
514
+ const index = new Map(this.#rowsLayout.map((entry, position) => [String(entry.task.id), position]));
515
+ const height = Math.max(1, this.#rowsLayout.length) * this.#rowHeight;
516
516
  this.#links.setAttribute("viewBox", `0 0 100 ${height}`);
517
517
  this.#links.style.height = `${height}px`;
518
- for (const { task } of this.#rows_layout) {
518
+ for (const { task } of this.#rowsLayout) {
519
519
  const dependencies = Array.isArray(task.dependencies) ? task.dependencies : [];
520
520
  if (dependencies.length === 0) continue;
521
521
  const start = Gantt.#taskStart(task);
522
522
  if (start === undefined) continue;
523
523
  const x2 = this.#fraction(start, bounds) * 100;
524
- const y2 = (index.get(String(task.id)) + 0.5) * this.#row_height;
524
+ const y2 = (index.get(String(task.id)) + 0.5) * this.#rowHeight;
525
525
  for (const dependency of dependencies) {
526
526
  const position = index.get(String(dependency));
527
527
  if (position === undefined) continue;
@@ -529,7 +529,7 @@ class Gantt {
529
529
  const end = source === undefined ? undefined : Gantt.#taskEnd(source);
530
530
  if (end === undefined) continue;
531
531
  const x1 = this.#fraction(end, bounds) * 100;
532
- const y1 = (position + 0.5) * this.#row_height;
532
+ const y1 = (position + 0.5) * this.#rowHeight;
533
533
  // Колено всегда справа от конца предшественника: при наложении линия уйдёт назад
534
534
  const elbow = x1 + 1.5;
535
535
  const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
@@ -555,7 +555,7 @@ class Gantt {
555
555
  const bar = target.closest(".gantt_bar");
556
556
  if (bar === null) return;
557
557
  const task = this.#tasks[Number(bar.dataset.index)];
558
- if (this.#on_task_click !== undefined) this.#on_task_click(task, bar);
558
+ if (this.#onTaskClick !== undefined) this.#onTaskClick(task, bar);
559
559
  };
560
560
  }
561
561
 
@@ -9,12 +9,12 @@ chui_gantt {
9
9
  flex-direction: column;
10
10
  width: -webkit-fill-available;
11
11
  box-sizing: border-box;
12
- margin: var(--margin);
12
+ margin: var(--block_margin);
13
13
  color: var(--text_color);
14
14
  font-size: var(--font_default_size);
15
15
  background: var(--element_background_2);
16
16
  border: 1px solid var(--border_color);
17
- border-radius: var(--border_radius);
17
+ border-radius: var(--radius_sm);
18
18
  overflow: hidden;
19
19
  }
20
20
 
@@ -128,7 +128,7 @@ button.gantt_bar {
128
128
  padding: 0 6px;
129
129
  overflow: hidden;
130
130
  border: none;
131
- border-radius: var(--border_radius);
131
+ border-radius: var(--radius_sm);
132
132
  background: var(--blue_prime_background);
133
133
  color: var(--text_color_hover);
134
134
  font-family: inherit;
@@ -163,7 +163,7 @@ gantt_bar_progress {
163
163
  inset-inline-start: 0;
164
164
  top: 0;
165
165
  bottom: 0;
166
- background: rgba(0, 0, 0, 0.28);
166
+ background: var(--overlay_dim);
167
167
  pointer-events: none;
168
168
  }
169
169
 
@@ -199,7 +199,7 @@ svg.gantt_links circle.gantt_link_dot {
199
199
 
200
200
  gantt_empty {
201
201
  display: block;
202
- padding: var(--main_padding);
202
+ padding: var(--block_padding);
203
203
  color: var(--text_color_disabled);
204
204
  text-align: center;
205
205
  }