Skip to content

Commit

Permalink
Merge branch 'master' into repo-names
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox authored Oct 5, 2024
2 parents bcdf844 + bb6c800 commit e94de9e
Show file tree
Hide file tree
Showing 2 changed files with 311 additions and 9 deletions.
234 changes: 228 additions & 6 deletions packages/admin/src-admin/less/adapter.less
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ h4 {
.tabs {
background-color: #272727;
.tab a {
color: #fff;
color: #fff !important;
opacity: 0.7;
.active {
color: #fff;
color: rgb(77, 171, 245) !important;
opacity: 1;
}
}
.active {
border-bottom-color: #436a93;
border-bottom-color: rgb(77, 171, 245) !important;
}
}
.card-panel {
Expand Down Expand Up @@ -389,15 +389,15 @@ h4 {
.tabs {
background-color: #2a3135;
.tab a {
color: #fff;
color: #fff !important;
opacity: 0.7;
.active {
color: #fff;
color: #fff !important;
opacity: 1;
}
}
.active {
border-bottom-color: #436a93;
border-bottom-color: #436a93 !important;
}
}
.card-panel {
Expand Down Expand Up @@ -495,3 +495,225 @@ h4 {
background-color: #436a93;
}
}

/* Design Fix simatec */
.m .col:has(.tabs) {
padding: 0 !important;
}

.m nav {
background-color: rgb(51, 153, 204) !important;
}

.m .btn,
.m .btn-large,
.m .btn-small {
box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px !important;
color: rgba(0, 0, 0, 0.87) !important;
background-color: rgb(224, 224, 224) !important;
}

.m .btn-large:hover,
.m .btn-small:hover,
.m .btn:hover {
background-color: rgb(245, 245, 245) !important;
text-decoration: none !important;
}

.m .btn-floating i {
color: rgba(0, 0, 0, 0.87) !important;
font-size: 1.6rem !important;
line-height: 40px !important;
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.m .btn-floating.btn-small {
width: 40px !important;
height: 40px !important;
}

.m .tabs .tab a.active {
color: rgb(51, 153, 204) !important;
}

.m .tabs .tab a {
color: rgba(0, 0, 0, 0.87) !important;
}

.m .tabs .active {
border-bottom: 2px solid rgb(51, 153, 204) !important;
}

.m .dropdown-toggle {
display: none;
}

.m .dropdown-menu {
display: none;
}

/* Styling for small Screen (Responsive) */
@media screen and (max-width: 768px) {

.highlight,
.highlight thead,
.highlight tbody,
.highlight th,
.highlight td,
.highlights tr,
.table-values,
.table-values thead,
.table-values tbody,
.table-values th,
.table-values td,
.table-values tr {
display: block;
width: 100%;
}

.highlight thead tr,
.table-values thead tr {
display: none;
}

.m .highlight tr,
.m .table-values tr {
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
padding: 10px;
background: #f9f9f9;
}

.m.react-dark .highlight tr,
.m.react-blue .highlight tr,
.m.react-dark .table-values tr,
.m.react-blue .table-values tr {
background: #272727 !important;
}

.highlight td,
.table-values td {
display: block !important;
text-align: left;
padding: 10px;
box-sizing: border-box;
position: relative;
}

.highlight td:before,
.table-values td:before {
font-weight: bold;
display: block;
margin-bottom: 5px;
color: #333;
}

.highlight td::before,
.table-values td::before {
content: attr(data-title);
}

.adapter-body {
overflow: hidden;
}

.m #dialog-select-member {
width: calc(100% - 0.3rem) !important;
height: calc(100% - 0.3rem) !important;
left: 0px;
box-sizing: border-box;
}

.m [type=checkbox]+span:not(.lever) {
height: auto;
}

.m .modal .modal-content {
padding: 5px;
}
}


/* Dropdown-Menu for very small screens */
@media (max-width: 601px) {
.help-link {
display: none;
}

.m .tabs {
display: none !important;
}

.m .dropdown-toggle {
position: fixed;
top: 15px;
right: 10px;
display: flex;
justify-content: center;
align-items: center;
width: 36px;
height: 36px;
box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px !important;
color: rgba(0, 0, 0, 0.87) !important;
background-color: rgb(224, 224, 224) !important;
cursor: pointer;
border-radius: 90px;
z-index: 1000;
}

.m .dropdown-toggle:hover {
background-color: rgb(245, 245, 245) !important;
text-decoration: none !important;
}

.m .dropdown-toggle i,
.m.react-blue.dropdown-toggle i,
.m.react-dark .dropdown-toggle i {
color: rgba(0, 0, 0, 0.87) !important;
font-size: 24px;
}

.m .dropdown-menu {
display: none;
flex-direction: column;
background-color: #f1f1f1;
position: absolute;
width: 250px;
z-index: 999;
}

.m.react-blue .dropdown-menu,
.m.react-dark .dropdown-menu {
background-color: #2a3135;
}

.m .dropdown-menu.show {
display: flex;
}

.m .dropdown-menu a {
padding: 10px;
text-align: center;
color: #000;
text-decoration: none;
}

.m.react-blue .dropdown-menu a,
.m.react-dark .dropdown-menu a {
color: #fff;
}

.m .dropdown-menu a.active {
color: rgb(51, 153, 204) !important;
}

.m .dropdown-menu .active {
border-bottom: 2px solid rgb(51, 153, 204) !important;
}

.m .dropdown-menu a:hover {
background-color: rgb(245, 245, 245);
}
}
86 changes: 83 additions & 3 deletions packages/admin/src-admin/public/js/adapter-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,85 @@ function preInit() {
event.stopImmediatePropagation();
}
});

// Design Fix simatec
designFix();
}
}

