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.
Files changed (119) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1203 -162
  3. package/framework/appLayout/default/chui_app_layout.js +747 -747
  4. package/framework/appLayout/default/global_style.css +592 -568
  5. package/framework/appLayout/default/main_theme_style.css +118 -101
  6. package/framework/components/chui_accordion/accordion.js +63 -63
  7. package/framework/components/chui_accordion/styles.css +79 -75
  8. package/framework/components/chui_badge/badge.js +55 -55
  9. package/framework/components/chui_badge/styles.css +29 -29
  10. package/framework/components/chui_button/button.js +48 -48
  11. package/framework/components/chui_button/styles.css +75 -70
  12. package/framework/components/chui_calendar/calendar.js +97 -97
  13. package/framework/components/chui_card/card.js +87 -0
  14. package/framework/components/chui_card/styles.css +72 -0
  15. package/framework/components/chui_code/code.js +18 -18
  16. package/framework/components/chui_code/styles.css +9 -9
  17. package/framework/components/chui_console/console.js +27 -27
  18. package/framework/components/chui_console/styles.css +31 -31
  19. package/framework/components/chui_content_block/content_block.js +51 -51
  20. package/framework/components/chui_content_block/styles.css +2 -2
  21. package/framework/components/chui_context_menu/context_menu.js +230 -0
  22. package/framework/components/chui_context_menu/styles.css +136 -0
  23. package/framework/components/chui_custom_element/custom_element.js +24 -24
  24. package/framework/components/chui_details/details.js +85 -85
  25. package/framework/components/chui_details/styles.css +70 -66
  26. package/framework/components/chui_fieldset/fieldset.js +40 -40
  27. package/framework/components/chui_fieldset/styles.css +24 -24
  28. package/framework/components/chui_form/form.js +40 -40
  29. package/framework/components/chui_form/styles.css +21 -21
  30. package/framework/components/chui_graphs/graphs.js +234 -190
  31. package/framework/components/chui_graphs/styles.css +37 -32
  32. package/framework/components/chui_hero/hero.js +98 -0
  33. package/framework/components/chui_hero/styles.css +91 -0
  34. package/framework/components/chui_html_block/html_block.js +16 -16
  35. package/framework/components/chui_html_block/styles.css +5 -5
  36. package/framework/components/chui_hx/hx.js +15 -15
  37. package/framework/components/chui_hx/styles.css +38 -38
  38. package/framework/components/chui_icons/icons.js +2144 -2144
  39. package/framework/components/chui_icons/styles.css +13 -13
  40. package/framework/components/chui_inputs/chui_check_box/check_box.js +32 -32
  41. package/framework/components/chui_inputs/chui_check_box/styles.css +91 -86
  42. package/framework/components/chui_inputs/chui_combo_box/combo_box.js +166 -150
  43. package/framework/components/chui_inputs/chui_combo_box/styles.css +113 -107
  44. package/framework/components/chui_inputs/chui_date/date.js +177 -174
  45. package/framework/components/chui_inputs/chui_date/styles.css +163 -128
  46. package/framework/components/chui_inputs/chui_email/email.js +61 -61
  47. package/framework/components/chui_inputs/chui_email/styles.css +69 -71
  48. package/framework/components/chui_inputs/chui_file/file.js +76 -76
  49. package/framework/components/chui_inputs/chui_file/styles.css +99 -99
  50. package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +295 -295
  51. package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +212 -235
  52. package/framework/components/chui_inputs/chui_number/number.js +108 -108
  53. package/framework/components/chui_inputs/chui_number/styles.css +84 -84
  54. package/framework/components/chui_inputs/chui_password/password.js +99 -99
  55. package/framework/components/chui_inputs/chui_password/styles.css +97 -97
  56. package/framework/components/chui_inputs/chui_radio_button/radio_button.js +45 -45
  57. package/framework/components/chui_inputs/chui_radio_button/styles.css +76 -73
  58. package/framework/components/chui_inputs/chui_select_box/select_box.js +187 -170
  59. package/framework/components/chui_inputs/chui_select_box/styles.css +123 -117
  60. package/framework/components/chui_inputs/chui_text/styles.css +83 -84
  61. package/framework/components/chui_inputs/chui_text/text.js +91 -91
  62. package/framework/components/chui_inputs/chui_text_area/styles.css +57 -57
  63. package/framework/components/chui_inputs/chui_text_area/text_area.js +61 -61
  64. package/framework/components/chui_inputs/chui_toggle/styles.css +66 -61
  65. package/framework/components/chui_inputs/chui_toggle/toggle.js +36 -36
  66. package/framework/components/chui_label/label.js +54 -54
  67. package/framework/components/chui_label/styles.css +11 -11
  68. package/framework/components/chui_media/audio.js +908 -908
  69. package/framework/components/chui_media/audio_styles.css +458 -458
  70. package/framework/components/chui_media/image.js +105 -105
  71. package/framework/components/chui_media/image_styles.css +61 -61
  72. package/framework/components/chui_media/video.js +248 -248
  73. package/framework/components/chui_media/video_styles.css +160 -160
  74. package/framework/components/chui_menu_bar/menu_bar.js +66 -74
  75. package/framework/components/chui_menu_bar/styles.css +114 -76
  76. package/framework/components/chui_modal/modal.js +142 -135
  77. package/framework/components/chui_modal/styles.css +36 -36
  78. package/framework/components/chui_notification/notification.js +72 -72
  79. package/framework/components/chui_notification/notification_download.js +78 -78
  80. package/framework/components/chui_notification/notification_download_progress.css +119 -123
  81. package/framework/components/chui_notification/notification_download_progress.js +105 -105
  82. package/framework/components/chui_notification/notification_update.js +54 -54
  83. package/framework/components/chui_notification/styles.css +91 -91
  84. package/framework/components/chui_notification/styles_download.css +85 -85
  85. package/framework/components/chui_notification/styles_update.css +73 -73
  86. package/framework/components/chui_paragraph/paragraph.js +14 -14
  87. package/framework/components/chui_paragraph/styles.css +6 -6
  88. package/framework/components/chui_popups/popups.js +250 -250
  89. package/framework/components/chui_popups/styles.css +129 -115
  90. package/framework/components/chui_progress_bar/progress_bar.js +28 -28
  91. package/framework/components/chui_progress_bar/styles.css +28 -28
  92. package/framework/components/chui_radio_group/radio_group.js +57 -57
  93. package/framework/components/chui_radio_group/styles.css +3 -3
  94. package/framework/components/chui_slideshow/slideshow.js +75 -75
  95. package/framework/components/chui_slideshow/styles.css +94 -85
  96. package/framework/components/chui_spinner/spinner.js +45 -45
  97. package/framework/components/chui_spinner/styles.css +23 -23
  98. package/framework/components/chui_table/styles.css +42 -42
  99. package/framework/components/chui_table/table.js +234 -234
  100. package/framework/components/chui_tabs/chui_tabs.js +77 -77
  101. package/framework/components/chui_tabs/styles.css +54 -48
  102. package/framework/components/chui_text_editor/styles.css +217 -217
  103. package/framework/components/chui_text_editor/text_editor.js +144 -144
  104. package/framework/components/chui_text_editor/text_editor_panel.js +568 -568
  105. package/framework/components/chui_tree_view/styles.css +81 -75
  106. package/framework/components/chui_tree_view/tree_view.js +90 -90
  107. package/framework/components/chui_webview/styles.css +27 -27
  108. package/framework/components/chui_webview/webview.js +103 -103
  109. package/framework/components/telegram_bot/chui_telegram_bot.js +183 -183
  110. package/framework/modules/chui_animations/animations.js +121 -121
  111. package/framework/modules/chui_animations/styles.css +79 -79
  112. package/framework/modules/chui_fonts.js +7129 -6974
  113. package/framework/modules/chui_functions.js +106 -78
  114. package/framework/modules/chui_logger/chui_logger.js +53 -53
  115. package/framework/modules/chui_page/page.js +86 -86
  116. package/framework/modules/chui_page/styles.css +9 -9
  117. package/framework/tray_bar/chui_menu_items.js +48 -48
  118. package/index.js +570 -555
  119. package/package.json +51 -46
