@wyfex/ivue 0.11.0 → 0.12.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.
@@ -1,10 +1,6 @@
1
- import { ComputedRef, Attrs } from 'vue';
1
+ import { ComputedRef } from 'vue';
2
2
  import { Emits, Props } from './types';
3
- export declare const useElButton: ({ mergedProps, emits, attrs }: {
4
- mergedProps: ComputedRef<Props>;
5
- emits: Emits;
6
- attrs: Attrs;
7
- }) => {
3
+ export declare const useElButton: (mergedProps: ComputedRef<Props>, emits: Emits) => {
8
4
  isConfirm: ComputedRef<boolean>;
9
- handleElButton: () => void;
5
+ handleElButtonClick: (event: Event) => void;
10
6
  };
@@ -13,7 +13,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
13
13
  default: () => {};
14
14
  };
15
15
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
- debClick: (value?: string | number | Record<string, unknown> | undefined) => any;
16
+ click: (value?: string | number | Record<string, unknown> | undefined) => any;
17
17
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
18
18
  btnText: {
19
19
  type: StringConstructor;
@@ -29,7 +29,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
29
29
  default: () => {};
30
30
  };
31
31
  }>> & Readonly<{
32
- onDebClick?: ((value?: string | number | Record<string, unknown> | undefined) => any) | undefined;
32
+ onClick?: ((value?: string | number | Record<string, unknown> | undefined) => any) | undefined;
33
33
  }>, {
34
34
  type: string;
35
35
  extConfig: import('./types').ExtConfig;
@@ -2,7 +2,7 @@ import { ExtractPropTypes } from 'vue';
2
2
  import { default as componentProps } from './props';
3
3
  export type Props = ExtractPropTypes<typeof componentProps>;
4
4
  export interface Emits {
5
- (e: 'debClick', value?: string | number | Record<string, unknown>): void;
5
+ (e: 'click', value?: string | number | Record<string, unknown>): void;
6
6
  }
7
7
  export interface ExtConfig {
8
8
  debounce?: {
@@ -0,0 +1,51 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ activeValue: {
3
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
4
+ default: number;
5
+ };
6
+ inactiveValue: {
7
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
8
+ default: number;
9
+ };
10
+ activeText: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ inactiveText: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ inlinePrompt: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
23
+ activeValue: {
24
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
25
+ default: number;
26
+ };
27
+ inactiveValue: {
28
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
29
+ default: number;
30
+ };
31
+ activeText: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ inactiveText: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ inlinePrompt: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
43
+ }>> & Readonly<{}>, {
44
+ activeValue: string | number | boolean;
45
+ inactiveValue: string | number | boolean;
46
+ activeText: string;
47
+ inactiveText: string;
48
+ inlinePrompt: boolean;
49
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
50
+ declare const _default: typeof __VLS_export;
51
+ export default _default;
@@ -0,0 +1,23 @@
1
+ declare const _default: {
2
+ activeValue: {
3
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
4
+ default: number;
5
+ };
6
+ inactiveValue: {
7
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
8
+ default: number;
9
+ };
10
+ activeText: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ inactiveText: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ inlinePrompt: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ };
23
+ export default _default;
@@ -1,18 +1,13 @@
1
- import { ComputedRef, Ref } from 'vue';
2
- import { TableInstance } from 'element-plus';
1
+ import { ComputedRef } from 'vue';
3
2
  import { Emits, Props, TableColumn } from '../types';
4
3
  import { GlobalConfig } from '../../../../types';
5
- export declare const useElTable: ({ mergedProps, emits, globalConfig, rootRef, tableWrapperRef, etRef }: {
4
+ export declare const useElTable: ({ mergedProps, emits, globalConfig }: {
6
5
  mergedProps: ComputedRef<Props>;
7
6
  emits: Emits;
8
7
  globalConfig: ComputedRef<GlobalConfig>;
9
- rootRef: Ref<HTMLDivElement | null>;
10
- tableWrapperRef: Ref<HTMLDivElement | null>;
11
- etRef: Ref<TableInstance | null>;
12
8
  }) => {
13
- tableRealHeight: Ref<string, string>;
14
9
  processHeaderCellClassName: ({ column }: any) => "" | "hideAllSelection";
15
10
  tableColumnsComputed: ComputedRef<TableColumn[]>;
16
- processDictData: (item: TableColumn) => Record<string, unknown>[];
11
+ processDictData: (item: TableColumn) => Record<string, any>[];
17
12
  validateRequired: (row: Record<string, any>) => boolean;
18
13
  };
@@ -0,0 +1,5 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { TableInstance } from 'element-plus';
3
+ import { Props } from '../types';
4
+ import { GlobalConfig } from '../../../../types';
5
+ export declare const useTableColumnMinWidth: (etRef: Ref<TableInstance | null>, mergedProps: ComputedRef<Props>, globalConfig: ComputedRef<GlobalConfig>) => void;
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ export declare const useTableHeightAdaptive: (rootRef: Ref<HTMLDivElement | null>, tableWrapperRef: Ref<HTMLDivElement | null>) => {
3
+ tableRealHeight: Ref<string, string>;
4
+ };
@@ -1,9 +1,7 @@
1
- import { ComputedRef } from 'vue';
2
- import { TableColumn, Props } from './types';
1
+ import { TableColumn } from './types';
3
2
  import { GlobalConfig } from '../../../types';
4
3
  export declare const processFieldProp: (row: Record<string, unknown>, item: TableColumn, globalConfig: GlobalConfig) => {
5
4
  class: string;
6
5
  style: string;
7
6
  data: unknown;
8
7
  };
9
- export declare const handleMinWidth: (columns: TableColumn[], data: any, mergedProps: ComputedRef<Props>, globalConfig: GlobalConfig) => void;
@@ -6,6 +6,7 @@ export { default as UseElDialog } from './UseElDialog/index.vue';
6
6
  export { default as UseElDrawer } from './UseElDrawer/index.vue';
7
7
  export { default as UseElInput } from './UseElInput/index.vue';
8
8
  export { default as UseElSelect } from './UseElSelect/index.vue';
9
+ export { default as UseElSwitch } from './UseElSwitch/index.vue';
9
10
  export { default as UseElTable } from './UseElTable/index.vue';
10
11
  export { default as UseRender } from './UseRender/index.vue';
11
12
  export { default as UseSvgIcon } from './UseSvgIcon/index.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wyfex/ivue",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "万有前端 X 体系下基于 Vite8 + Vue3 + Typescript6 + ElementPlus2 构建的 iVue 组件库",
5
5
  "homepage": "https://wyfe.top/idocs/ivue",
6
6
  "type": "module",
@@ -11,9 +11,9 @@ export type Props = ExtractPropTypes<typeof componentProps>
11
11
  */
12
12
  export interface Emits {
13
13
  /**
14
- * 防抖点击事件
14
+ * 点击事件 默认自带防抖
15
15
  */
16
- (e: 'debClick', value?: string | number | Record<string, unknown>): void
16
+ (e: 'click', value?: string | number | Record<string, unknown>): void
17
17
  }
18
18
 
19
19
  /**
@@ -22,7 +22,7 @@ export interface Emits {
22
22
  export interface ExtConfig {
23
23
  /**
24
24
  * 防抖配置项
25
- * 仅作用于@debClick事件,无需防抖则设置delay0或使用@click事件即可。
25
+ * 无需防抖将delay设置为0即可
26
26
  */
27
27
  debounce?: {
28
28
  /**
@@ -40,7 +40,7 @@ export interface ExtConfig {
40
40
  confirm?: {
41
41
  /**
42
42
  * 二次确认数据 显式设置则开启二次确认
43
- * 可为String、Number、Object、Array,无需传递数据则显式设置为null
43
+ * 可为String、Number、Object、Array,无需传递数据则显式设置为null
44
44
  */
45
45
  data?: string | number | Record<string, unknown> | unknown[] | null
46
46
  /**
@@ -0,0 +1,40 @@
1
+ /**
2
+ * 组件props
3
+ */
4
+ export default {
5
+ /**
6
+ * switch 状态为 on 时的值
7
+ */
8
+ activeValue: {
9
+ type: [Number, String, Boolean],
10
+ default: 1
11
+ },
12
+ /**
13
+ * switch的状态为 off 时的值
14
+ */
15
+ inactiveValue: {
16
+ type: [Number, String, Boolean],
17
+ default: 0
18
+ },
19
+ /**
20
+ * switch 打开时的文字描述
21
+ */
22
+ activeText: {
23
+ type: String,
24
+ default: '启用'
25
+ },
26
+ /**
27
+ * switch 的状态为 off 时的文字描述
28
+ */
29
+ inactiveText: {
30
+ type: String,
31
+ default: '禁用'
32
+ },
33
+ /**
34
+ * 无论图标或文本是否显示在点内,只会呈现文本的第一个字符
35
+ */
36
+ inlinePrompt: {
37
+ type: Boolean,
38
+ default: true
39
+ }
40
+ }
@@ -8,6 +8,8 @@ import type { DictMap, DictProps } from '@/types'
8
8
  export default {
9
9
  /**
10
10
  * 表格列 必传
11
+ * 注意:常规场景下列配置为静态值无需响应式;但本组件提供了 minWidth 自动计算功能并会修改列对象,
12
+ * 因此 tableColumns 必须用 ref/reactive 包裹,否则视图无法同步更新宽度。
11
13
  */
12
14
  tableColumns: {
13
15
  type: Array as PropType<TableColumn[]>,
@@ -48,7 +48,7 @@ export interface DictProps {
48
48
  */
49
49
  export interface DictMap {
50
50
  // 形如:{ 性别: [{ label: '男', value: 1 },{ label: '女', value: 2 }] }
51
- [key: string]: Record<DictProps['label'] | DictProps['value'], unknown>[]
51
+ [key: string]: Record<DictProps['label'] | DictProps['value'], any>[]
52
52
  }
53
53
  // export interface DictMap {
54
54
  // // 形如:{ 性别: [{ label: '男', value: 1 },{ label: '女', value: 2 }] }