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
@@ -1,5 +1,5 @@
1
- const {setStyles} = require('../../../modules/chui_functions');
2
- const {I18n} = require('../../../modules/chui_i18n/chui_i18n');
1
+ const { setStyles } = require("../../../modules/chui_functions");
2
+ const { I18n } = require("../../../modules/chui_i18n/chui_i18n");
3
3
 
4
4
  /**
5
5
  * Ползунок: одно значение или диапазон (`range: true`).
@@ -28,14 +28,14 @@ class Slider {
28
28
  #root = document.createElement("chui_slider");
29
29
  #header = document.createElement("slider_header");
30
30
  #title = document.createElement("slider_title");
31
- #value_text = document.createElement("slider_value");
31
+ #valueLabel = document.createElement("slider_value");
32
32
  #field = document.createElement("slider_field");
33
33
  #track = document.createElement("slider_track");
34
34
  #fill = document.createElement("slider_fill");
35
35
  #thumbs = [];
36
36
  #id = undefined;
37
37
  #name = undefined;
38
- #title_text = undefined;
38
+ #titleText = undefined;
39
39
  #label = undefined;
40
40
  #min = 0;
41
41
  #max = 100;
@@ -44,27 +44,29 @@ class Slider {
44
44
  #values = [0];
45
45
  #disabled = false;
46
46
  #format = undefined;
47
- #change_listeners = [];
48
- #input_listeners = [];
47
+ #changeListeners = [];
48
+ #inputListeners = [];
49
49
  #dragging = undefined;
50
50
 
51
- constructor(options = {
52
- id: String(),
53
- name: String(),
54
- title: String(),
55
- label: String(),
56
- min: Number(),
57
- max: Number(),
58
- step: Number(),
59
- value: undefined,
60
- range: Boolean(),
61
- disabled: Boolean(),
62
- width: String(),
63
- showValue: Boolean(),
64
- format: undefined,
65
- changeListener: undefined,
66
- inputListener: undefined
67
- }) {
51
+ constructor(
52
+ options = {
53
+ id: String(),
54
+ name: String(),
55
+ title: String(),
56
+ label: String(),
57
+ min: Number(),
58
+ max: Number(),
59
+ step: Number(),
60
+ value: undefined,
61
+ range: Boolean(),
62
+ disabled: Boolean(),
63
+ width: String(),
64
+ showValue: Boolean(),
65
+ format: undefined,
66
+ changeListener: undefined,
67
+ inputListener: undefined,
68
+ }
69
+ ) {
68
70
  setStyles(__dirname + "/styles.css", "chUiJS_Slider");
69
71
  Slider.#counter += 1;
70
72
  this.#id = options.id === undefined ? `chui_slider_${Slider.#counter}` : options.id;
@@ -86,16 +88,14 @@ class Slider {
86
88
  }
87
89
  this.#track.addEventListener("pointerdown", this.#onTrackPointerDown);
88
90
  this.#header.appendChild(this.#title);
89
- this.#header.appendChild(this.#value_text);
91
+ this.#header.appendChild(this.#valueLabel);
90
92
  this.#root.appendChild(this.#header);
91
93
  this.#root.appendChild(this.#field);
92
94
 
93
95
  if (options.title !== undefined) this.setTitle(options.title);
94
96
  else this.#header.hidden = true;
95
- if (options.showValue === false) this.#value_text.hidden = true;
96
- this.setValue(options.value === undefined
97
- ? (this.#range ? [this.#min, this.#max] : this.#min)
98
- : options.value);
97
+ if (options.showValue === false) this.#valueLabel.hidden = true;
98
+ this.setValue(options.value === undefined ? (this.#range ? [this.#min, this.#max] : this.#min) : options.value);
99
99
  if (options.disabled === true) this.setDisabled(true);
100
100
  if (options.width !== undefined) this.setWidth(options.width);
101
101
  if (options.changeListener !== undefined) this.addChangeListener(options.changeListener);
@@ -153,7 +153,7 @@ class Slider {
153
153
  }
154
154
 
155
155
  setTitle(text = String()) {
156
- this.#title_text = text;
156
+ this.#titleText = text;
157
157
  this.#title.innerText = text;
158
158
  this.#header.hidden = false;
159
159
  this.#render();
@@ -189,7 +189,7 @@ class Slider {
189
189
 
190
190
  /** Показывать ли читаемое значение рядом с заголовком */