// Design Fix simatec
function designFix() {
const cols = document.querySelectorAll('.col:not(.tab)');
const sClasses = ['s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 's11'];

cols.forEach(col => {
sClasses.forEach(sClass => {
if (col.classList.contains(sClass)) {
col.classList.remove(sClass);
}
});

col.classList.add('s12');
});

const logo = document.querySelector('.logo');

if (logo) {
const col = logo.closest('.col');
if (col) {
const sClasses = ['s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 's11', 's12', 'm2', 'm4', 'm8', 'm10', 'm12', 'l2', 'l4', 'l8', 'l10', 'l12',];
sClasses.forEach(sClass => {
if (col.classList.contains(sClass)) {
col.classList.remove(sClass);
}
});
col.classList.add('s10');
col.classList.add('m6');
col.classList.add('l6');
}
}

const allTabs = document.querySelectorAll('.tabs');

allTabs.forEach(function (tabs) {
const dropdownToggle = document.createElement('div');
dropdownToggle.classList.add('dropdown-toggle');

const icon = document.createElement('i');
icon.classList.add('material-icons');
icon.textContent = 'menu';
dropdownToggle.appendChild(icon);

tabs.insertAdjacentElement('beforebegin', dropdownToggle);

const dropdownMenu = document.createElement('div');
dropdownMenu.classList.add('dropdown-menu');

const tabLinks = tabs.querySelectorAll('li a');

tabLinks.forEach(function (tab) {
const dropdownLink = document.createElement('a');
dropdownLink.href = tab.getAttribute('href');
dropdownLink.textContent = tab.textContent;
dropdownMenu.appendChild(dropdownLink);
dropdownLink.addEventListener('click', function () {
tab.click();
dropdownMenu.classList.remove('show');
});
});

tabs.insertAdjacentElement('beforebegin', dropdownMenu);

dropdownToggle.addEventListener('click', function () {
dropdownMenu.classList.toggle('show');
});

const rect = dropdownToggle.getBoundingClientRect();
dropdownMenu.style.top = `${rect.bottom}px`;
dropdownMenu.style.right = '10px';
});
}

function loadScript(src, onload) {
var script = document.createElement('script');
script.onload = onload;
Expand Down Expand Up @@ -2041,6 +2117,8 @@ function values2table(divId, values, onChange, onReady, maxRaw) {
type: $(this).data('type') || 'text',
def: $(this).data('default'),
style: $(this).data('style'),
title: $(this).data('title'),
label: $(this).data('label'),
tdstyle: $(this).data('tdstyle'),
// add radio Button Id and optional span
radioButtomId: $(this).data('radio'),
Expand Down Expand Up @@ -2100,13 +2178,15 @@ function values2table(divId, values, onChange, onReady, maxRaw) {
text += '<td';
var line = '';
var style = '';
var dataName = '';
var tdstyle = '';
if (names[i]) {
if (names[i].name !== '_index') {
tdstyle = names[i].tdstyle || '';
if (tdstyle && tdstyle[0] !== ';') {
tdstyle = ';' + tdstyle;
}
dataName = names[i]?.title ? names[i].title : names[i]?.label ? names[i].label : names[i].name;
}
if (names[i].name === '_index') {
style = (names[i].style ? names[i].style : 'text-align: right;');
Expand Down Expand Up @@ -2170,9 +2250,9 @@ function values2table(divId, values, onChange, onReady, maxRaw) {
}
}
if (style.length || tdstyle.length) {
text += ' style="' + style + tdstyle + '">' + line + '</td>';
text += ' style="' + style + tdstyle + '" ' + 'data-title="' + _(dataName) + '"' + '>' + line + '</td>';
} else {
text += '>' + line + '</td>';
text += ' data-title="' + _(dataName) + '"' + '>' + line + '</td>';
}
}

Expand Down Expand Up @@ -2601,4 +2681,4 @@ function currentTheme() {
if (theme) {
return theme;
}
}
}

0 comments on commit e94de9e

Please sign in to comment.