@wx-design/components 2.0.0-alpha.10 → 2.0.0-alpha.11

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.
Files changed (55) hide show
  1. package/es/core/ConfigProvider/index.d.ts +109 -3
  2. package/es/core/Input/index.vue.d.ts +1114 -0
  3. package/es/core/Modal/index.vue.d.ts +14 -14
  4. package/es/core/Select/index.vue.d.ts +4 -4
  5. package/es/core/Table/components/CellEditors/Boolean.d.ts +6 -8
  6. package/es/core/Table/components/CellEditors/Select.d.ts +2 -2
  7. package/es/core/Table/components/FilterTagsDisplay/index.vue.d.ts +1 -1
  8. package/es/core/Table/components/TableSet/ColumnSet.vue.d.ts +2 -499
  9. package/es/core/Table/components/TableSet/ColumnSetBody.vue.d.ts +524 -0
  10. package/es/core/Table/components/TableSet/index.vue.d.ts +1 -6
  11. package/es/core/Table/components/TableSet/store.d.ts +11 -0
  12. package/es/core/Table/components/TableSet/utils.d.ts +9 -9
  13. package/es/core/Table/hooks/useTableCore.d.ts +1 -1
  14. package/es/core/Table/hooks/useTableFilters.d.ts +4 -3
  15. package/es/core/Table/index.vue.d.ts +12 -5
  16. package/es/core/Table/store.d.ts +4 -0
  17. package/es/index.d.ts +1 -0
  18. package/es/index.mjs +38798 -29763
  19. package/es/locales/lang/bn.d.ts +39 -1
  20. package/es/locales/lang/en.d.ts +39 -1
  21. package/es/locales/lang/vi.d.ts +39 -1
  22. package/es/locales/lang/zh-cn.d.ts +39 -1
  23. package/es/locales/useLocale.d.ts +39 -1
  24. package/es/style.css +1 -1
  25. package/lib/core/ConfigProvider/index.d.ts +109 -3
  26. package/lib/core/Input/index.vue.d.ts +1114 -0
  27. package/lib/core/Modal/index.vue.d.ts +14 -14
  28. package/lib/core/Select/index.vue.d.ts +4 -4
  29. package/lib/core/Table/components/CellEditors/Boolean.d.ts +6 -8
  30. package/lib/core/Table/components/CellEditors/Select.d.ts +2 -2
  31. package/lib/core/Table/components/FilterTagsDisplay/index.vue.d.ts +1 -1
  32. package/lib/core/Table/components/TableSet/ColumnSet.vue.d.ts +2 -499
  33. package/lib/core/Table/components/TableSet/ColumnSetBody.vue.d.ts +524 -0
  34. package/lib/core/Table/components/TableSet/index.vue.d.ts +1 -6
  35. package/lib/core/Table/components/TableSet/store.d.ts +11 -0
  36. package/lib/core/Table/components/TableSet/utils.d.ts +9 -9
  37. package/lib/core/Table/hooks/useTableCore.d.ts +1 -1
  38. package/lib/core/Table/hooks/useTableFilters.d.ts +4 -3
  39. package/lib/core/Table/index.vue.d.ts +12 -5
  40. package/lib/core/Table/store.d.ts +4 -0
  41. package/lib/index.d.ts +1 -0
  42. package/lib/index.js +6 -5
  43. package/lib/locales/lang/bn.d.ts +39 -1
  44. package/lib/locales/lang/en.d.ts +39 -1
  45. package/lib/locales/lang/vi.d.ts +39 -1
  46. package/lib/locales/lang/zh-cn.d.ts +39 -1
  47. package/lib/locales/useLocale.d.ts +39 -1
  48. package/lib/style.css +1 -1
  49. package/package.json +4 -4
  50. package/types/index.d.ts +27 -15
  51. package/types/input/index.d.ts +83 -0
  52. package/types/select/index.d.ts +2 -0
  53. package/types/table/column.d.ts +2 -2
  54. package/types/table/table-set.d.ts +4 -18
  55. package/types/table/table.d.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wx-design/components",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.11",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -38,11 +38,11 @@
38
38
  "lodash": "^4.17.21",
39
39
  "number-precision": "^1.6.0",
40
40
  "vue": "^3.3.7",
