@wx-design/components 1.4.10 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wx-design/components",
3
- "version": "1.4.10",
3
+ "version": "1.5.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
package/types/index.d.ts CHANGED
@@ -1,31 +1,43 @@
1
- import { VxeTablePropTypes } from 'vxe-table'
2
- import { App, Plugin } from 'vue'
3
- import { SabTable, SabTableSet, SabDesignConfigProvider } from './table'
1
+ import { VxeTablePropTypes } from "vxe-table";
2
+ import { App, Plugin } from "vue";
3
+ import { SabTable, SabTableSet, SabDesignConfigProvider } from "./table";
4
4
 
5
- import { SabSelect } from './select'
6
- import { SabModal } from './modal'
5
+ import { SabSelect } from "./select";
6
+ import { SabModal } from "./modal";
7
+ import { SabInput } from "./input";
7
8
 
8
- export { SabTable, SabTableSet, SabDesignConfigProvider, SabSelect, SabModal }
9
+ export {
10
+ SabTable,
11
+ SabTableSet,
12
+ SabDesignConfigProvider,
13
+ SabSelect,
14
+ SabModal,
15
+ SabInput,
16
+ };
9
17
 
10
- declare module '@vue/runtime-core' {
18
+ declare module "@vue/runtime-core" {
11
19
  export interface GlobalComponents {
12
20
  // 表格
13
- SabTable: typeof SabTable
14
- SabTableSet: typeof SabTableSet
21
+ SabTable: typeof SabTable;
22
+ SabTableSet: typeof SabTableSet;
15
23
 
16
24
  // 下拉选择器
17
- SabSelect: typeof SabSelect
25
+ SabSelect: typeof SabSelect;
26
+
18
27
  // 弹窗
19
- SabModal: typeof SabModal
28
+ SabModal: typeof SabModal;
29
+
30
+ // 输入框
31
+ SabInput: typeof SabInput;
20
32
 
21
33
  // 全局配置项
22
- SabDesignConfigProvider: typeof SabDesignConfigProvider
34
+ SabDesignConfigProvider: typeof SabDesignConfigProvider;
23
35
  }
24
36
  }
25
37
 
26
38
  export namespace SABTable {
27
- export * from './table'
28
- export import SabTablePropTypes = VxeTablePropTypes
39
+ export * from "./table";
40
+ export import SabTablePropTypes = VxeTablePropTypes;
29
41
  }
30
42
 
31
- export const SabUI: Plugin
43
+ export const SabUI: Plugin;
@@ -0,0 +1,83 @@
1
+ import type { SABComponent } from "../common";
2
+
3
+ // 自定义插槽
4
+ export interface SabInputSlots {
5
+ default?(): any;
6
+ prefix?(): any;
7
+ suffix?(): any;
8
+ prepend?(): any;
9
+ append?(): any;
10
+ }
11
+
12
+ // 事件
13
+ export interface SabInputEvents {
14
+ onFocus?(event: FocusEvent): void;
15
+ onBlur?(event: FocusEvent): void;
16
+ onInput?(value: string): void;
17
+ onChange?(value: string): void;
18
+ onClear?(): void;
19
+ onEnter?(event: KeyboardEvent): void;
20
+ }
21
+
22
+ export type SabInputProps = {
23
+ // 浮动标签文本
24
+ label?: string;
25
+ // 占位符(可选,默认使用 label)
26
+ placeholder?: string;
27
+ // 绑定值
28
+ modelValue?: string | number;
29
+ // 禁用状态
30
+ disabled?: boolean;
31
+ // 是否可清空
32
+ clearable?: boolean;
33
+ // 显示密码切换按钮
34
+ showPassword?: boolean;
35
+ // 输入框类型
36
+ type?: "text" | "textarea" | "password" | "number" | "email" | "url" | "tel" | "search";
37
+ // 输入框尺寸
38
+ size?: "large" | "default" | "small";
39
+ // 最大长度
40
+ maxlength?: number;
41
+ // 最小长度
42
+ minlength?: number;
43
+ // 是否显示字数统计
44
+ showWordLimit?: boolean;
45
+ // 是否必填
46
+ required?: boolean;
47
+ // 是否显示必填标记
48
+ showRequiredMark?: boolean;
49
+ // 是否只读
50
+ readonly?: boolean;
51
+ // 自定义前缀图标
52
+ prefixIcon?: string | any;
53
+ // 自定义后缀图标
54
+ suffixIcon?: string | any;
55
+ // 前置内容
56
+ prepend?: string;
57
+ // 后置内容
58
+ append?: string;
59
+ // 最大值(type=number时有效)
60
+ max?: number;
61
+ // 最小值(type=number时有效)
62
+ min?: number;
63
+ // 步长(type=number时有效)
64
+ step?: number;
65
+ // 是否显示必填标记
66
+ validateEvent?: boolean;
67
+ // 输入框唯一标识
68
+ name?: string;
69
+ // 行数(type=textarea时有效)
70
+ rows?: number;
71
+ // 是否自适应内容高度(type=textarea时有效)
72
+ autosize?: boolean | { minRows?: number; maxRows?: number };
73
+ // 自动补全
74
+ autocomplete?: string;
75
+ // 输入框样式类名
76
+ class?: string;
77
+ // 输入框包裹器样式类名
78
+ wrapperClass?: string;
79
+ // 是否显示标签
80
+ showLabel?: boolean;
81
+ };
82
+
83
+ export const SabInput: SABComponent<SabInputProps, SabInputEvents, SabInputSlots>;