niuma-ui 1.2.9 → 1.3.1

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/RsButton.css +119 -61
  3. package/dist/components/RsButton.d.ts +3 -3
  4. package/dist/components/RsButton.impl.js +4 -12
  5. package/dist/components/RsButton.js +1 -1
  6. package/dist/components/RsDialog.css +1 -0
  7. package/dist/components/RsDialog.d.ts +5 -0
  8. package/dist/components/RsDialog.impl.js +4 -0
  9. package/dist/components/RsDrawer.css +1 -0
  10. package/dist/components/RsFieldset.css +92 -0
  11. package/dist/components/RsFieldset.d.ts +61 -0
  12. package/dist/components/RsFieldset.impl.js +78 -0
  13. package/dist/components/RsFieldset.js +8 -0
  14. package/dist/components/RsFormItem.css +19 -19
  15. package/dist/components/RsFormItem.d.ts +6 -4
  16. package/dist/components/RsFormItem.impl.js +12 -2
  17. package/dist/components/RsFormItem.js +1 -1
  18. package/dist/components/RsInput.css +78 -69
  19. package/dist/components/RsInput.js +1 -1
  20. package/dist/components/RsLog.css +198 -0
  21. package/dist/components/RsLog.d.ts +126 -0
  22. package/dist/components/RsLog.impl.js +619 -0
  23. package/dist/components/RsLog.js +8 -0
  24. package/dist/components/RsTable.impl.js +2 -1
  25. package/dist/components/RsTerminal.css +59 -18
  26. package/dist/components/RsTerminal.d.ts +17 -1
  27. package/dist/components/RsTerminal.impl.js +115 -8
  28. package/dist/components/RsTerminal.js +1 -1
  29. package/dist/components/RsTextarea.css +126 -0
  30. package/dist/components/RsTextarea.d.ts +114 -0
  31. package/dist/components/RsTextarea.impl.js +385 -0
  32. package/dist/components/RsTextarea.js +8 -0
  33. package/dist/components/RsTooltip.css +4 -3
  34. package/dist/components/RsTooltip.d.ts +2 -0
  35. package/dist/components/RsTooltip.impl.js +5 -2
  36. package/dist/components/RsVirtualList.css +6 -6
  37. package/dist/components/RsVirtualList.d.ts +1 -1
  38. package/dist/components/RsVirtualList.impl.js +9 -4
  39. package/dist/components/RsVirtualList.js +1 -1
  40. package/dist/components/button-utils.d.ts +19 -10
  41. package/dist/components/button-utils.js +22 -7
  42. package/dist/components/dialog-window.d.ts +2 -0
  43. package/dist/components/dialog-window.js +2 -1
  44. package/dist/components/fieldset-utils.d.ts +29 -0
  45. package/dist/components/fieldset-utils.js +12 -0
  46. package/dist/components/log-utils.d.ts +105 -0
  47. package/dist/components/log-utils.js +354 -0
  48. package/dist/components/table/rs-table-props.d.ts +8 -0
  49. package/dist/components/table/rs-table-props.js +1 -0
  50. package/dist/components/table/rs-table.css +7 -0
  51. package/dist/components/terminal-utils.d.ts +1 -1
  52. package/dist/dev/vite-xterm-deps.d.ts +1 -0
  53. package/dist/dev/vite-xterm-deps.js +1 -0
  54. package/dist/index.d.ts +10 -2
  55. package/dist/index.js +24 -0
  56. package/dist/locale/messages.js +52 -0
  57. package/dist/styles.css +37 -0
  58. package/package.json +2 -1
