@operato/utils 10.0.0 → 10.11.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/CHANGELOG.md +19 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +131 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +328 -0
- package/dist/src/has-overflow.js +23 -1
- package/dist/src/has-overflow.js.map +1 -1
- package/dist/src/reactive-controllers/tooltip-reactive-controller.d.ts +42 -0
- package/dist/src/reactive-controllers/tooltip-reactive-controller.js +141 -37
- package/dist/src/reactive-controllers/tooltip-reactive-controller.js.map +1 -1
- package/dist/test/has-overflow.test.d.ts +1 -0
- package/dist/test/has-overflow.test.js +49 -0
- package/dist/test/has-overflow.test.js.map +1 -0
- package/dist/test/tooltip-reactive-controller.test.d.ts +1 -0
- package/dist/test/tooltip-reactive-controller.test.js +78 -0
- package/dist/test/tooltip-reactive-controller.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/test/has-overflow.test.ts +61 -0
- package/test/tooltip-reactive-controller.test.ts +88 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
var addSorting = (function() {
|
|
3
|
+
'use strict';
|
|
4
|
+
var cols,
|
|
5
|
+
currentSort = {
|
|
6
|
+
index: 0,
|
|
7
|
+
desc: false
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// returns the summary table element
|
|
11
|
+
function getTable() {
|
|
12
|
+
return document.querySelector('.coverage-summary');
|
|
13
|
+
}
|
|
14
|
+
// returns the thead element of the summary table
|
|
15
|
+
function getTableHeader() {
|
|
16
|
+
return getTable().querySelector('thead tr');
|
|
17
|
+
}
|
|
18
|
+
// returns the tbody element of the summary table
|
|
19
|
+
function getTableBody() {
|
|
20
|
+
return getTable().querySelector('tbody');
|
|
21
|
+
}
|
|
22
|
+
// returns the th element for nth column
|
|
23
|
+
function getNthColumn(n) {
|
|
24
|
+
return getTableHeader().querySelectorAll('th')[n];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onFilterInput() {
|
|
28
|
+
const searchValue = document.getElementById('fileSearch').value;
|
|
29
|
+
const rows = document.getElementsByTagName('tbody')[0].children;
|
|
30
|
+
|
|
31
|
+
// Try to create a RegExp from the searchValue. If it fails (invalid regex),
|
|
32
|
+
// it will be treated as a plain text search
|
|
33
|
+
let searchRegex;
|
|
34
|
+
try {
|
|
35
|
+
searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
|
|
36
|
+
} catch (error) {
|
|
37
|
+
searchRegex = null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < rows.length; i++) {
|
|
41
|
+
const row = rows[i];
|
|
42
|
+
let isMatch = false;
|
|
43
|
+
|
|
44
|
+
if (searchRegex) {
|
|
45
|
+
// If a valid regex was created, use it for matching
|
|
46
|
+
isMatch = searchRegex.test(row.textContent);
|
|
47
|
+
} else {
|
|
48
|
+
// Otherwise, fall back to the original plain text search
|
|
49
|
+
isMatch = row.textContent
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.includes(searchValue.toLowerCase());
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
row.style.display = isMatch ? '' : 'none';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// loads the search box
|
|
59
|
+
function addSearchBox() {
|
|
60
|
+
var template = document.getElementById('filterTemplate');
|
|
61
|
+
var templateClone = template.content.cloneNode(true);
|
|
62
|
+
templateClone.getElementById('fileSearch').oninput = onFilterInput;
|
|
63
|
+
template.parentElement.appendChild(templateClone);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// loads all columns
|
|
67
|
+
function loadColumns() {
|
|
68
|
+
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
69
|
+
colNode,
|
|
70
|
+
cols = [],
|
|
71
|
+
col,
|
|
72
|
+
i;
|
|
73
|
+
|
|
74
|
+
for (i = 0; i < colNodes.length; i += 1) {
|
|
75
|
+
colNode = colNodes[i];
|
|
76
|
+
col = {
|
|
77
|
+
key: colNode.getAttribute('data-col'),
|
|
78
|
+
sortable: !colNode.getAttribute('data-nosort'),
|
|
79
|
+
type: colNode.getAttribute('data-type') || 'string'
|
|
80
|
+
};
|
|
81
|
+
cols.push(col);
|
|
82
|
+
if (col.sortable) {
|
|
83
|
+
col.defaultDescSort = col.type === 'number';
|
|
84
|
+
colNode.innerHTML =
|
|
85
|
+
colNode.innerHTML + '<span class="sorter"></span>';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return cols;
|
|
89
|
+
}
|
|
90
|
+
// attaches a data attribute to every tr element with an object
|
|
91
|
+
// of data values keyed by column name
|
|
92
|
+
function loadRowData(tableRow) {
|
|
93
|
+
var tableCols = tableRow.querySelectorAll('td'),
|
|
94
|
+
colNode,
|
|
95
|
+
col,
|
|
96
|
+
data = {},
|
|
97
|
+
i,
|
|
98
|
+
val;
|
|
99
|
+
for (i = 0; i < tableCols.length; i += 1) {
|
|
100
|
+
colNode = tableCols[i];
|
|
101
|
+
col = cols[i];
|
|
102
|
+
val = colNode.getAttribute('data-value');
|
|
103
|
+
if (col.type === 'number') {
|
|
104
|
+
val = Number(val);
|
|
105
|
+
}
|
|
106
|
+
data[col.key] = val;
|
|
107
|
+
}
|
|
108
|
+
return data;
|
|
109
|
+
}
|
|
110
|
+
// loads all row data
|
|
111
|
+
function loadData() {
|
|
112
|
+
var rows = getTableBody().querySelectorAll('tr'),
|
|
113
|
+
i;
|
|
114
|
+
|
|
115
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
116
|
+
rows[i].data = loadRowData(rows[i]);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// sorts the table using the data for the ith column
|
|
120
|
+
function sortByIndex(index, desc) {
|
|
121
|
+
var key = cols[index].key,
|
|
122
|
+
sorter = function(a, b) {
|
|
123
|
+
a = a.data[key];
|
|
124
|
+
b = b.data[key];
|
|
125
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
126
|
+
},
|
|
127
|
+
finalSorter = sorter,
|
|
128
|
+
tableBody = document.querySelector('.coverage-summary tbody'),
|
|
129
|
+
rowNodes = tableBody.querySelectorAll('tr'),
|
|
130
|
+
rows = [],
|
|
131
|
+
i;
|
|
132
|
+
|
|
133
|
+
if (desc) {
|
|
134
|
+
finalSorter = function(a, b) {
|
|
135
|
+
return -1 * sorter(a, b);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
for (i = 0; i < rowNodes.length; i += 1) {
|
|
140
|
+
rows.push(rowNodes[i]);
|
|
141
|
+
tableBody.removeChild(rowNodes[i]);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
rows.sort(finalSorter);
|
|
145
|
+
|
|
146
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
147
|
+
tableBody.appendChild(rows[i]);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// removes sort indicators for current column being sorted
|
|
151
|
+
function removeSortIndicators() {
|
|
152
|
+
var col = getNthColumn(currentSort.index),
|
|
153
|
+
cls = col.className;
|
|
154
|
+
|
|
155
|
+
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
|
156
|
+
col.className = cls;
|
|
157
|
+
}
|
|
158
|
+
// adds sort indicators for current column being sorted
|
|
159
|
+
function addSortIndicators() {
|
|
160
|
+
getNthColumn(currentSort.index).className += currentSort.desc
|
|
161
|
+
? ' sorted-desc'
|
|
162
|
+
: ' sorted';
|
|
163
|
+
}
|
|
164
|
+
// adds event listeners for all sorter widgets
|
|
165
|
+
function enableUI() {
|
|
166
|
+
var i,
|
|
167
|
+
el,
|
|
168
|
+
ithSorter = function ithSorter(i) {
|
|
169
|
+
var col = cols[i];
|
|
170
|
+
|
|
171
|
+
return function() {
|
|
172
|
+
var desc = col.defaultDescSort;
|
|
173
|
+
|
|
174
|
+
if (currentSort.index === i) {
|
|
175
|
+
desc = !currentSort.desc;
|
|
176
|
+
}
|
|
177
|
+
sortByIndex(i, desc);
|
|
178
|
+
removeSortIndicators();
|
|
179
|
+
currentSort.index = i;
|
|
180
|
+
currentSort.desc = desc;
|
|
181
|
+
addSortIndicators();
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
for (i = 0; i < cols.length; i += 1) {
|
|
185
|
+
if (cols[i].sortable) {
|
|
186
|
+
// add the click event handler on the th so users
|
|
187
|
+
// dont have to click on those tiny arrows
|
|
188
|
+
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
|
189
|
+
if (el.addEventListener) {
|
|
190
|
+
el.addEventListener('click', ithSorter(i));
|
|
191
|
+
} else {
|
|
192
|
+
el.attachEvent('onclick', ithSorter(i));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// adds sorting functionality to the UI
|
|
198
|
+
return function() {
|
|
199
|
+
if (!getTable()) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
cols = loadColumns();
|
|
203
|
+
loadData();
|
|
204
|
+
addSearchBox();
|
|
205
|
+
addSortIndicators();
|
|
206
|
+
enableUI();
|
|
207
|
+
};
|
|
208
|
+
})();
|
|
209
|
+
|
|
210
|
+
window.addEventListener('load', addSorting);
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
TN:
|
|
2
|
+
SF:src/has-overflow.ts
|
|
3
|
+
FN:7,hasOverflow
|
|
4
|
+
FNF:1
|
|
5
|
+
FNH:1
|
|
6
|
+
FNDA:7,hasOverflow
|
|
7
|
+
DA:1,2
|
|
8
|
+
DA:2,2
|
|
9
|
+
DA:3,2
|
|
10
|
+
DA:4,2
|
|
11
|
+
DA:5,2
|
|
12
|
+
DA:6,2
|
|
13
|
+
DA:7,2
|
|
14
|
+
DA:8,7
|
|
15
|
+
DA:9,7
|
|
16
|
+
DA:10,7
|
|
17
|
+
DA:11,7
|
|
18
|
+
DA:12,0
|
|
19
|
+
DA:13,0
|
|
20
|
+
DA:14,7
|
|
21
|
+
DA:15,7
|
|
22
|
+
DA:16,7
|
|
23
|
+
DA:17,7
|
|
24
|
+
DA:18,0
|
|
25
|
+
DA:19,0
|
|
26
|
+
DA:20,7
|
|
27
|
+
DA:21,7
|
|
28
|
+
DA:22,1
|
|
29
|
+
DA:23,1
|
|
30
|
+
DA:24,6
|
|
31
|
+
DA:25,6
|
|
32
|
+
DA:26,6
|
|
33
|
+
DA:27,6
|
|
34
|
+
DA:28,6
|
|
35
|
+
DA:29,6
|
|
36
|
+
DA:30,6
|
|
37
|
+
DA:31,6
|
|
38
|
+
DA:32,6
|
|
39
|
+
DA:33,6
|
|
40
|
+
DA:34,6
|
|
41
|
+
DA:35,6
|
|
42
|
+
DA:36,6
|
|
43
|
+
DA:37,7
|
|
44
|
+
DA:38,1
|
|
45
|
+
DA:39,1
|
|
46
|
+
DA:40,5
|
|
47
|
+
DA:41,5
|
|
48
|
+
DA:42,5
|
|
49
|
+
DA:43,5
|
|
50
|
+
DA:44,5
|
|
51
|
+
DA:45,5
|
|
52
|
+
DA:46,5
|
|
53
|
+
DA:47,5
|
|
54
|
+
LF:47
|
|
55
|
+
LH:43
|
|
56
|
+
BRDA:7,0,0,7
|
|
57
|
+
BRDA:11,1,0,0
|
|
58
|
+
BRDA:15,2,0,6
|
|
59
|
+
BRDA:17,3,0,0
|
|
60
|
+
BRDA:21,4,0,1
|
|
61
|
+
BRDA:24,5,0,6
|
|
62
|
+
BRDA:37,6,0,1
|
|
63
|
+
BRDA:40,7,0,5
|
|
64
|
+
BRF:8
|
|
65
|
+
BRH:6
|
|
66
|
+
end_of_record
|
|
67
|
+
TN:
|
|
68
|
+
SF:src/reactive-controllers/tooltip-reactive-controller.ts
|
|
69
|
+
FN:32,TooltipReactiveController
|
|
70
|
+
FN:116,TooltipReactiveController.handleMouseOver
|
|
71
|
+
FN:203,TooltipReactiveController.handleMouseOut
|
|
72
|
+
FN:69,ensureContainer
|
|
73
|
+
FN:104,hostConnected
|
|
74
|
+
FN:110,hostDisconnected
|
|
75
|
+
FN:150,cancelPending
|
|
76
|
+
FN:157,show
|
|
77
|
+
FNF:8
|
|
78
|
+
FNH:7
|
|
79
|
+
FNDA:4,TooltipReactiveController
|
|
80
|
+
FNDA:4,TooltipReactiveController.handleMouseOver
|
|
81
|
+
FNDA:0,TooltipReactiveController.handleMouseOut
|
|
82
|
+
FNDA:4,ensureContainer
|
|
83
|
+
FNDA:4,hostConnected
|
|
84
|
+
FNDA:4,hostDisconnected
|
|
85
|
+
FNDA:3,cancelPending
|
|
86
|
+
FNDA:3,show
|
|
87
|
+
DA:1,1
|
|
88
|
+
DA:2,1
|
|
89
|
+
DA:3,1
|
|
90
|
+
DA:4,1
|
|
91
|
+
DA:5,1
|
|
92
|
+
DA:6,1
|
|
93
|
+
DA:7,1
|
|
94
|
+
DA:8,1
|
|
95
|
+
DA:9,1
|
|
96
|
+
DA:10,1
|
|
97
|
+
DA:11,1
|
|
98
|
+
DA:12,1
|
|
99
|
+
DA:13,1
|
|
100
|
+
DA:14,1
|
|
101
|
+
DA:15,1
|
|
102
|
+
DA:16,1
|
|
103
|
+
DA:17,1
|
|
104
|
+
DA:18,1
|
|
105
|
+
DA:19,1
|
|
106
|
+
DA:20,1
|
|
107
|
+
DA:21,1
|
|
108
|
+
DA:22,1
|
|
109
|
+
DA:23,1
|
|
110
|
+
DA:24,1
|
|
111
|
+
DA:25,1
|
|
112
|
+
DA:26,1
|
|
113
|
+
DA:27,1
|
|
114
|
+
DA:28,1
|
|
115
|
+
DA:29,1
|
|
116
|
+
DA:30,1
|
|
117
|
+
DA:31,1
|
|
118
|
+
DA:32,1
|
|
119
|
+
DA:33,4
|
|
120
|
+
DA:34,4
|
|
121
|
+
DA:35,4
|
|
122
|
+
DA:36,4
|
|
123
|
+
DA:37,4
|
|
124
|
+
DA:38,4
|
|
125
|
+
DA:39,4
|
|
126
|
+
DA:40,4
|
|
127
|
+
DA:41,4
|
|
128
|
+
DA:42,4
|
|
129
|
+
DA:43,4
|
|
130
|
+
DA:44,4
|
|
131
|
+
DA:45,4
|
|
132
|
+
DA:46,4
|
|
133
|
+
DA:47,4
|
|
134
|
+
DA:48,4
|
|
135
|
+
DA:49,4
|
|
136
|
+
DA:50,4
|
|
137
|
+
DA:51,4
|
|
138
|
+
DA:52,1
|
|
139
|
+
DA:53,1
|
|
140
|
+
DA:54,1
|
|
141
|
+
DA:55,1
|
|
142
|
+
DA:56,1
|
|
143
|
+
DA:57,1
|
|
144
|
+
DA:58,1
|
|
145
|
+
DA:59,1
|
|
146
|
+
DA:60,1
|
|
147
|
+
DA:61,1
|
|
148
|
+
DA:62,1
|
|
149
|
+
DA:63,1
|
|
150
|
+
DA:64,1
|
|
151
|
+
DA:65,1
|
|
152
|
+
DA:66,1
|
|
153
|
+
DA:67,1
|
|
154
|
+
DA:68,1
|
|
155
|
+
DA:69,1
|
|
156
|
+
DA:70,4
|
|
157
|
+
DA:71,3
|
|
158
|
+
DA:72,3
|
|
159
|
+
DA:73,1
|
|
160
|
+
DA:74,1
|
|
161
|
+
DA:75,1
|
|
162
|
+
DA:76,1
|
|
163
|
+
DA:77,1
|
|
164
|
+
DA:78,1
|
|
165
|
+
DA:79,1
|
|
166
|
+
DA:80,1
|
|
167
|
+
DA:81,1
|
|
168
|
+
DA:82,1
|
|
169
|
+
DA:83,1
|
|
170
|
+
DA:84,1
|
|
171
|
+
DA:85,1
|
|
172
|
+
DA:86,1
|
|
173
|
+
DA:87,1
|
|
174
|
+
DA:88,1
|
|
175
|
+
DA:89,1
|
|
176
|
+
DA:90,1
|
|
177
|
+
DA:91,1
|
|
178
|
+
DA:92,1
|
|
179
|
+
DA:93,1
|
|
180
|
+
DA:94,1
|
|
181
|
+
DA:95,1
|
|
182
|
+
DA:96,1
|
|
183
|
+
DA:97,1
|
|
184
|
+
DA:98,1
|
|
185
|
+
DA:99,1
|
|
186
|
+
DA:100,1
|
|
187
|
+
DA:101,1
|
|
188
|
+
DA:102,1
|
|
189
|
+
DA:103,1
|
|
190
|
+
DA:104,1
|
|
191
|
+
DA:105,4
|
|
192
|
+
DA:106,4
|
|
193
|
+
DA:107,4
|
|
194
|
+
DA:108,4
|
|
195
|
+
DA:109,1
|
|
196
|
+
DA:110,1
|
|
197
|
+
DA:111,4
|
|
198
|
+
DA:112,4
|
|
199
|
+
DA:113,4
|
|
200
|
+
DA:114,4
|
|
201
|
+
DA:115,1
|
|
202
|
+
DA:116,1
|
|
203
|
+
DA:117,4
|
|
204
|
+
DA:118,4
|
|
205
|
+
DA:119,4
|
|
206
|
+
DA:120,4
|
|
207
|
+
DA:121,4
|
|
208
|
+
DA:122,4
|
|
209
|
+
DA:123,4
|
|
210
|
+
DA:124,4
|
|
211
|
+
DA:125,4
|
|
212
|
+
DA:126,4
|
|
213
|
+
DA:127,4
|
|
214
|
+
DA:128,4
|
|
215
|
+
DA:129,4
|
|
216
|
+
DA:130,4
|
|
217
|
+
DA:131,4
|
|
218
|
+
DA:132,4
|
|
219
|
+
DA:133,1
|
|
220
|
+
DA:134,1
|
|
221
|
+
DA:135,3
|
|
222
|
+
DA:136,3
|
|
223
|
+
DA:137,3
|
|
224
|
+
DA:138,3
|
|
225
|
+
DA:139,4
|
|
226
|
+
DA:140,3
|
|
227
|
+
DA:141,3
|
|
228
|
+
DA:142,3
|
|
229
|
+
DA:143,0
|
|
230
|
+
DA:144,0
|
|
231
|
+
DA:145,0
|
|
232
|
+
DA:146,0
|
|
233
|
+
DA:147,0
|
|
234
|
+
DA:148,0
|
|
235
|
+
DA:149,1
|
|
236
|
+
DA:150,1
|
|
237
|
+
DA:151,3
|
|
238
|
+
DA:152,0
|
|
239
|
+
DA:153,0
|
|
240
|
+
DA:154,0
|
|
241
|
+
DA:155,3
|
|
242
|
+
DA:156,1
|
|
243
|
+
DA:157,1
|
|
244
|
+
DA:158,3
|
|
245
|
+
DA:159,3
|
|
246
|
+
DA:160,3
|
|
247
|
+
DA:161,3
|
|
248
|
+
DA:162,3
|
|
249
|
+
DA:163,3
|
|
250
|
+
DA:164,3
|
|
251
|
+
DA:165,3
|
|
252
|
+
DA:166,3
|
|
253
|
+
DA:167,3
|
|
254
|
+
DA:168,3
|
|
255
|
+
DA:169,3
|
|
256
|
+
DA:170,3
|
|
257
|
+
DA:171,3
|
|
258
|
+
DA:172,3
|
|
259
|
+
DA:173,3
|
|
260
|
+
DA:174,3
|
|
261
|
+
DA:175,3
|
|
262
|
+
DA:176,3
|
|
263
|
+
DA:177,3
|
|
264
|
+
DA:178,3
|
|
265
|
+
DA:179,3
|
|
266
|
+
DA:180,3
|
|
267
|
+
DA:181,3
|
|
268
|
+
DA:182,3
|
|
269
|
+
DA:183,3
|
|
270
|
+
DA:184,3
|
|
271
|
+
DA:185,3
|
|
272
|
+
DA:186,3
|
|
273
|
+
DA:187,3
|
|
274
|
+
DA:188,3
|
|
275
|
+
DA:189,0
|
|
276
|
+
DA:190,0
|
|
277
|
+
DA:191,3
|
|
278
|
+
DA:192,3
|
|
279
|
+
DA:193,0
|
|
280
|
+
DA:194,0
|
|
281
|
+
DA:195,3
|
|
282
|
+
DA:196,3
|
|
283
|
+
DA:197,3
|
|
284
|
+
DA:198,3
|
|
285
|
+
DA:199,3
|
|
286
|
+
DA:200,3
|
|
287
|
+
DA:201,3
|
|
288
|
+
DA:202,1
|
|
289
|
+
DA:203,1
|
|
290
|
+
DA:204,0
|
|
291
|
+
DA:205,0
|
|
292
|
+
DA:206,0
|
|
293
|
+
DA:207,0
|
|
294
|
+
DA:208,0
|
|
295
|
+
DA:209,0
|
|
296
|
+
DA:210,0
|
|
297
|
+
DA:211,0
|
|
298
|
+
DA:212,0
|
|
299
|
+
DA:213,1
|
|
300
|
+
LF:213
|
|
301
|
+
LH:191
|
|
302
|
+
BRDA:32,0,0,4
|
|
303
|
+
BRDA:41,1,0,0
|
|
304
|
+
BRDA:46,2,0,0
|
|
305
|
+
BRDA:116,3,0,4
|
|
306
|
+
BRDA:130,4,0,0
|
|
307
|
+
BRDA:132,5,0,3
|
|
308
|
+
BRDA:132,6,0,1
|
|
309
|
+
BRDA:135,7,0,3
|
|
310
|
+
BRDA:139,8,0,1
|
|
311
|
+
BRDA:139,9,0,3
|
|
312
|
+
BRDA:143,10,0,0
|
|
313
|
+
BRDA:69,11,0,4
|
|
314
|
+
BRDA:70,12,0,3
|
|
315
|
+
BRDA:73,13,0,1
|
|
316
|
+
BRDA:104,14,0,4
|
|
317
|
+
BRDA:105,15,0,0
|
|
318
|
+
BRDA:110,16,0,4
|
|
319
|
+
BRDA:111,17,0,0
|
|
320
|
+
BRDA:150,18,0,3
|
|
321
|
+
BRDA:151,19,0,0
|
|
322
|
+
BRDA:157,20,0,3
|
|
323
|
+
BRDA:162,21,0,0
|
|
324
|
+
BRDA:188,22,0,0
|
|
325
|
+
BRDA:192,23,0,0
|
|
326
|
+
BRF:24
|
|
327
|
+
BRH:14
|
|
328
|
+
end_of_record
|
package/dist/src/has-overflow.js
CHANGED
|
@@ -14,6 +14,28 @@ export function hasOverflow(el) {
|
|
|
14
14
|
if (originalOverflow === 'visible') {
|
|
15
15
|
el.style.overflow = '';
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
if (isOverflowing) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
/*
|
|
21
|
+
* A flex box reports no overflow even when its text is cut.
|
|
22
|
+
*
|
|
23
|
+
* scrollWidth measures what the box laid out, and flex lays its items out to fit — so a row
|
|
24
|
+
* whose title is ellipsised still answers scrollWidth === clientWidth. Measured on the plant
|
|
25
|
+
* calendar 2026-09-11: rows at client 114 with text 121, 123, 139 and 148 wide, every one
|
|
26
|
+
* visibly cut, every one reported as not overflowing. The tooltip that gates on this never
|
|
27
|
+
* appeared, on any row.
|
|
28
|
+
*
|
|
29
|
+
* Blocks are unaffected — they keep the fast answer above. Only a flex container pays for the
|
|
30
|
+
* second measurement, and only when the first says no.
|
|
31
|
+
*/
|
|
32
|
+
if (!computedStyle.display.includes('flex')) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const range = document.createRange();
|
|
36
|
+
range.selectNodeContents(el);
|
|
37
|
+
const content = range.getBoundingClientRect().width;
|
|
38
|
+
range.detach();
|
|
39
|
+
return content > el.clientWidth + 1;
|
|
18
40
|
}
|
|
19
41
|
//# sourceMappingURL=has-overflow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-overflow.js","sourceRoot":"","sources":["../../src/has-overflow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAe;IACzC,MAAM,aAAa,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAA;IAC1C,MAAM,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAA;IAE/C,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC9B,CAAC;IAED,MAAM,aAAa,GAAG,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,CAAA;IAE1F,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAA;IACxB,CAAC;IAED,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"has-overflow.js","sourceRoot":"","sources":["../../src/has-overflow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAe;IACzC,MAAM,aAAa,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAA;IAC1C,MAAM,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAA;IAE/C,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC9B,CAAC;IAED,MAAM,aAAa,GAAG,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,YAAY,CAAA;IAE1F,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAA;IACxB,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAA;IACpC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;IACnD,KAAK,CAAC,MAAM,EAAE,CAAA;IAEd,OAAO,OAAO,GAAG,EAAE,CAAC,WAAW,GAAG,CAAC,CAAA;AACrC,CAAC","sourcesContent":["/**\n * Detects if the content of an HTMLElement overflows its boundaries.\n *\n * @param {HTMLElement} el - The HTMLElement to check for overflow.\n * @returns {boolean} - `true` if overflow is detected, `false` otherwise.\n */\nexport function hasOverflow(el: HTMLElement): boolean {\n const computedStyle = getComputedStyle(el)\n const originalOverflow = computedStyle.overflow\n\n if (originalOverflow === 'visible') {\n el.style.overflow = 'hidden'\n }\n\n const isOverflowing = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight\n\n if (originalOverflow === 'visible') {\n el.style.overflow = ''\n }\n\n if (isOverflowing) {\n return true\n }\n\n /*\n * A flex box reports no overflow even when its text is cut.\n *\n * scrollWidth measures what the box laid out, and flex lays its items out to fit — so a row\n * whose title is ellipsised still answers scrollWidth === clientWidth. Measured on the plant\n * calendar 2026-09-11: rows at client 114 with text 121, 123, 139 and 148 wide, every one\n * visibly cut, every one reported as not overflowing. The tooltip that gates on this never\n * appeared, on any row.\n *\n * Blocks are unaffected — they keep the fast answer above. Only a flex container pays for the\n * second measurement, and only when the first says no.\n */\n if (!computedStyle.display.includes('flex')) {\n return false\n }\n\n const range = document.createRange()\n range.selectNodeContents(el)\n const content = range.getBoundingClientRect().width\n range.detach()\n\n return content > el.clientWidth + 1\n}\n"]}
|
|
@@ -1,15 +1,57 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
2
|
export declare class TooltipReactiveController implements ReactiveController {
|
|
3
|
+
/**
|
|
4
|
+
* 뜨기까지 기다리는 시간(밀리초).
|
|
5
|
+
*
|
|
6
|
+
* ── 왜 기다리나 ─────────────────────────────────────────────────────────
|
|
7
|
+
* 표를 훑을 때 마우스는 여러 칸을 스쳐 지난다. 지연이 없으면 그 칸마다 툴팁이 떴다 사라져서, 읽으려는
|
|
8
|
+
* 것을 가리고 눈이 따라가야 한다. 지연을 두면 **머문 곳에만** 뜬다 — 스쳐 지난 것과 보려고 멈춘 것을
|
|
9
|
+
* 가른다(hover intent).
|
|
10
|
+
*
|
|
11
|
+
* 450ms 는 관례에 가까운 값이다. 더 짧으면 스치는 것과 구별되지 않고, 더 길면 「안 뜨는 것」처럼
|
|
12
|
+
* 느껴진다.
|
|
13
|
+
*
|
|
14
|
+
* ── 한 번 뜬 뒤에는 기다리지 않는다 ──────────────────────────────────────
|
|
15
|
+
* 이미 떠 있으면 다음 요소로 옮길 때 바로 바꾼다. 한 번 「보고 싶다」를 표현했으니 옆 칸을 볼 때마다
|
|
16
|
+
* 다시 기다리게 하지 않는다.
|
|
17
|
+
*/
|
|
18
|
+
private static readonly DEFAULT_ENTER_DELAY;
|
|
3
19
|
private host;
|
|
4
20
|
private attributeName;
|
|
5
21
|
private content?;
|
|
22
|
+
private enterDelay;
|
|
6
23
|
private static tooltipContainer;
|
|
24
|
+
/** 뜨기를 기다리는 중인 타이머. */
|
|
25
|
+
private static pending;
|
|
26
|
+
/** 지금 툴팁이 떠 있는가. 떠 있으면 다음 요소로 옮길 때 기다리지 않는다. */
|
|
27
|
+
private static shown;
|
|
7
28
|
constructor(host: ReactiveControllerHost & HTMLElement, options?: {
|
|
8
29
|
content?: string | ((element: HTMLElement) => string);
|
|
9
30
|
attributeName?: string;
|
|
31
|
+
/** 머무른 시간이 이만큼을 넘으면 뜬다(밀리초). 0 이면 바로 뜬다. */
|
|
32
|
+
enterDelay?: number;
|
|
10
33
|
});
|
|
34
|
+
/**
|
|
35
|
+
* 툴팁 상자를 만든다 — 문서에 하나만 둔다.
|
|
36
|
+
*
|
|
37
|
+
* ── 모양 ────────────────────────────────────────────────────────────────
|
|
38
|
+
* 전에는 검정 70% 바탕 · 3px 둥글기 · 물려받은 글자 크기였다. 앱의 토큰을 하나도 쓰지 않아서, 화면이
|
|
39
|
+
* 어떤 색과 크기를 쓰든 툴팁만 브라우저 기본처럼 보였다.
|
|
40
|
+
*
|
|
41
|
+
* 이제 --ui-* 를 본다. 툴팁은 **화면 위에 잠깐 떠 있는 것**이라 화면과 같은 면이 아니고, 그래서
|
|
42
|
+
* 어두운 면에 흰 글자다 — 밝은 면으로 두면 표와 섞여 어디까지가 툴팁인지 안 보인다.
|
|
43
|
+
*
|
|
44
|
+
* 글자는 본문보다 한 단 작다(12px). 툴팁은 값이 아니라 값을 거드는 말이다.
|
|
45
|
+
*
|
|
46
|
+
* 테두리는 두지 않는다 — 어두운 면이 스스로 경계다. 그림자는 떠 있음을 말할 만큼만 옅게 둔다.
|
|
47
|
+
*
|
|
48
|
+
* 값은 모두 --tooltip-* 으로 덮을 수 있다. 어두운 테마는 이 값들을 뒤집어야 한다.
|
|
49
|
+
*/
|
|
50
|
+
private static ensureContainer;
|
|
11
51
|
hostConnected(): void;
|
|
12
52
|
hostDisconnected(): void;
|
|
13
53
|
private handleMouseOver;
|
|
54
|
+
private static cancelPending;
|
|
55
|
+
private show;
|
|
14
56
|
private handleMouseOut;
|
|
15
57
|
}
|