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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const { setStyles } = require(
|
|
2
|
-
const { Avatar } = require(
|
|
3
|
-
const { makeKeyboardButton } = require(
|
|
4
|
-
const { Icon, Icons } = require(
|
|
5
|
-
const { I18n } = require(
|
|
1
|
+
const { setStyles } = require("../../modules/chui_functions");
|
|
2
|
+
const { Avatar } = require("../chui_avatar/avatar");
|
|
3
|
+
const { makeKeyboardButton } = require("../../modules/chui_a11y/chui_a11y");
|
|
4
|
+
const { Icon, Icons } = require("../chui_icons/icons");
|
|
5
|
+
const { I18n } = require("../../modules/chui_i18n/chui_i18n");
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Схема подчинения: карточки людей по уровням и связи «руководитель — подчинённый».
|
|
@@ -55,7 +55,7 @@ class OrgChart {
|
|
|
55
55
|
static STYLE = {
|
|
56
56
|
DEFAULT: "default",
|
|
57
57
|
ACCENT: "accent",
|
|
58
|
-
MUTED: "muted"
|
|
58
|
+
MUTED: "muted",
|
|
59
59
|
};
|
|
60
60
|
static DEFAULT_NODE_WIDTH = 176;
|
|
61
61
|
static DEFAULT_NODE_HEIGHT = 64;
|
|
@@ -74,39 +74,52 @@ class OrgChart {
|
|
|
74
74
|
#roots = [];
|
|
75
75
|
#rows = [];
|
|
76
76
|
#slots = 1;
|
|
77
|
-
#
|
|
78
|
-
#
|
|
79
|
-
#
|
|
80
|
-
#
|
|
77
|
+
#nodeWidth = OrgChart.DEFAULT_NODE_WIDTH;
|
|
78
|
+
#nodeHeight = OrgChart.DEFAULT_NODE_HEIGHT;
|
|
79
|
+
#gapX = OrgChart.DEFAULT_GAP_X;
|
|
80
|
+
#gapY = OrgChart.DEFAULT_GAP_Y;
|
|
81
81
|
#collapsible = true;
|
|
82
|
-
#
|
|
82
|
+
#emptyText = undefined;
|
|
83
83
|
#label = undefined;
|
|
84
84
|
#selected = undefined;
|
|
85
85
|
#expanded = new Map();
|
|
86
|
-
#
|
|
87
|
-
#
|
|
86
|
+
#onNodeClick = undefined;
|
|
87
|
+
#clickListeners = [];
|
|
88
88
|
|
|
89
|
-
constructor(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
constructor(
|
|
90
|
+
options = {
|
|
91
|
+
id: String(),
|
|
92
|
+
title: String(),
|
|
93
|
+
label: String(),
|
|
94
|
+
data: undefined,
|
|
95
|
+
height: String(),
|
|
96
|
+
nodeWidth: Number(),
|
|
97
|
+
nodeHeight: Number(),
|
|
98
|
+
gapX: Number(),
|
|
99
|
+
gapY: Number(),
|
|
100
|
+
collapsible: Boolean(),
|
|
101
|
+
emptyText: String(),
|
|
102
|
+
onNodeClick: undefined,
|
|
103
|
+
}
|
|
104
|
+
) {
|
|
94
105
|
setStyles(__dirname + "/styles.css", "ChUiJS_OrgChart");
|
|
95
106
|
OrgChart.#counter += 1;
|
|
96
107
|
this.#id = options.id === undefined ? `chui_org_chart_${OrgChart.#counter}` : options.id;
|
|
97
108
|
this.#root.id = this.#id;
|
|
98
109
|
this.#label = options.label;
|
|
99
|
-
this.#
|
|
100
|
-
this.#
|
|
101
|
-
if (options.nodeWidth !== undefined)
|
|
102
|
-
|
|
103
|
-
if (options.
|
|
104
|
-
|
|
110
|
+
this.#emptyText = options.emptyText;
|
|
111
|
+
this.#onNodeClick = options.onNodeClick;
|
|
112
|
+
if (options.nodeWidth !== undefined)
|
|
113
|
+
this.#nodeWidth = Math.max(80, Number(options.nodeWidth) || OrgChart.DEFAULT_NODE_WIDTH);
|
|
114
|
+
if (options.nodeHeight !== undefined)
|
|
115
|
+
this.#nodeHeight = Math.max(40, Number(options.nodeHeight) || OrgChart.DEFAULT_NODE_HEIGHT);
|
|
116
|
+
if (options.gapX !== undefined) this.#gapX = Number(options.gapX);
|
|
117
|
+
if (options.gapY !== undefined) this.#gapY = Number(options.gapY);
|
|
105
118
|
if (options.collapsible !== undefined) this.#collapsible = options.collapsible !== false;
|
|
106
119
|
// Размер карточки читают и полотно, и поле прокрутки (отступ по краям), поэтому
|
|
107
120
|
// переменные живут на корне, а не на полотне
|
|
108
|
-
this.#root.style.setProperty("--org_chart_node_width", `${this.#
|
|
109
|
-
this.#root.style.setProperty("--org_chart_node_height", `${this.#
|
|
121
|
+
this.#root.style.setProperty("--org_chart_node_width", `${this.#nodeWidth}px`);
|
|
122
|
+
this.#root.style.setProperty("--org_chart_node_height", `${this.#nodeHeight}px`);
|
|
110
123
|
if (options.height !== undefined) this.#root.style.setProperty("--org_chart_height", options.height);
|
|
111
124
|
|
|
112
125
|
this.#title.id = `${this.#id}_title`;
|
|
@@ -119,7 +132,7 @@ class OrgChart {
|
|
|
119
132
|
this.#status.classList.add("chui_visually_hidden");
|
|
120
133
|
this.#status.setAttribute("role", "status");
|
|
121
134
|
this.#status.setAttribute("aria-live", "polite");
|
|
122
|
-
this.#empty.innerText = this.#
|
|
135
|
+
this.#empty.innerText = this.#emptyText === undefined ? I18n.t("data.orgChartEmpty") : this.#emptyText;
|
|
123
136
|
|
|
124
137
|
this.#canvas.appendChild(this.#links);
|
|
125
138
|
this.#viewport.appendChild(this.#canvas);
|
|
@@ -136,12 +149,22 @@ class OrgChart {
|
|
|
136
149
|
}
|
|
137
150
|
|
|
138
151
|
// GET
|
|
139
|
-
getId() {
|
|
140
|
-
|
|
152
|
+
getId() {
|
|
153
|
+
return this.#id;
|
|
154
|
+
}
|
|
155
|
+
getTitle() {
|
|
156
|
+
return this.#title.innerText;
|
|
157
|
+
}
|
|
141
158
|
/** Данные как передали: те же узлы (правьте их и зовите `setData()`) */
|
|
142
|
-
getData() {
|
|
143
|
-
|
|
144
|
-
|
|
159
|
+
getData() {
|
|
160
|
+
return this.#roots.length === 1 ? this.#roots[0] : [...this.#roots];
|
|
161
|
+
}
|
|
162
|
+
getSelected() {
|
|
163
|
+
return this.#selected;
|
|
164
|
+
}
|
|
165
|
+
getCanvas() {
|
|
166
|
+
return this.#canvas;
|
|
167
|
+
}
|
|
145
168
|
/** Видимые узлы по порядку обхода: `{id, title, position, level, expanded, hasChildren}` */
|
|
146
169
|
getItems() {
|
|
147
170
|
return this.#rows.map((row) => ({
|
|
@@ -150,7 +173,7 @@ class OrgChart {
|
|
|
150
173
|
position: row.node.position,
|
|
151
174
|
level: row.level,
|
|
152
175
|
expanded: row.expanded,
|
|
153
|
-
hasChildren: row.children.length > 0
|
|
176
|
+
hasChildren: row.children.length > 0,
|
|
154
177
|
}));
|
|
155
178
|
}
|
|
156
179
|
getNode(id = String()) {
|
|
@@ -175,13 +198,13 @@ class OrgChart {
|
|
|
175
198
|
return this;
|
|
176
199
|
}
|
|
177
200
|
setEmptyText(text = String()) {
|
|
178
|
-
this.#
|
|
201
|
+
this.#emptyText = text;
|
|
179
202
|
this.#empty.innerText = text;
|
|
180
203
|
return this;
|
|
181
204
|
}
|
|
182
205
|
/** Данные: один корень или массив корней; состояние свёрнутых веток сбрасывается */
|
|
183
206
|
setData(data = undefined) {
|
|
184
|
-
const roots = data === undefined || data === null ? [] :
|
|
207
|
+
const roots = data === undefined || data === null ? [] : Array.isArray(data) ? data : [data];
|
|
185
208
|
this.#roots = roots.filter((node) => node !== undefined && node !== null);
|
|
186
209
|
this.#expanded = new Map();
|
|
187
210
|
for (const node of this.#collect(this.#roots)) {
|
|
@@ -212,9 +235,11 @@ class OrgChart {
|
|
|
212
235
|
this.#expanded.set(String(id), want);
|
|
213
236
|
this.#render();
|
|
214
237
|
const count = this.#descendants(node);
|
|
215
|
-
this.#announce(
|
|
216
|
-
|
|
217
|
-
|
|
238
|
+
this.#announce(
|
|
239
|
+
want
|
|
240
|
+
? I18n.t("data.orgChartExpanded", { name: this.#nameOf(node), count: count })
|
|
241
|
+
: I18n.t("data.orgChartCollapsed", { name: this.#nameOf(node), count: count })
|
|
242
|
+
);
|
|
218
243
|
return this;
|
|
219
244
|
}
|
|
220
245
|
expandAll() {
|
|
@@ -228,10 +253,12 @@ class OrgChart {
|
|
|
228
253
|
return this;
|
|
229
254
|
}
|
|
230
255
|
addNodeClickListener(listener = () => {}) {
|
|
231
|
-
this.#
|
|
256
|
+
this.#clickListeners.push(listener);
|
|
232
257
|
return this;
|
|
233
258
|
}
|
|
234
|
-
set() {
|
|
259
|
+
set() {
|
|
260
|
+
return this.#root;
|
|
261
|
+
}
|
|
235
262
|
|
|
236
263
|
// === РАСКЛАДКА ===
|
|
237
264
|
/** Все узлы дерева в порядке обхода (включая скрытые ветки) */
|
|
@@ -243,7 +270,9 @@ class OrgChart {
|
|
|
243
270
|
return found;
|
|
244
271
|
}
|
|
245
272
|
#childrenOf(node = {}) {
|
|
246
|
-
return Array.isArray(node.children)
|
|
273
|
+
return Array.isArray(node.children)
|
|
274
|
+
? node.children.filter((child) => child !== undefined && child !== null)
|
|
275
|
+
: [];
|
|
247
276
|
}
|
|
248
277
|
/** Ветка раскрыта: у несворачиваемой схемы всегда, иначе явное состояние или `collapsed` из данных */
|
|
249
278
|
#isExpanded(node = {}) {
|
|
@@ -261,7 +290,13 @@ class OrgChart {
|
|
|
261
290
|
let slot = 0;
|
|
262
291
|
const walk = (node, level, parent) => {
|
|
263
292
|
const children = this.#isExpanded(node) ? this.#childrenOf(node) : [];
|
|
264
|
-
const row = {
|
|
293
|
+
const row = {
|
|
294
|
+
node: node,
|
|
295
|
+
level: level,
|
|
296
|
+
parent: parent,
|
|
297
|
+
children: this.#childrenOf(node),
|
|
298
|
+
expanded: this.#isExpanded(node),
|
|
299
|
+
};
|
|
265
300
|
rows.push(row);
|
|
266
301
|
if (children.length === 0) {
|
|
267
302
|
row.slot = slot + 0.5;
|
|
@@ -274,7 +309,7 @@ class OrgChart {
|
|
|
274
309
|
return row;
|
|
275
310
|
};
|
|
276
311
|
for (const root of this.#roots) walk(root, 0, undefined);
|
|
277
|
-
return {rows: rows, slots: Math.max(1, slot)};
|
|
312
|
+
return { rows: rows, slots: Math.max(1, slot) };
|
|
278
313
|
}
|
|
279
314
|
#rowOf(id = undefined) {
|
|
280
315
|
if (id === undefined || id === null) return undefined;
|
|
@@ -333,10 +368,10 @@ class OrgChart {
|
|
|
333
368
|
this.#rows = projected.rows;
|
|
334
369
|
this.#slots = projected.slots;
|
|
335
370
|
this.#nodes().forEach((node) => node.remove());
|
|
336
|
-
const step = this.#
|
|
371
|
+
const step = this.#nodeHeight + this.#gapY;
|
|
337
372
|
const levels = this.#rows.reduce((max, row) => Math.max(max, row.level + 1), 0);
|
|
338
|
-
const height = Math.max(this.#
|
|
339
|
-
const width = Math.max(this.#slots * (this.#
|
|
373
|
+
const height = Math.max(this.#nodeHeight, levels * step - this.#gapY);
|
|
374
|
+
const width = Math.max(this.#slots * (this.#nodeWidth + this.#gapX), 1);
|
|
340
375
|
this.#canvas.style.width = `${width}px`;
|
|
341
376
|
this.#canvas.style.height = `${height}px`;
|
|
342
377
|
// Система координат связей: 0…100 по ширине полотна и пиксели по высоте —
|
|
@@ -366,8 +401,8 @@ class OrgChart {
|
|
|
366
401
|
return undefined;
|
|
367
402
|
}
|
|
368
403
|
/** Координаты узла в той же системе, что у связей: `x` — процент, `y` — пиксели */
|
|
369
|
-
#positionOf(row, step = this.#
|
|
370
|
-
return {x: (row.slot / this.#slots) * 100, y: row.level * step};
|
|
404
|
+
#positionOf(row, step = this.#nodeHeight + this.#gapY) {
|
|
405
|
+
return { x: (row.slot / this.#slots) * 100, y: row.level * step };
|
|
371
406
|
}
|
|
372
407
|
#renderNode(row, step = Number()) {
|
|
373
408
|
const position = this.#positionOf(row, step);
|
|
@@ -378,7 +413,8 @@ class OrgChart {
|
|
|
378
413
|
node.setAttribute("aria-level", String(row.level + 1));
|
|
379
414
|
node.setAttribute("aria-selected", String(row.node.id) === String(this.#selected) ? "true" : "false");
|
|
380
415
|
// Про раскрытие говорит только сворачиваемая схема: у несворачиваемой подчинённые всегда видны
|
|
381
|
-
if (row.children.length > 0 && this.#collapsible)
|
|
416
|
+
if (row.children.length > 0 && this.#collapsible)
|
|
417
|
+
node.setAttribute("aria-expanded", row.expanded ? "true" : "false");
|
|
382
418
|
// Остановку Tab расставит `#applyStop`, а `makeKeyboardButton` заполняет `tabindex`
|
|
383
419
|
// только если атрибута нет — поэтому он задаётся заранее
|
|
384
420
|
node.setAttribute("tabindex", "-1");
|
|
@@ -388,9 +424,9 @@ class OrgChart {
|
|
|
388
424
|
if (row.node.avatar !== undefined) {
|
|
389
425
|
const avatar = new Avatar({
|
|
390
426
|
name: row.node.title,
|
|
391
|
-
image: typeof row.node.avatar === "object" ? row.node.avatar : {path: row.node.avatar},
|
|
427
|
+
image: typeof row.node.avatar === "object" ? row.node.avatar : { path: row.node.avatar },
|
|
392
428
|
size: Avatar.SIZE.SMALL,
|
|
393
|
-
decorative: true
|
|
429
|
+
decorative: true,
|
|
394
430
|
});
|
|
395
431
|
node.appendChild(avatar.set());
|
|
396
432
|
}
|
|
@@ -401,9 +437,9 @@ class OrgChart {
|
|
|
401
437
|
title.title = title.innerText;
|
|
402
438
|
content.appendChild(title);
|
|
403
439
|
if (row.node.position !== undefined) {
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
content.appendChild(
|
|
440
|
+
const positionText = document.createElement("org_chart_node_position");
|
|
441
|
+
positionText.innerText = String(row.node.position);
|
|
442
|
+
content.appendChild(positionText);
|
|
407
443
|
}
|
|
408
444
|
if (row.node.description !== undefined) {
|
|
409
445
|
const description = document.createElement("org_chart_node_description");
|
|
@@ -414,7 +450,7 @@ class OrgChart {
|
|
|
414
450
|
if (row.children.length > 0) {
|
|
415
451
|
const count = document.createElement("chui_visually_hidden");
|
|
416
452
|
count.classList.add("chui_visually_hidden");
|
|
417
|
-
count.innerText = I18n.t("data.orgChartReports", {count: row.children.length});
|
|
453
|
+
count.innerText = I18n.t("data.orgChartReports", { count: row.children.length });
|
|
418
454
|
content.appendChild(count);
|
|
419
455
|
}
|
|
420
456
|
node.appendChild(content);
|
|
@@ -423,7 +459,10 @@ class OrgChart {
|
|
|
423
459
|
toggle.dataset.expanded = row.expanded ? "true" : "false";
|
|
424
460
|
toggle.dataset.id = String(row.node.id);
|
|
425
461
|
toggle.setAttribute("aria-hidden", "true");
|
|
426
|
-
toggle.innerHTML = new Icon(
|
|
462
|
+
toggle.innerHTML = new Icon(
|
|
463
|
+
row.expanded ? Icons.NAVIGATION.EXPAND_LESS : Icons.NAVIGATION.EXPAND_MORE,
|
|
464
|
+
"14px"
|
|
465
|
+
).getHTML();
|
|
427
466
|
node.appendChild(toggle);
|
|
428
467
|
}
|
|
429
468
|
this.#canvas.appendChild(node);
|
|
@@ -439,8 +478,8 @@ class OrgChart {
|
|
|
439
478
|
const from = this.#positionOf(row.parent, step);
|
|
440
479
|
const to = this.#positionOf(row, step);
|
|
441
480
|
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
442
|
-
const middle = (from.y + this.#
|
|
443
|
-
path.setAttribute("d", `M ${from.x} ${from.y + this.#
|
|
481
|
+
const middle = (from.y + this.#nodeHeight + to.y) / 2;
|
|
482
|
+
path.setAttribute("d", `M ${from.x} ${from.y + this.#nodeHeight} V ${middle} H ${to.x} V ${to.y}`);
|
|
444
483
|
path.setAttribute("class", "org_chart_link");
|
|
445
484
|
path.setAttribute("vector-effect", "non-scaling-stroke");
|
|
446
485
|
this.#links.appendChild(path);
|
|
@@ -472,8 +511,8 @@ class OrgChart {
|
|
|
472
511
|
}
|
|
473
512
|
#emit(row) {
|
|
474
513
|
if (row === undefined) return;
|
|
475
|
-
for (const listener of [...this.#
|
|
476
|
-
if (this.#
|
|
514
|
+
for (const listener of [...this.#clickListeners]) listener(row.node);
|
|
515
|
+
if (this.#onNodeClick !== undefined) this.#onNodeClick(row.node);
|
|
477
516
|
}
|
|
478
517
|
#announce(text = String()) {
|
|
479
518
|
this.#status.innerText = "";
|
|
@@ -539,7 +578,7 @@ class OrgChart {
|
|
|
539
578
|
};
|
|
540
579
|
}
|
|
541
580
|
|
|
542
|
-
exports.OrgChart = OrgChart
|
|
581
|
+
exports.OrgChart = OrgChart;
|
|
543
582
|
|
|
544
583
|
// Описание узла собирает фабрика — как у ContextMenu и SplitButton
|
|
545
|
-
OrgChart.Node = (options = {}) => Object.assign({style: OrgChart.STYLE.DEFAULT}, options);
|
|
584
|
+
OrgChart.Node = (options = {}) => Object.assign({ style: OrgChart.STYLE.DEFAULT }, options);
|
|
@@ -11,7 +11,7 @@ chui_org_chart {
|
|
|
11
11
|
width: -webkit-fill-available;
|
|
12
12
|
max-width: 100%;
|
|
13
13
|
box-sizing: border-box;
|
|
14
|
-
margin: var(--
|
|
14
|
+
margin: var(--block_margin);
|
|
15
15
|
color: var(--text_color);
|
|
16
16
|
font-size: var(--font_default_size);
|
|
17
17
|
text-align: start;
|
|
@@ -184,7 +184,7 @@ org_chart_node chui_avatar {
|
|
|
184
184
|
|
|
185
185
|
org_chart_empty {
|
|
186
186
|
display: block;
|
|
187
|
-
padding: var(--
|
|
187
|
+
padding: var(--block_padding);
|
|
188
188
|
color: var(--text_color_disabled);
|
|
189
189
|
text-align: center;
|
|
190
190
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const {setStyles, optionOr} = require("../../modules/chui_functions");
|
|
2
|
-
const {Icon, Icons} = require("../chui_icons/icons");
|
|
3
|
-
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 { I18n } = require("../../modules/chui_i18n/chui_i18n");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Постраничная навигация: номера страниц, «…» на пропусках и кнопки перехода.
|
|
@@ -25,7 +25,7 @@ const {I18n} = require("../../modules/chui_i18n/chui_i18n");
|
|
|
25
25
|
class Pagination {
|
|
26
26
|
static SIZE = {
|
|
27
27
|
SMALL: "small",
|
|
28
|
-
DEFAULT: "default"
|
|
28
|
+
DEFAULT: "default",
|
|
29
29
|
};
|
|
30
30
|
static #counter = 0;
|
|
31
31
|
|
|
@@ -38,20 +38,22 @@ class Pagination {
|
|
|
38
38
|
#edges = 1;
|
|
39
39
|
#jump = true;
|
|
40
40
|
#listeners = [];
|
|
41
|
-
#
|
|
41
|
+
#onChange = undefined;
|
|
42
42
|
|
|
43
|
-
constructor(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
constructor(
|
|
44
|
+
options = {
|
|
45
|
+
id: String(),
|
|
46
|
+
pages: Number(),
|
|
47
|
+
page: Number(),
|
|
48
|
+
siblings: Number(),
|
|
49
|
+
edges: Number(),
|
|
50
|
+
jump: Boolean(),
|
|
51
|
+
size: String(),
|
|
52
|
+
label: String(),
|
|
53
|
+
onChange: undefined,
|
|
54
|
+
changeEvent: undefined,
|
|
55
|
+
}
|
|
56
|
+
) {
|
|
55
57
|
setStyles(__dirname + "/styles.css", "chUiJS_Pagination");
|
|
56
58
|
Pagination.#counter += 1;
|
|
57
59
|
this.#id = options.id === undefined ? `chui_pagination_${Pagination.#counter}` : options.id;
|
|
@@ -65,7 +67,7 @@ class Pagination {
|
|
|
65
67
|
if (options.jump !== undefined) this.#jump = options.jump === true;
|
|
66
68
|
this.#pages = Pagination.#count(options.pages, 1);
|
|
67
69
|
this.#page = Pagination.#clamp(Pagination.#count(options.page, 1), this.#pages);
|
|
68
|
-
this.#
|
|
70
|
+
this.#onChange = options.onChange;
|
|
69
71
|
if (options.changeEvent !== undefined) this.addChangeListener(options.changeEvent);
|
|
70
72
|
this.#root.appendChild(this.#list);
|
|
71
73
|
this.#render();
|
|
@@ -163,7 +165,7 @@ class Pagination {
|
|
|
163
165
|
// === ВНУТРЕННЕЕ ===
|
|
164
166
|
#notify() {
|
|
165
167
|
for (const listener of [...this.#listeners]) listener(this.#page, this);
|
|
166
|
-
if (this.#
|
|
168
|
+
if (this.#onChange !== undefined) this.#onChange(this.#page, this);
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
// Номера страниц с пропусками: `{gap: true}` — место для «…»
|
|
@@ -182,11 +184,13 @@ class Pagination {
|
|
|
182
184
|
for (let index = this.#page - siblings; index <= this.#page + siblings; index++) {
|
|
183
185
|
if (index >= 1 && index <= this.#pages) numbers.add(index);
|
|
184
186
|
}
|
|
185
|
-
const sorted = [...numbers]
|
|
187
|
+
const sorted = [...numbers]
|
|
188
|
+
.filter((number) => number >= 1 && number <= this.#pages)
|
|
189
|
+
.sort((first, second) => first - second);
|
|
186
190
|
const items = [];
|
|
187
191
|
let previous = 0;
|
|
188
192
|
for (const number of sorted) {
|
|
189
|
-
if (previous !== 0 && number - previous > 1) items.push({gap: true});
|
|
193
|
+
if (previous !== 0 && number - previous > 1) items.push({ gap: true });
|
|
190
194
|
items.push(number);
|
|
191
195
|
previous = number;
|
|
192
196
|
}
|
|
@@ -196,8 +200,23 @@ class Pagination {
|
|
|
196
200
|
#render() {
|
|
197
201
|
const focused = this.#focusedControl();
|
|
198
202
|
this.#list.innerHTML = "";
|
|
199
|
-
if (this.#jump)
|
|
200
|
-
|
|
203
|
+
if (this.#jump)
|
|
204
|
+
this.#list.appendChild(
|
|
205
|
+
this.#arrowButton(
|
|
206
|
+
"first",
|
|
207
|
+
I18n.t("navigation.firstPage"),
|
|
208
|
+
Icons.NAVIGATION.FIRST_PAGE,
|
|
209
|
+
this.#page === 1
|
|
210
|
+
)
|
|
211
|
+
);
|
|
212
|
+
this.#list.appendChild(
|
|
213
|
+
this.#arrowButton(
|
|
214
|
+
"prev",
|
|
215
|
+
I18n.t("navigation.previousPage"),
|
|
216
|
+
Icons.NAVIGATION.CHEVRON_LEFT,
|
|
217
|
+
this.#page === 1
|
|
218
|
+
)
|
|
219
|
+
);
|
|
201
220
|
for (const item of this.#window()) {
|
|
202
221
|
if (item.gap === true) {
|
|
203
222
|
const gap = document.createElement("chui_pagination_gap");
|
|
@@ -209,8 +228,23 @@ class Pagination {
|
|
|
209
228
|
}
|
|
210
229
|
this.#list.appendChild(this.#pageButton(item));
|
|
211
230
|
}
|
|
212
|
-
this.#list.appendChild(
|
|
213
|
-
|
|
231
|
+
this.#list.appendChild(
|
|
232
|
+
this.#arrowButton(
|
|
233
|
+
"next",
|
|
234
|
+
I18n.t("navigation.nextPage"),
|
|
235
|
+
Icons.NAVIGATION.CHEVRON_RIGHT,
|
|
236
|
+
this.#page === this.#pages
|
|
237
|
+
)
|
|
238
|
+
);
|
|
239
|
+
if (this.#jump)
|
|
240
|
+
this.#list.appendChild(
|
|
241
|
+
this.#arrowButton(
|
|
242
|
+
"last",
|
|
243
|
+
I18n.t("navigation.lastPage"),
|
|
244
|
+
Icons.NAVIGATION.LAST_PAGE,
|
|
245
|
+
this.#page === this.#pages
|
|
246
|
+
)
|
|
247
|
+
);
|
|
214
248
|
this.#restoreFocus(focused);
|
|
215
249
|
}
|
|
216
250
|
|
|
@@ -257,14 +291,15 @@ class Pagination {
|
|
|
257
291
|
#focusedControl() {
|
|
258
292
|
const active = document.activeElement;
|
|
259
293
|
if (active === null || active === undefined || !this.#list.contains(active)) return undefined;
|
|
260
|
-
return {role: active.dataset.role, page: active.dataset.page};
|
|
294
|
+
return { role: active.dataset.role, page: active.dataset.page };
|
|
261
295
|
}
|
|
262
296
|
|
|
263
297
|
#restoreFocus(control) {
|
|
264
298
|
if (control === undefined || control.role === undefined) return;
|
|
265
|
-
const selector =
|
|
266
|
-
|
|
267
|
-
|
|
299
|
+
const selector =
|
|
300
|
+
control.role === "page"
|
|
301
|
+
? `button[data-role="page"][data-page="${control.page}"]`
|
|
302
|
+
: `button[data-role="${control.role}"]`;
|
|
268
303
|
const node = this.#list.querySelector(selector);
|
|
269
304
|
// Номер мог уехать в «…» — тогда фокус остаётся там, где окажется ближайший контрол
|
|
270
305
|
if (node !== null) node.focus();
|
|
@@ -282,4 +317,4 @@ class Pagination {
|
|
|
282
317
|
static ICON_SIZE = "16px";
|
|
283
318
|
}
|
|
284
319
|
|
|
285
|
-
exports.Pagination = Pagination
|
|
320
|
+
exports.Pagination = Pagination;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
class Paragraph {
|
|
2
2
|
#Paragraph = document.createElement(`p`);
|
|
3
3
|
constructor(text = String()) {
|
|
4
|
-
require(
|
|
4
|
+
require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_Paragraph");
|
|
5
5
|
this.#Paragraph.innerText = text;
|
|
6
6
|
}
|
|
7
7
|
setText(text = String()) {
|
|
@@ -12,4 +12,4 @@ class Paragraph {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
exports.Paragraph = Paragraph
|
|
15
|
+
exports.Paragraph = Paragraph;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
p {
|
|
2
2
|
height: max-content;
|
|
3
3
|
/* Ширина абзаца — по контейнеру: с max-content длинный текст не переносился,
|
|
4
|
-
а вместе с margin: var(--
|
|
4
|
+
а вместе с margin: var(--block_margin) абзац ещё и смещался вправо за край родителя */
|
|
5
5
|
width: -webkit-fill-available;
|
|
6
6
|
/* Слово шире строки (ссылка, длинное имя) разрывается, а не вылезает за абзац */
|
|
7
7
|
overflow-wrap: break-word;
|
|
8
8
|
color: var(--text_color);
|
|
9
|
-
margin: var(--
|
|
9
|
+
margin: var(--block_margin);
|
|
10
10
|
font-size: var(--font_default_size);
|
|
11
|
-
}
|
|
11
|
+
}
|