@@ -0,0 +1,105 @@
1
+ /** 展示与过滤用的级别。success 是 UI 结果,不是 RFC 严重级别。 */
2
+ export type RsLogLevel = 'trace' | 'debug' | 'info' | 'notice' | 'success' | 'warn' | 'error' | 'fatal' | 'plain';
3
+ /** 数字严重级别的标尺。auto:0–7 当 syslog,更大当 OTel。 */
4
+ export type RsLogSeverityScale = 'syslog' | 'otel' | 'auto';
5
+ /** 调用方补充的成功 / 失败等标识。字符串按拉丁词边界匹配(中日韩按子串),也可传 RegExp。 */
6
+ export type RsLogMarker = string | RegExp;
7
+ /** 未写 level 时,在内置扫描之后用这些标识给正文上色。默认不启用。 */
8
+ export type RsLogInferMarkers = {
9
+ [K in Exclude<RsLogLevel, 'plain'>]?: readonly RsLogMarker[];
10
+ };
11
+ export type InferLogLevelOptions = {
12
+ markers?: RsLogInferMarkers;
13
+ };
14
+ /** 一条结构化日志。level 缺省时可由 infer / severity 得出。 */
15
+ export type RsLogLine = {
16
+ id?: string | number;
17
+ text: string;
18
+ /** 规范级别或别名(warning / critical…),由 parseRsLogLevel 收口 */
19
+ level?: string;
20
+ /** RFC 5424 0–7 或 OTel 1–24;未写 level 时参与解析 */
21
+ severity?: number;
22
+ time?: string | number | Date;
23
+ };
24
+ export type RsLogLineInput = string | RsLogLine;
25
+ /** 渲染用的归一化行。key 稳定,供虚拟列表复用。 */
26
+ export type RsNormalizedLogLine = {
27
+ key: string;
28
+ text: string;
29
+ level: RsLogLevel;
30
+ time?: string;
31
+ /** 裁剪后的 1-based 序号 */
32
+ seq: number;
33
+ /** RFC 5424 Severity,plain 为 null */
34
+ syslog: number | null;
35
+ /** OpenTelemetry severity number,plain 为 null */
36
+ otel: number | null;
37
+ };
38
+ export declare const RS_LOG_LEVELS: readonly RsLogLevel[];
39
+ /** 可过滤的级别(不含 plain)。 */
40
+ export declare const RS_LOG_FILTER_LEVELS: readonly RsLogLevel[];
41
+ export declare function isRsLogLevel(value: unknown): value is RsLogLevel;
42
+ /** RFC 5424 Severity(0–7)。plain 返回 null。 */
43
+ export declare function syslogSeverityOf(level: RsLogLevel): number | null;
44
+ /** OpenTelemetry severity number。plain 返回 null。 */
45
+ export declare function otelSeverityOf(level: RsLogLevel): number | null;
46
+ /**
47
+ * 把别名、syslog 0–7、OTel 1–24 收成规范级别。
48
+ * 无法识别时返回 undefined,由调用方决定是否再推断。
49
+ */
50
+ export declare function parseRsLogLevel(value: unknown, scale?: RsLogSeverityScale): RsLogLevel | undefined;
51
+ /** 把任意输入收成日志行数组:字符串按行拆,对象原样保留。 */
52
+ export declare function asLogLineInputs(input: string | RsLogLineInput | RsLogLineInput[]): RsLogLineInput[];
53
+ /** 拆成行。统一 CRLF;去掉末尾空行,避免 textarea 尾巴多一行。 */
54
+ export declare function splitLogText(text: string): string[];
55
+ /**
56
+ * 从一行正文推断语义色。
57
+ * 1. [error] / [ok] 等方括号级别(别名走 parseRsLogLevel)
58
+ * 2. 行首级别词,如 ERROR: / WARN
59
+ * 3. 工具链行首:BUILD SUCCESS / BUILD FAILURE / Exception in thread / panic:
60
+ * 4. 调用方 markers:成功 / 失败等产品标识(默认不扫)
61
+ * 行上已有 level / severity 时不会走到这里。
62
+ */
63
+ export declare function inferLogLevel(text: string, options?: InferLogLevelOptions): RsLogLevel;
64
+ /** 能解析的瞬间走 Intl;已是展示串则原样保留。 */
65
+ export declare function formatLogTime(value: string | number | Date | undefined, locale?: string, options?: Intl.DateTimeFormatOptions): string | undefined;
66
+ export type NormalizeLogLinesOptions = {
67
+ inferLevel?: boolean;
68
+ /** 传给 inferLogLevel 的成功 / 失败等标识。inferLevel 为 false 时不使用。 */
69
+ inferMarkers?: RsLogInferMarkers;
70
+ maxLines?: number;
71
+ severityScale?: RsLogSeverityScale;
72
+ locale?: string;
73
+ timeFormat?: Intl.DateTimeFormatOptions;
74
+ };
75
+ /** 把 string / 行对象收成渲染结构。inferLevel 默认开。 */
76
+ export declare function normalizeLogLines(source: string | RsLogLineInput[] | undefined | null, options?: NormalizeLogLinesOptions): RsNormalizedLogLine[];
77
+ /** 把一行收成可写回 v-model 的结构(字符串保持字符串)。 */
78
+ export declare function toLogLineInput(input: RsLogLineInput): RsLogLineInput;
79
+ export declare function joinLogLines(lines: Array<{
80
+ text: string;
81
+ }>): string;
82
+ export declare function clampLogCount<T>(items: T[], maxLines?: number): T[];
83
+ export declare function filterLogLines(lines: RsNormalizedLogLine[], options?: {
84
+ levels?: readonly RsLogLevel[];
85
+ search?: string;
86
+ }): RsNormalizedLogLine[];
87
+ export type RsLogHighlightPart = {
88
+ text: string;
89
+ hit: boolean;
90
+ };
91
+ /** 按查询切开正文,供搜索高亮。大小写不敏感。 */
92
+ export declare function splitLogHighlight(text: string, query: string): RsLogHighlightPart[];
93
+ export declare function resolveLogLive(live?: boolean | 'off' | 'polite' | 'assertive'): 'off' | 'polite' | 'assertive';
94
+ export declare function countDroppedLines(total: number, maxLines?: number): number;
95
+ export type RsLogCopySource = 'selection' | 'line' | 'visible' | 'all';
96
+ /** 复制优先级:选区 > 全文 > 当前行 > 可见行(含搜索过滤结果)。 */
97
+ export declare function resolveLogCopyText(options: {
98
+ selection?: string;
99
+ activeText?: string;
100
+ visibleTexts: string[];
101
+ allTexts?: string[];
102
+ }): {
103
+ text: string;
104
+ source: RsLogCopySource;
105
+ };
@@ -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;
@@ -40,6 +40,7 @@ var RS_TABLE_PROP_DEFAULTS = {
40
40
  cellTooltip: true,
41
41
  cellTooltipDelay: 300,
42
42
  headerTooltip: true,
43
+ cellFocus: "fill",
43
44
  editable: false,
44
45
  editTrigger: "dblclick",
45
46
  editGutter: true,
@@ -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%;
@@ -1,7 +1,7 @@
1
1
  import type { ITheme, Terminal } from '@xterm/xterm';
2
2
  export type RsTerminalThemeMode = 'auto' | 'light' | 'dark';
3
3
  export type RsResolvedTerminalTheme = 'light' | 'dark';
4
- export type RsTerminalAction = 'copy' | 'paste' | 'selectAll' | 'clear' | 'askAi';
4
+ export type RsTerminalAction = 'copy' | 'paste' | 'selectAll' | 'clear' | 'askAi' | 'search';
5
5
  export type RsTerminalGeometry = {
6
6
  cols: number;
7
7
  rows: number;
@@ -4,5 +4,6 @@
4
4
  * CSS 一并扫描,防止 JS 预构建后样式副作用丢失。
5
5
  */
6
6
  import '@xterm/addon-fit';
7
+ import '@xterm/addon-search';
7
8
  import '@xterm/xterm';
8
9
  import '@xterm/xterm/css/xterm.css';
@@ -1,3 +1,4 @@
1
1
  import "@xterm/addon-fit";
2
+ import "@xterm/addon-search";
2
3
  import "@xterm/xterm";
3
4
  import "@xterm/xterm/css/xterm.css";
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';