chuijs 3.6.2 → 3.6.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/LICENSE +21 -21
- package/README.md +1203 -162
- package/framework/appLayout/default/chui_app_layout.js +747 -747
- package/framework/appLayout/default/global_style.css +592 -568
- package/framework/appLayout/default/main_theme_style.css +118 -101
- package/framework/components/chui_accordion/accordion.js +63 -63
- package/framework/components/chui_accordion/styles.css +79 -75
- package/framework/components/chui_badge/badge.js +55 -55
- package/framework/components/chui_badge/styles.css +29 -29
- package/framework/components/chui_button/button.js +48 -48
- package/framework/components/chui_button/styles.css +75 -70
- package/framework/components/chui_calendar/calendar.js +97 -97
- package/framework/components/chui_card/card.js +87 -0
- package/framework/components/chui_card/styles.css +72 -0
- package/framework/components/chui_code/code.js +18 -18
- package/framework/components/chui_code/styles.css +9 -9
- package/framework/components/chui_console/console.js +27 -27
- package/framework/components/chui_console/styles.css +31 -31
- package/framework/components/chui_content_block/content_block.js +51 -51
- package/framework/components/chui_content_block/styles.css +2 -2
- package/framework/components/chui_context_menu/context_menu.js +230 -0
- package/framework/components/chui_context_menu/styles.css +136 -0
- package/framework/components/chui_custom_element/custom_element.js +24 -24
- package/framework/components/chui_details/details.js +85 -85
- package/framework/components/chui_details/styles.css +70 -66
- package/framework/components/chui_fieldset/fieldset.js +40 -40
- package/framework/components/chui_fieldset/styles.css +24 -24
- package/framework/components/chui_form/form.js +40 -40
- package/framework/components/chui_form/styles.css +21 -21
- package/framework/components/chui_graphs/graphs.js +234 -190
- package/framework/components/chui_graphs/styles.css +37 -32
- package/framework/components/chui_hero/hero.js +98 -0
- package/framework/components/chui_hero/styles.css +91 -0
- package/framework/components/chui_html_block/html_block.js +16 -16
- package/framework/components/chui_html_block/styles.css +5 -5
- package/framework/components/chui_hx/hx.js +15 -15
- package/framework/components/chui_hx/styles.css +38 -38
- package/framework/components/chui_icons/icons.js +2144 -2144
- package/framework/components/chui_icons/styles.css +13 -13
- package/framework/components/chui_inputs/chui_check_box/check_box.js +32 -32
- package/framework/components/chui_inputs/chui_check_box/styles.css +91 -86
- package/framework/components/chui_inputs/chui_combo_box/combo_box.js +166 -150
- package/framework/components/chui_inputs/chui_combo_box/styles.css +113 -107
- package/framework/components/chui_inputs/chui_date/date.js +177 -174
- package/framework/components/chui_inputs/chui_date/styles.css +163 -128
- package/framework/components/chui_inputs/chui_email/email.js +61 -61
- package/framework/components/chui_inputs/chui_email/styles.css +69 -71
- package/framework/components/chui_inputs/chui_file/file.js +76 -76
- package/framework/components/chui_inputs/chui_file/styles.css +99 -99
- package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +295 -295
- package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +212 -235
- package/framework/components/chui_inputs/chui_number/number.js +108 -108
- package/framework/components/chui_inputs/chui_number/styles.css +84 -84
- package/framework/components/chui_inputs/chui_password/password.js +99 -99
- package/framework/components/chui_inputs/chui_password/styles.css +97 -97
- package/framework/components/chui_inputs/chui_radio_button/radio_button.js +45 -45
- package/framework/components/chui_inputs/chui_radio_button/styles.css +76 -73
- package/framework/components/chui_inputs/chui_select_box/select_box.js +187 -170
- package/framework/components/chui_inputs/chui_select_box/styles.css +123 -117
- package/framework/components/chui_inputs/chui_text/styles.css +83 -84
- package/framework/components/chui_inputs/chui_text/text.js +91 -91
- package/framework/components/chui_inputs/chui_text_area/styles.css +57 -57
- package/framework/components/chui_inputs/chui_text_area/text_area.js +61 -61
- package/framework/components/chui_inputs/chui_toggle/styles.css +66 -61
- package/framework/components/chui_inputs/chui_toggle/toggle.js +36 -36
- package/framework/components/chui_label/label.js +54 -54
- package/framework/components/chui_label/styles.css +11 -11
- package/framework/components/chui_media/audio.js +908 -908
- package/framework/components/chui_media/audio_styles.css +458 -458
- package/framework/components/chui_media/image.js +105 -105
- package/framework/components/chui_media/image_styles.css +61 -61
- package/framework/components/chui_media/video.js +248 -248
- package/framework/components/chui_media/video_styles.css +160 -160
- package/framework/components/chui_menu_bar/menu_bar.js +66 -74
- package/framework/components/chui_menu_bar/styles.css +114 -76
- package/framework/components/chui_modal/modal.js +142 -135
- package/framework/components/chui_modal/styles.css +36 -36
- package/framework/components/chui_notification/notification.js +72 -72
- package/framework/components/chui_notification/notification_download.js +78 -78
- package/framework/components/chui_notification/notification_download_progress.css +119 -123
- package/framework/components/chui_notification/notification_download_progress.js +105 -105
- package/framework/components/chui_notification/notification_update.js +54 -54
- package/framework/components/chui_notification/styles.css +91 -91
- package/framework/components/chui_notification/styles_download.css +85 -85
- package/framework/components/chui_notification/styles_update.css +73 -73
- package/framework/components/chui_paragraph/paragraph.js +14 -14
- package/framework/components/chui_paragraph/styles.css +6 -6
- package/framework/components/chui_popups/popups.js +250 -250
- package/framework/components/chui_popups/styles.css +129 -115
- package/framework/components/chui_progress_bar/progress_bar.js +28 -28
- package/framework/components/chui_progress_bar/styles.css +28 -28
- package/framework/components/chui_radio_group/radio_group.js +57 -57
- package/framework/components/chui_radio_group/styles.css +3 -3
- package/framework/components/chui_slideshow/slideshow.js +75 -75
- package/framework/components/chui_slideshow/styles.css +94 -85
- package/framework/components/chui_spinner/spinner.js +45 -45
- package/framework/components/chui_spinner/styles.css +23 -23
- package/framework/components/chui_table/styles.css +42 -42
- package/framework/components/chui_table/table.js +234 -234
- package/framework/components/chui_tabs/chui_tabs.js +77 -77
- package/framework/components/chui_tabs/styles.css +54 -48
- package/framework/components/chui_text_editor/styles.css +217 -217
- package/framework/components/chui_text_editor/text_editor.js +144 -144
- package/framework/components/chui_text_editor/text_editor_panel.js +568 -568
- package/framework/components/chui_tree_view/styles.css +81 -75
- package/framework/components/chui_tree_view/tree_view.js +90 -90
- package/framework/components/chui_webview/styles.css +27 -27
- package/framework/components/chui_webview/webview.js +103 -103
- package/framework/components/telegram_bot/chui_telegram_bot.js +183 -183
- package/framework/modules/chui_animations/animations.js +121 -121
- package/framework/modules/chui_animations/styles.css +79 -79
- package/framework/modules/chui_fonts.js +7129 -6974
- package/framework/modules/chui_functions.js +106 -78
- package/framework/modules/chui_logger/chui_logger.js +53 -53
- package/framework/modules/chui_page/page.js +86 -86
- package/framework/modules/chui_page/styles.css +9 -9
- package/framework/tray_bar/chui_menu_items.js +48 -48
- package/index.js +570 -555
- package/package.json +51 -46
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
chui_number_input {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width:
|
|
5
|
-
height: max-content;
|
|
6
|
-
margin: var(--margin);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
number_main {
|
|
10
|
-
display: flex;
|
|
11
|
-
width: -webkit-fill-available;
|
|
12
|
-
height: max-content;
|
|
13
|
-
margin: 0;
|
|
14
|
-
border-radius: var(--border_radius);
|
|
15
|
-
align-items: center;
|
|
16
|
-
position: relative;
|
|
17
|
-
padding: var(--test_padding) 43px;
|
|
18
|
-
background: var(--element_background);
|
|
19
|
-
border: 1px solid var(--border_color);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.number_buttons {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
height: -webkit-fill-available;
|
|
25
|
-
width: 43px;
|
|
26
|
-
margin: 0;
|
|
27
|
-
display: inline-flex;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
align-items: center;
|
|
30
|
-
position: absolute;
|
|
31
|
-
color: var(--badge_cancel_text);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
input[type=number]::-webkit-inner-spin-button {
|
|
35
|
-
-webkit-appearance: none
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.number_input {
|
|
39
|
-
width: -webkit-fill-available;
|
|
40
|
-
margin: 0;
|
|
41
|
-
padding: 0;
|
|
42
|
-
background: transparent;
|
|
43
|
-
color: var(--text_color);
|
|
44
|
-
text-align: center;
|
|
45
|
-
border: none;
|
|
46
|
-
font-size: var(--font_default_size);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.number_label {
|
|
50
|
-
height: max-content;
|
|
51
|
-
width: max-content;
|
|
52
|
-
margin: var(--margin);
|
|
53
|
-
font-size: var(--font_labels_size);
|
|
54
|
-
font-weight:500;
|
|
55
|
-
color: var(--text_color)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* DISABLED STYLES */
|
|
59
|
-
.number_main_disabled {
|
|
60
|
-
cursor: not-allowed;
|
|
61
|
-
background: var(--element_background_disabled);
|
|
62
|
-
border: 1px solid var(--border_color);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.number_label_disabled {
|
|
66
|
-
cursor: not-allowed;
|
|
67
|
-
height: max-content;
|
|
68
|
-
width: max-content;
|
|
69
|
-
margin: var(--margin);
|
|
70
|
-
font-size: var(--font_labels_size);
|
|
71
|
-
font-weight:500;
|
|
72
|
-
color: var(--text_color_disabled)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.number_input_disabled {
|
|
76
|
-
cursor: not-allowed;
|
|
77
|
-
width: -webkit-fill-available;
|
|
78
|
-
margin: 0;
|
|
79
|
-
padding: 0;
|
|
80
|
-
background: transparent;
|
|
81
|
-
color: var(--text_color_disabled);
|
|
82
|
-
text-align: center;
|
|
83
|
-
border: none;
|
|
84
|
-
font-size: var(--font_default_size);
|
|
1
|
+
chui_number_input {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: var(--control_width);
|
|
5
|
+
height: max-content;
|
|
6
|
+
margin: var(--margin);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
number_main {
|
|
10
|
+
display: flex;
|
|
11
|
+
width: -webkit-fill-available;
|
|
12
|
+
height: max-content;
|
|
13
|
+
margin: 0;
|
|
14
|
+
border-radius: var(--border_radius);
|
|
15
|
+
align-items: center;
|
|
16
|
+
position: relative;
|
|
17
|
+
padding: var(--test_padding) 43px;
|
|
18
|
+
background: var(--element_background);
|
|
19
|
+
border: 1px solid var(--border_color);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.number_buttons {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
height: -webkit-fill-available;
|
|
25
|
+
width: 43px;
|
|
26
|
+
margin: 0;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
position: absolute;
|
|
31
|
+
color: var(--badge_cancel_text);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input[type=number]::-webkit-inner-spin-button {
|
|
35
|
+
-webkit-appearance: none
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.number_input {
|
|
39
|
+
width: -webkit-fill-available;
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 0;
|
|
42
|
+
background: transparent;
|
|
43
|
+
color: var(--text_color);
|
|
44
|
+
text-align: center;
|
|
45
|
+
border: none;
|
|
46
|
+
font-size: var(--font_default_size);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.number_label {
|
|
50
|
+
height: max-content;
|
|
51
|
+
width: max-content;
|
|
52
|
+
margin: var(--margin);
|
|
53
|
+
font-size: var(--font_labels_size);
|
|
54
|
+
font-weight:500;
|
|
55
|
+
color: var(--text_color)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* DISABLED STYLES */
|
|
59
|
+
.number_main_disabled {
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
background: var(--element_background_disabled);
|
|
62
|
+
border: 1px solid var(--border_color);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.number_label_disabled {
|
|
66
|
+
cursor: not-allowed;
|
|
67
|
+
height: max-content;
|
|
68
|
+
width: max-content;
|
|
69
|
+
margin: var(--margin);
|
|
70
|
+
font-size: var(--font_labels_size);
|
|
71
|
+
font-weight:500;
|
|
72
|
+
color: var(--text_color_disabled)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.number_input_disabled {
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
width: -webkit-fill-available;
|
|
78
|
+
margin: 0;
|
|
79
|
+
padding: 0;
|
|
80
|
+
background: transparent;
|
|
81
|
+
color: var(--text_color_disabled);
|
|
82
|
+
text-align: center;
|
|
83
|
+
border: none;
|
|
84
|
+
font-size: var(--font_default_size);
|
|
85
85
|
}
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
const { Icon, Icons } = require('../../chui_icons/icons');
|
|
2
|
-
const {Animation} = require("../../../modules/chui_animations/animations");
|
|
3
|
-
|
|
4
|
-
class PasswordInput {
|
|
5
|
-
#id = require("randomstring").generate();
|
|
6
|
-
#password_main = document.createElement('password_main');
|
|
7
|
-
#see_pass_button = document.createElement('see_pass_button');
|
|
8
|
-
#see_pass_button_disabled = document.createElement('see_pass_button');
|
|
9
|
-
#chui_password_input = document.createElement('chui_password_input');
|
|
10
|
-
#label = document.createElement('label');
|
|
11
|
-
#input = document.createElement('input');
|
|
12
|
-
#title = undefined;
|
|
13
|
-
#error_message_password = document.createElement("error_message_password");
|
|
14
|
-
constructor(options = {
|
|
15
|
-
name: String(), title: String(), placeholder: String(), width: String(), required: Boolean()
|
|
16
|
-
}) {
|
|
17
|
-
require('../../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_PasswordInput');
|
|
18
|
-
this.#title = options.title;
|
|
19
|
-
this.#input.type = 'password';
|
|
20
|
-
this.#input.id = this.#id;
|
|
21
|
-
if (options.name !== undefined) this.#input.name = options.name;
|
|
22
|
-
this.#input.className = 'password_input';
|
|
23
|
-
if (options.required !== undefined) this.#input.required = options.required;
|
|
24
|
-
this.#see_pass_button.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY, undefined, "var(--blue_prime_background)").getHTML();
|
|
25
|
-
this.#see_pass_button_disabled.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY, undefined, "var(--text_color_disabled)").getHTML();
|
|
26
|
-
this.#see_pass_button_disabled.style.cursor = "not-allowed";
|
|
27
|
-
if (options.title !== undefined) {
|
|
28
|
-
this.#label.innerText = options.title;
|
|
29
|
-
this.#label.classList.add('password_label')
|
|
30
|
-
this.#label.setAttribute('for', this.#id);
|
|
31
|
-
this.#chui_password_input.appendChild(this.#label);
|
|
32
|
-
}
|
|
33
|
-
if (options.placeholder !== undefined) this.#input.placeholder = options.placeholder;
|
|
34
|
-
if (options.width !== undefined) this.#chui_password_input.style.width = options.width;
|
|
35
|
-
this.#input.addEventListener('focus', () => {
|
|
36
|
-
this.#password_main.style.border = '1px solid var(--blue_prime_background)';
|
|
37
|
-
this.#label.style.color = 'var(--blue_prime_background)';
|
|
38
|
-
})
|
|
39
|
-
this.#input.addEventListener('blur', () => {
|
|
40
|
-
this.#password_main.removeAttribute('style');
|
|
41
|
-
this.#label.removeAttribute('style');
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
this.#see_pass_button.addEventListener('mousedown', (event) => {
|
|
45
|
-
event.preventDefault();
|
|
46
|
-
return false;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
this.#password_main.appendChild(this.#input);
|
|
50
|
-
this.#password_main.appendChild(this.#see_pass_button);
|
|
51
|
-
this.#see_pass_button.addEventListener('click', () => this.#showPassword());
|
|
52
|
-
this.#chui_password_input.appendChild(this.#password_main);
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
this.#input.addEventListener("input", () => {
|
|
56
|
-
this.#password_main.classList.remove("error_border");
|
|
57
|
-
new Animation(this.#error_message_password).fadeOut();
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
getName() { return this.#input.name; }
|
|
61
|
-
getTitle() { return this.#title; }
|
|
62
|
-
getValue() { return this.#input.value; }
|
|
63
|
-
setValue(text = String()) { this.#input.value = text; }
|
|
64
|
-
setDisabled(boolean = Boolean()) {
|
|
65
|
-
this.#input.disabled = boolean
|
|
66
|
-
if (boolean) {
|
|
67
|
-
this.#password_main.classList.add("password_main_disabled")
|
|
68
|
-
this.#input.className = "password_input_disabled"
|
|
69
|
-
this.#label.className = "password_label_disabled"
|
|
70
|
-
this.#see_pass_button.remove();
|
|
71
|
-
this.#password_main.appendChild(this.#see_pass_button_disabled);
|
|
72
|
-
} else {
|
|
73
|
-
this.#password_main.classList.remove("password_main_disabled")
|
|
74
|
-
this.#input.className = "password_input"
|
|
75
|
-
this.#label.className = "password_label"
|
|
76
|
-
this.#see_pass_button_disabled.remove();
|
|
77
|
-
this.#password_main.appendChild(this.#see_pass_button);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
setErrorMessage(message = String()) {
|
|
81
|
-
this.#password_main.classList.add("error_border");
|
|
82
|
-
this.#error_message_password.innerText = message;
|
|
83
|
-
this.#chui_password_input.appendChild(this.#error_message_password);
|
|
84
|
-
new Animation(this.#error_message_password).fadeIn();
|
|
85
|
-
}
|
|
86
|
-
set() { return this.#chui_password_input; }
|
|
87
|
-
#showPassword() {
|
|
88
|
-
this.#input.focus();
|
|
89
|
-
if (this.#input.type === "password") {
|
|
90
|
-
this.#see_pass_button.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY_OFF, undefined, "var(--blue_prime_background)").getHTML();
|
|
91
|
-
this.#input.type = "text";
|
|
92
|
-
} else {
|
|
93
|
-
this.#see_pass_button.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY, undefined, "var(--blue_prime_background)").getHTML();
|
|
94
|
-
this.#input.type = "password";
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
exports.PasswordInput = PasswordInput
|
|
1
|
+
const { Icon, Icons } = require('../../chui_icons/icons');
|
|
2
|
+
const {Animation} = require("../../../modules/chui_animations/animations");
|
|
3
|
+
|
|
4
|
+
class PasswordInput {
|
|
5
|
+
#id = require("randomstring").generate();
|
|
6
|
+
#password_main = document.createElement('password_main');
|
|
7
|
+
#see_pass_button = document.createElement('see_pass_button');
|
|
8
|
+
#see_pass_button_disabled = document.createElement('see_pass_button');
|
|
9
|
+
#chui_password_input = document.createElement('chui_password_input');
|
|
10
|
+
#label = document.createElement('label');
|
|
11
|
+
#input = document.createElement('input');
|
|
12
|
+
#title = undefined;
|
|
13
|
+
#error_message_password = document.createElement("error_message_password");
|
|
14
|
+
constructor(options = {
|
|
15
|
+
name: String(), title: String(), placeholder: String(), width: String(), required: Boolean()
|
|
16
|
+
}) {
|
|
17
|
+
require('../../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_PasswordInput');
|
|
18
|
+
this.#title = options.title;
|
|
19
|
+
this.#input.type = 'password';
|
|
20
|
+
this.#input.id = this.#id;
|
|
21
|
+
if (options.name !== undefined) this.#input.name = options.name;
|
|
22
|
+
this.#input.className = 'password_input';
|
|
23
|
+
if (options.required !== undefined) this.#input.required = options.required;
|
|
24
|
+
this.#see_pass_button.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY, undefined, "var(--blue_prime_background)").getHTML();
|
|
25
|
+
this.#see_pass_button_disabled.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY, undefined, "var(--text_color_disabled)").getHTML();
|
|
26
|
+
this.#see_pass_button_disabled.style.cursor = "not-allowed";
|
|
27
|
+
if (options.title !== undefined) {
|
|
28
|
+
this.#label.innerText = options.title;
|
|
29
|
+
this.#label.classList.add('password_label')
|
|
30
|
+
this.#label.setAttribute('for', this.#id);
|
|
31
|
+
this.#chui_password_input.appendChild(this.#label);
|
|
32
|
+
}
|
|
33
|
+
if (options.placeholder !== undefined) this.#input.placeholder = options.placeholder;
|
|
34
|
+
if (options.width !== undefined) this.#chui_password_input.style.width = options.width;
|
|
35
|
+
this.#input.addEventListener('focus', () => {
|
|
36
|
+
this.#password_main.style.border = '1px solid var(--blue_prime_background)';
|
|
37
|
+
this.#label.style.color = 'var(--blue_prime_background)';
|
|
38
|
+
})
|
|
39
|
+
this.#input.addEventListener('blur', () => {
|
|
40
|
+
this.#password_main.removeAttribute('style');
|
|
41
|
+
this.#label.removeAttribute('style');
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
this.#see_pass_button.addEventListener('mousedown', (event) => {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
return false;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
this.#password_main.appendChild(this.#input);
|
|
50
|
+
this.#password_main.appendChild(this.#see_pass_button);
|
|
51
|
+
this.#see_pass_button.addEventListener('click', () => this.#showPassword());
|
|
52
|
+
this.#chui_password_input.appendChild(this.#password_main);
|
|
53
|
+
|
|
54
|
+
//
|
|
55
|
+
this.#input.addEventListener("input", () => {
|
|
56
|
+
this.#password_main.classList.remove("error_border");
|
|
57
|
+
new Animation(this.#error_message_password).fadeOut();
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
getName() { return this.#input.name; }
|
|
61
|
+
getTitle() { return this.#title; }
|
|
62
|
+
getValue() { return this.#input.value; }
|
|
63
|
+
setValue(text = String()) { this.#input.value = text; }
|
|
64
|
+
setDisabled(boolean = Boolean()) {
|
|
65
|
+
this.#input.disabled = boolean
|
|
66
|
+
if (boolean) {
|
|
67
|
+
this.#password_main.classList.add("password_main_disabled")
|
|
68
|
+
this.#input.className = "password_input_disabled"
|
|
69
|
+
this.#label.className = "password_label_disabled"
|
|
70
|
+
this.#see_pass_button.remove();
|
|
71
|
+
this.#password_main.appendChild(this.#see_pass_button_disabled);
|
|
72
|
+
} else {
|
|
73
|
+
this.#password_main.classList.remove("password_main_disabled")
|
|
74
|
+
this.#input.className = "password_input"
|
|
75
|
+
this.#label.className = "password_label"
|
|
76
|
+
this.#see_pass_button_disabled.remove();
|
|
77
|
+
this.#password_main.appendChild(this.#see_pass_button);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
setErrorMessage(message = String()) {
|
|
81
|
+
this.#password_main.classList.add("error_border");
|
|
82
|
+
this.#error_message_password.innerText = message;
|
|
83
|
+
this.#chui_password_input.appendChild(this.#error_message_password);
|
|
84
|
+
new Animation(this.#error_message_password).fadeIn();
|
|
85
|
+
}
|
|
86
|
+
set() { return this.#chui_password_input; }
|
|
87
|
+
#showPassword() {
|
|
88
|
+
this.#input.focus();
|
|
89
|
+
if (this.#input.type === "password") {
|
|
90
|
+
this.#see_pass_button.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY_OFF, undefined, "var(--blue_prime_background)").getHTML();
|
|
91
|
+
this.#input.type = "text";
|
|
92
|
+
} else {
|
|
93
|
+
this.#see_pass_button.innerHTML = new Icon(Icons.ACTIONS.VISIBILITY, undefined, "var(--blue_prime_background)").getHTML();
|
|
94
|
+
this.#input.type = "password";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
exports.PasswordInput = PasswordInput
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
chui_password_input {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width:
|
|
5
|
-
height: max-content;
|
|
6
|
-
margin: var(--margin);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
password_main {
|
|
10
|
-
display: flex;
|
|
11
|
-
outline: none;
|
|
12
|
-
width: -webkit-fill-available;
|
|
13
|
-
height: max-content;
|
|
14
|
-
border-radius: var(--border_radius);
|
|
15
|
-
font-size: var(--font_default_size);
|
|
16
|
-
color: var(--text_color);
|
|
17
|
-
position: relative;
|
|
18
|
-
padding: var(--test_padding) 43px var(--main_padding);
|
|
19
|
-
background: var(--element_background);
|
|
20
|
-
border: 1px solid var(--border_color);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.password_input {
|
|
24
|
-
width: -webkit-fill-available;
|
|
25
|
-
margin: 0;
|
|
26
|
-
padding: 0;
|
|
27
|
-
background: transparent;
|
|
28
|
-
color: var(--text_color);
|
|
29
|
-
text-align: start;
|
|
30
|
-
border: none;
|
|
31
|
-
font-size: var(--font_default_size);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
see_pass_button {
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
position: absolute;
|
|
37
|
-
color: var(--badge_cancel_text);
|
|
38
|
-
right: 0;
|
|
39
|
-
top: 0;
|
|
40
|
-
height: -webkit-fill-available;
|
|
41
|
-
width: 43px;
|
|
42
|
-
margin: 0;
|
|
43
|
-
display: inline-flex;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
align-items: center
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.password_label {
|
|
49
|
-
height: max-content;
|
|
50
|
-
width: max-content;
|
|
51
|
-
margin: var(--margin);
|
|
52
|
-
font-size: var(--font_labels_size);
|
|
53
|
-
font-weight:500;
|
|
54
|
-
color: var(--text_color)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.error_border {
|
|
58
|
-
border:
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
error_message_password {
|
|
62
|
-
display: none;
|
|
63
|
-
height: max-content;
|
|
64
|
-
width: max-content;
|
|
65
|
-
margin: var(--margin) var(--margin) 0 var(--margin);
|
|
66
|
-
font-size: var(--font_labels_size);
|
|
67
|
-
font-weight:500;
|
|
68
|
-
color: var(--red_prime_background)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* DISABLED STYLES */
|
|
72
|
-
.password_main_disabled {
|
|
73
|
-
cursor: not-allowed;
|
|
74
|
-
background: var(--element_background_disabled);
|
|
75
|
-
border: 1px solid var(--border_color);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.password_label_disabled {
|
|
79
|
-
cursor: not-allowed;
|
|
80
|
-
height: max-content;
|
|
81
|
-
width: max-content;
|
|
82
|
-
margin: var(--margin);
|
|
83
|
-
font-size: var(--font_labels_size);
|
|
84
|
-
font-weight:500;
|
|
85
|
-
color: var(--text_color_disabled)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.password_input_disabled {
|
|
89
|
-
cursor: not-allowed;
|
|
90
|
-
width: -webkit-fill-available;
|
|
91
|
-
margin: 0;
|
|
92
|
-
padding: 0;
|
|
93
|
-
background: transparent;
|
|
94
|
-
color: var(--text_color_disabled);
|
|
95
|
-
text-align: start;
|
|
96
|
-
border: none;
|
|
97
|
-
font-size: var(--font_default_size);
|
|
1
|
+
chui_password_input {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: var(--control_width);
|
|
5
|
+
height: max-content;
|
|
6
|
+
margin: var(--margin);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
password_main {
|
|
10
|
+
display: flex;
|
|
11
|
+
outline: none;
|
|
12
|
+
width: -webkit-fill-available;
|
|
13
|
+
height: max-content;
|
|
14
|
+
border-radius: var(--border_radius);
|
|
15
|
+
font-size: var(--font_default_size);
|
|
16
|
+
color: var(--text_color);
|
|
17
|
+
position: relative;
|
|
18
|
+
padding: var(--test_padding) 43px var(--main_padding);
|
|
19
|
+
background: var(--element_background);
|
|
20
|
+
border: 1px solid var(--border_color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.password_input {
|
|
24
|
+
width: -webkit-fill-available;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
background: transparent;
|
|
28
|
+
color: var(--text_color);
|
|
29
|
+
text-align: start;
|
|
30
|
+
border: none;
|
|
31
|
+
font-size: var(--font_default_size);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
see_pass_button {
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
position: absolute;
|
|
37
|
+
color: var(--badge_cancel_text);
|
|
38
|
+
right: 0;
|
|
39
|
+
top: 0;
|
|
40
|
+
height: -webkit-fill-available;
|
|
41
|
+
width: 43px;
|
|
42
|
+
margin: 0;
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
align-items: center
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.password_label {
|
|
49
|
+
height: max-content;
|
|
50
|
+
width: max-content;
|
|
51
|
+
margin: var(--margin);
|
|
52
|
+
font-size: var(--font_labels_size);
|
|
53
|
+
font-weight:500;
|
|
54
|
+
color: var(--text_color)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.error_border {
|
|
58
|
+
border: 1px solid var(--red_prime_background);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
error_message_password {
|
|
62
|
+
display: none;
|
|
63
|
+
height: max-content;
|
|
64
|
+
width: max-content;
|
|
65
|
+
margin: var(--margin) var(--margin) 0 var(--margin);
|
|
66
|
+
font-size: var(--font_labels_size);
|
|
67
|
+
font-weight:500;
|
|
68
|
+
color: var(--red_prime_background)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* DISABLED STYLES */
|
|
72
|
+
.password_main_disabled {
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
background: var(--element_background_disabled);
|
|
75
|
+
border: 1px solid var(--border_color);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.password_label_disabled {
|
|
79
|
+
cursor: not-allowed;
|
|
80
|
+
height: max-content;
|
|
81
|
+
width: max-content;
|
|
82
|
+
margin: var(--margin);
|
|
83
|
+
font-size: var(--font_labels_size);
|
|
84
|
+
font-weight:500;
|
|
85
|
+
color: var(--text_color_disabled)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.password_input_disabled {
|
|
89
|
+
cursor: not-allowed;
|
|
90
|
+
width: -webkit-fill-available;
|
|
91
|
+
margin: 0;
|
|
92
|
+
padding: 0;
|
|
93
|
+
background: transparent;
|
|
94
|
+
color: var(--text_color_disabled);
|
|
95
|
+
text-align: start;
|
|
96
|
+
border: none;
|
|
97
|
+
font-size: var(--font_default_size);
|
|
98
98
|
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
class RadioButton {
|
|
2
|
-
#id = require("randomstring").generate();
|
|
3
|
-
#radioButton = document.createElement('radiobutton');
|
|
4
|
-
#input = document.createElement('input');
|
|
5
|
-
#label = document.createElement('label');
|
|
6
|
-
constructor(options = {
|
|
7
|
-
name: String(),
|
|
8
|
-
title: String(),
|
|
9
|
-
stringValue: String(),
|
|
10
|
-
value: Boolean(),
|
|
11
|
-
required: Boolean(),
|
|
12
|
-
width: String()
|
|
13
|
-
}) {
|
|
14
|
-
require('../../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_RadioButton');
|
|
15
|
-
this.#radioButton.style.getPropertyValue('display')
|
|
16
|
-
this.#input.classList.add('radiobutton');
|
|
17
|
-
this.#input.type = 'radio';
|
|
18
|
-
this.#input.classList.add('radiobutton_input');
|
|
19
|
-
this.#input.id = this.#id;
|
|
20
|
-
this.#input.value = options.stringValue;
|
|
21
|
-
this.#label.innerText = options.title;
|
|
22
|
-
this.#label.setAttribute('for', this.#id);
|
|
23
|
-
this.#label.classList.add('labelr')
|
|
24
|
-
if (options.name !== undefined) this.#input.name = options.name;
|
|
25
|
-
if (options.value !== undefined) this.#input.checked = options.value;
|
|
26
|
-
if (options.required !== undefined) this.#input.required = options.required;
|
|
27
|
-
if (options.width !== undefined) {
|
|
28
|
-
this.#radioButton.style.width = options.width;
|
|
29
|
-
if (options.width === "-webkit-fill-available") {
|
|
30
|
-
this.#label.style.width = options.width;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
getName() { return this.#input.name; }
|
|
35
|
-
getValue() { return this.#input.checked; }
|
|
36
|
-
setValue(value = Boolean()) { this.#input.checked = value; }
|
|
37
|
-
addChangeListener(listener) { this.#input.addEventListener('change', listener); }
|
|
38
|
-
setDisabled(boolean = Boolean()) { this.#input.disabled = boolean; }
|
|
39
|
-
set() {
|
|
40
|
-
this.#radioButton.appendChild(this.#input);
|
|
41
|
-
this.#radioButton.appendChild(this.#label);
|
|
42
|
-
return this.#radioButton;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
1
|
+
class RadioButton {
|
|
2
|
+
#id = require("randomstring").generate();
|
|
3
|
+
#radioButton = document.createElement('radiobutton');
|
|
4
|
+
#input = document.createElement('input');
|
|
5
|
+
#label = document.createElement('label');
|
|
6
|
+
constructor(options = {
|
|
7
|
+
name: String(),
|
|
8
|
+
title: String(),
|
|
9
|
+
stringValue: String(),
|
|
10
|
+
value: Boolean(),
|
|
11
|
+
required: Boolean(),
|
|
12
|
+
width: String()
|
|
13
|
+
}) {
|
|
14
|
+
require('../../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_RadioButton');
|
|
15
|
+
this.#radioButton.style.getPropertyValue('display')
|
|
16
|
+
this.#input.classList.add('radiobutton');
|
|
17
|
+
this.#input.type = 'radio';
|
|
18
|
+
this.#input.classList.add('radiobutton_input');
|
|
19
|
+
this.#input.id = this.#id;
|
|
20
|
+
this.#input.value = options.stringValue;
|
|
21
|
+
this.#label.innerText = options.title;
|
|
22
|
+
this.#label.setAttribute('for', this.#id);
|
|
23
|
+
this.#label.classList.add('labelr')
|
|
24
|
+
if (options.name !== undefined) this.#input.name = options.name;
|
|
25
|
+
if (options.value !== undefined) this.#input.checked = options.value;
|
|
26
|
+
if (options.required !== undefined) this.#input.required = options.required;
|
|
27
|
+
if (options.width !== undefined) {
|
|
28
|
+
this.#radioButton.style.width = options.width;
|
|
29
|
+
if (options.width === "-webkit-fill-available") {
|
|
30
|
+
this.#label.style.width = options.width;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
getName() { return this.#input.name; }
|
|
35
|
+
getValue() { return this.#input.checked; }
|
|
36
|
+
setValue(value = Boolean()) { this.#input.checked = value; }
|
|
37
|
+
addChangeListener(listener) { this.#input.addEventListener('change', listener); }
|
|
38
|
+
setDisabled(boolean = Boolean()) { this.#input.disabled = boolean; }
|
|
39
|
+
set() {
|
|
40
|
+
this.#radioButton.appendChild(this.#input);
|
|
41
|
+
this.#radioButton.appendChild(this.#label);
|
|
42
|
+
return this.#radioButton;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
46
|
exports.RadioButton = RadioButton
|