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,5 +1,5 @@
|
|
|
1
|
-
const {setStyles} = require(
|
|
2
|
-
const {I18n} = require(
|
|
1
|
+
const { setStyles } = require("../../../modules/chui_functions");
|
|
2
|
+
const { I18n } = require("../../../modules/chui_i18n/chui_i18n");
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Ползунок: одно значение или диапазон (`range: true`).
|
|
@@ -28,14 +28,14 @@ class Slider {
|
|
|
28
28
|
#root = document.createElement("chui_slider");
|
|
29
29
|
#header = document.createElement("slider_header");
|
|
30
30
|
#title = document.createElement("slider_title");
|
|
31
|
-
#
|
|
31
|
+
#valueLabel = document.createElement("slider_value");
|
|
32
32
|
#field = document.createElement("slider_field");
|
|
33
33
|
#track = document.createElement("slider_track");
|
|
34
34
|
#fill = document.createElement("slider_fill");
|
|
35
35
|
#thumbs = [];
|
|
36
36
|
#id = undefined;
|
|
37
37
|
#name = undefined;
|
|
38
|
-
#
|
|
38
|
+
#titleText = undefined;
|
|
39
39
|
#label = undefined;
|
|
40
40
|
#min = 0;
|
|
41
41
|
#max = 100;
|
|
@@ -44,27 +44,29 @@ class Slider {
|
|
|
44
44
|
#values = [0];
|
|
45
45
|
#disabled = false;
|
|
46
46
|
#format = undefined;
|
|
47
|
-
#
|
|
48
|
-
#
|
|
47
|
+
#changeListeners = [];
|
|
48
|
+
#inputListeners = [];
|
|
49
49
|
#dragging = undefined;
|
|
50
50
|
|
|
51
|
-
constructor(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
constructor(
|
|
52
|
+
options = {
|
|
53
|
+
id: String(),
|
|
54
|
+
name: String(),
|
|
55
|
+
title: String(),
|
|
56
|
+
label: String(),
|
|
57
|
+
min: Number(),
|
|
58
|
+
max: Number(),
|
|
59
|
+
step: Number(),
|
|
60
|
+
value: undefined,
|
|
61
|
+
range: Boolean(),
|
|
62
|
+
disabled: Boolean(),
|
|
63
|
+
width: String(),
|
|
64
|
+
showValue: Boolean(),
|
|
65
|
+
format: undefined,
|
|
66
|
+
changeListener: undefined,
|
|
67
|
+
inputListener: undefined,
|
|
68
|
+
}
|
|
69
|
+
) {
|
|
68
70
|
setStyles(__dirname + "/styles.css", "chUiJS_Slider");
|
|
69
71
|
Slider.#counter += 1;
|
|
70
72
|
this.#id = options.id === undefined ? `chui_slider_${Slider.#counter}` : options.id;
|
|
@@ -86,16 +88,14 @@ class Slider {
|
|
|
86
88
|
}
|
|
87
89
|
this.#track.addEventListener("pointerdown", this.#onTrackPointerDown);
|
|
88
90
|
this.#header.appendChild(this.#title);
|
|
89
|
-
this.#header.appendChild(this.#
|
|
91
|
+
this.#header.appendChild(this.#valueLabel);
|
|
90
92
|
this.#root.appendChild(this.#header);
|
|
91
93
|
this.#root.appendChild(this.#field);
|
|
92
94
|
|
|
93
95
|
if (options.title !== undefined) this.setTitle(options.title);
|
|
94
96
|
else this.#header.hidden = true;
|
|
95
|
-
if (options.showValue === false) this.#
|
|
96
|
-
this.setValue(options.value === undefined
|
|
97
|
-
? (this.#range ? [this.#min, this.#max] : this.#min)
|
|
98
|
-
: options.value);
|
|
97
|
+
if (options.showValue === false) this.#valueLabel.hidden = true;
|
|
98
|
+
this.setValue(options.value === undefined ? (this.#range ? [this.#min, this.#max] : this.#min) : options.value);
|
|
99
99
|
if (options.disabled === true) this.setDisabled(true);
|
|
100
100
|
if (options.width !== undefined) this.setWidth(options.width);
|
|
101
101
|
if (options.changeListener !== undefined) this.addChangeListener(options.changeListener);
|
|
@@ -153,7 +153,7 @@ class Slider {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
setTitle(text = String()) {
|
|
156
|
-
this.#
|
|
156
|
+
this.#titleText = text;
|
|
157
157
|
this.#title.innerText = text;
|
|
158
158
|
this.#header.hidden = false;
|
|
159
159
|
this.#render();
|
|
@@ -189,7 +189,7 @@ class Slider {
|
|
|
189
189
|
|
|
190
190
|
/** Показывать ли читаемое значение рядом с заголовком */
|
|
191
191
|
setShowValue(show = Boolean()) {
|
|
192
|
-
this.#
|
|
192
|
+
this.#valueLabel.hidden = show === false;
|
|
193
193
|
return this;
|
|
194
194
|
}
|
|
195
195
|
|
|
@@ -223,13 +223,13 @@ class Slider {
|
|
|
223
223
|
// ПОДПИСКИ
|
|
224
224
|
/** Вызов на отпускание бегунка, клик по дорожке и ход с клавиатуры */
|
|
225
225
|
addChangeListener(listener = () => {}) {
|
|
226
|
-
this.#
|
|
226
|
+
this.#changeListeners.push(listener);
|
|
227
227
|
return this;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
/** Вызов на каждое изменение во время перетаскивания */
|
|
231
231
|
addInputListener(listener = () => {}) {
|
|
232
|
-
this.#
|
|
232
|
+
this.#inputListeners.push(listener);
|
|
233
233
|
return this;
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -279,9 +279,12 @@ class Slider {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
#thumbLabel(index = Number()) {
|
|
282
|
-
const base =
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
const base =
|
|
283
|
+
this.#label === undefined
|
|
284
|
+
? this.#titleText === undefined
|
|
285
|
+
? I18n.t("forms.sliderValue")
|
|
286
|
+
: this.#titleText
|
|
287
|
+
: this.#label;
|
|
285
288
|
if (!this.#range) return base;
|
|
286
289
|
return `${base}: ${index === 0 ? I18n.t("forms.sliderMin") : I18n.t("forms.sliderMax")}`;
|
|
287
290
|
}
|
|
@@ -306,7 +309,7 @@ class Slider {
|
|
|
306
309
|
if (this.#disabled) thumb.setAttribute("aria-disabled", "true");
|
|
307
310
|
else thumb.removeAttribute("aria-disabled");
|
|
308
311
|
});
|
|
309
|
-
this.#
|
|
312
|
+
this.#valueLabel.innerText = this.#range
|
|
310
313
|
? `${this.#valueText(low)} – ${this.#valueText(high)}`
|
|
311
314
|
: this.#valueText(low);
|
|
312
315
|
}
|
|
@@ -324,7 +327,7 @@ class Slider {
|
|
|
324
327
|
}
|
|
325
328
|
|
|
326
329
|
#emit(type = String()) {
|
|
327
|
-
const listeners = type === "input" ? this.#
|
|
330
|
+
const listeners = type === "input" ? this.#inputListeners : this.#changeListeners;
|
|
328
331
|
const value = this.getValue();
|
|
329
332
|
for (const listener of [...listeners]) listener(value);
|
|
330
333
|
}
|
|
@@ -422,4 +425,4 @@ class Slider {
|
|
|
422
425
|
};
|
|
423
426
|
}
|
|
424
427
|
|
|
425
|
-
exports.Slider = Slider
|
|
428
|
+
exports.Slider = Slider;
|
|
@@ -4,12 +4,12 @@ chui_slider {
|
|
|
4
4
|
карточку. Токены переопределены у корня поля, поэтому действуют только внутри него
|
|
5
5
|
(тот же приём у полосы меню-бара). */
|
|
6
6
|
--control_padding: var(--control_padding_sm);
|
|
7
|
-
--
|
|
7
|
+
--block_padding: var(--block_padding_sm);
|
|
8
8
|
display: block;
|
|
9
9
|
/* fill-available учитывает собственный margin, 100% — нет: слайдер уезжал
|
|
10
10
|
вправо и вылезал за родителя на 6px */
|
|
11
11
|
width: -webkit-fill-available;
|
|
12
|
-
margin: var(--
|
|
12
|
+
margin: var(--block_margin);
|
|
13
13
|
font-size: var(--font_default_size);
|
|
14
14
|
color: var(--text_color);
|
|
15
15
|
}
|
|
@@ -76,15 +76,17 @@ slider_thumb {
|
|
|
76
76
|
/* Кружок целиком — 20px: рамка 2px прибавляется к 16px, а не входит в них, поэтому
|
|
77
77
|
половина равна 10px. С прежними -8px бегунок стоял на 2px ниже дорожки
|
|
78
78
|
и на 2px правее своего значения */
|
|
79
|
-
margin-block: -10px 0;
|
|
79
|
+
margin-block: -10px 0;
|
|
80
|
+
margin-inline: -10px 0;
|
|
80
81
|
border-radius: var(--radius_circle);
|
|
81
82
|
background: var(--blue_prime_background);
|
|
82
83
|
border: 2px solid var(--main_background);
|
|
83
|
-
box-shadow:
|
|
84
|
+
box-shadow: var(--box_shadow_control);
|
|
84
85
|
cursor: pointer;
|
|
85
86
|
outline: none;
|
|
86
87
|
touch-action: none;
|
|
87
|
-
|
|
88
|
+
/* Ползунок растёт на наведении и захвате: отклик с лёгким перелётом, а не линейный рост */
|
|
89
|
+
transition: transform var(--motion_base) var(--motion_spring);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
slider_thumb:hover,
|
|
@@ -4,12 +4,12 @@ chui_text_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
|
chui_text_main {
|
|
@@ -17,12 +17,12 @@ chui_text_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
|
background: var(--element_background);
|
|
22
22
|
color: var(--text_color);
|
|
23
23
|
align-items: center;
|
|
24
24
|
position: relative;
|
|
25
|
-
padding: var(--
|
|
25
|
+
padding: var(--block_padding);
|
|
26
26
|
border: 1px solid var(--border_color);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -40,20 +40,20 @@ chui_text_main {
|
|
|
40
40
|
.input_label {
|
|
41
41
|
height: max-content;
|
|
42
42
|
width: max-content;
|
|
43
|
-
margin: 0 0 var(--
|
|
43
|
+
margin: 0 0 var(--block_margin);
|
|
44
44
|
font-size: var(--font_labels_size);
|
|
45
|
-
font-weight:500;
|
|
46
|
-
color: var(--text_color)
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
color: var(--text_color);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
error_message_text {
|
|
50
50
|
display: none;
|
|
51
51
|
height: max-content;
|
|
52
52
|
width: max-content;
|
|
53
|
-
margin: var(--
|
|
53
|
+
margin: var(--block_margin) var(--block_margin) 0 var(--block_margin);
|
|
54
54
|
font-size: var(--font_labels_size);
|
|
55
|
-
font-weight:500;
|
|
56
|
-
color: var(--red_prime_background)
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
color: var(--red_prime_background);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.error_border {
|
|
@@ -83,8 +83,8 @@ error_message_text {
|
|
|
83
83
|
cursor: not-allowed;
|
|
84
84
|
height: max-content;
|
|
85
85
|
width: max-content;
|
|
86
|
-
margin: 0 0 var(--
|
|
86
|
+
margin: 0 0 var(--block_margin);
|
|
87
87
|
font-size: var(--font_labels_size);
|
|
88
|
-
font-weight:500;
|
|
89
|
-
color: var(--text_color_disabled)
|
|
90
|
-
}
|
|
88
|
+
font-weight: 500;
|
|
89
|
+
color: var(--text_color_disabled);
|
|
90
|
+
}
|
|
@@ -1,90 +1,107 @@
|
|
|
1
1
|
//version: 1.0.0
|
|
2
|
-
const {Animation} = require(
|
|
2
|
+
const { Animation } = require("../../../modules/chui_animations/animations");
|
|
3
3
|
|
|
4
|
-
const {Validate} = require(
|
|
4
|
+
const { Validate } = require("../../../modules/chui_validate/chui_validate");
|
|
5
5
|
|
|
6
6
|
class TextInput {
|
|
7
|
-
#
|
|
8
|
-
#
|
|
7
|
+
#chuiTextMain = document.createElement("chui_text_main");
|
|
8
|
+
#chuiTextInput = document.createElement("chui_text_input");
|
|
9
9
|
#id = require("randomstring").generate();
|
|
10
10
|
#title = String();
|
|
11
|
-
#input = document.createElement(
|
|
12
|
-
#label = document.createElement(
|
|
13
|
-
#
|
|
14
|
-
constructor(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
#input = document.createElement("input");
|
|
12
|
+
#label = document.createElement("label");
|
|
13
|
+
#errorMessageText = document.createElement("error_message_text");
|
|
14
|
+
constructor(
|
|
15
|
+
options = {
|
|
16
|
+
name: String(),
|
|
17
|
+
title: String(),
|
|
18
|
+
placeholder: String(),
|
|
19
|
+
width: String(),
|
|
20
|
+
required: Boolean(),
|
|
21
|
+
value: String(),
|
|
22
|
+
disableFocus: Boolean(),
|
|
23
|
+
inputListener: () => {},
|
|
24
|
+
focusListener: () => {},
|
|
25
|
+
blurListener: () => {},
|
|
26
|
+
}
|
|
27
|
+
) {
|
|
28
|
+
require("../../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_TextInput");
|
|
29
|
+
this.#input.type = "text";
|
|
30
|
+
this.#input.className = "text_input";
|
|
29
31
|
this.#input.id = this.#id;
|
|
30
32
|
|
|
31
33
|
//Options
|
|
32
|
-
if (options.inputListener !== undefined) this.#input.addEventListener(
|
|
33
|
-
if (options.focusListener !== undefined) this.#input.addEventListener(
|
|
34
|
-
if (options.blurListener !== undefined) this.#input.addEventListener(
|
|
34
|
+
if (options.inputListener !== undefined) this.#input.addEventListener("input", options.inputListener);
|
|
35
|
+
if (options.focusListener !== undefined) this.#input.addEventListener("focus", options.focusListener);
|
|
36
|
+
if (options.blurListener !== undefined) this.#input.addEventListener("blur", options.blurListener);
|
|
35
37
|
if (options.name !== undefined) this.#input.name = options.name;
|
|
36
38
|
if (options.value !== undefined) this.#input.value = options.value;
|
|
37
39
|
if (options.required !== undefined) this.#input.required = options.required;
|
|
38
40
|
// Валидация и показ ошибки: правила из options (required/min/max/pattern/…)
|
|
39
|
-
Validate.installField(this, options, this.#
|
|
40
|
-
if (options.disableFocus !== undefined) this.#input.addEventListener("mousedown", () => { return false });
|
|
41
|
+
Validate.installField(this, options, this.#chuiTextMain, this.#errorMessageText, () => this.#input.value);
|
|
41
42
|
if (options.title !== undefined) {
|
|
42
43
|
this.#title = options.title;
|
|
43
44
|
this.#label.innerText = options.title;
|
|
44
|
-
this.#label.className =
|
|
45
|
-
this.#label.setAttribute(
|
|
46
|
-
this.#
|
|
45
|
+
this.#label.className = "input_label";
|
|
46
|
+
this.#label.setAttribute("for", this.#id);
|
|
47
|
+
this.#chuiTextInput.appendChild(this.#label);
|
|
47
48
|
}
|
|
48
|
-
if (options.width !== undefined) this.#
|
|
49
|
+
if (options.width !== undefined) this.#chuiTextInput.style.width = options.width;
|
|
49
50
|
if (options.placeholder !== undefined) this.#input.placeholder = options.placeholder;
|
|
50
51
|
// Опция `disableFocus`: поле не подсвечивается фокусом. Класс читает тема
|
|
51
52
|
// (`field_no_focus` рядом с общим правилом полей), а не сам компонент
|
|
52
|
-
if (options.disableFocus) this.#
|
|
53
|
+
if (options.disableFocus) this.#chuiTextMain.classList.add("field_no_focus");
|
|
53
54
|
// Рамку с кольцом при фокусе и подсказку при наведении рисует общее правило темы
|
|
54
55
|
// (`chui_text_main:hover`, `:focus-within` в global_style.css), а не компонент:
|
|
55
56
|
// прежде он ставил то же самое инлайном, а на `blur` снимал весь атрибут `style`
|
|
56
|
-
this.#
|
|
57
|
-
this.#
|
|
57
|
+
this.#chuiTextMain.appendChild(this.#input);
|
|
58
|
+
this.#chuiTextInput.appendChild(this.#chuiTextMain);
|
|
58
59
|
|
|
59
60
|
//
|
|
60
61
|
this.#input.addEventListener("input", () => {
|
|
61
62
|
this.clearError();
|
|
62
|
-
new Animation(this.#
|
|
63
|
-
})
|
|
63
|
+
new Animation(this.#errorMessageText).fadeOut();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
addInputListener(listener = () => {}) {
|
|
67
|
+
this.#input.addEventListener("input", listener);
|
|
68
|
+
}
|
|
69
|
+
addFocusListener(listener = () => {}) {
|
|
70
|
+
this.#input.addEventListener("focus", listener);
|
|
71
|
+
}
|
|
72
|
+
addBlurListener(listener = () => {}) {
|
|
73
|
+
this.#input.addEventListener("blur", listener);
|
|
74
|
+
}
|
|
75
|
+
getName() {
|
|
76
|
+
return this.#input.name;
|
|
77
|
+
}
|
|
78
|
+
getTitle() {
|
|
79
|
+
return this.#title;
|
|
80
|
+
}
|
|
81
|
+
getValue() {
|
|
82
|
+
return this.#input.value;
|
|
83
|
+
}
|
|
84
|
+
setValue(text = String()) {
|
|
85
|
+
this.#input.value = text;
|
|
64
86
|
}
|
|
65
|
-
addInputListener(listener = () => {}) { this.#input.addEventListener('input', listener); }
|
|
66
|
-
addFocusListener(listener = () => {}) { this.#input.addEventListener('focus', listener); }
|
|
67
|
-
addBlurListener(listener = () => {}) { this.#input.addEventListener('blur', listener); }
|
|
68
|
-
getName() { return this.#input.name; }
|
|
69
|
-
getTitle() { return this.#title; }
|
|
70
|
-
getValue() { return this.#input.value; }
|
|
71
|
-
setValue(text = String()) { this.#input.value = text; }
|
|
72
87
|
setDisabled(boolean = Boolean()) {
|
|
73
|
-
this.#input.disabled = boolean
|
|
88
|
+
this.#input.disabled = boolean;
|
|
74
89
|
if (boolean) {
|
|
75
|
-
this.#
|
|
76
|
-
this.#input.className = "text_input_disabled"
|
|
77
|
-
this.#label.className = "input_label_disabled"
|
|
90
|
+
this.#chuiTextMain.classList.add("chui_text_main_disabled");
|
|
91
|
+
this.#input.className = "text_input_disabled";
|
|
92
|
+
this.#label.className = "input_label_disabled";
|
|
78
93
|
} else {
|
|
79
|
-
this.#
|
|
80
|
-
this.#input.className = "text_input"
|
|
81
|
-
this.#label.className = "input_label"
|
|
94
|
+
this.#chuiTextMain.classList.remove("chui_text_main_disabled");
|
|
95
|
+
this.#input.className = "text_input";
|
|
96
|
+
this.#label.className = "input_label";
|
|
82
97
|
}
|
|
83
98
|
}
|
|
84
99
|
setErrorMessage(message = String()) {
|
|
85
100
|
this.setError(message);
|
|
86
101
|
}
|
|
87
|
-
set() {
|
|
102
|
+
set() {
|
|
103
|
+
return this.#chuiTextInput;
|
|
104
|
+
}
|
|
88
105
|
}
|
|
89
106
|
|
|
90
|
-
exports.TextInput = TextInput
|
|
107
|
+
exports.TextInput = TextInput;
|
|
@@ -4,23 +4,23 @@ chui_area_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
|
.resize_off {
|
|
16
|
-
resize: none
|
|
16
|
+
resize: none;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.area_input {
|
|
20
20
|
height: inherit;
|
|
21
21
|
width: -webkit-fill-available;
|
|
22
|
-
border-radius: var(--
|
|
23
|
-
padding: var(--
|
|
22
|
+
border-radius: var(--radius_sm);
|
|
23
|
+
padding: var(--block_padding);
|
|
24
24
|
font-size: var(--font_default_size);
|
|
25
25
|
color: var(--text_color);
|
|
26
26
|
background: var(--element_background);
|
|
@@ -30,10 +30,10 @@ chui_area_input {
|
|
|
30
30
|
.textarea_label {
|
|
31
31
|
height: max-content;
|
|
32
32
|
width: max-content;
|
|
33
|
-
margin: 0 0 var(--
|
|
33
|
+
margin: 0 0 var(--block_margin);
|
|
34
34
|
font-size: var(--font_labels_size);
|
|
35
|
-
font-weight:500;
|
|
36
|
-
color: var(--text_color)
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
color: var(--text_color);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/* DISABLED STYLES */
|
|
@@ -41,8 +41,8 @@ chui_area_input {
|
|
|
41
41
|
cursor: not-allowed;
|
|
42
42
|
height: inherit;
|
|
43
43
|
width: -webkit-fill-available;
|
|
44
|
-
border-radius: var(--
|
|
45
|
-
padding: var(--
|
|
44
|
+
border-radius: var(--radius_sm);
|
|
45
|
+
padding: var(--block_padding);
|
|
46
46
|
font-size: var(--font_default_size);
|
|
47
47
|
color: var(--text_color_disabled);
|
|
48
48
|
background: var(--element_background_disabled);
|
|
@@ -53,8 +53,8 @@ chui_area_input {
|
|
|
53
53
|
cursor: not-allowed;
|
|
54
54
|
height: max-content;
|
|
55
55
|
width: max-content;
|
|
56
|
-
margin: 0 0 var(--
|
|
56
|
+
margin: 0 0 var(--block_margin);
|
|
57
57
|
font-size: var(--font_labels_size);
|
|
58
|
-
font-weight:500;
|
|
59
|
-
color: var(--text_color_disabled)
|
|
60
|
-
}
|
|
58
|
+
font-weight: 500;
|
|
59
|
+
color: var(--text_color_disabled);
|
|
60
|
+
}
|
|
@@ -1,58 +1,81 @@
|
|
|
1
|
-
const {Validate} = require(
|
|
1
|
+
const { Validate } = require("../../../modules/chui_validate/chui_validate");
|
|
2
2
|
|
|
3
3
|
class TextArea {
|
|
4
4
|
#id = require("randomstring").generate();
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#label = document.createElement(
|
|
5
|
+
#chuiTextInput = document.createElement("chui_area_input");
|
|
6
|
+
#textArea = document.createElement("textarea");
|
|
7
|
+
#label = document.createElement("label");
|
|
8
8
|
#title = undefined;
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
constructor(
|
|
10
|
+
options = {
|
|
11
|
+
name: String(),
|
|
12
|
+
title: String(),
|
|
13
|
+
placeholder: String(),
|
|
14
|
+
width: String(),
|
|
15
|
+
height: String(),
|
|
16
|
+
required: Boolean(),
|
|
17
|
+
}
|
|
18
|
+
) {
|
|
19
|
+
require("../../../modules/chui_functions").setStyles(__dirname + "/styles.css", "chUiJS_TextArea");
|
|
20
|
+
this.#textArea.classList.add("area_input", "resize_off");
|
|
21
|
+
this.#textArea.id = this.#id;
|
|
22
|
+
if (options.name !== undefined) this.#textArea.name = options.name;
|
|
23
|
+
if (options.required !== undefined) this.#textArea.required = options.required;
|
|
18
24
|
// Валидация и показ ошибки: правила из options. Текст ошибки — в корень поля
|
|
19
25
|
// (под областью ввода), а рамку получает само поле: иначе узел с текстом попал бы
|
|
20
26
|
// внутрь `<textarea>` и читался бы как его содержимое
|
|
21
|
-
Validate.installField(
|
|
27
|
+
Validate.installField(
|
|
28
|
+
this,
|
|
29
|
+
options,
|
|
30
|
+
this.#chuiTextInput,
|
|
31
|
+
undefined,
|
|
32
|
+
() => this.#textArea.value,
|
|
33
|
+
this.#textArea
|
|
34
|
+
);
|
|
22
35
|
if (options.title !== undefined) {
|
|
23
36
|
this.#title = options.title;
|
|
24
37
|
this.#label.innerText = options.title;
|
|
25
|
-
this.#label.classList.add(
|
|
26
|
-
this.#label.setAttribute(
|
|
27
|
-
this.#
|
|
38
|
+
this.#label.classList.add("textarea_label");
|
|
39
|
+
this.#label.setAttribute("for", this.#id);
|
|
40
|
+
this.#chuiTextInput.appendChild(this.#label);
|
|
28
41
|
}
|
|
29
|
-
if (options.placeholder !== undefined) this.#
|
|
30
|
-
if (options.width !== undefined) this.#
|
|
31
|
-
if (options.height !== undefined) this.#
|
|
42
|
+
if (options.placeholder !== undefined) this.#textArea.placeholder = options.placeholder;
|
|
43
|
+
if (options.width !== undefined) this.#chuiTextInput.style.width = options.width;
|
|
44
|
+
if (options.height !== undefined) this.#chuiTextInput.style.height = options.height;
|
|
32
45
|
// Рамку с кольцом при фокусе рисует общее правило темы (`.area_input:hover`,
|
|
33
46
|
// `:focus-within`), а не компонент: прежде он ставил то же самое инлайном,
|
|
34
47
|
// а на `blur` снимал весь атрибут `style`
|
|
35
|
-
this.#
|
|
48
|
+
this.#chuiTextInput.appendChild(this.#textArea);
|
|
49
|
+
}
|
|
50
|
+
getName() {
|
|
51
|
+
return this.#textArea.name;
|
|
52
|
+
}
|
|
53
|
+
getTitle() {
|
|
54
|
+
return this.#title;
|
|
55
|
+
}
|
|
56
|
+
getValue() {
|
|
57
|
+
return this.#textArea.value;
|
|
58
|
+
}
|
|
59
|
+
setValue(text = String()) {
|
|
60
|
+
this.#textArea.value = text;
|
|
36
61
|
}
|
|
37
|
-
getName() { return this.#text_area.name; }
|
|
38
|
-
getTitle() { return this.#title; }
|
|
39
|
-
getValue() { return this.#text_area.value; }
|
|
40
|
-
setValue(text = String()) { this.#text_area.value = text; }
|
|
41
62
|
setDisabled(boolean = Boolean()) {
|
|
42
|
-
this.#
|
|
63
|
+
this.#textArea.disabled = boolean;
|
|
43
64
|
if (boolean) {
|
|
44
|
-
this.#
|
|
45
|
-
this.#
|
|
46
|
-
this.#label.classList.remove("textarea_label")
|
|
47
|
-
this.#label.classList.add("textarea_label_disabled")
|
|
65
|
+
this.#textArea.classList.remove("area_input");
|
|
66
|
+
this.#textArea.classList.add("area_input_disabled");
|
|
67
|
+
this.#label.classList.remove("textarea_label");
|
|
68
|
+
this.#label.classList.add("textarea_label_disabled");
|
|
48
69
|
} else {
|
|
49
|
-
this.#
|
|
50
|
-
this.#
|
|
51
|
-
this.#label.classList.add("textarea_label")
|
|
52
|
-
this.#label.classList.remove("textarea_label_disabled")
|
|
70
|
+
this.#textArea.classList.add("area_input");
|
|
71
|
+
this.#textArea.classList.remove("area_input_disabled");
|
|
72
|
+
this.#label.classList.add("textarea_label");
|
|
73
|
+
this.#label.classList.remove("textarea_label_disabled");
|
|
53
74
|
}
|
|
54
75
|
}
|
|
55
|
-
set() {
|
|
76
|
+
set() {
|
|
77
|
+
return this.#chuiTextInput;
|
|
78
|
+
}
|
|
56
79
|
}
|
|
57
80
|
|
|
58
|
-
exports.TextArea = TextArea
|
|
81
|
+
exports.TextArea = TextArea;
|