@farris/x-ui 0.5.3 → 0.5.4
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/farris.x-ui.esm.js +6869 -6645
- package/farris.x-ui.umd.cjs +84 -83
- package/index.css +1 -1
- package/markdown/src/composition/table-card-renderer.d.ts +39 -0
- package/markdown/src/composition/table-to-tsv.d.ts +11 -0
- package/markdown/src/composition/write-text-to-clipboard.d.ts +8 -0
- package/markdown/test/markdown-table-card.spec.d.ts +1 -0
- package/package.json +1 -1
- package/popover/src/popover.component.d.ts +3 -0
- package/popover/src/popover.props.d.ts +9 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as MarkdownIt } from '../../../../markdown-it';
|
|
2
|
+
|
|
3
|
+
/** 表格卡片根节点属性,事件委托据此定位卡片 */
|
|
4
|
+
export declare const TABLE_CARD_ATTRIBUTE = "data-table-card";
|
|
5
|
+
/** 表格卡片操作按钮属性,取值为动作标识 */
|
|
6
|
+
export declare const TABLE_CARD_ACTION_ATTRIBUTE = "data-table-card-action";
|
|
7
|
+
/** 表格卡片导航区标题文案 */
|
|
8
|
+
export declare const TABLE_CARD_TITLE = "\u8868\u683C";
|
|
9
|
+
/** 复制动作标识(卡片导航区与最大化预览顶部栏共用) */
|
|
10
|
+
export declare const TABLE_CARD_COPY_ACTION = "copy";
|
|
11
|
+
/** 最大化动作标识 */
|
|
12
|
+
export declare const TABLE_CARD_MAXIMIZE_ACTION = "maximize";
|
|
13
|
+
/** 关闭最大化动作标识,仅用于最大化预览顶部栏 */
|
|
14
|
+
export declare const TABLE_CARD_CLOSE_ACTION = "close";
|
|
15
|
+
/** 复制成功反馈态属性 */
|
|
16
|
+
export declare const TABLE_CARD_COPIED_ATTRIBUTE = "data-copied";
|
|
17
|
+
/** 复制成功反馈持续时长(毫秒) */
|
|
18
|
+
export declare const TABLE_CARD_COPY_FEEDBACK_MS = 1500;
|
|
19
|
+
/**
|
|
20
|
+
* 最大化预览右上角的浮层按钮:复制在左、关闭最大化在右。
|
|
21
|
+
*
|
|
22
|
+
* 关闭按钮沿用图片预览的图标字体字形,保证两处全屏预览的关闭入口完全一致;
|
|
23
|
+
* 交互由组件在按钮容器上做事件委托处理。
|
|
24
|
+
*/
|
|
25
|
+
export declare const TABLE_CARD_PREVIEW_ACTIONS_HTML: string;
|
|
26
|
+
/**
|
|
27
|
+
* 让 Markdown 表格渲染为「圆角卡片 + 导航区(标题 + 复制/最大化)」。
|
|
28
|
+
*
|
|
29
|
+
* 实现只在 `table_open` / `table_close` 两侧加壳,`<table>` 自身 HTML 完全交由
|
|
30
|
+
* markdown-it 默认渲染,因此表格语义与既有样式钩子保持不变;又因为所有使用位
|
|
31
|
+
* 都经过同一个 `FXMarkdown`,卡片行为对调用方零改动即可全局生效。
|
|
32
|
+
*
|
|
33
|
+
* 卡片容器同时承担表格外框职责(表格单元格只画右侧与下侧边线),因此最大化预览
|
|
34
|
+
* 必须为 `<table>` 提供带描边的容器,否则表格四周的边线会缺失。
|
|
35
|
+
*
|
|
36
|
+
* 导航区处于 `innerHTML` 注入的子树内,无法挂载 Vue 子组件,交互由组件在内容
|
|
37
|
+
* 容器与预览容器上做事件委托处理(见 `markdown.component.tsx`)。
|
|
38
|
+
*/
|
|
39
|
+
export declare function applyTableCardRenderer(md: MarkdownIt): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 把表格序列化为 TSV 纯文本,便于直接粘贴到 Excel / WPS 自动分列。
|
|
3
|
+
*
|
|
4
|
+
* 规整规则:
|
|
5
|
+
* - 单元格文本取 `textContent`,把换行符与制表符折叠为单个空格后去除首尾空白;
|
|
6
|
+
* - 带 `colspan` 的单元格按跨列数补足空单元格占位,保证每行列数一致;
|
|
7
|
+
* - 行内以制表符连接、行间以换行符连接,末尾不追加换行。
|
|
8
|
+
*
|
|
9
|
+
* 已知限制:`rowspan` 不会补齐被占用的下方单元格,复制结果可能与该列错位。
|
|
10
|
+
*/
|
|
11
|
+
export declare function tableToTsv(table: HTMLTableElement): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ declare const _default: import('../../../vue').DefineComponent<{
|
|
|
17
17
|
enableDrag: boolean;
|
|
18
18
|
renderWhenShown: boolean;
|
|
19
19
|
hideOnResize: boolean;
|
|
20
|
+
autoFlip: boolean;
|
|
20
21
|
title?: string | undefined;
|
|
21
22
|
id?: string | undefined;
|
|
22
23
|
host?: any;
|
|
@@ -43,6 +44,7 @@ declare const _default: import('../../../vue').DefineComponent<{
|
|
|
43
44
|
enableDrag: boolean;
|
|
44
45
|
renderWhenShown: boolean;
|
|
45
46
|
hideOnResize: boolean;
|
|
47
|
+
autoFlip: boolean;
|
|
46
48
|
title?: string | undefined;
|
|
47
49
|
id?: string | undefined;
|
|
48
50
|
host?: any;
|
|
@@ -69,5 +71,6 @@ declare const _default: import('../../../vue').DefineComponent<{
|
|
|
69
71
|
enableDrag: boolean;
|
|
70
72
|
renderWhenShown: boolean;
|
|
71
73
|
hideOnResize: boolean;
|
|
74
|
+
autoFlip: boolean;
|
|
72
75
|
}, {}, {}, {}, string, import('../../../vue').ComponentProvideOptions, true, {}, any>;
|
|
73
76
|
export default _default;
|
|
@@ -132,5 +132,14 @@ export declare const popoverProps: {
|
|
|
132
132
|
type: BooleanConstructor;
|
|
133
133
|
default: boolean;
|
|
134
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* 空间不足时是否自动垂直翻转到参照元素另一侧。
|
|
137
|
+
* 仅对固定方向(如 bottom / bottom-right)生效;默认 false,保持固定方向不翻转。
|
|
138
|
+
* 开启后,下方空间不足则翻转到上方(保持水平对齐不变)。
|
|
139
|
+
*/
|
|
140
|
+
autoFlip: {
|
|
141
|
+
type: BooleanConstructor;
|
|
142
|
+
default: boolean;
|
|
143
|
+
};
|
|
135
144
|
};
|
|
136
145
|
export type PopoverProps = ExtractPropTypes<typeof popoverProps>;
|