mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
refactor(types): Sintassi "moderna" Array
This commit is contained in:
@@ -87,11 +87,11 @@ export default class DataTable extends Component {
|
|||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
tableColumns(children: Array<Children>) {
|
tableColumns(children: Children[]) {
|
||||||
return this.filterElements(children.flat(), TableColumn);
|
return this.filterElements(children.flat(), TableColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
tableRows(children: Array<Children>) {
|
tableRows(children: Children[]) {
|
||||||
let rows = this.filterElements(children.flat(), TableRow);
|
let rows = this.filterElements(children.flat(), TableRow);
|
||||||
|
|
||||||
if (this.attrs.has('checkable')) {
|
if (this.attrs.has('checkable')) {
|
||||||
@@ -105,11 +105,11 @@ export default class DataTable extends Component {
|
|||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
tableFooter(children: Array<Children>) {
|
tableFooter(children: Children[]) {
|
||||||
return this.filterElements(children.flat(), TableFooter);
|
return this.filterElements(children.flat(), TableFooter);
|
||||||
}
|
}
|
||||||
|
|
||||||
filterElements(elements: Array<Children>, tag: Component | string): Array<Children> {
|
filterElements(elements: Children[], tag: Component | string): Children[] {
|
||||||
const filtered = [];
|
const filtered = [];
|
||||||
|
|
||||||
for (const element: Vnode of elements) {
|
for (const element: Vnode of elements) {
|
||||||
|
@@ -20,7 +20,7 @@ export default class TableRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox(children: Array<Children>): Children {
|
checkbox(children: Children[]): Children {
|
||||||
if (!this.attrs.has('checkable')) {
|
if (!this.attrs.has('checkable')) {
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,7 @@ function getFlag(language: string, slot: string = 'graphic', styles: {...} = {})
|
|||||||
|
|
||||||
export default class SetupPage extends Page {
|
export default class SetupPage extends Page {
|
||||||
languages() {
|
languages() {
|
||||||
const listItems: Array[Mithril.Vnode] = [];
|
const listItems: Mithril.Vnode[] = [];
|
||||||
|
|
||||||
for (const lang of this.page.props.languages) {
|
for (const lang of this.page.props.languages) {
|
||||||
const attributes = {
|
const attributes = {
|
||||||
|
Reference in New Issue
Block a user