41
- "vxe-pc-ui": "4.10.6",
42
- "vxe-table": "4.17.0"
41
+ "vxe-pc-ui": "4.14.16",
42
+ "vxe-table": "4.19.0-beta.14"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@element-plus/icons-vue": "2",
46
- "element-plus": "^2.2"
46
+ "element-plus": "^2.6"
47
47
  }
48
48
  }
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>;
@@ -44,6 +44,8 @@ export type SabSelectProps = {
44
44
  modelValue?: any;
45
45
  // 值是否包含整个 option
46
46
  labelInValue?: boolean;
47
+ // 当 labelInValue 为 true 时,从 modelValue 读取值的 key
48
+ modelValueKey?: string;
47
49
  // 选项列表
48
50
  options?: any[];
49
51
  // 多选
@@ -121,6 +121,8 @@ export type SabCellSelectProps<D = VxeTableDataRow> = {
121
121
  disabledKey?: string;
122
122
  // select 变更时影响的 row.value 字段
123
123
  effectValueField?: string;
124
+ // select 变更时影响的 row.label 字段
125
+ effectLabelField?: string;
124
126
  // 远程搜索
125
127
  remote?: boolean;
126
128
  // 动态获取单元格选项
@@ -285,8 +287,6 @@ export type SabColumnProps<D = VxeTableDataRow> = VxeColumnProps<D> & {
285
287
  enableAutoWidth?: boolean;
286
288
 
287
289
  // 其他
288
- // 参与批量操作, 如果单元格支持编辑的话,默认 true,否则false
289
- enableBatchAction?: boolean;
290
290
  // 不参与动态表头控制
291
291
  noHeaderSet?: boolean;
292
292
  // 参与表格尾部汇总
@@ -1,14 +1,6 @@
1
1
  import type { VxeTableInstance } from "vxe-table";
2
2
  import type { SabColumnProps } from "./column";
3
3
 
4
- type PureColumn = Pick<SabColumnProps, "field" | "title" | "visible" | "fixed" | "enableBatchAction"> & { __table__seq: number };
5
-
6
- // 表格配置项存储类型
7
- export type SabTableSetConfig = {
8
- // 存储表头排序及显隐控制
9
- columns?: PureColumn[]
10
- }
11
-
12
4
  export interface TableSetProps {
13
5
  // 表名key
14
6
  name: string;
@@ -20,16 +12,14 @@ export interface TableSetProps {
20
12
  getTableConfig?: (params: {
21
13
  // 表名
22
14
  name: string;
23
- }) => SabTableSetConfig | Promise<SabTableSetConfig>;
15
+ }) => VxeTableDefines.CustomStoreData | Promise<VxeTableDefines.CustomStoreData>;
24
16
  // 设置表格配置的方法
25
17
  setTableConfig?: (params: {
26
18
  // 表名
27
19
  name: string;
28
20
  // 表格配置项
29
- config: SabTableSetConfig;
21
+ config: VxeTableDefines.CustomStoreData;
30
22
  }) => any;
31
- // 当设置完表格的时候触发
32
- onSetTableConfig?:() => void
33
23
  // vxe-table 实例
34
24
  tableRef?: VxeTableInstance;
35
25
  size?: 'small' | 'large' | 'default'
@@ -37,13 +27,9 @@ export interface TableSetProps {
37
27
 
38
28
  // ColumnSet 表头设置配置
39
29
  export interface TableSetColumnsProps {
40
- // 表格传入的 columns
41
- columns?: SabColumnProps[]
42
- // 初始列表配置
43
- initColumns?: PureColumn[];
30
+ // 表名key
31
+ name: string;
44
32
  // vxe-table 实例
45
33
  tableRef?: VxeTableInstance;
46
- // 展示批量操作列
47
- showBatchActionColumn?: boolean
48
34
  size?: 'small' | 'large' | 'default'
49
35
  }
@@ -90,6 +90,10 @@ export type SabTableProps<D = VxeTableDataRow> = VxeTableProps<D> & {
90
90
  };
91
91
  // 动态表头设置的时候是否采用销毁重新渲染的方式
92
92
  reloadWithDestroy?: boolean
93
+ customConfig?: VxeTablePropTypes.CustomConfig<D> & {
94
+ // 是否使用 sab 样式的自定义配置弹窗
95
+ useSabModal?: boolean;
96
+ }
93
97
  };
94
98
 
95
99
  // 表格插槽