@oscarpalmer/tabela 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tabela.full.js +146 -18
- package/package.json +45 -37
- package/src/components/body.component.ts +11 -7
- package/src/components/column.component.ts +23 -24
- package/src/components/footer.component.ts +7 -5
- package/src/components/group.component.ts +73 -9
- package/src/components/header.component.ts +6 -4
- package/src/components/row.component.ts +28 -18
- package/src/helpers/dom.helpers.ts +27 -29
- package/src/helpers/misc.helpers.ts +5 -0
- package/src/helpers/style.helper.ts +1 -1
- package/src/managers/column.manager.ts +4 -0
- package/src/managers/data.manager.ts +197 -124
- package/src/managers/event.manager.ts +27 -17
- package/src/managers/filter.manager.ts +49 -25
- package/src/managers/group.manager.ts +73 -12
- package/src/managers/navigation.manager.ts +48 -50
- package/src/managers/render.manager.ts +56 -29
- package/src/managers/row.manager.ts +22 -10
- package/src/managers/selection.manager.ts +40 -31
- package/src/managers/sort.manager.ts +58 -43
- package/src/managers/style.manager.ts +171 -0
- package/src/models/column.model.ts +2 -6
- package/src/models/data.model.ts +12 -10
- package/src/models/dom.model.ts +33 -0
- package/src/models/event.model.ts +7 -0
- package/src/models/filter.model.ts +20 -0
- package/src/models/group.model.ts +10 -2
- package/src/models/sort.model.ts +4 -0
- package/src/models/style.model.ts +51 -0
- package/src/models/tabela.model.ts +11 -8
- package/src/tabela.ts +67 -37
- package/types/components/body.component.d.ts +0 -6
- package/types/components/column.component.d.ts +0 -13
- package/types/components/footer.component.d.ts +0 -8
- package/types/components/group.component.d.ts +0 -14
- package/types/components/header.component.d.ts +0 -8
- package/types/components/row.component.d.ts +0 -11
- package/types/helpers/dom.helpers.d.ts +0 -10
- package/types/helpers/misc.helpers.d.ts +0 -2
- package/types/helpers/style.helper.d.ts +0 -1
- package/types/index.d.ts +0 -4
- package/types/managers/column.manager.d.ts +0 -12
- package/types/managers/data.manager.d.ts +0 -29
- package/types/managers/event.manager.d.ts +0 -7
- package/types/managers/filter.manager.d.ts +0 -19
- package/types/managers/group.manager.d.ts +0 -17
- package/types/managers/navigation.manager.d.ts +0 -10
- package/types/managers/render.manager.d.ts +0 -17
- package/types/managers/row.manager.d.ts +0 -13
- package/types/managers/selection.manager.d.ts +0 -24
- package/types/managers/sort.manager.d.ts +0 -28
- package/types/models/body.model.d.ts +0 -4
- package/types/models/column.model.d.ts +0 -13
- package/types/models/data.model.d.ts +0 -24
- package/types/models/filter.model.d.ts +0 -13
- package/types/models/footer.model.d.ts +0 -5
- package/types/models/group.model.d.ts +0 -4
- package/types/models/header.model.d.ts +0 -4
- package/types/models/render.model.d.ts +0 -13
- package/types/models/selection.model.d.ts +0 -8
- package/types/models/sort.model.d.ts +0 -12
- package/types/models/tabela.model.d.ts +0 -39
- package/types/models/tabela.options.d.ts +0 -10
- package/types/tabela.d.ts +0 -15
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const CSS_BUTTON = 'tabela__button';
|
|
2
|
+
|
|
3
|
+
export const CSS_BUTTON_GROUP = 'tabela__button--group';
|
|
4
|
+
|
|
5
|
+
export const CSS_CELL = 'tabela__cell';
|
|
6
|
+
|
|
7
|
+
export const CSS_CELL_BODY = 'tabela__cell--body';
|
|
8
|
+
|
|
9
|
+
export const CSS_CELL_FOOTER = 'tabela__cell--footer';
|
|
10
|
+
|
|
11
|
+
export const CSS_CELL_GROUP = 'tabela__cell--group';
|
|
12
|
+
|
|
13
|
+
export const CSS_FAKER = 'tabela__faker';
|
|
14
|
+
|
|
15
|
+
export const CSS_GROUP = 'tabela__group';
|
|
16
|
+
|
|
17
|
+
export const CSS_GROUP_SELECTED = 'tabela__group__selected';
|
|
18
|
+
|
|
19
|
+
export const CSS_GROUP_TOTAL = 'tabela__group__total';
|
|
20
|
+
|
|
21
|
+
export const CSS_HEADING = 'tabela__heading';
|
|
22
|
+
|
|
23
|
+
export const CSS_HEADING_CONTENT = 'tabela__heading__content';
|
|
24
|
+
|
|
25
|
+
export const CSS_HEADING_SORTER = 'tabela__heading__sorter';
|
|
26
|
+
|
|
27
|
+
export const CSS_ROW = 'tabela__row';
|
|
28
|
+
|
|
29
|
+
export const CSS_ROW_BODY = 'tabela__row--body';
|
|
30
|
+
|
|
31
|
+
export const CSS_ROW_FOOTER = 'tabela__row--footer';
|
|
32
|
+
|
|
33
|
+
export const CSS_ROW_GROUP = 'tabela__row--group tabela__group';
|
|
34
|
+
|
|
35
|
+
export const CSS_ROW_HEADER = 'tabela__row--header';
|
|
36
|
+
|
|
37
|
+
export const CSS_ROW_SELECTED = 'tabela__row--selected';
|
|
38
|
+
|
|
39
|
+
export const CSS_ROWGROUP = 'tabela__rowgroup';
|
|
40
|
+
|
|
41
|
+
export const CSS_ROWGROUP_BODY = 'tabela__rowgroup--body';
|
|
42
|
+
|
|
43
|
+
export const CSS_ROWGROUP_FOOTER = 'tabela__rowgroup--footer';
|
|
44
|
+
|
|
45
|
+
export const CSS_ROWGROUP_HEADER = 'tabela__rowgroup--header';
|
|
46
|
+
|
|
47
|
+
export const CSS_SELECTION = 'tabela__selection';
|
|
48
|
+
|
|
49
|
+
export const CSS_TABLE = 'tabela__table';
|
|
50
|
+
|
|
51
|
+
export const CSS_WRAPPER = 'tabela';
|
|
@@ -5,12 +5,13 @@ import type {ColumnManager} from '../managers/column.manager';
|
|
|
5
5
|
import type {DataManager} from '../managers/data.manager';
|
|
6
6
|
import type {EventManager} from '../managers/event.manager';
|
|
7
7
|
import type {FilterManager} from '../managers/filter.manager';
|
|
8
|
-
import type {
|
|
8
|
+
import type {GroupManager} from '../managers/group.manager';
|
|
9
9
|
import type {NavigationManager} from '../managers/navigation.manager';
|
|
10
10
|
import type {RenderManager} from '../managers/render.manager';
|
|
11
11
|
import type {RowManager} from '../managers/row.manager';
|
|
12
12
|
import type {SelectionManager} from '../managers/selection.manager';
|
|
13
13
|
import type {SortManager} from '../managers/sort.manager';
|
|
14
|
+
import type {StyleManager} from '../managers/style.manager';
|
|
14
15
|
import type {TabelaOptions} from './tabela.options';
|
|
15
16
|
|
|
16
17
|
export type Components = {
|
|
@@ -26,17 +27,19 @@ export type Managers = {
|
|
|
26
27
|
filter: FilterManager;
|
|
27
28
|
group: GroupManager;
|
|
28
29
|
navigation: NavigationManager;
|
|
30
|
+
render: RenderManager;
|
|
29
31
|
row: RowManager;
|
|
30
32
|
selection: SelectionManager;
|
|
31
33
|
sort: SortManager;
|
|
32
|
-
|
|
34
|
+
style: StyleManager;
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
export type State = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
components: Components;
|
|
39
|
+
element: HTMLElement;
|
|
40
|
+
id: number;
|
|
41
|
+
key: string;
|
|
42
|
+
managers: Managers;
|
|
43
|
+
prefix: string;
|
|
44
|
+
options: TabelaOptions;
|
|
42
45
|
};
|
package/src/tabela.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {BodyComponent} from './components/body.component';
|
|
2
2
|
import {FooterComponent} from './components/footer.component';
|
|
3
3
|
import {HeaderComponent} from './components/header.component';
|
|
4
|
+
import {createElement} from './helpers/dom.helpers';
|
|
4
5
|
import {ColumnManager} from './managers/column.manager';
|
|
5
6
|
import {DataManager} from './managers/data.manager';
|
|
6
7
|
import {EventManager} from './managers/event.manager';
|
|
@@ -11,27 +12,27 @@ import {RenderManager} from './managers/render.manager';
|
|
|
11
12
|
import {RowManager} from './managers/row.manager';
|
|
12
13
|
import {SelectionManager} from './managers/selection.manager';
|
|
13
14
|
import {SortManager} from './managers/sort.manager';
|
|
15
|
+
import {StyleManager} from './managers/style.manager';
|
|
14
16
|
import type {TabelaData} from './models/data.model';
|
|
17
|
+
import {ARIA_LABEL, ATTRIBUTE_ROLE, ELEMENT_DIV, ROLE_TABLE} from './models/dom.model';
|
|
15
18
|
import type {TabelaFilter} from './models/filter.model';
|
|
19
|
+
import type {TabelaGroup} from './models/group.model';
|
|
16
20
|
import type {TabelaSelection} from './models/selection.model';
|
|
17
21
|
import type {TabelaSort} from './models/sort.model';
|
|
22
|
+
import {CSS_TABLE, CSS_WRAPPER} from './models/style.model';
|
|
18
23
|
import type {Components, Managers, State} from './models/tabela.model';
|
|
19
24
|
import type {TabelaOptions} from './models/tabela.options';
|
|
20
25
|
|
|
21
26
|
export class Tabela {
|
|
22
|
-
|
|
23
|
-
header: undefined as never,
|
|
24
|
-
body: undefined as never,
|
|
25
|
-
footer: undefined as never,
|
|
26
|
-
};
|
|
27
|
+
#components: Components;
|
|
27
28
|
|
|
28
29
|
#element: HTMLElement;
|
|
29
30
|
|
|
30
31
|
#id = getId();
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
#key: string;
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
#managers: Managers = {
|
|
35
36
|
column: undefined as never,
|
|
36
37
|
data: undefined as never,
|
|
37
38
|
event: undefined as never,
|
|
@@ -42,66 +43,86 @@ export class Tabela {
|
|
|
42
43
|
row: undefined as never,
|
|
43
44
|
selection: undefined as never,
|
|
44
45
|
sort: undefined as never,
|
|
46
|
+
style: undefined as never,
|
|
45
47
|
};
|
|
46
48
|
|
|
49
|
+
#prefix = `tabela_${this.#id}_`;
|
|
50
|
+
|
|
51
|
+
#state: State;
|
|
52
|
+
|
|
53
|
+
#table: HTMLElement;
|
|
54
|
+
|
|
47
55
|
readonly data: TabelaData;
|
|
48
56
|
|
|
49
57
|
readonly filter: TabelaFilter;
|
|
50
58
|
|
|
59
|
+
readonly group: TabelaGroup;
|
|
60
|
+
|
|
51
61
|
readonly selection: TabelaSelection;
|
|
52
62
|
|
|
53
63
|
readonly sort: TabelaSort;
|
|
54
64
|
|
|
55
|
-
get key(): string {
|
|
56
|
-
return this.#key;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
65
|
constructor(element: HTMLElement, options: TabelaOptions) {
|
|
60
66
|
this.#element = element;
|
|
61
67
|
|
|
62
68
|
element.innerHTML = '';
|
|
63
|
-
element.role = 'table';
|
|
64
|
-
|
|
65
|
-
element.classList.add('tabela');
|
|
66
69
|
|
|
67
|
-
element.
|
|
70
|
+
element.classList.add(CSS_WRAPPER);
|
|
71
|
+
|
|
72
|
+
this.#table = createElement(
|
|
73
|
+
ELEMENT_DIV,
|
|
74
|
+
{
|
|
75
|
+
className: CSS_TABLE,
|
|
76
|
+
role: ROLE_TABLE,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
[ARIA_LABEL]: options.label,
|
|
80
|
+
},
|
|
81
|
+
);
|
|
68
82
|
|
|
69
83
|
this.#key = options.key;
|
|
70
84
|
|
|
71
|
-
this.#components
|
|
72
|
-
this.#components.body = new BodyComponent();
|
|
73
|
-
this.#components.footer = new FooterComponent();
|
|
85
|
+
this.#components = {} as never;
|
|
74
86
|
|
|
75
|
-
|
|
76
|
-
element,
|
|
87
|
+
this.#state = {
|
|
77
88
|
options,
|
|
78
89
|
components: this.#components,
|
|
90
|
+
element: this.#table,
|
|
79
91
|
id: this.#id,
|
|
80
92
|
key: this.#key,
|
|
81
93
|
managers: this.#managers,
|
|
94
|
+
prefix: this.#prefix,
|
|
82
95
|
};
|
|
83
96
|
|
|
84
|
-
this.#
|
|
85
|
-
this.#
|
|
86
|
-
this.#
|
|
87
|
-
|
|
88
|
-
this.#managers.
|
|
89
|
-
this.#managers.
|
|
90
|
-
this.#managers.
|
|
91
|
-
this.#managers.
|
|
92
|
-
this.#managers.
|
|
93
|
-
this.#managers.
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
this.#components.body = new BodyComponent(this.#state);
|
|
98
|
+
this.#components.footer = new FooterComponent(this.#state);
|
|
99
|
+
this.#components.header = new HeaderComponent(this.#state);
|
|
100
|
+
|
|
101
|
+
this.#managers.column = new ColumnManager(this.#state);
|
|
102
|
+
this.#managers.data = new DataManager(this.#state);
|
|
103
|
+
this.#managers.event = new EventManager(this.#state);
|
|
104
|
+
this.#managers.filter = new FilterManager(this.#state);
|
|
105
|
+
this.#managers.group = new GroupManager(this.#state);
|
|
106
|
+
this.#managers.navigation = new NavigationManager(this.#state);
|
|
107
|
+
this.#managers.render = new RenderManager(this.#state);
|
|
108
|
+
this.#managers.row = new RowManager(this.#state);
|
|
109
|
+
this.#managers.selection = new SelectionManager(this.#state);
|
|
110
|
+
this.#managers.sort = new SortManager(this.#state);
|
|
111
|
+
this.#managers.style = new StyleManager(this.#state);
|
|
112
|
+
|
|
113
|
+
this.#table.append(
|
|
96
114
|
this.#components.header.elements.group,
|
|
97
115
|
this.#components.body.elements.group,
|
|
98
116
|
this.#components.footer.elements.group,
|
|
99
117
|
);
|
|
100
118
|
|
|
119
|
+
element.append(this.#table);
|
|
120
|
+
|
|
101
121
|
this.#managers.data.set(options.data);
|
|
102
122
|
|
|
103
123
|
this.data = this.#managers.data.handlers;
|
|
104
124
|
this.filter = this.#managers.filter.handlers;
|
|
125
|
+
this.group = this.#managers.group.handlers;
|
|
105
126
|
this.selection = this.#managers.selection.handlers;
|
|
106
127
|
this.sort = this.#managers.sort.handlers;
|
|
107
128
|
}
|
|
@@ -110,6 +131,7 @@ export class Tabela {
|
|
|
110
131
|
const components = this.#components;
|
|
111
132
|
const managers = this.#managers;
|
|
112
133
|
const element = this.#element;
|
|
134
|
+
const table = this.#table;
|
|
113
135
|
|
|
114
136
|
components.body.destroy();
|
|
115
137
|
components.footer.destroy();
|
|
@@ -119,20 +141,28 @@ export class Tabela {
|
|
|
119
141
|
managers.data.destroy();
|
|
120
142
|
managers.event.destroy();
|
|
121
143
|
managers.filter.destroy();
|
|
122
|
-
|
|
144
|
+
managers.group.destroy();
|
|
145
|
+
managers.navigation.destroy();
|
|
123
146
|
managers.render.destroy();
|
|
124
147
|
managers.row.destroy();
|
|
125
148
|
managers.selection.destroy();
|
|
126
149
|
managers.sort.destroy();
|
|
127
150
|
|
|
128
151
|
element.innerHTML = '';
|
|
129
|
-
|
|
152
|
+
table.innerHTML = '';
|
|
153
|
+
|
|
154
|
+
element.classList.remove(CSS_WRAPPER);
|
|
155
|
+
|
|
156
|
+
table.removeAttribute(ARIA_LABEL);
|
|
157
|
+
table.removeAttribute(ATTRIBUTE_ROLE);
|
|
130
158
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
element
|
|
159
|
+
this.#state.components = undefined as never;
|
|
160
|
+
this.#state.managers = undefined as never;
|
|
161
|
+
this.#state.element = undefined as never;
|
|
162
|
+
this.#state.options = undefined as never;
|
|
134
163
|
|
|
135
164
|
this.#element = undefined as never;
|
|
165
|
+
this.#table = undefined as never;
|
|
136
166
|
}
|
|
137
167
|
}
|
|
138
168
|
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Column, TabelaColumn } from '../models/column.model';
|
|
2
|
-
export declare class ColumnComponent {
|
|
3
|
-
elements: ColumnElements;
|
|
4
|
-
options: Column;
|
|
5
|
-
constructor(column: TabelaColumn);
|
|
6
|
-
destroy(): void;
|
|
7
|
-
}
|
|
8
|
-
type ColumnElements = {
|
|
9
|
-
content: HTMLDivElement;
|
|
10
|
-
sorter: HTMLDivElement;
|
|
11
|
-
wrapper: HTMLDivElement;
|
|
12
|
-
};
|
|
13
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { FooterElements } from '../models/footer.model';
|
|
2
|
-
import type { ColumnComponent } from './column.component';
|
|
3
|
-
export declare class FooterComponent {
|
|
4
|
-
readonly elements: FooterElements;
|
|
5
|
-
constructor();
|
|
6
|
-
destroy(): void;
|
|
7
|
-
update(columns: ColumnComponent[]): void;
|
|
8
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { State } from '../models/tabela.model';
|
|
2
|
-
export declare class GroupComponent {
|
|
3
|
-
readonly key: string;
|
|
4
|
-
readonly label: string;
|
|
5
|
-
readonly value: unknown;
|
|
6
|
-
element: HTMLElement | undefined;
|
|
7
|
-
expanded: boolean;
|
|
8
|
-
filtered: number;
|
|
9
|
-
selected: number;
|
|
10
|
-
total: number;
|
|
11
|
-
constructor(key: string, label: string, value: unknown);
|
|
12
|
-
}
|
|
13
|
-
export declare function renderGroup(state: State, component: GroupComponent): void;
|
|
14
|
-
export declare function updateGroup(state: State, component: GroupComponent): void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { HeaderElements } from '../models/header.model';
|
|
2
|
-
import type { ColumnComponent } from './column.component';
|
|
3
|
-
export declare class HeaderComponent {
|
|
4
|
-
readonly elements: HeaderElements;
|
|
5
|
-
constructor();
|
|
6
|
-
destroy(): void;
|
|
7
|
-
update(columns: ColumnComponent[]): void;
|
|
8
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Key } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import type { RenderElementPool } from '../models/render.model';
|
|
3
|
-
import type { State } from '../models/tabela.model';
|
|
4
|
-
export declare function removeRow(pool: RenderElementPool, row: RowComponent): void;
|
|
5
|
-
export declare function renderRow(state: State, row: RowComponent): void;
|
|
6
|
-
export declare class RowComponent {
|
|
7
|
-
readonly key: Key;
|
|
8
|
-
cells: Record<string, HTMLDivElement>;
|
|
9
|
-
element: HTMLDivElement | undefined;
|
|
10
|
-
constructor(key: Key);
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type RowGroupWithRow = {
|
|
2
|
-
group: HTMLDivElement;
|
|
3
|
-
row: HTMLDivElement;
|
|
4
|
-
};
|
|
5
|
-
export declare function createCell(width: number, body?: boolean): HTMLDivElement;
|
|
6
|
-
export declare function createElement<TagName extends keyof HTMLElementTagNameMap>(tagName: TagName, properties: Partial<HTMLElementTagNameMap[TagName]>, attributes: Record<string, string>, style: Partial<CSSStyleDeclaration>): HTMLElementTagNameMap[TagName];
|
|
7
|
-
export declare function createRowGroup(): RowGroupWithRow;
|
|
8
|
-
export declare function createRowGroup(withRow: boolean): HTMLDivElement;
|
|
9
|
-
export declare function createRow(): HTMLDivElement;
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const dragStyling: import("@oscarpalmer/toretto/style").StyleToggler;
|
package/types/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ColumnComponent } from '../components/column.component';
|
|
2
|
-
import type { TabelaColumn } from '../models/column.model';
|
|
3
|
-
import type { State } from '../models/tabela.model';
|
|
4
|
-
export declare class ColumnManager {
|
|
5
|
-
state: State;
|
|
6
|
-
items: ColumnComponent[];
|
|
7
|
-
constructor(state: State);
|
|
8
|
-
destroy(): void;
|
|
9
|
-
remove(field: string): void;
|
|
10
|
-
remove(fields: string[]): void;
|
|
11
|
-
set(columns: TabelaColumn[]): void;
|
|
12
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Key, PlainObject } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import type { DataValues } from '../models/data.model';
|
|
3
|
-
import type { State } from '../models/tabela.model';
|
|
4
|
-
import { GroupComponent } from '../components/group.component';
|
|
5
|
-
export declare class DataManager {
|
|
6
|
-
state: State;
|
|
7
|
-
handlers: Readonly<{
|
|
8
|
-
add: (data: PlainObject[]) => undefined;
|
|
9
|
-
clear: () => undefined;
|
|
10
|
-
get: (active: boolean | undefined) => PlainObject[];
|
|
11
|
-
remove: (items: PlainObject[] | Key[]) => undefined;
|
|
12
|
-
synchronize: (data: PlainObject[], remove: boolean | undefined) => undefined;
|
|
13
|
-
update: (data: PlainObject[]) => undefined;
|
|
14
|
-
}>;
|
|
15
|
-
values: DataValues;
|
|
16
|
-
get keys(): Array<GroupComponent | Key>;
|
|
17
|
-
get size(): number;
|
|
18
|
-
constructor(state: State);
|
|
19
|
-
add(data: PlainObject[], render: boolean): Promise<void>;
|
|
20
|
-
clear(): void;
|
|
21
|
-
destroy(): void;
|
|
22
|
-
get(active?: boolean): PlainObject[];
|
|
23
|
-
getIndex(key: Key): number;
|
|
24
|
-
remove(items: Array<Key | PlainObject>, render: boolean): Promise<void>;
|
|
25
|
-
render(): void;
|
|
26
|
-
set(data: PlainObject[]): void;
|
|
27
|
-
synchronize(data: PlainObject[], remove?: boolean): Promise<void>;
|
|
28
|
-
update(data: PlainObject[]): Promise<void>;
|
|
29
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { TabelaFilterItem } from '../models/filter.model';
|
|
2
|
-
import type { State } from '../models/tabela.model';
|
|
3
|
-
export declare class FilterManager {
|
|
4
|
-
state: State;
|
|
5
|
-
handlers: Readonly<{
|
|
6
|
-
add: (item: TabelaFilterItem) => void;
|
|
7
|
-
clear: () => void;
|
|
8
|
-
remove: (value: string | TabelaFilterItem) => void;
|
|
9
|
-
set: (items: TabelaFilterItem[]) => void;
|
|
10
|
-
}>;
|
|
11
|
-
items: Record<string, TabelaFilterItem[]>;
|
|
12
|
-
constructor(state: State);
|
|
13
|
-
add(item: TabelaFilterItem): void;
|
|
14
|
-
clear(): void;
|
|
15
|
-
destroy(): void;
|
|
16
|
-
filter(): void;
|
|
17
|
-
remove(value: string | TabelaFilterItem): void;
|
|
18
|
-
set(items: TabelaFilterItem[]): void;
|
|
19
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Key } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import type { GroupComponent } from '../components/group.component';
|
|
3
|
-
import type { State } from '../models/tabela.model';
|
|
4
|
-
export declare class GroupManager {
|
|
5
|
-
readonly state: State;
|
|
6
|
-
collapsed: Set<Key>;
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
field: string;
|
|
9
|
-
items: GroupComponent[];
|
|
10
|
-
order: Record<never, number>;
|
|
11
|
-
constructor(state: State);
|
|
12
|
-
add(group: GroupComponent): void;
|
|
13
|
-
get(value: unknown): GroupComponent | undefined;
|
|
14
|
-
handle(button: HTMLElement): void;
|
|
15
|
-
remove(group: GroupComponent): void;
|
|
16
|
-
set(items: GroupComponent[]): void;
|
|
17
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Key } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import type { State } from '../models/tabela.model';
|
|
3
|
-
export declare class NavigationManager {
|
|
4
|
-
state: State;
|
|
5
|
-
active: Key | undefined;
|
|
6
|
-
constructor(state: State);
|
|
7
|
-
destroy(): void;
|
|
8
|
-
handle(event: KeyboardEvent): void;
|
|
9
|
-
setActive(key: Key | undefined, scroll?: boolean): void;
|
|
10
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Key } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import type { RemovableEventListener } from '@oscarpalmer/toretto/models';
|
|
3
|
-
import { GroupComponent } from '../components/group.component';
|
|
4
|
-
import type { RenderElementPool, RenderState } from '../models/render.model';
|
|
5
|
-
import type { State } from '../models/tabela.model';
|
|
6
|
-
export declare class RenderManager {
|
|
7
|
-
fragment: DocumentFragment;
|
|
8
|
-
listener: RemovableEventListener;
|
|
9
|
-
pool: RenderElementPool;
|
|
10
|
-
state: RenderState;
|
|
11
|
-
visible: Map<number, GroupComponent | Key>;
|
|
12
|
-
constructor(state: State);
|
|
13
|
-
destroy(): void;
|
|
14
|
-
removeCells(fields: string[]): void;
|
|
15
|
-
getFragment(): DocumentFragment;
|
|
16
|
-
update(down: boolean, rerender?: boolean): void;
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Key } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import { RowComponent } from '../components/row.component';
|
|
3
|
-
import type { State } from '../models/tabela.model';
|
|
4
|
-
export declare class RowManager {
|
|
5
|
-
state: State;
|
|
6
|
-
components: Map<Key, RowComponent>;
|
|
7
|
-
constructor(state: State);
|
|
8
|
-
destroy(): void;
|
|
9
|
-
get(key: Key): RowComponent | undefined;
|
|
10
|
-
has(key: Key): boolean;
|
|
11
|
-
remove(key: Key): void;
|
|
12
|
-
update(key: Key): void;
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Key } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import type { State } from '../models/tabela.model';
|
|
3
|
-
export declare class SelectionManager {
|
|
4
|
-
state: State;
|
|
5
|
-
handlers: Readonly<{
|
|
6
|
-
add: (keys: Key[]) => void;
|
|
7
|
-
clear: () => void;
|
|
8
|
-
remove: (keys: Key[]) => void;
|
|
9
|
-
set: (keys: Key[]) => void;
|
|
10
|
-
toggle: () => void;
|
|
11
|
-
}>;
|
|
12
|
-
items: Set<Key>;
|
|
13
|
-
last: Key | undefined;
|
|
14
|
-
constructor(state: State);
|
|
15
|
-
add(keys: Key[]): void;
|
|
16
|
-
clear(): void;
|
|
17
|
-
destroy(): void;
|
|
18
|
-
handle(event: MouseEvent, target: HTMLElement): void;
|
|
19
|
-
range(from: Key | HTMLElement, to: Key | HTMLElement): void;
|
|
20
|
-
remove(keys: Key[]): void;
|
|
21
|
-
set(keys: Key[]): void;
|
|
22
|
-
toggle(): void;
|
|
23
|
-
update(removed: Key[]): void;
|
|
24
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type ArrayKeySorter } from '@oscarpalmer/atoms/array';
|
|
2
|
-
import type { PlainObject } from '@oscarpalmer/atoms/models';
|
|
3
|
-
import { GroupComponent } from '../components/group.component';
|
|
4
|
-
import type { TabelaSortDirection, TabelaSortItem } from '../models/sort.model';
|
|
5
|
-
import type { State } from '../models/tabela.model';
|
|
6
|
-
export declare class SortManager {
|
|
7
|
-
state: State;
|
|
8
|
-
handlers: Readonly<{
|
|
9
|
-
add: (field: string, direction: TabelaSortDirection | undefined) => void;
|
|
10
|
-
flip: (field: string) => void;
|
|
11
|
-
clear: () => void;
|
|
12
|
-
remove: (field: string) => void;
|
|
13
|
-
set: (items: TabelaSortItem[]) => void;
|
|
14
|
-
}>;
|
|
15
|
-
items: ArrayKeySorter<PlainObject>[];
|
|
16
|
-
constructor(state: State);
|
|
17
|
-
add(field: string, direction?: TabelaSortDirection): void;
|
|
18
|
-
addOrSet(event: MouseEvent, field: string): void;
|
|
19
|
-
clear(): void;
|
|
20
|
-
destroy(): void;
|
|
21
|
-
flip(field: string): void;
|
|
22
|
-
remove(field: string): void;
|
|
23
|
-
removeOrClear(event: MouseEvent, field: string): void;
|
|
24
|
-
set(items: TabelaSortItem[]): void;
|
|
25
|
-
sort(): void;
|
|
26
|
-
toggle(event: MouseEvent, field: string, direction?: string | null): void;
|
|
27
|
-
}
|
|
28
|
-
export declare function sortWithGroups(state: State, data: Array<GroupComponent | PlainObject>, sorters: ArrayKeySorter<PlainObject>[]): Array<GroupComponent | PlainObject>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type Column = {
|
|
2
|
-
field: string;
|
|
3
|
-
title: string;
|
|
4
|
-
type: TabelaColumnType;
|
|
5
|
-
width: number;
|
|
6
|
-
};
|
|
7
|
-
export type TabelaColumn = {
|
|
8
|
-
field: string;
|
|
9
|
-
title: string;
|
|
10
|
-
type: TabelaColumnType;
|
|
11
|
-
width?: number;
|
|
12
|
-
};
|
|
13
|
-
export type TabelaColumnType = 'boolean' | 'date' | 'date-time' | 'number' | 'string' | 'time';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Key, PlainObject } from '@oscarpalmer/atoms/models';
|
|
2
|
-
import type { GroupComponent } from '../components/group.component';
|
|
3
|
-
export type DataValues = {
|
|
4
|
-
keys: DataValuesKeys;
|
|
5
|
-
objects: DataValuesObjects;
|
|
6
|
-
};
|
|
7
|
-
type DataValuesKeys = {
|
|
8
|
-
active?: Array<GroupComponent | Key>;
|
|
9
|
-
original: Array<GroupComponent | Key>;
|
|
10
|
-
};
|
|
11
|
-
type DataValuesObjects = {
|
|
12
|
-
array: Array<GroupComponent | PlainObject>;
|
|
13
|
-
mapped: Map<Key, PlainObject>;
|
|
14
|
-
};
|
|
15
|
-
export type TabelaData = {
|
|
16
|
-
add(data: PlainObject[]): void;
|
|
17
|
-
clear(): void;
|
|
18
|
-
get(active?: boolean): PlainObject[];
|
|
19
|
-
remove(keys: Key[]): void;
|
|
20
|
-
remove(data: PlainObject[]): void;
|
|
21
|
-
synchronize(data: PlainObject[], remove?: boolean): void;
|
|
22
|
-
update(data: PlainObject[]): void;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type TabelaFilter = {
|
|
2
|
-
add(item: TabelaFilterItem): void;
|
|
3
|
-
clear(): void;
|
|
4
|
-
remove(field: string): void;
|
|
5
|
-
remove(item: TabelaFilterItem): void;
|
|
6
|
-
set(items: TabelaFilterItem[]): void;
|
|
7
|
-
};
|
|
8
|
-
export type TabelaFilterComparison = 'contains' | 'ends-with' | 'equals' | 'greater-than' | 'greater-than-or-equal' | 'less-than' | 'less-than-or-equal' | 'not-contains' | 'not-equals' | 'starts-with';
|
|
9
|
-
export type TabelaFilterItem = {
|
|
10
|
-
comparison: TabelaFilterComparison;
|
|
11
|
-
field: string;
|
|
12
|
-
value: unknown;
|
|
13
|
-
};
|