chuijs 4.0.2 → 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 (292) hide show
  1. package/CHANGELOG.md +597 -0
  2. package/README.md +43 -644
  3. package/framework/appLayout/default/chui_app_layout.js +602 -496
  4. package/framework/appLayout/default/global_style.css +288 -97
  5. package/framework/appLayout/default/main_theme_style.css +188 -101
  6. package/framework/components/chui_accordion/accordion.js +38 -35
  7. package/framework/components/chui_accordion/styles.css +13 -12
  8. package/framework/components/chui_action_sheet/action_sheet.js +93 -64
  9. package/framework/components/chui_action_sheet/styles.css +12 -5
  10. package/framework/components/chui_actions_bar/actions_bar.js +338 -0
  11. package/framework/components/chui_actions_bar/styles.css +139 -0
  12. package/framework/components/chui_affix/affix.js +16 -11
  13. package/framework/components/chui_affix/styles.css +5 -0
  14. package/framework/components/chui_alert/alert.js +34 -19
  15. package/framework/components/chui_alert/styles.css +7 -0
  16. package/framework/components/chui_avatar/avatar.js +36 -35
  17. package/framework/components/chui_avatar/styles.css +1 -1
  18. package/framework/components/chui_avatar_group/avatar_group.js +25 -23
  19. package/framework/components/chui_avatar_group/styles.css +1 -1
  20. package/framework/components/chui_backtop/backtop.js +60 -21
  21. package/framework/components/chui_backtop/styles.css +21 -0
  22. package/framework/components/chui_badge/badge.js +30 -28
  23. package/framework/components/chui_badge/styles.css +6 -6
  24. package/framework/components/chui_banner/banner.js +222 -0
  25. package/framework/components/chui_banner/styles.css +170 -0
  26. package/framework/components/chui_breadcrumb/breadcrumb.js +15 -13
  27. package/framework/components/chui_breadcrumb/styles.css +1 -1
  28. package/framework/components/chui_button/button.js +52 -36
  29. package/framework/components/chui_button/styles.css +7 -7
  30. package/framework/components/chui_calendar/calendar.js +18 -16
  31. package/framework/components/chui_card/card.js +52 -32
  32. package/framework/components/chui_card_scroll/card_scroll.js +169 -0
  33. package/framework/components/chui_card_scroll/styles.css +86 -0
  34. package/framework/components/chui_chat/chat.js +140 -79
  35. package/framework/components/chui_chat/styles.css +18 -7
  36. package/framework/components/chui_clipboard_history/clipboard_history.js +53 -39
  37. package/framework/components/chui_clipboard_history/styles.css +13 -9
  38. package/framework/components/chui_code/code.js +10 -10
  39. package/framework/components/chui_code/styles.css +4 -4
  40. package/framework/components/chui_code_editor/code_editor.js +73 -57
  41. package/framework/components/chui_code_editor/styles.css +6 -5
  42. package/framework/components/chui_command_palette/command_palette.js +87 -64
  43. package/framework/components/chui_command_palette/styles.css +5 -5
  44. package/framework/components/chui_console/console.js +13 -13
  45. package/framework/components/chui_console/styles.css +6 -3
  46. package/framework/components/chui_content_block/content_block.js +35 -21
  47. package/framework/components/chui_content_block/styles.css +2 -2
  48. package/framework/components/chui_context_menu/context_menu.js +171 -58
  49. package/framework/components/chui_context_menu/styles.css +82 -8
  50. package/framework/components/chui_custom_element/custom_element.js +25 -18
  51. package/framework/components/chui_data_grid/data_grid.js +633 -471
  52. package/framework/components/chui_data_grid/styles.css +24 -22
  53. package/framework/components/chui_descriptions/descriptions.js +34 -17
  54. package/framework/components/chui_descriptions/styles.css +1 -1
  55. package/framework/components/chui_details/details.js +42 -36
  56. package/framework/components/chui_details/styles.css +12 -11
  57. package/framework/components/chui_diff_viewer/diff_viewer.js +172 -147
  58. package/framework/components/chui_diff_viewer/styles.css +10 -10
  59. package/framework/components/chui_divider/divider.js +19 -17
  60. package/framework/components/chui_divider/styles.css +2 -2
  61. package/framework/components/chui_drawer/drawer.js +63 -38
  62. package/framework/components/chui_drawer/styles.css +18 -4
  63. package/framework/components/chui_drop_zone/drop_zone.js +37 -27
  64. package/framework/components/chui_drop_zone/styles.css +10 -6
  65. package/framework/components/chui_empty_state/empty_state.js +20 -15
  66. package/framework/components/chui_fieldset/fieldset.js +40 -23
  67. package/framework/components/chui_fieldset/styles.css +6 -6
  68. package/framework/components/chui_file_explorer/file_explorer.js +260 -189
  69. package/framework/components/chui_file_explorer/styles.css +8 -7
  70. package/framework/components/chui_form/form.js +40 -28
  71. package/framework/components/chui_form/styles.css +1 -1
  72. package/framework/components/chui_gantt/gantt.js +102 -78
  73. package/framework/components/chui_gantt/styles.css +5 -5
  74. package/framework/components/chui_graphs/graphs.js +376 -239
  75. package/framework/components/chui_graphs/styles.css +27 -6
  76. package/framework/components/chui_hero/hero.js +98 -37
  77. package/framework/components/chui_hero/styles.css +176 -7
  78. package/framework/components/chui_html_block/html_block.js +8 -8
  79. package/framework/components/chui_html_block/styles.css +3 -3
  80. package/framework/components/chui_hx/hx.js +3 -3
  81. package/framework/components/chui_hx/styles.css +13 -6
  82. package/framework/components/chui_icons/icons.js +2115 -2115
  83. package/framework/components/chui_icons/styles.css +4 -3
  84. package/framework/components/chui_inputs/chui_check_box/check_box.js +31 -19
  85. package/framework/components/chui_inputs/chui_check_box/styles.css +30 -21
  86. package/framework/components/chui_inputs/chui_chips/chips.js +141 -70
  87. package/framework/components/chui_inputs/chui_chips/styles.css +32 -7
  88. package/framework/components/chui_inputs/chui_color_picker/color_picker.js +55 -38
  89. package/framework/components/chui_inputs/chui_color_picker/styles.css +7 -7
  90. package/framework/components/chui_inputs/chui_combo_box/combo_box.js +127 -109
  91. package/framework/components/chui_inputs/chui_combo_box/styles.css +23 -21
  92. package/framework/components/chui_inputs/chui_date/date.js +161 -127
  93. package/framework/components/chui_inputs/chui_date/styles.css +20 -19
  94. package/framework/components/chui_inputs/chui_date_range/date_range.js +61 -50
  95. package/framework/components/chui_inputs/chui_date_range/styles.css +3 -3
  96. package/framework/components/chui_inputs/chui_datetime/datetime.js +47 -39
  97. package/framework/components/chui_inputs/chui_datetime/styles.css +3 -3
  98. package/framework/components/chui_inputs/chui_email/email.js +48 -36
  99. package/framework/components/chui_inputs/chui_email/styles.css +11 -11
  100. package/framework/components/chui_inputs/chui_file/file.js +71 -44
  101. package/framework/components/chui_inputs/chui_file/styles.css +23 -19
  102. package/framework/components/chui_inputs/chui_hotkey/hotkey.js +101 -76
  103. package/framework/components/chui_inputs/chui_hotkey/styles.css +6 -6
  104. package/framework/components/chui_inputs/chui_masked/masked.js +83 -72
  105. package/framework/components/chui_inputs/chui_masked/styles.css +5 -5
  106. package/framework/components/chui_inputs/chui_mention/mention.js +87 -40
  107. package/framework/components/chui_inputs/chui_mention/styles.css +14 -8
  108. package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +242 -212
  109. package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +23 -15
  110. package/framework/components/chui_inputs/chui_number/number.js +84 -70
  111. package/framework/components/chui_inputs/chui_number/styles.css +13 -13
  112. package/framework/components/chui_inputs/chui_otp/otp.js +71 -62
  113. package/framework/components/chui_inputs/chui_otp/styles.css +5 -5
  114. package/framework/components/chui_inputs/chui_password/password.js +72 -56
  115. package/framework/components/chui_inputs/chui_password/styles.css +15 -15
  116. package/framework/components/chui_inputs/chui_radio_button/radio_button.js +37 -25
  117. package/framework/components/chui_inputs/chui_radio_button/styles.css +22 -22
  118. package/framework/components/chui_inputs/chui_rating/rating.js +54 -50
  119. package/framework/components/chui_inputs/chui_rating/styles.css +3 -3
  120. package/framework/components/chui_inputs/chui_select_box/select_box.js +132 -108
  121. package/framework/components/chui_inputs/chui_select_box/styles.css +21 -21
  122. package/framework/components/chui_inputs/chui_slider/slider.js +41 -38
  123. package/framework/components/chui_inputs/chui_slider/styles.css +7 -5
  124. package/framework/components/chui_inputs/chui_text/styles.css +14 -14
  125. package/framework/components/chui_inputs/chui_text/text.js +69 -52
  126. package/framework/components/chui_inputs/chui_text_area/styles.css +14 -14
  127. package/framework/components/chui_inputs/chui_text_area/text_area.js +59 -36
  128. package/framework/components/chui_inputs/chui_time/styles.css +18 -20
  129. package/framework/components/chui_inputs/chui_time/time.js +71 -49
  130. package/framework/components/chui_inputs/chui_toggle/styles.css +13 -6
  131. package/framework/components/chui_inputs/chui_toggle/toggle.js +27 -27
  132. package/framework/components/chui_json_editor/json_editor.js +137 -127
  133. package/framework/components/chui_json_editor/styles.css +5 -5
  134. package/framework/components/chui_json_viewer/json_viewer.js +133 -114
  135. package/framework/components/chui_json_viewer/styles.css +9 -8
  136. package/framework/components/chui_kanban/kanban.js +78 -60
  137. package/framework/components/chui_kanban/styles.css +8 -4
  138. package/framework/components/chui_kbd/kbd.js +12 -10
  139. package/framework/components/chui_kbd/styles.css +1 -1
  140. package/framework/components/chui_label/label.js +31 -29
  141. package/framework/components/chui_label/styles.css +3 -3
  142. package/framework/components/chui_link/link.js +36 -29
  143. package/framework/components/chui_link/styles.css +11 -4
  144. package/framework/components/chui_list/list.js +42 -38
  145. package/framework/components/chui_list/styles.css +4 -3
  146. package/framework/components/chui_markdown_editor/markdown_editor.js +125 -109
  147. package/framework/components/chui_markdown_editor/styles.css +5 -5
  148. package/framework/components/chui_media/audio.js +457 -364
  149. package/framework/components/chui_media/audio_styles.css +74 -37
  150. package/framework/components/chui_media/image.js +99 -64
  151. package/framework/components/chui_media/image_compare.js +86 -55
  152. package/framework/components/chui_media/image_compare_styles.css +5 -5
  153. package/framework/components/chui_media/image_styles.css +4 -4
  154. package/framework/components/chui_media/video.js +264 -171
  155. package/framework/components/chui_media/video_styles.css +57 -24
  156. package/framework/components/chui_menu_bar/menu_bar.js +67 -65
  157. package/framework/components/chui_menu_bar/styles.css +14 -12
  158. package/framework/components/chui_message_bar/message_bar.js +551 -0
  159. package/framework/components/chui_message_bar/styles.css +248 -0
  160. package/framework/components/chui_modal/modal.js +81 -56
  161. package/framework/components/chui_modal/styles.css +3 -2
  162. package/framework/components/chui_notification/notification.js +107 -69
  163. package/framework/components/chui_notification/notification_download.js +28 -77
  164. package/framework/components/chui_notification/notification_download_card.js +115 -0
  165. package/framework/components/chui_notification/notification_download_progress.css +5 -4
  166. package/framework/components/chui_notification/notification_download_progress.js +73 -105
  167. package/framework/components/chui_notification/notification_update.js +44 -37
  168. package/framework/components/chui_notification/status_plate.css +3 -3
  169. package/framework/components/chui_notification/status_plate.js +2 -2
  170. package/framework/components/chui_notification/styles.css +6 -1
  171. package/framework/components/chui_notification/styles_download.css +2 -2
  172. package/framework/components/chui_notification/styles_update.css +3 -3
  173. package/framework/components/chui_org_chart/org_chart.js +101 -62
  174. package/framework/components/chui_org_chart/styles.css +2 -2
  175. package/framework/components/chui_pagination/pagination.js +65 -30
  176. package/framework/components/chui_pagination/styles.css +1 -1
  177. package/framework/components/chui_paragraph/paragraph.js +2 -2
  178. package/framework/components/chui_paragraph/styles.css +3 -3
  179. package/framework/components/chui_popover/popover.js +77 -50
  180. package/framework/components/chui_popover/styles.css +1 -1
  181. package/framework/components/chui_popups/popups.js +210 -181
  182. package/framework/components/chui_popups/styles.css +7 -7
  183. package/framework/components/chui_print_button/print_button.js +48 -33
  184. package/framework/components/chui_progress_bar/progress_bar.js +49 -19
  185. package/framework/components/chui_progress_bar/styles.css +6 -6
  186. package/framework/components/chui_progress_ring/progress_ring.js +32 -30
  187. package/framework/components/chui_progress_ring/styles.css +1 -1
  188. package/framework/components/chui_qrcode/qrcode.js +85 -41
  189. package/framework/components/chui_query_builder/query_builder.js +263 -170
  190. package/framework/components/chui_query_builder/styles.css +4 -4
  191. package/framework/components/chui_radio_group/radio_group.js +36 -26
  192. package/framework/components/chui_radio_group/styles.css +2 -2
  193. package/framework/components/chui_result/result.js +41 -31
  194. package/framework/components/chui_result/styles.css +3 -3
  195. package/framework/components/chui_scheduler/scheduler.js +126 -104
  196. package/framework/components/chui_scheduler/styles.css +11 -7
  197. package/framework/components/chui_screen_spinner/screen_spinner.js +167 -0
  198. package/framework/components/chui_screen_spinner/styles.css +49 -0
  199. package/framework/components/chui_segmented_control/segmented_control.js +90 -27
  200. package/framework/components/chui_segmented_control/styles.css +32 -6
  201. package/framework/components/chui_settings/settings.js +160 -87
  202. package/framework/components/chui_settings/styles.css +4 -4
  203. package/framework/components/chui_shortcut_help/shortcut_help.js +82 -61
  204. package/framework/components/chui_sidebar_nav/sidebar_nav.js +132 -53
  205. package/framework/components/chui_sidebar_nav/styles.css +9 -3
  206. package/framework/components/chui_skeleton/skeleton.js +29 -24
  207. package/framework/components/chui_slideshow/slideshow.js +122 -103
  208. package/framework/components/chui_slideshow/styles.css +22 -16
  209. package/framework/components/chui_spinner/spinner.js +17 -17
  210. package/framework/components/chui_spinner/styles.css +0 -1
  211. package/framework/components/chui_split_button/split_button.js +53 -30
  212. package/framework/components/chui_split_button/styles.css +22 -6
  213. package/framework/components/chui_splitter/splitter.js +46 -39
  214. package/framework/components/chui_splitter/styles.css +2 -2
  215. package/framework/components/chui_statistic/statistic.js +111 -84
  216. package/framework/components/chui_status_bar/status_bar.js +11 -9
  217. package/framework/components/chui_status_bar/styles.css +2 -2
  218. package/framework/components/chui_stepper/stepper.js +230 -54
  219. package/framework/components/chui_stepper/styles.css +79 -14
  220. package/framework/components/chui_sticky_bar/sticky_bar.js +53 -17
  221. package/framework/components/chui_sticky_bar/styles.css +11 -7
  222. package/framework/components/chui_tabs/chui_tabs.js +100 -46
  223. package/framework/components/chui_tabs/styles.css +43 -15
  224. package/framework/components/chui_text_editor/styles.css +24 -23
  225. package/framework/components/chui_text_editor/text_editor.js +103 -79
  226. package/framework/components/chui_text_editor/text_editor_panel.js +428 -367
  227. package/framework/components/chui_theme_toggle/theme_toggle.js +46 -25
  228. package/framework/components/chui_timeline/styles.css +3 -1
  229. package/framework/components/chui_timeline/timeline.js +14 -12
  230. package/framework/components/chui_toast_queue/styles.css +11 -11
  231. package/framework/components/chui_toast_queue/toast_queue.js +82 -73
  232. package/framework/components/chui_toolbar/styles.css +2 -2
  233. package/framework/components/chui_toolbar/toolbar.js +20 -13
  234. package/framework/components/chui_tooltip/styles.css +2 -2
  235. package/framework/components/chui_tooltip/tooltip.js +40 -27
  236. package/framework/components/chui_tour/styles.css +12 -7
  237. package/framework/components/chui_tour/tour.js +132 -98
  238. package/framework/components/chui_transfer/styles.css +8 -7
  239. package/framework/components/chui_transfer/transfer.js +143 -123
  240. package/framework/components/chui_tree_table/styles.css +4 -4
  241. package/framework/components/chui_tree_table/tree_table.js +88 -74
  242. package/framework/components/chui_tree_view/styles.css +14 -10
  243. package/framework/components/chui_tree_view/tree_view.js +298 -253
  244. package/framework/components/chui_user_bar/styles.css +145 -0
  245. package/framework/components/chui_user_bar/user_bar.js +402 -0
  246. package/framework/components/chui_user_list_bar/styles.css +173 -0
  247. package/framework/components/chui_user_list_bar/user_list_bar.js +485 -0
  248. package/framework/components/chui_watermark/watermark.js +41 -33
  249. package/framework/components/chui_webview/styles.css +2 -2
  250. package/framework/components/chui_webview/webview.js +64 -52
  251. package/framework/components/chui_write_bar/styles.css +172 -0
  252. package/framework/components/chui_write_bar/write_bar.js +320 -0
  253. package/framework/main_window.js +1234 -0
  254. package/framework/modules/chui_a11y/chui_a11y.js +153 -123
  255. package/framework/modules/chui_animations/animations.js +105 -43
  256. package/framework/modules/chui_animations/motion.js +120 -0
  257. package/framework/modules/chui_animations/styles.css +37 -4
  258. package/framework/modules/chui_bridge/preload.js +36 -25
  259. package/framework/modules/chui_functions.js +69 -63
  260. package/framework/modules/chui_highlight/chui_highlight.js +25 -22
  261. package/framework/modules/chui_highlight/styles.css +13 -10
  262. package/framework/modules/chui_i18n/chui_i18n.js +12 -10
  263. package/framework/modules/chui_i18n/locales/a11y.js +5 -5
  264. package/framework/modules/chui_i18n/locales/app_layout.js +5 -5
  265. package/framework/modules/chui_i18n/locales/calendar.js +3 -3
  266. package/framework/modules/chui_i18n/locales/common.js +3 -3
  267. package/framework/modules/chui_i18n/locales/data.js +36 -26
  268. package/framework/modules/chui_i18n/locales/editors.js +40 -13
  269. package/framework/modules/chui_i18n/locales/feedback.js +65 -3
  270. package/framework/modules/chui_i18n/locales/forms.js +8 -8
  271. package/framework/modules/chui_i18n/locales/graphics.js +8 -8
  272. package/framework/modules/chui_i18n/locales/media.js +4 -4
  273. package/framework/modules/chui_i18n/locales/navigation.js +12 -8
  274. package/framework/modules/chui_i18n/locales/validate.js +3 -3
  275. package/framework/modules/chui_json/chui_json.js +11 -11
  276. package/framework/modules/chui_layout/chui_layout.js +12 -10
  277. package/framework/modules/chui_logger/chui_logger.js +47 -28
  278. package/framework/modules/chui_page/page.js +39 -33
  279. package/framework/modules/chui_palette/palette.js +61 -0
  280. package/framework/modules/chui_qr/chui_qr.js +179 -88
  281. package/framework/modules/chui_scrollbar/chui_scrollbar.js +79 -68
  282. package/framework/modules/chui_scrollbar/styles.css +4 -2
  283. package/framework/modules/chui_services/chui_channels.js +27 -13
  284. package/framework/modules/chui_services/chui_services.js +47 -39
  285. package/framework/modules/chui_services/desktop.js +108 -101
  286. package/framework/modules/chui_sortable/chui_sortable.js +33 -28
  287. package/framework/modules/chui_validate/chui_validate.js +10 -7
  288. package/framework/tray_bar/chui_menu_items.js +136 -46
  289. package/index.d.ts +5046 -0
  290. package/index.js +199 -1254
  291. package/package.json +81 -68
  292. package/framework/components/telegram_bot/chui_telegram_bot.js +0 -184
