chuijs 3.6.2 → 3.6.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 (119) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1203 -162
  3. package/framework/appLayout/default/chui_app_layout.js +747 -747
  4. package/framework/appLayout/default/global_style.css +592 -568
  5. package/framework/appLayout/default/main_theme_style.css +118 -101
  6. package/framework/components/chui_accordion/accordion.js +63 -63
  7. package/framework/components/chui_accordion/styles.css +79 -75
  8. package/framework/components/chui_badge/badge.js +55 -55
  9. package/framework/components/chui_badge/styles.css +29 -29
  10. package/framework/components/chui_button/button.js +48 -48
  11. package/framework/components/chui_button/styles.css +75 -70
  12. package/framework/components/chui_calendar/calendar.js +97 -97
  13. package/framework/components/chui_card/card.js +87 -0
  14. package/framework/components/chui_card/styles.css +72 -0
  15. package/framework/components/chui_code/code.js +18 -18
  16. package/framework/components/chui_code/styles.css +9 -9
  17. package/framework/components/chui_console/console.js +27 -27
  18. package/framework/components/chui_console/styles.css +31 -31
  19. package/framework/components/chui_content_block/content_block.js +51 -51
  20. package/framework/components/chui_content_block/styles.css +2 -2
  21. package/framework/components/chui_context_menu/context_menu.js +230 -0
  22. package/framework/components/chui_context_menu/styles.css +136 -0
  23. package/framework/components/chui_custom_element/custom_element.js +24 -24
  24. package/framework/components/chui_details/details.js +85 -85
  25. package/framework/components/chui_details/styles.css +70 -66
  26. package/framework/components/chui_fieldset/fieldset.js +40 -40
  27. package/framework/components/chui_fieldset/styles.css +24 -24
  28. package/framework/components/chui_form/form.js +40 -40
  29. package/framework/components/chui_form/styles.css +21 -21
  30. package/framework/components/chui_graphs/graphs.js +234 -190
  31. package/framework/components/chui_graphs/styles.css +37 -32
  32. package/framework/components/chui_hero/hero.js +98 -0
  33. package/framework/components/chui_hero/styles.css +91 -0
  34. package/framework/components/chui_html_block/html_block.js +16 -16
  35. package/framework/components/chui_html_block/styles.css +5 -5
  36. package/framework/components/chui_hx/hx.js +15 -15
  37. package/framework/components/chui_hx/styles.css +38 -38
  38. package/framework/components/chui_icons/icons.js +2144 -2144
  39. package/framework/components/chui_icons/styles.css +13 -13
  40. package/framework/components/chui_inputs/chui_check_box/check_box.js +32 -32
  41. package/framework/components/chui_inputs/chui_check_box/styles.css +91 -86
  42. package/framework/components/chui_inputs/chui_combo_box/combo_box.js +166 -150
  43. package/framework/components/chui_inputs/chui_combo_box/styles.css +113 -107
  44. package/framework/components/chui_inputs/chui_date/date.js +177 -174
  45. package/framework/components/chui_inputs/chui_date/styles.css +163 -128
  46. package/framework/components/chui_inputs/chui_email/email.js +61 -61
  47. package/framework/components/chui_inputs/chui_email/styles.css +69 -71
  48. package/framework/components/chui_inputs/chui_file/file.js +76 -76
  49. package/framework/components/chui_inputs/chui_file/styles.css +99 -99
  50. package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +295 -295
  51. package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +212 -235
  52. package/framework/components/chui_inputs/chui_number/number.js +108 -108
  53. package/framework/components/chui_inputs/chui_number/styles.css +84 -84
  54. package/framework/components/chui_inputs/chui_password/password.js +99 -99
  55. package/framework/components/chui_inputs/chui_password/styles.css +97 -97
  56. package/framework/components/chui_inputs/chui_radio_button/radio_button.js +45 -45
  57. package/framework/components/chui_inputs/chui_radio_button/styles.css +76 -73
  58. package/framework/components/chui_inputs/chui_select_box/select_box.js +187 -170
  59. package/framework/components/chui_inputs/chui_select_box/styles.css +123 -117
  60. package/framework/components/chui_inputs/chui_text/styles.css +83 -84
  61. package/framework/components/chui_inputs/chui_text/text.js +91 -91
  62. package/framework/components/chui_inputs/chui_text_area/styles.css +57 -57
  63. package/framework/components/chui_inputs/chui_text_area/text_area.js +61 -61
  64. package/framework/components/chui_inputs/chui_toggle/styles.css +66 -61
  65. package/framework/components/chui_inputs/chui_toggle/toggle.js +36 -36
  66. package/framework/components/chui_label/label.js +54 -54
  67. package/framework/components/chui_label/styles.css +11 -11
  68. package/framework/components/chui_media/audio.js +908 -908
  69. package/framework/components/chui_media/audio_styles.css +458 -458
  70. package/framework/components/chui_media/image.js +105 -105
  71. package/framework/components/chui_media/image_styles.css +61 -61
  72. package/framework/components/chui_media/video.js +248 -248
  73. package/framework/components/chui_media/video_styles.css +160 -160
  74. package/framework/components/chui_menu_bar/menu_bar.js +66 -74
  75. package/framework/components/chui_menu_bar/styles.css +114 -76
  76. package/framework/components/chui_modal/modal.js +142 -135
  77. package/framework/components/chui_modal/styles.css +36 -36
  78. package/framework/components/chui_notification/notification.js +72 -72
  79. package/framework/components/chui_notification/notification_download.js +78 -78
  80. package/framework/components/chui_notification/notification_download_progress.css +119 -123
  81. package/framework/components/chui_notification/notification_download_progress.js +105 -105
  82. package/framework/components/chui_notification/notification_update.js +54 -54
  83. package/framework/components/chui_notification/styles.css +91 -91
  84. package/framework/components/chui_notification/styles_download.css +85 -85
  85. package/framework/components/chui_notification/styles_update.css +73 -73
  86. package/framework/components/chui_paragraph/paragraph.js +14 -14
  87. package/framework/components/chui_paragraph/styles.css +6 -6
  88. package/framework/components/chui_popups/popups.js +250 -250
  89. package/framework/components/chui_popups/styles.css +129 -115
  90. package/framework/components/chui_progress_bar/progress_bar.js +28 -28
  91. package/framework/components/chui_progress_bar/styles.css +28 -28
  92. package/framework/components/chui_radio_group/radio_group.js +57 -57
  93. package/framework/components/chui_radio_group/styles.css +3 -3
  94. package/framework/components/chui_slideshow/slideshow.js +75 -75
  95. package/framework/components/chui_slideshow/styles.css +94 -85
  96. package/framework/components/chui_spinner/spinner.js +45 -45
  97. package/framework/components/chui_spinner/styles.css +23 -23
  98. package/framework/components/chui_table/styles.css +42 -42
  99. package/framework/components/chui_table/table.js +234 -234
  100. package/framework/components/chui_tabs/chui_tabs.js +77 -77
  101. package/framework/components/chui_tabs/styles.css +54 -48
  102. package/framework/components/chui_text_editor/styles.css +217 -217
  103. package/framework/components/chui_text_editor/text_editor.js +144 -144
  104. package/framework/components/chui_text_editor/text_editor_panel.js +568 -568
  105. package/framework/components/chui_tree_view/styles.css +81 -75
  106. package/framework/components/chui_tree_view/tree_view.js +90 -90
  107. package/framework/components/chui_webview/styles.css +27 -27
  108. package/framework/components/chui_webview/webview.js +103 -103
  109. package/framework/components/telegram_bot/chui_telegram_bot.js +183 -183
  110. package/framework/modules/chui_animations/animations.js +121 -121
  111. package/framework/modules/chui_animations/styles.css +79 -79
  112. package/framework/modules/chui_fonts.js +7129 -6974
  113. package/framework/modules/chui_functions.js +106 -78
  114. package/framework/modules/chui_logger/chui_logger.js +53 -53
  115. package/framework/modules/chui_page/page.js +86 -86
  116. package/framework/modules/chui_page/styles.css +9 -9
  117. package/framework/tray_bar/chui_menu_items.js +48 -48
  118. package/index.js +570 -555
  119. package/package.json +51 -46
