@fcurd/naive-ui 0.1.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/dist/adapter.d.ts +70 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/controls/index.d.ts +6 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1094 -0
- package/dist/naive-ui.css +1 -0
- package/dist/render/cell/format.d.ts +31 -0
- package/dist/render/cell/index.d.ts +6 -0
- package/dist/render/cell/inspect.d.ts +18 -0
- package/dist/render/cell/media.d.ts +19 -0
- package/dist/render/cell/shared.d.ts +9 -0
- package/dist/render/cell/tag.d.ts +61 -0
- package/dist/render/cell/text.d.ts +22 -0
- package/dist/render/index.d.ts +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.crud-form__footer[data-v-0bca27a9]{margin-top:24px}.crud-search[data-v-e009ac6b]{margin-bottom:16px}.crud-table__header[data-v-0a031491]{margin-bottom:12px}.crud-table__pagination[data-v-0a031491]{display:flex;justify-content:flex-end;margin-top:16px}.auto-crud__before-table[data-v-299e1ff1]{margin-bottom:16px}.auto-crud__batch-actions[data-v-299e1ff1]{margin-bottom:12px;padding:8px 12px;background:var(--n-color-hover);border-radius:4px}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CrudTableCellContext } from '@fcurd/core';
|
|
2
|
+
import type { CellRenderFactoryOptions } from './shared';
|
|
3
|
+
export interface CellDateTimeOptions extends CellRenderFactoryOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 解析 value 的方式(默认兼容 Date / timestamp(ms) / ISO string)
|
|
6
|
+
*/
|
|
7
|
+
parse?: (value: unknown) => Date | null;
|
|
8
|
+
/**
|
|
9
|
+
* Intl.DateTimeFormat locales
|
|
10
|
+
* @default 'zh-CN'
|
|
11
|
+
*/
|
|
12
|
+
locale?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 日期/时间格式
|
|
15
|
+
*/
|
|
16
|
+
formatOptions?: Intl.DateTimeFormatOptions;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 日期时间格式化(基于 Intl.DateTimeFormat)
|
|
20
|
+
*/
|
|
21
|
+
export declare function cellDateTime<Row = any>(options?: CellDateTimeOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
22
|
+
export interface CellMoneyOptions extends CellRenderFactoryOptions {
|
|
23
|
+
locale?: string;
|
|
24
|
+
currency?: string;
|
|
25
|
+
minimumFractionDigits?: number;
|
|
26
|
+
maximumFractionDigits?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 金额格式化(基于 Intl.NumberFormat)
|
|
30
|
+
*/
|
|
31
|
+
export declare function cellMoney<Row = any>(options?: CellMoneyOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CrudTableCellContext } from '@fcurd/core';
|
|
2
|
+
import type { PopoverProps } from 'naive-ui';
|
|
3
|
+
import type { CellRenderFactoryOptions } from './shared';
|
|
4
|
+
export interface CellJsonPopoverOptions extends CellRenderFactoryOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Popover 透传
|
|
7
|
+
*/
|
|
8
|
+
popoverProps?: Partial<PopoverProps>;
|
|
9
|
+
/**
|
|
10
|
+
* 触发内容最大长度(用于预览)
|
|
11
|
+
* @default 60
|
|
12
|
+
*/
|
|
13
|
+
previewMaxLen?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* JSON 悬浮预览(NPopover + NCode)
|
|
17
|
+
*/
|
|
18
|
+
export declare function cellJsonPopover<Row = any>(options?: CellJsonPopoverOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CrudTableCellContext } from '@fcurd/core';
|
|
2
|
+
import type { CellRenderFactoryOptions } from './shared';
|
|
3
|
+
export interface CellImageOptions<Row = any> extends CellRenderFactoryOptions {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
/**
|
|
7
|
+
* 图片预览(Naive NImage)
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
previewDisabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 自定义 URL 提取
|
|
13
|
+
*/
|
|
14
|
+
getUrl?: (ctx: CrudTableCellContext<Row>) => string | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 图片缩略图(NImage)
|
|
18
|
+
*/
|
|
19
|
+
export declare function cellImage<Row = any>(options?: CellImageOptions<Row>): (ctx: CrudTableCellContext<Row>) => any;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CrudTableCellContext } from '@fcurd/core';
|
|
2
|
+
import type { TagProps } from 'naive-ui';
|
|
3
|
+
import type { CellRenderFactoryOptions } from './shared';
|
|
4
|
+
export interface CellBooleanTagOptions extends CellRenderFactoryOptions {
|
|
5
|
+
trueText?: string;
|
|
6
|
+
falseText?: string;
|
|
7
|
+
trueType?: TagProps['type'];
|
|
8
|
+
falseType?: TagProps['type'];
|
|
9
|
+
nullText?: string;
|
|
10
|
+
nullType?: TagProps['type'];
|
|
11
|
+
/**
|
|
12
|
+
* Tag 尺寸
|
|
13
|
+
* @default 'small'
|
|
14
|
+
*/
|
|
15
|
+
size?: TagProps['size'];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 布尔值渲染成 Tag(常用于 enabled/disabled)
|
|
19
|
+
*/
|
|
20
|
+
export declare function cellBooleanTag<Row = any>(options?: CellBooleanTagOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
21
|
+
export interface EnumOption {
|
|
22
|
+
value: string | number;
|
|
23
|
+
label: string;
|
|
24
|
+
tagType?: TagProps['type'];
|
|
25
|
+
}
|
|
26
|
+
export interface CellEnumLabelOptions extends CellRenderFactoryOptions {
|
|
27
|
+
/**
|
|
28
|
+
* value -> label 映射(优先级高于 options)
|
|
29
|
+
*/
|
|
30
|
+
map?: Record<string, string> | Record<number, string>;
|
|
31
|
+
/**
|
|
32
|
+
* options(可直接复用 naive-ui 的 SelectOption 结构)
|
|
33
|
+
*/
|
|
34
|
+
options?: {
|
|
35
|
+
value?: any;
|
|
36
|
+
label?: any;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 枚举值渲染成 label(例如 status/category)
|
|
41
|
+
*/
|
|
42
|
+
export declare function cellEnumLabel<Row = any>(options: CellEnumLabelOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
43
|
+
export interface CellEnumTagOptions extends CellEnumLabelOptions {
|
|
44
|
+
/**
|
|
45
|
+
* value -> tagType 映射
|
|
46
|
+
*/
|
|
47
|
+
typeMap?: Record<string, TagProps['type']> | Record<number, TagProps['type']>;
|
|
48
|
+
/**
|
|
49
|
+
* 默认 tagType(当没有匹配时)
|
|
50
|
+
*/
|
|
51
|
+
defaultType?: TagProps['type'];
|
|
52
|
+
/**
|
|
53
|
+
* Tag 尺寸
|
|
54
|
+
* @default 'small'
|
|
55
|
+
*/
|
|
56
|
+
size?: TagProps['size'];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 枚举值渲染成 Tag(例如状态:草稿/启用/禁用)
|
|
60
|
+
*/
|
|
61
|
+
export declare function cellEnumTag<Row = any>(options: CellEnumTagOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CrudTableCellContext } from '@fcurd/core';
|
|
2
|
+
import type { CellRenderFactoryOptions } from './shared';
|
|
3
|
+
/**
|
|
4
|
+
* 纯文本(可选:空值占位)
|
|
5
|
+
*/
|
|
6
|
+
export declare function cellText<Row = any>(options?: CellRenderFactoryOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
7
|
+
export interface CellEllipsisOptions extends CellRenderFactoryOptions {
|
|
8
|
+
/**
|
|
9
|
+
* 行数(1=单行省略)
|
|
10
|
+
* @default 1
|
|
11
|
+
*/
|
|
12
|
+
lineClamp?: number;
|
|
13
|
+
/**
|
|
14
|
+
* hover 时显示 tooltip
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
tooltip?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 省略显示(NEllipsis)
|
|
21
|
+
*/
|
|
22
|
+
export declare function cellEllipsis<Row = any>(options?: CellEllipsisOptions): (ctx: CrudTableCellContext<Row>) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cell';
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fcurd/naive-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/akinoccc/curd-pro-docs.git",
|
|
8
|
+
"directory": "packages/naive-ui"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.mjs",
|
|
17
|
+
"require": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": ["dist"],
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "rimraf dist && vite build && tsc -p tsconfig.build.json"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"vue": "^3.4.0",
|
|
27
|
+
"naive-ui": "^2.43.2",
|
|
28
|
+
"@fcurd/core": "^0.1.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"vue-router": "^4.6.0"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
}
|
|
36
|
+
}
|