@@ -1,25 +1,25 @@
1
- class CustomElement {
2
- #chui_custom_element = undefined
3
- constructor(options = {
4
- tag: String(), id: String(), className: String(), pathToCSS: String()
5
- }) {
6
- if (options.tag === undefined) throw new Error("Не установлен тэг элемента")
7
- this.#chui_custom_element = document.createElement(options.tag);
8
- if (options.id === undefined) throw new Error("Не установлен идентификатор элемента")
9
- require('../../modules/chui_functions').setStyles(options.pathToCSS, `chUiJS_CustomElement_${options.id}`)
10
- this.#chui_custom_element.id = options.id
11
- this.#chui_custom_element.className = options.className
12
- }
13
- addEventListener(type = String(), listener = () => {}) {
14
- this.#chui_custom_element.addEventListener(type, listener)
15
- }
16
- innerText(innerText = String()) {
17
- this.#chui_custom_element.innerText = innerText
18
- }
19
- innerHTML(innerHTML = String()) {
20
- this.#chui_custom_element.innerHTML = innerHTML
21
- }
22
- set() { return this.#chui_custom_element }
23
- }
24
-
1
+ class CustomElement {
2
+ #chui_custom_element = undefined
3
+ constructor(options = {
4
+ tag: String(), id: String(), className: String(), pathToCSS: String()
5
+ }) {
6
+ if (options.tag === undefined) throw new Error("Не установлен тэг элемента")
7
+ this.#chui_custom_element = document.createElement(options.tag);
8
+ if (options.id === undefined) throw new Error("Не установлен идентификатор элемента")
9
+ require('../../modules/chui_functions').setStyles(options.pathToCSS, `chUiJS_CustomElement_${options.id}`)
10
+ this.#chui_custom_element.id = options.id
11
+ this.#chui_custom_element.className = options.className
12
+ }
13
+ addEventListener(type = String(), listener = () => {}) {
14
+ this.#chui_custom_element.addEventListener(type, listener)
15
+ }
16
+ innerText(innerText = String()) {
17
+ this.#chui_custom_element.innerText = innerText
18
+ }
19
+ innerHTML(innerHTML = String()) {
20
+ this.#chui_custom_element.innerHTML = innerHTML
21
+ }
22
+ set() { return this.#chui_custom_element }
23
+ }
24
+
25
25
  exports.CustomElement = CustomElement
@@ -1,86 +1,86 @@
1
- const {Icon, Icons} = require("../chui_icons/icons");
2
-
3
- class Details {
4
- #name = require("randomstring").generate();
5
- #chui_details = document.createElement(`chui_details`);
6
- //
7
- #ab = document.createElement('details_button')
8
- #bt = document.createElement('details_button_text')
9
- #barrow = document.createElement('details_button_arrow')
10
- //
11
- #ap = document.createElement('details_panel')
12
- #html = document.createElement('details_panel_html')
13
- #direction;
14
- #wrap;
15
- #align;
16
- #justify;
17
- #width;
18
- constructor(options = {
19
- title: String(), contenteditable: Boolean(),
20
- direction: String(), wrap: String(), align: String(),
21
- justify: String(), width: String()
22
- }) {
23
- require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_Details');
24
- this.#direction = options.direction;
25
- this.#wrap = options.wrap;
26
- this.#align = options.align;
27
- this.#justify = options.justify;
28
- this.#width = options.width;
29
- this.#html.setAttribute('contenteditable', options.contenteditable);
30
-
31
- if (this.#direction !== undefined) this.#html.style.flexDirection = this.#direction;
32
- if (this.#wrap !== undefined) this.#html.style.flexWrap = this.#wrap;
33
- if (this.#align !== undefined) this.#html.style.alignItems = this.#align;
34
- if (this.#justify !== undefined) this.#html.style.justifyContent = this.#justify;
35
- if (this.#width !== undefined) {
36
- this.#chui_details.style.width = this.#width;
37
- this.#ab.style.width = this.#width;
38
- this.#ap.style.width = this.#width;
39
- this.#html.style.width = this.#width;
40
- }
41
-
42
- this.#ab.setAttribute('name', this.#name)
43
- this.#bt.innerText = options.title;
44
- this.#barrow.style.marginLeft = 'auto'
45
- this.#barrow.innerHTML = new Icon(Icons.HARDWARE.KEYBOARD_ARROW_DOWN).getHTML();
46
- this.#ab.appendChild(this.#bt)
47
- this.#ab.appendChild(this.#barrow)
48
- this.#ap.appendChild(this.#html)
49
- this.#chui_details.appendChild(this.#ab)
50
- this.#chui_details.appendChild(this.#ap)
51
-
52
- //ФУНКЦИИ
53
- let test = this.#chui_details.children;
54
- let i;
55
- for (i = 0; i < test.length; i++) {
56
- let elem = test[i];
57
- if (elem.tagName === 'DETAILS_BUTTON') {
58
- elem.addEventListener('click', () => {
59
- elem.classList.toggle('details_active')
60
- let panel = elem.nextElementSibling;
61
- if (panel.style.maxHeight) {
62
- elem.children[1].children[0].style.transform = 'rotate(0deg)'
63
- panel.style.maxHeight = null;
64
- elem.style.borderBottomLeftRadius = 'var(--border_radius)'
65
- elem.style.borderBottomRightRadius = 'var(--border_radius)'
66
- } else {
67
- elem.children[1].children[0].style.transform = 'rotate(180deg)'
68
- elem.style.borderBottomLeftRadius = '0px'
69
- elem.style.borderBottomRightRadius = '0px'
70
- panel.style.maxHeight = panel.scrollHeight + "px";
71
- }
72
- })
73
- }
74
- }
75
- }
76
- add(...components) {
77
- for (let component of components) {
78
- this.#html.appendChild(component.set());
79
- }
80
- }
81
- set() {
82
- return this.#chui_details;
83
- }
84
- }
85
-
1
+ const {Icon, Icons} = require("../chui_icons/icons");
2
+
3
+ class Details {
4
+ #name = require("randomstring").generate();
5
+ #chui_details = document.createElement(`chui_details`);
6
+ //
7
+ #ab = document.createElement('details_button')
8
+ #bt = document.createElement('details_button_text')
9
+ #barrow = document.createElement('details_button_arrow')
10
+ //
11
+ #ap = document.createElement('details_panel')
12
+ #html = document.createElement('details_panel_html')
13
+ #direction;
14
+ #wrap;
15
+ #align;
16
+ #justify;
17
+ #width;
18
+ constructor(options = {
19
+ title: String(), contenteditable: Boolean(),
20
+ direction: String(), wrap: String(), align: String(),
21
+ justify: String(), width: String()
22
+ }) {
23
+ require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_Details');
24
+ this.#direction = options.direction;
25
+ this.#wrap = options.wrap;
26
+ this.#align = options.align;
27
+ this.#justify = options.justify;
28
+ this.#width = options.width;
29
+ this.#html.setAttribute('contenteditable', options.contenteditable);
30
+
31
+ if (this.#direction !== undefined) this.#html.style.flexDirection = this.#direction;
32
+ if (this.#wrap !== undefined) this.#html.style.flexWrap = this.#wrap;
33
+ if (this.#align !== undefined) this.#html.style.alignItems = this.#align;
34
+ if (this.#justify !== undefined) this.#html.style.justifyContent = this.#justify;
35
+ if (this.#width !== undefined) {
36
+ this.#chui_details.style.width = this.#width;
37
+ this.#ab.style.width = this.#width;
38
+ this.#ap.style.width = this.#width;
39
+ this.#html.style.width = this.#width;
40
+ }
41
+
42
+ this.#ab.setAttribute('name', this.#name)
43
+ this.#bt.innerText = options.title;
44
+ this.#barrow.style.marginLeft = 'auto'
45
+ this.#barrow.innerHTML = new Icon(Icons.HARDWARE.KEYBOARD_ARROW_DOWN).getHTML();
46
+ this.#ab.appendChild(this.#bt)
47
+ this.#ab.appendChild(this.#barrow)
48
+ this.#ap.appendChild(this.#html)
49
+ this.#chui_details.appendChild(this.#ab)
50
+ this.#chui_details.appendChild(this.#ap)
51
+
52
+ //ФУНКЦИИ
53
+ let test = this.#chui_details.children;
54
+ let i;
55
+ for (i = 0; i < test.length; i++) {
56
+ let elem = test[i];
57
+ if (elem.tagName === 'DETAILS_BUTTON') {
58
+ elem.addEventListener('click', () => {
59
+ elem.classList.toggle('details_active')
60
+ let panel = elem.nextElementSibling;
61
+ if (panel.style.maxHeight) {
62
+ elem.children[1].children[0].style.transform = 'rotate(0deg)'
63
+ panel.style.maxHeight = null;
64
+ elem.style.borderBottomLeftRadius = 'var(--border_radius)'
65
+ elem.style.borderBottomRightRadius = 'var(--border_radius)'
66
+ } else {
67
+ elem.children[1].children[0].style.transform = 'rotate(180deg)'
68
+ elem.style.borderBottomLeftRadius = '0px'
69
+ elem.style.borderBottomRightRadius = '0px'
70
+ panel.style.maxHeight = panel.scrollHeight + "px";
71
+ }
72
+ })
73
+ }
74
+ }
75
+ }
76
+ add(...components) {
77
+ for (let component of components) {
78
+ this.#html.appendChild(component.set());
79
+ }
80
+ }
81
+ set() {
82
+ return this.#chui_details;
83
+ }
84
+ }
85
+
86
86
  exports.Details = Details
@@ -1,67 +1,71 @@
1
- chui_details {
2
- display: flex;
3
- flex-direction: column;
4
- height: max-content;
5
- width: max-content;
6
- margin: var(--margin);
7
- font-size: var(--font_default_size);
8
- font-weight:400;
9
- border-radius: var(--border_radius);
10
- border: none;
11
- }
12
-
13
- details_button {
14
- background: var(--element_background);
15
- cursor: pointer;
16
- padding: var(--main_padding);
17
- font-size: var(--font_default_size);
18
- width: -webkit-fill-available;
19
- text-align: left;
20
- outline: none;
21
- display: flex;
22
- align-items: center;
23
- border-radius: var(--border_radius);
24
- color: var(--text_color);
25
- border: none;
26
- }
27
-
28
- details_panel {
29
- background: var(--header_background);
30
- padding: 0 10px;
31
- display: block;
32
- overflow: hidden;
33
- width: -webkit-fill-available;
34
- max-height: 0;
35
- border-bottom-right-radius: var(--border_radius);
36
- border-bottom-left-radius: var(--border_radius);
37
- color: var(--text_color);
38
- border: none;
39
- }
40
-
41
- details_panel_html {
42
- padding: 8px 0;
43
- width: -webkit-fill-available;
44
- display: flex
45
- }
46
-
47
- details_button:hover {
48
- background: var(--blue_prime_background);
49
- }
50
-
51
- details_button:hover details_button_text {
52
- color: var(--text_color_hover);
53
- }
54
-
55
- details_button:hover chui_icon {
56
- color: var(--text_color_hover);
57
- }
58
-
59
- .details_active {
60
- background: var(--blue_prime_background);
61
- color: var(--text_color_hover);
62
- }
63
-
64
- .details_active chui_icon {
65
- background: transparent;
66
- color: var(--text_color_hover);
1
+ chui_details {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: max-content;
5
+ width: max-content;
6
+ margin: var(--margin);
7
+ font-size: var(--font_default_size);
8
+ font-weight:400;
9
+ border-radius: var(--border_radius);
10
+ border: none;
11
+ }
12
+
13
+ details_button {
14
+ background: var(--element_background);
15
+ cursor: pointer;
16
+ padding: var(--main_padding);
17
+ font-size: var(--font_default_size);
18
+ width: -webkit-fill-available;
19
+ text-align: left;
20
+ outline: none;
21
+ display: flex;
22
+ align-items: center;
23
+ border-radius: var(--border_radius);
24
+ color: var(--text_color);
25
+ border: none;
26
+ }
27
+
28
+ details_panel {
29
+ background: var(--element_background);
30
+ padding: 0 10px;
31
+ display: block;
32
+ overflow: hidden;
33
+ width: -webkit-fill-available;
34
+ max-height: 0;
35
+ border-bottom-right-radius: var(--border_radius);
36
+ border-bottom-left-radius: var(--border_radius);
37
+ color: var(--text_color);
38
+ border: none;
39
+ }
40
+
41
+ details_panel_html {
42
+ padding: 8px 0;
43
+ width: -webkit-fill-available;
44
+ display: flex
45
+ }
46
+
47
+ details_button:hover {
48
+ background: var(--blue_prime_background);
49
+ }
50
+
51
+ details_button:active {
52
+ background: var(--element_background_prime);
53
+ }
54
+
55
+ details_button:hover details_button_text {
56
+ color: var(--text_color_hover);
57
+ }
58
+
59
+ details_button:hover chui_icon {
60
+ color: var(--text_color_hover);
61
+ }
62
+
63
+ .details_active {
64
+ background: var(--blue_prime_background);
65
+ color: var(--text_color_hover);
66
+ }
67
+
68
+ .details_active chui_icon {
69
+ background: transparent;
70
+ color: var(--text_color_hover);
67
71
  }
@@ -1,41 +1,41 @@
1
- class FieldSet {
2
- #chui_fieldset = document.createElement('chui_fieldset');
3
- #fieldset = document.createElement("fieldset")
4
- #legend = document.createElement("legend")
5
- constructor(options = {
6
- id: String(), name: String(), title: String(),
7
- style: {
8
- width: String(), height: String(),
9
- direction: String(), wrap: String(),
10
- align: String(), justify: String(),
11
- },
12
- components: []
13
- }) {
14
- require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_FieldSet');
15
- if (options.id !== undefined) this.#fieldset.id = options.id;
16
- if (options.name !== undefined) this.#fieldset.name = options.name;
17
- this.#legend.innerText = options.title;
18
- // Установка стилей
19
- if (options.style !== undefined) {
20
- // Размер
21
- if (options.style.width !== undefined) this.#chui_fieldset.style.width = options.style.width;
22
- if (options.style.height !== undefined) this.#fieldset.style.height = options.style.height;
23
- // Расположение
24
- if (options.style.direction !== undefined) this.#fieldset.style.flexDirection = options.style.direction;
25
- if (options.style.wrap !== undefined) this.#fieldset.style.flexWrap = options.style.wrap;
26
- if (options.style.align !== undefined) this.#fieldset.style.alignItems = options.style.align;
27
- if (options.style.justify !== undefined) this.#fieldset.style.justifyContent = options.style.justify;
28
- }
29
- //
30
- this.#fieldset.appendChild(this.#legend);
31
- this.#chui_fieldset.appendChild(this.#fieldset);
32
- if (options.components.length !== 0) for (let component of options.components) this.#fieldset.appendChild(component.set());
33
- }
34
- getId() { return this.#fieldset.id; }
35
- getLegend() { return this.#legend.innerText; }
36
- setLegend(text = String()) { return this.#legend.innerText = text; }
37
- add(...components) { for (let component of components) this.#fieldset.appendChild(component.set()); }
38
- set() { return this.#chui_fieldset; }
39
- }
40
-
1
+ class FieldSet {
2
+ #chui_fieldset = document.createElement('chui_fieldset');
3
+ #fieldset = document.createElement("fieldset")
4
+ #legend = document.createElement("legend")
5
+ constructor(options = {
6
+ id: String(), name: String(), title: String(),
7
+ style: {
8
+ width: String(), height: String(),
9
+ direction: String(), wrap: String(),
10
+ align: String(), justify: String(),
11
+ },
12
+ components: []
13
+ }) {
14
+ require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_FieldSet');
15
+ if (options.id !== undefined) this.#fieldset.id = options.id;
16
+ if (options.name !== undefined) this.#fieldset.name = options.name;
17
+ this.#legend.innerText = options.title;
18
+ // Установка стилей
19
+ if (options.style !== undefined) {
20
+ // Размер
21
+ if (options.style.width !== undefined) this.#chui_fieldset.style.width = options.style.width;
22
+ if (options.style.height !== undefined) this.#fieldset.style.height = options.style.height;
23
+ // Расположение
24
+ if (options.style.direction !== undefined) this.#fieldset.style.flexDirection = options.style.direction;
25
+ if (options.style.wrap !== undefined) this.#fieldset.style.flexWrap = options.style.wrap;
26
+ if (options.style.align !== undefined) this.#fieldset.style.alignItems = options.style.align;
27
+ if (options.style.justify !== undefined) this.#fieldset.style.justifyContent = options.style.justify;
28
+ }
29
+ //
30
+ this.#fieldset.appendChild(this.#legend);
31
+ this.#chui_fieldset.appendChild(this.#fieldset);
32
+ if (options.components.length !== 0) for (let component of options.components) this.#fieldset.appendChild(component.set());
33
+ }
34
+ getId() { return this.#fieldset.id; }
35
+ getLegend() { return this.#legend.innerText; }
36
+ setLegend(text = String()) { return this.#legend.innerText = text; }
37
+ add(...components) { for (let component of components) this.#fieldset.appendChild(component.set()); }
38
+ set() { return this.#chui_fieldset; }
39
+ }
40
+
41
41
  exports.FieldSet = FieldSet
@@ -1,25 +1,25 @@
1
- chui_fieldset {
2
- height: max-content;
3
- width: max-content;
4
- border-radius: var(--border_radius);
5
- margin: var(--margin);
6
- }
7
-
8
- fieldset {
9
- height: -webkit-fill-available;
10
- width: -webkit-fill-available;
11
- border: none;
12
- border-radius: var(--border_radius);
13
- padding: 0 6px 6px 6px;
14
- display: flex;
15
- }
16
-
17
- legend {
18
- color: var(--blue_prime_background);
19
- padding: var(--test_padding);
20
- font-size: var(--font_default_size);
21
- font-weight: 500;
22
- border: none;
23
- border-radius: var(--border_radius);
24
- margin-left: var(--margin);
1
+ chui_fieldset {
2
+ height: max-content;
3
+ width: max-content;
4
+ border-radius: var(--border_radius);
5
+ margin: var(--margin);
6
+ }
7
+
8
+ fieldset {
9
+ height: -webkit-fill-available;
10
+ width: -webkit-fill-available;
11
+ border: none;
12
+ border-radius: var(--border_radius);
13
+ padding: 0 6px 6px 6px;
14
+ display: flex;
15
+ }
16
+
17
+ legend {
18
+ color: var(--blue_prime_background);
19
+ padding: var(--test_padding);
20
+ font-size: var(--font_default_size);
21
+ font-weight: 500;
22
+ border: none;
23
+ border-radius: var(--border_radius);
24
+ margin-left: var(--margin);
25
25
  }
@@ -1,41 +1,41 @@
1
- class Form {
2
- #id = require("randomstring").generate();
3
- #chui_form_main = document.createElement("chui_form_main")
4
- #form = document.createElement("form")
5
- constructor(options = {
6
- action: String(),
7
- method: String(),
8
- components: [],
9
- submitEvent: () => {}
10
- }) {
11
- require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_Forms');
12
- this.#chui_form_main.id = this.#id;
13
- this.#chui_form_main.appendChild(this.#form);
14
-
15
- // Установка компонентов в форму
16
- for (let component of options.components) this.#form.appendChild(component.set());
17
- // ===
18
-
19
- //Установка опций
20
- if (options.action) this.#form.action = options.action;
21
- if (options.method) this.#form.method = options.method;
22
- if (options.submitEvent !== undefined) this.#form.addEventListener("submit", options.submitEvent);
23
- // ===
24
- }
25
- //addSubmitEvent(listener = () => {}) { this.#form.addEventListener("submit", listener); }
26
- set() { return this.#chui_form_main }
27
- static SubmitButton(title = String()) { return new SubmitButton(title); }
28
- static METHOD = { GET: "GET", POST: "POST" }
29
- }
30
-
31
- class SubmitButton {
32
- #submit = document.createElement("input")
33
- constructor(title = String()) {
34
- this.#submit.classList.add("chui_form_submit_button")
35
- this.#submit.type = 'submit';
36
- this.#submit.value = title;
37
- }
38
- set() { return this.#submit; }
39
- }
40
-
1
+ class Form {
2
+ #id = require("randomstring").generate();
3
+ #chui_form_main = document.createElement("chui_form_main")
4
+ #form = document.createElement("form")
5
+ constructor(options = {
6
+ action: String(),
7
+ method: String(),
8
+ components: [],
9
+ submitEvent: () => {}
10
+ }) {
11
+ require('../../modules/chui_functions').setStyles(__dirname + "/styles.css", 'chUiJS_Forms');
12
+ this.#chui_form_main.id = this.#id;
13
+ this.#chui_form_main.appendChild(this.#form);
14
+
15
+ // Установка компонентов в форму
16
+ for (let component of options.components) this.#form.appendChild(component.set());
17
+ // ===
18
+
19
+ //Установка опций
20
+ if (options.action) this.#form.action = options.action;
21
+ if (options.method) this.#form.method = options.method;
22
+ if (options.submitEvent !== undefined) this.#form.addEventListener("submit", options.submitEvent);
23
+ // ===
24
+ }
25
+ //addSubmitEvent(listener = () => {}) { this.#form.addEventListener("submit", listener); }
26
+ set() { return this.#chui_form_main }
27
+ static SubmitButton(title = String()) { return new SubmitButton(title); }
28
+ static METHOD = { GET: "GET", POST: "POST" }
29
+ }
30
+
31
+ class SubmitButton {
32
+ #submit = document.createElement("input")
33
+ constructor(title = String()) {
34
+ this.#submit.classList.add("chui_form_submit_button")
35
+ this.#submit.type = 'submit';
36
+ this.#submit.value = title;
37
+ }
38
+ set() { return this.#submit; }
39
+ }
40
+
41
41
  exports.Form = Form
@@ -1,22 +1,22 @@
1
- chui_form_main {
2
- color: var(--text_color);
3
- }
4
-
5
- .chui_form_submit_button {
6
- border: none;
7
- cursor: pointer;
8
- height: max-content;
9
- width: max-content;
10
- border-radius: var(--border_radius);
11
- padding: var(--main_padding);
12
- font-size: var(--font_default_size);
13
- font-weight: 400;
14
- margin: var(--margin);
15
- background: var(--element_background_2);
16
- color: var(--text_color);
17
- }
18
-
19
- .chui_form_submit_button:hover {
20
- background: var(--blue_prime_background);
21
- color: var(--text_color_hover);
1
+ chui_form_main {
2
+ color: var(--text_color);
3
+ }
4
+
5
+ .chui_form_submit_button {
6
+ border: none;
7
+ cursor: pointer;
8
+ height: max-content;
9
+ width: max-content;
10
+ border-radius: var(--border_radius);
11
+ padding: var(--main_padding);
12
+ font-size: var(--font_default_size);
13
+ font-weight: 400;
14
+ margin: var(--margin);
15
+ background: var(--button_background);
16
+ color: var(--text_color);
17
+ }
18
+
19
+ .chui_form_submit_button:hover {
20
+ background: var(--blue_prime_background);
21
+ color: var(--text_color_hover);
22
22
  }