@@ -1,101 +1,118 @@
1
- @media (prefers-color-scheme: light) {
2
- :root {
3
- /* Текст */
4
- --text_color: rgb(45, 45, 45);
5
- --text_color_disabled: rgba(45, 45, 45, 0.65);
6
- --text_color_hover: rgb(255, 255, 255);
7
- --text_color_hover_disable: rgba(255, 255, 255, 0.65);
8
- /* Основные цвета */
9
- --main_background: rgb(255, 255, 255);
10
- --header_background: rgba(226, 226, 226, 0.65);
11
- --header_background_drop: rgb(246, 246, 246, 1);
12
- /* Обводка */
13
- --border_color: rgb(240, 240, 240);
14
- /* Элементы */
15
- /* Кнопка */
16
- --button_border_color: rgb(240, 240, 240);
17
- --button_border_color_hover: rgb(0, 122, 245);
18
- --button_background: rgb(240, 240, 240);
19
- --button_background_hover: rgb(0, 122, 245);
20
- --button_background_disabled: rgba(240, 240, 240, 0.65);
21
- /* Модальное окно */
22
- --modal_background: rgba(255, 255, 255, 0.7);
23
- /* Элементы */
24
- --element_background: rgb(240, 240, 240);
25
- --element_background_disabled: rgba(240, 240, 240, 0.65);
26
- --element_background_2: rgb(226, 226, 226);
27
- --element_background_disabled_2: rgba(226, 226, 226, 0.65);
28
- --element_background_prime: rgb(0, 102, 225);
29
- --element_background_disabled_prime: rgba(0, 102, 225, 0.65);
30
- /* Акцент */
31
- --blue_prime_background: rgb(0, 122, 245);
32
- --blue_prime_background_trans: rgba(0, 122, 245, 0.65);
33
- --red_prime_background: rgb(246, 52, 40);
34
- /* Бэйджи */
35
- --badge_error_back: rgba(255, 59, 48, 0.5);
36
- --badge_error_text: rgb(194, 6, 24);
37
- --badge_success_back: rgba(52, 199, 89, 0.5);
38
- --badge_success_text: rgb(0, 112, 24);
39
- --badge_cancel_back: rgba(142, 142, 147, 0.5);
40
- --badge_cancel_text: rgb(97, 97, 101);
41
- --badge_warning_back: rgba(255, 204, 0, 0.5);
42
- --badge_warning_text: rgb(146, 81, 0);
43
- /* Аудиоплеер */
44
- --ap_input_background: rgba(255, 255, 255, 0.65);
45
- --ap_main_background: rgba(226, 226, 226, 0.65);
46
- --ap_main_background_2: rgba(220, 220, 220, 0.65);
47
- --ap_slider_background: rgba(220, 220, 220, 0.65);
48
- --ap_slider_buf_background: rgba(0, 122, 245, 0.65);
49
- }
50
- }
51
-
52
- @media (prefers-color-scheme: dark) {
53
- :root {
54
- /* Текст */
55
- --text_color: rgb(255, 255, 255);
56
- --text_color_disabled: rgba(255, 255, 255, 0.65);
57
- --text_color_hover: rgb(255, 255, 255);
58
- --text_color_hover_disable: rgba(255, 255, 255, 0.65);
59
- /* Основные цвета */
60
- --main_background: rgb(27, 27, 27);
61
- --header_background: rgba(40, 40, 40, 0.65);
62
- --header_background_drop: rgba(48, 48, 48, 1);
63
- /* Обводка */
64
- --border_color: rgb(54, 54, 54);
65
- /* Элементы */
66
- /* Кнопка */
67
- --button_border_color: rgb(54, 54, 54);
68
- --button_border_color_hover: rgb(64, 156, 255);
69
- --button_background: rgb(54, 54, 54);
70
- --button_background_hover: rgb(64, 156, 255);
71
- --button_background_disabled: rgba(54, 54, 54, 0.65);
72
- /* Модальное окно */
73
- --modal_background: rgba(27, 27, 27, 0.7);
74
- /* Элементы */
75
- --element_background: rgb(54, 54, 54);
76
- --element_background_disabled: rgba(54, 54, 54, 0.65);
77
- --element_background_2: rgb(68, 68, 68);
78
- --element_background_disabled_2: rgba(68, 68, 68, 0.65);
79
- --element_background_prime: rgb(34, 126, 225);
80
- --element_background_disabled_prime: rgba(34, 126, 225, 0.65);
81
- /* Акцент */
82
- --blue_prime_background: rgb(64, 156, 255);
83
- --blue_prime_background_trans: rgba(64, 156, 255, 0.65);
84
- --red_prime_background: rgb(255, 105, 97);
85
- /* Бэйджи */
86
- --badge_error_back: rgba(255, 69, 58, 0.5);
87
- --badge_error_text: rgb(255, 105, 94);
88
- --badge_success_back: rgba(48, 209, 88, 0.5);
89
- --badge_success_text: rgb(49, 222, 75);
90
- --badge_cancel_back: rgba(142, 142, 147, 0.5);
91
- --badge_cancel_text: rgb(182, 182, 187);
92
- --badge_warning_back: rgba(255, 214, 10, 0.5);
93
- --badge_warning_text: rgb(255, 212, 38);
94
- /* Аудиоплеер */
95
- --ap_input_background: rgba(30, 30, 30, 0.65);
96
- --ap_main_background: rgba(40, 40, 40, 0.65);
97
- --ap_main_background_2: rgba(73, 73, 73, 0.65);
98
- --ap_slider_background: rgba(73, 73, 73, 0.65);
99
- --ap_slider_buf_background: rgba(64, 156, 255, 0.65);
100
- }
101
- }
1
+ /* Палитры в стиле Apple flat (macOS/iOS system colors).
2
+
3
+ Иерархия поверхностей повторяет iOS/macOS «grouped»:
4
+ - --main_background — подложка страницы (светло-серая / чёрная);
5
+ - --element_background_2 — карточки и контент-блоки (белые / #1c1c1e);
6
+ - --element_background, --button_background — полупрозрачные нейтральные
7
+ заливки контролов (iOS systemFill), поэтому элемент читается и на белой
8
+ карточке, и на серой подложке, независимо от того, где он лежит;
9
+ - --element_background_hover — та же заливка, но плотнее (ховер контрола);
10
+ - --element_background_disabled_2 полупрозрачный «белый» токен оставлен
11
+ для совместимости, хайрлайны рисуются через --border_color.
12
+
13
+ Прозрачность и blur оставлены только для «материалов», которые реально
14
+ всплывают над контентом (шапка, модалки, поповеры, меню, уведомления). */
15
+
16
+ @media (prefers-color-scheme: light) {
17
+ :root {
18
+ /* Текст */
19
+ --text_color: #1d1d1f;
20
+ --text_color_disabled: rgba(60, 60, 67, 0.6);
21
+ --text_color_hover: #ffffff;
22
+ --text_color_hover_disable: rgba(255, 255, 255, 0.7);
23
+ /* Поверхности: серая подложка страницы + белые карточки */
24
+ --main_background: #f2f2f7;
25
+ --header_background: rgba(250, 250, 252, 0.72);
26
+ /* Обводка (hairline) */
27
+ --border_color: rgba(60, 60, 67, 0.18);
28
+ /* Кнопка */
29
+ --button_border_color: rgba(60, 60, 67, 0.2);
30
+ --button_border_color_hover: #007aff;
31
+ --button_background: rgba(120, 120, 128, 0.2);
32
+ --button_background_hover: #007aff;
33
+ --button_background_disabled: rgba(120, 120, 128, 0.09);
34
+ /* Модальное окно */
35
+ --modal_background: rgba(250, 250, 252, 0.78);
36
+ /* Элементы */
37
+ --element_background: rgba(120, 120, 128, 0.2);
38
+ --element_background_hover: rgba(120, 120, 128, 0.32);
39
+ --element_background_disabled: rgba(120, 120, 128, 0.09);
40
+ --element_background_2: #ffffff;
41
+ --element_background_disabled_2: rgba(255, 255, 255, 0.6);
42
+ --element_background_prime: #007aff;
43
+ --element_background_disabled_prime: rgba(0, 122, 255, 0.6);
44
+ /* Акцент */
45
+ --blue_prime_background: #007aff;
46
+ --blue_prime_background_trans: rgba(0, 122, 255, 0.6);
47
+ --red_prime_background: #ff3b30;
48
+ /* Бэйджи */
49
+ --badge_error_back: rgba(255, 59, 48, 0.16);
50
+ --badge_error_text: #d70015;
51
+ --badge_success_back: rgba(52, 199, 89, 0.16);
52
+ --badge_success_text: #248a3d;
53
+ --badge_cancel_back: rgba(142, 142, 147, 0.16);
54
+ --badge_cancel_text: #6c6c70;
55
+ --badge_warning_back: rgba(255, 204, 0, 0.2);
56
+ --badge_warning_text: #b25000;
57
+ /* Аудиоплеер: полупрозрачные заливки под backdrop-filter */
58
+ --ap_input_background: rgba(120, 120, 128, 0.18);
59
+ --ap_main_background: rgba(120, 120, 128, 0.16);
60
+ --ap_main_background_2: rgba(120, 120, 128, 0.26);
61
+ --ap_slider_background: rgba(120, 120, 128, 0.3);
62
+ --ap_slider_buf_background: rgba(0, 122, 255, 0.65);
63
+ /* Скроллбар */
64
+ --scrollbar_thumb: rgba(120, 120, 128, 0.45);
65
+ }
66
+ }
67
+
68
+ @media (prefers-color-scheme: dark) {
69
+ :root {
70
+ /* Текст */
71
+ --text_color: #ffffff;
72
+ --text_color_disabled: rgba(235, 235, 245, 0.6);
73
+ --text_color_hover: #ffffff;
74
+ --text_color_hover_disable: rgba(255, 255, 255, 0.7);
75
+ /* Основные цвета */
76
+ --main_background: #000000;
77
+ --header_background: rgba(28, 28, 30, 0.72);
78
+ /* Обводка (hairline) */
79
+ --border_color: rgba(255, 255, 255, 0.16);
80
+ /* Кнопка */
81
+ --button_border_color: rgba(255, 255, 255, 0.2);
82
+ --button_border_color_hover: #0a84ff;
83
+ --button_background: rgba(120, 120, 128, 0.3);
84
+ --button_background_hover: #0a84ff;
85
+ --button_background_disabled: rgba(120, 120, 128, 0.14);
86
+ /* Модальное окно */
87
+ --modal_background: rgba(30, 30, 32, 0.78);
88
+ /* Элементы */
89
+ --element_background: rgba(120, 120, 128, 0.3);
90
+ --element_background_hover: rgba(120, 120, 128, 0.45);
91
+ --element_background_disabled: rgba(120, 120, 128, 0.14);
92
+ --element_background_2: #1c1c1e;
93
+ --element_background_disabled_2: rgba(28, 28, 30, 0.6);
94
+ --element_background_prime: #0a84ff;
95
+ --element_background_disabled_prime: rgba(10, 132, 255, 0.6);
96
+ /* Акцент */
97
+ --blue_prime_background: #0a84ff;
98
+ --blue_prime_background_trans: rgba(10, 132, 255, 0.6);
99
+ --red_prime_background: #ff453a;
100
+ /* Бэйджи */
101
+ --badge_error_back: rgba(255, 69, 58, 0.2);
102
+ --badge_error_text: #ff6961;
103
+ --badge_success_back: rgba(48, 209, 88, 0.2);
104
+ --badge_success_text: #30d158;
105
+ --badge_cancel_back: rgba(142, 142, 147, 0.2);
106
+ --badge_cancel_text: #aeaeb2;
107
+ --badge_warning_back: rgba(255, 214, 10, 0.2);
108
+ --badge_warning_text: #ffd60a;
109
+ /* Аудиоплеер: полупрозрачные заливки под backdrop-filter */
110
+ --ap_input_background: rgba(120, 120, 128, 0.28);
111
+ --ap_main_background: rgba(120, 120, 128, 0.24);
112
+ --ap_main_background_2: rgba(120, 120, 128, 0.36);
113
+ --ap_slider_background: rgba(120, 120, 128, 0.42);
114
+ --ap_slider_buf_background: rgba(10, 132, 255, 0.65);
115
+ /* Скроллбар */
116
+ --scrollbar_thumb: rgba(120, 120, 128, 0.5);
117
+ }
118
+ }
@@ -1,64 +1,64 @@
1
- const {Icon, Icons} = require("../chui_icons/icons");
2
-
3
- class Accordion {
4
- #name = require("randomstring").generate();
5
- #chui_accordion = document.createElement(`chui_accordion`);
6
- constructor(options = [ { b_text: undefined, p_text: undefined } ]) {
7
- require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_Accordion');
8
- options.forEach(element => {
9
- let main_test = document.createElement(`chui_accordion_main_test`);
10
- let ab = document.createElement('accordion_button')
11
- ab.setAttribute('name', this.#name)
12
- let bt = document.createElement('accordion_button_text')
13
- bt.innerHTML = element.b_text
14
- let barrow = document.createElement('accordion_button_arrow')
15
- barrow.style.marginLeft = 'auto'
16
- barrow.innerHTML = new Icon(Icons.HARDWARE.KEYBOARD_ARROW_DOWN).getHTML();
17
- ab.appendChild(bt)
18
- ab.appendChild(barrow)
19
- let ap = document.createElement('accordion_panel')
20
- /*if ((options.indexOf(elem) + 1) !== options.length) {
21
- ap.style.marginBottom = 'var(--margin)'
22
- }*/
23
- let html = document.createElement('accordion_panel_html')
24
- html.innerHTML = element.p_text
25
- ap.appendChild(html)
26
- main_test.appendChild(ab)
27
- main_test.appendChild(ap)
28
- this.#chui_accordion.appendChild(main_test)
29
-
30
- if (options.indexOf(element) > 0) {
31
- main_test.style.marginTop = "8px"
32
- }
33
-
34
- //ФУНКЦИИ
35
- let test = main_test.children;
36
- let i;
37
- for (i = 0; i < test.length; i++) {
38
- let elem = test[i];
39
- if (elem.tagName === 'ACCORDION_BUTTON') {
40
- elem.addEventListener('click', (e) => {
41
- elem.classList.toggle('accordion_active')
42
- let panel = elem.nextElementSibling;
43
- if (panel.style.maxHeight) {
44
- elem.children[1].children[0].style.transform = 'rotate(0deg)'
45
- panel.style.maxHeight = null;
46
- elem.style.borderBottomLeftRadius = 'var(--border_radius)'
47
- elem.style.borderBottomRightRadius = 'var(--border_radius)'
48
- } else {
49
- elem.children[1].children[0].style.transform = 'rotate(180deg)'
50
- elem.style.borderBottomLeftRadius = '0px'
51
- elem.style.borderBottomRightRadius = '0px'
52
- panel.style.maxHeight = panel.scrollHeight + "px";
53
- }
54
- })
55
- }
56
- }
57
- })
58
- }
59
- set() {
60
- return this.#chui_accordion;
61
- }
62
- }
63
-
1
+ const {Icon, Icons} = require("../chui_icons/icons");
2
+
3
+ class Accordion {
4
+ #name = require("randomstring").generate();
5
+ #chui_accordion = document.createElement(`chui_accordion`);
6
+ constructor(options = [ { b_text: undefined, p_text: undefined } ]) {
7
+ require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_Accordion');
8
+ options.forEach(element => {
9
+ let main_test = document.createElement(`chui_accordion_main_test`);
10
+ let ab = document.createElement('accordion_button')
11
+ ab.setAttribute('name', this.#name)
12
+ let bt = document.createElement('accordion_button_text')
13
+ bt.innerHTML = element.b_text
14
+ let barrow = document.createElement('accordion_button_arrow')
15
+ barrow.style.marginLeft = 'auto'
16
+ barrow.innerHTML = new Icon(Icons.HARDWARE.KEYBOARD_ARROW_DOWN).getHTML();
17
+ ab.appendChild(bt)
18
+ ab.appendChild(barrow)
19
+ let ap = document.createElement('accordion_panel')
20
+ /*if ((options.indexOf(elem) + 1) !== options.length) {
21
+ ap.style.marginBottom = 'var(--margin)'
22
+ }*/
23
+ let html = document.createElement('accordion_panel_html')
24
+ html.innerHTML = element.p_text
25
+ ap.appendChild(html)
26
+ main_test.appendChild(ab)
27
+ main_test.appendChild(ap)
28
+ this.#chui_accordion.appendChild(main_test)
29
+
30
+ if (options.indexOf(element) > 0) {
31
+ main_test.style.marginTop = "8px"
32
+ }
33
+
34
+ //ФУНКЦИИ
35
+ let test = main_test.children;
36
+ let i;
37
+ for (i = 0; i < test.length; i++) {
38
+ let elem = test[i];
39
+ if (elem.tagName === 'ACCORDION_BUTTON') {
40
+ elem.addEventListener('click', (e) => {
41
+ elem.classList.toggle('accordion_active')
42
+ let panel = elem.nextElementSibling;
43
+ if (panel.style.maxHeight) {
44
+ elem.children[1].children[0].style.transform = 'rotate(0deg)'
45
+ panel.style.maxHeight = null;
46
+ elem.style.borderBottomLeftRadius = 'var(--border_radius)'
47
+ elem.style.borderBottomRightRadius = 'var(--border_radius)'
48
+ } else {
49
+ elem.children[1].children[0].style.transform = 'rotate(180deg)'
50
+ elem.style.borderBottomLeftRadius = '0px'
51
+ elem.style.borderBottomRightRadius = '0px'
52
+ panel.style.maxHeight = panel.scrollHeight + "px";
53
+ }
54
+ })
55
+ }
56
+ }
57
+ })
58
+ }
59
+ set() {
60
+ return this.#chui_accordion;
61
+ }
62
+ }
63
+
64
64
  exports.Accordion = Accordion
@@ -1,76 +1,80 @@
1
- chui_accordion {
2
- display: flex;
3
- flex-direction: column;
4
- height: max-content;
5
- width: max-content;
6
- font-size: var(--font_default_size);
7
- font-weight:400;
8
- border: none;
9
- margin: var(--margin);
10
- }
11
-
12
- chui_accordion_main_test {
13
- display: flex;
14
- flex-direction: column;
15
- height: max-content;
16
- width: -webkit-fill-available;
17
- font-size: var(--font_default_size);
18
- font-weight:400;
19
- border-radius: var(--border_radius);
20
- border: none;
21
- }
22
-
23
- accordion_button {
24
- background: var(--element_background);
25
- cursor: pointer;
26
- padding: var(--main_padding);
27
- width: -webkit-fill-available;
28
- text-align: left;
29
- outline: none;
30
- display: flex;
31
- align-items: center;
32
- border-radius: var(--border_radius);
33
- color: var(--text_color);
34
- border: none;
35
- }
36
-
37
- accordion_panel {
38
- background: var(--header_background);
39
- padding: 0 10px;
40
- display: block;
41
- overflow: hidden;
42
- width: -webkit-fill-available;
43
- max-height: 0;
44
- border-bottom-right-radius: var(--border_radius);
45
- border-bottom-left-radius: var(--border_radius);
46
- color: var(--text_color);
47
- }
48
-
49
- accordion_panel_html {
50
- padding: 8px 0;
51
- width: -webkit-fill-available;
52
- display: flex;
53
- border: none
54
- }
55
-
56
- accordion_button:hover {
57
- background: var(--blue_prime_background);
58
- }
59
-
60
- accordion_button:hover accordion_button_text {
61
- color: var(--text_color_hover);
62
- }
63
-
64
- accordion_button:hover chui_icon {
65
- color: var(--text_color_hover);
66
- }
67
-
68
- .accordion_active {
69
- background: var(--blue_prime_background);
70
- color: var(--text_color_hover);
71
- }
72
-
73
- .accordion_active chui_icon {
74
- background: transparent;
75
- color: var(--text_color_hover);
1
+ chui_accordion {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: max-content;
5
+ width: max-content;
6
+ font-size: var(--font_default_size);
7
+ font-weight:400;
8
+ border: none;
9
+ margin: var(--margin);
10
+ }
11
+
12
+ chui_accordion_main_test {
13
+ display: flex;
14
+ flex-direction: column;
15
+ height: max-content;
16
+ width: -webkit-fill-available;
17
+ font-size: var(--font_default_size);
18
+ font-weight:400;
19
+ border-radius: var(--border_radius);
20
+ border: none;
21
+ }
22
+
23
+ accordion_button {
24
+ background: var(--element_background);
25
+ cursor: pointer;
26
+ padding: var(--main_padding);
27
+ width: -webkit-fill-available;
28
+ text-align: left;
29
+ outline: none;
30
+ display: flex;
31
+ align-items: center;
32
+ border-radius: var(--border_radius);
33
+ color: var(--text_color);
34
+ border: none;
35
+ }
36
+
37
+ accordion_panel {
38
+ background: var(--element_background);
39
+ padding: 0 10px;
40
+ display: block;
41
+ overflow: hidden;
42
+ width: -webkit-fill-available;
43
+ max-height: 0;
44
+ border-bottom-right-radius: var(--border_radius);
45
+ border-bottom-left-radius: var(--border_radius);
46
+ color: var(--text_color);
47
+ }
48
+
49
+ accordion_panel_html {
50
+ padding: 8px 0;
51
+ width: -webkit-fill-available;
52
+ display: flex;
53
+ border: none
54
+ }
55
+
56
+ accordion_button:hover {
57
+ background: var(--blue_prime_background);
58
+ }
59
+
60
+ accordion_button:active {
61
+ background: var(--element_background_prime);
62
+ }
63
+
64
+ accordion_button:hover accordion_button_text {
65
+ color: var(--text_color_hover);
66
+ }
67
+
68
+ accordion_button:hover chui_icon {
69
+ color: var(--text_color_hover);
70
+ }
71
+
72
+ .accordion_active {
73
+ background: var(--blue_prime_background);
74
+ color: var(--text_color_hover);
75
+ }
76
+
77
+ .accordion_active chui_icon {
78
+ background: transparent;
79
+ color: var(--text_color_hover);
76
80
  }
@@ -1,56 +1,56 @@
1
- const {setStyles, markdownToHtml, htmlToMarkdown} = require('../../modules/chui_functions');
2
-
3
- class Badge {
4
- #chui_badge = document.createElement(`chui_badge`);
5
- constructor(options = {
6
- id: String(),
7
- text: String(),
8
- markdownText: String(),
9
- style: undefined
10
- }) {
11
- setStyles(__dirname + "/styles.css", 'chUiJS_Badge');
12
- if (options.id !== undefined) this.#chui_badge.id = options.id;
13
- if (options.style !== undefined) this.#chui_badge.classList.add(options.style);
14
- // Стили текста баджей
15
- if (options.text !== undefined && options.markdownText !== undefined) {
16
- throw new Error("Должна быть установлена одна опция text или markdownText");
17
- } else {
18
- if (options.text !== undefined) this.#chui_badge.innerText = options.text;
19
- if (options.markdownText !== undefined) this.#chui_badge.innerHTML = markdownToHtml(options.markdownText);
20
- }
21
- }
22
- // GET
23
- getId() {
24
- return this.#chui_badge.id;
25
- }
26
- getText() {
27
- return this.#chui_badge.innerText;
28
- }
29
- getMarkdownText() {
30
- return htmlToMarkdown(this.#chui_badge.innerHTML);
31
- }
32
- // SET
33
- setText(text = String()) {
34
- this.#chui_badge.innerText = text;
35
- }
36
- setMarkdownText(text = String()) {
37
- this.#chui_badge.innerHTML = markdownToHtml(text);
38
- }
39
- setId(id = String()) {
40
- this.#chui_badge.id = id;
41
- }
42
- setStyle(style = String()) {
43
- this.#chui_badge.classList.add(style);
44
- }
45
- // RENDER
46
- set() {
47
- return this.#chui_badge;
48
- }
49
- static STYLE = {
50
- ERROR: 'badge_error',
51
- SUCCESS: 'badge_success',
52
- WARNING: 'badge_warning'
53
- }
54
- }
55
-
1
+ const {setStyles, markdownToHtml, htmlToMarkdown} = require('../../modules/chui_functions');
2
+
3
+ class Badge {
4
+ #chui_badge = document.createElement(`chui_badge`);
5
+ constructor(options = {
6
+ id: String(),
7
+ text: String(),
8
+ markdownText: String(),
9
+ style: undefined
10
+ }) {
11
+ setStyles(__dirname + "/styles.css", 'chUiJS_Badge');
12
+ if (options.id !== undefined) this.#chui_badge.id = options.id;
13
+ if (options.style !== undefined) this.#chui_badge.classList.add(options.style);
14
+ // Стили текста баджей
15
+ if (options.text !== undefined && options.markdownText !== undefined) {
16
+ throw new Error("Должна быть установлена одна опция text или markdownText");
17
+ } else {
18
+ if (options.text !== undefined) this.#chui_badge.innerText = options.text;
19
+ if (options.markdownText !== undefined) this.#chui_badge.innerHTML = markdownToHtml(options.markdownText);
20
+ }
21
+ }
22
+ // GET
23
+ getId() {
24
+ return this.#chui_badge.id;
25
+ }
26
+ getText() {
27
+ return this.#chui_badge.innerText;
28
+ }
29
+ getMarkdownText() {
30
+ return htmlToMarkdown(this.#chui_badge.innerHTML);
31
+ }
32
+ // SET
33
+ setText(text = String()) {
34
+ this.#chui_badge.innerText = text;
35
+ }
36
+ setMarkdownText(text = String()) {
37
+ this.#chui_badge.innerHTML = markdownToHtml(text);
38
+ }
39
+ setId(id = String()) {
40
+ this.#chui_badge.id = id;
41
+ }
42
+ setStyle(style = String()) {
43
+ this.#chui_badge.classList.add(style);
44
+ }
45
+ // RENDER
46
+ set() {
47
+ return this.#chui_badge;
48
+ }
49
+ static STYLE = {
50
+ ERROR: 'badge_error',
51
+ SUCCESS: 'badge_success',
52
+ WARNING: 'badge_warning'
53
+ }
54
+ }
55
+
56
56
  exports.Badge = Badge