@@ -0,0 +1,170 @@
1
+ /* Баннер: карточка-объявление с кромкой (значок или фото), текстом и действиями.
2
+ Материал — как у карточки и `Alert`: своя подложка и волосяная рамка. Отдельных цветов
3
+ у компонента нет: состояние несут плашка значка, фото и кнопки. */
4
+
5
+ chui_banner {
6
+ position: relative;
7
+ display: flex;
8
+ flex-direction: row;
9
+ align-items: center;
10
+ gap: 12px;
11
+ /* Компонент сам задаёт ширину: в flex-колонке с `align-items: flex-start` карточка
12
+ без ширины получила бы `max-content` и вылезла за содержимое */
13
+ width: -webkit-fill-available;
14
+ box-sizing: border-box;
15
+ padding: 12px 14px;
16
+ border: 1px solid var(--border_color);
17
+ border-radius: var(--radius_md);
18
+ background: var(--element_background_2);
19
+ color: var(--text_color);
20
+ font-size: var(--font_default_size);
21
+ text-align: start;
22
+ /* Появление: карточка встаёт на место — общий кадр из global_style.css */
23
+ animation: chui_appear_up var(--motion_base) var(--motion_ease);
24
+ }
25
+
26
+ /* Уход: карточка гаснет и сходит вверх, узел убирается по концу кадра */
27
+ .banner_leaving {
28
+ animation: chui_leave_up var(--motion_fast) var(--motion_ease) forwards;
29
+ }
30
+
31
+ /* Крупный баннер — карточка: кромка сверху во всю ширину, текст и действия под ней */
32
+ chui_banner[data-size="m"] {
33
+ flex-direction: column;
34
+ align-items: stretch;
35
+ gap: 10px;
36
+ /* Кромка касается краёв карточки: свои отступы у неё снизу, у текста — по бокам */
37
+ padding: 0 0 12px;
38
+ }
39
+
40
+ banner_media {
41
+ flex: none;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ box-sizing: border-box;
46
+ /* Кромка со значком — квадрат со строку текста (29 px у поля + воздух): в обоих
47
+ размерах она одного роста, а крупный вид с фотографией перекрывает этот размер ниже */
48
+ width: 44px;
49
+ height: 44px;
50
+ overflow: hidden;
51
+ border-radius: var(--radius_sm);
52
+ background: var(--element_background);
53
+ color: var(--blue_prime_background);
54
+ }
55
+
56
+ chui_banner[data-mode="tint"] banner_media {
57
+ background: var(--blue_prime_background_tint);
58
+ }
59
+
60
+ /* Фото — состояние `image`: кромка тянется во всю ширину карточки */
61
+ chui_banner[data-mode="image"][data-size="m"] banner_media {
62
+ width: -webkit-fill-available;
63
+ height: 140px;
64
+ border-radius: var(--radius_md) var(--radius_md) 0 0;
65
+ }
66
+
67
+ /* Плашка со значком в крупном баннере остаётся плашкой: без картинки полоса во всю ширину
68
+ была бы пустой — объявление читалось бы полем без содержимого */
69
+ chui_banner[data-mode="tint"][data-size="m"] banner_media {
70
+ align-self: flex-start;
71
+ margin: 12px 14px 0;
72
+ }
73
+
74
+ banner_media img {
75
+ display: block;
76
+ width: 100%;
77
+ height: 100%;
78
+ object-fit: cover;
79
+ }
80
+
81
+ banner_content {
82
+ display: flex;
83
+ flex-direction: column;
84
+ gap: 2px;
85
+ flex: 1 1 auto;
86
+ min-width: 0;
87
+ }
88
+
89
+ /* В крупном баннере текст отходит от краёв карточки: кромка их уже заняла */
90
+ chui_banner[data-size="m"] banner_content {
91
+ padding-inline: 14px;
92
+ }
93
+
94
+ banner_title {
95
+ font-weight: 600;
96
+ color: var(--text_color);
97
+ word-break: break-word;
98
+ }
99
+
100
+ banner_subtitle {
101
+ color: var(--text_color_disabled);
102
+ font-size: var(--font_labels_size);
103
+ word-break: break-word;
104
+ }
105
+
106
+ banner_text {
107
+ color: var(--text_color);
108
+ word-break: break-word;
109
+ }
110
+
111
+ banner_text p {
112
+ margin: 0;
113
+ }
114
+
115
+ banner_actions {
116
+ display: flex;
117
+ flex: none;
118
+ flex-wrap: wrap;
119
+ align-items: center;
120
+ gap: 8px;
121
+ }
122
+
123
+ /* Пустой блок действий места не занимает */
124
+ banner_actions:empty {
125
+ display: none;
126
+ }
127
+
128
+ chui_banner[data-size="m"] banner_actions {
129
+ padding-inline: 14px;
130
+ }
131
+
132
+ /* Закрытие — круглая кнопка в углу карточки: в крупном баннере она лежит поверх кромки,
133
+ поэтому фон у неё есть всегда, иначе значок терялся бы на снимке */
134
+ .banner_close {
135
+ position: absolute;
136
+ top: 8px;
137
+ inset-inline-end: 8px;
138
+ cursor: pointer;
139
+ display: flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ box-sizing: border-box;
143
+ width: 26px;
144
+ height: 26px;
145
+ padding: 0;
146
+ border: none;
147
+ border-radius: var(--radius_circle);
148
+ background: var(--element_background);
149
+ color: var(--text_color_disabled);
150
+ }
151
+
152
+ .banner_close:hover {
153
+ background: var(--element_background_hover);
154
+ color: var(--text_color);
155
+ }
156
+
157
+ .banner_close chui_icon {
158
+ color: inherit;
159
+ }
160
+
161
+ /* В строке (размер `s`) кнопке хватает места в ряду: поверх кромки она не лежит */
162
+ chui_banner[data-size="s"] .banner_close {
163
+ position: static;
164
+ flex: none;
165
+ background: transparent;
166
+ }
167
+
168
+ chui_banner[data-size="s"] .banner_close:hover {
169
+ background: var(--element_background_hover);
170
+ }
@@ -1,7 +1,7 @@
1
- const {setStyles, optionOr} = require("../../modules/chui_functions");
2
- const {Icon, Icons} = require("../chui_icons/icons");
3
- const {Link} = require("../chui_link/link");
4
- const {I18n} = require("../../modules/chui_i18n/chui_i18n");
1
+ const { setStyles, optionOr } = require("../../modules/chui_functions");
2
+ const { Icon, Icons } = require("../chui_icons/icons");
3
+ const { Link } = require("../chui_link/link");
4
+ const { I18n } = require("../../modules/chui_i18n/chui_i18n");
5
5
 
