Skip to content

Commit 7756316

Browse files
committed
[PRAC/cont] Add "output-table" to DOM
Adding classes/attr's, contents. Init positioning, tbl/columns. Worth noting: - layout without the Pixel Perfect approach. core: B-3 / JS-BL
1 parent 054e6f2 commit 7756316

File tree

4 files changed

+110
-1
lines changed

4 files changed

+110
-1
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.crm__output-title {
2+
margin-bottom: 7px;
3+
font-weight: var(--semi-bold);
4+
font-size: 28px;
5+
}
6+
7+
.crm__output-table {
8+
min-height: 400px;
9+
font-family: var(--open-sans), sans-serif;
10+
font-weight: var(--regular);
11+
background-color: var(--white);
12+
}
13+
14+
.crm__output-table tr th {
15+
border: none;
16+
font-weight: var(--regular);
17+
color: var(--text-gray);
18+
background-color: var(--bg-page);
19+
}
20+
21+
.crm__output-table tr th,
22+
.crm__output-table tr td {
23+
/* line-height: 32px;
24+
text-align: center;
25+
vertical-align: middle;
26+
color: var(--starry-night); */
27+
cursor: pointer;
28+
}
29+
30+
.crm__output-table .crm__o-table-head-cell {
31+
padding-top: 5px;
32+
padding-left: 20px;
33+
}
34+
35+
.crm__o-table-head-cell:focus-visible {
36+
outline: solid rgba(152, 115, 255, 0.5);
37+
}
38+
39+
.crm__output-table #table-th-id {
40+
width: 75px;
41+
color: var(--main-purple);
42+
}
43+
44+
.crm__output-table #table-th-fio {
45+
width: 280px;
46+
}
47+
48+
.crm__output-table #table-th-dt {
49+
width: 180px;
50+
}
51+
52+
.crm__output-table #table-th-change {
53+
width: 180px;
54+
}
55+
56+
.crm__output-table #table-th-contact {
57+
padding-right: 30px;
58+
width: 190px;
59+
}
60+
61+
.crm__output-table #table-th-action {
62+
padding-right: 20px;
63+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ html {
1212

1313
*::selection {
1414
color: var(--white);
15-
background-color: var(--specific-gray);
15+
background-color: var(--main-purple);
1616
}
1717

1818
body,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
@import url("page.css");
44
@import url("crm.css");
55
@import url("crm-search.css");
6+
@import url("crm-output.css");
67
@import url("custom-tippy.css");

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,51 @@
6262
const oTableHeadThContacts = document.createElement('th');
6363
const oTableHeadThActions = document.createElement('th');
6464

65+
outputTitle.classList.add('crm__output-title');
66+
outputTable.classList.add('crm__output-table', 'table', 'table-hover');
67+
outputTableHead.classList.add('crm__output-table-head');
68+
outputTableBody.classList.add('crm__output-table-body');
69+
oTableHeadTr.classList.add('crm__o-table-head-row');
70+
oTableHeadThId.classList.add('crm__o-table-head-cell');
71+
oTableHeadThFIO.classList.add('crm__o-table-head-cell');
72+
oTableHeadThCreationDT.classList.add('crm__o-table-head-cell');
73+
oTableHeadThChanges.classList.add('crm__o-table-head-cell');
74+
oTableHeadThContacts.classList.add('crm__o-table-head-cell');
75+
oTableHeadThActions.classList.add('crm__o-table-head-cell');
76+
77+
oTableHeadThId.setAttribute('id', 'table-th-id');
78+
oTableHeadThId.setAttribute('tabindex', '0');
79+
oTableHeadThFIO.setAttribute('id', 'table-th-fio');
80+
oTableHeadThFIO.setAttribute('tabindex', '0');
81+
oTableHeadThCreationDT.setAttribute('id', 'table-th-dt');
82+
oTableHeadThCreationDT.setAttribute('tabindex', '0');
83+
oTableHeadThChanges.setAttribute('id', 'table-th-change');
84+
oTableHeadThChanges.setAttribute('tabindex', '0');
85+
oTableHeadThContacts.setAttribute('id', 'table-th-contact');
86+
oTableHeadThContacts.setAttribute('tabindex', '0');
87+
oTableHeadThActions.setAttribute('id', 'table-th-action');
88+
oTableHeadThActions.setAttribute('tabindex', '0');
89+
90+
outputTitle.textContent = 'Клиенты';
91+
oTableHeadThId.textContent = 'ID';
92+
oTableHeadThFIO.textContent = 'Фамилия Имя Отчество';
93+
oTableHeadThCreationDT.textContent = 'Дата и время создания';
94+
oTableHeadThChanges.textContent = 'Последние изменения';
95+
oTableHeadThContacts.textContent = 'Контакты';
96+
oTableHeadThActions.textContent = 'Действия';
97+
98+
oTableHeadTr.append(
99+
oTableHeadThId,
100+
oTableHeadThFIO,
101+
oTableHeadThCreationDT,
102+
oTableHeadThChanges,
103+
oTableHeadThContacts,
104+
oTableHeadThActions
105+
);
106+
outputTableHead.append(oTableHeadTr);
107+
outputTable.append(outputTableHead, outputTableBody);
108+
crmOutput.append(outputTitle, outputTable);
109+
65110
// ** организация появления/скрытия поля для ввода данных/фильтрационного инпута (по нажатию на logo, на 320px)
66111
document
67112
.querySelector('.crm__search-logo-img')

0 commit comments

Comments
 (0)