@icen.ai/ui 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +79 -309
- package/LICENSE +21 -0
- package/README.md +43 -54
- package/dist/base.css +57 -16
- package/dist/behaviors/accordion.mjs +1 -1
- package/dist/behaviors/ai-branch.mjs +1 -0
- package/dist/behaviors/ai-chat.d.mts +2 -2
- package/dist/behaviors/ai-chat.mjs +53 -10
- package/dist/behaviors/ai-composer.d.mts +5 -5
- package/dist/behaviors/ai-composer.mjs +21 -10
- package/dist/behaviors/ai-core.mjs +1 -0
- package/dist/behaviors/ai-diff.mjs +1 -0
- package/dist/behaviors/ai-feedback.mjs +1 -0
- package/dist/behaviors/ai-panel.d.mts +2 -2
- package/dist/behaviors/ai-panel.mjs +1 -0
- package/dist/behaviors/ai-provider.d.mts +1 -1
- package/dist/behaviors/ai-provider.mjs +1 -0
- package/dist/behaviors/ai-threads.mjs +1 -0
- package/dist/behaviors/ai-tool.d.mts +1 -1
- package/dist/behaviors/ai-tool.mjs +57 -24
- package/dist/behaviors/ai-tools.mjs +937 -28
- package/dist/behaviors/autocomplete.d.mts +1 -1
- package/dist/behaviors/autocomplete.mjs +1 -0
- package/dist/behaviors/back-top.mjs +1 -0
- package/dist/behaviors/carousel.mjs +8 -1
- package/dist/behaviors/cascader.mjs +14 -0
- package/dist/behaviors/charts.mjs +56 -20
- package/dist/behaviors/code-block.mjs +9 -1
- package/dist/behaviors/command-palette.mjs +3 -3
- package/dist/behaviors/context-menu.d.mts +2 -2
- package/dist/behaviors/context-menu.mjs +1 -0
- package/dist/behaviors/controls.d.mts +8 -8
- package/dist/behaviors/controls.mjs +37 -6
- package/dist/behaviors/copy.mjs +1 -0
- package/dist/behaviors/datatable.d.mts +3 -3
- package/dist/behaviors/datatable.mjs +76 -11
- package/dist/behaviors/date-picker.mjs +1 -0
- package/dist/behaviors/events.d.mts +10 -10
- package/dist/behaviors/events.mjs +11 -1
- package/dist/behaviors/form-validate.d.mts +10 -1
- package/dist/behaviors/form-validate.mjs +266 -4611
- package/dist/behaviors/i18n.d.mts +1 -0
- package/dist/behaviors/i18n.mjs +2 -0
- package/dist/behaviors/input.mjs +3 -0
- package/dist/behaviors/kb-access.d.mts +2 -2
- package/dist/behaviors/kb-access.mjs +8 -2
- package/dist/behaviors/kb-acl.d.mts +2 -2
- package/dist/behaviors/kb-acl.mjs +1 -0
- package/dist/behaviors/kb-answer.d.mts +2 -2
- package/dist/behaviors/kb-answer.mjs +56 -23
- package/dist/behaviors/kb-audit.d.mts +2 -2
- package/dist/behaviors/kb-audit.mjs +1 -0
- package/dist/behaviors/kb-canvas.d.mts +3 -3
- package/dist/behaviors/kb-canvas.mjs +1 -0
- package/dist/behaviors/kb-chain.d.mts +2 -2
- package/dist/behaviors/kb-chain.mjs +1 -0
- package/dist/behaviors/kb-checkpoint.d.mts +2 -2
- package/dist/behaviors/kb-checkpoint.mjs +1 -0
- package/dist/behaviors/kb-chunks.d.mts +2 -2
- package/dist/behaviors/kb-chunks.mjs +1 -0
- package/dist/behaviors/kb-citation.d.mts +2 -2
- package/dist/behaviors/kb-citation.mjs +20 -6
- package/dist/behaviors/kb-clarify.d.mts +2 -2
- package/dist/behaviors/kb-clarify.mjs +1 -0
- package/dist/behaviors/kb-conflict.d.mts +2 -2
- package/dist/behaviors/kb-conflict.mjs +1 -0
- package/dist/behaviors/kb-connector.d.mts +2 -2
- package/dist/behaviors/kb-connector.mjs +1 -0
- package/dist/behaviors/kb-core.d.mts +1 -1
- package/dist/behaviors/kb-core.mjs +1 -0
- package/dist/behaviors/kb-eval.d.mts +2 -2
- package/dist/behaviors/kb-eval.mjs +8 -2
- package/dist/behaviors/kb-explain.d.mts +2 -2
- package/dist/behaviors/kb-explain.mjs +13 -2
- package/dist/behaviors/kb-filter.d.mts +2 -2
- package/dist/behaviors/kb-filter.mjs +8 -2
- package/dist/behaviors/kb-gap.d.mts +2 -2
- package/dist/behaviors/kb-gap.mjs +1 -0
- package/dist/behaviors/kb-hittest.d.mts +2 -2
- package/dist/behaviors/kb-hittest.mjs +2 -1
- package/dist/behaviors/kb-metadata.mjs +6 -0
- package/dist/behaviors/kb-passage.d.mts +2 -2
- package/dist/behaviors/kb-passage.mjs +1 -0
- package/dist/behaviors/kb-pipeline.d.mts +2 -2
- package/dist/behaviors/kb-pipeline.mjs +1 -0
- package/dist/behaviors/kb-qa.mjs +1 -0
- package/dist/behaviors/kb-rerank.d.mts +2 -2
- package/dist/behaviors/kb-rerank.mjs +1 -0
- package/dist/behaviors/kb-retrieval.d.mts +2 -2
- package/dist/behaviors/kb-retrieval.mjs +18 -4
- package/dist/behaviors/kb-review.d.mts +2 -2
- package/dist/behaviors/kb-review.mjs +8 -2
- package/dist/behaviors/kb-sandbox.d.mts +2 -2
- package/dist/behaviors/kb-sandbox.mjs +7 -1
- package/dist/behaviors/kb-segment.d.mts +2 -2
- package/dist/behaviors/kb-segment.mjs +2 -1
- package/dist/behaviors/kb-select.mjs +8 -2
- package/dist/behaviors/kb-sources.d.mts +2 -2
- package/dist/behaviors/kb-sources.mjs +1 -0
- package/dist/behaviors/kb-sql.d.mts +2 -2
- package/dist/behaviors/kb-sql.mjs +1 -0
- package/dist/behaviors/kb-trace.d.mts +2 -2
- package/dist/behaviors/kb-trace.mjs +9 -3
- package/dist/behaviors/kb-visibility.d.mts +2 -2
- package/dist/behaviors/kb-visibility.mjs +1 -0
- package/dist/behaviors/kb-who-can.d.mts +2 -2
- package/dist/behaviors/kb-who-can.mjs +8 -2
- package/dist/behaviors/mentions.d.mts +1 -1
- package/dist/behaviors/mentions.mjs +1 -0
- package/dist/behaviors/modal.d.mts +1 -1
- package/dist/behaviors/modal.mjs +1 -0
- package/dist/behaviors/notification.d.mts +2 -2
- package/dist/behaviors/notification.mjs +14 -3
- package/dist/behaviors/panel.mjs +1 -0
- package/dist/behaviors/scroll-area.d.mts +17 -0
- package/dist/behaviors/scroll-area.mjs +59 -0
- package/dist/behaviors/select.mjs +8 -2
- package/dist/behaviors/slider.mjs +3 -3
- package/dist/behaviors/split-pane.mjs +2 -0
- package/dist/behaviors/suggestions.mjs +1 -0
- package/dist/behaviors/tabs.mjs +10 -0
- package/dist/behaviors/tag-input.mjs +1 -0
- package/dist/behaviors/theme-switcher.d.mts +2 -2
- package/dist/behaviors/theme-switcher.mjs +17 -2
- package/dist/behaviors/theme.mjs +16 -2
- package/dist/behaviors/toast.d.mts +2 -2
- package/dist/behaviors/toast.mjs +1 -0
- package/dist/behaviors/tree-select.mjs +14 -0
- package/dist/behaviors/tree.mjs +4 -4
- package/dist/behaviors/upload.mjs +1 -0
- package/dist/behaviors/url-safety.d.mts +8 -0
- package/dist/behaviors/url-safety.mjs +11 -0
- package/dist/components/accordion.d.mts +2 -0
- package/dist/components/ai-branch.d.mts +2 -0
- package/dist/components/ai-chat.css +40 -33
- package/dist/components/ai-chat.d.mts +2 -0
- package/dist/components/ai-composer.d.mts +2 -0
- package/dist/components/ai-context.d.mts +2 -0
- package/dist/components/ai-context.mjs +1 -0
- package/dist/components/ai-diff.css +6 -6
- package/dist/components/ai-diff.d.mts +2 -0
- package/dist/components/ai-feedback.d.mts +2 -0
- package/dist/components/ai-files.d.mts +2 -0
- package/dist/components/ai-message.d.mts +2 -0
- package/dist/components/ai-panel.css +12 -10
- package/dist/components/ai-reasoning.d.mts +2 -0
- package/dist/components/ai-subagent.d.mts +2 -0
- package/dist/components/ai-subagent.mjs +1 -0
- package/dist/components/ai-threads.d.mts +2 -0
- package/dist/components/ai-todo.d.mts +2 -0
- package/dist/components/ai-todo.mjs +1 -0
- package/dist/components/ai-tool-call.d.mts +2 -0
- package/dist/components/ai-tool-call.mjs +1 -0
- package/dist/components/ai-tool.css +16 -16
- package/dist/components/ai-usage.d.mts +2 -0
- package/dist/components/alert.d.mts +2 -0
- package/dist/components/autocomplete.css +12 -12
- package/dist/components/autocomplete.d.mts +2 -0
- package/dist/components/avatar.d.mts +2 -0
- package/dist/components/back-top.css +47 -16
- package/dist/components/back-top.d.mts +2 -0
- package/dist/components/badge.css +1 -1
- package/dist/components/badge.d.mts +2 -0
- package/dist/components/breadcrumb.css +26 -8
- package/dist/components/breadcrumb.d.mts +2 -0
- package/dist/components/btn.css +67 -62
- package/dist/components/btn.d.mts +2 -0
- package/dist/components/card.css +22 -22
- package/dist/components/card.d.mts +2 -0
- package/dist/components/carousel.d.mts +2 -0
- package/dist/components/cascader.css +56 -35
- package/dist/components/cascader.d.mts +2 -0
- package/dist/components/chart-area.css +46 -0
- package/dist/components/chart-area.d.mts +2 -0
- package/dist/components/chart-bar.css +66 -19
- package/dist/components/chart-bar.d.mts +2 -0
- package/dist/components/chart-calendar.d.mts +2 -0
- package/dist/components/chart-gauge.css +23 -3
- package/dist/components/chart-gauge.d.mts +2 -0
- package/dist/components/chart-graph.css +15 -3
- package/dist/components/chart-graph.d.mts +2 -0
- package/dist/components/chart-heatmap.css +117 -95
- package/dist/components/chart-heatmap.d.mts +2 -0
- package/dist/components/chart-line.css +54 -0
- package/dist/components/chart-line.d.mts +2 -0
- package/dist/components/chart-map.d.mts +2 -0
- package/dist/components/chart-pie.css +29 -0
- package/dist/components/chart-pie.d.mts +2 -0
- package/dist/components/chart-radar.css +50 -1
- package/dist/components/chart-radar.d.mts +2 -0
- package/dist/components/chart-scatter.css +39 -2
- package/dist/components/chart-scatter.d.mts +2 -0
- package/dist/components/chart-sparkline.css +20 -0
- package/dist/components/chart-sparkline.d.mts +2 -0
- package/dist/components/chart-stack.css +16 -5
- package/dist/components/chart-stack.d.mts +2 -0
- package/dist/components/charts.css +80 -35
- package/dist/components/charts.d.mts +2 -0
- package/dist/components/code-block.css +10 -8
- package/dist/components/code-block.d.mts +2 -0
- package/dist/components/command-palette.css +45 -38
- package/dist/components/command-palette.d.mts +2 -0
- package/dist/components/content.css +62 -57
- package/dist/components/context-menu.d.mts +2 -0
- package/dist/components/copy.css +10 -10
- package/dist/components/copy.d.mts +2 -0
- package/dist/components/datatable.css +72 -59
- package/dist/components/datatable.d.mts +2 -0
- package/dist/components/date-picker.css +26 -26
- package/dist/components/date-picker.d.mts +2 -0
- package/dist/components/desc.d.mts +2 -0
- package/dist/components/dropdown.d.mts +2 -0
- package/dist/components/empty.css +16 -16
- package/dist/components/empty.d.mts +2 -0
- package/dist/components/feedback.css +31 -29
- package/dist/components/form-validate.css +20 -6
- package/dist/components/form-validate.d.mts +2 -0
- package/dist/components/form.css +17 -14
- package/dist/components/form.d.mts +2 -0
- package/dist/components/icon.css +21 -10
- package/dist/components/icon.d.mts +2 -0
- package/dist/components/input.css +22 -22
- package/dist/components/input.d.mts +2 -0
- package/dist/components/kb-access.d.mts +2 -0
- package/dist/components/kb-acl.d.mts +2 -0
- package/dist/components/kb-agent.css +134 -55
- package/dist/components/kb-answer.d.mts +2 -0
- package/dist/components/kb-audit.d.mts +2 -0
- package/dist/components/kb-canvas.d.mts +2 -0
- package/dist/components/kb-chain.d.mts +2 -0
- package/dist/components/kb-checkpoint.d.mts +2 -0
- package/dist/components/kb-chunks.d.mts +2 -0
- package/dist/components/kb-citation.d.mts +2 -0
- package/dist/components/kb-clarify.d.mts +2 -0
- package/dist/components/kb-conflict.d.mts +2 -0
- package/dist/components/kb-connector.d.mts +2 -0
- package/dist/components/kb-data.css +192 -80
- package/dist/components/kb-eval.d.mts +2 -0
- package/dist/components/kb-explain.d.mts +2 -0
- package/dist/components/kb-filter.d.mts +2 -0
- package/dist/components/kb-gap.d.mts +2 -0
- package/dist/components/kb-ground.css +165 -73
- package/dist/components/kb-hittest.d.mts +2 -0
- package/dist/components/kb-ingest.css +308 -113
- package/dist/components/kb-metadata.d.mts +2 -0
- package/dist/components/kb-ops.css +189 -75
- package/dist/components/kb-passage.d.mts +2 -0
- package/dist/components/kb-perm.css +158 -87
- package/dist/components/kb-pipeline.d.mts +2 -0
- package/dist/components/kb-qa.d.mts +2 -0
- package/dist/components/kb-rerank.d.mts +2 -0
- package/dist/components/kb-retrieval.d.mts +2 -0
- package/dist/components/kb-review.d.mts +2 -0
- package/dist/components/kb-sandbox.d.mts +2 -0
- package/dist/components/kb-search.css +353 -116
- package/dist/components/kb-segment.d.mts +2 -0
- package/dist/components/kb-sources.d.mts +2 -0
- package/dist/components/kb-sql.d.mts +2 -0
- package/dist/components/kb-trace.d.mts +2 -0
- package/dist/components/kb-visibility.d.mts +2 -0
- package/dist/components/kb-who-can.d.mts +2 -0
- package/dist/components/kb.css +60 -36
- package/dist/components/kb.d.mts +2 -0
- package/dist/components/kbd.d.mts +2 -0
- package/dist/components/layout.css +10 -10
- package/dist/components/layout.d.mts +2 -0
- package/dist/components/list.d.mts +2 -0
- package/dist/components/material-chinese.css +10 -0
- package/dist/components/material-soviet.css +10 -0
- package/dist/components/material.css +61 -18
- package/dist/components/media-card.d.mts +2 -0
- package/dist/components/media.css +22 -27
- package/dist/components/mentions.css +18 -17
- package/dist/components/mentions.d.mts +2 -0
- package/dist/components/menu.css +32 -28
- package/dist/components/modal.css +30 -27
- package/dist/components/modal.d.mts +2 -0
- package/dist/components/nav.css +48 -44
- package/dist/components/nav.d.mts +2 -0
- package/dist/components/notification.css +31 -25
- package/dist/components/notification.d.mts +2 -0
- package/dist/components/pagination.css +15 -13
- package/dist/components/pagination.d.mts +2 -0
- package/dist/components/panel.css +19 -20
- package/dist/components/panel.d.mts +2 -0
- package/dist/components/pill.css +8 -7
- package/dist/components/pill.d.mts +2 -0
- package/dist/components/popover.css +32 -23
- package/dist/components/popover.d.mts +2 -0
- package/dist/components/progress.d.mts +2 -0
- package/dist/components/rating.d.mts +2 -0
- package/dist/components/result.d.mts +2 -0
- package/dist/components/scroll-area.css +84 -112
- package/dist/components/scroll-area.d.mts +2 -0
- package/dist/components/scroll-area.mjs +1 -0
- package/dist/components/segmented.css +47 -29
- package/dist/components/segmented.d.mts +2 -0
- package/dist/components/select.css +80 -41
- package/dist/components/select.d.mts +2 -0
- package/dist/components/sidebar.css +42 -38
- package/dist/components/sidebar.d.mts +2 -0
- package/dist/components/skeleton.d.mts +2 -0
- package/dist/components/slider.css +26 -22
- package/dist/components/slider.d.mts +2 -0
- package/dist/components/spinner.d.mts +2 -0
- package/dist/components/split-pane.css +16 -7
- package/dist/components/split-pane.d.mts +2 -0
- package/dist/components/stat.css +17 -16
- package/dist/components/stat.d.mts +2 -0
- package/dist/components/steps.css +26 -26
- package/dist/components/steps.d.mts +2 -0
- package/dist/components/switch.css +78 -39
- package/dist/components/switch.d.mts +2 -0
- package/dist/components/table.css +54 -32
- package/dist/components/table.d.mts +2 -0
- package/dist/components/tabs.css +53 -32
- package/dist/components/tabs.d.mts +2 -0
- package/dist/components/tag-input.css +12 -8
- package/dist/components/tag-input.d.mts +2 -0
- package/dist/components/tag.css +20 -12
- package/dist/components/tag.d.mts +2 -0
- package/dist/components/theme-switcher.css +7 -7
- package/dist/components/theme-switcher.d.mts +2 -0
- package/dist/components/timeline.d.mts +2 -0
- package/dist/components/toast.css +34 -30
- package/dist/components/toast.d.mts +2 -0
- package/dist/components/toolbar.css +19 -18
- package/dist/components/toolbar.d.mts +2 -0
- package/dist/components/tooltip.css +9 -8
- package/dist/components/tooltip.d.mts +2 -0
- package/dist/components/tree-select.css +63 -40
- package/dist/components/tree-select.d.mts +2 -0
- package/dist/components/tree.d.mts +2 -0
- package/dist/components/upload.css +9 -11
- package/dist/components/upload.d.mts +2 -0
- package/dist/index.d.mts +85 -84
- package/dist/index.mjs +14764 -14311
- package/dist/react.d.mts +18 -18
- package/dist/react.mjs +135 -36
- package/dist/registry.json +795 -64
- package/dist/tokens/colors.css +6 -0
- package/dist/tokens/design.css +130 -30
- package/dist/tokens/dtcg.json +6189 -1461
- package/dist/tokens/figma.variables.json +4107 -345
- package/dist/tokens/pixel.css +3 -0
- package/dist/tokens/scrollbars.css +40 -0
- package/dist/tokens/tokens-studio.json +5191 -271
- package/dist/tokens.css +304 -81
- package/dist/ui.css +4050 -2148
- package/dist/vue.d.mts +17 -17
- package/dist/vue.mjs +129 -34
- package/docs/spec/design-philosophy.md +5 -5
- package/docs/spec/design-primitives.md +10 -10
- package/docs/spec/scrollbars.md +46 -0
- package/package.json +16 -3
|
@@ -306,6 +306,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
306
306
|
"aiChat.roleTool": "\u5DE5",
|
|
307
307
|
"aiChat.roleUser": "\u6211",
|
|
308
308
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
309
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
309
310
|
/* ── aiComposer ── */
|
|
310
311
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
311
312
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1336,7 +1337,13 @@ function onKeyDown(e) {
|
|
|
1336
1337
|
|
|
1337
1338
|
// src/behaviors/datatable.ts
|
|
1338
1339
|
function defaultCompare(a, b) {
|
|
1339
|
-
if (typeof a === "number" && typeof b === "number")
|
|
1340
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
1341
|
+
if (Number.isNaN(a) || Number.isNaN(b)) {
|
|
1342
|
+
if (Number.isNaN(a) && Number.isNaN(b)) return 0;
|
|
1343
|
+
return Number.isNaN(a) ? 1 : -1;
|
|
1344
|
+
}
|
|
1345
|
+
return a - b;
|
|
1346
|
+
}
|
|
1340
1347
|
return String(a ?? "").localeCompare(String(b ?? ""), "zh-CN", { numeric: true });
|
|
1341
1348
|
}
|
|
1342
1349
|
function toNum(v) {
|
|
@@ -1625,11 +1632,13 @@ function createTable(el, opts) {
|
|
|
1625
1632
|
const body = document.createElement("div");
|
|
1626
1633
|
body.className = "icen-dt-body";
|
|
1627
1634
|
body.setAttribute("role", "rowgroup");
|
|
1628
|
-
const summaryEl = document.createElement("div");
|
|
1629
|
-
summaryEl
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1635
|
+
const summaryEl = opts.summaryRow ? document.createElement("div") : null;
|
|
1636
|
+
if (summaryEl) {
|
|
1637
|
+
summaryEl.className = "icen-dt-row icen-dt-row--summary";
|
|
1638
|
+
summaryEl.setAttribute("role", "row");
|
|
1639
|
+
summaryEl.hidden = true;
|
|
1640
|
+
}
|
|
1641
|
+
canvas.append(head, body, ...summaryEl ? [summaryEl] : []);
|
|
1633
1642
|
scroll.appendChild(canvas);
|
|
1634
1643
|
root.appendChild(scroll);
|
|
1635
1644
|
const foot = document.createElement("div");
|
|
@@ -2443,6 +2452,7 @@ function createTable(el, opts) {
|
|
|
2443
2452
|
return wrap;
|
|
2444
2453
|
}
|
|
2445
2454
|
function renderSummary() {
|
|
2455
|
+
if (!summaryEl) return;
|
|
2446
2456
|
summaryEl.textContent = "";
|
|
2447
2457
|
summaryEl.hidden = true;
|
|
2448
2458
|
const cfg = opts.summaryRow;
|
|
@@ -2639,9 +2649,9 @@ function createTable(el, opts) {
|
|
|
2639
2649
|
}
|
|
2640
2650
|
}
|
|
2641
2651
|
let currentTotal = 0;
|
|
2642
|
-
function visibleRange(total) {
|
|
2652
|
+
function visibleRange(total, avail) {
|
|
2643
2653
|
if (!virtual) {
|
|
2644
|
-
if (opts.remote || opts.pagination === false) return [0, total];
|
|
2654
|
+
if (opts.remote || opts.pagination === false) return [0, Math.min(total, avail)];
|
|
2645
2655
|
const start2 = (page - 1) * pageSize;
|
|
2646
2656
|
return [start2, Math.min(total, start2 + pageSize)];
|
|
2647
2657
|
}
|
|
@@ -2656,6 +2666,10 @@ function createTable(el, opts) {
|
|
|
2656
2666
|
const rows = pipeline();
|
|
2657
2667
|
const entries = groupFn ? flatEntries() : null;
|
|
2658
2668
|
const total = entries ? entries.length : opts.remote ? opts.totalCount ?? data.length : rows.length;
|
|
2669
|
+
if (!opts.remote && opts.pagination !== false) {
|
|
2670
|
+
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
2671
|
+
if (page > pages) page = pages;
|
|
2672
|
+
}
|
|
2659
2673
|
navTotal = entries ? entries.length : rows.length;
|
|
2660
2674
|
currentTotal = total;
|
|
2661
2675
|
const keepTop = virtual ? scroll.scrollTop : 0;
|
|
@@ -2684,7 +2698,7 @@ function createTable(el, opts) {
|
|
|
2684
2698
|
renderSummary();
|
|
2685
2699
|
return;
|
|
2686
2700
|
}
|
|
2687
|
-
const [start, end] = visibleRange(total);
|
|
2701
|
+
const [start, end] = visibleRange(total, rows.length);
|
|
2688
2702
|
const frag = document.createDocumentFragment();
|
|
2689
2703
|
const offsets = frozenOffsets();
|
|
2690
2704
|
if (virtual && start > 0) {
|
|
@@ -2747,11 +2761,21 @@ function createTable(el, opts) {
|
|
|
2747
2761
|
const pages = Math.ceil(total / pageSize);
|
|
2748
2762
|
const pager = document.createElement("nav");
|
|
2749
2763
|
pager.className = "icen-dt-pager";
|
|
2750
|
-
|
|
2764
|
+
{
|
|
2765
|
+
const base = t("datatable.paginationAria");
|
|
2766
|
+
const used = /* @__PURE__ */ new Set();
|
|
2767
|
+
for (const el2 of document.querySelectorAll(".icen-dt-pager[aria-label]")) {
|
|
2768
|
+
if (!root.contains(el2)) used.add(el2.getAttribute("aria-label") ?? "");
|
|
2769
|
+
}
|
|
2770
|
+
let label = base, n = 2;
|
|
2771
|
+
while (used.has(label)) label = `${base} ${n++}`;
|
|
2772
|
+
pager.setAttribute("aria-label", label);
|
|
2773
|
+
}
|
|
2751
2774
|
const sizeSel = document.createElement("select");
|
|
2752
2775
|
sizeSel.className = "icen-dt-page-size";
|
|
2753
2776
|
sizeSel.setAttribute("aria-label", t("datatable.pageSizeAria"));
|
|
2754
|
-
|
|
2777
|
+
const sizeOptions = pageSizes.includes(pageSize) ? pageSizes : [...pageSizes, pageSize].sort((a, b) => a - b);
|
|
2778
|
+
for (const s of sizeOptions) {
|
|
2755
2779
|
const o = document.createElement("option");
|
|
2756
2780
|
o.value = String(s);
|
|
2757
2781
|
o.textContent = t("pagination.pageSize", { p0: s });
|
|
@@ -2843,6 +2867,7 @@ function createTable(el, opts) {
|
|
|
2843
2867
|
if (destroyed) return;
|
|
2844
2868
|
renderHead();
|
|
2845
2869
|
renderBody();
|
|
2870
|
+
syncFrozenWidths();
|
|
2846
2871
|
}
|
|
2847
2872
|
rekey();
|
|
2848
2873
|
renderAll();
|
|
@@ -2863,12 +2888,52 @@ function createTable(el, opts) {
|
|
|
2863
2888
|
opts.onPageChange?.(page, pageSize);
|
|
2864
2889
|
renderAll();
|
|
2865
2890
|
}
|
|
2891
|
+
function hasFluidFrozen() {
|
|
2892
|
+
return cols().some((c) => frozenSide(c) != null && !/^(\d+(?:\.\d+)?)px/.test(colWidths.get(c.key) ?? c.width ?? ""));
|
|
2893
|
+
}
|
|
2894
|
+
function syncFrozenWidths() {
|
|
2895
|
+
if (!hasFluidFrozen()) return;
|
|
2896
|
+
const visible = cols();
|
|
2897
|
+
const headCells = Array.from(headRow.children);
|
|
2898
|
+
const lead = headCells.length - visible.length;
|
|
2899
|
+
const left = /* @__PURE__ */ new Map();
|
|
2900
|
+
const right = /* @__PURE__ */ new Map();
|
|
2901
|
+
let acc = headCells.slice(0, lead).reduce((s, c) => s + c.offsetWidth, 0);
|
|
2902
|
+
for (let i = 0; i < visible.length; i++) {
|
|
2903
|
+
const c = visible[i];
|
|
2904
|
+
if (frozenSide(c) === "left") left.set(c.key, acc);
|
|
2905
|
+
acc += headCells[lead + i]?.offsetWidth ?? 0;
|
|
2906
|
+
}
|
|
2907
|
+
let accR = 0;
|
|
2908
|
+
for (let i = visible.length - 1; i >= 0; i--) {
|
|
2909
|
+
const c = visible[i];
|
|
2910
|
+
if (frozenSide(c) === "right") right.set(c.key, accR);
|
|
2911
|
+
accR += headCells[lead + i]?.offsetWidth ?? 0;
|
|
2912
|
+
}
|
|
2913
|
+
const rows = [headRow, ...summaryEl ? [summaryEl] : [], ...Array.from(body.querySelectorAll(".icen-dt-row"))];
|
|
2914
|
+
for (const row of rows) {
|
|
2915
|
+
const cells = Array.from(row.children);
|
|
2916
|
+
if (cells.length !== headCells.length) continue;
|
|
2917
|
+
cells.forEach((cell, i) => {
|
|
2918
|
+
const col = i >= lead ? visible[i - lead] : void 0;
|
|
2919
|
+
if (!col) return;
|
|
2920
|
+
const l = left.get(col.key);
|
|
2921
|
+
if (l != null && cell.classList.contains("icen-dt-cell--frozen")) cell.style.left = `${l}px`;
|
|
2922
|
+
const r = right.get(col.key);
|
|
2923
|
+
if (r != null && cell.classList.contains("icen-dt-cell--frozen-right")) cell.style.right = `${r}px`;
|
|
2924
|
+
});
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2866
2927
|
return {
|
|
2867
2928
|
setPage,
|
|
2868
2929
|
setPageSize,
|
|
2869
2930
|
setData(next) {
|
|
2870
2931
|
if (editing) cancelEdit(true);
|
|
2871
2932
|
data = next;
|
|
2933
|
+
if (typeof opts.rowKey !== "function" && typeof opts.rowKey !== "string" && selected.size > 0) {
|
|
2934
|
+
selected.clear();
|
|
2935
|
+
emitSelection();
|
|
2936
|
+
}
|
|
2872
2937
|
rekey();
|
|
2873
2938
|
invalidate();
|
|
2874
2939
|
page = 1;
|
|
@@ -282,6 +282,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
282
282
|
"aiChat.roleTool": "\u5DE5",
|
|
283
283
|
"aiChat.roleUser": "\u6211",
|
|
284
284
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
285
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
285
286
|
/* ── aiComposer ── */
|
|
286
287
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
287
288
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ChartEventDetail } from './charts.
|
|
2
|
-
import { AiUsage } from './ai-core.
|
|
3
|
-
import { AiDoneEventDetail } from './ai-provider.
|
|
4
|
-
import { AiComposerRefSource } from './ai-composer.
|
|
5
|
-
import { MentionEntity, MentionValue } from './mentions.
|
|
6
|
-
import { KbCitation, KbSegmentConfig, KbRetrievalQuery, KbFilterNode, KbCheckpointScope, KbSandboxMessage, KbChainStep, KbAclEntry, KbIdentity, KbAclDecision, KbAccessRequest, KbRole, KbAuditChannel, KbHygieneIssue } from './kb-core.
|
|
7
|
-
import './icons.
|
|
8
|
-
import './popover.
|
|
9
|
-
import './ai-panel.
|
|
10
|
-
import './suggestions.
|
|
1
|
+
import { ChartEventDetail } from './charts.mjs';
|
|
2
|
+
import { AiUsage } from './ai-core.mjs';
|
|
3
|
+
import { AiDoneEventDetail } from './ai-provider.mjs';
|
|
4
|
+
import { AiComposerRefSource } from './ai-composer.mjs';
|
|
5
|
+
import { MentionEntity, MentionValue } from './mentions.mjs';
|
|
6
|
+
import { KbCitation, KbSegmentConfig, KbRetrievalQuery, KbFilterNode, KbCheckpointScope, KbSandboxMessage, KbChainStep, KbAclEntry, KbIdentity, KbAclDecision, KbAccessRequest, KbRole, KbAuditChannel, KbHygieneIssue } from './kb-core.mjs';
|
|
7
|
+
import './icons.mjs';
|
|
8
|
+
import './popover.mjs';
|
|
9
|
+
import './ai-panel.mjs';
|
|
10
|
+
import './suggestions.mjs';
|
|
11
11
|
|
|
12
12
|
interface IcenGestureDetail {
|
|
13
13
|
/** 手势命中源:最近的 [data-icen-gestures] 宿主 */
|
|
@@ -99,6 +99,11 @@ function initGestures() {
|
|
|
99
99
|
downPos = { x: e.clientX, y: e.clientY };
|
|
100
100
|
suppressTrailingClick = false;
|
|
101
101
|
};
|
|
102
|
+
const onUpPos = (e) => {
|
|
103
|
+
if (downPos && Math.hypot(e.clientX - downPos.x, e.clientY - downPos.y) <= CLICK_DRAG_TOLERANCE) {
|
|
104
|
+
downPos = null;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
102
107
|
const isDragRelease = (e) => downPos != null && Math.hypot(e.clientX - downPos.x, e.clientY - downPos.y) > CLICK_DRAG_TOLERANCE;
|
|
103
108
|
const onClick = (e) => {
|
|
104
109
|
const host = gestureHost(e, "click");
|
|
@@ -107,7 +112,10 @@ function initGestures() {
|
|
|
107
112
|
suppressTrailingClick = false;
|
|
108
113
|
return;
|
|
109
114
|
}
|
|
110
|
-
if (isDragRelease(e))
|
|
115
|
+
if (isDragRelease(e)) {
|
|
116
|
+
downPos = null;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
111
119
|
if (host.matches('[data-icen-gestures~="dblclick"]')) {
|
|
112
120
|
if (clickTimer) clearTimeout(clickTimer);
|
|
113
121
|
pending = { host, e };
|
|
@@ -205,6 +213,7 @@ function initGestures() {
|
|
|
205
213
|
emit(host, "icen:text-select", e, text);
|
|
206
214
|
};
|
|
207
215
|
document.addEventListener("pointerdown", onDownPos);
|
|
216
|
+
document.addEventListener("pointerup", onUpPos);
|
|
208
217
|
document.addEventListener("click", onClick);
|
|
209
218
|
document.addEventListener("dblclick", onDblClick);
|
|
210
219
|
document.addEventListener("contextmenu", onContextMenu);
|
|
@@ -219,6 +228,7 @@ function initGestures() {
|
|
|
219
228
|
document.addEventListener("mouseup", onTextSelect);
|
|
220
229
|
gesturesTeardown = () => {
|
|
221
230
|
document.removeEventListener("pointerdown", onDownPos);
|
|
231
|
+
document.removeEventListener("pointerup", onUpPos);
|
|
222
232
|
document.removeEventListener("click", onClick);
|
|
223
233
|
document.removeEventListener("dblclick", onDblClick);
|
|
224
234
|
document.removeEventListener("contextmenu", onContextMenu);
|
|
@@ -98,5 +98,14 @@ interface ShowFormSpec {
|
|
|
98
98
|
type ShowFormResult = Record<string, unknown> | {
|
|
99
99
|
cancelled: true;
|
|
100
100
|
};
|
|
101
|
+
/** show_form 的 inputSchema(注册在 ai-tools.ts,见文件尾内置工具段)。 */
|
|
102
|
+
declare const SHOW_FORM_SCHEMA: Record<string, unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* show_form 渲染:表单进 mount,返回一个 Promise——用户提交(过校验)resolve 表单值对象;
|
|
105
|
+
* 点「取消」resolve { cancelled: true }。表单自带 data-icen-validate + 错误汇总,
|
|
106
|
+
* 取消/提交后渲染体自动摘除(挂载卡本体归 AI 工具挂载区管理)。
|
|
107
|
+
* 由 ai-tools.ts 注册为内置工具 show_form 的 run(本模块不做注册,见文件头分层纪律)。
|
|
108
|
+
*/
|
|
109
|
+
declare function runShowForm(input: unknown, mount: HTMLElement): Promise<ShowFormResult>;
|
|
101
110
|
|
|
102
|
-
export { type CustomValidatorFn, type FieldElement, type FieldRule, type FormValidateOptions, type FormValidateStrategy, type FormValidator, type ShowFormFieldSpec, type ShowFormResult, type ShowFormSpec, collectFormFields, createFormValidator, evaluateRules, fieldLabel, fieldValue, initFormValidate, registerValidator, resolveFieldRules, setValidateMessages, unregisterValidator };
|
|
111
|
+
export { type CustomValidatorFn, type FieldElement, type FieldRule, type FormValidateOptions, type FormValidateStrategy, type FormValidator, SHOW_FORM_SCHEMA, type ShowFormFieldSpec, type ShowFormResult, type ShowFormSpec, collectFormFields, createFormValidator, evaluateRules, fieldLabel, fieldValue, initFormValidate, registerValidator, resolveFieldRules, runShowForm, setValidateMessages, unregisterValidator };
|