6
6
  /**
7
7
  * Навигационная цепочка: путь от корня к текущему месту с переходом по звеньям.
@@ -25,7 +25,7 @@ const {I18n} = require("../../modules/chui_i18n/chui_i18n");
25
25
  class Breadcrumb {
26
26
  static SIZE = {
27
27
  SMALL: "small",
28
- DEFAULT: "default"
28
+ DEFAULT: "default",
29
29
  };
30
30
  static #counter = 0;
31
31
 
@@ -34,12 +34,14 @@ class Breadcrumb {
34
34
  #items = [];
35
35
  #id = undefined;
36
36
 
37
- constructor(options = {
38
- id: String(),
39
- items: [],
40
- size: String(),
41
- label: String()
42
- }) {
37
+ constructor(
38
+ options = {
39
+ id: String(),
40
+ items: [],
41
+ size: String(),
42
+ label: String(),
43
+ }
44
+ ) {
43
45
  setStyles(__dirname + "/styles.css", "chUiJS_Breadcrumb");
44
46
  Breadcrumb.#counter += 1;
45
47
  this.#id = options.id === undefined ? `chui_breadcrumb_${Breadcrumb.#counter}` : options.id;
@@ -121,7 +123,7 @@ class Breadcrumb {
121
123
  node.appendChild(text);
122
124
  return node;
123
125
  }
124
- const link = new Link({text: item.title, href: item.href, clickEvent: item.clickEvent, icon: item.icon});
126
+ const link = new Link({ text: item.title, href: item.href, clickEvent: item.clickEvent, icon: item.icon });
125
127
  node.appendChild(link.set());
126
128
  return node;
127
129
  }
@@ -140,4 +142,4 @@ class Breadcrumb {
140
142
  static ICON_SIZE = "14px";
141
143
  }
142
144
 
143
- exports.Breadcrumb = Breadcrumb
145
+ exports.Breadcrumb = Breadcrumb;
@@ -3,7 +3,7 @@ chui_breadcrumb {
3
3
  display: block;
4
4
  width: max-content;
5
5
  max-width: 100%;
6
- margin: var(--margin);
6
+ margin: var(--block_margin);
7
7
  color: var(--text_color);
8
8
  font-size: var(--font_default_size);
9
9
  }
@@ -1,80 +1,96 @@
1
- const {Icon} = require("../chui_icons/icons");
1
+ const { Icon } = require("../chui_icons/icons");
2
2
 
3
3
  class Button {
4
- #chui_button = document.createElement('chui_button');
5
- #button = document.createElement('button');
6
- #button_text = document.createElement('button_text');
7
- #button_icon = document.createElement('button_icon');
8
- #label_text = undefined;
9
- constructor(options = { reverse: Boolean(), title: String(), icon: undefined, label: String(), disabled: Boolean(), clickEvent: () => {} }) {
10
- require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", "chUiJS_Button")
4
+ #chuiButton = document.createElement("chui_button");
5
+ #button = document.createElement("button");
6
+ #buttonText = document.createElement("button_text");
7
+ #buttonIcon = document.createElement("button_icon");
8
+ #labelText = undefined;
9
+ constructor(
10
+ options = {
11
+ reverse: Boolean(),
12
+ title: String(),
13
+ icon: undefined,
14
+ label: String(),
15
+ disabled: Boolean(),
16
+ clickEvent: () => {},
17
+ }
18
+ ) {
19
+ require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_Button");
11
20
 
12
- this.#button.className = "chui_button"
13
- this.#button_text.className = "chui_button_text"
21
+ this.#button.className = "chui_button";
22
+ this.#buttonText.className = "chui_button_text";
14
23
  // Иконка декоративна: иначе её глиф-имя («print», «delete»…) попадает в имя кнопки
15
- this.#button_icon.setAttribute("aria-hidden", "true");
24
+ this.#buttonIcon.setAttribute("aria-hidden", "true");
16
25
 
17
- if (options.title !== undefined) this.#button_text.innerText = options.title;
18
- if (options.icon !== undefined) this.#button_icon.innerHTML = new Icon(options.icon, "var(--header_icon_size)").getHTML();
26
+ if (options.title !== undefined) this.#buttonText.innerText = options.title;
27
+ if (options.icon !== undefined)
28
+ this.#buttonIcon.innerHTML = new Icon(options.icon, "var(--header_icon_size)").getHTML();
19
29
 
20
30
  if (options.title !== undefined && options.icon === undefined) {
21
- this.#button.appendChild(this.#button_text);
31
+ this.#button.appendChild(this.#buttonText);
22
32
  } else if (options.title === undefined && options.icon !== undefined) {
23
33
  // Квадратный отступ для кнопки только со значком: признак читает CSS
24
34
  this.#button.dataset.icon_only = "true";
25
- this.#button.appendChild(this.#button_icon);
35
+ this.#button.appendChild(this.#buttonIcon);
26
36
  } else {
27
37
  // Порядок детей задаёт `reverse`, а зазор между значком и подписью —
28
38
  // `gap` в CSS: инлайновые отступы здесь больше не нужны
29
39
  if (options.reverse) {
30
- this.#button.appendChild(this.#button_icon);
31
- this.#button.appendChild(this.#button_text);
40
+ this.#button.appendChild(this.#buttonIcon);
41
+ this.#button.appendChild(this.#buttonText);
32
42
  } else {
33
- this.#button.appendChild(this.#button_text);
34
- this.#button.appendChild(this.#button_icon);
43
+ this.#button.appendChild(this.#buttonText);
44
+ this.#button.appendChild(this.#buttonIcon);
35
45
  }
36
46
  }
37
47
 
38
- if (options.clickEvent !== undefined) this.#button.addEventListener('click', options.clickEvent);
39
- this.#button.addEventListener("mousedown", () => {
40
- return false
41
- })
42
- this.#chui_button.appendChild(this.#button)
48
+ if (options.clickEvent !== undefined) this.#button.addEventListener("click", options.clickEvent);
49
+ this.#chuiButton.appendChild(this.#button);
43
50
  // Доступное имя кнопки без надписи: значок декоративен (`aria-hidden`) и имени не даёт,
44
51
  // поэтому кнопка только со значком оставалась бы без имени
45
52
  if (options.label !== undefined) this.setLabel(options.label);
46
53
  // `disabled` в опциях — то же, что setDisabled(true): без этого опция молча терялась
47
54
  if (options.disabled === true) this.setDisabled(true);
48
55
  }
49
- getText() { return this.#button_text.innerText; }
56
+ getText() {
57
+ return this.#buttonText.innerText;
58
+ }
50
59
  /** Новый текст. Пишем в `button_text`, а не в саму кнопку: запись в кнопку целиком
51
60
  * затирала бы и значок, и его разметку (`aria-hidden`), а `getText()` читал бы старый узел */