191
191
  setShowValue(show = Boolean()) {
192
- this.#value_text.hidden = show === false;
192
+ this.#valueLabel.hidden = show === false;
193
193
  return this;
194
194
  }
195
195
 
@@ -223,13 +223,13 @@ class Slider {
223
223
  // ПОДПИСКИ
224
224
  /** Вызов на отпускание бегунка, клик по дорожке и ход с клавиатуры */
225
225
  addChangeListener(listener = () => {}) {
226
- this.#change_listeners.push(listener);
226
+ this.#changeListeners.push(listener);
227
227
  return this;
228
228
  }
229
229
 
230
230
  /** Вызов на каждое изменение во время перетаскивания */
231
231
  addInputListener(listener = () => {}) {
232
- this.#input_listeners.push(listener);
232
+ this.#inputListeners.push(listener);
233
233
  return this;
234
234
  }
235
235
 
@@ -279,9 +279,12 @@ class Slider {
279
279
  }
280
280
 
281
281
  #thumbLabel(index = Number()) {
282
- const base = this.#label === undefined
283
- ? (this.#title_text === undefined ? I18n.t("forms.sliderValue") : this.#title_text)
284
- : this.#label;
282
+ const base =
283
+ this.#label === undefined
284
+ ? this.#titleText === undefined
285
+ ? I18n.t("forms.sliderValue")
286
+ : this.#titleText
287
+ : this.#label;
285
288
  if (!this.#range) return base;
286
289
  return `${base}: ${index === 0 ? I18n.t("forms.sliderMin") : I18n.t("forms.sliderMax")}`;
287
290
  }
@@ -306,7 +309,7 @@ class Slider {
306
309
  if (this.#disabled) thumb.setAttribute("aria-disabled", "true");
307
310
  else thumb.removeAttribute("aria-disabled");
308
311
  });
309
- this.#value_text.innerText = this.#range
312
+ this.#valueLabel.innerText = this.#range
310
313
  ? `${this.#valueText(low)} – ${this.#valueText(high)}`
311
314
  : this.#valueText(low);
312
315
  }
@@ -324,7 +327,7 @@ class Slider {
324
327
  }
325
328
 
326
329
  #emit(type = String()) {
327
- const listeners = type === "input" ? this.#input_listeners : this.#change_listeners;
330
+ const listeners = type === "input" ? this.#inputListeners : this.#changeListeners;
328
331
  const value = this.getValue();
329
332
  for (const listener of [...listeners]) listener(value);
330
333
  }
@@ -422,4 +425,4 @@ class Slider {
422
425
  };
423
426
  }
424
427
 
425
- exports.Slider = Slider
428
+ exports.Slider = Slider;
@@ -4,12 +4,12 @@ chui_slider {
4
4
  карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
5
5
  (тот же приём у полосы меню-бара). */
6
6
  --control_padding: var(--control_padding_sm);
7
- --main_padding: var(--main_padding_sm);
7
+ --block_padding: var(--block_padding_sm);
8
8
  display: block;
9
9
  /* fill-available учитывает собственный margin, 100% — нет: слайдер уезжал
10
10
  вправо и вылезал за родителя на 6px */
11
11
  width: -webkit-fill-available;
12
- margin: var(--margin);
12
+ margin: var(--block_margin);
13
13
  font-size: var(--font_default_size);
14
14
  color: var(--text_color);
15
15
  }
