chuijs 3.6.3 → 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 -570
- 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 +7128 -7128
- 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,30 +1,30 @@
|
|
|
1
|
-
chui_badge {
|
|
2
|
-
font-weight: 400;
|
|
3
|
-
height: max-content;
|
|
4
|
-
width: max-content;
|
|
5
|
-
padding: var(--main_padding);
|
|
6
|
-
margin: var(--margin);
|
|
7
|
-
border-radius: var(--border_radius);
|
|
8
|
-
font-size: var(--font_default_size);
|
|
9
|
-
background: var(--badge_cancel_back);
|
|
10
|
-
color: var(--badge_cancel_text);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
chui_badge p {
|
|
14
|
-
margin: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.badge_error {
|
|
18
|
-
background: var(--badge_error_back);
|
|
19
|
-
color: var(--badge_error_text);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.badge_success {
|
|
23
|
-
background: var(--badge_success_back);
|
|
24
|
-
color: var(--badge_success_text);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.badge_warning {
|
|
28
|
-
background: var(--badge_warning_back);
|
|
29
|
-
color: var(--badge_warning_text);
|
|
1
|
+
chui_badge {
|
|
2
|
+
font-weight: 400;
|
|
3
|
+
height: max-content;
|
|
4
|
+
width: max-content;
|
|
5
|
+
padding: var(--main_padding);
|
|
6
|
+
margin: var(--margin);
|
|
7
|
+
border-radius: var(--border_radius);
|
|
8
|
+
font-size: var(--font_default_size);
|
|
9
|
+
background: var(--badge_cancel_back);
|
|
10
|
+
color: var(--badge_cancel_text);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
chui_badge p {
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.badge_error {
|
|
18
|
+
background: var(--badge_error_back);
|
|
19
|
+
color: var(--badge_error_text);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.badge_success {
|
|
23
|
+
background: var(--badge_success_back);
|
|
24
|
+
color: var(--badge_success_text);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.badge_warning {
|
|
28
|
+
background: var(--badge_warning_back);
|
|
29
|
+
color: var(--badge_warning_text);
|
|
30
30
|
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
const {Icon} = require("../chui_icons/icons");
|
|
2
|
-
|
|
3
|
-
class Button {
|
|
4
|
-
#chui_button = document.createElement('chui_button');
|
|
5
|
-
#button = document.createElement('button');
|
|
6
|
-
#button_text = document.createElement('button_text');
|
|
7
|
-
#button_icon = document.createElement('button_icon');
|
|
8
|
-
constructor(options = { reverse: Boolean(), title: String(), icon: undefined, clickEvent: () => {} }) {
|
|
9
|
-
require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", "chUiJS_Button")
|
|
10
|
-
|
|
11
|
-
this.#button.className = "chui_button"
|
|
12
|
-
this.#button_text.className = "chui_button_text"
|
|
13
|
-
|
|
14
|
-
if (options.title !== undefined) this.#button_text.innerText = options.title;
|
|
15
|
-
if (options.icon !== undefined) this.#button_icon.innerHTML = new Icon(options.icon, "var(--header_icon_size)").getHTML();
|
|
16
|
-
|
|
17
|
-
if (options.title !== undefined && options.icon === undefined) {
|
|
18
|
-
this.#button.appendChild(this.#button_text);
|
|
19
|
-
} else if (options.title === undefined && options.icon !== undefined) {
|
|
20
|
-
this.#button.style.padding = "var(--test_padding)"
|
|
21
|
-
this.#button.appendChild(this.#button_icon);
|
|
22
|
-
} else {
|
|
23
|
-
if (options.reverse) {
|
|
24
|
-
this.#button.appendChild(this.#button_icon);
|
|
25
|
-
this.#button_text.style.marginLeft = "var(--test_padding)";
|
|
26
|
-
this.#button.appendChild(this.#button_text);
|
|
27
|
-
} else {
|
|
28
|
-
this.#button.appendChild(this.#button_text);
|
|
29
|
-
this.#button_icon.style.marginLeft = "var(--test_padding)";
|
|
30
|
-
this.#button.appendChild(this.#button_icon);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (options.clickEvent !== undefined) this.#button.addEventListener('click', options.clickEvent);
|
|
35
|
-
this.#button.addEventListener("mousedown", () => {
|
|
36
|
-
return false
|
|
37
|
-
})
|
|
38
|
-
this.#chui_button.appendChild(this.#button)
|
|
39
|
-
}
|
|
40
|
-
getText() { return this.#button.innerText; }
|
|
41
|
-
setText(text = String()) { this.#button.innerText = text; }
|
|
42
|
-
addClickListener(listener = () => {}) { this.#button.addEventListener('click', listener); }
|
|
43
|
-
setDisabled(boolean = Boolean()) {
|
|
44
|
-
this.#button.disabled = boolean
|
|
45
|
-
}
|
|
46
|
-
set() { return this.#chui_button; }
|
|
47
|
-
}
|
|
48
|
-
|
|
1
|
+
const {Icon} = require("../chui_icons/icons");
|
|
2
|
+
|
|
3
|
+
class Button {
|
|
4
|
+
#chui_button = document.createElement('chui_button');
|
|
5
|
+
#button = document.createElement('button');
|
|
6
|
+
#button_text = document.createElement('button_text');
|
|
7
|
+
#button_icon = document.createElement('button_icon');
|
|
8
|
+
constructor(options = { reverse: Boolean(), title: String(), icon: undefined, clickEvent: () => {} }) {
|
|
9
|
+
require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", "chUiJS_Button")
|
|
10
|
+
|
|
11
|
+
this.#button.className = "chui_button"
|
|
12
|
+
this.#button_text.className = "chui_button_text"
|
|
13
|
+
|
|
14
|
+
if (options.title !== undefined) this.#button_text.innerText = options.title;
|
|
15
|
+
if (options.icon !== undefined) this.#button_icon.innerHTML = new Icon(options.icon, "var(--header_icon_size)").getHTML();
|
|
16
|
+
|
|
17
|
+
if (options.title !== undefined && options.icon === undefined) {
|
|
18
|
+
this.#button.appendChild(this.#button_text);
|
|
19
|
+
} else if (options.title === undefined && options.icon !== undefined) {
|
|
20
|
+
this.#button.style.padding = "var(--test_padding)"
|
|
21
|
+
this.#button.appendChild(this.#button_icon);
|
|
22
|
+
} else {
|
|
23
|
+
if (options.reverse) {
|
|
24
|
+
this.#button.appendChild(this.#button_icon);
|
|
25
|
+
this.#button_text.style.marginLeft = "var(--test_padding)";
|
|
26
|
+
this.#button.appendChild(this.#button_text);
|
|
27
|
+
} else {
|
|
28
|
+
this.#button.appendChild(this.#button_text);
|
|
29
|
+
this.#button_icon.style.marginLeft = "var(--test_padding)";
|
|
30
|
+
this.#button.appendChild(this.#button_icon);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (options.clickEvent !== undefined) this.#button.addEventListener('click', options.clickEvent);
|
|
35
|
+
this.#button.addEventListener("mousedown", () => {
|
|
36
|
+
return false
|
|
37
|
+
})
|
|
38
|
+
this.#chui_button.appendChild(this.#button)
|
|
39
|
+
}
|
|
40
|
+
getText() { return this.#button.innerText; }
|
|
41
|
+
setText(text = String()) { this.#button.innerText = text; }
|
|
42
|
+
addClickListener(listener = () => {}) { this.#button.addEventListener('click', listener); }
|
|
43
|
+
setDisabled(boolean = Boolean()) {
|
|
44
|
+
this.#button.disabled = boolean
|
|
45
|
+
}
|
|
46
|
+
set() { return this.#chui_button; }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
49
|
exports.Button = Button
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
chui_button {
|
|
2
|
-
cursor: pointer;
|
|
3
|
-
height: max-content;
|
|
4
|
-
width: max-content;
|
|
5
|
-
border-radius: var(--border_radius);
|
|
6
|
-
margin: var(--margin);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.chui_button {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
height: max-content;
|
|
12
|
-
width: max-content;
|
|
13
|
-
border-radius: var(--border_radius);
|
|
14
|
-
padding: var(--main_padding);
|
|
15
|
-
font-size: var(--font_default_size);
|
|
16
|
-
font-weight: 400;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
background: var(--button_background);
|
|
22
|
-
border: 1px solid var(--button_border_color);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.chui_button:hover {
|
|
26
|
-
background: var(--button_background_hover);
|
|
27
|
-
border: 1px solid var(--button_border_color_hover);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
color: var(--
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.chui_button:disabled
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
chui_button {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
height: max-content;
|
|
4
|
+
width: max-content;
|
|
5
|
+
border-radius: var(--border_radius);
|
|
6
|
+
margin: var(--margin);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.chui_button {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
height: max-content;
|
|
12
|
+
width: max-content;
|
|
13
|
+
border-radius: var(--border_radius);
|
|
14
|
+
padding: var(--main_padding);
|
|
15
|
+
font-size: var(--font_default_size);
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
background: var(--button_background);
|
|
22
|
+
border: 1px solid var(--button_border_color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.chui_button:hover {
|
|
26
|
+
background: var(--button_background_hover);
|
|
27
|
+
border: 1px solid var(--button_border_color_hover);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.chui_button:active:not(:disabled) {
|
|
31
|
+
background: var(--element_background_prime);
|
|
32
|
+
border: 1px solid var(--button_border_color_hover);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.chui_button_text {
|
|
36
|
+
color: var(--text_color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.chui_button:hover .chui_button_text {
|
|
40
|
+
color: var(--text_color_hover);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.chui_button button_icon chui_icon {
|
|
44
|
+
color: var(--text_color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.chui_button:hover button_icon chui_icon {
|
|
48
|
+
color: var(--text_color_hover);
|
|
49
|
+
}
|
|
50
|
+
/* DISABLED STYLES */
|
|
51
|
+
.chui_button:disabled {
|
|
52
|
+
cursor: not-allowed;
|
|
53
|
+
color: var(--text_color_disabled);
|
|
54
|
+
background: var(--button_background_disabled);
|
|
55
|
+
border: 1px solid var(--button_border_color);
|
|
56
|
+
}
|
|
57
|
+
.chui_button:disabled:hover {
|
|
58
|
+
background: var(--button_background_disabled);
|
|
59
|
+
color: var(--text_color_disabled);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.chui_button:disabled .chui_button_text {
|
|
63
|
+
color: var(--text_color_disabled);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.chui_button:disabled:hover .chui_button_text {
|
|
67
|
+
color: var(--text_color_disabled);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.chui_button:disabled button_icon chui_icon {
|
|
71
|
+
color: var(--text_color_disabled);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.chui_button:disabled:hover button_icon chui_icon {
|
|
75
|
+
color: var(--text_color_disabled);
|
|
71
76
|
}
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
class Calendar {
|
|
2
|
-
constructor(year, month) {
|
|
3
|
-
this.year = year;
|
|
4
|
-
this.month = month - 1;
|
|
5
|
-
this.calendar = [
|
|
6
|
-
new Array(7),
|
|
7
|
-
new Array(7),
|
|
8
|
-
new Array(7),
|
|
9
|
-
new Array(7),
|
|
10
|
-
new Array(7),
|
|
11
|
-
new Array(7),
|
|
12
|
-
new Array(7)
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
for (let i = 0; i < 35; i++) {
|
|
16
|
-
let dayzz = new Date(this.year, this.month, i+1);
|
|
17
|
-
if (dayzz.getDay() === 0) {
|
|
18
|
-
this.calendar[0][0] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
19
|
-
}
|
|
20
|
-
if (dayzz.getDay() === 1) {
|
|
21
|
-
this.calendar[0][1] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
22
|
-
}
|
|
23
|
-
if (dayzz.getDay() === 2) {
|
|
24
|
-
this.calendar[0][2] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
25
|
-
}
|
|
26
|
-
if (dayzz.getDay() === 3) {
|
|
27
|
-
this.calendar[0][3] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
28
|
-
}
|
|
29
|
-
if (dayzz.getDay() === 4) {
|
|
30
|
-
this.calendar[0][4] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
31
|
-
}
|
|
32
|
-
if (dayzz.getDay() === 5) {
|
|
33
|
-
this.calendar[0][5] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
34
|
-
}
|
|
35
|
-
if (dayzz.getDay() === 6) {
|
|
36
|
-
this.calendar[0][6] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
this.list = [];
|
|
41
|
-
this.date = new Date(this.year, this.month, 1);
|
|
42
|
-
/*let optionz = {
|
|
43
|
-
era: 'long',
|
|
44
|
-
year: 'numeric',
|
|
45
|
-
month: 'long',
|
|
46
|
-
day: 'numeric',
|
|
47
|
-
weekday: 'long',
|
|
48
|
-
timezone: 'UTC',
|
|
49
|
-
hour: 'numeric',
|
|
50
|
-
minute: 'numeric',
|
|
51
|
-
second: 'numeric'
|
|
52
|
-
};*/
|
|
53
|
-
while (this.date.getMonth() === this.month) {
|
|
54
|
-
let dayToPush = this.date;
|
|
55
|
-
let days = [];
|
|
56
|
-
days.push(dayToPush.toLocaleString('default', {day: 'numeric'}));
|
|
57
|
-
days.push(dayToPush.toLocaleString('default', {weekday: 'short'}).toUpperCase());
|
|
58
|
-
days.push(dayToPush.toLocaleString('default', {month: 'long'}).toUpperCase());
|
|
59
|
-
this.date.setDate(this.date.getDate() + 1);
|
|
60
|
-
this.list.push(days)
|
|
61
|
-
}
|
|
62
|
-
let index = 1;
|
|
63
|
-
for (let day of this.list) {
|
|
64
|
-
for (let name_day of this.calendar[0]) {
|
|
65
|
-
let indexz = this.calendar[0].indexOf(name_day);
|
|
66
|
-
if (day[1].includes(name_day)) {
|
|
67
|
-
this.calendar[index][indexz] = day[0];
|
|
68
|
-
if (indexz === 6) {
|
|
69
|
-
index++;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
getDateNow() {
|
|
76
|
-
return new Date();
|
|
77
|
-
}
|
|
78
|
-
getMonthName() {
|
|
79
|
-
return new Date(this.year, this.month).toLocaleString('default', {month: 'long'}).toUpperCase();
|
|
80
|
-
}
|
|
81
|
-
getDayName() {
|
|
82
|
-
return new Date(this.year, this.month).toLocaleString("default", { weekday: 'long' }).toUpperCase();
|
|
83
|
-
}
|
|
84
|
-
getDate() {
|
|
85
|
-
return new Date(this.year, this.month).getDate();
|
|
86
|
-
}
|
|
87
|
-
getMonth() {
|
|
88
|
-
return new Date(this.year, this.month).getMonth();
|
|
89
|
-
}
|
|
90
|
-
getYear() {
|
|
91
|
-
return new Date(this.year, this.month).getFullYear();
|
|
92
|
-
}
|
|
93
|
-
getCalendar() {
|
|
94
|
-
return this.calendar;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
1
|
+
class Calendar {
|
|
2
|
+
constructor(year, month) {
|
|
3
|
+
this.year = year;
|
|
4
|
+
this.month = month - 1;
|
|
5
|
+
this.calendar = [
|
|
6
|
+
new Array(7),
|
|
7
|
+
new Array(7),
|
|
8
|
+
new Array(7),
|
|
9
|
+
new Array(7),
|
|
10
|
+
new Array(7),
|
|
11
|
+
new Array(7),
|
|
12
|
+
new Array(7)
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i < 35; i++) {
|
|
16
|
+
let dayzz = new Date(this.year, this.month, i+1);
|
|
17
|
+
if (dayzz.getDay() === 0) {
|
|
18
|
+
this.calendar[0][0] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
19
|
+
}
|
|
20
|
+
if (dayzz.getDay() === 1) {
|
|
21
|
+
this.calendar[0][1] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
22
|
+
}
|
|
23
|
+
if (dayzz.getDay() === 2) {
|
|
24
|
+
this.calendar[0][2] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
25
|
+
}
|
|
26
|
+
if (dayzz.getDay() === 3) {
|
|
27
|
+
this.calendar[0][3] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
if (dayzz.getDay() === 4) {
|
|
30
|
+
this.calendar[0][4] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
31
|
+
}
|
|
32
|
+
if (dayzz.getDay() === 5) {
|
|
33
|
+
this.calendar[0][5] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
34
|
+
}
|
|
35
|
+
if (dayzz.getDay() === 6) {
|
|
36
|
+
this.calendar[0][6] = dayzz.toLocaleString("default", { weekday: 'short' }).toUpperCase();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
this.list = [];
|
|
41
|
+
this.date = new Date(this.year, this.month, 1);
|
|
42
|
+
/*let optionz = {
|
|
43
|
+
era: 'long',
|
|
44
|
+
year: 'numeric',
|
|
45
|
+
month: 'long',
|
|
46
|
+
day: 'numeric',
|
|
47
|
+
weekday: 'long',
|
|
48
|
+
timezone: 'UTC',
|
|
49
|
+
hour: 'numeric',
|
|
50
|
+
minute: 'numeric',
|
|
51
|
+
second: 'numeric'
|
|
52
|
+
};*/
|
|
53
|
+
while (this.date.getMonth() === this.month) {
|
|
54
|
+
let dayToPush = this.date;
|
|
55
|
+
let days = [];
|
|
56
|
+
days.push(dayToPush.toLocaleString('default', {day: 'numeric'}));
|
|
57
|
+
days.push(dayToPush.toLocaleString('default', {weekday: 'short'}).toUpperCase());
|
|
58
|
+
days.push(dayToPush.toLocaleString('default', {month: 'long'}).toUpperCase());
|
|
59
|
+
this.date.setDate(this.date.getDate() + 1);
|
|
60
|
+
this.list.push(days)
|
|
61
|
+
}
|
|
62
|
+
let index = 1;
|
|
63
|
+
for (let day of this.list) {
|
|
64
|
+
for (let name_day of this.calendar[0]) {
|
|
65
|
+
let indexz = this.calendar[0].indexOf(name_day);
|
|
66
|
+
if (day[1].includes(name_day)) {
|
|
67
|
+
this.calendar[index][indexz] = day[0];
|
|
68
|
+
if (indexz === 6) {
|
|
69
|
+
index++;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
getDateNow() {
|
|
76
|
+
return new Date();
|
|
77
|
+
}
|
|
78
|
+
getMonthName() {
|
|
79
|
+
return new Date(this.year, this.month).toLocaleString('default', {month: 'long'}).toUpperCase();
|
|
80
|
+
}
|
|
81
|
+
getDayName() {
|
|
82
|
+
return new Date(this.year, this.month).toLocaleString("default", { weekday: 'long' }).toUpperCase();
|
|
83
|
+
}
|
|
84
|
+
getDate() {
|
|
85
|
+
return new Date(this.year, this.month).getDate();
|
|
86
|
+
}
|
|
87
|
+
getMonth() {
|
|
88
|
+
return new Date(this.year, this.month).getMonth();
|
|
89
|
+
}
|
|
90
|
+
getYear() {
|
|
91
|
+
return new Date(this.year, this.month).getFullYear();
|
|
92
|
+
}
|
|
93
|
+
getCalendar() {
|
|
94
|
+
return this.calendar;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
98
|
exports.Calendar = Calendar
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const {Icon} = require("../chui_icons/icons");
|
|
2
|
+
|
|
3
|
+
class Card {
|
|
4
|
+
#chui_card = document.createElement("chui_card");
|
|
5
|
+
#head;
|
|
6
|
+
#icon;
|
|
7
|
+
#titles;
|
|
8
|
+
#title;
|
|
9
|
+
#description;
|
|
10
|
+
#body = document.createElement("card_body");
|
|
11
|
+
constructor(options = {
|
|
12
|
+
id: String(),
|
|
13
|
+
title: String(),
|
|
14
|
+
description: String(),
|
|
15
|
+
icon: String(),
|
|
16
|
+
width: String(),
|
|
17
|
+
height: String(),
|
|
18
|
+
style: String(),
|
|
19
|
+
components: []
|
|
20
|
+
}) {
|
|
21
|
+
require("../../modules/chui_functions").setStyles(__dirname + "/styles.css", 'chUiJS_Card');
|
|
22
|
+
if (options.id !== undefined) this.#chui_card.id = options.id;
|
|
23
|
+
if (options.style !== undefined) this.#chui_card.classList.add(options.style);
|
|
24
|
+
if (options.width !== undefined) this.#chui_card.style.width = options.width;
|
|
25
|
+
if (options.height !== undefined) this.#chui_card.style.height = options.height;
|
|
26
|
+
this.#chui_card.appendChild(this.#body);
|
|
27
|
+
if (options.icon !== undefined) this.setIcon(options.icon);
|
|
28
|
+
if (options.title !== undefined) this.setTitle(options.title);
|
|
29
|
+
if (options.description !== undefined) this.setDescription(options.description);
|
|
30
|
+
if (options.components !== undefined) this.add(...options.components);
|
|
31
|
+
}
|
|
32
|
+
// GET
|
|
33
|
+
getId() { return this.#chui_card.id; }
|
|
34
|
+
getTitle() { return this.#title === undefined ? "" : this.#title.innerText; }
|
|
35
|
+
getDescription() { return this.#description === undefined ? "" : this.#description.innerText; }
|
|
36
|
+
getBody() { return this.#body; }
|
|
37
|
+
// SET
|
|
38
|
+
setId(id = String()) { this.#chui_card.id = id; }
|
|
39
|
+
setStyle(style = String()) { this.#chui_card.classList.add(style); }
|
|
40
|
+
setWidth(width = String()) { this.#chui_card.style.width = width; }
|
|
41
|
+
setHeight(height = String()) { this.#chui_card.style.height = height; }
|
|
42
|
+
setIcon(icon = String()) {
|
|
43
|
+
if (this.#icon === undefined) {
|
|
44
|
+
this.#icon = document.createElement("card_icon");
|
|
45
|
+
this.#headNode().prepend(this.#icon);
|
|
46
|
+
}
|
|
47
|
+
this.#icon.innerHTML = new Icon(icon, "20px").getHTML();
|
|
48
|
+
}
|
|
49
|
+
setTitle(text = String()) {
|
|
50
|
+
if (this.#title === undefined) {
|
|
51
|
+
this.#title = document.createElement("card_title");
|
|
52
|
+
this.#titlesNode().appendChild(this.#title);
|
|
53
|
+
}
|
|
54
|
+
this.#title.innerText = text;
|
|
55
|
+
}
|
|
56
|
+
setDescription(text = String()) {
|
|
57
|
+
if (this.#description === undefined) {
|
|
58
|
+
this.#description = document.createElement("card_description");
|
|
59
|
+
this.#titlesNode().appendChild(this.#description);
|
|
60
|
+
}
|
|
61
|
+
this.#description.innerText = text;
|
|
62
|
+
}
|
|
63
|
+
// FUNCTIONS
|
|
64
|
+
add(...components) {
|
|
65
|
+
for (let component of components) this.#body.appendChild(component.set());
|
|
66
|
+
}
|
|
67
|
+
clear() { this.#body.innerHTML = ""; }
|
|
68
|
+
// Шапка создаётся при первом обращении и всегда стоит выше тела
|
|
69
|
+
#headNode() {
|
|
70
|
+
if (this.#head === undefined) {
|
|
71
|
+
this.#head = document.createElement("card_head");
|
|
72
|
+
this.#chui_card.prepend(this.#head);
|
|
73
|
+
}
|
|
74
|
+
return this.#head;
|
|
75
|
+
}
|
|
76
|
+
#titlesNode() {
|
|
77
|
+
if (this.#titles === undefined) {
|
|
78
|
+
this.#titles = document.createElement("card_titles");
|
|
79
|
+
this.#headNode().appendChild(this.#titles);
|
|
80
|
+
}
|
|
81
|
+
return this.#titles;
|
|
82
|
+
}
|
|
83
|
+
// RENDER
|
|
84
|
+
set() { return this.#chui_card; }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
exports.Card = Card
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
chui_card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
width: max-content;
|
|
7
|
+
height: max-content;
|
|
8
|
+
padding: 14px 16px 16px 16px;
|
|
9
|
+
border: 1px solid var(--border_color);
|
|
10
|
+
border-radius: var(--radius_md);
|
|
11
|
+
background: var(--element_background_2);
|
|
12
|
+
box-shadow: var(--box_shadow_main);
|
|
13
|
+
font-size: var(--font_default_size);
|
|
14
|
+
color: var(--text_color);
|
|
15
|
+
text-align: left;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
chui_card card_head {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 10px;
|
|
22
|
+
padding-bottom: 10px;
|
|
23
|
+
border-bottom: 1px solid var(--border_color);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
chui_card card_icon {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
flex: 0 0 auto;
|
|
31
|
+
width: 36px;
|
|
32
|
+
height: 36px;
|
|
33
|
+
border-radius: var(--radius_sm);
|
|
34
|
+
background: var(--button_background);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
chui_card card_icon chui_icon {
|
|
38
|
+
font-size: 20px;
|
|
39
|
+
color: var(--blue_prime_background);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
chui_card card_titles {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: 1px;
|
|
46
|
+
min-width: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
chui_card card_title {
|
|
50
|
+
font-size: 15px;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
color: var(--text_color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
chui_card card_description {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: var(--text_color_disabled);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
chui_card card_body {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
gap: 12px;
|
|
65
|
+
width: -webkit-fill-available;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* У <p> из chui_paragraph ширина max-content, поэтому абзац растягиваем по карточке */
|
|
69
|
+
chui_card card_body > p {
|
|
70
|
+
align-self: stretch;
|
|
71
|
+
width: -webkit-fill-available;
|
|
72
|
+
}
|