foucui 2.3.4 → 2.3.5
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/dist/components/FouTable/excelTemplate.d.ts +35 -0
- package/dist/components/FouTree/context.d.ts +23 -0
- package/dist/components/FouTree/types.d.ts +30 -0
- package/dist/foucui.css +1 -1
- package/dist/foucui.js +1675 -1285
- package/dist/foucui.umd.cjs +13 -13
- package/dist/index.d.ts +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type ExcelCellValue = string | number | boolean | Date | null | undefined;
|
|
2
|
+
export type ExcelTemplateTable = {
|
|
3
|
+
/** 工作表名或序号,默认第一张 */
|
|
4
|
+
sheet?: string | number;
|
|
5
|
+
/** 数据起始单元格,如 A6。模板里已有表头时从下一行起填 */
|
|
6
|
+
start: string;
|
|
7
|
+
/** 从左到右对应行对象字段 */
|
|
8
|
+
columns: string[];
|
|
9
|
+
rows: Record<string, unknown>[];
|
|
10
|
+
/** 为 true 时先在 start 写表头,数据从下一行开始 */
|
|
11
|
+
writeHeader?: boolean;
|
|
12
|
+
headers?: string[];
|
|
13
|
+
};
|
|
14
|
+
export type FillExcelTemplateOptions = {
|
|
15
|
+
template: ArrayBuffer | Uint8Array | Blob | File;
|
|
16
|
+
/** 替换单元格里的 {{key}} */
|
|
17
|
+
data?: Record<string, ExcelCellValue>;
|
|
18
|
+
/** 按单元格地址写入,如 { B2: '月报' } */
|
|
19
|
+
cells?: Record<string, ExcelCellValue>;
|
|
20
|
+
tables?: ExcelTemplateTable[];
|
|
21
|
+
};
|
|
22
|
+
export type CreateExcelTemplateOptions = {
|
|
23
|
+
title?: string;
|
|
24
|
+
sheetName?: string;
|
|
25
|
+
headers?: string[];
|
|
26
|
+
filename?: string;
|
|
27
|
+
};
|
|
28
|
+
/** 用表格数据填入手工 Excel 模板:{{占位符}}、指定单元格、从某格起写入行 */
|
|
29
|
+
export declare function fillExcelTemplate(options: FillExcelTemplateOptions): Promise<Uint8Array>;
|
|
30
|
+
export declare function downloadFilledExcel(options: FillExcelTemplateOptions & {
|
|
31
|
+
filename?: string;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
/** 生成一份固定版式模板:标题 / {{title}} {{date}} {{dept}} / 表头,数据从 A6 起填 */
|
|
34
|
+
export declare function createExcelTemplate(options?: CreateExcelTemplateOptions): Promise<Uint8Array>;
|
|
35
|
+
export declare function downloadExcelTemplate(options?: CreateExcelTemplateOptions): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, Ref, Slots } from 'vue';
|
|
2
|
+
import { FouTreeNodeData, FouTreePropsConfig } from './types';
|
|
3
|
+
export interface FouTreeContext {
|
|
4
|
+
resolvedProps: ComputedRef<Required<FouTreePropsConfig>>;
|
|
5
|
+
expandedKeys: Ref<Set<string | number>>;
|
|
6
|
+
currentKey: Ref<string | number | null>;
|
|
7
|
+
highlightCurrent: ComputedRef<boolean>;
|
|
8
|
+
filterText: Ref<string>;
|
|
9
|
+
filterNodeMethod?: (value: string, data: FouTreeNodeData, node: FouTreeNodeData) => boolean;
|
|
10
|
+
showCheckbox: ComputedRef<boolean>;
|
|
11
|
+
showRadio: ComputedRef<boolean>;
|
|
12
|
+
checkedSet: ComputedRef<Set<string | number>>;
|
|
13
|
+
halfSet: ComputedRef<Set<string | number>>;
|
|
14
|
+
radioKey: ComputedRef<string | number | null>;
|
|
15
|
+
showContextMenu: ComputedRef<boolean>;
|
|
16
|
+
slots: Slots;
|
|
17
|
+
toggleExpand: (key: string | number) => void;
|
|
18
|
+
onNodeClick: (data: FouTreeNodeData) => void;
|
|
19
|
+
toggleCheck: (data: FouTreeNodeData) => void;
|
|
20
|
+
toggleRadio: (data: FouTreeNodeData) => void;
|
|
21
|
+
onContextMenu: (e: MouseEvent, data: FouTreeNodeData | null) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const FOU_TREE_KEY: InjectionKey<FouTreeContext>;
|
|
@@ -1,13 +1,43 @@
|
|
|
1
1
|
export interface FouTreeNodeData {
|
|
2
2
|
[key: string]: unknown;
|
|
3
3
|
children?: FouTreeNodeData[];
|
|
4
|
+
disabled?: boolean;
|
|
4
5
|
}
|
|
5
6
|
export interface FouTreePropsConfig {
|
|
6
7
|
label?: string;
|
|
7
8
|
children?: string;
|
|
8
9
|
value?: string;
|
|
10
|
+
disabled?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FouTreeMenuItem {
|
|
13
|
+
label?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
shortcut?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
command?: string | number;
|
|
18
|
+
divider?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface FouTreeCheckPayload {
|
|
21
|
+
node: FouTreeNodeData;
|
|
22
|
+
checked: boolean;
|
|
23
|
+
checkedKeys: Array<string | number>;
|
|
24
|
+
halfCheckedKeys: Array<string | number>;
|
|
25
|
+
}
|
|
26
|
+
export interface FouTreeLocated {
|
|
27
|
+
node: FouTreeNodeData;
|
|
28
|
+
parent: FouTreeNodeData | null;
|
|
29
|
+
list: FouTreeNodeData[];
|
|
30
|
+
index: number;
|
|
9
31
|
}
|
|
10
32
|
export declare const defaultTreeProps: Required<FouTreePropsConfig>;
|
|
33
|
+
export declare const defaultTreeMenuItems: FouTreeMenuItem[];
|
|
11
34
|
export declare function getNodeKey(node: FouTreeNodeData, config: FouTreePropsConfig): string | number;
|
|
12
35
|
export declare function getNodeLabel(node: FouTreeNodeData, config: FouTreePropsConfig): string;
|
|
13
36
|
export declare function getNodeChildren(node: FouTreeNodeData, config: FouTreePropsConfig): FouTreeNodeData[];
|
|
37
|
+
export declare function isNodeDisabled(node: FouTreeNodeData, config: FouTreePropsConfig): boolean;
|
|
38
|
+
export declare function walkNodes(nodes: FouTreeNodeData[], config: FouTreePropsConfig, fn: (node: FouTreeNodeData, parent: FouTreeNodeData | null) => void, parent?: FouTreeNodeData | null): void;
|
|
39
|
+
export declare function collectKeys(nodes: FouTreeNodeData[], config: FouTreePropsConfig): (string | number)[];
|
|
40
|
+
export declare function collectDescendantKeys(node: FouTreeNodeData, config: FouTreePropsConfig): (string | number)[];
|
|
41
|
+
export declare function findNodeLocation(nodes: FouTreeNodeData[], key: string | number, config: FouTreePropsConfig, parent?: FouTreeNodeData | null): FouTreeLocated | null;
|
|
42
|
+
export declare function createTreeNode(config: FouTreePropsConfig, extra?: Record<string, unknown>): FouTreeNodeData;
|
|
43
|
+
export declare function ensureChildren(node: FouTreeNodeData, config: FouTreePropsConfig): FouTreeNodeData[];
|