@@ -76,15 +76,17 @@ slider_thumb {
76
76
  /* Кружок целиком — 20px: рамка 2px прибавляется к 16px, а не входит в них, поэтому
77
77
  половина равна 10px. С прежними -8px бегунок стоял на 2px ниже дорожки
78
78
  и на 2px правее своего значения */
79
- margin-block: -10px 0; margin-inline: -10px 0;
79
+ margin-block: -10px 0;
80
+ margin-inline: -10px 0;
80
81
  border-radius: var(--radius_circle);
81
82
  background: var(--blue_prime_background);
82
83
  border: 2px solid var(--main_background);
83
- box-shadow: 0 1px 3px rgb(0 0 0 / 16%);
84
+ box-shadow: var(--box_shadow_control);
84
85
  cursor: pointer;
85
86
  outline: none;
86
87
  touch-action: none;
87
- transition: transform var(--transition_time);
88
+ /* Ползунок растёт на наведении и захвате: отклик с лёгким перелётом, а не линейный рост */
89
+ transition: transform var(--motion_base) var(--motion_spring);
88
90
  }
89
91
 
90
92
  slider_thumb:hover,
@@ -4,12 +4,12 @@ chui_text_input {
4
4
  карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
5
5
  (тот же приём у полосы меню-бара). */
6
6
  --control_padding: var(--control_padding_sm);
7
- --main_padding: var(--main_padding_sm);
7
+ --block_padding: var(--block_padding_sm);
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  width: var(--control_width);
11
11
  height: max-content;
12
- margin: var(--margin)
12
+ margin: var(--block_margin);
13
13
  }
14
14
 
