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