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.
- package/LICENSE +21 -21
- package/README.md +1203 -162
- package/framework/appLayout/default/chui_app_layout.js +747 -747
- package/framework/appLayout/default/global_style.css +592 -568
- package/framework/appLayout/default/main_theme_style.css +118 -101
- package/framework/components/chui_accordion/accordion.js +63 -63
- package/framework/components/chui_accordion/styles.css +79 -75
- package/framework/components/chui_badge/badge.js +55 -55
- package/framework/components/chui_badge/styles.css +29 -29
- package/framework/components/chui_button/button.js +48 -48
- package/framework/components/chui_button/styles.css +75 -70
- package/framework/components/chui_calendar/calendar.js +97 -97
- package/framework/components/chui_card/card.js +87 -0
- package/framework/components/chui_card/styles.css +72 -0
- package/framework/components/chui_code/code.js +18 -18
- package/framework/components/chui_code/styles.css +9 -9
- package/framework/components/chui_console/console.js +27 -27
- package/framework/components/chui_console/styles.css +31 -31
- package/framework/components/chui_content_block/content_block.js +51 -51
- package/framework/components/chui_content_block/styles.css +2 -2
- package/framework/components/chui_context_menu/context_menu.js +230 -0
- package/framework/components/chui_context_menu/styles.css +136 -0
- package/framework/components/chui_custom_element/custom_element.js +24 -24
- package/framework/components/chui_details/details.js +85 -85
- package/framework/components/chui_details/styles.css +70 -66
- package/framework/components/chui_fieldset/fieldset.js +40 -40
- package/framework/components/chui_fieldset/styles.css +24 -24
- package/framework/components/chui_form/form.js +40 -40
- package/framework/components/chui_form/styles.css +21 -21
- package/framework/components/chui_graphs/graphs.js +234 -190
- package/framework/components/chui_graphs/styles.css +37 -32
- package/framework/components/chui_hero/hero.js +98 -0
- package/framework/components/chui_hero/styles.css +91 -0
- package/framework/components/chui_html_block/html_block.js +16 -16
- package/framework/components/chui_html_block/styles.css +5 -5
- package/framework/components/chui_hx/hx.js +15 -15
- package/framework/components/chui_hx/styles.css +38 -38
- package/framework/components/chui_icons/icons.js +2144 -2144
- package/framework/components/chui_icons/styles.css +13 -13
- package/framework/components/chui_inputs/chui_check_box/check_box.js +32 -32
- package/framework/components/chui_inputs/chui_check_box/styles.css +91 -86
- package/framework/components/chui_inputs/chui_combo_box/combo_box.js +166 -150
- package/framework/components/chui_inputs/chui_combo_box/styles.css +113 -107
- package/framework/components/chui_inputs/chui_date/date.js +177 -174
- package/framework/components/chui_inputs/chui_date/styles.css +163 -128
- package/framework/components/chui_inputs/chui_email/email.js +61 -61
- package/framework/components/chui_inputs/chui_email/styles.css +69 -71
- package/framework/components/chui_inputs/chui_file/file.js +76 -76
- package/framework/components/chui_inputs/chui_file/styles.css +99 -99
- package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +295 -295
- package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +212 -235
- package/framework/components/chui_inputs/chui_number/number.js +108 -108
- package/framework/components/chui_inputs/chui_number/styles.css +84 -84
- package/framework/components/chui_inputs/chui_password/password.js +99 -99
- package/framework/components/chui_inputs/chui_password/styles.css +97 -97
- package/framework/components/chui_inputs/chui_radio_button/radio_button.js +45 -45
- package/framework/components/chui_inputs/chui_radio_button/styles.css +76 -73
- package/framework/components/chui_inputs/chui_select_box/select_box.js +187 -170
- package/framework/components/chui_inputs/chui_select_box/styles.css +123 -117
- package/framework/components/chui_inputs/chui_text/styles.css +83 -84
- package/framework/components/chui_inputs/chui_text/text.js +91 -91
- package/framework/components/chui_inputs/chui_text_area/styles.css +57 -57
- package/framework/components/chui_inputs/chui_text_area/text_area.js +61 -61
- package/framework/components/chui_inputs/chui_toggle/styles.css +66 -61
- package/framework/components/chui_inputs/chui_toggle/toggle.js +36 -36
- package/framework/components/chui_label/label.js +54 -54
- package/framework/components/chui_label/styles.css +11 -11
- package/framework/components/chui_media/audio.js +908 -908
- package/framework/components/chui_media/audio_styles.css +458 -458
- package/framework/components/chui_media/image.js +105 -105
- package/framework/components/chui_media/image_styles.css +61 -61
- package/framework/components/chui_media/video.js +248 -248
- package/framework/components/chui_media/video_styles.css +160 -160
- package/framework/components/chui_menu_bar/menu_bar.js +66 -74
- package/framework/components/chui_menu_bar/styles.css +114 -76
- package/framework/components/chui_modal/modal.js +142 -135
- package/framework/components/chui_modal/styles.css +36 -36
- package/framework/components/chui_notification/notification.js +72 -72
- package/framework/components/chui_notification/notification_download.js +78 -78
- package/framework/components/chui_notification/notification_download_progress.css +119 -123
- package/framework/components/chui_notification/notification_download_progress.js +105 -105
- package/framework/components/chui_notification/notification_update.js +54 -54
- package/framework/components/chui_notification/styles.css +91 -91
- package/framework/components/chui_notification/styles_download.css +85 -85
- package/framework/components/chui_notification/styles_update.css +73 -73
- package/framework/components/chui_paragraph/paragraph.js +14 -14
- package/framework/components/chui_paragraph/styles.css +6 -6
- package/framework/components/chui_popups/popups.js +250 -250
- package/framework/components/chui_popups/styles.css +129 -115
- package/framework/components/chui_progress_bar/progress_bar.js +28 -28
- package/framework/components/chui_progress_bar/styles.css +28 -28
- package/framework/components/chui_radio_group/radio_group.js +57 -57
- package/framework/components/chui_radio_group/styles.css +3 -3
- package/framework/components/chui_slideshow/slideshow.js +75 -75
- package/framework/components/chui_slideshow/styles.css +94 -85
- package/framework/components/chui_spinner/spinner.js +45 -45
- package/framework/components/chui_spinner/styles.css +23 -23
- package/framework/components/chui_table/styles.css +42 -42
- package/framework/components/chui_table/table.js +234 -234
- package/framework/components/chui_tabs/chui_tabs.js +77 -77
- package/framework/components/chui_tabs/styles.css +54 -48
- package/framework/components/chui_text_editor/styles.css +217 -217
- package/framework/components/chui_text_editor/text_editor.js +144 -144
- package/framework/components/chui_text_editor/text_editor_panel.js +568 -568
- package/framework/components/chui_tree_view/styles.css +81 -75
- package/framework/components/chui_tree_view/tree_view.js +90 -90
- package/framework/components/chui_webview/styles.css +27 -27
- package/framework/components/chui_webview/webview.js +103 -103
- package/framework/components/telegram_bot/chui_telegram_bot.js +183 -183
- package/framework/modules/chui_animations/animations.js +121 -121
- package/framework/modules/chui_animations/styles.css +79 -79
- package/framework/modules/chui_fonts.js +7129 -6974
- package/framework/modules/chui_functions.js +106 -78
- package/framework/modules/chui_logger/chui_logger.js +53 -53
- package/framework/modules/chui_page/page.js +86 -86
- package/framework/modules/chui_page/styles.css +9 -9
- package/framework/tray_bar/chui_menu_items.js +48 -48
- package/index.js +570 -555
- package/package.json +51 -46
|
@@ -1,101 +1,118 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
|
|
22
|
-
--
|
|
23
|
-
/*
|
|
24
|
-
--
|
|
25
|
-
--
|
|
26
|
-
|
|
27
|
-
--
|
|
28
|
-
|
|
29
|
-
--
|
|
30
|
-
|
|
31
|
-
--
|
|
32
|
-
--
|
|
33
|
-
--
|
|
34
|
-
/*
|
|
35
|
-
--
|
|
36
|
-
|
|
37
|
-
--
|
|
38
|
-
--
|
|
39
|
-
--
|
|
40
|
-
--
|
|
41
|
-
--
|
|
42
|
-
--
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
--
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
--
|
|
56
|
-
--
|
|
57
|
-
|
|
58
|
-
--
|
|
59
|
-
|
|
60
|
-
--
|
|
61
|
-
--
|
|
62
|
-
--
|
|
63
|
-
/*
|
|
64
|
-
--
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
--
|
|
72
|
-
|
|
73
|
-
--
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
--
|
|
77
|
-
--
|
|
78
|
-
|
|
79
|
-
--
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
--
|
|
83
|
-
--
|
|
84
|
-
--
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
--
|
|
88
|
-
|
|
89
|
-
--
|
|
90
|
-
--
|
|
91
|
-
--
|
|
92
|
-
--
|
|
93
|
-
--
|
|
94
|
-
|
|
95
|
-
--
|
|
96
|
-
|
|
97
|
-
--
|
|
98
|
-
--
|
|
99
|
-
--
|
|
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(--
|
|
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:
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
accordion_button:hover
|
|
65
|
-
color: var(--text_color_hover);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|