chuijs 3.6.4 → 3.6.5

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.
@@ -168,7 +168,6 @@ header {
168
168
  align-items: start;
169
169
  background-color: var(--header_background);
170
170
  backdrop-filter: var(--global_blur);
171
- background-blend-mode: overlay;
172
171
  justify-content: space-between;
173
172
  border-bottom: 1px solid var(--border_color);
174
173
  }
@@ -278,25 +277,29 @@ notification_button {
278
277
  border-radius: var(--border_radius);
279
278
  padding: var(--test_padding);
280
279
  margin: var(--margin);
281
- font-size: 22pt;
282
280
  background: transparent;
283
281
  color: var(--text_color);
284
282
  -webkit-app-region: no-drag;
283
+ transition: background-color var(--transition_time) ease, color var(--transition_time) ease;
285
284
  }
286
285
 
287
286
  notification_button:hover {
288
- background: var(--blue_prime_background);
287
+ background: var(--element_background);
289
288
  }
290
289
 
291
- .notification_button_active {
292
- background: var(--blue_prime_background);
290
+ notification_button:active {
291
+ background: var(--element_background_hover);
293
292
  }
294
293
 
295
- .notification_button_active chui_icon {
294
+ /* Открытый ящик уведомлений: акцент, а не ховер */
295
+ .notification_button_active,
296
+ .notification_button_active:hover {
297
+ background: var(--blue_prime_background);
296
298
  color: var(--text_color_hover);
297
299
  }
298
300
 
299
- notification_button:hover chui_icon {
301
+ .notification_button_active chui_icon,
302
+ .notification_button_active:hover chui_icon {
300
303
  color: var(--text_color_hover);
301
304
  }
302
305
 
@@ -309,28 +312,40 @@ app_menu_button {
309
312
  border-radius: var(--border_radius);
310
313
  padding: var(--test_padding);
311
314
  margin: var(--margin);
312
- font-size: 22pt;
313
315
  background: transparent;
314
316
  color: var(--text_color);
315
317
  -webkit-app-region: no-drag;
318
+ transition: background-color var(--transition_time) ease, color var(--transition_time) ease;
316
319
  }
317
320
 
318
321
  app_menu_button:hover {
319
- background: var(--blue_prime_background);
322
+ background: var(--element_background);
320
323
  }
321
324
 
322
- .app_menu_button_active {
323
- background: var(--blue_prime_background);
325
+ app_menu_button:active {
326
+ background: var(--element_background_hover);
324
327
  }
325
328
 
326
- .app_menu_button_active chui_icon {
329
+ /* Открытое меню маршрутов: акцент, а не ховер */
330
+ .app_menu_button_active,
331
+ .app_menu_button_active:hover {
332
+ background: var(--blue_prime_background);
327
333
  color: var(--text_color_hover);
328
334
  }
329
335
 
330
- app_menu_button:hover chui_icon {
336
+ .app_menu_button_active chui_icon,
337
+ .app_menu_button_active:hover chui_icon {
331
338
  color: var(--text_color_hover);
332
339
  }
333
340
 
341
+ /* Клавиатурный фокус элементов шапки (мышь его не показывает) */
342
+ notification_button:focus-visible,
343
+ app_menu_button:focus-visible,
344
+ header_button:focus-visible {
345
+ outline: var(--focus_outline);
346
+ outline-offset: var(--focus_outline_offset);
347
+ }
348
+
334
349
  route_views {
335
350
  display: flex;
336
351
  flex-direction: column;
@@ -525,7 +540,7 @@ header_button {
525
540
  display: flex;
526
541
  flex-direction: row;
527
542
  -webkit-app-region: no-drag;
528
-
543
+ transition: background-color var(--transition_time) ease, color var(--transition_time) ease;
529
544
  }
530
545
 
531
546
  header_button header_button_title {
@@ -533,22 +548,18 @@ header_button header_button_title {
533
548
  }
534
549
 
535
550
  header_button:hover {
536
- background: var(--blue_prime_background);
551
+ background: var(--element_background);
537
552
  }
538
553
 
539
- header_button:hover header_button_title {
540
- color: var(--text_color_hover);
554
+ header_button:active {
555
+ background: var(--element_background_hover);
541
556
  }
542
557
 
543
- header_button:hover chui_icon {
544
- color: var(--text_color_hover);
545
- }
546
-
547
- /*Управление окном*/
558
+ /*Управление окном — те же кнопки-иконки, что и остальные в шапке:
559
+ прозрачный фон, видимый символ, нейтральный ховер. */
548
560
  wc_box {
549
561
  -webkit-app-region: no-drag;
550
- color: var(--text_color);
551
- margin: 0 3px;
562
+ margin: 0 var(--margin);
552
563
  padding: 0 3px;
553
564
  display: flex;
554
565
  align-items: center;
@@ -556,23 +567,35 @@ wc_box {
556
567
  }
557
568
 
558
569
  wc_close, wc_maximize, wc_minimize {
570
+ cursor: pointer;
559
571
  margin: 6px 3px;
560
- padding: 3px;
561
- border-radius: 50%;
562
- /*background: var(--element_background);*/
563
- box-shadow: 0 0 1px 0 var(--border_color);
572
+ padding: 5px;
573
+ border-radius: var(--radius_circle);
574
+ background: transparent;
575
+ color: var(--text_color);
576
+ transition: background-color var(--transition_time) ease, color var(--transition_time) ease;
564
577
  }
565
578
 
579
+ wc_maximize:hover, wc_minimize:hover {
580
+ background: var(--element_background);
581
+ }
582
+
583
+ wc_maximize:active, wc_minimize:active {
584
+ background: var(--element_background_hover);
585
+ }
586
+
587
+ /* Закрытие окна — единственное место, где уместен красный */
566
588
  wc_close:hover {
567
- background-color: var(--red_prime_background);
589
+ background: var(--red_prime_background);
568
590
  }
569
591
 
570
- wc_maximize:hover, wc_minimize:hover {
571
- background-color: var(--blue_prime_background);
592
+ wc_close:hover chui_icon {
593
+ color: var(--text_color_hover);
572
594
  }
573
595
 
574
- wc_close:hover chui_icon, wc_maximize:hover chui_icon, wc_minimize:hover chui_icon {
575
- color: white;
596
+ wc_close:focus-visible, wc_maximize:focus-visible, wc_minimize:focus-visible {
597
+ outline: var(--focus_outline);
598
+ outline-offset: var(--focus_outline_offset);
576
599
  }
577
600
 
578
601
  header_tabs {
@@ -33,6 +33,9 @@
33
33
  --button_background_disabled: rgba(120, 120, 128, 0.09);
34
34
  /* Модальное окно */
35
35
  --modal_background: rgba(250, 250, 252, 0.78);
36
+ /* Занавес под всплывающим слоем: подложка обязана отличаться от --modal_background,
37
+ иначе материал модалки на ней не читается. */
38
+ --modal_scrim: rgba(0, 0, 0, 0.18);
36
39
  /* Элементы */
37
40
  --element_background: rgba(120, 120, 128, 0.2);
38
41
  --element_background_hover: rgba(120, 120, 128, 0.32);
@@ -85,6 +88,9 @@
85
88
  --button_background_disabled: rgba(120, 120, 128, 0.14);
86
89
  /* Модальное окно */
87
90
  --modal_background: rgba(30, 30, 32, 0.78);
91
+ /* Занавес под всплывающим слоем: подложка обязана отличаться от --modal_background,
92
+ иначе материал модалки на ней не читается. */
93
+ --modal_scrim: rgba(0, 0, 0, 0.5);
88
94
  /* Элементы */
89
95
  --element_background: rgba(120, 120, 128, 0.3);
90
96
  --element_background_hover: rgba(120, 120, 128, 0.45);
@@ -58,7 +58,7 @@ class MultiComboBox {
58
58
  this.#button_open_disabled.style.cursor = "not-allowed";
59
59
  this.#dropdown.setAttribute('id', this.#id);
60
60
  this.#MultiComboBox_second.appendChild(this.#MultiComboBox_options)
61
- this.#MultiComboBox_second.appendChild(this.#input)
61
+ this.#MultiComboBox_options.appendChild(this.#input)
62
62
  this.#MultiComboBox_second.appendChild(this.#button_open)
63
63
  this.#MultiComboBox_second.appendChild(this.#dropdown)
64
64
  //LISTENERS
@@ -74,7 +74,8 @@ class MultiComboBox {
74
74
  })
75
75
  this.#MultiComboBox_second.addEventListener('click', (event) => {
76
76
  if (!this.#input.disabled) {
77
- if (event.target.parentNode === this.#MultiComboBox_second) {
77
+ if (event.target.closest('multicombobox_dropdown') === null &&
78
+ event.target.closest('multicombobox_option_added_main') === null) {
78
79
  this.#input.focus()
79
80
  new Animation(this.#dropdown).fadeIn();
80
81
  setOptionDisplay(document.getElementById(this.#id));
@@ -134,12 +135,13 @@ class MultiComboBox {
134
135
  test_main.id = id_name
135
136
  const test_body = document.createElement("multicombobox_option_added_body")
136
137
  test_body.innerText = sect.title + ": " + opt.title;
138
+ test_body.title = sect.title + ": " + opt.title;
137
139
  const test_remove = document.createElement("multicombobox_option_added_remove")
138
140
  test_remove.innerHTML = new Icon(Icons.NAVIGATION.CLOSE, "10pt").getHTML()
139
141
  test_remove.addEventListener("click", () => checkbox_input.click())
140
142
  test_main.appendChild(test_body)
141
143
  test_main.appendChild(test_remove)
142
- this.#MultiComboBox_options.appendChild(test_main)
144
+ this.#MultiComboBox_options.insertBefore(test_main, this.#input)
143
145
  this.#value.push({
144
146
  id: id_name,
145
147
  section: sect.title,
@@ -203,6 +205,7 @@ class MultiComboBox {
203
205
  test_main.id = opt.title
204
206
  const test_body = document.createElement("multicombobox_option_added_body")
205
207
  test_body.innerText = opt.title;
208
+ test_body.title = opt.title;
206
209
  const test_remove = document.createElement("multicombobox_option_added_remove")
207
210
  test_remove.innerHTML = new Icon(Icons.NAVIGATION.CLOSE, "10pt").getHTML()
208
211
  test_main.appendChild(test_body)
@@ -211,7 +214,7 @@ class MultiComboBox {
211
214
  test_remove.addEventListener("click", () => checkbox_input.click())
212
215
  //
213
216
  if (evt.target.checked) {
214
- this.#MultiComboBox_options.appendChild(test_main)
217
+ this.#MultiComboBox_options.insertBefore(test_main, this.#input)
215
218
  this.#value.push(opt)
216
219
  } else {
217
220
  for (let node of this.#MultiComboBox_options.childNodes) {
@@ -275,7 +278,9 @@ class MultiComboBox {
275
278
  clear() {
276
279
  this.#input.value = ""
277
280
  this.#value = []
278
- this.#MultiComboBox_options.innerHTML = ""
281
+ for (let node of [...this.#MultiComboBox_options.childNodes]) {
282
+ if (node !== this.#input) node.remove()
283
+ }
279
284
  for (let checkbox of this.#dropdown.querySelectorAll('input[type="checkbox"]')) {
280
285
  checkbox.checked = false;
281
286
  }
@@ -21,11 +21,17 @@ multicombobox {
21
21
 
22
22
  multicombobox_options {
23
23
  display: flex;
24
- flex-direction: column;
24
+ flex: 1 1 auto;
25
+ flex-direction: row;
26
+ flex-wrap: wrap;
27
+ align-items: center;
28
+ min-width: 0;
29
+ overflow: hidden;
25
30
  }
26
31
 
27
32
  .multicombobox_input {
28
- width: 100%;
33
+ flex: 1 1 40px;
34
+ min-width: 40px;
29
35
  margin: 0;
30
36
  padding: var(--test_padding) 0 var(--test_padding) 10px;
31
37
  background: transparent;
@@ -108,7 +114,8 @@ multicombo_button_open {
108
114
  background: transparent;
109
115
  color: var(--text_color_disabled);
110
116
  text-align: start;
111
- width: 100%;
117
+ flex: 1 1 40px;
118
+ min-width: 40px;
112
119
  margin: 0;
113
120
  padding: var(--test_padding) 0 var(--test_padding) 10px;
114
121
  border: none;
@@ -130,8 +137,10 @@ multicombobox_option_added_main {
130
137
  display: flex;
131
138
  flex-direction: row;
132
139
  height: max-content;
133
- margin: 3px;
140
+ margin: 2px;
134
141
  width: max-content;
142
+ min-width: 0;
143
+ max-width: calc(100% - 6px);
135
144
  background: var(--element_background_2);
136
145
  border-radius: var(--border_radius);
137
146
  font-weight: 500;
@@ -140,12 +149,18 @@ multicombobox_option_added_main {
140
149
  }
141
150
 
142
151
  multicombobox_option_added_body {
143
- padding: 5px 8px;
144
- width: max-content;
152
+ padding: 5px 6px;
153
+ flex: 0 1 auto;
154
+ width: auto;
155
+ min-width: 0;
145
156
  height: max-content;
157
+ overflow: hidden;
158
+ text-overflow: ellipsis;
159
+ white-space: nowrap;
146
160
  }
147
161
 
148
162
  multicombobox_option_added_remove {
163
+ flex: 0 0 auto;
149
164
  width: max-content;
150
165
  height: max-content;
151
166
  font-weight: 600;
@@ -7,7 +7,7 @@ chui_popup {
7
7
  width: 100%;
8
8
  height: 100%;
9
9
  overflow: auto;
10
- background-color: var(--header_background);
10
+ background-color: var(--modal_scrim);
11
11
  padding: 0;
12
12
  border: none;
13
13
  backdrop-filter: var(--global_blur);
@@ -20,22 +20,25 @@ popup_content {
20
20
  height: max-content;
21
21
  display: flex;
22
22
  flex-direction: column;
23
- border-radius: var(--border_radius);
23
+ border-radius: var(--radius_md);
24
24
  color: var(--text_color);
25
- background: var(--element_background_2);
26
- box-shadow: var(--box_shadow_drop);
27
- border: none;
25
+ background: var(--modal_background);
26
+ box-shadow: var(--box_shadow_modal);
27
+ border: 1px solid var(--border_color);
28
+ backdrop-filter: var(--global_blur);
28
29
  }
29
30
 
30
31
  popup_body {
31
- padding: 10px;
32
+ padding: var(--test_padding);
32
33
  display: flex;
33
34
  height: -webkit-fill-available;
34
35
  width: -webkit-fill-available;
35
36
  overflow: auto;
36
37
  flex-direction: column;
37
38
  justify-content: center;
38
- align-items: center;
39
+ /* stretch, а не center: поле ввода в prompt заполняет карточку,
40
+ а центрирование текста задаётся через text-align у title/message */
41
+ align-items: stretch;
39
42
  }
40
43
 
41
44
  popup_buttons {
@@ -43,7 +46,7 @@ popup_buttons {
43
46
  flex-direction: row;
44
47
  justify-content: center;
45
48
  align-items: center;
46
- padding: 8px;
49
+ padding: var(--test_padding);
47
50
  }
48
51
 
49
52
  popup_title {
@@ -51,80 +54,48 @@ popup_title {
51
54
  text-align: center;
52
55
  font-size: var(--font_default_size);
53
56
  font-weight: 500;
54
- padding: 6px;
57
+ padding: var(--margin);
55
58
  }
56
59
 
57
60
  popup_message {
58
61
  display: block;
59
62
  text-align: center;
60
63
  font-size: var(--font_labels_size);
61
- font-weight: 500;
62
- padding: 6px;
63
- }
64
- /* ALERT */
65
- popup_button_ok {
66
- display: flex;
67
- flex-direction: row;
68
- justify-content: center;
69
- align-items: center;
70
- width: -webkit-fill-available;
71
- padding: 10px;
72
- border-radius: var(--border_radius);
73
- color: var(--text_color);
74
- font-weight: 500;
75
- font-size: var(--font_default_size);
76
- }
77
-
78
- popup_button_ok:hover {
79
- color: var(--text_color_hover);
80
- background: var(--blue_prime_background);
81
- }
82
- /* CONFIRM */
83
- popup_button_accept {
84
- display: flex;
85
- flex-direction: row;
86
- justify-content: center;
87
- align-items: center;
88
- width: -webkit-fill-available;
89
- padding: 10px;
90
- border-radius: var(--border_radius);
91
- color: var(--text_color);
92
- font-weight: 500;
93
- font-size: var(--font_default_size);
64
+ font-weight: 400;
65
+ padding: var(--margin);
94
66
  }
95
-
96
- popup_button_accept:hover {
97
- color: var(--text_color_hover);
98
- background: var(--blue_prime_background);
99
- }
100
-
67
+ /* Кнопки — как .chui_button: заполненный контрол с хайрлайном, но равной ширины */
68
+ popup_button_ok,
69
+ popup_button_accept,
101
70
  popup_button_cancel {
71
+ cursor: pointer;
102
72
  display: flex;
103
73
  flex-direction: row;
104
74
  justify-content: center;
105
75
  align-items: center;
106
76
  width: -webkit-fill-available;
107
- padding: 10px;
77
+ padding: var(--main_padding);
78
+ margin: var(--margin);
108
79
  border-radius: var(--border_radius);
80
+ background: var(--button_background);
81
+ border: 1px solid var(--button_border_color);
109
82
  color: var(--text_color);
110
- font-weight: 500;
83
+ font-weight: 400;
111
84
  font-size: var(--font_default_size);
112
85
  }
113
86
 
87
+ popup_button_ok:hover,
88
+ popup_button_accept:hover,
114
89
  popup_button_cancel:hover {
90
+ background: var(--button_background_hover);
91
+ border: 1px solid var(--button_border_color_hover);
115
92
  color: var(--text_color_hover);
116
- background: var(--red_prime_background);
117
- }
118
-
119
- popup_button_ok,
120
- popup_button_accept,
121
- popup_button_cancel {
122
- cursor: pointer;
123
93
  }
124
94
 
125
95
  popup_button_ok:active,
126
96
  popup_button_accept:active,
127
97
  popup_button_cancel:active {
128
98
  background: var(--element_background_prime);
99
+ border: 1px solid var(--button_border_color_hover);
129
100
  color: var(--text_color_hover);
130
101
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "chuijs",
3
3
  "productName": "chuijs",
4
4
  "description": "component framework chUiJS",
5
- "version": "3.6.4",
5
+ "version": "3.6.5",
6
6
  "private": false,
7
7
  "main": "index.js",
8
8
  "author": {