52
61
  setText(text = String()) {
53
- this.#button_text.innerText = text;
62
+ this.#buttonText.innerText = text;
54
63
  // Пустой узел в разметку не дописываем: кнопке только со значком он ничего не даёт
55
- if (String(text) !== "" && !this.#button.contains(this.#button_text)) this.#button.appendChild(this.#button_text);
64
+ if (String(text) !== "" && !this.#button.contains(this.#buttonText)) this.#button.appendChild(this.#buttonText);
56
65
  this.#syncLabel();
57
66
  return this;
58
67
  }
59
- getLabel() { return this.#label_text; }
68
+ getLabel() {
69
+ return this.#labelText;
70
+ }
60
71
  /** Доступное имя кнопки без видимой надписи; `undefined` его убирает.
61
72
  * Пока надпись есть, имя даёт она сама — `aria-label` тогда не ставится и не подменяет её */
62
73
  setLabel(label = undefined) {
63
- this.#label_text = label;
74
+ this.#labelText = label;
64
75
  this.#syncLabel();
65
76
  return this;
66
77
  }
67
78
  /** Имя кнопки: из видимой надписи, а если её нет — из `label` */
68
79
  #syncLabel() {
69
- const hasText = this.#button.contains(this.#button_text) && this.#button_text.innerText.trim() !== "";
70
- if (hasText || this.#label_text === undefined || this.#label_text === "") this.#button.removeAttribute("aria-label");
71
- else this.#button.setAttribute("aria-label", String(this.#label_text));
80
+ const hasText = this.#button.contains(this.#buttonText) && this.#buttonText.innerText.trim() !== "";
81
+ if (hasText || this.#labelText === undefined || this.#labelText === "")
82
+ this.#button.removeAttribute("aria-label");
83
+ else this.#button.setAttribute("aria-label", String(this.#labelText));
84
+ }
85
+ addClickListener(listener = () => {}) {
86
+ this.#button.addEventListener("click", listener);
72
87
  }
73
- addClickListener(listener = () => {}) { this.#button.addEventListener('click', listener); }
74
88
  setDisabled(boolean = Boolean()) {
75
- this.#button.disabled = boolean
89
+ this.#button.disabled = boolean;
90
+ }
91
+ set() {
92
+ return this.#chuiButton;
76
93
  }
77
- set() { return this.#chui_button; }
78
94
  }
79
95
 
80
- exports.Button = Button
96
+ exports.Button = Button;
@@ -2,19 +2,19 @@ chui_button {
2
2
  cursor: pointer;
3
3
  height: max-content;
4
4
  width: max-content;
5
- border-radius: var(--border_radius);
6
- margin: var(--margin);
5
+ border-radius: var(--radius_sm);
6
+ margin: var(--block_margin);
7
7
  }
8
8
 
9
9
  .chui_button {
10
10
  cursor: pointer;
11
11
  height: max-content;
12
12
  width: max-content;
13
- border-radius: var(--border_radius);
13
+ border-radius: var(--radius_sm);
14
14
  /* Компактный шаг: 5px по вертикали дают 29px (значок 17 + отступы 10 + черта 2) —
15
- как у кнопок шапки (30px). Прежде стояло --main_padding (8px 13px), и кнопка
15
+ как у кнопок шапки (30px). Прежде стояло --block_padding (8px 13px), и кнопка
16
16
  выходила 35px, то есть ростом с поле ввода — самый крупный контроль в вёрстке. */
17
- padding: var(--main_padding_sm);
17
+ padding: var(--block_padding_sm);
18
18
  /* Зазор вместо `margin-left`, который ставил JS: отступ между значком и подписью
19
19
  держит flex-контейнер, поэтому он не зависит от порядка детей (включая `reverse`). */
20
20
  gap: var(--control_padding);
@@ -45,7 +45,7 @@ chui_button {
45
45
  background: var(--blue_prime_background);
46
46
  border-color: var(--button_border_color_hover);
47
47
  /* Лёгкая усадка: нажатие читается даже тогда, когда заливка уже акцентная */
48
- transform: scale(.97);
48
+ transform: scale(0.97);
49
49
  }
50
50
 
51
51
  .chui_button_text {
@@ -97,4 +97,4 @@ chui_button {
97
97
 
98
98
  .chui_button:disabled:hover button_icon chui_icon {
99
99
  color: var(--text_color_disabled);
100
- }
100
+ }
@@ -1,4 +1,4 @@
1
- const {I18n} = require("../../modules/chui_i18n/chui_i18n");
1
+ const { I18n } = require("../../modules/chui_i18n/chui_i18n");
2
2
 
3
3
  class Calendar {
4
4
  constructor(year, month) {
@@ -11,14 +11,16 @@ class Calendar {
11
11
  new Array(7),
12
12
  new Array(7),
13
13
  new Array(7),
14
- new Array(7)
14
+ new Array(7),
15
15
  ];
16
16
 
17
17
  // Названия дней недели берёт локаль текущего языка (воскресенье — 0):
18
18
  // семь подряд идущих дней месяца покрывают все дни недели
19
19
  for (let day = 0; day < 7; day++) {
20
20
  const sample = new Date(this.year, this.month, day + 1);
21
- this.calendar[0][sample.getDay()] = sample.toLocaleString(I18n.getLocale(), { weekday: 'short' }).toUpperCase();
21
+ this.calendar[0][sample.getDay()] = sample
22
+ .toLocaleString(I18n.getLocale(), { weekday: "short" })
23
+ .toUpperCase();
22
24
  }
23
25
 
24
26
  this.list = [];
@@ -35,19 +37,19 @@ class Calendar {
35
37
  second: 'numeric'
36
38
  };*/
37
39
  while (this.date.getMonth() === this.month) {
38
- let dayToPush = this.date;
39
- let days = [];
40
- days.push(dayToPush.toLocaleString(I18n.getLocale(), {day: 'numeric'}));
41
- days.push(dayToPush.toLocaleString(I18n.getLocale(), {weekday: 'short'}).toUpperCase());
42
- days.push(dayToPush.toLocaleString(I18n.getLocale(), {month: 'long'}).toUpperCase());
40
+ const dayToPush = this.date;
41
+ const days = [];
42
+ days.push(dayToPush.toLocaleString(I18n.getLocale(), { day: "numeric" }));
43
+ days.push(dayToPush.toLocaleString(I18n.getLocale(), { weekday: "short" }).toUpperCase());
44
+ days.push(dayToPush.toLocaleString(I18n.getLocale(), { month: "long" }).toUpperCase());
43
45
  this.date.setDate(this.date.getDate() + 1);
44
- this.list.push(days)
46
+ this.list.push(days);
45
47
  }
46
48
  let index = 1;
47
- for (let day of this.list) {
48
- for (let name_day of this.calendar[0]) {
49
- let indexz = this.calendar[0].indexOf(name_day);
50
- if (day[1].includes(name_day)) {
49
+ for (const day of this.list) {
50
+ for (const nameDay of this.calendar[0]) {
51
+ const indexz = this.calendar[0].indexOf(nameDay);
52
+ if (day[1].includes(nameDay)) {
51
53
  this.calendar[index][indexz] = day[0];
52
54
  if (indexz === 6) {
53
55
  index++;
@@ -60,10 +62,10 @@ class Calendar {
60
62
  return new Date();
61
63
  }
62
64
  getMonthName() {
63
- return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), {month: 'long'}).toUpperCase();
65
+ return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), { month: "long" }).toUpperCase();
64
66
  }
65
67
  getDayName() {
66
- return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), { weekday: 'long' }).toUpperCase();
68
+ return new Date(this.year, this.month).toLocaleString(I18n.getLocale(), { weekday: "long" }).toUpperCase();
67
69
  }
68
70
  getDate() {
69
71
  return new Date(this.year, this.month).getDate();
@@ -79,4 +81,4 @@ class Calendar {
79
81
  }
80
82
  }
81
83
 
82
- exports.Calendar = Calendar
84
+ exports.Calendar = Calendar;
@@ -1,50 +1,66 @@
1
- const {Icon} = require("../chui_icons/icons");
2
- const {optionOr} = require("../../modules/chui_functions");
1
+ const { Icon } = require("../chui_icons/icons");
2
+ const { optionOr } = require("../../modules/chui_functions");
3
3
 
4
4
  class Card {
5
- #chui_card = document.createElement("chui_card");
5
+ #chuiCard = document.createElement("chui_card");
6
6
  #head;
7
7
  #icon;
8
8
  #titles;
9
9
  #title;
10
10
  #description;
11
11
  #body = document.createElement("card_body");
12
- constructor(options = {
13
- id: String(),
14
- title: String(),
15
- description: String(),
16
- icon: String(),
17
- width: String(),
18
- height: String(),
19
- style: String(),
20
- components: []
21
- }) {
22
- require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", 'chUiJS_Card');
23
- if (options.id !== undefined) this.#chui_card.id = options.id;
12
+ constructor(
13
+ options = {
14
+ id: String(),
15
+ title: String(),
16
+ description: String(),
17
+ icon: String(),
18
+ width: String(),
19
+ height: String(),
20
+ style: String(),
21
+ components: [],
22
+ }
23
+ ) {
24
+ require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_Card");
25
+ if (options.id !== undefined) this.#chuiCard.id = options.id;
24
26
  const style = optionOr(options.style, undefined);
25
- if (style !== undefined) this.#chui_card.classList.add(style);
26
- if (options.width !== undefined) this.#chui_card.style.width = options.width;
27
- if (options.height !== undefined) this.#chui_card.style.height = options.height;
28
- this.#chui_card.appendChild(this.#body);
27
+ if (style !== undefined) this.#chuiCard.classList.add(style);
28
+ if (options.width !== undefined) this.#chuiCard.style.width = options.width;
29
+ if (options.height !== undefined) this.#chuiCard.style.height = options.height;
30
+ this.#chuiCard.appendChild(this.#body);
29
31
  if (options.icon !== undefined) this.setIcon(options.icon);
30
32
  if (options.title !== undefined) this.setTitle(options.title);
31
33
  if (options.description !== undefined) this.setDescription(options.description);
32
34
  if (options.components !== undefined) this.add(...options.components);
33
35
  }
34
36
  // GET
35
- getId() { return this.#chui_card.id; }
36
- getTitle() { return this.#title === undefined ? "" : this.#title.innerText; }
37
- getDescription() { return this.#description === undefined ? "" : this.#description.innerText; }
38
- getBody() { return this.#body; }
37
+ getId() {
38
+ return this.#chuiCard.id;
39
+ }
40
+ getTitle() {
41
+ return this.#title === undefined ? "" : this.#title.innerText;
42
+ }
43
+ getDescription() {
44
+ return this.#description === undefined ? "" : this.#description.innerText;
45
+ }
46
+ getBody() {
47
+ return this.#body;
48
+ }
39
49
  // SET
40
- setId(id = String()) { this.#chui_card.id = id; }
50
+ setId(id = String()) {
51
+ this.#chuiCard.id = id;
52
+ }
41
53
  // Пустая строка — «не задана»: `classList.add("")` бросает исключение
42
54
  setStyle(style = String()) {
43
55
  const known = optionOr(style, undefined);
44
- if (known !== undefined) this.#chui_card.classList.add(known);
56
+ if (known !== undefined) this.#chuiCard.classList.add(known);
57
+ }
58
+ setWidth(width = String()) {
59
+ this.#chuiCard.style.width = width;
60
+ }
61
+ setHeight(height = String()) {
62
+ this.#chuiCard.style.height = height;
45
63
  }
46
- setWidth(width = String()) { this.#chui_card.style.width = width; }
47
- setHeight(height = String()) { this.#chui_card.style.height = height; }
48
64
  setIcon(icon = String()) {
49
65
  if (this.#icon === undefined) {
50
66
  this.#icon = document.createElement("card_icon");
@@ -68,14 +84,16 @@ class Card {
68
84
  }
69
85
  // FUNCTIONS
70
86
  add(...components) {
71
- for (let component of components) this.#body.appendChild(component.set());
87
+ for (const component of components) this.#body.appendChild(component.set());
88
+ }
89
+ clear() {
90
+ this.#body.innerHTML = "";
72
91
  }
73
- clear() { this.#body.innerHTML = ""; }
74
92
  // Шапка создаётся при первом обращении и всегда стоит выше тела
75
93
  #headNode() {
76
94
  if (this.#head === undefined) {
77
95
  this.#head = document.createElement("card_head");
78
- this.#chui_card.prepend(this.#head);
96
+ this.#chuiCard.prepend(this.#head);
79
97
  }
80
98
  return this.#head;
81
99
  }
@@ -87,7 +105,9 @@ class Card {
87
105
  return this.#titles;
88
106
  }
89
107
  // RENDER
90
- set() { return this.#chui_card; }
108
+ set() {
109
+ return this.#chuiCard;
110
+ }
91
111
  }
92
112
 
93
- exports.Card = Card
113
+ exports.Card = Card;