@itrocks/table 0.0.11 → 0.0.13
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/column-reorder.d.ts +3 -3
- package/column-reorder.js +2 -2
- package/edit/lock.d.ts +3 -3
- package/edit/lock.js +2 -2
- package/edit/move.d.ts +4 -4
- package/edit/move.js +2 -2
- package/edit-freeze/hide.d.ts +5 -5
- package/edit-freeze/hide.js +2 -2
- package/edit-freeze/scroll.d.ts +4 -4
- package/edit-freeze/scroll.js +2 -2
- package/edit.d.ts +3 -3
- package/edit.js +3 -3
- package/fix.d.ts +27 -0
- package/fix.js +191 -0
- package/freeze/inherit-background.d.ts +3 -3
- package/freeze/inherit-background.js +2 -2
- package/freeze/inherit-border.d.ts +4 -4
- package/freeze/inherit-border.js +2 -2
- package/freeze.d.ts +3 -3
- package/freeze.js +2 -2
- package/package.json +5 -6
- package/table.d.ts +1 -1
- package/table.js +1 -1
package/column-reorder.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Plugin from '../node_modules/@itrocks/plugin/plugin.js';
|
|
1
|
+
import { Plugin } from '../node_modules/@itrocks/plugin/plugin.js';
|
|
2
2
|
import { HTMLTableFreezeElement } from './freeze.js';
|
|
3
|
-
import Table from './table.js';
|
|
4
|
-
export
|
|
3
|
+
import { Table } from './table.js';
|
|
4
|
+
export declare class TableColumnReorder extends Plugin<Table> {
|
|
5
5
|
reorderCells: NodeListOf<HTMLTableFreezeElement>;
|
|
6
6
|
constructor(table: Table);
|
|
7
7
|
protected getReorderCells(): NodeListOf<HTMLTableFreezeElement>;
|
package/column-reorder.js
CHANGED
package/edit/lock.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Plugin from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
-
import Table from '../table.js';
|
|
1
|
+
import { Plugin } from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
+
import { Table } from '../table.js';
|
|
3
3
|
declare class Options {
|
|
4
4
|
nonEditableConditions: {
|
|
5
5
|
[index: string]: string;
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export declare class TableEditLock extends Plugin<Table> {
|
|
9
9
|
options: Options;
|
|
10
10
|
constructor(table: Table, options?: Partial<Options>);
|
|
11
11
|
colCell(cell: HTMLTableCellElement): HTMLTableCellElement | HTMLTableColElement;
|
package/edit/lock.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Plugin from '../../plugin/plugin.js';
|
|
1
|
+
import { Plugin } from '../../plugin/plugin.js';
|
|
2
2
|
class Options {
|
|
3
3
|
nonEditableConditions = {
|
|
4
4
|
'closest': 'tfoot, thead, [data-lock]',
|
|
5
5
|
'col': '[data-lock]'
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export class TableEditLock extends Plugin {
|
|
9
9
|
options = new Options;
|
|
10
10
|
constructor(table, options = {}) {
|
|
11
11
|
super(table);
|
package/edit/move.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HTMLEditableElement } from '../../node_modules/@itrocks/contenteditable/contenteditable.js';
|
|
2
|
-
import Plugin from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
3
|
-
import TableEdit from '../edit.js';
|
|
4
|
-
import Table from '../table.js';
|
|
5
|
-
export
|
|
2
|
+
import { Plugin } from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
3
|
+
import { TableEdit } from '../edit.js';
|
|
4
|
+
import { Table } from '../table.js';
|
|
5
|
+
export declare class TableEditMove extends Plugin<Table> {
|
|
6
6
|
tableEdit: TableEdit;
|
|
7
7
|
constructor(table: Table);
|
|
8
8
|
selectNextColumn(): void;
|
package/edit/move.js
CHANGED
package/edit-freeze/hide.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HTMLEditableElement } from '../../node_modules/@itrocks/contenteditable/contenteditable.js';
|
|
2
|
-
import Plugin from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
3
|
-
import TableEdit from '../edit.js';
|
|
4
|
-
import TableFreeze from '../freeze.js';
|
|
5
|
-
import Table from '../table.js';
|
|
6
|
-
export
|
|
2
|
+
import { Plugin } from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
3
|
+
import { TableEdit } from '../edit.js';
|
|
4
|
+
import { TableFreeze } from '../freeze.js';
|
|
5
|
+
import { Table } from '../table.js';
|
|
6
|
+
export declare class TableEditFreezeHide extends Plugin<Table> {
|
|
7
7
|
readonly tableFreeze: TableFreeze;
|
|
8
8
|
readonly tableEdit: TableEdit;
|
|
9
9
|
constructor(table: Table);
|
package/edit-freeze/hide.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Plugin from '../../plugin/plugin.js';
|
|
1
|
+
import { Plugin } from '../../plugin/plugin.js';
|
|
2
2
|
const zIndex = {
|
|
3
3
|
back: false,
|
|
4
4
|
editable: '',
|
|
5
5
|
selected: ''
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export class TableEditFreezeHide extends Plugin {
|
|
8
8
|
tableFreeze;
|
|
9
9
|
tableEdit;
|
|
10
10
|
constructor(table) {
|
package/edit-freeze/scroll.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Plugin from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
-
import TableFreeze from '../freeze.js';
|
|
3
|
-
import Table from '../table.js';
|
|
4
|
-
export
|
|
1
|
+
import { Plugin } from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
+
import { TableFreeze } from '../freeze.js';
|
|
3
|
+
import { Table } from '../table.js';
|
|
4
|
+
export declare class TableEditFreezeScroll extends Plugin<Table> {
|
|
5
5
|
tableFreeze: TableFreeze;
|
|
6
6
|
constructor(table: Table);
|
|
7
7
|
scrollToCell(cell: HTMLTableCellElement): HTMLTableCellElement;
|
package/edit-freeze/scroll.js
CHANGED
package/edit.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLEditableElement } from '../node_modules/@itrocks/contenteditable/contenteditable.js';
|
|
2
|
-
import Plugin from '../node_modules/@itrocks/plugin/plugin.js';
|
|
3
|
-
import Table from './table.js';
|
|
2
|
+
import { Plugin } from '../node_modules/@itrocks/plugin/plugin.js';
|
|
3
|
+
import { Table } from './table.js';
|
|
4
4
|
export declare class RangeCopy {
|
|
5
5
|
commonAncestorContainer: Node;
|
|
6
6
|
endContainer: Node;
|
|
@@ -10,7 +10,7 @@ export declare class RangeCopy {
|
|
|
10
10
|
constructor(range: Range);
|
|
11
11
|
toRange(): Range;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export declare class TableEdit extends Plugin<Table> {
|
|
14
14
|
zIndex: string;
|
|
15
15
|
init(): void;
|
|
16
16
|
closestEditable(node: Node | Range | RangeCopy): HTMLDivElement;
|
package/edit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ContentEditable from '../contenteditable/contenteditable.js';
|
|
2
|
-
import Plugin from '../plugin/plugin.js';
|
|
1
|
+
import { ContentEditable } from '../contenteditable/contenteditable.js';
|
|
2
|
+
import { Plugin } from '../plugin/plugin.js';
|
|
3
3
|
let editable;
|
|
4
4
|
let selected;
|
|
5
5
|
let selectedStyle;
|
|
@@ -24,7 +24,7 @@ export class RangeCopy {
|
|
|
24
24
|
return range;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export class TableEdit extends Plugin {
|
|
28
28
|
zIndex = '2';
|
|
29
29
|
init() {
|
|
30
30
|
const table = this.of;
|
package/fix.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Plugin from '../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
+
import { HTMLTableFixElement, Table } from './table.js';
|
|
3
|
+
interface FullIndex {
|
|
4
|
+
column: string;
|
|
5
|
+
corner: string;
|
|
6
|
+
row: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class FixTable extends Plugin<Table> {
|
|
9
|
+
columns: NodeListOf<HTMLTableFixElement>;
|
|
10
|
+
full?: FullIndex;
|
|
11
|
+
leftColumnCount: number;
|
|
12
|
+
rightColumnCount: number;
|
|
13
|
+
zIndex: string;
|
|
14
|
+
constructor(table: Table);
|
|
15
|
+
init(): void;
|
|
16
|
+
closestScrollable(element: Element): HTMLElement | (Window & typeof globalThis) | undefined;
|
|
17
|
+
protected countLeftColumns(): number;
|
|
18
|
+
protected countRightColumns(): number;
|
|
19
|
+
protected fixFootRows(): void;
|
|
20
|
+
protected fixHeadRows(): void;
|
|
21
|
+
protected fixLeftColumns(): void;
|
|
22
|
+
protected fixRightColumns(): void;
|
|
23
|
+
protected getColumns(): NodeListOf<HTMLTableFixElement>;
|
|
24
|
+
position(position: number, _counter: number, _colCell: HTMLTableFixElement, _side: 'bottom' | 'left' | 'right' | 'top'): string;
|
|
25
|
+
visibleInnerRect(): DOMRect;
|
|
26
|
+
}
|
|
27
|
+
export default FixTable;
|
package/fix.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import Plugin from '../plugin/plugin.js';
|
|
2
|
+
export class FixTable extends Plugin {
|
|
3
|
+
columns;
|
|
4
|
+
full;
|
|
5
|
+
leftColumnCount;
|
|
6
|
+
rightColumnCount;
|
|
7
|
+
zIndex = '1';
|
|
8
|
+
constructor(table) {
|
|
9
|
+
super(table);
|
|
10
|
+
this.columns = this.getColumns();
|
|
11
|
+
this.leftColumnCount = this.countLeftColumns();
|
|
12
|
+
this.rightColumnCount = this.countRightColumns();
|
|
13
|
+
}
|
|
14
|
+
init() {
|
|
15
|
+
this.fixFootRows();
|
|
16
|
+
this.fixHeadRows();
|
|
17
|
+
this.fixLeftColumns();
|
|
18
|
+
this.fixRightColumns();
|
|
19
|
+
}
|
|
20
|
+
closestScrollable(element) {
|
|
21
|
+
let parent = element.closest('table')?.parentElement;
|
|
22
|
+
while (parent && (parent.scrollHeight <= parent.clientHeight)) {
|
|
23
|
+
parent = parent.parentElement;
|
|
24
|
+
}
|
|
25
|
+
return parent ? ((parent instanceof HTMLHtmlElement) ? window : parent) : undefined;
|
|
26
|
+
}
|
|
27
|
+
countLeftColumns() {
|
|
28
|
+
let count = 0;
|
|
29
|
+
while ((count < this.columns.length - 1) && (this.columns[count].dataset.fix !== undefined)) {
|
|
30
|
+
count++;
|
|
31
|
+
}
|
|
32
|
+
return count;
|
|
33
|
+
}
|
|
34
|
+
countRightColumns() {
|
|
35
|
+
let count = this.columns.length - 1;
|
|
36
|
+
while ((count > 0) && (this.columns[count].dataset.fix !== undefined)) {
|
|
37
|
+
count--;
|
|
38
|
+
}
|
|
39
|
+
return this.columns.length - 1 - count;
|
|
40
|
+
}
|
|
41
|
+
fixFootRows() {
|
|
42
|
+
const table = this.of;
|
|
43
|
+
if (!table.element.tFoot?.rows.length)
|
|
44
|
+
return;
|
|
45
|
+
let counter = 1, bottom = .0, previousBottom = table.element.getBoundingClientRect().bottom;
|
|
46
|
+
for (const row of Array.from(table.element.tFoot.querySelectorAll(':scope > tr')).reverse()) {
|
|
47
|
+
const actualBottom = row.getBoundingClientRect().bottom;
|
|
48
|
+
bottom += previousBottom - actualBottom;
|
|
49
|
+
previousBottom = actualBottom;
|
|
50
|
+
table.styleSheet.push(`
|
|
51
|
+
${table.selector} > tfoot > tr:nth-last-child(${counter}) > * {
|
|
52
|
+
bottom: ${this.position(bottom, counter, row.firstElementChild, 'bottom')};
|
|
53
|
+
}
|
|
54
|
+
`);
|
|
55
|
+
counter++;
|
|
56
|
+
}
|
|
57
|
+
const zIndex = this.full ? `z-index: ${this.full.row};` : '';
|
|
58
|
+
table.styleSheet.push(`
|
|
59
|
+
${table.selector} > tfoot > tr > * {
|
|
60
|
+
position: sticky;
|
|
61
|
+
${zIndex}
|
|
62
|
+
}
|
|
63
|
+
`);
|
|
64
|
+
}
|
|
65
|
+
fixHeadRows() {
|
|
66
|
+
const table = this.of;
|
|
67
|
+
if (!table.element.tHead?.rows.length)
|
|
68
|
+
return;
|
|
69
|
+
let counter = 1, top = .0, previousTop = table.element.getBoundingClientRect().top;
|
|
70
|
+
table.element.tHead.querySelectorAll(':scope > tr').forEach(row => {
|
|
71
|
+
const actualTop = row.getBoundingClientRect().top;
|
|
72
|
+
top += actualTop - previousTop;
|
|
73
|
+
previousTop = actualTop;
|
|
74
|
+
table.styleSheet.push(`
|
|
75
|
+
${table.selector} > thead > tr:nth-child(${counter}) > * {
|
|
76
|
+
top: ${this.position(top, counter, row.firstElementChild, 'top')};
|
|
77
|
+
}
|
|
78
|
+
`);
|
|
79
|
+
counter++;
|
|
80
|
+
});
|
|
81
|
+
const zIndex = this.full ? `z-index: ${this.full.row};` : '';
|
|
82
|
+
table.styleSheet.push(`
|
|
83
|
+
${table.selector} > thead > tr > * {
|
|
84
|
+
position: sticky;
|
|
85
|
+
${zIndex}
|
|
86
|
+
}
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
fixLeftColumns() {
|
|
90
|
+
if (!this.leftColumnCount)
|
|
91
|
+
return;
|
|
92
|
+
const table = this.of;
|
|
93
|
+
const bodySel = [];
|
|
94
|
+
const cornerSel = [];
|
|
95
|
+
let counter = 1, left = .0, previousLeft = table.element.getBoundingClientRect().left;
|
|
96
|
+
for (const colCell of Array.from(this.columns).toSpliced(this.leftColumnCount)) {
|
|
97
|
+
const actualLeft = colCell.getBoundingClientRect().left;
|
|
98
|
+
left += actualLeft - previousLeft;
|
|
99
|
+
previousLeft = actualLeft;
|
|
100
|
+
table.styleSheet.push(`
|
|
101
|
+
${table.selector} > * > tr > :nth-child(${counter}) {
|
|
102
|
+
left: ${this.position(left, counter, colCell, 'left')};
|
|
103
|
+
}
|
|
104
|
+
`);
|
|
105
|
+
bodySel.push(`${table.selector} > tbody > tr > :nth-child(${counter})`);
|
|
106
|
+
cornerSel.push(`${table.selector} > tfoot > tr > :nth-child(${counter})`);
|
|
107
|
+
cornerSel.push(`${table.selector} > thead > tr > :nth-child(${counter})`);
|
|
108
|
+
counter++;
|
|
109
|
+
}
|
|
110
|
+
const zIndex = this.full ? `z-index: ${this.full.column};` : '';
|
|
111
|
+
const zIndexValue = this.full ? this.full.corner : this.zIndex;
|
|
112
|
+
table.styleSheet.push(`
|
|
113
|
+
${bodySel.join(', ')} {
|
|
114
|
+
position: sticky;
|
|
115
|
+
${zIndex}
|
|
116
|
+
}
|
|
117
|
+
${cornerSel.join(', ')} {
|
|
118
|
+
z-index: ${zIndexValue};
|
|
119
|
+
}
|
|
120
|
+
`);
|
|
121
|
+
}
|
|
122
|
+
fixRightColumns() {
|
|
123
|
+
if (!this.rightColumnCount)
|
|
124
|
+
return;
|
|
125
|
+
const table = this.of;
|
|
126
|
+
const bodySel = [];
|
|
127
|
+
const cornerSel = [];
|
|
128
|
+
let counter = 1, right = .0, previousRight = table.element.getBoundingClientRect().right;
|
|
129
|
+
for (const colCell of Array.from(this.columns).reverse().toSpliced(this.rightColumnCount)) {
|
|
130
|
+
const actualRight = colCell.getBoundingClientRect().right;
|
|
131
|
+
right += previousRight - actualRight;
|
|
132
|
+
previousRight = actualRight;
|
|
133
|
+
table.styleSheet.push(`
|
|
134
|
+
${table.selector} > * > tr > :nth-last-child(${counter}) {
|
|
135
|
+
right: ${this.position(right, counter, colCell, 'right')};
|
|
136
|
+
}
|
|
137
|
+
`);
|
|
138
|
+
bodySel.push(`${table.selector} > tbody > tr > :nth-last-child(${counter})`);
|
|
139
|
+
if (this.full) {
|
|
140
|
+
cornerSel.push(`${table.selector} > tfoot > tr > :nth-last-child(${counter})`);
|
|
141
|
+
}
|
|
142
|
+
cornerSel.push(`${table.selector} > thead > tr > :nth-last-child(${counter})`);
|
|
143
|
+
counter++;
|
|
144
|
+
}
|
|
145
|
+
const zIndex = this.full ? `z-index: ${this.full.column};` : '';
|
|
146
|
+
const zIndexValue = this.full ? this.full.corner : this.zIndex;
|
|
147
|
+
table.styleSheet.push(`
|
|
148
|
+
${bodySel.join(', ')} {
|
|
149
|
+
position: sticky;
|
|
150
|
+
${zIndex}
|
|
151
|
+
}
|
|
152
|
+
${cornerSel.join(', ')} {
|
|
153
|
+
z-index: ${zIndexValue};
|
|
154
|
+
}
|
|
155
|
+
`);
|
|
156
|
+
}
|
|
157
|
+
getColumns() {
|
|
158
|
+
if (this.columns)
|
|
159
|
+
return this.columns;
|
|
160
|
+
const table = this.of;
|
|
161
|
+
let columns = table.element.querySelectorAll(':scope > colgroup > col');
|
|
162
|
+
if (!columns.length) {
|
|
163
|
+
columns = table.element.querySelectorAll(':scope > thead > tr:first-child > *');
|
|
164
|
+
if (!columns.length) {
|
|
165
|
+
columns = table.element.querySelectorAll(':scope > tbody > tr:first-child > *');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return columns;
|
|
169
|
+
}
|
|
170
|
+
position(position, _counter, _colCell, _side) {
|
|
171
|
+
return `${position}px`;
|
|
172
|
+
}
|
|
173
|
+
visibleInnerRect() {
|
|
174
|
+
const tableElement = this.of.element;
|
|
175
|
+
const rect = tableElement.getBoundingClientRect();
|
|
176
|
+
if (this.leftColumnCount) {
|
|
177
|
+
rect.x = this.columns[this.leftColumnCount - 1].getBoundingClientRect().right;
|
|
178
|
+
}
|
|
179
|
+
if (tableElement.tHead?.lastElementChild?.firstElementChild) {
|
|
180
|
+
rect.y = tableElement.tHead.lastElementChild.firstElementChild.getBoundingClientRect().bottom;
|
|
181
|
+
}
|
|
182
|
+
if (this.rightColumnCount) {
|
|
183
|
+
rect.width = this.columns[this.columns.length - this.rightColumnCount].getBoundingClientRect().left - rect.x + 1;
|
|
184
|
+
}
|
|
185
|
+
if (tableElement.tFoot?.firstElementChild?.firstElementChild) {
|
|
186
|
+
rect.height = tableElement.tFoot.firstElementChild.firstElementChild.getBoundingClientRect().top - rect.y + 1;
|
|
187
|
+
}
|
|
188
|
+
return rect;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
export default FixTable;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import TableFreeze from '../freeze.js';
|
|
2
|
-
import Table from '../table';
|
|
1
|
+
import { TableFreeze } from '../freeze.js';
|
|
2
|
+
import { Table } from '../table';
|
|
3
3
|
/**
|
|
4
4
|
* This plugin has no use and no effect if your table has border-collapse: collapse
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare class TableFreezeInheritBackground extends TableFreeze {
|
|
7
7
|
tableStyle: CSSStyleDeclaration;
|
|
8
8
|
constructor(table: Table);
|
|
9
9
|
init(): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import TableFreeze from '../freeze.js';
|
|
1
|
+
import { TableFreeze } from '../freeze.js';
|
|
2
2
|
/**
|
|
3
3
|
* This plugin has no use and no effect if your table has border-collapse: collapse
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export class TableFreezeInheritBackground extends TableFreeze {
|
|
6
6
|
tableStyle;
|
|
7
7
|
constructor(table) {
|
|
8
8
|
super(table);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Plugin from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
-
import TableFreeze from '../freeze.js';
|
|
1
|
+
import { Plugin } from '../../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
+
import { TableFreeze } from '../freeze.js';
|
|
3
3
|
import { HTMLTableFreezeElement } from '../freeze.js';
|
|
4
|
-
import Table from '../table.js';
|
|
4
|
+
import { Table } from '../table.js';
|
|
5
5
|
/**
|
|
6
6
|
* This plugin has no use and no effect if your table has border-collapse: separate (default)
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare class TableFreezeInheritBorder extends Plugin<Table> {
|
|
9
9
|
tableStyle: CSSStyleDeclaration;
|
|
10
10
|
tableFreeze: TableFreeze;
|
|
11
11
|
constructor(table: Table);
|
package/freeze/inherit-border.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Plugin from '../../plugin/plugin.js';
|
|
1
|
+
import { Plugin } from '../../plugin/plugin.js';
|
|
2
2
|
/**
|
|
3
3
|
* This plugin has no use and no effect if your table has border-collapse: separate (default)
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export class TableFreezeInheritBorder extends Plugin {
|
|
6
6
|
tableStyle;
|
|
7
7
|
tableFreeze;
|
|
8
8
|
constructor(table) {
|
package/freeze.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Plugin from '../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
-
import Table from './table.js';
|
|
1
|
+
import { Plugin } from '../node_modules/@itrocks/plugin/plugin.js';
|
|
2
|
+
import { Table } from './table.js';
|
|
3
3
|
export type HTMLTableFreezeElement = HTMLTableCellElement | HTMLTableColElement;
|
|
4
4
|
interface FullIndex {
|
|
5
5
|
column: string;
|
|
6
6
|
corner: string;
|
|
7
7
|
row: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export declare class TableFreeze extends Plugin<Table> {
|
|
10
10
|
columns: NodeListOf<HTMLTableFreezeElement>;
|
|
11
11
|
full?: FullIndex;
|
|
12
12
|
leftColumnCount: number;
|
package/freeze.js
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@itrocks/prepare-module": "latest",
|
|
13
13
|
"@types/node": "^22.9",
|
|
14
|
-
"sass": "^1.
|
|
14
|
+
"sass": "^1.83",
|
|
15
15
|
"typescript": "5.6"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
"README.md",
|
|
20
20
|
"**/*.d.ts",
|
|
21
21
|
"**/*.js",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"!src/**"
|
|
22
|
+
"!/demo",
|
|
23
|
+
"!/src"
|
|
25
24
|
],
|
|
26
25
|
"homepage": "https://it.rocks",
|
|
27
26
|
"keywords": [
|
|
@@ -46,10 +45,10 @@
|
|
|
46
45
|
"url": "git+https://github.com/itrocks-ts/table.git"
|
|
47
46
|
},
|
|
48
47
|
"scripts": {
|
|
49
|
-
"build": "tsc && sass demo:demo",
|
|
48
|
+
"build": "tsc && sass --no-source-map demo:demo",
|
|
50
49
|
"prepare": "prepare-module"
|
|
51
50
|
},
|
|
52
51
|
"type": "module",
|
|
53
52
|
"types": "./table.d.ts",
|
|
54
|
-
"version": "0.0.
|
|
53
|
+
"version": "0.0.13"
|
|
55
54
|
}
|
package/table.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare function applyStyleSheets(): void;
|
|
|
3
3
|
export declare function garbageCollector(): void;
|
|
4
4
|
export declare function getTables(): Table[];
|
|
5
5
|
export type Options = PluginOptions<Table>;
|
|
6
|
-
export
|
|
6
|
+
export declare class Table extends HasPlugins<Table> {
|
|
7
7
|
readonly element: HTMLTableElement;
|
|
8
8
|
readonly id: number;
|
|
9
9
|
readonly selector: string;
|