15
15
  chui_text_main {
@@ -17,12 +17,12 @@ chui_text_main {
17
17
  width: -webkit-fill-available;
18
18
  height: max-content;
19
19
  margin: 0;
20
- border-radius: var(--border_radius);
20
+ border-radius: var(--radius_sm);
21
21
  background: var(--element_background);
22
22
  color: var(--text_color);
23
23
  align-items: center;
24
24
  position: relative;
25
- padding: var(--main_padding);
25
+ padding: var(--block_padding);
26
26
  border: 1px solid var(--border_color);
27
27
  }
28
28
 
@@ -40,20 +40,20 @@ chui_text_main {
40
40
  .input_label {
41
41
  height: max-content;
42
42
  width: max-content;
43
- margin: 0 0 var(--margin);
43
+ margin: 0 0 var(--block_margin);
44
44
  font-size: var(--font_labels_size);
45
- font-weight:500;
46
- color: var(--text_color)
45
+ font-weight: 500;
46
+ color: var(--text_color);
47
47
  }
48
48
 
49
49
  error_message_text {
50
50
  display: none;
51
51
  height: max-content;
52
52
  width: max-content;
53
- margin: var(--margin) var(--margin) 0 var(--margin);
53
+ margin: var(--block_margin) var(--block_margin) 0 var(--block_margin);
54
54
  font-size: var(--font_labels_size);
55
- font-weight:500;
56
- color: var(--red_prime_background)
55
+ font-weight: 500;
56
+ color: var(--red_prime_background);
57
57
  }
58
58
 
59
59
  .error_border {
@@ -83,8 +83,8 @@ error_message_text {
83
83
  cursor: not-allowed;
84
84
  height: max-content;
85
85
  width: max-content;
86
- margin: 0 0 var(--margin);
86
+ margin: 0 0 var(--block_margin);
87
87
  font-size: var(--font_labels_size);
88
- font-weight:500;
89
- color: var(--text_color_disabled)
90
- }
88
+ font-weight: 500;
89
+ color: var(--text_color_disabled);
90
+ }
@@ -1,90 +1,107 @@
1
1
  //version: 1.0.0
2
- const {Animation} = require('../../../modules/chui_animations/animations');
2
+ const { Animation } = require("../../../modules/chui_animations/animations");
3
3
 
4
- const {Validate} = require('../../../modules/chui_validate/chui_validate');
4
+ const { Validate } = require("../../../modules/chui_validate/chui_validate");
5
5
 
6
6
  class TextInput {
7
- #chui_text_main = document.createElement('chui_text_main');
8
- #chui_text_input = document.createElement('chui_text_input');
7
+ #chuiTextMain = document.createElement("chui_text_main");
8
+ #chuiTextInput = document.createElement("chui_text_input");
9
9
  #id = require("randomstring").generate();
10
10
  #title = String();
11
- #input = document.createElement('input');
12
- #label = document.createElement('label');
13
- #error_message_text = document.createElement("error_message_text");
14
- constructor(options = {
15
- name: String(),
16
- title: String(),
17
- placeholder: String(),
18
- width: String(),
19
- required: Boolean(),
20
- value: String(),
21
- disableFocus: Boolean(),
22
- inputListener: () => {},
23
- focusListener: () => {},
24
- blurListener: () => {}
25
- }) {
26
- require('../../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_TextInput');
27
- this.#input.type = 'text';
28
- this.#input.className = 'text_input';
11
+ #input = document.createElement("input");
12
+ #label = document.createElement("label");
13
+ #errorMessageText = document.createElement("error_message_text");
14
+ constructor(
15
+ options = {
16
+ name: String(),
17
+ title: String(),
18
+ placeholder: String(),
19
+ width: String(),
20
+ required: Boolean(),
21
+ value: String(),
22
+ disableFocus: Boolean(),
23
+ inputListener: () => {},
24
+ focusListener: () => {},
25
+ blurListener: () => {},
26
+ }
27
+ ) {
28
+ require("../../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_TextInput");
29
+ this.#input.type = "text";
30
+ this.#input.className = "text_input";
29
31
  this.#input.id = this.#id;
30
32
 
31
33
  //Options
32
- if (options.inputListener !== undefined) this.#input.addEventListener('input', options.inputListener);
33
- if (options.focusListener !== undefined) this.#input.addEventListener('focus', options.focusListener);
34
- if (options.blurListener !== undefined) this.#input.addEventListener('blur', options.blurListener);
34
+ if (options.inputListener !== undefined) this.#input.addEventListener("input", options.inputListener);
35
+ if (options.focusListener !== undefined) this.#input.addEventListener("focus", options.focusListener);
36
+ if (options.blurListener !== undefined) this.#input.addEventListener("blur", options.blurListener);
35
37
  if (options.name !== undefined) this.#input.name = options.name;
36
38
  if (options.value !== undefined) this.#input.value = options.value;
37
39
  if (options.required !== undefined) this.#input.required = options.required;
38
40
  // Валидация и показ ошибки: правила из options (required/min/max/pattern/…)
39
- Validate.installField(this, options, this.#chui_text_main, this.#error_message_text, () => this.#input.value);
40
- if (options.disableFocus !== undefined) this.#input.addEventListener("mousedown", () => { return false });
41
+ Validate.installField(this, options, this.#chuiTextMain, this.#errorMessageText, () => this.#input.value);
41
42
  if (options.title !== undefined) {
42
43
  this.#title = options.title;
43
44
  this.#label.innerText = options.title;
44
- this.#label.className = 'input_label';
45
- this.#label.setAttribute('for', this.#id);
46
- this.#chui_text_input.appendChild(this.#label);
45
+ this.#label.className = "input_label";
46
+ this.#label.setAttribute("for", this.#id);
47
+ this.#chuiTextInput.appendChild(this.#label);
47
48
  }
48
- if (options.width !== undefined) this.#chui_text_input.style.width = options.width;
49
+ if (options.width !== undefined) this.#chuiTextInput.style.width = options.width;
49
50
  if (options.placeholder !== undefined) this.#input.placeholder = options.placeholder;
50
51
  // Опция `disableFocus`: поле не подсвечивается фокусом. Класс читает тема
51
52
  // (`field_no_focus` рядом с общим правилом полей), а не сам компонент
52
- if (options.disableFocus) this.#chui_text_main.classList.add("field_no_focus");
53
+ if (options.disableFocus) this.#chuiTextMain.classList.add("field_no_focus");
53
54
  // Рамку с кольцом при фокусе и подсказку при наведении рисует общее правило темы
54
55
  // (`chui_text_main:hover`, `:focus-within` в global_style.css), а не компонент:
55
56
  // прежде он ставил то же самое инлайном, а на `blur` снимал весь атрибут `style`
56
- this.#chui_text_main.appendChild(this.#input);
57
- this.#chui_text_input.appendChild(this.#chui_text_main);
57
+ this.#chuiTextMain.appendChild(this.#input);
58
+ this.#chuiTextInput.appendChild(this.#chuiTextMain);
58
59
 
59
60
  //
60
61
  this.#input.addEventListener("input", () => {
61
62
  this.clearError();
62
- new Animation(this.#error_message_text).fadeOut();
63
- })
63
+ new Animation(this.#errorMessageText).fadeOut();
64
+ });
65
+ }
66
+ addInputListener(listener = () => {}) {
67
+ this.#input.addEventListener("input", listener);
68
+ }
69
+ addFocusListener(listener = () => {}) {
70
+ this.#input.addEventListener("focus", listener);
71
+ }
72
+ addBlurListener(listener = () => {}) {
73
+ this.#input.addEventListener("blur", listener);
74
+ }
75
+ getName() {
76
+ return this.#input.name;
77
+ }
78
+ getTitle() {
79
+ return this.#title;
80
+ }
81
+ getValue() {
82
+ return this.#input.value;
83
+ }
84
+ setValue(text = String()) {
85
+ this.#input.value = text;
64
86
  }
65
- addInputListener(listener = () => {}) { this.#input.addEventListener('input', listener); }
66
- addFocusListener(listener = () => {}) { this.#input.addEventListener('focus', listener); }
67
- addBlurListener(listener = () => {}) { this.#input.addEventListener('blur', listener); }
68
- getName() { return this.#input.name; }
69
- getTitle() { return this.#title; }
70
- getValue() { return this.#input.value; }
71
- setValue(text = String()) { this.#input.value = text; }
72
87
  setDisabled(boolean = Boolean()) {
73
- this.#input.disabled = boolean
88
+ this.#input.disabled = boolean;
74
89
  if (boolean) {
75
- this.#chui_text_main.classList.add("chui_text_main_disabled")
76
- this.#input.className = "text_input_disabled"
77
- this.#label.className = "input_label_disabled"
90
+ this.#chuiTextMain.classList.add("chui_text_main_disabled");
91
+ this.#input.className = "text_input_disabled";
92
+ this.#label.className = "input_label_disabled";
78
93
  } else {
79
- this.#chui_text_main.classList.remove("chui_text_main_disabled")
80
- this.#input.className = "text_input"
81
- this.#label.className = "input_label"
94
+ this.#chuiTextMain.classList.remove("chui_text_main_disabled");
95
+ this.#input.className = "text_input";
96
+ this.#label.className = "input_label";
82
97
  }
83
98
  }
84
99
  setErrorMessage(message = String()) {
85
100
  this.setError(message);
86
101
  }
87
- set() { return this.#chui_text_input; }
102
+ set() {
103
+ return this.#chuiTextInput;
104
+ }
88
105
  }
89
106
 
90
- exports.TextInput = TextInput
107
+ exports.TextInput = TextInput;
@@ -4,23 +4,23 @@ chui_area_input {
4
4
  карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
5
5
  (тот же приём у полосы меню-бара). */
6
6
  --control_padding: var(--control_padding_sm);
7
- --main_padding: var(--main_padding_sm);
7
+ --block_padding: var(--block_padding_sm);
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  width: var(--control_width);
11
11
  height: max-content;
12
- margin: var(--margin);
12
+ margin: var(--block_margin);
13
13
  }
14
14
 
15
15
  .resize_off {
16
- resize: none
16
+ resize: none;
17
17
  }
18
18
 
19
19
  .area_input {
20
20
  height: inherit;
21
21
  width: -webkit-fill-available;
22
- border-radius: var(--border_radius);
23
- padding: var(--main_padding);
22
+ border-radius: var(--radius_sm);
23
+ padding: var(--block_padding);
24
24
  font-size: var(--font_default_size);
25
25
  color: var(--text_color);
26
26
  background: var(--element_background);
@@ -30,10 +30,10 @@ chui_area_input {
30
30
  .textarea_label {
31
31
  height: max-content;
32
32
  width: max-content;
33
- margin: 0 0 var(--margin);
33
+ margin: 0 0 var(--block_margin);
34
34
  font-size: var(--font_labels_size);
35
- font-weight:500;
36
- color: var(--text_color)
35
+ font-weight: 500;
36
+ color: var(--text_color);
37
37
  }
38
38
 
39
39
  /* DISABLED STYLES */
@@ -41,8 +41,8 @@ chui_area_input {
41
41
  cursor: not-allowed;
42
42
  height: inherit;
43
43
  width: -webkit-fill-available;
44
- border-radius: var(--border_radius);
45
- padding: var(--main_padding);
44
+ border-radius: var(--radius_sm);
45
+ padding: var(--block_padding);
46
46
  font-size: var(--font_default_size);
47
47
  color: var(--text_color_disabled);
48
48
  background: var(--element_background_disabled);
@@ -53,8 +53,8 @@ chui_area_input {
53
53
  cursor: not-allowed;
54
54
  height: max-content;
55
55
  width: max-content;
56
- margin: 0 0 var(--margin);
56
+ margin: 0 0 var(--block_margin);
57
57
  font-size: var(--font_labels_size);
58
- font-weight:500;
59
- color: var(--text_color_disabled)
60
- }
58
+ font-weight: 500;
59
+ color: var(--text_color_disabled);
60
+ }
@@ -1,58 +1,81 @@
1
- const {Validate} = require('../../../modules/chui_validate/chui_validate');
1
+ const { Validate } = require("../../../modules/chui_validate/chui_validate");
2
2
 
3
3
  class TextArea {
4
4
  #id = require("randomstring").generate();
5
- #chui_text_input = document.createElement('chui_area_input');
6
- #text_area = document.createElement('textarea');
7
- #label = document.createElement('label');
5
+ #chuiTextInput = document.createElement("chui_area_input");
6
+ #textArea = document.createElement("textarea");
7
+ #label = document.createElement("label");
8
8
  #title = undefined;
9
- constructor(options = {
10
- name: String(), title: String(), placeholder: String(),
11
- width: String(), height: String(), required: Boolean()
12
- }) {
13
- require('../../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_TextArea');
14
- this.#text_area.classList.add('area_input', 'resize_off');
15
- this.#text_area.id = this.#id;
16
- if (options.name !== undefined) this.#text_area.name = options.name;
17
- if (options.required !== undefined) this.#text_area.required = options.required;
9
+ constructor(
10
+ options = {
11
+ name: String(),
12
+ title: String(),
13
+ placeholder: String(),
14
+ width: String(),
15
+ height: String(),
16
+ required: Boolean(),
17
+ }
18
+ ) {
19
+ require("../../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_TextArea");
20
+ this.#textArea.classList.add("area_input", "resize_off");
21
+ this.#textArea.id = this.#id;
22
+ if (options.name !== undefined) this.#textArea.name = options.name;
23
+ if (options.required !== undefined) this.#textArea.required = options.required;
18
24
  // Валидация и показ ошибки: правила из options. Текст ошибки — в корень поля
19
25
  // (под областью ввода), а рамку получает само поле: иначе узел с текстом попал бы
20
26
  // внутрь `<textarea>` и читался бы как его содержимое
21
- Validate.installField(this, options, this.#chui_text_input, undefined, () => this.#text_area.value, this.#text_area);
27
+ Validate.installField(
28
+ this,
29
+ options,
30
+ this.#chuiTextInput,
31
+ undefined,
32
+ () => this.#textArea.value,
33
+ this.#textArea
34
+ );
22
35
  if (options.title !== undefined) {
23
36
  this.#title = options.title;
24
37
  this.#label.innerText = options.title;
25
- this.#label.classList.add('textarea_label')
26
- this.#label.setAttribute('for', this.#id);
27
- this.#chui_text_input.appendChild(this.#label);
38
+ this.#label.classList.add("textarea_label");
39
+ this.#label.setAttribute("for", this.#id);
40
+ this.#chuiTextInput.appendChild(this.#label);
28
41
  }
29
- if (options.placeholder !== undefined) this.#text_area.placeholder = options.placeholder;
30
- if (options.width !== undefined) this.#chui_text_input.style.width = options.width;
31
- if (options.height !== undefined) this.#chui_text_input.style.height = options.height;
42
+ if (options.placeholder !== undefined) this.#textArea.placeholder = options.placeholder;
43
+ if (options.width !== undefined) this.#chuiTextInput.style.width = options.width;
44
+ if (options.height !== undefined) this.#chuiTextInput.style.height = options.height;
32
45
  // Рамку с кольцом при фокусе рисует общее правило темы (`.area_input:hover`,
33
46
  // `:focus-within`), а не компонент: прежде он ставил то же самое инлайном,
34
47
  // а на `blur` снимал весь атрибут `style`
35
- this.#chui_text_input.appendChild(this.#text_area);
48
+ this.#chuiTextInput.appendChild(this.#textArea);
49
+ }
50
+ getName() {
51
+ return this.#textArea.name;
52
+ }
53
+ getTitle() {
54
+ return this.#title;
55
+ }
56
+ getValue() {
57
+ return this.#textArea.value;
58
+ }
59
+ setValue(text = String()) {
60
+ this.#textArea.value = text;
36
61
  }
37
- getName() { return this.#text_area.name; }
38
- getTitle() { return this.#title; }
39
- getValue() { return this.#text_area.value; }
40
- setValue(text = String()) { this.#text_area.value = text; }
41
62
  setDisabled(boolean = Boolean()) {
42
- this.#text_area.disabled = boolean
63
+ this.#textArea.disabled = boolean;
43
64
  if (boolean) {
44
- this.#text_area.classList.remove("area_input")
45
- this.#text_area.classList.add("area_input_disabled")
46
- this.#label.classList.remove("textarea_label")
47
- this.#label.classList.add("textarea_label_disabled")
65
+ this.#textArea.classList.remove("area_input");
66
+ this.#textArea.classList.add("area_input_disabled");
67
+ this.#label.classList.remove("textarea_label");
68
+ this.#label.classList.add("textarea_label_disabled");
48
69
  } else {
49
- this.#text_area.classList.add("area_input")
50
- this.#text_area.classList.remove("area_input_disabled")
51
- this.#label.classList.add("textarea_label")
52
- this.#label.classList.remove("textarea_label_disabled")
70
+ this.#textArea.classList.add("area_input");
71
+ this.#textArea.classList.remove("area_input_disabled");
72
+ this.#label.classList.add("textarea_label");
73
+ this.#label.classList.remove("textarea_label_disabled");
53
74
  }
54
75
  }
55
- set() { return this.#chui_text_input; }
76
+ set() {
77
+ return this.#chuiTextInput;
78
+ }
56
79
  }
57
80
 
58
- exports.TextArea = TextArea
81
+ exports.TextArea = TextArea;