@icen.ai/ui 0.10.0 → 0.11.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.
- package/AGENTS.md +79 -309
- package/LICENSE +21 -0
- package/README.md +43 -54
- package/dist/base.css +68 -22
- package/dist/behaviors/accordion.mjs +1 -1
- package/dist/behaviors/ai-branch.mjs +14 -0
- package/dist/behaviors/ai-chat.d.mts +2 -2
- package/dist/behaviors/ai-chat.mjs +66 -10
- package/dist/behaviors/ai-composer.d.mts +5 -5
- package/dist/behaviors/ai-composer.mjs +34 -10
- package/dist/behaviors/ai-core.mjs +14 -0
- package/dist/behaviors/ai-diff.mjs +14 -0
- package/dist/behaviors/ai-feedback.mjs +14 -0
- package/dist/behaviors/ai-panel.d.mts +2 -2
- package/dist/behaviors/ai-panel.mjs +14 -0
- package/dist/behaviors/ai-provider.d.mts +1 -1
- package/dist/behaviors/ai-provider.mjs +14 -0
- package/dist/behaviors/ai-threads.mjs +14 -0
- package/dist/behaviors/ai-tool.d.mts +1 -1
- package/dist/behaviors/ai-tool.mjs +299 -24
- package/dist/behaviors/ai-tools.mjs +1179 -28
- package/dist/behaviors/autocomplete.d.mts +1 -1
- package/dist/behaviors/autocomplete.mjs +14 -0
- package/dist/behaviors/back-top.mjs +14 -0
- package/dist/behaviors/carousel.mjs +21 -1
- package/dist/behaviors/cascader.mjs +27 -0
- package/dist/behaviors/charts.d.mts +12 -1
- package/dist/behaviors/charts.mjs +298 -20
- package/dist/behaviors/code-block.mjs +22 -1
- package/dist/behaviors/command-palette.mjs +3 -3
- package/dist/behaviors/context-menu.d.mts +2 -2
- package/dist/behaviors/context-menu.mjs +14 -0
- package/dist/behaviors/controls.d.mts +8 -8
- package/dist/behaviors/controls.mjs +50 -6
- package/dist/behaviors/copy.mjs +14 -0
- package/dist/behaviors/datatable.d.mts +3 -3
- package/dist/behaviors/datatable.mjs +89 -11
- package/dist/behaviors/date-picker.mjs +14 -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 +279 -4611
- package/dist/behaviors/i18n.d.mts +14 -0
- package/dist/behaviors/i18n.mjs +28 -0
- package/dist/behaviors/input.mjs +16 -0
- package/dist/behaviors/kb-access.d.mts +2 -2
- package/dist/behaviors/kb-access.mjs +21 -2
- package/dist/behaviors/kb-acl.d.mts +2 -2
- package/dist/behaviors/kb-acl.mjs +14 -0
- package/dist/behaviors/kb-answer.d.mts +2 -2
- package/dist/behaviors/kb-answer.mjs +298 -23
- package/dist/behaviors/kb-audit.d.mts +2 -2
- package/dist/behaviors/kb-audit.mjs +14 -0
- package/dist/behaviors/kb-canvas.d.mts +3 -3
- package/dist/behaviors/kb-canvas.mjs +14 -0
- package/dist/behaviors/kb-chain.d.mts +2 -2
- package/dist/behaviors/kb-chain.mjs +14 -0
- package/dist/behaviors/kb-checkpoint.d.mts +2 -2
- package/dist/behaviors/kb-checkpoint.mjs +14 -0
- package/dist/behaviors/kb-chunks.d.mts +2 -2
- package/dist/behaviors/kb-chunks.mjs +14 -0
- package/dist/behaviors/kb-citation.d.mts +2 -2
- package/dist/behaviors/kb-citation.mjs +33 -6
- package/dist/behaviors/kb-clarify.d.mts +2 -2
- package/dist/behaviors/kb-clarify.mjs +14 -0
- package/dist/behaviors/kb-conflict.d.mts +2 -2
- package/dist/behaviors/kb-conflict.mjs +14 -0
- package/dist/behaviors/kb-connector.d.mts +2 -2
- package/dist/behaviors/kb-connector.mjs +14 -0
- package/dist/behaviors/kb-core.d.mts +1 -1
- package/dist/behaviors/kb-core.mjs +14 -0
- package/dist/behaviors/kb-eval.d.mts +2 -2
- package/dist/behaviors/kb-eval.mjs +21 -2
- package/dist/behaviors/kb-explain.d.mts +2 -2
- package/dist/behaviors/kb-explain.mjs +26 -2
- package/dist/behaviors/kb-filter.d.mts +2 -2
- package/dist/behaviors/kb-filter.mjs +21 -2
- package/dist/behaviors/kb-gap.d.mts +2 -2
- package/dist/behaviors/kb-gap.mjs +14 -0
- package/dist/behaviors/kb-hittest.d.mts +2 -2
- package/dist/behaviors/kb-hittest.mjs +15 -1
- package/dist/behaviors/kb-metadata.mjs +19 -0
- package/dist/behaviors/kb-passage.d.mts +2 -2
- package/dist/behaviors/kb-passage.mjs +14 -0
- package/dist/behaviors/kb-pipeline.d.mts +2 -2
- package/dist/behaviors/kb-pipeline.mjs +14 -0
- package/dist/behaviors/kb-qa.mjs +14 -0
- package/dist/behaviors/kb-rerank.d.mts +2 -2
- package/dist/behaviors/kb-rerank.mjs +14 -0
- package/dist/behaviors/kb-retrieval.d.mts +2 -2
- package/dist/behaviors/kb-retrieval.mjs +31 -4
- package/dist/behaviors/kb-review.d.mts +2 -2
- package/dist/behaviors/kb-review.mjs +21 -2
- package/dist/behaviors/kb-sandbox.d.mts +2 -2
- package/dist/behaviors/kb-sandbox.mjs +20 -1
- package/dist/behaviors/kb-segment.d.mts +2 -2
- package/dist/behaviors/kb-segment.mjs +15 -1
- package/dist/behaviors/kb-select.mjs +21 -2
- package/dist/behaviors/kb-sources.d.mts +2 -2
- package/dist/behaviors/kb-sources.mjs +14 -0
- package/dist/behaviors/kb-sql.d.mts +2 -2
- package/dist/behaviors/kb-sql.mjs +14 -0
- package/dist/behaviors/kb-trace.d.mts +2 -2
- package/dist/behaviors/kb-trace.mjs +22 -3
- package/dist/behaviors/kb-visibility.d.mts +2 -2
- package/dist/behaviors/kb-visibility.mjs +14 -0
- package/dist/behaviors/kb-who-can.d.mts +2 -2
- package/dist/behaviors/kb-who-can.mjs +21 -2
- package/dist/behaviors/mentions.d.mts +1 -1
- package/dist/behaviors/mentions.mjs +14 -0
- package/dist/behaviors/modal.d.mts +1 -1
- package/dist/behaviors/modal.mjs +14 -0
- package/dist/behaviors/motion.d.mts +16 -0
- package/dist/behaviors/motion.mjs +39 -0
- package/dist/behaviors/notification.d.mts +2 -2
- package/dist/behaviors/notification.mjs +27 -3
- package/dist/behaviors/panel.mjs +14 -0
- package/dist/behaviors/scroll-area.d.mts +17 -0
- package/dist/behaviors/scroll-area.mjs +59 -0
- package/dist/behaviors/select.mjs +21 -2
- package/dist/behaviors/slider.mjs +3 -3
- package/dist/behaviors/split-pane.mjs +2 -0
- package/dist/behaviors/suggestions.mjs +14 -0
- package/dist/behaviors/tabs.mjs +10 -0
- package/dist/behaviors/tag-input.mjs +14 -0
- package/dist/behaviors/theme-switcher.d.mts +2 -2
- package/dist/behaviors/theme-switcher.mjs +30 -2
- package/dist/behaviors/theme.mjs +16 -2
- package/dist/behaviors/toast.d.mts +2 -2
- package/dist/behaviors/toast.mjs +14 -0
- package/dist/behaviors/tree-select.mjs +27 -0
- package/dist/behaviors/tree.mjs +4 -4
- package/dist/behaviors/upload.mjs +14 -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 +109 -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 +14644 -13935
- package/dist/react.d.mts +18 -18
- package/dist/react.mjs +377 -36
- package/dist/registry.json +797 -64
- package/dist/tokens/colors.css +6 -0
- package/dist/tokens/design.css +137 -31
- package/dist/tokens/dtcg.json +9592 -2008
- package/dist/tokens/figma.variables.json +7451 -2141
- package/dist/tokens/motion.css +51 -0
- package/dist/tokens/pixel.css +10 -0
- package/dist/tokens/scrollbars.css +40 -0
- package/dist/tokens/tokens-studio.json +8390 -1142
- package/dist/tokens/typography.css +33 -0
- package/dist/tokens.css +402 -82
- package/dist/ui.css +4196 -2163
- package/dist/vue.d.mts +17 -17
- package/dist/vue.mjs +371 -34
- package/docs/spec/charts-scale-a11y.md +115 -0
- package/docs/spec/design-philosophy.md +5 -5
- package/docs/spec/design-primitives.md +10 -10
- package/docs/spec/motion-typography.md +105 -0
- package/docs/spec/scrollbars.md +46 -0
- package/package.json +17 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { initInput } from './input.
|
|
1
|
+
export { initInput } from './input.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 接线开关 / 勾选框 / 单选(document 级委托,页面级一次即可,重复调用幂等)。
|
|
@@ -6,21 +6,21 @@ export { initInput } from './input.js';
|
|
|
6
6
|
* radio 组内互斥),派 icen:switch-change / icen:check-change。
|
|
7
7
|
* 返回销毁函数:摘除委托并复位幂等标记,销毁后可重新 initSwitch。SSR 下返回 no-op。
|
|
8
8
|
*/
|
|
9
|
-
declare const initSwitch: () => void;
|
|
9
|
+
declare const initSwitch: () => () => void;
|
|
10
10
|
/**
|
|
11
11
|
* 接线数字步进器(document 级委托,重复调用幂等)。
|
|
12
12
|
* .icen-stepper 内 .icen-stepper-btn[data-icen-step] 点击 → .icen-stepper-input 数值 ±step 并 clamp 到
|
|
13
13
|
* min/max,派 icen:stepper-change { el: .icen-stepper 根, value, delta }(触界 delta 为 0)。
|
|
14
14
|
* 返回销毁函数:摘除委托并复位幂等标记,销毁后可重新 initStepper。SSR 下返回 no-op。
|
|
15
15
|
*/
|
|
16
|
-
declare const initStepper: () => void;
|
|
16
|
+
declare const initStepper: () => () => void;
|
|
17
17
|
/**
|
|
18
18
|
* 接线分段控件(document 级委托,重复调用幂等)。
|
|
19
19
|
* .icen-segmented 内 .icen-segmented-item 点击 → 组内 .is-active 互斥 + role="radio" 项同步
|
|
20
20
|
* aria-checked,派 icen:segmented-change { el: 容器, value: data-icen-value ?? String(index), index }。
|
|
21
21
|
* 返回销毁函数:摘除委托并复位幂等标记,销毁后可重新 initSegmented。SSR 下返回 no-op。
|
|
22
22
|
*/
|
|
23
|
-
declare const initSegmented: () => void;
|
|
23
|
+
declare const initSegmented: () => () => void;
|
|
24
24
|
/**
|
|
25
25
|
* 接线可点击步骤条(document 级委托,重复调用幂等)。
|
|
26
26
|
* .icen-steps 内 .icen-step[role="button"] 点击(或聚焦后 Space / Enter)→ 激活点位移
|
|
@@ -28,7 +28,7 @@ declare const initSegmented: () => void;
|
|
|
28
28
|
* icen:step-change { step, index }。返回销毁函数:摘除委托并复位幂等标记,
|
|
29
29
|
* 销毁后可重新 initSteps。SSR 下返回 no-op。
|
|
30
30
|
*/
|
|
31
|
-
declare const initSteps: () => void;
|
|
31
|
+
declare const initSteps: () => () => void;
|
|
32
32
|
/**
|
|
33
33
|
* 接线星级评分(document 级委托,重复调用幂等)。
|
|
34
34
|
* .icen-rating 内 .icen-rating-star 点击 → 该星及之前 .is-filled(重建选中态,清除残留
|
|
@@ -36,7 +36,7 @@ declare const initSteps: () => void;
|
|
|
36
36
|
* icen:rating-change { el: 容器, value }(1 起算);.icen-rating--readonly 不接线。
|
|
37
37
|
* 返回销毁函数:摘除委托并复位幂等标记,销毁后可重新 initRating。SSR 下返回 no-op。
|
|
38
38
|
*/
|
|
39
|
-
declare const initRating: () => void;
|
|
39
|
+
declare const initRating: () => () => void;
|
|
40
40
|
/**
|
|
41
41
|
* 接线分页(document 级委托,重复调用幂等)。
|
|
42
42
|
* .icen-pagination 内 .icen-page-btn 点击 → .is-active / aria-current 位移并派
|
|
@@ -45,7 +45,7 @@ declare const initRating: () => void;
|
|
|
45
45
|
* 总页数与省略号折叠策略归消费方。返回销毁函数:摘除委托并复位幂等标记,
|
|
46
46
|
* 销毁后可重新 initPagination。SSR 下返回 no-op。
|
|
47
47
|
*/
|
|
48
|
-
declare const initPagination: () => void;
|
|
48
|
+
declare const initPagination: () => () => void;
|
|
49
49
|
/**
|
|
50
50
|
* 接线静态表排序(document 级委托,重复调用幂等)。
|
|
51
51
|
* th[data-icen-sort] 点击 → asc→desc→无 循环(data-icen-sort 属性即方向载体,列 key 首次
|
|
@@ -54,6 +54,6 @@ declare const initPagination: () => void;
|
|
|
54
54
|
* behaviors/datatable 的 icen:table-sort-change)。返回销毁函数:摘除委托并
|
|
55
55
|
* 复位幂等标记,销毁后可重新 initTableSort。SSR 下返回 no-op。
|
|
56
56
|
*/
|
|
57
|
-
declare const initTableSort: () => void;
|
|
57
|
+
declare const initTableSort: () => () => void;
|
|
58
58
|
|
|
59
59
|
export { initPagination, initRating, initSegmented, initStepper, initSteps, initSwitch, initTableSort };
|
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -203,6 +204,19 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
203
204
|
"charts.noData": "\u6682\u65E0\u6570\u636E",
|
|
204
205
|
"charts.resetZoom": "\u91CD\u7F6E\u7F29\u653E",
|
|
205
206
|
"charts.sampled": "\u5DF2\u62BD\u6837 {p0}\u2192{p1} \u70B9",
|
|
207
|
+
"charts.a11y.keyboardHint": "\u65B9\u5411\u952E\u9010\u70B9\u6D4F\u89C8\uFF0CHome/End \u8DF3\u9996\u5C3E\uFF0CEsc \u91CD\u7F6E\u7F29\u653E",
|
|
208
|
+
"charts.a11y.max": "\u6700\u5927 {p0}\uFF08{p1}\uFF09",
|
|
209
|
+
"charts.a11y.min": "\u6700\u5C0F {p0}\uFF08{p1}\uFF09",
|
|
210
|
+
"charts.a11y.point": "{p0}\uFF1A{p1}\uFF0C\u7B2C {p2}/{p3} \u70B9",
|
|
211
|
+
"charts.a11y.pointSeries": "{p0} \xB7 {p1}\uFF1A{p2}\uFF0C\u7B2C {p3}/{p4} \u70B9",
|
|
212
|
+
"charts.a11y.range": "\u7C7B\u76EE {p0} \u81F3 {p1}",
|
|
213
|
+
"charts.a11y.scatterRange": "x \u8303\u56F4 {p0}\u2013{p1}\uFF0Cy \u8303\u56F4 {p2}\u2013{p3}",
|
|
214
|
+
"charts.a11y.seriesCount": "{p0} \u4E2A\u7CFB\u5217",
|
|
215
|
+
"charts.a11y.tableCaption": "{p0} \u6570\u636E\u8868",
|
|
216
|
+
"charts.a11y.trend": "\u9996\u7CFB\u5217\u8D8B\u52BF{p0}",
|
|
217
|
+
"charts.a11y.trendDown": "\u4E0B\u964D",
|
|
218
|
+
"charts.a11y.trendFlat": "\u6301\u5E73",
|
|
219
|
+
"charts.a11y.trendUp": "\u4E0A\u5347",
|
|
206
220
|
"charts.type.area": "\u9762\u79EF\u56FE",
|
|
207
221
|
"charts.type.donut": "\u73AF\u5F62\u56FE",
|
|
208
222
|
"charts.type.gauge": "\u4EEA\u8868\u76D8",
|
|
@@ -864,6 +878,7 @@ function setupClear(wrap) {
|
|
|
864
878
|
const field = wrap.querySelector("input.icen-input, textarea.icen-textarea");
|
|
865
879
|
if (!btn || !field) return;
|
|
866
880
|
btn.addEventListener("click", () => {
|
|
881
|
+
if (field.disabled || field.readOnly) return;
|
|
867
882
|
field.value = "";
|
|
868
883
|
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
869
884
|
field.focus();
|
|
@@ -1072,6 +1087,7 @@ function setupOtp(group) {
|
|
|
1072
1087
|
syncFilled(target);
|
|
1073
1088
|
}
|
|
1074
1089
|
cells[Math.min(i + text.length, cells.length - 1)].focus();
|
|
1090
|
+
fireComplete();
|
|
1075
1091
|
});
|
|
1076
1092
|
});
|
|
1077
1093
|
const fireComplete = () => {
|
|
@@ -1155,6 +1171,12 @@ function createDelegatedInit(handlers) {
|
|
|
1155
1171
|
}
|
|
1156
1172
|
var SWITCH_LIKE = '.icen-switch[role="switch"], .icen-checkbox[role="checkbox"], .icen-radio-item[role="radio"], .radio[role="radio"], .icen-radio-card[role="radio"]';
|
|
1157
1173
|
var seenCheckboxes = /* @__PURE__ */ new WeakSet();
|
|
1174
|
+
function radioPeers(el) {
|
|
1175
|
+
const group = el.closest('[data-icen-radio-group], .icen-radio-group, [role="radiogroup"], .icen-radio-card-grid');
|
|
1176
|
+
return group ? Array.from(group.querySelectorAll('[role="radio"]')).filter(
|
|
1177
|
+
(it) => it.closest('[data-icen-radio-group], .icen-radio-group, [role="radiogroup"], .icen-radio-card-grid') === group
|
|
1178
|
+
) : [el];
|
|
1179
|
+
}
|
|
1158
1180
|
function toggleSwitch(el) {
|
|
1159
1181
|
const checked = el.getAttribute("aria-checked") !== "true";
|
|
1160
1182
|
el.setAttribute("aria-checked", String(checked));
|
|
@@ -1173,11 +1195,7 @@ function toggleCheckbox(el) {
|
|
|
1173
1195
|
}
|
|
1174
1196
|
function selectRadio(el) {
|
|
1175
1197
|
if (el.getAttribute("aria-checked") === "true") return;
|
|
1176
|
-
const
|
|
1177
|
-
const peers = group ? Array.from(group.querySelectorAll('[role="radio"]')).filter(
|
|
1178
|
-
(it) => it.closest('[data-icen-radio-group], .icen-radio-group, [role="radiogroup"], .icen-radio-card-grid') === group
|
|
1179
|
-
) : [el];
|
|
1180
|
-
for (const it of peers) {
|
|
1198
|
+
for (const it of radioPeers(el)) {
|
|
1181
1199
|
const on = it === el;
|
|
1182
1200
|
it.classList.toggle("is-selected", on);
|
|
1183
1201
|
it.setAttribute("aria-checked", String(on));
|
|
@@ -1196,6 +1214,9 @@ function resolveSwitchTarget(t2) {
|
|
|
1196
1214
|
const row = t2.closest(".icen-checkbox-row");
|
|
1197
1215
|
if (row && !t2.closest("button, a, input, select, textarea, [contenteditable]")) {
|
|
1198
1216
|
const box = row.querySelector('.icen-checkbox[role="checkbox"]');
|
|
1217
|
+
if (row instanceof HTMLLabelElement && (box instanceof HTMLButtonElement || box instanceof HTMLInputElement)) {
|
|
1218
|
+
return null;
|
|
1219
|
+
}
|
|
1199
1220
|
if (box && !isDisabled(box)) return box;
|
|
1200
1221
|
}
|
|
1201
1222
|
return null;
|
|
@@ -1205,11 +1226,34 @@ function onSwitchClick(ev) {
|
|
|
1205
1226
|
if (el) activateSwitchLike(el);
|
|
1206
1227
|
}
|
|
1207
1228
|
function onSwitchKeydown(ev) {
|
|
1208
|
-
if (!isActivateKey(ev)) return;
|
|
1209
1229
|
const t2 = ev.target;
|
|
1210
1230
|
if (!(t2 instanceof Element)) return;
|
|
1211
1231
|
const el = t2.closest(SWITCH_LIKE);
|
|
1212
1232
|
if (!el || isDisabled(el)) return;
|
|
1233
|
+
if (el.getAttribute("role") === "radio") {
|
|
1234
|
+
const key = ev.key;
|
|
1235
|
+
const isRadioNav = key === "ArrowLeft" || key === "ArrowRight" || key === "ArrowUp" || key === "ArrowDown" || key === "Home" || key === "End";
|
|
1236
|
+
const peers = radioPeers(el).filter((it) => !isDisabled(it));
|
|
1237
|
+
const cur = peers.indexOf(el);
|
|
1238
|
+
if (isRadioNav && peers.length > 1 && cur !== -1) {
|
|
1239
|
+
let next;
|
|
1240
|
+
if (key === "Home") next = peers[0];
|
|
1241
|
+
else if (key === "End") next = peers[peers.length - 1];
|
|
1242
|
+
else {
|
|
1243
|
+
const rtl = getComputedStyle(el).direction === "rtl";
|
|
1244
|
+
const forward = key === "ArrowRight" || key === "ArrowDown";
|
|
1245
|
+
const delta = forward ? rtl ? -1 : 1 : rtl ? 1 : -1;
|
|
1246
|
+
next = peers[(cur + delta + peers.length) % peers.length];
|
|
1247
|
+
}
|
|
1248
|
+
if (next) {
|
|
1249
|
+
ev.preventDefault();
|
|
1250
|
+
if (next !== el) selectRadio(next);
|
|
1251
|
+
next.focus({ preventScroll: true });
|
|
1252
|
+
}
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
if (!isActivateKey(ev)) return;
|
|
1213
1257
|
ev.preventDefault();
|
|
1214
1258
|
activateSwitchLike(el);
|
|
1215
1259
|
}
|
package/dist/behaviors/copy.mjs
CHANGED
|
@@ -21,6 +21,7 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
21
21
|
"aiChat.roleTool": "\u5DE5",
|
|
22
22
|
"aiChat.roleUser": "\u6211",
|
|
23
23
|
"aiChat.thinking": "\u601D\u8003 {p0}",
|
|
24
|
+
"aiChat.thinkingNow": "\u6B63\u5728\u601D\u8003\u2026",
|
|
24
25
|
/* ── aiComposer ── */
|
|
25
26
|
"aiComposer.attachAgent": "\u4EE3\u7406",
|
|
26
27
|
"aiComposer.library": "\u6DFB\u52A0\u4E0A\u4E0B\u6587\u4E0E\u547D\u4EE4",
|
|
@@ -203,6 +204,19 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
203
204
|
"charts.noData": "\u6682\u65E0\u6570\u636E",
|
|
204
205
|
"charts.resetZoom": "\u91CD\u7F6E\u7F29\u653E",
|
|
205
206
|
"charts.sampled": "\u5DF2\u62BD\u6837 {p0}\u2192{p1} \u70B9",
|
|
207
|
+
"charts.a11y.keyboardHint": "\u65B9\u5411\u952E\u9010\u70B9\u6D4F\u89C8\uFF0CHome/End \u8DF3\u9996\u5C3E\uFF0CEsc \u91CD\u7F6E\u7F29\u653E",
|
|
208
|
+
"charts.a11y.max": "\u6700\u5927 {p0}\uFF08{p1}\uFF09",
|
|
209
|
+
"charts.a11y.min": "\u6700\u5C0F {p0}\uFF08{p1}\uFF09",
|
|
210
|
+
"charts.a11y.point": "{p0}\uFF1A{p1}\uFF0C\u7B2C {p2}/{p3} \u70B9",
|
|
211
|
+
"charts.a11y.pointSeries": "{p0} \xB7 {p1}\uFF1A{p2}\uFF0C\u7B2C {p3}/{p4} \u70B9",
|
|
212
|
+
"charts.a11y.range": "\u7C7B\u76EE {p0} \u81F3 {p1}",
|
|
213
|
+
"charts.a11y.scatterRange": "x \u8303\u56F4 {p0}\u2013{p1}\uFF0Cy \u8303\u56F4 {p2}\u2013{p3}",
|
|
214
|
+
"charts.a11y.seriesCount": "{p0} \u4E2A\u7CFB\u5217",
|
|
215
|
+
"charts.a11y.tableCaption": "{p0} \u6570\u636E\u8868",
|
|
216
|
+
"charts.a11y.trend": "\u9996\u7CFB\u5217\u8D8B\u52BF{p0}",
|
|
217
|
+
"charts.a11y.trendDown": "\u4E0B\u964D",
|
|
218
|
+
"charts.a11y.trendFlat": "\u6301\u5E73",
|
|
219
|
+
"charts.a11y.trendUp": "\u4E0A\u5347",
|
|
206
220
|
"charts.type.area": "\u9762\u79EF\u56FE",
|
|
207
221
|
"charts.type.donut": "\u73AF\u5F62\u56FE",
|
|
208
222
|
"charts.type.gauge": "\u4EEA\u8868\u76D8",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ContextMenuItem } from './context-menu.
|
|
2
|
-
import './icons.
|
|
3
|
-
import './popover.
|
|
1
|
+
import { ContextMenuItem } from './context-menu.mjs';
|
|
2
|
+
import './icons.mjs';
|
|
3
|
+
import './popover.mjs';
|
|
4
4
|
|
|
5
5
|
type TableFrozenSide = 'left' | 'right';
|
|
6
6
|
/** 行分组聚合器:内置五种 + 自定义函数(收数字数组,返回展示串) */
|
|
@@ -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",
|
|
@@ -488,6 +489,19 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
488
489
|
"charts.noData": "\u6682\u65E0\u6570\u636E",
|
|
489
490
|
"charts.resetZoom": "\u91CD\u7F6E\u7F29\u653E",
|
|
490
491
|
"charts.sampled": "\u5DF2\u62BD\u6837 {p0}\u2192{p1} \u70B9",
|
|
492
|
+
"charts.a11y.keyboardHint": "\u65B9\u5411\u952E\u9010\u70B9\u6D4F\u89C8\uFF0CHome/End \u8DF3\u9996\u5C3E\uFF0CEsc \u91CD\u7F6E\u7F29\u653E",
|
|
493
|
+
"charts.a11y.max": "\u6700\u5927 {p0}\uFF08{p1}\uFF09",
|
|
494
|
+
"charts.a11y.min": "\u6700\u5C0F {p0}\uFF08{p1}\uFF09",
|
|
495
|
+
"charts.a11y.point": "{p0}\uFF1A{p1}\uFF0C\u7B2C {p2}/{p3} \u70B9",
|
|
496
|
+
"charts.a11y.pointSeries": "{p0} \xB7 {p1}\uFF1A{p2}\uFF0C\u7B2C {p3}/{p4} \u70B9",
|
|
497
|
+
"charts.a11y.range": "\u7C7B\u76EE {p0} \u81F3 {p1}",
|
|
498
|
+
"charts.a11y.scatterRange": "x \u8303\u56F4 {p0}\u2013{p1}\uFF0Cy \u8303\u56F4 {p2}\u2013{p3}",
|
|
499
|
+
"charts.a11y.seriesCount": "{p0} \u4E2A\u7CFB\u5217",
|
|
500
|
+
"charts.a11y.tableCaption": "{p0} \u6570\u636E\u8868",
|
|
501
|
+
"charts.a11y.trend": "\u9996\u7CFB\u5217\u8D8B\u52BF{p0}",
|
|
502
|
+
"charts.a11y.trendDown": "\u4E0B\u964D",
|
|
503
|
+
"charts.a11y.trendFlat": "\u6301\u5E73",
|
|
504
|
+
"charts.a11y.trendUp": "\u4E0A\u5347",
|
|
491
505
|
"charts.type.area": "\u9762\u79EF\u56FE",
|
|
492
506
|
"charts.type.donut": "\u73AF\u5F62\u56FE",
|
|
493
507
|
"charts.type.gauge": "\u4EEA\u8868\u76D8",
|
|
@@ -1336,7 +1350,13 @@ function onKeyDown(e) {
|
|
|
1336
1350
|
|
|
1337
1351
|
// src/behaviors/datatable.ts
|
|
1338
1352
|
function defaultCompare(a, b) {
|
|
1339
|
-
if (typeof a === "number" && typeof b === "number")
|
|
1353
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
1354
|
+
if (Number.isNaN(a) || Number.isNaN(b)) {
|
|
1355
|
+
if (Number.isNaN(a) && Number.isNaN(b)) return 0;
|
|
1356
|
+
return Number.isNaN(a) ? 1 : -1;
|
|
1357
|
+
}
|
|
1358
|
+
return a - b;
|
|
1359
|
+
}
|
|
1340
1360
|
return String(a ?? "").localeCompare(String(b ?? ""), "zh-CN", { numeric: true });
|
|
1341
1361
|
}
|
|
1342
1362
|
function toNum(v) {
|
|
@@ -1625,11 +1645,13 @@ function createTable(el, opts) {
|
|
|
1625
1645
|
const body = document.createElement("div");
|
|
1626
1646
|
body.className = "icen-dt-body";
|
|
1627
1647
|
body.setAttribute("role", "rowgroup");
|
|
1628
|
-
const summaryEl = document.createElement("div");
|
|
1629
|
-
summaryEl
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1648
|
+
const summaryEl = opts.summaryRow ? document.createElement("div") : null;
|
|
1649
|
+
if (summaryEl) {
|
|
1650
|
+
summaryEl.className = "icen-dt-row icen-dt-row--summary";
|
|
1651
|
+
summaryEl.setAttribute("role", "row");
|
|
1652
|
+
summaryEl.hidden = true;
|
|
1653
|
+
}
|
|
1654
|
+
canvas.append(head, body, ...summaryEl ? [summaryEl] : []);
|
|
1633
1655
|
scroll.appendChild(canvas);
|
|
1634
1656
|
root.appendChild(scroll);
|
|
1635
1657
|
const foot = document.createElement("div");
|
|
@@ -2443,6 +2465,7 @@ function createTable(el, opts) {
|
|
|
2443
2465
|
return wrap;
|
|
2444
2466
|
}
|
|
2445
2467
|
function renderSummary() {
|
|
2468
|
+
if (!summaryEl) return;
|
|
2446
2469
|
summaryEl.textContent = "";
|
|
2447
2470
|
summaryEl.hidden = true;
|
|
2448
2471
|
const cfg = opts.summaryRow;
|
|
@@ -2639,9 +2662,9 @@ function createTable(el, opts) {
|
|
|
2639
2662
|
}
|
|
2640
2663
|
}
|
|
2641
2664
|
let currentTotal = 0;
|
|
2642
|
-
function visibleRange(total) {
|
|
2665
|
+
function visibleRange(total, avail) {
|
|
2643
2666
|
if (!virtual) {
|
|
2644
|
-
if (opts.remote || opts.pagination === false) return [0, total];
|
|
2667
|
+
if (opts.remote || opts.pagination === false) return [0, Math.min(total, avail)];
|
|
2645
2668
|
const start2 = (page - 1) * pageSize;
|
|
2646
2669
|
return [start2, Math.min(total, start2 + pageSize)];
|
|
2647
2670
|
}
|
|
@@ -2656,6 +2679,10 @@ function createTable(el, opts) {
|
|
|
2656
2679
|
const rows = pipeline();
|
|
2657
2680
|
const entries = groupFn ? flatEntries() : null;
|
|
2658
2681
|
const total = entries ? entries.length : opts.remote ? opts.totalCount ?? data.length : rows.length;
|
|
2682
|
+
if (!opts.remote && opts.pagination !== false) {
|
|
2683
|
+
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
2684
|
+
if (page > pages) page = pages;
|
|
2685
|
+
}
|
|
2659
2686
|
navTotal = entries ? entries.length : rows.length;
|
|
2660
2687
|
currentTotal = total;
|
|
2661
2688
|
const keepTop = virtual ? scroll.scrollTop : 0;
|
|
@@ -2684,7 +2711,7 @@ function createTable(el, opts) {
|
|
|
2684
2711
|
renderSummary();
|
|
2685
2712
|
return;
|
|
2686
2713
|
}
|
|
2687
|
-
const [start, end] = visibleRange(total);
|
|
2714
|
+
const [start, end] = visibleRange(total, rows.length);
|
|
2688
2715
|
const frag = document.createDocumentFragment();
|
|
2689
2716
|
const offsets = frozenOffsets();
|
|
2690
2717
|
if (virtual && start > 0) {
|
|
@@ -2747,11 +2774,21 @@ function createTable(el, opts) {
|
|
|
2747
2774
|
const pages = Math.ceil(total / pageSize);
|
|
2748
2775
|
const pager = document.createElement("nav");
|
|
2749
2776
|
pager.className = "icen-dt-pager";
|
|
2750
|
-
|
|
2777
|
+
{
|
|
2778
|
+
const base = t("datatable.paginationAria");
|
|
2779
|
+
const used = /* @__PURE__ */ new Set();
|
|
2780
|
+
for (const el2 of document.querySelectorAll(".icen-dt-pager[aria-label]")) {
|
|
2781
|
+
if (!root.contains(el2)) used.add(el2.getAttribute("aria-label") ?? "");
|
|
2782
|
+
}
|
|
2783
|
+
let label = base, n = 2;
|
|
2784
|
+
while (used.has(label)) label = `${base} ${n++}`;
|
|
2785
|
+
pager.setAttribute("aria-label", label);
|
|
2786
|
+
}
|
|
2751
2787
|
const sizeSel = document.createElement("select");
|
|
2752
2788
|
sizeSel.className = "icen-dt-page-size";
|
|
2753
2789
|
sizeSel.setAttribute("aria-label", t("datatable.pageSizeAria"));
|
|
2754
|
-
|
|
2790
|
+
const sizeOptions = pageSizes.includes(pageSize) ? pageSizes : [...pageSizes, pageSize].sort((a, b) => a - b);
|
|
2791
|
+
for (const s of sizeOptions) {
|
|
2755
2792
|
const o = document.createElement("option");
|
|
2756
2793
|
o.value = String(s);
|
|
2757
2794
|
o.textContent = t("pagination.pageSize", { p0: s });
|
|
@@ -2843,6 +2880,7 @@ function createTable(el, opts) {
|
|
|
2843
2880
|
if (destroyed) return;
|
|
2844
2881
|
renderHead();
|
|
2845
2882
|
renderBody();
|
|
2883
|
+
syncFrozenWidths();
|
|
2846
2884
|
}
|
|
2847
2885
|
rekey();
|
|
2848
2886
|
renderAll();
|
|
@@ -2863,12 +2901,52 @@ function createTable(el, opts) {
|
|
|
2863
2901
|
opts.onPageChange?.(page, pageSize);
|
|
2864
2902
|
renderAll();
|
|
2865
2903
|
}
|
|
2904
|
+
function hasFluidFrozen() {
|
|
2905
|
+
return cols().some((c) => frozenSide(c) != null && !/^(\d+(?:\.\d+)?)px/.test(colWidths.get(c.key) ?? c.width ?? ""));
|
|
2906
|
+
}
|
|
2907
|
+
function syncFrozenWidths() {
|
|
2908
|
+
if (!hasFluidFrozen()) return;
|
|
2909
|
+
const visible = cols();
|
|
2910
|
+
const headCells = Array.from(headRow.children);
|
|
2911
|
+
const lead = headCells.length - visible.length;
|
|
2912
|
+
const left = /* @__PURE__ */ new Map();
|
|
2913
|
+
const right = /* @__PURE__ */ new Map();
|
|
2914
|
+
let acc = headCells.slice(0, lead).reduce((s, c) => s + c.offsetWidth, 0);
|
|
2915
|
+
for (let i = 0; i < visible.length; i++) {
|
|
2916
|
+
const c = visible[i];
|
|
2917
|
+
if (frozenSide(c) === "left") left.set(c.key, acc);
|
|
2918
|
+
acc += headCells[lead + i]?.offsetWidth ?? 0;
|
|
2919
|
+
}
|
|
2920
|
+
let accR = 0;
|
|
2921
|
+
for (let i = visible.length - 1; i >= 0; i--) {
|
|
2922
|
+
const c = visible[i];
|
|
2923
|
+
if (frozenSide(c) === "right") right.set(c.key, accR);
|
|
2924
|
+
accR += headCells[lead + i]?.offsetWidth ?? 0;
|
|
2925
|
+
}
|
|
2926
|
+
const rows = [headRow, ...summaryEl ? [summaryEl] : [], ...Array.from(body.querySelectorAll(".icen-dt-row"))];
|
|
2927
|
+
for (const row of rows) {
|
|
2928
|
+
const cells = Array.from(row.children);
|
|
2929
|
+
if (cells.length !== headCells.length) continue;
|
|
2930
|
+
cells.forEach((cell, i) => {
|
|
2931
|
+
const col = i >= lead ? visible[i - lead] : void 0;
|
|
2932
|
+
if (!col) return;
|
|
2933
|
+
const l = left.get(col.key);
|
|
2934
|
+
if (l != null && cell.classList.contains("icen-dt-cell--frozen")) cell.style.left = `${l}px`;
|
|
2935
|
+
const r = right.get(col.key);
|
|
2936
|
+
if (r != null && cell.classList.contains("icen-dt-cell--frozen-right")) cell.style.right = `${r}px`;
|
|
2937
|
+
});
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2866
2940
|
return {
|
|
2867
2941
|
setPage,
|
|
2868
2942
|
setPageSize,
|
|
2869
2943
|
setData(next) {
|
|
2870
2944
|
if (editing) cancelEdit(true);
|
|
2871
2945
|
data = next;
|
|
2946
|
+
if (typeof opts.rowKey !== "function" && typeof opts.rowKey !== "string" && selected.size > 0) {
|
|
2947
|
+
selected.clear();
|
|
2948
|
+
emitSelection();
|
|
2949
|
+
}
|
|
2872
2950
|
rekey();
|
|
2873
2951
|
invalidate();
|
|
2874
2952
|
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",
|
|
@@ -464,6 +465,19 @@ var ICEN_LOCALE_ZH_CN = {
|
|
|
464
465
|
"charts.noData": "\u6682\u65E0\u6570\u636E",
|
|
465
466
|
"charts.resetZoom": "\u91CD\u7F6E\u7F29\u653E",
|
|
466
467
|
"charts.sampled": "\u5DF2\u62BD\u6837 {p0}\u2192{p1} \u70B9",
|
|
468
|
+
"charts.a11y.keyboardHint": "\u65B9\u5411\u952E\u9010\u70B9\u6D4F\u89C8\uFF0CHome/End \u8DF3\u9996\u5C3E\uFF0CEsc \u91CD\u7F6E\u7F29\u653E",
|
|
469
|
+
"charts.a11y.max": "\u6700\u5927 {p0}\uFF08{p1}\uFF09",
|
|
470
|
+
"charts.a11y.min": "\u6700\u5C0F {p0}\uFF08{p1}\uFF09",
|
|
471
|
+
"charts.a11y.point": "{p0}\uFF1A{p1}\uFF0C\u7B2C {p2}/{p3} \u70B9",
|
|
472
|
+
"charts.a11y.pointSeries": "{p0} \xB7 {p1}\uFF1A{p2}\uFF0C\u7B2C {p3}/{p4} \u70B9",
|
|
473
|
+
"charts.a11y.range": "\u7C7B\u76EE {p0} \u81F3 {p1}",
|
|
474
|
+
"charts.a11y.scatterRange": "x \u8303\u56F4 {p0}\u2013{p1}\uFF0Cy \u8303\u56F4 {p2}\u2013{p3}",
|
|
475
|
+
"charts.a11y.seriesCount": "{p0} \u4E2A\u7CFB\u5217",
|
|
476
|
+
"charts.a11y.tableCaption": "{p0} \u6570\u636E\u8868",
|
|
477
|
+
"charts.a11y.trend": "\u9996\u7CFB\u5217\u8D8B\u52BF{p0}",
|
|
478
|
+
"charts.a11y.trendDown": "\u4E0B\u964D",
|
|
479
|
+
"charts.a11y.trendFlat": "\u6301\u5E73",
|
|
480
|
+
"charts.a11y.trendUp": "\u4E0A\u5347",
|
|
467
481
|
"charts.type.area": "\u9762\u79EF\u56FE",
|
|
468
482
|
"charts.type.donut": "\u73AF\u5F62\u56FE",
|
|
469
483
|
"charts.type.gauge": "\u4EEA\u8868\u76D8",
|
|
@@ -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 };
|