@hengdian-tech/components-vue2 1.0.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/index.cjs.js +4 -0
- package/dist/index.es.js +1359 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/src/_adapter/index.d.ts +115 -0
- package/dist/types/src/components/base-button/props.d.ts +31 -0
- package/dist/types/src/components/base-button-group/props.d.ts +26 -0
- package/dist/types/src/components/base-card/props.d.ts +24 -0
- package/dist/types/src/components/base-container/props.d.ts +26 -0
- package/dist/types/src/components/base-descriptions/props.d.ts +35 -0
- package/dist/types/src/components/base-dialog/props.d.ts +47 -0
- package/dist/types/src/components/base-divider/props.d.ts +18 -0
- package/dist/types/src/components/base-menu/props.d.ts +14 -0
- package/dist/types/src/components/base-pagination/props.d.ts +28 -0
- package/dist/types/src/components/base-search-bar/props.d.ts +43 -0
- package/dist/types/src/components/base-table/props.d.ts +57 -0
- package/dist/types/src/components/base-tabs/props.d.ts +30 -0
- package/dist/types/src/components/base-tag/props.d.ts +29 -0
- package/dist/types/src/components/base-title/props.d.ts +19 -0
- package/dist/types/src/components/saber-avue-form/index.d.ts +47 -0
- package/dist/types/src/components/saber-avue-form/props.d.ts +14 -0
- package/dist/types/src/components/saber-form-tip/props.d.ts +16 -0
- package/dist/types/src/index.d.ts +63 -0
- package/package.json +60 -0
- package/types/shims-vue.d.ts +14 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SaberAvueForm — Avue 表单统一封装组件
|
|
3
|
+
*
|
|
4
|
+
* 基于 avue-form 二次封装,提供 Saber 设计规范预设:
|
|
5
|
+
* - size="small"(控件高度 32px)
|
|
6
|
+
* - label-width="128px"(标签宽度)
|
|
7
|
+
* - 统一样式、间距、错误提示、说明图标区域
|
|
8
|
+
*
|
|
9
|
+
* 扩展列配置能力(保留原 avue-form 所有配置):
|
|
10
|
+
* - hasTip(Boolean):是否在表单项内容区右侧显示说明图标
|
|
11
|
+
* - tip(String):说明图标 hover 时的 tooltip 文本
|
|
12
|
+
*
|
|
13
|
+
* 前置条件:消费方项目必须全局注册 avue-form 组件(来自 @smallwei/avue)。
|
|
14
|
+
*/
|
|
15
|
+
declare const _default: {
|
|
16
|
+
name: string;
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: ObjectConstructor;
|
|
20
|
+
default: () => {};
|
|
21
|
+
};
|
|
22
|
+
column: {
|
|
23
|
+
type: ArrayConstructor;
|
|
24
|
+
default: () => never[];
|
|
25
|
+
};
|
|
26
|
+
labelWidth: {
|
|
27
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
size: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
validator: (v: string) => boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
emits: string[];
|
|
37
|
+
data(): {
|
|
38
|
+
avueFormRegistered: boolean;
|
|
39
|
+
};
|
|
40
|
+
computed: {
|
|
41
|
+
processedColumns(this: any): any[];
|
|
42
|
+
mergedBind(this: any): Record<string, any>;
|
|
43
|
+
};
|
|
44
|
+
created(this: any): void;
|
|
45
|
+
render(this: any, h: any): any;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SaberAvueForm — Props 类型镜像(C3 公共类型导出)
|
|
3
|
+
* 运行时以 index.ts 的 props 对象为准。
|
|
4
|
+
*/
|
|
5
|
+
export interface SaberAvueFormProps {
|
|
6
|
+
/** v-model 绑定值 — 表单数据对象 */
|
|
7
|
+
modelValue?: Record<string, any>;
|
|
8
|
+
/** 列配置数组(支持 hasTip / tip 扩展,保留 avue-form 全部配置) */
|
|
9
|
+
column?: any[];
|
|
10
|
+
/** 标签宽度 */
|
|
11
|
+
labelWidth?: string | number;
|
|
12
|
+
/** 控件尺寸 */
|
|
13
|
+
size?: 'small' | 'default' | 'large';
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SaberFormTip — Props 类型镜像(C3 公共类型导出)
|
|
3
|
+
* 运行时以 index.vue 的 props 对象为准。
|
|
4
|
+
*/
|
|
5
|
+
export interface SaberFormTipProps {
|
|
6
|
+
/** 提示文字内容(为空时不显示 tooltip) */
|
|
7
|
+
content?: string;
|
|
8
|
+
/** tooltip 弹出位置,默认 right */
|
|
9
|
+
placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
10
|
+
/** tooltip 主题,默认 light */
|
|
11
|
+
effect?: 'dark' | 'light';
|
|
12
|
+
/** 自定义 popper 类名 */
|
|
13
|
+
popperClass?: string;
|
|
14
|
+
/** 自定义 tip 容器类名 */
|
|
15
|
+
tipClass?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hengdian-tech/components-vue2 — Vue 2 + Element UI 入口
|
|
3
|
+
*
|
|
4
|
+
* 与 @hengdian-tech/components-vue3 保持完全相同的导出签名,业务组件无感知。
|
|
5
|
+
*
|
|
6
|
+
* 分类索引:
|
|
7
|
+
* - 布局容器类 : BaseCard, BaseContainer, BaseDivider
|
|
8
|
+
* - 表单组件类 : SaberFormTip, SaberAvueForm
|
|
9
|
+
* - 按钮 & 操作类 : BaseButton, BaseButtonGroup
|
|
10
|
+
* - 数据展示类 : BaseTag, BaseTitle
|
|
11
|
+
* - 弹窗 & 反馈类 : BaseDialog
|
|
12
|
+
* - 导航 & 菜单类 : BaseTabs, BaseMenu
|
|
13
|
+
* - 分页类 : BasePagination
|
|
14
|
+
* - 表格 & 列表类 : BaseTable, BaseDescriptions
|
|
15
|
+
* - 高阶业务组件 : BaseSearchBar
|
|
16
|
+
*/
|
|
17
|
+
import '@hengdian-tech/theme';
|
|
18
|
+
import type { VueConstructor } from 'vue';
|
|
19
|
+
import BaseCard from './components/base-card/index.vue';
|
|
20
|
+
import BaseContainer from './components/base-container/index.vue';
|
|
21
|
+
import BaseDivider from './components/base-divider/index.vue';
|
|
22
|
+
import BaseButton from './components/base-button/index.vue';
|
|
23
|
+
import BaseButtonGroup from './components/base-button-group/index.vue';
|
|
24
|
+
import BaseTag from './components/base-tag/index.vue';
|
|
25
|
+
import BaseTitle from './components/base-title/index.vue';
|
|
26
|
+
import BaseDialog from './components/base-dialog/index.vue';
|
|
27
|
+
import BaseTable from './components/base-table/index.vue';
|
|
28
|
+
import BaseDescriptions from './components/base-descriptions/index.vue';
|
|
29
|
+
import BaseTabs from './components/base-tabs/index.vue';
|
|
30
|
+
import BaseMenu from './components/base-menu/index.vue';
|
|
31
|
+
import BasePagination from './components/base-pagination/index.vue';
|
|
32
|
+
import SaberFormTip from './components/saber-form-tip/index.vue';
|
|
33
|
+
import SaberAvueForm from './components/saber-avue-form/index';
|
|
34
|
+
import BaseSearchBar from './components/base-search-bar/index.vue';
|
|
35
|
+
export { BaseCard, BaseContainer, BaseDivider, BaseButton, BaseButtonGroup, BaseTag, BaseTitle, BaseDialog, BaseTable, BaseDescriptions, BaseTabs, BaseMenu, BasePagination, SaberFormTip, SaberAvueForm, BaseSearchBar, };
|
|
36
|
+
export type { BaseButtonProps } from './components/base-button/props';
|
|
37
|
+
export type { BaseButtonGroupProps } from './components/base-button-group/props';
|
|
38
|
+
export type { BaseCardProps } from './components/base-card/props';
|
|
39
|
+
export type { BaseContainerProps } from './components/base-container/props';
|
|
40
|
+
export type { BaseDescriptionsOption, BaseDescriptionsProps } from './components/base-descriptions/props';
|
|
41
|
+
export type { BaseDialogProps } from './components/base-dialog/props';
|
|
42
|
+
export type { BaseDividerProps } from './components/base-divider/props';
|
|
43
|
+
export type { BaseMenuProps } from './components/base-menu/props';
|
|
44
|
+
export type { BasePaginationProps } from './components/base-pagination/props';
|
|
45
|
+
export type { BaseSearchBarProps, SearchBarOption } from './components/base-search-bar/props';
|
|
46
|
+
export type { BaseTableProps, TableColumn } from './components/base-table/props';
|
|
47
|
+
export type { BaseTabsOption, BaseTabsProps } from './components/base-tabs/props';
|
|
48
|
+
export type { BaseTagProps } from './components/base-tag/props';
|
|
49
|
+
export type { BaseTitleProps } from './components/base-title/props';
|
|
50
|
+
export type { SaberFormTipProps } from './components/saber-form-tip/props';
|
|
51
|
+
export type { SaberAvueFormProps } from './components/saber-avue-form/props';
|
|
52
|
+
/**
|
|
53
|
+
* 插件安装器:一次性全局注册所有组件
|
|
54
|
+
*
|
|
55
|
+
* 先注册 @vue/composition-api(Vue 2.6 无内建 composition API,2.7 上为安全 no-op)。
|
|
56
|
+
* 幂等保护:标记打在 Vue 构造器上,即使包被实例化多份也只注册一次。
|
|
57
|
+
*/
|
|
58
|
+
export declare function install(Vue: VueConstructor): void;
|
|
59
|
+
/** 兼容 Vue 插件形式 (app.use) */
|
|
60
|
+
declare const _default: {
|
|
61
|
+
install: typeof install;
|
|
62
|
+
};
|
|
63
|
+
export default _default;
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hengdian-tech/components-vue2",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Saber UI 组件库(Vue 2.6.10+ / Element UI)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vue",
|
|
7
|
+
"vue2",
|
|
8
|
+
"element-ui",
|
|
9
|
+
"components",
|
|
10
|
+
"ui"
|
|
11
|
+
],
|
|
12
|
+
"author": "Hengdian Tech",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"main": "dist/index.cjs.js",
|
|
15
|
+
"module": "dist/index.es.js",
|
|
16
|
+
"style": "dist/style.css",
|
|
17
|
+
"types": "dist/types/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/types/index.d.ts",
|
|
21
|
+
"import": "./dist/index.es.js",
|
|
22
|
+
"require": "./dist/index.cjs.js",
|
|
23
|
+
"default": "./dist/index.es.js"
|
|
24
|
+
},
|
|
25
|
+
"./style.css": "./dist/style.css"
|
|
26
|
+
},
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"*.css"
|
|
29
|
+
],
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"types"
|
|
33
|
+
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@vue/composition-api": "^1.7.2",
|
|
39
|
+
"@hengdian-tech/theme": "^1.0.4"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"element-ui": "^2.15.0",
|
|
43
|
+
"vue": "^2.6.10"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@vitejs/plugin-vue2": "^2.3.4",
|
|
47
|
+
"@vue/compiler-sfc": "2.7.16",
|
|
48
|
+
"@vue/composition-api": "^1.7.2",
|
|
49
|
+
"element-ui": "^2.15.0",
|
|
50
|
+
"sass": "^1.85.0",
|
|
51
|
+
"typescript": "^5.4.0",
|
|
52
|
+
"vite": "^4.5.0",
|
|
53
|
+
"vue": "2.6.10"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "vite build && pnpm run build:types",
|
|
57
|
+
"build:types": "node scripts/gen-types.mjs",
|
|
58
|
+
"dev": "vite build --watch"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue 2 单文件组件(.vue)类型声明 shim
|
|
3
|
+
*
|
|
4
|
+
* 本包类型管线为纯 tsc(Vue 2.6.10 类型环境,不解析 SFC 内部结构),
|
|
5
|
+
* 组件类型统一收敛为 Vue 实例 —— 组件 Props 精确类型请以
|
|
6
|
+
* 双端各自的 Props 接口为准(C3 公共类型 API 会显式导出)。
|
|
7
|
+
*
|
|
8
|
+
* - vue-cli 项目:自带 shims-vue.d.ts,无需任何操作
|
|
9
|
+
* - 非 vue-cli 项目(webpack 自配 / vite 等):把本文件复制到项目 src/ 下
|
|
10
|
+
*/
|
|
11
|
+
declare module '*.vue' {
|
|
12
|
+
import Vue from 'vue'
|
|
13
|
+
export default Vue
|
|
14
|
+
}
|