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.
Files changed (54) hide show
  1. package/CHANGELOG.md +25 -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/RsTextarea.css +126 -0
  26. package/dist/components/RsTextarea.d.ts +114 -0
  27. package/dist/components/RsTextarea.impl.js +385 -0
  28. package/dist/components/RsTextarea.js +8 -0
  29. package/dist/components/RsTooltip.css +4 -3
  30. package/dist/components/RsTooltip.d.ts +2 -0
  31. package/dist/components/RsTooltip.impl.js +5 -2
  32. package/dist/components/RsVirtualList.css +6 -6
  33. package/dist/components/RsVirtualList.d.ts +1 -1
  34. package/dist/components/RsVirtualList.impl.js +9 -4
  35. package/dist/components/RsVirtualList.js +1 -1
  36. package/dist/components/button-utils.d.ts +19 -10
  37. package/dist/components/button-utils.js +22 -7
  38. package/dist/components/dialog-window.d.ts +2 -0
  39. package/dist/components/dialog-window.js +2 -1
  40. package/dist/components/fieldset-utils.d.ts +29 -0
  41. package/dist/components/fieldset-utils.js +12 -0
  42. package/dist/components/log-utils.d.ts +105 -0
  43. package/dist/components/log-utils.js +354 -0
  44. package/dist/components/table/rs-table-props.d.ts +8 -0
  45. package/dist/components/table/rs-table-props.js +1 -0
  46. package/dist/components/table/rs-table.css +7 -0
  47. package/dist/index.d.ts +10 -2
  48. package/dist/index.js +24 -0
  49. package/dist/lib/rs-dayjs.js +1 -1
  50. package/dist/locale/messages.js +42 -0
  51. package/dist/styles.css +37 -0
  52. package/dist/vite-plugins/niuma-ui-host.d.ts +8 -0
  53. package/dist/vite-plugins/niuma-ui-host.js +47 -9
  54. package/package.json +1 -1
