niuma-ui 1.3.0 → 1.3.2
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 +25 -0
- package/dist/components/RsButton.css +119 -61
- package/dist/components/RsButton.d.ts +3 -3
- package/dist/components/RsButton.impl.js +4 -12
- package/dist/components/RsButton.js +1 -1
- package/dist/components/RsDialog.css +1 -0
- package/dist/components/RsDialog.d.ts +5 -0
- package/dist/components/RsDialog.impl.js +4 -0
- package/dist/components/RsDrawer.css +1 -0
- package/dist/components/RsFieldset.css +92 -0
- package/dist/components/RsFieldset.d.ts +61 -0
- package/dist/components/RsFieldset.impl.js +78 -0
- package/dist/components/RsFieldset.js +8 -0
- package/dist/components/RsFormItem.css +19 -19
- package/dist/components/RsFormItem.d.ts +6 -4
- package/dist/components/RsFormItem.impl.js +12 -2
- package/dist/components/RsFormItem.js +1 -1
- package/dist/components/RsInput.css +78 -69
- package/dist/components/RsInput.js +1 -1
- package/dist/components/RsLog.css +198 -0
- package/dist/components/RsLog.d.ts +126 -0
- package/dist/components/RsLog.impl.js +619 -0
- package/dist/components/RsLog.js +8 -0
- package/dist/components/RsTable.impl.js +2 -1
- package/dist/components/RsTextarea.css +126 -0
- package/dist/components/RsTextarea.d.ts +114 -0
- package/dist/components/RsTextarea.impl.js +385 -0
- package/dist/components/RsTextarea.js +8 -0
- package/dist/components/RsTooltip.css +4 -3
- package/dist/components/RsTooltip.d.ts +2 -0
- package/dist/components/RsTooltip.impl.js +5 -2
- package/dist/components/RsVirtualList.css +6 -6
- package/dist/components/RsVirtualList.d.ts +1 -1
- package/dist/components/RsVirtualList.impl.js +9 -4
- package/dist/components/RsVirtualList.js +1 -1
- package/dist/components/button-utils.d.ts +19 -10
- package/dist/components/button-utils.js +22 -7
- package/dist/components/dialog-window.d.ts +2 -0
- package/dist/components/dialog-window.js +2 -1
- package/dist/components/fieldset-utils.d.ts +29 -0
- package/dist/components/fieldset-utils.js +12 -0
- package/dist/components/log-utils.d.ts +105 -0
- package/dist/components/log-utils.js +354 -0
- package/dist/components/table/rs-table-props.d.ts +8 -0
- package/dist/components/table/rs-table-props.js +1 -0
- package/dist/components/table/rs-table.css +7 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +24 -0
- package/dist/lib/rs-dayjs.js +1 -1
- package/dist/locale/messages.js +42 -0
- package/dist/styles.css +37 -0
- package/dist/vite-plugins/niuma-ui-host.d.ts +8 -0
- package/dist/vite-plugins/niuma-ui-host.js +47 -9
- package/package.json +1 -1
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
//#region src/components/log-utils.ts
|
|
2
|
+
var RS_LOG_LEVELS = [
|
|
3
|
+
"trace",
|
|
4
|
+
"debug",
|
|
5
|
+
"info",
|
|
6
|
+
"notice",
|
|
7
|
+
"success",
|
|
8
|
+
"warn",
|
|
9
|
+
"error",
|
|
10
|
+
"fatal",
|
|
11
|
+
"plain"
|
|
12
|
+
];
|
|
13
|
+
/** 可过滤的级别(不含 plain)。 */
|
|
14
|
+
var RS_LOG_FILTER_LEVELS = [
|
|
15
|
+
"trace",
|
|
16
|
+
"debug",
|
|
17
|
+
"info",
|
|
18
|
+
"notice",
|
|
19
|
+
"success",
|
|
20
|
+
"warn",
|
|
21
|
+
"error",
|
|
22
|
+
"fatal"
|
|
23
|
+
];
|
|
24
|
+
var LEVEL_SET = new Set(RS_LOG_LEVELS);
|
|
25
|
+
/** RFC 5424:数字越小越严重。success 映射为 info(6)。 */
|
|
26
|
+
var SYSLOG_OF = {
|
|
27
|
+
fatal: 2,
|
|
28
|
+
error: 3,
|
|
29
|
+
warn: 4,
|
|
30
|
+
notice: 5,
|
|
31
|
+
success: 6,
|
|
32
|
+
info: 6,
|
|
33
|
+
debug: 7,
|
|
34
|
+
trace: 7,
|
|
35
|
+
plain: null
|
|
36
|
+
};
|
|
37
|
+
/** OTel:数字越大越严重。取各档下限。 */
|
|
38
|
+
var OTEL_OF = {
|
|
39
|
+
trace: 1,
|
|
40
|
+
debug: 5,
|
|
41
|
+
info: 9,
|
|
42
|
+
notice: 10,
|
|
43
|
+
success: 9,
|
|
44
|
+
warn: 13,
|
|
45
|
+
error: 17,
|
|
46
|
+
fatal: 21,
|
|
47
|
+
plain: null
|
|
48
|
+
};
|
|
49
|
+
var ALIAS_LEVEL = {
|
|
50
|
+
trace: "trace",
|
|
51
|
+
debug: "debug",
|
|
52
|
+
info: "info",
|
|
53
|
+
information: "info",
|
|
54
|
+
informational: "info",
|
|
55
|
+
notice: "notice",
|
|
56
|
+
success: "success",
|
|
57
|
+
ok: "success",
|
|
58
|
+
warn: "warn",
|
|
59
|
+
warning: "warn",
|
|
60
|
+
error: "error",
|
|
61
|
+
err: "error",
|
|
62
|
+
failed: "error",
|
|
63
|
+
failure: "error",
|
|
64
|
+
fatal: "fatal",
|
|
65
|
+
crit: "fatal",
|
|
66
|
+
critical: "fatal",
|
|
67
|
+
emerg: "fatal",
|
|
68
|
+
emergency: "fatal",
|
|
69
|
+
alert: "fatal",
|
|
70
|
+
panic: "fatal",
|
|
71
|
+
plain: "plain",
|
|
72
|
+
output: "plain"
|
|
73
|
+
};
|
|
74
|
+
function isRsLogLevel(value) {
|
|
75
|
+
return typeof value === "string" && LEVEL_SET.has(value);
|
|
76
|
+
}
|
|
77
|
+
/** RFC 5424 Severity(0–7)。plain 返回 null。 */
|
|
78
|
+
function syslogSeverityOf(level) {
|
|
79
|
+
return SYSLOG_OF[level];
|
|
80
|
+
}
|
|
81
|
+
/** OpenTelemetry severity number。plain 返回 null。 */
|
|
82
|
+
function otelSeverityOf(level) {
|
|
83
|
+
return OTEL_OF[level];
|
|
84
|
+
}
|
|
85
|
+
function levelFromSyslog(value) {
|
|
86
|
+
if (value <= 2) return "fatal";
|
|
87
|
+
if (value === 3) return "error";
|
|
88
|
+
if (value === 4) return "warn";
|
|
89
|
+
if (value === 5) return "notice";
|
|
90
|
+
if (value === 6) return "info";
|
|
91
|
+
return "debug";
|
|
92
|
+
}
|
|
93
|
+
function levelFromOtel(value) {
|
|
94
|
+
if (value >= 21) return "fatal";
|
|
95
|
+
if (value >= 17) return "error";
|
|
96
|
+
if (value >= 13) return "warn";
|
|
97
|
+
if (value >= 9) return "info";
|
|
98
|
+
if (value >= 5) return "debug";
|
|
99
|
+
return "trace";
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 把别名、syslog 0–7、OTel 1–24 收成规范级别。
|
|
103
|
+
* 无法识别时返回 undefined,由调用方决定是否再推断。
|
|
104
|
+
*/
|
|
105
|
+
function parseRsLogLevel(value, scale = "auto") {
|
|
106
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
107
|
+
if (scale === "syslog") return levelFromSyslog(value);
|
|
108
|
+
if (scale === "otel") return levelFromOtel(value);
|
|
109
|
+
return value <= 7 ? levelFromSyslog(value) : levelFromOtel(value);
|
|
110
|
+
}
|
|
111
|
+
if (typeof value !== "string") return void 0;
|
|
112
|
+
const key = value.trim().toLowerCase();
|
|
113
|
+
if (!key) return void 0;
|
|
114
|
+
if (LEVEL_SET.has(key)) return key;
|
|
115
|
+
if (key in ALIAS_LEVEL) return ALIAS_LEVEL[key];
|
|
116
|
+
if (/^\d+$/.test(key)) return parseRsLogLevel(Number(key), scale);
|
|
117
|
+
}
|
|
118
|
+
/** 把任意输入收成日志行数组:字符串按行拆,对象原样保留。 */
|
|
119
|
+
function asLogLineInputs(input) {
|
|
120
|
+
if (typeof input === "string") return splitLogText(input);
|
|
121
|
+
if (Array.isArray(input)) return input;
|
|
122
|
+
return [input];
|
|
123
|
+
}
|
|
124
|
+
/** 拆成行。统一 CRLF;去掉末尾空行,避免 textarea 尾巴多一行。 */
|
|
125
|
+
function splitLogText(text) {
|
|
126
|
+
if (!text) return [];
|
|
127
|
+
const lines = text.replaceAll("\r\n", "\n").replaceAll("\r", "\n").split("\n");
|
|
128
|
+
if (lines.length > 1 && lines.at(-1) === "") lines.pop();
|
|
129
|
+
return lines;
|
|
130
|
+
}
|
|
131
|
+
/** 多条用户标识同时命中时,按严重程度取最高档。 */
|
|
132
|
+
var MARKER_RANK = [
|
|
133
|
+
"fatal",
|
|
134
|
+
"error",
|
|
135
|
+
"warn",
|
|
136
|
+
"notice",
|
|
137
|
+
"success",
|
|
138
|
+
"info",
|
|
139
|
+
"debug",
|
|
140
|
+
"trace"
|
|
141
|
+
];
|
|
142
|
+
/**
|
|
143
|
+
* 从一行正文推断语义色。
|
|
144
|
+
* 1. [error] / [ok] 等方括号级别(别名走 parseRsLogLevel)
|
|
145
|
+
* 2. 行首级别词,如 ERROR: / WARN
|
|
146
|
+
* 3. 工具链行首:BUILD SUCCESS / BUILD FAILURE / Exception in thread / panic:
|
|
147
|
+
* 4. 调用方 markers:成功 / 失败等产品标识(默认不扫)
|
|
148
|
+
* 行上已有 level / severity 时不会走到这里。
|
|
149
|
+
*/
|
|
150
|
+
function inferLogLevel(text, options) {
|
|
151
|
+
const raw = text.trim();
|
|
152
|
+
if (!raw) return "plain";
|
|
153
|
+
const tagged = levelFromBracketTag(raw);
|
|
154
|
+
if (tagged) return tagged;
|
|
155
|
+
const leading = raw.match(/^([a-z]+)\b/i)?.[1];
|
|
156
|
+
const fromLead = leading ? parseRsLogLevel(leading) : void 0;
|
|
157
|
+
if (fromLead && fromLead !== "plain") return fromLead;
|
|
158
|
+
if (/^BUILD SUCCESS\b/i.test(raw)) return "success";
|
|
159
|
+
if (/^BUILD FAILURE\b/i.test(raw)) return "error";
|
|
160
|
+
if (/^Exception in thread\b/i.test(raw)) return "error";
|
|
161
|
+
if (/^panic:/i.test(raw)) return "fatal";
|
|
162
|
+
return levelFromMarkers(raw, options?.markers) ?? "plain";
|
|
163
|
+
}
|
|
164
|
+
function levelFromBracketTag(text) {
|
|
165
|
+
const tag = /\[([^\]\n]+)\]/g;
|
|
166
|
+
let match = tag.exec(text);
|
|
167
|
+
while (match) {
|
|
168
|
+
const level = parseRsLogLevel(match[1]);
|
|
169
|
+
if (level && level !== "plain") return level;
|
|
170
|
+
match = tag.exec(text);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function escapeRegExp(value) {
|
|
174
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
175
|
+
}
|
|
176
|
+
function markerHits(text, marker) {
|
|
177
|
+
if (marker instanceof RegExp) {
|
|
178
|
+
const flags = marker.global ? marker.flags : `${marker.flags}g`;
|
|
179
|
+
const copy = new RegExp(marker.source, flags);
|
|
180
|
+
copy.lastIndex = 0;
|
|
181
|
+
return copy.test(text);
|
|
182
|
+
}
|
|
183
|
+
const token = marker.trim();
|
|
184
|
+
if (!token) return false;
|
|
185
|
+
return new RegExp(`(?<![A-Za-z0-9_])${escapeRegExp(token)}(?![A-Za-z0-9_])`, "i").test(text);
|
|
186
|
+
}
|
|
187
|
+
function levelFromMarkers(text, markers) {
|
|
188
|
+
if (!markers) return void 0;
|
|
189
|
+
for (const level of MARKER_RANK) {
|
|
190
|
+
const list = markers[level];
|
|
191
|
+
if (!list?.length) continue;
|
|
192
|
+
for (const marker of list) if (markerHits(text, marker)) return level;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function lineText(input) {
|
|
196
|
+
return typeof input === "string" ? input : String(input.text ?? "");
|
|
197
|
+
}
|
|
198
|
+
function lineKey(input, index) {
|
|
199
|
+
if (typeof input !== "string" && input.id != null && input.id !== "") return String(input.id);
|
|
200
|
+
return `${index}:${lineText(input).slice(0, 48)}`;
|
|
201
|
+
}
|
|
202
|
+
function looksLikeInstant(value) {
|
|
203
|
+
return /^\d{4}-\d{2}-\d{2}/.test(value) || value.includes("T");
|
|
204
|
+
}
|
|
205
|
+
var DEFAULT_TIME_FORMAT = {
|
|
206
|
+
hour: "2-digit",
|
|
207
|
+
minute: "2-digit",
|
|
208
|
+
second: "2-digit",
|
|
209
|
+
hour12: false
|
|
210
|
+
};
|
|
211
|
+
/** 能解析的瞬间走 Intl;已是展示串则原样保留。 */
|
|
212
|
+
function formatLogTime(value, locale = "en-US", options = DEFAULT_TIME_FORMAT) {
|
|
213
|
+
if (value == null || value === "") return void 0;
|
|
214
|
+
if (value instanceof Date) {
|
|
215
|
+
if (Number.isNaN(value.getTime())) return void 0;
|
|
216
|
+
return new Intl.DateTimeFormat(locale, options).format(value);
|
|
217
|
+
}
|
|
218
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
219
|
+
const date = new Date(value);
|
|
220
|
+
if (Number.isNaN(date.getTime())) return void 0;
|
|
221
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
|
222
|
+
}
|
|
223
|
+
if (typeof value === "string") {
|
|
224
|
+
if (looksLikeInstant(value)) {
|
|
225
|
+
const parsed = Date.parse(value);
|
|
226
|
+
if (!Number.isNaN(parsed)) return new Intl.DateTimeFormat(locale, options).format(new Date(parsed));
|
|
227
|
+
}
|
|
228
|
+
return value;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function resolveLineLevel(item, text, options) {
|
|
232
|
+
if (typeof item !== "string") {
|
|
233
|
+
const fromLevel = parseRsLogLevel(item.level, options.severityScale);
|
|
234
|
+
if (fromLevel) return fromLevel;
|
|
235
|
+
const fromSeverity = parseRsLogLevel(item.severity, options.severityScale ?? "auto");
|
|
236
|
+
if (fromSeverity) return fromSeverity;
|
|
237
|
+
}
|
|
238
|
+
return options.inferLevel !== false ? inferLogLevel(text, { markers: options.inferMarkers }) : "plain";
|
|
239
|
+
}
|
|
240
|
+
/** 把 string / 行对象收成渲染结构。inferLevel 默认开。 */
|
|
241
|
+
function normalizeLogLines(source, options = {}) {
|
|
242
|
+
const raw = source == null ? [] : typeof source === "string" ? splitLogText(source) : source;
|
|
243
|
+
const max = options.maxLines;
|
|
244
|
+
const sliced = max != null && max > 0 && raw.length > max ? raw.slice(raw.length - max) : raw;
|
|
245
|
+
const locale = options.locale ?? "en-US";
|
|
246
|
+
return sliced.map((item, index) => {
|
|
247
|
+
const text = lineText(item);
|
|
248
|
+
const level = resolveLineLevel(item, text, options);
|
|
249
|
+
const time = typeof item === "string" ? void 0 : formatLogTime(item.time, locale, options.timeFormat);
|
|
250
|
+
return {
|
|
251
|
+
key: lineKey(item, index),
|
|
252
|
+
text,
|
|
253
|
+
level,
|
|
254
|
+
time,
|
|
255
|
+
seq: index + 1,
|
|
256
|
+
syslog: syslogSeverityOf(level),
|
|
257
|
+
otel: otelSeverityOf(level)
|
|
258
|
+
};
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
/** 把一行收成可写回 v-model 的结构(字符串保持字符串)。 */
|
|
262
|
+
function toLogLineInput(input) {
|
|
263
|
+
if (typeof input === "string") return input;
|
|
264
|
+
const next = { text: String(input.text ?? "") };
|
|
265
|
+
const level = parseRsLogLevel(input.level);
|
|
266
|
+
if (input.id != null && input.id !== "") next.id = input.id;
|
|
267
|
+
if (level) next.level = level;
|
|
268
|
+
if (input.severity != null) next.severity = input.severity;
|
|
269
|
+
if (input.time != null && input.time !== "") next.time = input.time;
|
|
270
|
+
return next;
|
|
271
|
+
}
|
|
272
|
+
function joinLogLines(lines) {
|
|
273
|
+
return lines.map((line) => line.text).join("\n");
|
|
274
|
+
}
|
|
275
|
+
function clampLogCount(items, maxLines) {
|
|
276
|
+
if (maxLines == null || maxLines <= 0 || items.length <= maxLines) return items;
|
|
277
|
+
return items.slice(items.length - maxLines);
|
|
278
|
+
}
|
|
279
|
+
function filterLogLines(lines, options) {
|
|
280
|
+
const levels = options?.levels?.filter((level) => isRsLogLevel(level)) ?? [];
|
|
281
|
+
const query = options?.search?.trim().toLowerCase() ?? "";
|
|
282
|
+
return lines.filter((line) => {
|
|
283
|
+
if (levels.length > 0 && !levels.includes(line.level)) return false;
|
|
284
|
+
if (!query) return true;
|
|
285
|
+
return line.text.toLowerCase().includes(query) || line.level.includes(query);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/** 按查询切开正文,供搜索高亮。大小写不敏感。 */
|
|
289
|
+
function splitLogHighlight(text, query) {
|
|
290
|
+
const needle = query.trim();
|
|
291
|
+
if (!needle) return [{
|
|
292
|
+
text,
|
|
293
|
+
hit: false
|
|
294
|
+
}];
|
|
295
|
+
const source = text.toLowerCase();
|
|
296
|
+
const target = needle.toLowerCase();
|
|
297
|
+
const parts = [];
|
|
298
|
+
let cursor = 0;
|
|
299
|
+
while (cursor < text.length) {
|
|
300
|
+
const index = source.indexOf(target, cursor);
|
|
301
|
+
if (index < 0) {
|
|
302
|
+
parts.push({
|
|
303
|
+
text: text.slice(cursor),
|
|
304
|
+
hit: false
|
|
305
|
+
});
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
if (index > cursor) parts.push({
|
|
309
|
+
text: text.slice(cursor, index),
|
|
310
|
+
hit: false
|
|
311
|
+
});
|
|
312
|
+
parts.push({
|
|
313
|
+
text: text.slice(index, index + needle.length),
|
|
314
|
+
hit: true
|
|
315
|
+
});
|
|
316
|
+
cursor = index + needle.length;
|
|
317
|
+
}
|
|
318
|
+
return parts.length > 0 ? parts : [{
|
|
319
|
+
text,
|
|
320
|
+
hit: false
|
|
321
|
+
}];
|
|
322
|
+
}
|
|
323
|
+
function resolveLogLive(live) {
|
|
324
|
+
if (live === true) return "polite";
|
|
325
|
+
if (live === false || live == null || live === "off") return "off";
|
|
326
|
+
return live;
|
|
327
|
+
}
|
|
328
|
+
function countDroppedLines(total, maxLines) {
|
|
329
|
+
if (maxLines == null || maxLines <= 0 || total <= maxLines) return 0;
|
|
330
|
+
return total - maxLines;
|
|
331
|
+
}
|
|
332
|
+
/** 复制优先级:选区 > 全文 > 当前行 > 可见行(含搜索过滤结果)。 */
|
|
333
|
+
function resolveLogCopyText(options) {
|
|
334
|
+
const selection = options.selection?.trim();
|
|
335
|
+
if (selection) return {
|
|
336
|
+
text: selection,
|
|
337
|
+
source: "selection"
|
|
338
|
+
};
|
|
339
|
+
if (options.allTexts && options.allTexts.length > 0) return {
|
|
340
|
+
text: options.allTexts.join("\n"),
|
|
341
|
+
source: "all"
|
|
342
|
+
};
|
|
343
|
+
const active = options.activeText?.trim();
|
|
344
|
+
if (active) return {
|
|
345
|
+
text: active,
|
|
346
|
+
source: "line"
|
|
347
|
+
};
|
|
348
|
+
return {
|
|
349
|
+
text: options.visibleTexts.join("\n"),
|
|
350
|
+
source: "visible"
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
//#endregion
|
|
354
|
+
export { RS_LOG_FILTER_LEVELS, RS_LOG_LEVELS, asLogLineInputs, clampLogCount, countDroppedLines, filterLogLines, formatLogTime, inferLogLevel, isRsLogLevel, joinLogLines, normalizeLogLines, otelSeverityOf, parseRsLogLevel, resolveLogCopyText, resolveLogLive, splitLogHighlight, splitLogText, syslogSeverityOf, toLogLineInput };
|
|
@@ -5,6 +5,8 @@ import type { RsContextMenuItem } from '../context-menu-utils';
|
|
|
5
5
|
import type { RsTableColumn, RsTableGroupBy, RsTableRowData, RsTableRowDropPosition, RsTableRowKey, RsTableSelectionType, RsTableSize, RsTableSortState, RsTableTreeConfig } from '../table-utils';
|
|
6
6
|
import type { RsTableRowDragTrigger, RsTableRowDropMode } from '../table-drag';
|
|
7
7
|
import type { RsTableCellEditFocusMode } from './table-edit-utils';
|
|
8
|
+
/** 单元格焦点视觉:fill 轮廓+内底;outline 仅轮廓;none 不画焦点块 */
|
|
9
|
+
export type RsTableCellFocus = 'fill' | 'outline' | 'none';
|
|
8
10
|
import type { RsTableFeature } from './table-features';
|
|
9
11
|
import type { RsTableSummaryData, RsTableSummaryMode } from './table-summary-utils';
|
|
10
12
|
/** RsTable 组件 props */
|
|
@@ -94,6 +96,11 @@ export interface RsTableProps<T extends RsTableRowData = RsTableRowData> {
|
|
|
94
96
|
cellTooltip?: boolean;
|
|
95
97
|
cellTooltipDelay?: number;
|
|
96
98
|
headerTooltip?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* 焦点格视觉。只读展示表用 `outline` / `none`,避免自定义插槽再套一块内底。
|
|
101
|
+
* 键盘漫游仍维护 focusCell。
|
|
102
|
+
*/
|
|
103
|
+
cellFocus?: RsTableCellFocus;
|
|
97
104
|
editable?: boolean;
|
|
98
105
|
editTrigger?: 'click' | 'dblclick';
|
|
99
106
|
editGutter?: boolean;
|
|
@@ -292,6 +299,7 @@ export declare const RS_TABLE_PROP_DEFAULTS: {
|
|
|
292
299
|
cellTooltip: boolean;
|
|
293
300
|
cellTooltipDelay: number;
|
|
294
301
|
headerTooltip: boolean;
|
|
302
|
+
cellFocus: "fill";
|
|
295
303
|
editable: boolean;
|
|
296
304
|
editTrigger: "dblclick";
|
|
297
305
|
editGutter: boolean;
|
|
@@ -894,6 +894,13 @@
|
|
|
894
894
|
.rs-table__cell-body--focused {
|
|
895
895
|
background: color-mix(in srgb, var(--rs-primary) 6%, transparent);
|
|
896
896
|
}
|
|
897
|
+
.rs-table__table--cell-focus-outline .rs-table__cell-body--focused,
|
|
898
|
+
.rs-table__table--cell-focus-none .rs-table__cell-body--focused {
|
|
899
|
+
background: transparent;
|
|
900
|
+
}
|
|
901
|
+
.rs-table__table--cell-focus-none .rs-table__td--focused:not(.rs-table__td--editing) {
|
|
902
|
+
outline: none;
|
|
903
|
+
}
|
|
897
904
|
.rs-table-cell-editor {
|
|
898
905
|
display: block;
|
|
899
906
|
width: 100%;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { default as RsBreadcrumb } from './components/RsBreadcrumb.js';
|
|
|
5
5
|
export { default as RsToolbar } from './components/RsToolbar.js';
|
|
6
6
|
export { default as RsButton } from './components/RsButton.js';
|
|
7
7
|
export type { RsButtonTone, RsButtonVariant } from './components/button-utils';
|
|
8
|
-
export { isRsButtonFilledVariant, supportsRsButtonTone, } from './components/button-utils';
|
|
8
|
+
export { isRsButtonFilledVariant, resolveRsButtonTone, resolveRsButtonVariant, supportsRsButtonTone, } from './components/button-utils';
|
|
9
9
|
export { default as RsCheckbox } from './components/RsCheckbox.js';
|
|
10
10
|
export { default as RsSwitch } from './components/RsSwitch.js';
|
|
11
11
|
export type { RsSwitchValue } from './components/RsSwitch.js';
|
|
@@ -28,6 +28,8 @@ export { default as RsDropdown } from './components/RsDropdown.js';
|
|
|
28
28
|
export { default as RsIcon } from './components/RsIcon.js';
|
|
29
29
|
export { default as RsInput } from './components/RsInput.js';
|
|
30
30
|
export type { RsInputExpose, RsInputInstance } from './components/RsInput.js';
|
|
31
|
+
export { default as RsTextarea } from './components/RsTextarea.js';
|
|
32
|
+
export type { RsTextareaAutosize, RsTextareaExpose, RsTextareaInstance, RsTextareaResize, } from './components/RsTextarea.js';
|
|
31
33
|
export { default as RsInputNumber } from './components/RsInputNumber.js';
|
|
32
34
|
export type { RsInputNumberValue } from './components/input-number-utils';
|
|
33
35
|
export { clampNumber, formatNumberValue, fromModelValue, isNumberInputInterim, normalizeCommittedNumber, parseNumberInput, resolveNumberPrecision, roundToPrecision, stepNumberValue, toModelValue, } from './components/input-number-utils';
|
|
@@ -62,6 +64,8 @@ export { clampRsDrawerSize, resolveDrawerOverlayStyle, resolveRsDrawerDimensionC
|
|
|
62
64
|
export { default as RsForm } from './components/RsForm.js';
|
|
63
65
|
export { default as RsFormItem } from './components/RsFormItem.js';
|
|
64
66
|
export { default as RsFormList } from './components/RsFormList.js';
|
|
67
|
+
export { default as RsFieldset } from './components/RsFieldset.js';
|
|
68
|
+
export type { RsFieldsetBorderStyle, RsFieldsetBorderTone, RsFieldsetSize, RsFieldsetTitleSize, RsFieldsetTitleTone, } from './components/fieldset-utils';
|
|
65
69
|
export { default as RsToaster } from './components/RsToaster.js';
|
|
66
70
|
export { default as RsDatePicker } from './components/RsDatePicker.js';
|
|
67
71
|
export { default as RsDateTimePicker } from './components/RsDateTimePicker.js';
|
|
@@ -93,6 +97,10 @@ export type { RsMarkdownMode, RsMarkdownRenderOptions } from './components/markd
|
|
|
93
97
|
export { escapeHtml, isSafeHref, isSafeImageSrc, renderMarkdown, renderMarkdownInline, resolveMarkdownHeight, resolveMarkdownMode, } from './components/markdown-utils';
|
|
94
98
|
export { default as RsProseEditor } from './components/RsProseEditor.js';
|
|
95
99
|
export { default as RsTerminal } from './components/RsTerminal.js';
|
|
100
|
+
export { default as RsLog } from './components/RsLog.js';
|
|
101
|
+
export type { RsLogExpose, RsLogLive } from './components/RsLog.js';
|
|
102
|
+
export type { InferLogLevelOptions, RsLogCopySource, RsLogHighlightPart, RsLogInferMarkers, RsLogLevel, RsLogLine, RsLogLineInput, RsLogMarker, RsLogSeverityScale, RsNormalizedLogLine, } from './components/log-utils';
|
|
103
|
+
export { RS_LOG_FILTER_LEVELS, RS_LOG_LEVELS, asLogLineInputs, clampLogCount, countDroppedLines, filterLogLines, formatLogTime, inferLogLevel, isRsLogLevel, joinLogLines, normalizeLogLines, otelSeverityOf, parseRsLogLevel, resolveLogCopyText, resolveLogLive, splitLogHighlight, splitLogText, syslogSeverityOf, toLogLineInput, } from './components/log-utils';
|
|
96
104
|
export { beginClipboardPrefetch, copyTextToClipboard, copyTextWithExecCommand, prefetchClipboardText, readClipboardText, writeClipboardText, } from './utils/rs-clipboard';
|
|
97
105
|
export { resolveCodeMirrorLanguage, isCodeMirrorLightTheme, prewarmCodeMirrorEditor } from './components/code-mirror-lang';
|
|
98
106
|
export { buildAnsiColorDemo, containsEscapeSequence, getTerminalThemePalette, mergeTerminalTheme, readTerminalThemeFromCss, resolveTerminalTheme, terminalShortcutLabel, } from './components/terminal-utils';
|
|
@@ -160,7 +168,7 @@ export { createRsTableEditEmitBridge } from './composables/createRsTableEditEmit
|
|
|
160
168
|
export { assembleRsTableApi } from './composables/assembleRsTableApi';
|
|
161
169
|
export { bindRsTableViewContext } from './composables/bindRsTableViewContext';
|
|
162
170
|
export { RS_TABLE_API_REQUIRED_METHODS, RS_TABLE_API_OPTIONAL_METHODS, RS_TABLE_STABLE_EMITS, RS_TABLE_COMPAT_API_VERSION, } from './components/table/rs-table-compat-matrix';
|
|
163
|
-
export type { RsTableProps, RsTableEmits, RsTableColumnSlotProps, RsTableEditSlotProps, RsTableHeaderSlotProps, RsTableExpandSlotProps, RsTableGroupSlotProps, RsTableSlots, RsTableSlotPropsOf, } from './components/table/rs-table-props';
|
|
171
|
+
export type { RsTableProps, RsTableEmits, RsTableCellFocus, RsTableColumnSlotProps, RsTableEditSlotProps, RsTableHeaderSlotProps, RsTableExpandSlotProps, RsTableGroupSlotProps, RsTableSlots, RsTableSlotPropsOf, } from './components/table/rs-table-props';
|
|
164
172
|
export { RS_TABLE_PROP_DEFAULTS } from './components/table/rs-table-props';
|
|
165
173
|
export { useRsTableGridKeyboard } from './composables/useRsTableGridKeyboard';
|
|
166
174
|
export { navigateGridCell, resolveGridNavDirection, type RsTableGridNavDirection, type RsTableGridCellRef, } from './components/table/rs-table-grid-nav';
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,8 @@ export { RS_FONT_WEIGHT_CSS } from './theme/types.js'
|
|
|
25
25
|
export { RS_FORM_INJECTION_KEY } from './components/form-utils.js'
|
|
26
26
|
export { RS_FORM_ITEM_INJECTION_KEY } from './components/form-utils.js'
|
|
27
27
|
export { RS_FORM_LIST_INJECTION_KEY } from './components/form-utils.js'
|
|
28
|
+
export { RS_LOG_FILTER_LEVELS } from './components/log-utils.js'
|
|
29
|
+
export { RS_LOG_LEVELS } from './components/log-utils.js'
|
|
28
30
|
export { RS_MONACO_DEBUG } from './monaco/debug-decorations2.js'
|
|
29
31
|
export { RS_RADII } from './theme/types.js'
|
|
30
32
|
export { RS_RADIUS_CSS } from './theme/types.js'
|
|
@@ -72,6 +74,7 @@ export { default as RsDrawer } from './components/RsDrawer.js'
|
|
|
72
74
|
export { default as RsDropdown } from './components/RsDropdown.js'
|
|
73
75
|
export { default as RsDynamicTags } from './components/RsDynamicTags.js'
|
|
74
76
|
export { default as RsEmpty } from './components/RsEmpty.js'
|
|
77
|
+
export { default as RsFieldset } from './components/RsFieldset.js'
|
|
75
78
|
export { default as RsForm } from './components/RsForm.js'
|
|
76
79
|
export { default as RsFormItem } from './components/RsFormItem.js'
|
|
77
80
|
export { default as RsFormList } from './components/RsFormList.js'
|
|
@@ -82,6 +85,7 @@ export { default as RsLabel } from './components/RsLabel.js'
|
|
|
82
85
|
export { default as RsLink } from './components/RsLink.js'
|
|
83
86
|
export { default as RsLoading } from './components/RsLoading.js'
|
|
84
87
|
export { default as RsLoadingBar } from './components/RsLoadingBar.js'
|
|
88
|
+
export { default as RsLog } from './components/RsLog.js'
|
|
85
89
|
export { default as RsMarkdown } from './components/RsMarkdown.js'
|
|
86
90
|
export { default as RsMentions } from './components/RsMentions.js'
|
|
87
91
|
export { default as RsMenu } from './components/RsMenu.js'
|
|
@@ -110,6 +114,7 @@ export { default as RsTableSummaryRow } from './components/table/RsTableSummaryR
|
|
|
110
114
|
export { default as RsTabs } from './components/RsTabs.js'
|
|
111
115
|
export { default as RsTag } from './components/RsTag.js'
|
|
112
116
|
export { default as RsTerminal } from './components/RsTerminal.js'
|
|
117
|
+
export { default as RsTextarea } from './components/RsTextarea.js'
|
|
113
118
|
export { default as RsTimePicker } from './components/RsTimePicker.js'
|
|
114
119
|
export { default as RsTimePickerColumns } from './components/RsTimePickerColumns.js'
|
|
115
120
|
export { default as RsToaster } from './components/RsToaster.js'
|
|
@@ -126,6 +131,7 @@ export { aggregateColumnSummary } from './components/table/table-summary-utils.j
|
|
|
126
131
|
export { applyMonacoDebugDecorations } from './monaco/debug-decorations2.js'
|
|
127
132
|
export { applySplitResize } from './components/split-pane-utils.js'
|
|
128
133
|
export { applyTheme } from './theme/apply.js'
|
|
134
|
+
export { asLogLineInputs } from './components/log-utils.js'
|
|
129
135
|
export { assembleRsTableApi } from './composables/assembleRsTableApi.js'
|
|
130
136
|
export { beginClipboardPrefetch } from './utils/rs-clipboard.js'
|
|
131
137
|
export { bindRsTableViewContext } from './composables/bindRsTableViewContext.js'
|
|
@@ -141,6 +147,7 @@ export { buildTableTreeEntries } from './components/table-utils.js'
|
|
|
141
147
|
export { buildTableTreeNodeIndex } from './components/table-utils.js'
|
|
142
148
|
export { buildTreeNodeIndex } from './components/tree-utils.js'
|
|
143
149
|
export { clampColumnWidth } from './components/table-utils.js'
|
|
150
|
+
export { clampLogCount } from './components/log-utils.js'
|
|
144
151
|
export { clampNumber } from './components/input-number-utils.js'
|
|
145
152
|
export { clampPage } from './components/pagination-utils.js'
|
|
146
153
|
export { clampRsDrawerSize } from './components/drawer-utils.js'
|
|
@@ -158,6 +165,7 @@ export { concatNamePath } from './components/form-path.js'
|
|
|
158
165
|
export { containsEscapeSequence } from './components/terminal-utils.js'
|
|
159
166
|
export { copyTextToClipboard } from './utils/rs-clipboard.js'
|
|
160
167
|
export { copyTextWithExecCommand } from './utils/rs-clipboard.js'
|
|
168
|
+
export { countDroppedLines } from './components/log-utils.js'
|
|
161
169
|
export { createAnalyticsTableFeature } from './components/table/table-features.js'
|
|
162
170
|
export { createBuiltinTableFeatures } from './components/table/table-features.js'
|
|
163
171
|
export { createChartSeriesTableFeature } from './components/table/table-features.js'
|
|
@@ -178,6 +186,7 @@ export { downloadUploadFile } from './components/upload-utils.js'
|
|
|
178
186
|
export { ensureMongodbShellLanguage } from './monaco/languages/mongodb-shell.js'
|
|
179
187
|
export { escapeHtml } from './components/markdown-utils.js'
|
|
180
188
|
export { expandSplitPane } from './components/split-pane-utils.js'
|
|
189
|
+
export { filterLogLines } from './components/log-utils.js'
|
|
181
190
|
export { filterTableRows } from './components/table-utils.js'
|
|
182
191
|
export { filterTableTreeRows } from './components/table-utils.js'
|
|
183
192
|
export { filterTreeNodes } from './components/tree-utils.js'
|
|
@@ -194,6 +203,7 @@ export { formatDateTimeValue } from './components/date-picker-utils.js'
|
|
|
194
203
|
export { formatDateValue } from './components/date-picker-utils.js'
|
|
195
204
|
export { formatFileSize } from './components/upload-utils.js'
|
|
196
205
|
export { formatIsoUtcToLocal } from './lib/iso-local-datetime.js'
|
|
206
|
+
export { formatLogTime } from './components/log-utils.js'
|
|
197
207
|
export { formatNumberValue } from './components/input-number-utils.js'
|
|
198
208
|
export { formatTimeFromParts } from './components/time-picker-utils.js'
|
|
199
209
|
export { formatTimeParts } from './components/time-picker-utils.js'
|
|
@@ -225,6 +235,7 @@ export { hasStableTableTreeRowKey } from './components/table-utils.js'
|
|
|
225
235
|
export { hasTableSummaryConfig } from './components/table/table-summary-utils.js'
|
|
226
236
|
export { hasTableTreeChildren } from './components/table-utils.js'
|
|
227
237
|
export { hasTreeChildren } from './components/tree-utils.js'
|
|
238
|
+
export { inferLogLevel } from './components/log-utils.js'
|
|
228
239
|
export { injectExpandRows } from './components/table-utils.js'
|
|
229
240
|
export { inputRuleMessageKeys } from './components/input-rules.js'
|
|
230
241
|
export { isCodeMirrorLightTheme } from './components/code-mirror-lang.js'
|
|
@@ -240,6 +251,7 @@ export { isRsButtonFilledVariant } from './components/button-utils.js'
|
|
|
240
251
|
export { isRsDialogWidthPreset } from './components/dialog-utils.js'
|
|
241
252
|
export { isRsFormItemBoundControl } from './components/form-utils.js'
|
|
242
253
|
export { isRsIconName } from './icons/lucide.js'
|
|
254
|
+
export { isRsLogLevel } from './components/log-utils.js'
|
|
243
255
|
export { isRsSplitPaneAutoSize } from './components/split-pane-utils.js'
|
|
244
256
|
export { isRsTableApi } from './components/table/rs-table-api.js'
|
|
245
257
|
export { isSafeHref } from './components/markdown-utils.js'
|
|
@@ -255,6 +267,7 @@ export { isTimeRangeEmpty } from './components/time-picker-utils.js'
|
|
|
255
267
|
export { isTimeRangeOrdered } from './components/time-picker-utils.js'
|
|
256
268
|
export { isTimeWithinBounds } from './components/time-picker-utils.js'
|
|
257
269
|
export { isTreeAncestorKey } from './components/tree-utils.js'
|
|
270
|
+
export { joinLogLines } from './components/log-utils.js'
|
|
258
271
|
export { listBatchColumnTargets } from './components/table/table-edit-utils.js'
|
|
259
272
|
export { listEditableCells } from './components/table/table-edit-utils.js'
|
|
260
273
|
export { looksLikeIsoDateTimeWithTz } from './lib/iso-local-datetime.js'
|
|
@@ -269,12 +282,14 @@ export { navigateEditableCell } from './components/table/table-edit-utils.js'
|
|
|
269
282
|
export { navigateGridCell } from './components/table/rs-table-grid-nav.js'
|
|
270
283
|
export { normalizeCommittedNumber } from './components/input-number-utils.js'
|
|
271
284
|
export { normalizeFormRules } from './components/form-rules.js'
|
|
285
|
+
export { normalizeLogLines } from './components/log-utils.js'
|
|
272
286
|
export { normalizeNamePath } from './components/form-path.js'
|
|
273
287
|
export { normalizeSelectOptions } from './components/select-utils.js'
|
|
274
288
|
export { normalizeSplitSizes } from './components/split-pane-utils.js'
|
|
275
289
|
export { nullToEditText } from './components/table/table-edit-utils.js'
|
|
276
290
|
export { openRsDialog } from './composables/createRsDialog.js'
|
|
277
291
|
export { optionDisplayLabel } from './components/select-utils.js'
|
|
292
|
+
export { otelSeverityOf } from './components/log-utils.js'
|
|
278
293
|
export { packSelectModel } from './components/select-utils.js'
|
|
279
294
|
export { parseClipboardGrid } from './components/table/table-edit-utils.js'
|
|
280
295
|
export { parseColumnWidth } from './components/table-utils.js'
|
|
@@ -283,6 +298,7 @@ export { parseDateTimeValue } from './components/date-picker-utils.js'
|
|
|
283
298
|
export { parseDateValue } from './components/date-picker-utils.js'
|
|
284
299
|
export { parseLocalDateTimeToUtcIso } from './lib/iso-local-datetime.js'
|
|
285
300
|
export { parseNumberInput } from './components/input-number-utils.js'
|
|
301
|
+
export { parseRsLogLevel } from './components/log-utils.js'
|
|
286
302
|
export { parseTimeValue } from './components/time-picker-utils.js'
|
|
287
303
|
export { placeAnchoredPopup } from './components/overlay-utils.js'
|
|
288
304
|
export { prefetchClipboardText } from './utils/rs-clipboard.js'
|
|
@@ -323,11 +339,15 @@ export { resolveFixedColumnStyles } from './components/table-utils.js'
|
|
|
323
339
|
export { resolveGridNavDirection } from './components/table/rs-table-grid-nav.js'
|
|
324
340
|
export { resolveInstanceFeatures } from './components/table/rs-table-module-registry.js'
|
|
325
341
|
export { resolveItemSize } from './components/virtual-list-utils.js'
|
|
342
|
+
export { resolveLogCopyText } from './components/log-utils.js'
|
|
343
|
+
export { resolveLogLive } from './components/log-utils.js'
|
|
326
344
|
export { resolveMarkdownHeight } from './components/markdown-utils.js'
|
|
327
345
|
export { resolveMarkdownMode } from './components/markdown-utils.js'
|
|
328
346
|
export { resolveNumberPrecision } from './components/input-number-utils.js'
|
|
329
347
|
export { resolveOrderedColumns } from './components/table-utils.js'
|
|
330
348
|
export { resolveRowKey } from './components/table-utils.js'
|
|
349
|
+
export { resolveRsButtonTone } from './components/button-utils.js'
|
|
350
|
+
export { resolveRsButtonVariant } from './components/button-utils.js'
|
|
331
351
|
export { resolveRsComponentSize } from './components/resolve-size.js'
|
|
332
352
|
export { resolveRsDialogCssWidth } from './components/dialog-utils.js'
|
|
333
353
|
export { resolveRsDialogWidthPx } from './components/dialog-utils.js'
|
|
@@ -381,15 +401,19 @@ export { sliceVirtualTreeNodes } from './components/tree-utils.js'
|
|
|
381
401
|
export { sortTableRows } from './components/table-utils.js'
|
|
382
402
|
export { sortTableRowsMulti } from './components/table-utils.js'
|
|
383
403
|
export { sortTableTreeRows } from './components/table-utils.js'
|
|
404
|
+
export { splitLogHighlight } from './components/log-utils.js'
|
|
405
|
+
export { splitLogText } from './components/log-utils.js'
|
|
384
406
|
export { splitSizesEqual } from './components/split-pane-utils.js'
|
|
385
407
|
export { splitTreeLabelHighlight } from './components/tree-utils.js'
|
|
386
408
|
export { stepEnabledIndex } from './components/overlay-utils.js'
|
|
387
409
|
export { stepNumberValue } from './components/input-number-utils.js'
|
|
388
410
|
export { supportsRsButtonTone } from './components/button-utils.js'
|
|
411
|
+
export { syslogSeverityOf } from './components/log-utils.js'
|
|
389
412
|
export { terminalShortcutLabel } from './components/terminal-utils.js'
|
|
390
413
|
export { themePresets } from './theme/presets.js'
|
|
391
414
|
export { toComboboxValue } from './components/select-utils.js'
|
|
392
415
|
export { toInternalPickerValue } from './components/date-picker-utils.js'
|
|
416
|
+
export { toLogLineInput } from './components/log-utils.js'
|
|
393
417
|
export { toModelValue } from './components/input-number-utils.js'
|
|
394
418
|
export { toRangeEndpointString } from './components/date-picker-utils.js'
|
|
395
419
|
export { toggleExpandedRowKeys } from './components/table-utils.js'
|
package/dist/lib/rs-dayjs.js
CHANGED