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
|
@@ -5,12 +5,12 @@ const { I18n } = require("../../../modules/chui_i18n/chui_i18n");
|
|
|
5
5
|
const { Validate } = require("../../../modules/chui_validate/chui_validate");
|
|
6
6
|
|
|
7
7
|
class NumberInput {
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
8
|
+
#chuiNumberInput = document.createElement("chui_number_input");
|
|
9
|
+
#numberMain = document.createElement("number_main");
|
|
10
|
+
#numberButtonMinus = document.createElement("number_button_minus");
|
|
11
|
+
#numberButtonPlus = document.createElement("number_button_plus");
|
|
12
|
+
#numberButtonMinusDisabled = document.createElement("number_button_minus");
|
|
13
|
+
#numberButtonPlusDisabled = document.createElement("number_button_plus");
|
|
14
14
|
#title = undefined;
|
|
15
15
|
#id = require("randomstring").generate();
|
|
16
16
|
#input = document.createElement("input");
|
|
@@ -20,27 +20,24 @@ class NumberInput {
|
|
|
20
20
|
this.#title = options.title;
|
|
21
21
|
|
|
22
22
|
// Кнопки «плюс» и «минус» — у правого и левого края поля (позицию держит CSS)
|
|
23
|
-
this.#
|
|
24
|
-
this.#
|
|
25
|
-
this.#
|
|
26
|
-
this.#
|
|
23
|
+
this.#numberButtonPlus.className = "number_buttons number_buttons_plus";
|
|
24
|
+
this.#numberButtonPlus.innerHTML = this.#iconHTML(Icons.CONTENT.ADD, "var(--blue_prime_background)");
|
|
25
|
+
this.#numberButtonMinus.className = "number_buttons number_buttons_minus";
|
|
26
|
+
this.#numberButtonMinus.innerHTML = this.#iconHTML(Icons.CONTENT.REMOVE, "var(--blue_prime_background)");
|
|
27
27
|
// Кнопки — не нативные: делаем их доступными с клавиатуры и даём имена (глиф в дерево доступности не идёт)
|
|
28
|
-
makeKeyboardButton(this.#
|
|
29
|
-
makeKeyboardButton(this.#
|
|
30
|
-
this.#
|
|
31
|
-
this.#
|
|
28
|
+
makeKeyboardButton(this.#numberButtonMinus);
|
|
29
|
+
makeKeyboardButton(this.#numberButtonPlus);
|
|
30
|
+
this.#numberButtonMinus.setAttribute("aria-label", I18n.t("forms.numberDecrease"));
|
|
31
|
+
this.#numberButtonPlus.setAttribute("aria-label", I18n.t("forms.numberIncrease"));
|
|
32
32
|
|
|
33
33
|
// Выключенные кнопки: только вид, действий нет — скринридеру их не отдаём.
|
|
34
34
|
// Курсор берётся наследованием от корня `.number_main_disabled`
|
|
35
|
-
this.#
|
|
36
|
-
this.#
|
|
37
|
-
this.#
|
|
38
|
-
this.#
|
|
39
|
-
this.#
|
|
40
|
-
|
|
41
|
-
"var(--text_color_disabled)"
|
|
42
|
-
);
|
|
43
|
-
this.#number_button_minus_disabled.setAttribute("aria-hidden", "true");
|
|
35
|
+
this.#numberButtonPlusDisabled.className = "number_buttons number_buttons_plus";
|
|
36
|
+
this.#numberButtonPlusDisabled.innerHTML = this.#iconHTML(Icons.CONTENT.ADD, "var(--text_color_disabled)");
|
|
37
|
+
this.#numberButtonPlusDisabled.setAttribute("aria-hidden", "true");
|
|
38
|
+
this.#numberButtonMinusDisabled.className = "number_buttons number_buttons_minus";
|
|
39
|
+
this.#numberButtonMinusDisabled.innerHTML = this.#iconHTML(Icons.CONTENT.REMOVE, "var(--text_color_disabled)");
|
|
40
|
+
this.#numberButtonMinusDisabled.setAttribute("aria-hidden", "true");
|
|
44
41
|
//
|
|
45
42
|
|
|
46
43
|
this.#input.type = "number";
|
|
@@ -50,28 +47,28 @@ class NumberInput {
|
|
|
50
47
|
if (options.name !== undefined) this.#input.name = options.name;
|
|
51
48
|
if (options.required !== undefined) this.#input.required = options.required;
|
|
52
49
|
// Валидация и показ ошибки: min/max/required и другие правила из options
|
|
53
|
-
Validate.installField(this, options, this.#
|
|
50
|
+
Validate.installField(this, options, this.#numberMain, undefined, () => this.#input.value);
|
|
54
51
|
if (options.title !== undefined) {
|
|
55
52
|
this.#label.innerText = options.title;
|
|
56
53
|
this.#label.classList.add("number_label");
|
|
57
54
|
this.#label.setAttribute("for", this.#id);
|
|
58
|
-
this.#
|
|
55
|
+
this.#chuiNumberInput.appendChild(this.#label);
|
|
59
56
|
}
|
|
60
|
-
if (options.width !== undefined) this.#
|
|
57
|
+
if (options.width !== undefined) this.#chuiNumberInput.style.width = options.width;
|
|
61
58
|
// Рамку с кольцом при фокусе рисует общее правило темы (`number_main:hover`,
|
|
62
59
|
// `:focus-within`), а не компонент: прежде он ставил то же самое инлайном,
|
|
63
60
|
// а на `blur` снимал весь атрибут `style`
|
|
64
61
|
|
|
65
|
-
this.#
|
|
66
|
-
this.#
|
|
67
|
-
this.#
|
|
68
|
-
this.#
|
|
62
|
+
this.#numberMain.appendChild(this.#numberButtonMinus);
|
|
63
|
+
this.#numberMain.appendChild(this.#input);
|
|
64
|
+
this.#numberMain.appendChild(this.#numberButtonPlus);
|
|
65
|
+
this.#chuiNumberInput.appendChild(this.#numberMain);
|
|
69
66
|
|
|
70
|
-
this.#
|
|
67
|
+
this.#numberButtonPlus.addEventListener("mousedown", (event) => {
|
|
71
68
|
event.preventDefault();
|
|
72
69
|
return false;
|
|
73
70
|
});
|
|
74
|
-
this.#
|
|
71
|
+
this.#numberButtonMinus.addEventListener("mousedown", (event) => {
|
|
75
72
|
event.preventDefault();
|
|
76
73
|
return false;
|
|
77
74
|
});
|
|
@@ -79,12 +76,12 @@ class NumberInput {
|
|
|
79
76
|
// Клавиатура: фокус остаётся на кнопке (можно нажимать подряд), мышь — уводит в поле
|
|
80
77
|
// Свои кнопки меняют значение программно, поэтому событие шлём сами: иначе о правке
|
|
81
78
|
// не узнали бы ни слушатели, ни составные компоненты
|
|
82
|
-
this.#
|
|
79
|
+
this.#numberButtonPlus.addEventListener("click", (event) => {
|
|
83
80
|
if (event.detail > 0) this.#input.focus();
|
|
84
81
|
this.#input.value++;
|
|
85
82
|
this.#input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
86
83
|
});
|
|
87
|
-
this.#
|
|
84
|
+
this.#numberButtonMinus.addEventListener("click", (event) => {
|
|
88
85
|
if (event.detail > 0) this.#input.focus();
|
|
89
86
|
this.#input.value--;
|
|
90
87
|
this.#input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
@@ -117,25 +114,25 @@ class NumberInput {
|
|
|
117
114
|
setDisabled(boolean = Boolean()) {
|
|
118
115
|
this.#input.disabled = boolean;
|
|
119
116
|
if (boolean) {
|
|
120
|
-
this.#
|
|
117
|
+
this.#numberMain.classList.add("number_main_disabled");
|
|
121
118
|
this.#input.className = "number_input_disabled";
|
|
122
119
|
this.#label.className = "number_label_disabled";
|
|
123
|
-
this.#
|
|
124
|
-
this.#
|
|
125
|
-
this.#
|
|
126
|
-
this.#
|
|
120
|
+
this.#numberButtonMinus.remove();
|
|
121
|
+
this.#numberButtonPlus.remove();
|
|
122
|
+
this.#numberMain.appendChild(this.#numberButtonMinusDisabled);
|
|
123
|
+
this.#numberMain.appendChild(this.#numberButtonPlusDisabled);
|
|
127
124
|
} else {
|
|
128
|
-
this.#
|
|
125
|
+
this.#numberMain.classList.remove("number_main_disabled");
|
|
129
126
|
this.#input.className = "number_input";
|
|
130
127
|
this.#label.className = "number_label";
|
|
131
|
-
this.#
|
|
132
|
-
this.#
|
|
133
|
-
this.#
|
|
134
|
-
this.#
|
|
128
|
+
this.#numberButtonMinusDisabled.remove();
|
|
129
|
+
this.#numberButtonPlusDisabled.remove();
|
|
130
|
+
this.#numberMain.appendChild(this.#numberButtonMinus);
|
|
131
|
+
this.#numberMain.appendChild(this.#numberButtonPlus);
|
|
135
132
|
}
|
|
136
133
|
}
|
|
137
134
|
set() {
|
|
138
|
-
return this.#
|
|
135
|
+
return this.#chuiNumberInput;
|
|
139
136
|
}
|
|
140
137
|
}
|
|
141
138
|
|
|
@@ -4,12 +4,12 @@ chui_number_input {
|
|
|
4
4
|
карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
|
|
5
5
|
(тот же приём у полосы меню-бара). */
|
|
6
6
|
--control_padding: var(--control_padding_sm);
|
|
7
|
-
--
|
|
7
|
+
--block_padding: var(--block_padding_sm);
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: var(--control_width);
|
|
11
11
|
height: max-content;
|
|
12
|
-
margin: var(--
|
|
12
|
+
margin: var(--block_margin);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
number_main {
|
|
@@ -17,7 +17,7 @@ number_main {
|
|
|
17
17
|
width: -webkit-fill-available;
|
|
18
18
|
height: max-content;
|
|
19
19
|
margin: 0;
|
|
20
|
-
border-radius: var(--
|
|
20
|
+
border-radius: var(--radius_sm);
|
|
21
21
|
align-items: center;
|
|
22
22
|
position: relative;
|
|
23
23
|
padding: var(--control_padding) 43px;
|
|
@@ -47,7 +47,7 @@ number_main {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.number_buttons:focus-visible {
|
|
50
|
-
border-radius: var(--
|
|
50
|
+
border-radius: var(--radius_sm);
|
|
51
51
|
outline: var(--focus_outline);
|
|
52
52
|
outline-offset: var(--focus_outline_offset);
|
|
53
53
|
}
|
|
@@ -72,7 +72,7 @@ chui_number_input input[type="number"]::-webkit-inner-spin-button {
|
|
|
72
72
|
.number_label {
|
|
73
73
|
height: max-content;
|
|
74
74
|
width: max-content;
|
|
75
|
-
margin: 0 0 var(--
|
|
75
|
+
margin: 0 0 var(--block_margin);
|
|
76
76
|
font-size: var(--font_labels_size);
|
|
77
77
|
font-weight: 500;
|
|
78
78
|
color: var(--text_color);
|
|
@@ -89,7 +89,7 @@ chui_number_input input[type="number"]::-webkit-inner-spin-button {
|
|
|
89
89
|
cursor: not-allowed;
|
|
90
90
|
height: max-content;
|
|
91
91
|
width: max-content;
|
|
92
|
-
margin: 0 0 var(--
|
|
92
|
+
margin: 0 0 var(--block_margin);
|
|
93
93
|
font-size: var(--font_labels_size);
|
|
94
94
|
font-weight: 500;
|
|
95
95
|
color: var(--text_color_disabled);
|
|
@@ -88,18 +88,18 @@ class OtpInput {
|
|
|
88
88
|
#roving = undefined;
|
|
89
89
|
#id = undefined;
|
|
90
90
|
#name = undefined;
|
|
91
|
-
#
|
|
92
|
-
#
|
|
91
|
+
#titleText = undefined;
|
|
92
|
+
#labelText = undefined;
|
|
93
93
|
#length = 6;
|
|
94
94
|
#type = OtpInput.TYPES.NUMERIC;
|
|
95
95
|
#value = "";
|
|
96
96
|
#obscure = false;
|
|
97
97
|
#disabled = false;
|
|
98
|
-
#
|
|
98
|
+
#readOnly = false;
|
|
99
99
|
#listeners = [];
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
100
|
+
#completeListeners = [];
|
|
101
|
+
#onChange = undefined;
|
|
102
|
+
#onComplete = undefined;
|
|
103
103
|
|
|
104
104
|
constructor(
|
|
105
105
|
options = {
|
|
@@ -123,9 +123,9 @@ class OtpInput {
|
|
|
123
123
|
OtpInput.#counter += 1;
|
|
124
124
|
this.#id = options.id === undefined ? `chui_otp_input_${OtpInput.#counter}` : options.id;
|
|
125
125
|
this.#name = options.name;
|
|
126
|
-
this.#
|
|
127
|
-
this.#
|
|
128
|
-
this.#
|
|
126
|
+
this.#labelText = options.label;
|
|
127
|
+
this.#onChange = options.onChange;
|
|
128
|
+
this.#onComplete = options.onComplete;
|
|
129
129
|
this.#length = OtpInput.#toLength(options.length);
|
|
130
130
|
this.#type = OtpInput.#toType(options.type);
|
|
131
131
|
this.#root.id = this.#id;
|
|
@@ -146,7 +146,7 @@ class OtpInput {
|
|
|
146
146
|
this.#root.appendChild(this.#status);
|
|
147
147
|
if (options.title !== undefined) this.setTitle(options.title);
|
|
148
148
|
else this.#label.hidden = true;
|
|
149
|
-
this.setLabel(this.#
|
|
149
|
+
this.setLabel(this.#labelText === undefined ? I18n.t("forms.otpLabel") : this.#labelText);
|
|
150
150
|
if (options.hint !== undefined) this.setHint(options.hint);
|
|
151
151
|
this.#build();
|
|
152
152
|
this.#roving = new RovingKeyboard(this.#row, { itemSelector: ".otp_cell" });
|
|
@@ -181,12 +181,12 @@ class OtpInput {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
getTitle() {
|
|
184
|
-
return this.#
|
|
184
|
+
return this.#titleText;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
/** Доступное имя группы, заданное в `label` */
|
|
188
188
|
getLabel() {
|
|
189
|
-
return this.#
|
|
189
|
+
return this.#labelText;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
getLength() {
|
|
@@ -221,7 +221,7 @@ class OtpInput {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
isReadOnly() {
|
|
224
|
-
return this.#
|
|
224
|
+
return this.#readOnly;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
// SET
|
|
@@ -238,7 +238,7 @@ class OtpInput {
|
|
|
238
238
|
|
|
239
239
|
/** Подпись над клетками; `undefined` её убирает (имя тогда даёт `label`) */
|
|
240
240
|
setTitle(text = undefined) {
|
|
241
|
-
this.#
|
|
241
|
+
this.#titleText = text;
|
|
242
242
|
if (text === undefined || text === "") {
|
|
243
243
|
this.#label.hidden = true;
|
|
244
244
|
this.#label.innerText = "";
|
|
@@ -255,8 +255,8 @@ class OtpInput {
|
|
|
255
255
|
|
|
256
256
|
/** Имя группы, когда подписи в разметке нет */
|
|
257
257
|
setLabel(text = undefined) {
|
|
258
|
-
this.#
|
|
259
|
-
if (this.#
|
|
258
|
+
this.#labelText = text;
|
|
259
|
+
if (this.#titleText === undefined || this.#titleText === "") {
|
|
260
260
|
if (text === undefined) this.#row.removeAttribute("aria-label");
|
|
261
261
|
else this.#row.setAttribute("aria-label", String(text));
|
|
262
262
|
}
|
|
@@ -328,10 +328,10 @@ class OtpInput {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/** Режим показа: код видно и можно скопировать, но клетки не принимают нажатия */
|
|
331
|
-
setReadOnly(
|
|
332
|
-
this.#
|
|
333
|
-
this.#root.classList.toggle("otp_readonly", this.#
|
|
334
|
-
for (const cell of this.#cells) cell.readOnly = this.#
|
|
331
|
+
setReadOnly(readOnly = Boolean()) {
|
|
332
|
+
this.#readOnly = readOnly === true;
|
|
333
|
+
this.#root.classList.toggle("otp_readonly", this.#readOnly);
|
|
334
|
+
for (const cell of this.#cells) cell.readOnly = this.#readOnly;
|
|
335
335
|
return this;
|
|
336
336
|
}
|
|
337
337
|
|
|
@@ -351,7 +351,7 @@ class OtpInput {
|
|
|
351
351
|
|
|
352
352
|
/** Слушатель заполненного кода: `(value, otpInput) => {}` */
|
|
353
353
|
addCompleteListener(listener = () => {}) {
|
|
354
|
-
this.#
|
|
354
|
+
this.#completeListeners.push(listener);
|
|
355
355
|
return this;
|
|
356
356
|
}
|
|
357
357
|
|
|
@@ -382,8 +382,8 @@ class OtpInput {
|
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
#accessibleName() {
|
|
385
|
-
if (this.#
|
|
386
|
-
if (this.#
|
|
385
|
+
if (this.#titleText !== undefined && this.#titleText !== "") return this.#titleText;
|
|
386
|
+
if (this.#labelText !== undefined && this.#labelText !== "") return this.#labelText;
|
|
387
387
|
return I18n.t("forms.otpLabel");
|
|
388
388
|
}
|
|
389
389
|
|
|
@@ -431,7 +431,7 @@ class OtpInput {
|
|
|
431
431
|
this.#value = this.#cells.map((cell) => cell.value).join("");
|
|
432
432
|
if (this.#roving !== undefined) this.#roving.refresh();
|
|
433
433
|
if (this.#obscure) this.#root.classList.add("otp_obscured");
|
|
434
|
-
if (this.#
|
|
434
|
+
if (this.#readOnly) for (const cell of this.#cells) cell.readOnly = true;
|
|
435
435
|
if (this.#disabled) for (const cell of this.#cells) cell.disabled = true;
|
|
436
436
|
return this;
|
|
437
437
|
}
|
|
@@ -454,16 +454,16 @@ class OtpInput {
|
|
|
454
454
|
#collect(notify = false) {
|
|
455
455
|
const value = this.#cells.map((cell) => cell.value).join("");
|
|
456
456
|
const changed = value !== this.#value;
|
|
457
|
-
const
|
|
457
|
+
const completeBefore = this.#value.length === this.#length && this.#value !== "";
|
|
458
458
|
this.#value = value;
|
|
459
459
|
this.#announce();
|
|
460
460
|
if (!changed || !notify) return this;
|
|
461
461
|
for (const listener of [...this.#listeners]) listener(value, this);
|
|
462
|
-
if (this.#
|
|
462
|
+
if (this.#onChange !== undefined) this.#onChange(value, this);
|
|
463
463
|
const complete = this.isComplete();
|
|
464
|
-
if (complete && !
|
|
465
|
-
for (const listener of [...this.#
|
|
466
|
-
if (this.#
|
|
464
|
+
if (complete && !completeBefore) {
|
|
465
|
+
for (const listener of [...this.#completeListeners]) listener(value, this);
|
|
466
|
+
if (this.#onComplete !== undefined) this.#onComplete(value, this);
|
|
467
467
|
}
|
|
468
468
|
return this;
|
|
469
469
|
}
|
|
@@ -498,7 +498,7 @@ class OtpInput {
|
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
#onInput = (event) => {
|
|
501
|
-
if (this.#disabled || this.#
|
|
501
|
+
if (this.#disabled || this.#readOnly) return;
|
|
502
502
|
const cell = event.target;
|
|
503
503
|
const index = this.#cells.indexOf(cell);
|
|
504
504
|
if (index === -1) return;
|
|
@@ -531,7 +531,7 @@ class OtpInput {
|
|
|
531
531
|
};
|
|
532
532
|
|
|
533
533
|
#onKeyDown = (event) => {
|
|
534
|
-
if (this.#disabled || this.#
|
|
534
|
+
if (this.#disabled || this.#readOnly) return;
|
|
535
535
|
const cell = event.target;
|
|
536
536
|
const index = this.#cells.indexOf(cell);
|
|
537
537
|
if (index === -1) return;
|
|
@@ -557,7 +557,7 @@ class OtpInput {
|
|
|
557
557
|
};
|
|
558
558
|
|
|
559
559
|
#onPaste = (event) => {
|
|
560
|
-
if (this.#disabled || this.#
|
|
560
|
+
if (this.#disabled || this.#readOnly) return;
|
|
561
561
|
event.preventDefault();
|
|
562
562
|
const text = event.clipboardData === null ? "" : event.clipboardData.getData("text");
|
|
563
563
|
this.#fill(text, this.#cells.indexOf(event.target));
|
|
@@ -5,18 +5,18 @@ chui_otp_input {
|
|
|
5
5
|
карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
|
|
6
6
|
(тот же приём у полосы меню-бара). */
|
|
7
7
|
--control_padding: var(--control_padding_sm);
|
|
8
|
-
--
|
|
8
|
+
--block_padding: var(--block_padding_sm);
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
width: max-content;
|
|
12
12
|
max-width: 100%;
|
|
13
|
-
margin: var(--
|
|
13
|
+
margin: var(--block_margin);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.otp_label {
|
|
17
17
|
display: block;
|
|
18
18
|
width: max-content;
|
|
19
|
-
margin: 0 0 var(--
|
|
19
|
+
margin: 0 0 var(--block_margin);
|
|
20
20
|
color: var(--text_color);
|
|
21
21
|
font-size: var(--font_labels_size);
|
|
22
22
|
font-weight: 500;
|
|
@@ -39,7 +39,7 @@ chui_otp_input {
|
|
|
39
39
|
margin: 0;
|
|
40
40
|
padding: 0;
|
|
41
41
|
border: 1px solid var(--border_color);
|
|
42
|
-
border-radius: var(--
|
|
42
|
+
border-radius: var(--radius_sm);
|
|
43
43
|
background: var(--element_background);
|
|
44
44
|
color: var(--text_color);
|
|
45
45
|
font-size: 18px;
|
|
@@ -62,7 +62,7 @@ chui_otp_input {
|
|
|
62
62
|
border: none;
|
|
63
63
|
outline: 1px solid var(--red_prime_background);
|
|
64
64
|
outline-offset: 4px;
|
|
65
|
-
border-radius: var(--
|
|
65
|
+
border-radius: var(--radius_sm);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.otp_disabled .otp_cell {
|
|
@@ -7,14 +7,14 @@ const { Validate } = require("../../../modules/chui_validate/chui_validate");
|
|
|
7
7
|
|
|
8
8
|
class PasswordInput {
|
|
9
9
|
#id = require("randomstring").generate();
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
10
|
+
#passwordMain = document.createElement("password_main");
|
|
11
|
+
#seePassButton = document.createElement("see_pass_button");
|
|
12
|
+
#seePassButtonDisabled = document.createElement("see_pass_button");
|
|
13
|
+
#chuiPasswordInput = document.createElement("chui_password_input");
|
|
14
14
|
#label = document.createElement("label");
|
|
15
15
|
#input = document.createElement("input");
|
|
16
16
|
#title = undefined;
|
|
17
|
-
#
|
|
17
|
+
#errorMessagePassword = document.createElement("error_message_password");
|
|
18
18
|
constructor(
|
|
19
19
|
options = {
|
|
20
20
|
name: String(),
|
|
@@ -32,19 +32,13 @@ class PasswordInput {
|
|
|
32
32
|
this.#input.className = "password_input";
|
|
33
33
|
if (options.required !== undefined) this.#input.required = options.required;
|
|
34
34
|
// Валидация: тот же контракт validate/setError/clearError, своё сообщение под полем
|
|
35
|
-
Validate.installField(
|
|
36
|
-
this,
|
|
37
|
-
options,
|
|
38
|
-
this.#password_main,
|
|
39
|
-
this.#error_message_password,
|
|
40
|
-
() => this.#input.value
|
|
41
|
-
);
|
|
35
|
+
Validate.installField(this, options, this.#passwordMain, this.#errorMessagePassword, () => this.#input.value);
|
|
42
36
|
// Кнопка показа пароля — не значок, а кнопка: роль, остановка обхода и Enter/Space
|
|
43
|
-
makeKeyboardButton(this.#
|
|
37
|
+
makeKeyboardButton(this.#seePassButton);
|
|
44
38
|
// У выключенного поля кнопка декоративна: фокус в неё не попадает
|
|
45
|
-
this.#
|
|
46
|
-
this.#setSeeGlyph(this.#
|
|
47
|
-
this.#setSeeGlyph(this.#
|
|
39
|
+
this.#seePassButtonDisabled.setAttribute("aria-hidden", "true");
|
|
40
|
+
this.#setSeeGlyph(this.#seePassButton, Icons.ACTIONS.VISIBILITY, "var(--blue_prime_background)");
|
|
41
|
+
this.#setSeeGlyph(this.#seePassButtonDisabled, Icons.ACTIONS.VISIBILITY, "var(--text_color_disabled)");
|
|
48
42
|
// Курсор выключенного поля даёт его контейнер (`.password_main_disabled`),
|
|
49
43
|
// курсор наследуется и на кнопку
|
|
50
44
|
this.#syncSeeLabel();
|
|
@@ -52,28 +46,28 @@ class PasswordInput {
|
|
|
52
46
|
this.#label.innerText = options.title;
|
|
53
47
|
this.#label.classList.add("password_label");
|
|
54
48
|
this.#label.setAttribute("for", this.#id);
|
|
55
|
-
this.#
|
|
49
|
+
this.#chuiPasswordInput.appendChild(this.#label);
|
|
56
50
|
}
|
|
57
51
|
if (options.placeholder !== undefined) this.#input.placeholder = options.placeholder;
|
|
58
|
-
if (options.width !== undefined) this.#
|
|
52
|
+
if (options.width !== undefined) this.#chuiPasswordInput.style.width = options.width;
|
|
59
53
|
// Рамку с кольцом при фокусе рисует общее правило темы (`password_main:hover`,
|
|
60
54
|
// `:focus-within`), а не компонент: прежде он ставил то же самое инлайном,
|
|
61
55
|
// а на `blur` снимал весь атрибут `style`
|
|
62
56
|
|
|
63
|
-
this.#
|
|
57
|
+
this.#seePassButton.addEventListener("mousedown", (event) => {
|
|
64
58
|
event.preventDefault();
|
|
65
59
|
return false;
|
|
66
60
|
});
|
|
67
61
|
|
|
68
|
-
this.#
|
|
69
|
-
this.#
|
|
70
|
-
this.#
|
|
71
|
-
this.#
|
|
62
|
+
this.#passwordMain.appendChild(this.#input);
|
|
63
|
+
this.#passwordMain.appendChild(this.#seePassButton);
|
|
64
|
+
this.#seePassButton.addEventListener("click", () => this.#showPassword());
|
|
65
|
+
this.#chuiPasswordInput.appendChild(this.#passwordMain);
|
|
72
66
|
|
|
73
67
|
//
|
|
74
68
|
this.#input.addEventListener("input", () => {
|
|
75
69
|
this.clearError();
|
|
76
|
-
new Animation(this.#
|
|
70
|
+
new Animation(this.#errorMessagePassword).fadeOut();
|
|
77
71
|
});
|
|
78
72
|
}
|
|
79
73
|
getName() {
|
|
@@ -91,17 +85,17 @@ class PasswordInput {
|
|
|
91
85
|
setDisabled(boolean = Boolean()) {
|
|
92
86
|
this.#input.disabled = boolean;
|
|
93
87
|
if (boolean) {
|
|
94
|
-
this.#
|
|
88
|
+
this.#passwordMain.classList.add("password_main_disabled");
|
|
95
89
|
this.#input.className = "password_input_disabled";
|
|
96
90
|
this.#label.className = "password_label_disabled";
|
|
97
|
-
this.#
|
|
98
|
-
this.#
|
|
91
|
+
this.#seePassButton.remove();
|
|
92
|
+
this.#passwordMain.appendChild(this.#seePassButtonDisabled);
|
|
99
93
|
} else {
|
|
100
|
-
this.#
|
|
94
|
+
this.#passwordMain.classList.remove("password_main_disabled");
|
|
101
95
|
this.#input.className = "password_input";
|
|
102
96
|
this.#label.className = "password_label";
|
|
103
|
-
this.#
|
|
104
|
-
this.#
|
|
97
|
+
this.#seePassButtonDisabled.remove();
|
|
98
|
+
this.#passwordMain.appendChild(this.#seePassButton);
|
|
105
99
|
}
|
|
106
100
|
}
|
|
107
101
|
setErrorMessage(message = String()) {
|
|
@@ -109,10 +103,10 @@ class PasswordInput {
|
|
|
109
103
|
// Своя отрисовка оставляла ошибку только глазами — скринридер о ней не знал
|
|
110
104
|
this.setError(message);
|
|
111
105
|
// У поля сообщение скрыто по умолчанию (`display: none`) — показываем анимацией
|
|
112
|
-
new Animation(this.#
|
|
106
|
+
new Animation(this.#errorMessagePassword).fadeIn();
|
|
113
107
|
}
|
|
114
108
|
set() {
|
|
115
|
-
return this.#
|
|
109
|
+
return this.#chuiPasswordInput;
|
|
116
110
|
}
|
|
117
111
|
/** Значок кнопки: узел помечается скрытым — имя кнопки даёт `aria-label`, а не лигатура */
|
|
118
112
|
#setSeeGlyph(button = new HTMLElement(), icon = String(), color = String()) {
|
|
@@ -125,16 +119,16 @@ class PasswordInput {
|
|
|
125
119
|
#syncSeeLabel() {
|
|
126
120
|
const shown = this.#input.type === "text";
|
|
127
121
|
const label = I18n.t(shown ? "forms.passwordHide" : "forms.passwordShow");
|
|
128
|
-
this.#
|
|
129
|
-
this.#
|
|
122
|
+
this.#seePassButton.setAttribute("aria-label", label);
|
|
123
|
+
this.#seePassButton.setAttribute("title", label);
|
|
130
124
|
}
|
|
131
125
|
#showPassword() {
|
|
132
126
|
this.#input.focus();
|
|
133
127
|
if (this.#input.type === "password") {
|
|
134
|
-
this.#setSeeGlyph(this.#
|
|
128
|
+
this.#setSeeGlyph(this.#seePassButton, Icons.ACTIONS.VISIBILITY_OFF, "var(--blue_prime_background)");
|
|
135
129
|
this.#input.type = "text";
|
|
136
130
|
} else {
|
|
137
|
-
this.#setSeeGlyph(this.#
|
|
131
|
+
this.#setSeeGlyph(this.#seePassButton, Icons.ACTIONS.VISIBILITY, "var(--blue_prime_background)");
|
|
138
132
|
this.#input.type = "password";
|
|
139
133
|
}
|
|
140
134
|
this.#syncSeeLabel();
|
|
@@ -4,12 +4,12 @@ chui_password_input {
|
|
|
4
4
|
карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
|
|
5
5
|
(тот же приём у полосы меню-бара). */
|
|
6
6
|
--control_padding: var(--control_padding_sm);
|
|
7
|
-
--
|
|
7
|
+
--block_padding: var(--block_padding_sm);
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: var(--control_width);
|
|
11
11
|
height: max-content;
|
|
12
|
-
margin: var(--
|
|
12
|
+
margin: var(--block_margin);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
password_main {
|
|
@@ -17,11 +17,11 @@ password_main {
|
|
|
17
17
|
outline: none;
|
|
18
18
|
width: -webkit-fill-available;
|
|
19
19
|
height: max-content;
|
|
20
|
-
border-radius: var(--
|
|
20
|
+
border-radius: var(--radius_sm);
|
|
21
21
|
font-size: var(--font_default_size);
|
|
22
22
|
color: var(--text_color);
|
|
23
23
|
position: relative;
|
|
24
|
-
padding: var(--control_padding) 43px var(--
|
|
24
|
+
padding: var(--control_padding) 43px var(--block_padding);
|
|
25
25
|
background: var(--element_background);
|
|
26
26
|
border: 1px solid var(--border_color);
|
|
27
27
|
}
|
|
@@ -54,7 +54,7 @@ see_pass_button {
|
|
|
54
54
|
.password_label {
|
|
55
55
|
height: max-content;
|
|
56
56
|
width: max-content;
|
|
57
|
-
margin: 0 0 var(--
|
|
57
|
+
margin: 0 0 var(--block_margin);
|
|
58
58
|
font-size: var(--font_labels_size);
|
|
59
59
|
font-weight: 500;
|
|
60
60
|
color: var(--text_color);
|
|
@@ -68,7 +68,7 @@ error_message_password {
|
|
|
68
68
|
display: none;
|
|
69
69
|
height: max-content;
|
|
70
70
|
width: max-content;
|
|
71
|
-
margin: var(--
|
|
71
|
+
margin: var(--block_margin) var(--block_margin) 0 var(--block_margin);
|
|
72
72
|
font-size: var(--font_labels_size);
|
|
73
73
|
font-weight: 500;
|
|
74
74
|
color: var(--red_prime_background);
|
|
@@ -85,7 +85,7 @@ error_message_password {
|
|
|
85
85
|
cursor: not-allowed;
|
|
86
86
|
height: max-content;
|
|
87
87
|
width: max-content;
|
|
88
|
-
margin: 0 0 var(--
|
|
88
|
+
margin: 0 0 var(--block_margin);
|
|
89
89
|
font-size: var(--font_labels_size);
|
|
90
90
|
font-weight: 500;
|
|
91
91
|
color: var(--text_color_disabled);
|
|
@@ -4,13 +4,13 @@ radiobutton {
|
|
|
4
4
|
карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
|
|
5
5
|
(тот же приём у полосы меню-бара). */
|
|
6
6
|
--control_padding: var(--control_padding_sm);
|
|
7
|
-
--
|
|
7
|
+
--block_padding: var(--block_padding_sm);
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: flex-start;
|
|
11
11
|
/* Тот же шаг шрифта, что у CheckBox: квадратик и кружок должны быть одного размера */
|
|
12
12
|
font-size: var(--font_default_size);
|
|
13
|
-
margin: var(--
|
|
13
|
+
margin: var(--block_margin);
|
|
14
14
|
width: max-content;
|
|
15
15
|
}
|
|
16
16
|
|