@@ -0,0 +1,619 @@
1
+ import { useRsI18n } from "../composables/useRsI18n.js";
2
+ import { rsRadiusCss, useResolvedRsRadius } from "./resolve-radius.js";
3
+ import RsButton_default from "./RsButton.js";
4
+ import RsInput_default from "./RsInput.js";
5
+ import RsEmpty_default from "./RsEmpty.js";
6
+ import { copyTextToClipboard } from "../utils/rs-clipboard.js";
7
+ import RsVirtualList_default from "./RsVirtualList.js";
8
+ import { RS_LOG_FILTER_LEVELS, asLogLineInputs, clampLogCount, countDroppedLines, filterLogLines, joinLogLines, normalizeLogLines, resolveLogCopyText, resolveLogLive, splitLogHighlight, splitLogText, toLogLineInput } from "./log-utils.js";
9
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, nextTick, normalizeClass, normalizeStyle, onUnmounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useModel, useSlots, watch, withCtx } from "vue";
10
+ //#region src/components/RsLog.vue?vue&type=script&setup=true&lang.ts
11
+ var _hoisted_1 = ["dir"];
12
+ var _hoisted_2 = {
13
+ key: 0,
14
+ class: "rs-log__chrome"
15
+ };
16
+ var _hoisted_3 = {
17
+ key: 1,
18
+ class: "rs-log__filters"
19
+ };
20
+ var _hoisted_4 = { class: "rs-log__sr-only" };
21
+ var _hoisted_5 = ["aria-pressed", "onClick"];
22
+ var _hoisted_6 = ["aria-live"];
23
+ var _hoisted_7 = ["aria-label", "aria-busy"];
24
+ var _hoisted_8 = [
25
+ "aria-label",
26
+ "data-log-index",
27
+ "onClick"
28
+ ];
29
+ var _hoisted_9 = {
30
+ key: 0,
31
+ class: "rs-log__no"
32
+ };
33
+ var _hoisted_10 = {
34
+ key: 1,
35
+ class: "rs-log__time"
36
+ };
37
+ var _hoisted_11 = {
38
+ key: 2,
39
+ class: "rs-log__level"
40
+ };
41
+ var _hoisted_12 = {
42
+ key: 3,
43
+ class: "rs-log__sr-only"
44
+ };
45
+ var _hoisted_13 = { class: "rs-log__text" };
46
+ var _hoisted_14 = {
47
+ key: 0,
48
+ class: "rs-log__hit"
49
+ };
50
+ var _hoisted_15 = [
51
+ "aria-label",
52
+ "data-log-index",
53
+ "onClick"
54
+ ];
55
+ var _hoisted_16 = {
56
+ key: 0,
57
+ class: "rs-log__no"
58
+ };
59
+ var _hoisted_17 = {
60
+ key: 1,
61
+ class: "rs-log__time"
62
+ };
63
+ var _hoisted_18 = {
64
+ key: 2,
65
+ class: "rs-log__level"
66
+ };
67
+ var _hoisted_19 = {
68
+ key: 3,
69
+ class: "rs-log__sr-only"
70
+ };
71
+ var _hoisted_20 = { class: "rs-log__text" };
72
+ var _hoisted_21 = {
73
+ key: 0,
74
+ class: "rs-log__hit"
75
+ };
76
+ var RsLog_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
77
+ __name: "RsLog",
78
+ props: /*@__PURE__*/ mergeModels({
79
+ text: {},
80
+ height: { default: 280 },
81
+ itemSize: { default: 0 },
82
+ overscan: { default: 8 },
83
+ follow: {
84
+ type: Boolean,
85
+ default: true
86
+ },
87
+ wrap: {
88
+ type: Boolean,
89
+ default: false
90
+ },
91
+ showTime: {
92
+ type: Boolean,
93
+ default: false
94
+ },
95
+ showLevel: {
96
+ type: Boolean,
97
+ default: true
98
+ },
99
+ inferLevel: {
100
+ type: Boolean,
101
+ default: true
102
+ },
103
+ inferMarkers: {},
104
+ maxLines: {},
105
+ zebra: {
106
+ type: Boolean,
107
+ default: true
108
+ },
109
+ emptyText: {},
110
+ radius: {},
111
+ ariaLabel: {},
112
+ live: {
113
+ type: [Boolean, String],
114
+ default: "off"
115
+ },
116
+ busy: {
117
+ type: Boolean,
118
+ default: false
119
+ },
120
+ showSearch: {
121
+ type: Boolean,
122
+ default: true
123
+ },
124
+ showCopy: {
125
+ type: Boolean,
126
+ default: true
127
+ },
128
+ showFilter: {
129
+ type: Boolean,
130
+ default: false
131
+ },
132
+ showLineNo: {
133
+ type: Boolean,
134
+ default: false
135
+ },
136
+ virtual: {
137
+ type: [Boolean, String],
138
+ default: "auto"
139
+ },
140
+ dir: { default: "ltr" },
141
+ severityScale: { default: "auto" },
142
+ timeFormat: {}
143
+ }, {
144
+ "lines": { default: "" },
145
+ "linesModifiers": {},
146
+ "search": { default: "" },
147
+ "searchModifiers": {},
148
+ "levels": { default: () => [] },
149
+ "levelsModifiers": {}
150
+ }),
151
+ emits: /*@__PURE__*/ mergeModels([
152
+ "followChange",
153
+ "overflow",
154
+ "copy"
155
+ ], [
156
+ "update:lines",
157
+ "update:search",
158
+ "update:levels"
159
+ ]),
160
+ setup(__props, { expose: __expose, emit: __emit }) {
161
+ const emit = __emit;
162
+ const { t, locale } = useRsI18n();
163
+ const slots = useSlots();
164
+ const lines = useModel(__props, "lines");
165
+ const search = useModel(__props, "search");
166
+ const filterLevels = useModel(__props, "levels");
167
+ const props = __props;
168
+ const rootRef = ref(null);
169
+ const searchRef = ref(null);
170
+ const viewportRef = ref(null);
171
+ const plainRef = ref(null);
172
+ const copied = ref(false);
173
+ let copiedTimer = 0;
174
+ const listRef = ref(null);
175
+ const stuckToBottom = ref(true);
176
+ const activeIndex = ref(-1);
177
+ const announcement = ref("");
178
+ const resolvedRadius = useResolvedRsRadius(() => props.radius, "sm");
179
+ const liveMode = computed(() => resolveLogLive(props.live));
180
+ const useVirtual = computed(() => {
181
+ if (props.virtual === "auto") return !props.wrap;
182
+ return props.virtual;
183
+ });
184
+ const resolvedItemSize = computed(() => {
185
+ if (props.itemSize > 0) return props.itemSize;
186
+ if (props.wrap) return 48;
187
+ return 24;
188
+ });
189
+ const source = computed(() => {
190
+ if (lines.value !== "" && lines.value != null) return lines.value;
191
+ return props.text ?? "";
192
+ });
193
+ const rawCount = computed(() => {
194
+ const src = source.value;
195
+ return typeof src === "string" ? splitLogText(src).length : src.length;
196
+ });
197
+ const resolvedLines = computed(() => normalizeLogLines(source.value, {
198
+ inferLevel: props.inferLevel,
199
+ inferMarkers: props.inferMarkers,
200
+ maxLines: props.maxLines,
201
+ severityScale: props.severityScale,
202
+ locale: locale.value,
203
+ timeFormat: props.timeFormat
204
+ }));
205
+ const displayLines = computed(() => filterLogLines(resolvedLines.value, {
206
+ levels: filterLevels.value,
207
+ search: search.value
208
+ }));
209
+ const emptyLabel = computed(() => props.emptyText || t("log.empty", "No log output"));
210
+ const regionLabel = computed(() => props.ariaLabel || t("log.label", "Log"));
211
+ const hasChrome = computed(() => props.showSearch || props.showCopy || props.showFilter || Boolean(slots.toolbar));
212
+ const copyTip = computed(() => {
213
+ if (copied.value) return t("log.copied", "Copied");
214
+ return t("log.copy", "Copy");
215
+ });
216
+ const rootStyle = computed(() => ({
217
+ "--rs-log-radius": rsRadiusCss(resolvedRadius.value),
218
+ "--rs-log-box-height": typeof props.height === "number" ? `${props.height}px` : props.height
219
+ }));
220
+ function levelLabel(level) {
221
+ return t(`log.level.${level}`, level);
222
+ }
223
+ function rowLabel(item) {
224
+ const parts = [levelLabel(item.level)];
225
+ if (props.showLineNo) parts.push(t("log.lineNo", "Line {n}", { n: item.seq }));
226
+ if (item.time) parts.push(item.time);
227
+ parts.push(item.text);
228
+ return parts.filter(Boolean).join(", ");
229
+ }
230
+ function highlightParts(text) {
231
+ return splitLogHighlight(text, search.value);
232
+ }
233
+ function writeLines(next) {
234
+ lines.value = typeof next === "string" ? next : clampLogCount(next, props.maxLines);
235
+ }
236
+ function append(input) {
237
+ const added = asLogLineInputs(input).map(toLogLineInput);
238
+ if (added.length === 0) return;
239
+ const current = lines.value;
240
+ if (typeof current === "string" || current == null) {
241
+ const chunk = added.map((item) => typeof item === "string" ? item : item.text).join("\n");
242
+ const base = typeof current === "string" ? current : "";
243
+ writeLines(joinLogLines(normalizeLogLines(base ? `${base}\n${chunk}` : chunk, {
244
+ inferLevel: false,
245
+ maxLines: props.maxLines
246
+ })));
247
+ return;
248
+ }
249
+ writeLines([...current, ...added]);
250
+ }
251
+ function clear() {
252
+ writeLines(typeof lines.value === "string" ? "" : []);
253
+ activeIndex.value = -1;
254
+ }
255
+ function scrollPlain(top) {
256
+ const el = plainRef.value;
257
+ if (!el) return;
258
+ el.scrollTop = top;
259
+ }
260
+ function scrollToBottom() {
261
+ setStuck(true);
262
+ const last = displayLines.value.length - 1;
263
+ if (last < 0) return;
264
+ activeIndex.value = last;
265
+ if (useVirtual.value) {
266
+ listRef.value?.scrollToIndex(last, "end");
267
+ return;
268
+ }
269
+ nextTick(() => {
270
+ const el = plainRef.value;
271
+ if (el) scrollPlain(el.scrollHeight);
272
+ });
273
+ }
274
+ function scrollToTop() {
275
+ setStuck(false);
276
+ activeIndex.value = displayLines.value.length > 0 ? 0 : -1;
277
+ if (useVirtual.value) {
278
+ listRef.value?.scrollToIndex(0, "start");
279
+ return;
280
+ }
281
+ scrollPlain(0);
282
+ }
283
+ function readDomSelection() {
284
+ const sel = typeof document === "undefined" ? null : document.getSelection();
285
+ if (!sel || sel.isCollapsed) return "";
286
+ const text = sel.toString();
287
+ if (!text.trim()) return "";
288
+ const root = rootRef.value;
289
+ const node = sel.anchorNode;
290
+ if (root && node && !root.contains(node)) return "";
291
+ return text;
292
+ }
293
+ function markCopied() {
294
+ copied.value = true;
295
+ if (copiedTimer) window.clearTimeout(copiedTimer);
296
+ copiedTimer = window.setTimeout(() => {
297
+ copied.value = false;
298
+ copiedTimer = 0;
299
+ }, 1500);
300
+ }
301
+ async function writeCopy(text, source) {
302
+ if (!text) return false;
303
+ const ok = await copyTextToClipboard(text);
304
+ if (ok) {
305
+ markCopied();
306
+ emit("copy", {
307
+ text,
308
+ source
309
+ });
310
+ }
311
+ return ok;
312
+ }
313
+ async function copy() {
314
+ const resolved = resolveLogCopyText({
315
+ selection: readDomSelection(),
316
+ visibleTexts: displayLines.value.map((line) => line.text),
317
+ allTexts: resolvedLines.value.map((line) => line.text)
318
+ });
319
+ return writeCopy(resolved.text, resolved.source);
320
+ }
321
+ async function copyAll() {
322
+ return writeCopy(joinLogLines(resolvedLines.value), "all");
323
+ }
324
+ function focusSearch() {
325
+ const input = searchRef.value?.querySelector("input");
326
+ input?.focus();
327
+ input?.select();
328
+ }
329
+ function getLines() {
330
+ return resolvedLines.value;
331
+ }
332
+ function getVisibleLines() {
333
+ return displayLines.value;
334
+ }
335
+ function focus() {
336
+ viewportRef.value?.focus();
337
+ }
338
+ function setStuck(next) {
339
+ if (stuckToBottom.value === next) return;
340
+ stuckToBottom.value = next;
341
+ emit("followChange", next);
342
+ }
343
+ function onListScroll(event) {
344
+ const el = event.target;
345
+ if (!(el instanceof HTMLElement)) return;
346
+ setStuck(el.scrollHeight - el.scrollTop - el.clientHeight < 28);
347
+ }
348
+ function isTypingTarget(target) {
349
+ if (!(target instanceof HTMLElement)) return false;
350
+ return Boolean(target.closest("input, textarea, select, [contenteditable=\"true\"]"));
351
+ }
352
+ function moveActive(delta) {
353
+ const max = displayLines.value.length - 1;
354
+ if (max < 0) return;
355
+ const current = activeIndex.value;
356
+ const next = current < 0 ? delta >= 0 ? 0 : max : Math.min(max, Math.max(0, current + delta));
357
+ activeIndex.value = next;
358
+ setStuck(next >= max);
359
+ if (useVirtual.value) {
360
+ listRef.value?.scrollToIndex(next, "nearest");
361
+ return;
362
+ }
363
+ const row = plainRef.value?.querySelector(`[data-log-index="${next}"]`);
364
+ if (typeof row?.scrollIntoView === "function") row.scrollIntoView({ block: "nearest" });
365
+ }
366
+ function isSearchShortcut(event) {
367
+ return (event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "f";
368
+ }
369
+ function isCopyShortcut(event) {
370
+ return (event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "c";
371
+ }
372
+ function onRootKeydown(event) {
373
+ if (isSearchShortcut(event) && props.showSearch) {
374
+ event.preventDefault();
375
+ focusSearch();
376
+ return;
377
+ }
378
+ if (isCopyShortcut(event) && !isTypingTarget(event.target)) {
379
+ if (readDomSelection()) return;
380
+ event.preventDefault();
381
+ copy();
382
+ }
383
+ }
384
+ function onViewportKeydown(event) {
385
+ if (isSearchShortcut(event) || isCopyShortcut(event)) return;
386
+ if (isTypingTarget(event.target)) return;
387
+ if (displayLines.value.length - 1 < 0) return;
388
+ const page = 10;
389
+ if (event.key === "ArrowDown") {
390
+ event.preventDefault();
391
+ moveActive(1);
392
+ return;
393
+ }
394
+ if (event.key === "ArrowUp") {
395
+ event.preventDefault();
396
+ moveActive(-1);
397
+ return;
398
+ }
399
+ if (event.key === "Home") {
400
+ event.preventDefault();
401
+ moveActive(-displayLines.value.length);
402
+ return;
403
+ }
404
+ if (event.key === "End") {
405
+ event.preventDefault();
406
+ moveActive(displayLines.value.length);
407
+ return;
408
+ }
409
+ if (event.key === "PageDown") {
410
+ event.preventDefault();
411
+ moveActive(page);
412
+ return;
413
+ }
414
+ if (event.key === "PageUp") {
415
+ event.preventDefault();
416
+ moveActive(-10);
417
+ return;
418
+ }
419
+ }
420
+ function toggleLevel(level) {
421
+ const current = filterLevels.value ?? [];
422
+ filterLevels.value = current.includes(level) ? current.filter((item) => item !== level) : [...current, level];
423
+ }
424
+ function onRowClick(index) {
425
+ activeIndex.value = index;
426
+ }
427
+ watch(() => displayLines.value.length, async (count, prev) => {
428
+ const delta = count - (prev ?? 0);
429
+ if (liveMode.value !== "off" && delta > 0) announcement.value = t("log.newLines", "{count} new lines", { count: delta });
430
+ if (!props.follow || delta <= 0 || !stuckToBottom.value) return;
431
+ await nextTick();
432
+ scrollToBottom();
433
+ });
434
+ watch(() => countDroppedLines(rawCount.value, props.maxLines), (dropped, prev) => {
435
+ if (dropped <= (prev ?? 0)) return;
436
+ emit("overflow", {
437
+ dropped,
438
+ kept: resolvedLines.value.length
439
+ });
440
+ });
441
+ onUnmounted(() => {
442
+ if (copiedTimer) window.clearTimeout(copiedTimer);
443
+ });
444
+ __expose({
445
+ append,
446
+ clear,
447
+ scrollToBottom,
448
+ scrollToTop,
449
+ copy,
450
+ copyAll,
451
+ getLines,
452
+ getVisibleLines,
453
+ focus,
454
+ focusSearch
455
+ });
456
+ return (_ctx, _cache) => {
457
+ return openBlock(), createElementBlock("div", {
458
+ ref_key: "rootRef",
459
+ ref: rootRef,
460
+ class: normalizeClass(["rs-log", {
461
+ "rs-log--wrap": __props.wrap,
462
+ "rs-log--zebra": __props.zebra,
463
+ "rs-log--chrome": hasChrome.value
464
+ }]),
465
+ style: normalizeStyle(rootStyle.value),
466
+ dir: __props.dir,
467
+ onKeydown: onRootKeydown
468
+ }, [
469
+ hasChrome.value ? (openBlock(), createElementBlock("div", _hoisted_2, [renderSlot(_ctx.$slots, "toolbar", {}, () => [
470
+ __props.showSearch ? (openBlock(), createElementBlock("div", {
471
+ key: 0,
472
+ ref_key: "searchRef",
473
+ ref: searchRef,
474
+ class: "rs-log__search"
475
+ }, [createVNode(RsInput_default, {
476
+ modelValue: search.value,
477
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
478
+ type: "search",
479
+ size: "sm",
480
+ clearable: "",
481
+ placeholder: unref(t)("log.searchPlaceholder", "Filter lines…"),
482
+ "aria-label": unref(t)("log.search", "Search logs")
483
+ }, null, 8, [
484
+ "modelValue",
485
+ "placeholder",
486
+ "aria-label"
487
+ ])], 512)) : createCommentVNode("", true),
488
+ __props.showFilter ? (openBlock(), createElementBlock("fieldset", _hoisted_3, [createElementVNode("legend", _hoisted_4, toDisplayString(unref(t)("log.filter", "Filter levels")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(RS_LOG_FILTER_LEVELS), (level) => {
489
+ return openBlock(), createElementBlock("button", {
490
+ key: level,
491
+ type: "button",
492
+ class: normalizeClass(["rs-log__chip", [`rs-log__chip--${level}`, { "rs-log__chip--on": filterLevels.value.includes(level) }]]),
493
+ "aria-pressed": filterLevels.value.includes(level),
494
+ onClick: ($event) => toggleLevel(level)
495
+ }, toDisplayString(levelLabel(level)), 11, _hoisted_5);
496
+ }), 128))])) : createCommentVNode("", true),
497
+ __props.showCopy ? (openBlock(), createBlock(RsButton_default, {
498
+ key: 2,
499
+ class: "rs-log__copy",
500
+ variant: "ghost",
501
+ size: "sm",
502
+ icon: "copy",
503
+ "icon-only": "",
504
+ "aria-label": copyTip.value,
505
+ tooltip: copyTip.value,
506
+ disabled: displayLines.value.length === 0,
507
+ onClick: _cache[1] || (_cache[1] = ($event) => void copy())
508
+ }, null, 8, [
509
+ "aria-label",
510
+ "tooltip",
511
+ "disabled"
512
+ ])) : createCommentVNode("", true)
513
+ ], true)])) : createCommentVNode("", true),
514
+ liveMode.value !== "off" ? (openBlock(), createElementBlock("div", {
515
+ key: 1,
516
+ class: "rs-log__sr-only",
517
+ "aria-live": liveMode.value,
518
+ "aria-atomic": "true"
519
+ }, toDisplayString(announcement.value), 9, _hoisted_6)) : createCommentVNode("", true),
520
+ createElementVNode("div", {
521
+ ref_key: "viewportRef",
522
+ ref: viewportRef,
523
+ class: "rs-log__viewport",
524
+ role: "region",
525
+ tabindex: "0",
526
+ "aria-label": regionLabel.value,
527
+ "aria-busy": __props.busy ? "true" : void 0,
528
+ onKeydown: onViewportKeydown
529
+ }, [displayLines.value.length === 0 ? renderSlot(_ctx.$slots, "empty", {}, () => [createVNode(RsEmpty_default, {
530
+ fill: "",
531
+ description: emptyLabel.value
532
+ }, null, 8, ["description"])], true, 0) : useVirtual.value ? (openBlock(), createBlock(RsVirtualList_default, {
533
+ key: 1,
534
+ ref_key: "listRef",
535
+ ref: listRef,
536
+ class: "rs-log__list",
537
+ role: "list",
538
+ items: displayLines.value,
539
+ "item-size": resolvedItemSize.value,
540
+ height: 0,
541
+ overscan: __props.overscan,
542
+ "active-index": activeIndex.value < 0 ? null : activeIndex.value,
543
+ radius: "none",
544
+ onScroll: onListScroll
545
+ }, {
546
+ default: withCtx(({ item, index }) => [createElementVNode("div", {
547
+ class: normalizeClass(["rs-log__row", [`rs-log__row--${item.level}`, {
548
+ "rs-log__row--odd": index % 2 === 1,
549
+ "rs-log__row--active": index === activeIndex.value
550
+ }]]),
551
+ role: "listitem",
552
+ "aria-label": rowLabel(item),
553
+ "data-log-index": index,
554
+ onClick: ($event) => onRowClick(index)
555
+ }, [
556
+ _cache[2] || (_cache[2] = createElementVNode("span", {
557
+ class: "rs-log__marker",
558
+ "aria-hidden": "true"
559
+ }, null, -1)),
560
+ __props.showLineNo ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(item.seq), 1)) : createCommentVNode("", true),
561
+ __props.showTime && item.time ? (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(item.time), 1)) : createCommentVNode("", true),
562
+ __props.showLevel && item.level !== "plain" ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(levelLabel(item.level)), 1)) : (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(levelLabel(item.level)), 1)),
563
+ renderSlot(_ctx.$slots, "row", {
564
+ item,
565
+ index,
566
+ levelLabel: levelLabel(item.level),
567
+ parts: highlightParts(item.text)
568
+ }, () => [createElementVNode("span", _hoisted_13, [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(item.text), (part, partIndex) => {
569
+ return openBlock(), createElementBlock(Fragment, { key: partIndex }, [part.hit ? (openBlock(), createElementBlock("mark", _hoisted_14, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
570
+ }), 128))])], true)
571
+ ], 10, _hoisted_8)]),
572
+ _: 3
573
+ }, 8, [
574
+ "items",
575
+ "item-size",
576
+ "overscan",
577
+ "active-index"
578
+ ])) : (openBlock(), createElementBlock("div", {
579
+ key: 2,
580
+ ref_key: "plainRef",
581
+ ref: plainRef,
582
+ class: "rs-log__plain",
583
+ role: "list",
584
+ onScroll: onListScroll
585
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(displayLines.value, (item, index) => {
586
+ return openBlock(), createElementBlock("div", {
587
+ key: item.key,
588
+ class: normalizeClass(["rs-log__row", [`rs-log__row--${item.level}`, {
589
+ "rs-log__row--odd": index % 2 === 1,
590
+ "rs-log__row--active": index === activeIndex.value
591
+ }]]),
592
+ role: "listitem",
593
+ "aria-label": rowLabel(item),
594
+ "data-log-index": index,
595
+ onClick: ($event) => onRowClick(index)
596
+ }, [
597
+ _cache[3] || (_cache[3] = createElementVNode("span", {
598
+ class: "rs-log__marker",
599
+ "aria-hidden": "true"
600
+ }, null, -1)),
601
+ __props.showLineNo ? (openBlock(), createElementBlock("span", _hoisted_16, toDisplayString(item.seq), 1)) : createCommentVNode("", true),
602
+ __props.showTime && item.time ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(item.time), 1)) : createCommentVNode("", true),
603
+ __props.showLevel && item.level !== "plain" ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(levelLabel(item.level)), 1)) : (openBlock(), createElementBlock("span", _hoisted_19, toDisplayString(levelLabel(item.level)), 1)),
604
+ renderSlot(_ctx.$slots, "row", {
605
+ item,
606
+ index,
607
+ levelLabel: levelLabel(item.level),
608
+ parts: highlightParts(item.text)
609
+ }, () => [createElementVNode("span", _hoisted_20, [(openBlock(true), createElementBlock(Fragment, null, renderList(highlightParts(item.text), (part, partIndex) => {
610
+ return openBlock(), createElementBlock(Fragment, { key: partIndex }, [part.hit ? (openBlock(), createElementBlock("mark", _hoisted_21, toDisplayString(part.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part.text), 1)], 64))], 64);
611
+ }), 128))])], true)
612
+ ], 10, _hoisted_15);
613
+ }), 128))], 544))], 40, _hoisted_7)
614
+ ], 46, _hoisted_1);
615
+ };
616
+ }
617
+ });
618
+ //#endregion
619
+ export { RsLog_vue_vue_type_script_setup_true_lang_default as default };
@@ -0,0 +1,8 @@
1
+ import './RsLog.css'
2
+ import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.js";
3
+ import RsLog_vue_vue_type_script_setup_true_lang_default from "./RsLog.impl.js";
4
+
5
+ //#region src/components/RsLog.vue
6
+ var RsLog_default = /*#__PURE__*/ _plugin_vue_export_helper_default(RsLog_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-292b0834"]]);
7
+ //#endregion
8
+ export { RsLog_default as default };
@@ -106,6 +106,7 @@ var RsTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
106
106
  cellTooltip: { type: Boolean },
107
107
  cellTooltipDelay: {},
108
108
  headerTooltip: { type: Boolean },
109
+ cellFocus: {},
109
110
  editable: { type: Boolean },
110
111
  editTrigger: {},
111
112
  editGutter: { type: Boolean },
@@ -599,7 +600,7 @@ var RsTable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
599
600
  }, [createElementVNode("table", mergeProps({
600
601
  ref_key: "tableRef",
601
602
  ref: tableRef,
602
- class: "rs-table__table",
603
+ class: ["rs-table__table", `rs-table__table--cell-focus-${__props.cellFocus}`],
603
604
  style: unref(tableInlineStyle)
604
605
  }, unref(tableA11y), {
605
606
  onKeydown: _cache[0] || (_cache[0] = (...args) => unref(onShellKeydown) && unref(onShellKeydown)(...args)),