-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
35 changed files
with
376 additions
and
379 deletions.
There are no files selected for viewing
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import './main.css'; | ||
@import './mobile.css' (max-width: 800px); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import '../css/common.css'; | ||
import '../img/icon.png'; | ||
|
||
import { SortableTable } from './src/SortableTable.js'; | ||
import { TabbedUI } from './src/TabbedUI.js'; | ||
|
||
document.documentElement.classList.add('JS'); | ||
|
||
document.addEventListener('DOMContentLoaded', function(){ | ||
let sortableTable = document.querySelector('table.sortable'); | ||
let tabbedUI = document.querySelector('.tabbed-ui'); | ||
let notification = document.querySelector('.notification-wrapper'); | ||
|
||
if (sortableTable) { | ||
new SortableTable(sortableTable); | ||
} | ||
if (tabbedUI) { | ||
new TabbedUI(tabbedUI); | ||
} | ||
if (notification) { | ||
setTimeout(() => { notification.classList.add('hidden'); }, 10000); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { RadioTableColumnsUI } from './src/RadioTableColumnsUI.js'; | ||
|
||
document.addEventListener('DOMContentLoaded', function(){ | ||
let container = document.querySelector('.radio-table-columns'); | ||
|
||
if (container) { | ||
new RadioTableColumnsUI(container); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import '../css/themes.css'; | ||
|
||
import { NumberIndentManager } from './src/NumberIndentManager.js'; | ||
import { OverflowStylesManager } from './src/OverflowStylesManager.js'; | ||
import { RDSPopupManager } from './src/RDSPopupManager.js'; | ||
|
||
document.addEventListener('DOMContentLoaded', function(){ | ||
let container = document.querySelector('.radio-table-container'); | ||
|
||
if (container) { | ||
new NumberIndentManager(container); | ||
new OverflowStylesManager(container); | ||
new RDSPopupManager(container); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
export class NumberIndentManager | ||
{ | ||
constructor(container) | ||
{ | ||
this.container = container; | ||
this.itemsGroups = new Map; | ||
|
||
this.setupItemsGroups(); | ||
this.applyNumberIndent(); | ||
} | ||
|
||
setupItemsGroups() | ||
{ | ||
this.container.querySelectorAll('[data-number-indent]').forEach(item => { | ||
let indentType = item.dataset.numberIndent; | ||
|
||
if (!this.itemsGroups.has(indentType)) { | ||
this.itemsGroups.set(indentType, []); | ||
} | ||
|
||
this.itemsGroups.get(indentType).push(item); | ||
}); | ||
} | ||
|
||
applyNumberIndent() | ||
{ | ||
this.itemsGroups.forEach(items => { | ||
let maxNumber = this.getMaxNumberFromItems(items); | ||
let maxDigits = this.getDigitsCountOfInteger(maxNumber); | ||
|
||
items.forEach(item => { | ||
let number = this.getIntegerFromItem(item); | ||
let digits = this.getDigitsCountOfInteger(number); | ||
let digitsDifference = maxDigits - digits; | ||
|
||
if (digitsDifference) { | ||
item.classList.add(`number-indent-${digitsDifference}`); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
getIntegerFromItem(item) | ||
{ | ||
return Number.parseInt(item.textContent); | ||
} | ||
|
||
getDigitsCountOfInteger(number) | ||
{ | ||
return number.toString().length; | ||
} | ||
|
||
getMaxNumberFromItems(items) | ||
{ | ||
let numbers = items.map(item => this.getIntegerFromItem(item)); | ||
|
||
return numbers.reduce((prev, value) => prev > value ? prev : value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export class OverflowStylesManager | ||
{ | ||
constructor(container) | ||
{ | ||
this.container = container; | ||
|
||
this.refreshStatus(); | ||
|
||
this.container.addEventListener('scroll', this.refreshStatus.bind(this)); | ||
window.addEventListener('resize', this.refreshStatus.bind(this)); | ||
} | ||
|
||
refreshStatus() | ||
{ | ||
const MIN_SCROLL_MARGIN = 3; | ||
|
||
let container = this.container; | ||
let isScrollbarVisible = (container.scrollWidth !== container.clientWidth); | ||
|
||
container.classList.remove('overflow-left'); | ||
container.classList.remove('overflow-right'); | ||
|
||
if (isScrollbarVisible) { | ||
if(container.scrollLeft > MIN_SCROLL_MARGIN) { | ||
container.classList.add('overflow-left'); | ||
} | ||
if((container.scrollWidth - container.clientWidth - container.scrollLeft) > MIN_SCROLL_MARGIN) { | ||
container.classList.add('overflow-right'); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.