Skip to content

Commit 2a90e89

Browse files
committed
[PRAC/cont] Add "hash" for output-title
Adding #/span for future resetting of clients tbl sorting. Worth noting: - "tabindex" selections. core: B-3 / JS-BL
1 parent 8a52477 commit 2a90e89

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-client/css/crm-output.css

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,30 @@
77
padding-left: 90px;
88
}
99

10+
.crm__output-title-wrap {
11+
display: flex;
12+
align-items: center;
13+
column-gap: 2px;
14+
margin-bottom: 12px;
15+
}
16+
1017
.crm__output-title {
11-
margin-bottom: 15px;
1218
font-weight: var(--semi-bold);
1319
font-size: 28px;
1420
}
1521

22+
.crm__output-title-hash {
23+
font-weight: var(--semi-bold);
24+
font-size: 32px;
25+
line-height: 44px;
26+
color: var(--main-purple);
27+
cursor: pointer;
28+
}
29+
30+
.crm__output-title-hash:focus-visible {
31+
outline: solid rgba(152, 115, 255, 0.5);
32+
}
33+
1634
.crm__output-table {
1735
margin-bottom: 0;
1836
min-height: 400px;
@@ -38,11 +56,11 @@
3856
}
3957

4058
.crm__output-table .crm__o-table-head-cell {
41-
padding-top: 5px;
42-
padding-left: 20px;
59+
padding: 8px 10px;
4360
}
4461

4562
.crm__output-table #table-th-id {
63+
padding-left: 20px;
4664
width: 70px;
4765
font-weight: var(--semi-bold);
4866
color: var(--main-purple);
@@ -53,22 +71,17 @@
5371
}
5472

5573
.crm__output-table #table-th-dt {
56-
width: 190px;
74+
width: 195px;
5775
}
5876

5977
.crm__output-table #table-th-change {
6078
width: 195px;
6179
}
6280

6381
.crm__output-table #table-th-contact {
64-
padding-right: 30px;
6582
width: 145px;
6683
}
6784

68-
.crm__output-table #table-th-action {
69-
/* padding-right: 20px; */
70-
}
71-
7285
.crm__o-table-head-cell:focus-visible {
7386
outline: solid rgba(152, 115, 255, 0.5);
7487
}
@@ -105,7 +118,7 @@
105118
/* media queries, any-hover */
106119

107120
@media (max-width: 992px) {
108-
.crm__output-title {
121+
.crm__output-title-wrap {
109122
margin-bottom: 7px;
110123
}
111124

@@ -128,8 +141,4 @@
128141
.crm__output-table #table-th-contact {
129142
width: 190px;
130143
}
131-
132-
.crm__output-table #table-th-action {
133-
padding-right: 20px;
134-
}
135144
}

core-courses/3-js-basic-level/practicum-js-basic-level/sb-crm-client/js/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
crmSearchContainer.append(searchLogoWrap, searchFormInputWrap);
5656

5757
// организация таблицы данных о клиентах (структура, заголовки колонок, иконки)
58+
const outputTitleWrap = document.createElement('div');
59+
const outputTitleHash = document.createElement('span');
5860
const outputTitle = document.createElement('h2');
5961
const outputTable = document.createElement('table');
6062
const outTableHead = document.createElement('thead');
@@ -84,6 +86,8 @@
8486
const outTblHeadThActionWrap = document.createElement('div');
8587
const outTblHeadThActionText = document.createElement('span');
8688

89+
outputTitleWrap.classList.add('crm__output-title-wrap');
90+
outputTitleHash.classList.add('crm__output-title-hash');
8791
outputTitle.classList.add('crm__output-title');
8892
outputTable.classList.add('crm__output-table', 'table', 'table-hover');
8993
outTableHead.classList.add('crm__output-table-head');
@@ -163,6 +167,8 @@
163167
'head-cell__text-action'
164168
);
165169

170+
outputTitleHash.setAttribute('id', 'hash-tag-title');
171+
outputTitleHash.setAttribute('tabindex', '0');
166172
outTblHeadThId.setAttribute('id', 'table-th-id');
167173
outTblHeadThId.setAttribute('tabindex', '0');
168174
outTblHeadThFIO.setAttribute('id', 'table-th-fio');
@@ -176,6 +182,7 @@
176182
outTblHeadThActions.setAttribute('id', 'table-th-action');
177183
outTblHeadThActions.setAttribute('tabindex', '0');
178184

185+
outputTitleHash.textContent = '#';
179186
outputTitle.textContent = 'Клиенты';
180187
outTblHeadThIdText.textContent = 'ID';
181188
outTblHeadThFIOText.textContent = 'Фамилия Имя Отчество';
@@ -185,6 +192,7 @@
185192
outTblHeadThContactText.textContent = 'Контакты';
186193
outTblHeadThActionText.textContent = 'Действия';
187194

195+
outputTitleWrap.append(outputTitleHash, outputTitle);
188196
outTblHeadThIdWrap.append(outTblHeadThIdText, outTblHeadThIdIcon);
189197
outTblHeadThFIOWrap.append(
190198
outTblHeadThFIOText,
@@ -211,7 +219,7 @@
211219
);
212220
outTableHead.append(outTblHeadTr);
213221
outputTable.append(outTableHead, outTableBody);
214-
crmOutputContainer.append(outputTitle, outputTable);
222+
crmOutputContainer.append(outputTitleWrap, outputTable);
215223

216224
// основные блоки/составляющие элементы приложения
217225
crm.append(crmSearch, crmOutput, crmAdd);

0 commit comments

Comments
 (0)