chuijs 4.0.3 → 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 +536 -0
- package/framework/appLayout/default/chui_app_layout.js +361 -303
- package/framework/appLayout/default/global_style.css +243 -89
- package/framework/appLayout/default/main_theme_style.css +188 -101
- package/framework/components/chui_accordion/accordion.js +17 -17
- package/framework/components/chui_accordion/styles.css +7 -7
- package/framework/components/chui_action_sheet/action_sheet.js +35 -32
- package/framework/components/chui_action_sheet/styles.css +10 -4
- 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 +4 -4
- package/framework/components/chui_affix/styles.css +5 -0
- package/framework/components/chui_alert/alert.js +11 -5
- package/framework/components/chui_alert/styles.css +7 -0
- package/framework/components/chui_avatar/avatar.js +13 -13
- package/framework/components/chui_avatar/styles.css +1 -1
- package/framework/components/chui_avatar_group/avatar_group.js +4 -4
- package/framework/components/chui_avatar_group/styles.css +1 -1
- package/framework/components/chui_backtop/backtop.js +25 -2
- package/framework/components/chui_backtop/styles.css +21 -0
- package/framework/components/chui_badge/badge.js +15 -15
- 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/styles.css +1 -1
- package/framework/components/chui_button/button.js +24 -28
- package/framework/components/chui_button/styles.css +5 -5
- package/framework/components/chui_calendar/calendar.js +6 -6
- package/framework/components/chui_card/card.js +14 -14
- 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 +73 -51
- package/framework/components/chui_chat/styles.css +18 -7
- package/framework/components/chui_clipboard_history/clipboard_history.js +25 -20
- package/framework/components/chui_clipboard_history/styles.css +10 -8
- package/framework/components/chui_code/code.js +8 -8
- package/framework/components/chui_code/styles.css +2 -2
- package/framework/components/chui_code_editor/code_editor.js +26 -26
- package/framework/components/chui_code_editor/styles.css +3 -3
- package/framework/components/chui_command_palette/command_palette.js +29 -29
- package/framework/components/chui_command_palette/styles.css +5 -5
- package/framework/components/chui_console/console.js +9 -9
- package/framework/components/chui_console/styles.css +5 -2
- package/framework/components/chui_content_block/content_block.js +2 -2
- package/framework/components/chui_context_menu/context_menu.js +162 -54
- package/framework/components/chui_context_menu/styles.css +82 -8
- package/framework/components/chui_custom_element/custom_element.js +11 -11
- package/framework/components/chui_data_grid/data_grid.js +268 -268
- package/framework/components/chui_data_grid/styles.css +14 -14
- package/framework/components/chui_descriptions/styles.css +1 -1
- package/framework/components/chui_details/details.js +12 -12
- package/framework/components/chui_details/styles.css +7 -7
- package/framework/components/chui_diff_viewer/diff_viewer.js +88 -88
- package/framework/components/chui_diff_viewer/styles.css +9 -9
- package/framework/components/chui_divider/divider.js +6 -6
- package/framework/components/chui_divider/styles.css +2 -2
- package/framework/components/chui_drawer/drawer.js +37 -14
- package/framework/components/chui_drawer/styles.css +18 -4
- package/framework/components/chui_drop_zone/drop_zone.js +6 -6
- package/framework/components/chui_drop_zone/styles.css +10 -6
- package/framework/components/chui_fieldset/fieldset.js +6 -6
- package/framework/components/chui_fieldset/styles.css +5 -5
- package/framework/components/chui_file_explorer/file_explorer.js +115 -115
- package/framework/components/chui_file_explorer/styles.css +6 -6
- package/framework/components/chui_form/form.js +11 -11
- package/framework/components/chui_gantt/gantt.js +41 -41
- package/framework/components/chui_gantt/styles.css +5 -5
- package/framework/components/chui_graphs/graphs.js +82 -46
- package/framework/components/chui_graphs/styles.css +26 -5
- package/framework/components/chui_hero/hero.js +63 -20
- package/framework/components/chui_hero/styles.css +176 -7
- package/framework/components/chui_html_block/html_block.js +5 -5
- package/framework/components/chui_html_block/styles.css +1 -1
- package/framework/components/chui_hx/styles.css +2 -2
- package/framework/components/chui_icons/icons.js +7 -7
- package/framework/components/chui_icons/styles.css +2 -1
- package/framework/components/chui_inputs/chui_check_box/styles.css +12 -3
- package/framework/components/chui_inputs/chui_chips/chips.js +92 -31
- package/framework/components/chui_inputs/chui_chips/styles.css +28 -5
- package/framework/components/chui_inputs/chui_color_picker/color_picker.js +20 -15
- package/framework/components/chui_inputs/chui_color_picker/styles.css +7 -7
- package/framework/components/chui_inputs/chui_combo_box/combo_box.js +58 -58
- package/framework/components/chui_inputs/chui_combo_box/styles.css +9 -9
- package/framework/components/chui_inputs/chui_date/date.js +93 -95
- package/framework/components/chui_inputs/chui_date/styles.css +8 -8
- package/framework/components/chui_inputs/chui_date_range/date_range.js +22 -22
- package/framework/components/chui_inputs/chui_date_range/styles.css +3 -3
- package/framework/components/chui_inputs/chui_datetime/datetime.js +12 -12
- package/framework/components/chui_inputs/chui_datetime/styles.css +3 -3
- package/framework/components/chui_inputs/chui_email/email.js +10 -10
- package/framework/components/chui_inputs/chui_email/styles.css +6 -6
- package/framework/components/chui_inputs/chui_file/file.js +8 -8
- package/framework/components/chui_inputs/chui_file/styles.css +12 -9
- package/framework/components/chui_inputs/chui_hotkey/hotkey.js +39 -39
- package/framework/components/chui_inputs/chui_hotkey/styles.css +6 -6
- package/framework/components/chui_inputs/chui_masked/masked.js +44 -44
- package/framework/components/chui_inputs/chui_masked/styles.css +5 -5
- package/framework/components/chui_inputs/chui_mention/mention.js +13 -13
- package/framework/components/chui_inputs/chui_mention/styles.css +14 -8
- package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +147 -137
- package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +14 -8
- package/framework/components/chui_inputs/chui_number/number.js +42 -45
- package/framework/components/chui_inputs/chui_number/styles.css +6 -6
- package/framework/components/chui_inputs/chui_otp/otp.js +32 -32
- package/framework/components/chui_inputs/chui_otp/styles.css +5 -5
- package/framework/components/chui_inputs/chui_password/password.js +30 -36
- package/framework/components/chui_inputs/chui_password/styles.css +7 -7
- package/framework/components/chui_inputs/chui_radio_button/styles.css +2 -2
- package/framework/components/chui_inputs/chui_rating/rating.js +28 -28
- package/framework/components/chui_inputs/chui_rating/styles.css +3 -3
- package/framework/components/chui_inputs/chui_select_box/select_box.js +54 -54
- package/framework/components/chui_inputs/chui_select_box/styles.css +10 -10
- package/framework/components/chui_inputs/chui_slider/slider.js +14 -14
- package/framework/components/chui_inputs/chui_slider/styles.css +5 -4
- package/framework/components/chui_inputs/chui_text/styles.css +7 -7
- package/framework/components/chui_inputs/chui_text/text.js +13 -17
- package/framework/components/chui_inputs/chui_text_area/styles.css +8 -8
- package/framework/components/chui_inputs/chui_text_area/text_area.js +23 -23
- package/framework/components/chui_inputs/chui_time/styles.css +13 -17
- package/framework/components/chui_inputs/chui_time/time.js +35 -24
- package/framework/components/chui_inputs/chui_toggle/styles.css +10 -3
- package/framework/components/chui_inputs/chui_toggle/toggle.js +16 -16
- package/framework/components/chui_json_editor/json_editor.js +87 -87
- package/framework/components/chui_json_editor/styles.css +5 -5
- package/framework/components/chui_json_viewer/json_viewer.js +80 -80
- package/framework/components/chui_json_viewer/styles.css +6 -6
- package/framework/components/chui_kanban/kanban.js +27 -27
- package/framework/components/chui_kanban/styles.css +8 -4
- package/framework/components/chui_kbd/styles.css +1 -1
- package/framework/components/chui_label/label.js +17 -17
- package/framework/components/chui_label/styles.css +1 -1
- package/framework/components/chui_link/link.js +9 -9
- package/framework/components/chui_link/styles.css +11 -4
- package/framework/components/chui_list/list.js +11 -11
- package/framework/components/chui_list/styles.css +2 -2
- package/framework/components/chui_markdown_editor/markdown_editor.js +66 -66
- package/framework/components/chui_markdown_editor/styles.css +5 -5
- package/framework/components/chui_media/audio.js +240 -246
- package/framework/components/chui_media/audio_styles.css +41 -23
- package/framework/components/chui_media/image.js +49 -46
- package/framework/components/chui_media/image_compare.js +35 -35
- package/framework/components/chui_media/image_compare_styles.css +5 -5
- package/framework/components/chui_media/image_styles.css +1 -1
- package/framework/components/chui_media/video.js +148 -148
- package/framework/components/chui_media/video_styles.css +27 -11
- package/framework/components/chui_menu_bar/menu_bar.js +54 -54
- package/framework/components/chui_menu_bar/styles.css +10 -10
- 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 +37 -13
- package/framework/components/chui_notification/notification.js +76 -54
- package/framework/components/chui_notification/notification_download.js +26 -81
- package/framework/components/chui_notification/notification_download_card.js +115 -0
- package/framework/components/chui_notification/notification_download_progress.css +2 -2
- package/framework/components/chui_notification/notification_download_progress.js +70 -108
- package/framework/components/chui_notification/notification_update.js +31 -31
- package/framework/components/chui_notification/status_plate.css +3 -3
- package/framework/components/chui_notification/styles.css +6 -1
- package/framework/components/chui_notification/styles_download.css +1 -1
- package/framework/components/chui_notification/styles_update.css +2 -2
- package/framework/components/chui_org_chart/org_chart.js +29 -29
- package/framework/components/chui_org_chart/styles.css +2 -2
- package/framework/components/chui_pagination/pagination.js +3 -3
- package/framework/components/chui_pagination/styles.css +1 -1
- package/framework/components/chui_paragraph/styles.css +2 -2
- package/framework/components/chui_popover/popover.js +29 -23
- package/framework/components/chui_popover/styles.css +1 -1
- package/framework/components/chui_popups/popups.js +124 -124
- package/framework/components/chui_popups/styles.css +5 -5
- package/framework/components/chui_print_button/print_button.js +15 -10
- package/framework/components/chui_progress_bar/progress_bar.js +34 -12
- package/framework/components/chui_progress_bar/styles.css +4 -4
- package/framework/components/chui_progress_ring/progress_ring.js +15 -15
- package/framework/components/chui_progress_ring/styles.css +1 -1
- package/framework/components/chui_qrcode/qrcode.js +12 -12
- package/framework/components/chui_query_builder/query_builder.js +46 -46
- package/framework/components/chui_query_builder/styles.css +4 -4
- package/framework/components/chui_radio_group/styles.css +1 -1
- package/framework/components/chui_result/result.js +15 -15
- package/framework/components/chui_result/styles.css +3 -3
- package/framework/components/chui_scheduler/scheduler.js +74 -74
- package/framework/components/chui_scheduler/styles.css +5 -5
- 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 +63 -6
- package/framework/components/chui_segmented_control/styles.css +32 -6
- package/framework/components/chui_settings/settings.js +45 -46
- package/framework/components/chui_settings/styles.css +4 -4
- package/framework/components/chui_shortcut_help/shortcut_help.js +32 -34
- package/framework/components/chui_sidebar_nav/sidebar_nav.js +98 -29
- package/framework/components/chui_sidebar_nav/styles.css +9 -3
- package/framework/components/chui_slideshow/slideshow.js +85 -85
- package/framework/components/chui_slideshow/styles.css +6 -6
- package/framework/components/chui_spinner/spinner.js +10 -10
- package/framework/components/chui_split_button/split_button.js +30 -12
- package/framework/components/chui_split_button/styles.css +21 -5
- package/framework/components/chui_splitter/splitter.js +11 -11
- package/framework/components/chui_splitter/styles.css +2 -2
- package/framework/components/chui_statistic/statistic.js +47 -47
- package/framework/components/chui_status_bar/styles.css +2 -2
- package/framework/components/chui_stepper/stepper.js +202 -31
- package/framework/components/chui_stepper/styles.css +79 -14
- package/framework/components/chui_sticky_bar/sticky_bar.js +44 -13
- package/framework/components/chui_sticky_bar/styles.css +10 -8
- package/framework/components/chui_tabs/chui_tabs.js +74 -26
- package/framework/components/chui_tabs/styles.css +40 -12
- package/framework/components/chui_text_editor/styles.css +7 -7
- package/framework/components/chui_text_editor/text_editor.js +56 -56
- package/framework/components/chui_text_editor/text_editor_panel.js +173 -174
- package/framework/components/chui_theme_toggle/theme_toggle.js +21 -5
- package/framework/components/chui_timeline/styles.css +3 -1
- package/framework/components/chui_toast_queue/styles.css +11 -11
- package/framework/components/chui_toast_queue/toast_queue.js +30 -27
- package/framework/components/chui_toolbar/styles.css +2 -2
- package/framework/components/chui_tooltip/styles.css +2 -2
- package/framework/components/chui_tooltip/tooltip.js +3 -3
- package/framework/components/chui_tour/styles.css +8 -8
- package/framework/components/chui_tour/tour.js +72 -72
- package/framework/components/chui_transfer/styles.css +6 -6
- package/framework/components/chui_transfer/transfer.js +93 -106
- package/framework/components/chui_tree_table/styles.css +4 -4
- package/framework/components/chui_tree_table/tree_table.js +45 -45
- package/framework/components/chui_tree_view/styles.css +10 -8
- package/framework/components/chui_tree_view/tree_view.js +185 -183
- 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 +17 -17
- package/framework/components/chui_webview/webview.js +9 -9
- 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 +78 -79
- package/framework/modules/chui_animations/animations.js +77 -15
- package/framework/modules/chui_animations/motion.js +120 -0
- package/framework/modules/chui_animations/styles.css +36 -3
- package/framework/modules/chui_functions.js +31 -27
- package/framework/modules/chui_highlight/styles.css +13 -10
- package/framework/modules/chui_i18n/chui_i18n.js +3 -3
- package/framework/modules/chui_i18n/locales/feedback.js +62 -0
- package/framework/modules/chui_i18n/locales/navigation.js +4 -0
- package/framework/modules/chui_json/chui_json.js +2 -2
- package/framework/modules/chui_logger/chui_logger.js +23 -8
- package/framework/modules/chui_page/page.js +10 -10
- package/framework/modules/chui_palette/palette.js +61 -0
- package/framework/modules/chui_qr/chui_qr.js +23 -23
- package/framework/modules/chui_scrollbar/chui_scrollbar.js +45 -45
- package/framework/modules/chui_scrollbar/styles.css +3 -3
- package/framework/modules/chui_services/chui_services.js +8 -8
- package/framework/modules/chui_services/desktop.js +77 -71
- package/framework/modules/chui_sortable/chui_sortable.js +17 -17
- package/framework/modules/chui_validate/chui_validate.js +3 -3
- package/framework/tray_bar/chui_menu_items.js +2 -2
- package/index.d.ts +266 -34
- package/index.js +20 -1168
- package/package.json +6 -4
- package/framework/components/telegram_bot/chui_telegram_bot.js +0 -191
|
@@ -43,11 +43,13 @@ class Drawer {
|
|
|
43
43
|
#width = undefined;
|
|
44
44
|
#height = undefined;
|
|
45
45
|
#closable = true;
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
46
|
+
#closeOutsideClick = false;
|
|
47
|
+
#headerBuilt = false;
|
|
48
|
+
#footerBuilt = false;
|
|
49
|
+
// Место, откуда слой открыли: туда он вернётся после ухода
|
|
50
|
+
#origin = undefined;
|
|
49
51
|
// Имя слоя берётся из узла заголовка — тогда setTitle() ничего не переключает
|
|
50
|
-
#
|
|
52
|
+
#labelledByTitle = false;
|
|
51
53
|
#a11y = undefined;
|
|
52
54
|
isOpen = false;
|
|
53
55
|
|
|
@@ -68,7 +70,7 @@ class Drawer {
|
|
|
68
70
|
this.#id = options.id === undefined ? require("randomstring").generate() : options.id;
|
|
69
71
|
this.#drawer.id = this.#id;
|
|
70
72
|
this.#closable = options.closable === undefined ? true : options.closable;
|
|
71
|
-
this.#
|
|
73
|
+
this.#closeOutsideClick = options.closeOutSideClick === true;
|
|
72
74
|
this.#width = options.width;
|
|
73
75
|
this.#height = options.height;
|
|
74
76
|
this.#panel.appendChild(this.#body);
|
|
@@ -82,12 +84,12 @@ class Drawer {
|
|
|
82
84
|
// Пустая заготовка `title: String()` из описания опций заголовком не считается: иначе
|
|
83
85
|
// слой ссылался бы на пустой узел и оставался без имени
|
|
84
86
|
const title = optionOr(options.title, undefined);
|
|
85
|
-
this.#
|
|
87
|
+
this.#labelledByTitle = title !== undefined;
|
|
86
88
|
if (title !== undefined) this.setTitle(title);
|
|
87
89
|
this.#a11y = new OverlayA11y(this.#drawer, {
|
|
88
90
|
role: "dialog",
|
|
89
|
-
labelNode: this.#
|
|
90
|
-
label: this.#
|
|
91
|
+
labelNode: this.#labelledByTitle ? this.#title : undefined,
|
|
92
|
+
label: this.#labelledByTitle ? undefined : optionOr(options.label, I18n.t("feedback.drawer")),
|
|
91
93
|
onEscape: () => this.close(),
|
|
92
94
|
});
|
|
93
95
|
if (this.#closable) this.#addCloseButton();
|
|
@@ -123,7 +125,7 @@ class Drawer {
|
|
|
123
125
|
if (this.#title.parentElement === null) this.#header.prepend(this.#title);
|
|
124
126
|
this.#title.innerText = title;
|
|
125
127
|
// Слой строился без заголовка: имя задавалось через aria-label — обновляем его
|
|
126
|
-
if (!this.#
|
|
128
|
+
if (!this.#labelledByTitle) {
|
|
127
129
|
this.#a11y.setLabel(title);
|
|
128
130
|
return this;
|
|
129
131
|
}
|
|
@@ -187,7 +189,14 @@ class Drawer {
|
|
|
187
189
|
open() {
|
|
188
190
|
if (this.isOpen) return this;
|
|
189
191
|
this.isOpen = true;
|
|
192
|
+
// Занавес ставится в body — рядом с шапкой и остальными слоями окна. У него
|
|
193
|
+
// `backdrop-filter` и `z-index`, а внутри карточки Chromium собирает такой слой
|
|
194
|
+
// отдельной поверхностью и рисует её под слоями из body: шапка приложения срезала
|
|
195
|
+
// верх панели вместе с заголовком и кнопкой закрытия
|
|
196
|
+
this.#origin = this.#drawer.parentElement;
|
|
197
|
+
if (this.#drawer.parentElement !== document.body) document.body.appendChild(this.#drawer);
|
|
190
198
|
this.#panel.style.animationName = `drawer_${this.#side}_in`;
|
|
199
|
+
this.#panel.dataset.motion = "enter";
|
|
191
200
|
new Animation(this.#drawer).fadeIn();
|
|
192
201
|
this.#a11y.open();
|
|
193
202
|
return this;
|
|
@@ -204,6 +213,7 @@ class Drawer {
|
|
|
204
213
|
this.isOpen = false;
|
|
205
214
|
this.#a11y.close();
|
|
206
215
|
this.#panel.style.animationName = `drawer_${this.#side}_out`;
|
|
216
|
+
this.#panel.dataset.motion = "exit";
|
|
207
217
|
new Animation(this.#drawer).fadeOut();
|
|
208
218
|
return this;
|
|
209
219
|
}
|
|
@@ -223,14 +233,14 @@ class Drawer {
|
|
|
223
233
|
}
|
|
224
234
|
|
|
225
235
|
#ensureHeader() {
|
|
226
|
-
if (this.#
|
|
227
|
-
this.#
|
|
236
|
+
if (this.#headerBuilt) return;
|
|
237
|
+
this.#headerBuilt = true;
|
|
228
238
|
this.#panel.prepend(this.#header);
|
|
229
239
|
}
|
|
230
240
|
|
|
231
241
|
#ensureFooter() {
|
|
232
|
-
if (this.#
|
|
233
|
-
this.#
|
|
242
|
+
if (this.#footerBuilt) return;
|
|
243
|
+
this.#footerBuilt = true;
|
|
234
244
|
this.#panel.appendChild(this.#footer);
|
|
235
245
|
}
|
|
236
246
|
|
|
@@ -261,7 +271,7 @@ class Drawer {
|
|
|
261
271
|
|
|
262
272
|
// Клик по занавесу (но не по панели) закрывает панель, если это разрешено опцией
|
|
263
273
|
#onDrawerClick = (event) => {
|
|
264
|
-
if (!this.#
|
|
274
|
+
if (!this.#closeOutsideClick || event.target !== this.#drawer) return;
|
|
265
275
|
this.close();
|
|
266
276
|
};
|
|
267
277
|
|
|
@@ -270,7 +280,20 @@ class Drawer {
|
|
|
270
280
|
#onPanelAnimationEnd = (event) => {
|
|
271
281
|
if (event.target !== this.#panel) return;
|
|
272
282
|
this.#panel.style.animationName = "";
|
|
283
|
+
if (this.isOpen) return;
|
|
284
|
+
// Уход доигран: слой возвращается туда, откуда открывался. Кадр откладывается на
|
|
285
|
+
// следующий кадр — перенос узла в момент `animationend` перезапустил бы уход
|
|
286
|
+
requestAnimationFrame(() => this.#returnHome());
|
|
273
287
|
};
|
|
288
|
+
|
|
289
|
+
/** Вернуть слой на прежнее место, если оно ещё в документе */
|
|
290
|
+
#returnHome() {
|
|
291
|
+
if (this.isOpen) return;
|
|
292
|
+
const origin = this.#origin;
|
|
293
|
+
if (origin === undefined || origin === null || origin === document.body) return;
|
|
294
|
+
if (origin.isConnected === false) return;
|
|
295
|
+
origin.appendChild(this.#drawer);
|
|
296
|
+
}
|
|
274
297
|
}
|
|
275
298
|
|
|
276
299
|
exports.Drawer = Drawer;
|
|
@@ -25,6 +25,20 @@ drawer_panel {
|
|
|
25
25
|
backdrop-filter: var(--global_blur);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/* Крупная поверхность выезжает медленнее базового движения, а уходит быстро: вид движения
|
|
29
|
+
ставит drawer.js, а длительность и кривая — здесь, иначе панель догоняла бы мелкие всплытия */
|
|
30
|
+
drawer_panel[data-motion="enter"] {
|
|
31
|
+
animation-duration: var(--motion_slow);
|
|
32
|
+
animation-timing-function: var(--motion_ease);
|
|
33
|
+
animation-fill-mode: both;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
drawer_panel[data-motion="exit"] {
|
|
37
|
+
animation-duration: var(--motion_fast);
|
|
38
|
+
animation-timing-function: var(--motion_ease);
|
|
39
|
+
animation-fill-mode: both;
|
|
40
|
+
}
|
|
41
|
+
|
|
28
42
|
/* Сторона панели. Радиус только на внутренних углах — панель «выходит» из-за края окна */
|
|
29
43
|
chui_drawer[data-side="right"] > drawer_panel {
|
|
30
44
|
inset-inline-end: 0;
|
|
@@ -132,7 +146,7 @@ drawer_header {
|
|
|
132
146
|
flex-direction: row;
|
|
133
147
|
align-items: center;
|
|
134
148
|
justify-content: space-between;
|
|
135
|
-
gap: var(--
|
|
149
|
+
gap: var(--block_margin);
|
|
136
150
|
padding: var(--control_padding);
|
|
137
151
|
border-bottom: 1px solid var(--border_color);
|
|
138
152
|
}
|
|
@@ -142,7 +156,7 @@ drawer_title {
|
|
|
142
156
|
flex: 1;
|
|
143
157
|
font-size: var(--font_default_size);
|
|
144
158
|
font-weight: 500;
|
|
145
|
-
padding: var(--
|
|
159
|
+
padding: var(--block_margin);
|
|
146
160
|
text-align: start;
|
|
147
161
|
}
|
|
148
162
|
|
|
@@ -171,7 +185,7 @@ drawer_close:focus-visible {
|
|
|
171
185
|
drawer_body {
|
|
172
186
|
display: flex;
|
|
173
187
|
flex-direction: column;
|
|
174
|
-
gap: var(--
|
|
188
|
+
gap: var(--block_margin);
|
|
175
189
|
flex: 1;
|
|
176
190
|
padding: var(--control_padding);
|
|
177
191
|
overflow: auto;
|
|
@@ -182,7 +196,7 @@ drawer_footer {
|
|
|
182
196
|
flex-direction: row;
|
|
183
197
|
align-items: center;
|
|
184
198
|
justify-content: flex-end;
|
|
185
|
-
gap: var(--
|
|
199
|
+
gap: var(--block_margin);
|
|
186
200
|
padding: var(--control_padding);
|
|
187
201
|
border-top: 1px solid var(--border_color);
|
|
188
202
|
}
|
|
@@ -44,8 +44,8 @@ class DropZone {
|
|
|
44
44
|
#label = undefined;
|
|
45
45
|
// Глубина входа: dragenter/dragleave приходят с дочерних узлов и гасили бы подсветку
|
|
46
46
|
#depth = 0;
|
|
47
|
-
#
|
|
48
|
-
#
|
|
47
|
+
#onDrop = undefined;
|
|
48
|
+
#onFiles = undefined;
|
|
49
49
|
#files = [];
|
|
50
50
|
|
|
51
51
|
constructor(
|
|
@@ -68,8 +68,8 @@ class DropZone {
|
|
|
68
68
|
this.#root.id = this.#id;
|
|
69
69
|
this.#accept = options.accept === undefined || options.accept.length === 0 ? undefined : options.accept;
|
|
70
70
|
this.#multiple = options.multiple !== false;
|
|
71
|
-
this.#
|
|
72
|
-
this.#
|
|
71
|
+
this.#onDrop = options.onDrop;
|
|
72
|
+
this.#onFiles = options.onFiles;
|
|
73
73
|
// Пустая опция — «не задана»: `#applyLabel` тогда берёт подпись из заголовка
|
|
74
74
|
this.#label = optionOr(options.label, undefined);
|
|
75
75
|
this.#root.setAttribute("role", "button");
|
|
@@ -238,7 +238,7 @@ class DropZone {
|
|
|
238
238
|
? ""
|
|
239
239
|
: I18n.t("forms.dropZoneAccepted", { count: this.#files.length })
|
|
240
240
|
: I18n.t("forms.dropZoneRejected", { count: rejected });
|
|
241
|
-
if (this.#
|
|
241
|
+
if (this.#onFiles !== undefined) this.#onFiles(this.getFiles());
|
|
242
242
|
return rejected;
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -255,7 +255,7 @@ class DropZone {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
#emit(payload = Object()) {
|
|
258
|
-
if (this.#
|
|
258
|
+
if (this.#onDrop !== undefined) this.#onDrop(payload);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
#setActive(active = Boolean()) {
|
|
@@ -7,18 +7,18 @@ chui_drop_zone {
|
|
|
7
7
|
gap: 6px;
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
padding: 20px;
|
|
10
|
-
margin: var(--
|
|
10
|
+
margin: var(--block_margin);
|
|
11
11
|
width: -webkit-fill-available;
|
|
12
12
|
text-align: center;
|
|
13
13
|
color: var(--text_color);
|
|
14
14
|
font-size: var(--font_default_size);
|
|
15
15
|
background: var(--element_background_2);
|
|
16
16
|
border: 1px dashed var(--border_color);
|
|
17
|
-
border-radius: var(--
|
|
17
|
+
border-radius: var(--radius_sm);
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
outline: none;
|
|
20
|
-
/* Свой переход не нужен: фон и рамку
|
|
21
|
-
|
|
20
|
+
/* Свой переход не нужен: фон и рамку ведёт общее правило `* { transition }` одним
|
|
21
|
+
видом движения — своё время ломало бы общий ритм */
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
chui_drop_zone:focus-visible {
|
|
@@ -27,10 +27,14 @@ chui_drop_zone:focus-visible {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
chui_drop_zone.drop_zone_active {
|
|
30
|
-
background: var(--
|
|
30
|
+
background: var(--blue_prime_background_tint_strong);
|
|
31
31
|
border-color: var(--blue_prime_background);
|
|
32
32
|
border-style: solid;
|
|
33
33
|
color: var(--text_color_hover);
|
|
34
|
+
/* Приём файла читается подъёмом: зона идёт навстречу перетаскиваемому, а не только
|
|
35
|
+
меняет цвет — это ответ на жест, а не смена состояния */
|
|
36
|
+
transform: scale(1.01);
|
|
37
|
+
box-shadow: var(--box_shadow_drop);
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
chui_drop_zone.drop_zone_disabled {
|
|
@@ -60,7 +64,7 @@ drop_zone_description {
|
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
chui_drop_zone.drop_zone_active drop_zone_description {
|
|
63
|
-
color: var(--
|
|
67
|
+
color: var(--text_color_hover_disabled);
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
/* Скрытие идёт атрибутом hidden: авторский display перебил бы UA-правило [hidden] */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class FieldSet {
|
|
2
|
-
#
|
|
2
|
+
#chuiFieldset = document.createElement("chui_fieldset");
|
|
3
3
|
#fieldset = document.createElement("fieldset");
|
|
4
4
|
#legend = document.createElement("legend");
|
|
5
5
|
constructor(
|
|
@@ -28,7 +28,7 @@ class FieldSet {
|
|
|
28
28
|
// Установка стилей
|
|
29
29
|
if (options.style !== undefined) {
|
|
30
30
|
// Размер
|
|
31
|
-
if (options.style.width !== undefined) this.#
|
|
31
|
+
if (options.style.width !== undefined) this.#chuiFieldset.style.width = options.style.width;
|
|
32
32
|
if (options.style.height !== undefined) this.#fieldset.style.height = options.style.height;
|
|
33
33
|
// Расположение
|
|
34
34
|
if (options.style.direction !== undefined) this.#fieldset.style.flexDirection = options.style.direction;
|
|
@@ -38,9 +38,9 @@ class FieldSet {
|
|
|
38
38
|
}
|
|
39
39
|
//
|
|
40
40
|
this.#fieldset.appendChild(this.#legend);
|
|
41
|
-
this.#
|
|
41
|
+
this.#chuiFieldset.appendChild(this.#fieldset);
|
|
42
42
|
if (Array.isArray(options.components) && options.components.length !== 0) {
|
|
43
|
-
for (
|
|
43
|
+
for (const component of options.components) this.#fieldset.appendChild(component.set());
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
getId() {
|
|
@@ -53,10 +53,10 @@ class FieldSet {
|
|
|
53
53
|
return (this.#legend.innerText = text);
|
|
54
54
|
}
|
|
55
55
|
add(...components) {
|
|
56
|
-
for (
|
|
56
|
+
for (const component of components) this.#fieldset.appendChild(component.set());
|
|
57
57
|
}
|
|
58
58
|
set() {
|
|
59
|
-
return this.#
|
|
59
|
+
return this.#chuiFieldset;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
chui_fieldset {
|
|
2
2
|
height: max-content;
|
|
3
3
|
width: max-content;
|
|
4
|
-
border-radius: var(--
|
|
5
|
-
margin: var(--
|
|
4
|
+
border-radius: var(--radius_sm);
|
|
5
|
+
margin: var(--block_margin);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
fieldset {
|
|
9
9
|
height: -webkit-fill-available;
|
|
10
10
|
width: -webkit-fill-available;
|
|
11
11
|
border: none;
|
|
12
|
-
border-radius: var(--
|
|
12
|
+
border-radius: var(--radius_sm);
|
|
13
13
|
padding: 0 10px 10px;
|
|
14
14
|
display: flex;
|
|
15
15
|
}
|
|
@@ -22,6 +22,6 @@ legend {
|
|
|
22
22
|
font-size: var(--font_default_size);
|
|
23
23
|
font-weight: 500;
|
|
24
24
|
border: none;
|
|
25
|
-
border-radius: var(--
|
|
26
|
-
margin-inline-start: var(--
|
|
25
|
+
border-radius: var(--radius_sm);
|
|
26
|
+
margin-inline-start: var(--block_margin);
|
|
27
27
|
}
|