@qy_better_lib/pc 0.2.34 → 0.3.3

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 (70) hide show
  1. package/DOCUMENTATION.md +559 -0
  2. package/LICENSE +24 -0
  3. package/dist/@qy_better_lib/pc.min.js +1 -1
  4. package/lib/commDialog/index.d.ts +3 -0
  5. package/lib/commDialog/index.js +8 -0
  6. package/lib/commDialog/src/index.vue.d.ts +102 -0
  7. package/lib/commDialog/src/index.vue.js +49 -0
  8. package/lib/commDialog/src/index.vue2.js +4 -0
  9. package/lib/commDialog/src/props.d.ts +49 -0
  10. package/lib/commDialog/src/props.js +48 -0
  11. package/lib/commDialog/src/type.d.ts +39 -0
  12. package/lib/commForm/index.d.ts +3 -0
  13. package/lib/commForm/index.js +8 -0
  14. package/lib/commForm/src/index.vue.d.ts +95 -0
  15. package/lib/commForm/src/index.vue.js +51 -0
  16. package/lib/commForm/src/index.vue2.js +4 -0
  17. package/lib/commForm/src/props.d.ts +49 -0
  18. package/lib/commForm/src/props.js +47 -0
  19. package/lib/commForm/src/type.d.ts +8 -0
  20. package/lib/contextMenu/index.d.ts +5 -2
  21. package/lib/contextMenu/index.js +5 -4
  22. package/lib/contextMenu/src/index.vue.d.ts +48 -36
  23. package/lib/contextMenu/src/index.vue.js +128 -79
  24. package/lib/contextMenu/src/index.vue2.js +2 -2
  25. package/lib/contextMenu/src/props.d.ts +32 -0
  26. package/lib/contextMenu/src/props.js +27 -0
  27. package/lib/contextMenu/src/type.d.ts +11 -0
  28. package/lib/describeView/index.js +4 -4
  29. package/lib/describeView/src/index.vue.d.ts +6 -9
  30. package/lib/describeView/src/index.vue.js +73 -70
  31. package/lib/describeView/src/index.vue2.js +2 -2
  32. package/lib/describeView/src/props.d.ts +35 -0
  33. package/lib/describeView/src/props.js +33 -0
  34. package/lib/index.d.ts +7 -3
  35. package/lib/index.js +31 -21
  36. package/lib/simpleVirtualList/index.js +4 -4
  37. package/lib/simpleVirtualList/src/index.vue.js +70 -53
  38. package/lib/simpleVirtualList/src/index.vue2.js +2 -2
  39. package/lib/styles/comm-form.scss +4 -0
  40. package/lib/styles/index.scss +6 -5
  41. package/lib/tableExtend/index.js +4 -4
  42. package/lib/tableExtend/props.d.ts +74 -15
  43. package/lib/tableExtend/props.js +82 -24
  44. package/lib/tableExtend/src/colVisible.vue.js +95 -70
  45. package/lib/tableExtend/src/colVisible.vue2.js +2 -2
  46. package/lib/tableExtend/src/index.vue.d.ts +18 -10
  47. package/lib/tableExtend/src/index.vue.js +169 -142
  48. package/lib/tableExtend/src/index.vue2.js +2 -2
  49. package/lib/tableExtend/src/valueCol.vue.js +11 -8
  50. package/lib/tableExtend/src/valueCol.vue2.js +2 -2
  51. package/lib/tableExtend/type.d.ts +9 -14
  52. package/lib/tableExtend/type.js +7 -2
  53. package/lib/tableExtend/useTable.d.ts +19 -50
  54. package/lib/tableExtend/useTable.js +95 -56
  55. package/lib/textButton/index.js +4 -4
  56. package/lib/textButton/src/index.vue.d.ts +7 -6
  57. package/lib/textButton/src/index.vue.js +25 -37
  58. package/lib/textButton/src/index.vue2.js +2 -2
  59. package/lib/textButton/src/props.d.ts +23 -0
  60. package/lib/textButton/src/props.js +30 -0
  61. package/lib/textButton/src/type.d.ts +30 -0
  62. package/lib/utils/index.d.ts +55 -13
  63. package/lib/utils/index.js +98 -54
  64. package/package.json +26 -9
  65. package/types/index.d.ts +9 -1
  66. /package/lib/styles/{contextMenu.scss → context-menu.scss} +0 -0
  67. /package/lib/styles/{describeView.scss → describe-view.scss} +0 -0
  68. /package/lib/styles/{simpleVirtualList.scss → simple-virtual-list.scss} +0 -0
  69. /package/lib/styles/{tableExtend.scss → table-extend.scss} +0 -0
  70. /package/lib/styles/{textButton.scss → text-button.scss} +0 -0
@@ -1,4 +1,4 @@
1
- import f from "./index.vue.js";
1
+ import _sfc_main from "./index.vue.js";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as l, computed as p, openBlock as r, createElementBlock as a, toDisplayString as u } from "vue";
2
- const f = /* @__PURE__ */ l({
1
+ import { defineComponent, computed, openBlock, createElementBlock, toDisplayString } from "vue";
2
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3
3
  __name: "valueCol",
4
4
  props: {
5
5
  row: {
@@ -13,14 +13,17 @@ const f = /* @__PURE__ */ l({
13
13
  }
14
14
  }
15
15
  },
16
- setup(n) {
17
- const c = n, e = p(() => {
18
- const { row: o, colCfg: t } = c;
19
- return o[t.prop];
16
+ setup(__props) {
17
+ const props = __props;
18
+ const column = computed(() => {
19
+ const { row, colCfg } = props;
20
+ return row[colCfg.prop];
20
21
  });
21
- return (o, t) => (r(), a("span", null, u(e.value != null ? e.value : "--"), 1));
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createElementBlock("span", null, toDisplayString(column.value != void 0 ? column.value : "--"), 1);
24
+ };
22
25
  }
23
26
  });
24
27
  export {
25
- f as default
28
+ _sfc_main as default
26
29
  };
@@ -1,4 +1,4 @@
1
- import f from "./valueCol.vue.js";
1
+ import _sfc_main from "./valueCol.vue.js";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };
@@ -41,32 +41,31 @@ export type TableAttr = {
41
41
  /**分页 */
42
42
  export type Pagination = {
43
43
  /**页码 */
44
- pageIndex: number | undefined;
44
+ page_index: number | undefined;
45
45
  /**每页显示数量 */
46
- pageSize: number | undefined;
47
- has: boolean;
46
+ page_size: number | undefined;
48
47
  };
49
48
  /**列配置 */
50
49
  export type ColumnConfig = {
51
50
  /**显示列 */
52
- showColumn: TableColumn[];
51
+ show_column: TableColumn[];
53
52
  /**隐藏列 */
54
- hiddenColumn: TableColumn[];
53
+ hidden_column: TableColumn[];
55
54
  };
56
55
  interface TableExtendProps<T> extends Omit<TableProps<any>, "data"> {
57
56
  data?: undefined;
58
57
  }
59
58
  /**注入结构 */
60
59
  export type TableProvies = {
61
- tableProps: Record<string, any>;
62
- tableColums: Ref<Array<TableColumn>>;
63
- columnConfig: ColumnConfig;
60
+ table_props: Record<string, any>;
61
+ table_colums: Ref<Array<TableColumn>>;
62
+ column_config: ColumnConfig;
64
63
  };
65
64
  export type ImageViewer = {
66
65
  /**是否显示 */
67
66
  show: boolean;
68
67
  /**图片路径 */
69
- filePathList: any[];
68
+ file_path_list: any[];
70
69
  /**显示图片的索引 */
71
70
  index: number;
72
71
  };
@@ -155,13 +154,9 @@ export interface TableColumn {
155
154
  */
156
155
  fixed?: "left" | "right";
157
156
  /**
158
- * 图片类型
157
+ * 文件类型
159
158
  */
160
159
  fileType?: FileType;
161
- /**
162
- * 数据是否为HTML
163
- */
164
- isHtml?: boolean;
165
160
  /**多语言配置 */
166
161
  langue?: string;
167
162
  /**其他配置 */
@@ -1,4 +1,9 @@
1
- var E = /* @__PURE__ */ ((r) => (r[r.PICTURE = 1] = "PICTURE", r[r.PDF = 2] = "PDF", r[r.OTHER = 3] = "OTHER", r))(E || {});
1
+ var FileType = /* @__PURE__ */ ((FileType2) => {
2
+ FileType2[FileType2["PICTURE"] = 1] = "PICTURE";
3
+ FileType2[FileType2["PDF"] = 2] = "PDF";
4
+ FileType2[FileType2["OTHER"] = 3] = "OTHER";
5
+ return FileType2;
6
+ })(FileType || {});
2
7
  export {
3
- E as FileType
8
+ FileType
4
9
  };
@@ -1,58 +1,27 @@
1
- import { FileType, TableColumn } from './type';
2
- import { ComputedRef } from 'vue';
1
+ import { ColumnConfig, TableColumn } from './type';
2
+ import { ComputedRef, ShallowReactive } from 'vue';
3
3
  /**
4
- * useTable
4
+ * 表格扩展组件的核心逻辑钩子
5
+ * @param {Function} i18n_instance - 国际化实例函数,用于多语言支持
6
+ * @returns {Object} 表格相关的响应式数据和计算属性
5
7
  */
6
- export default function useTable(i18nInstance?: (key: string) => string): {
7
- defColSetting: TableColumn;
8
- selectionOptions: Record<string, any>;
9
- tableAttribute: ComputedRef<Record<string, any>>;
8
+ export default function use_table(i18n_instance?: (key: string) => string): {
9
+ def_col_setting: TableColumn;
10
+ selection_options: Record<string, any>;
11
+ table_attribute: ComputedRef<Record<string, any>>;
10
12
  pagination: {
11
- pageIndex: any;
12
- pageSize: any;
13
+ page_index: any;
14
+ page_size: any;
13
15
  };
14
- hasPagination: ComputedRef<boolean>;
15
- imageViewer: {
16
+ has_pagination: ComputedRef<boolean>;
17
+ image_viewer: {
16
18
  show: boolean;
17
- filePathList: any[];
19
+ file_path_list: any[];
18
20
  index: number;
19
21
  };
20
- columnConfig: {
21
- showColumn: {
22
- [x: string]: any;
23
- headerAlign?: string | undefined;
24
- align?: string | undefined;
25
- prop?: string | undefined;
26
- label?: string | undefined;
27
- init?: boolean | undefined;
28
- width?: number | undefined;
29
- minWidth?: number | undefined;
30
- showOverflowTooltip?: (boolean | Record<string, any>) | undefined;
31
- sortable?: boolean | undefined;
32
- fixed?: "left" | "right" | undefined;
33
- fileType?: FileType | undefined;
34
- isHtml?: boolean | undefined;
35
- langue?: string | undefined;
36
- }[];
37
- hiddenColumn: {
38
- [x: string]: any;
39
- headerAlign?: string | undefined;
40
- align?: string | undefined;
41
- prop?: string | undefined;
42
- label?: string | undefined;
43
- init?: boolean | undefined;
44
- width?: number | undefined;
45
- minWidth?: number | undefined;
46
- showOverflowTooltip?: (boolean | Record<string, any>) | undefined;
47
- sortable?: boolean | undefined;
48
- fixed?: "left" | "right" | undefined;
49
- fileType?: FileType | undefined;
50
- isHtml?: boolean | undefined;
51
- langue?: string | undefined;
52
- }[];
53
- };
54
- colSettingList: ComputedRef<TableColumn[]>;
55
- showToolPanel: ComputedRef<boolean>;
56
- showBottomPanel: ComputedRef<boolean>;
57
- hasImageViewer: ComputedRef<boolean>;
22
+ column_config: ShallowReactive<ColumnConfig>;
23
+ col_setting_list: ComputedRef<TableColumn[]>;
24
+ show_tool_panel: ComputedRef<boolean>;
25
+ show_bottom_panel: ComputedRef<boolean>;
26
+ has_image_viewer: ComputedRef<boolean>;
58
27
  };
@@ -1,76 +1,115 @@
1
- import { deepClone as T, auto_size as s } from "@qy_better_lib/core";
2
- import { getCurrentInstance as W, computed as n, reactive as r, toRef as c } from "vue";
3
- import { FileType as z } from "./type.js";
4
- function L(g) {
5
- const i = W(), e = i?.props, f = {
1
+ import { auto_size } from "@qy_better_lib/core";
2
+ import { getCurrentInstance, computed, reactive, toRef, shallowReactive } from "vue";
3
+ import { FileType } from "./type.js";
4
+ function use_table(i18n_instance) {
5
+ const base_w = 1920;
6
+ const current_instance = getCurrentInstance();
7
+ const props = current_instance?.props;
8
+ const default_table_attr = {
6
9
  rowKey: "id",
7
10
  "element-loading-text": "加载中…",
8
11
  "element-loading-background": "rgba(0, 0, 0, 0.2)",
9
- highlightCurrentRow: !0,
10
- stripe: !0,
11
- border: !1
12
- }, p = {
12
+ highlightCurrentRow: true,
13
+ stripe: true,
14
+ border: false
15
+ };
16
+ const default_col_setting = {
13
17
  headerAlign: void 0,
14
18
  align: void 0,
15
19
  prop: void 0,
16
20
  label: void 0,
17
- init: !0,
21
+ init: true,
18
22
  width: void 0,
19
- showOverflowTooltip: !1,
23
+ showOverflowTooltip: false,
20
24
  sortable: void 0,
21
25
  fixed: void 0
22
- }, w = n(() => ({
23
- ...f,
24
- ...Object.keys(e.options).length > 0 ? e.options : {}
25
- })), b = r({
26
+ };
27
+ const table_attribute = computed(() => {
28
+ return {
29
+ ...default_table_attr,
30
+ ...Object.keys(props.options).length > 0 ? props.options : {}
31
+ };
32
+ });
33
+ const selection_options = reactive({
26
34
  count: 0,
27
35
  rows: []
28
- }), d = r({
29
- pageIndex: e?.paging?.pageIndex ? c(e.paging, "pageIndex") : 1,
30
- pageSize: e?.paging?.pageSize ? c(e.paging, "pageSize") : 10
31
- }), m = n(() => {
32
- const o = e?.paging?.pageIndex > 0 && e?.paging?.pageSize > 0;
33
- if (!e.autoPagination)
34
- return o;
35
- const h = e.tableData.length > (e.total || 0) ? e.tableData.length : e.total || 0;
36
- return o && h > d.pageSize;
37
- }), C = r({
38
- /**是否显示 */
39
- show: !1,
40
- /**图片路径 */
41
- filePathList: [],
42
- /**显示图片的索引 */
36
+ });
37
+ const pagination = reactive({
38
+ page_index: props?.paging?.pageIndex ? toRef(props.paging, "pageIndex") : 1,
39
+ page_size: props?.paging?.pageSize ? toRef(props.paging, "pageSize") : 10
40
+ });
41
+ const has_pagination = computed(() => {
42
+ const has = props?.paging?.pageIndex > 0 && props?.paging?.pageSize > 0;
43
+ if (!props.autoPagination) {
44
+ return has;
45
+ }
46
+ const total = props.tableData.length > (props.total || 0) ? props.tableData.length : props.total || 0;
47
+ return has && total > pagination.page_size;
48
+ });
49
+ const image_viewer = reactive({
50
+ /** 是否显示图片预览 */
51
+ show: false,
52
+ /** 图片路径列表 */
53
+ file_path_list: [],
54
+ /** 当前显示图片的索引 */
43
55
  index: 0
44
- }), l = r({
45
- showColumn: [],
46
- hiddenColumn: []
47
- }), u = n(() => !l.showColumn || l.showColumn.length === 0 ? [
48
- {
49
- prop: "default-prop",
50
- init: !0,
51
- label: ""
56
+ });
57
+ const column_config = shallowReactive({
58
+ show_column: [],
59
+ hidden_column: []
60
+ });
61
+ const col_setting_list = computed(() => {
62
+ if (!column_config.show_column || column_config.show_column.length === 0) {
63
+ return [{ prop: "default-prop", init: true, label: "" }];
52
64
  }
53
- ] : T(l.showColumn).map((t) => {
54
- g && t.langue && (t.label = g(t.langue));
55
- const a = 1920;
56
- return e.autoSize ? t.width ? t.width = s(t.width || 0, a) : t.minWidth && (t.minWidth = s(t.minWidth || 0, a)) : t.autoW && (t.width ? t.width = s(t.width || 0, a) : t.minWidth && (t.minWidth = s(t.minWidth || 0, a))), { ...p, ...t };
57
- })), v = n(() => (i?.slots["tool-left"]?.()?.length || 0) > 0 || (i?.slots["tool-right"]?.()?.length || 0) > 0), x = n(() => (i?.slots["tool-left"]?.()?.length || 0) > 0), S = n(() => u.value.some(
58
- (o) => o.fileType && o.fileType == z.PICTURE
65
+ const col_list = column_config.show_column.map((item) => {
66
+ const clonedItem = { ...item };
67
+ i18n_instance && clonedItem.langue && (clonedItem.label = i18n_instance(clonedItem.langue));
68
+ if (props.autoSize) {
69
+ if (clonedItem.width) {
70
+ clonedItem.width = auto_size(clonedItem.width || 0, base_w);
71
+ } else if (clonedItem.minWidth) {
72
+ clonedItem.minWidth = auto_size(clonedItem.minWidth || 0, base_w);
73
+ }
74
+ } else {
75
+ clonedItem.minWidth = auto_size(clonedItem.minWidth || 0, base_w);
76
+ }
77
+ return { ...default_col_setting, ...clonedItem };
78
+ });
79
+ return col_list;
80
+ });
81
+ const show_tool_panel = computed(() => {
82
+ return (current_instance?.slots["tool-left"]?.()?.length || 0) > 0 || (current_instance?.slots["tool-right"]?.()?.length || 0) > 0;
83
+ });
84
+ const show_bottom_panel = computed(() => (current_instance?.slots["tool-left"]?.()?.length || 0) > 0);
85
+ const has_image_viewer = computed(() => col_setting_list.value.some(
86
+ (f) => f.fileType && f.fileType == FileType.PICTURE
59
87
  ));
60
88
  return {
61
- defColSetting: p,
62
- selectionOptions: b,
63
- tableAttribute: w,
64
- pagination: d,
65
- hasPagination: m,
66
- imageViewer: C,
67
- columnConfig: l,
68
- colSettingList: u,
69
- showToolPanel: v,
70
- showBottomPanel: x,
71
- hasImageViewer: S
89
+ def_col_setting: default_col_setting,
90
+ // 默认列配置
91
+ selection_options,
92
+ // 选中行状态
93
+ table_attribute,
94
+ // 表格属性
95
+ pagination,
96
+ // 分页配置
97
+ has_pagination,
98
+ // 是否显示分页
99
+ image_viewer,
100
+ // 图片预览配置
101
+ column_config,
102
+ // 列显示/隐藏配置
103
+ col_setting_list,
104
+ // 表格显示列
105
+ show_tool_panel,
106
+ // 是否显示工具栏
107
+ show_bottom_panel,
108
+ // 是否显示底部面板
109
+ has_image_viewer
110
+ // 是否包含图片预览功能
72
111
  };
73
112
  }
74
113
  export {
75
- L as default
114
+ use_table as default
76
115
  };
@@ -1,7 +1,7 @@
1
- import t from "./src/index.vue.js";
2
- t.install = (o) => {
3
- o.component("TextButton", t);
1
+ import _sfc_main from "./src/index.vue.js";
2
+ _sfc_main.install = (app) => {
3
+ app.component("TextButton", _sfc_main);
4
4
  };
5
5
  export {
6
- t as default
6
+ _sfc_main as default
7
7
  };
@@ -1,4 +1,5 @@
1
- import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { TextButtonType } from './type';
2
3
  declare function __VLS_template(): {
3
4
  attrs: Partial<{}>;
4
5
  slots: {
@@ -10,26 +11,26 @@ declare function __VLS_template(): {
10
11
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
12
  declare const __VLS_component: DefineComponent<ExtractPropTypes<{
12
13
  type: {
13
- type: StringConstructor;
14
+ type: PropType<TextButtonType>;
14
15
  default: string;
15
16
  validator: (val: string) => boolean;
16
17
  };
17
18
  icon: StringConstructor;
18
19
  disabled: BooleanConstructor;
19
20
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
20
- click: (...args: any[]) => void;
21
+ click: (event: MouseEvent) => any;
21
22
  }, string, PublicProps, Readonly< ExtractPropTypes<{
22
23
  type: {
23
- type: StringConstructor;
24
+ type: PropType<TextButtonType>;
24
25
  default: string;
25
26
  validator: (val: string) => boolean;
26
27
  };
27
28
  icon: StringConstructor;
28
29
  disabled: BooleanConstructor;
29
30
  }>> & Readonly<{
30
- onClick?: ((...args: any[]) => any) | undefined;
31
+ onClick?: ((event: MouseEvent) => any) | undefined;
31
32
  }>, {
32
- type: string;
33
+ type: TextButtonType;
33
34
  disabled: boolean;
34
35
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
35
36
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,56 +1,44 @@
1
- import { defineComponent as s, resolveComponent as d, openBlock as o, createElementBlock as m, normalizeClass as u, createBlock as i, withCtx as p, resolveDynamicComponent as f, createCommentVNode as b, createElementVNode as k, withModifiers as x, renderSlot as C } from "vue";
2
- const B = /* @__PURE__ */ s({
3
- name: "TextButton",
1
+ import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, createElementVNode, withModifiers, renderSlot } from "vue";
2
+ import { props } from "./props.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ ...{ name: "TextButton" },
4
5
  __name: "index",
5
- props: {
6
- type: {
7
- type: String,
8
- default: "primary",
9
- validator: (e) => [
10
- "default",
11
- "primary",
12
- "success",
13
- "warning",
14
- "info",
15
- "danger"
16
- ].includes(e)
17
- },
18
- icon: String,
19
- disabled: Boolean
20
- },
6
+ props: props(),
21
7
  emits: ["click"],
22
- setup(e, { emit: c }) {
23
- const t = e, r = c;
24
- function l(n) {
25
- t.disabled || r("click", n);
8
+ setup(__props, { emit: __emit }) {
9
+ const props2 = __props;
10
+ const emit = __emit;
11
+ function onClick(e) {
12
+ if (props2.disabled) return;
13
+ emit("click", e);
26
14
  }
27
- return (n, y) => {
28
- const a = d("el-icon");
29
- return o(), m("div", {
30
- class: u(["text-button", [
31
- `text-button-${e.type}`,
32
- e.disabled && "is-disabled"
15
+ return (_ctx, _cache) => {
16
+ const _component_el_icon = resolveComponent("el-icon");
17
+ return openBlock(), createElementBlock("div", {
18
+ class: normalizeClass(["text-button", [
19
+ `text-button-${_ctx.type}`,
20
+ _ctx.disabled && "is-disabled"
33
21
  ]])
34
22
  }, [
35
- t.icon ? (o(), i(a, {
23
+ _ctx.icon ? (openBlock(), createBlock(_component_el_icon, {
36
24
  key: 0,
37
25
  class: "text-button-icon"
38
26
  }, {
39
- default: p(() => [
40
- (o(), i(f(t.icon)))
27
+ default: withCtx(() => [
28
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
41
29
  ]),
42
30
  _: 1
43
- })) : b("", !0),
44
- k("div", {
31
+ })) : createCommentVNode("", true),
32
+ createElementVNode("div", {
45
33
  class: "text-button-inner",
46
- onClick: x(l, ["prevent"])
34
+ onClick: withModifiers(onClick, ["prevent"])
47
35
  }, [
48
- C(n.$slots, "default")
36
+ renderSlot(_ctx.$slots, "default")
49
37
  ])
50
38
  ], 2);
51
39
  };
52
40
  }
53
41
  });
54
42
  export {
55
- B as default
43
+ _sfc_main as default
56
44
  };
@@ -1,4 +1,4 @@
1
- import f from "./index.vue.js";
1
+ import _sfc_main from "./index.vue.js";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };
@@ -0,0 +1,23 @@
1
+ import { PropType } from 'vue';
2
+ import { TextButtonType } from './type';
3
+ /**
4
+ * 文本按钮组件属性定义
5
+ */
6
+ export declare const props: () => {
7
+ /**
8
+ * 按钮类型
9
+ */
10
+ type: {
11
+ type: PropType<TextButtonType>;
12
+ default: string;
13
+ validator: (val: string) => boolean;
14
+ };
15
+ /**
16
+ * 图标组件
17
+ */
18
+ icon: StringConstructor;
19
+ /**
20
+ * 是否禁用
21
+ */
22
+ disabled: BooleanConstructor;
23
+ };
@@ -0,0 +1,30 @@
1
+ const props = () => ({
2
+ /**
3
+ * 按钮类型
4
+ */
5
+ type: {
6
+ type: String,
7
+ default: "primary",
8
+ validator: (val) => {
9
+ return [
10
+ "default",
11
+ "primary",
12
+ "success",
13
+ "warning",
14
+ "info",
15
+ "danger"
16
+ ].includes(val);
17
+ }
18
+ },
19
+ /**
20
+ * 图标组件
21
+ */
22
+ icon: String,
23
+ /**
24
+ * 是否禁用
25
+ */
26
+ disabled: Boolean
27
+ });
28
+ export {
29
+ props
30
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 文本按钮类型
3
+ */
4
+ export type TextButtonType = 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger';
5
+ /**
6
+ * 文本按钮组件属性
7
+ */
8
+ export interface TextButtonProps {
9
+ /**
10
+ * 按钮类型
11
+ */
12
+ type: TextButtonType;
13
+ /**
14
+ * 图标组件
15
+ */
16
+ icon?: string;
17
+ /**
18
+ * 是否禁用
19
+ */
20
+ disabled: boolean;
21
+ }
22
+ /**
23
+ * 文本按钮组件事件
24
+ */
25
+ export interface TextButtonEmits {
26
+ /**
27
+ * 点击事件
28
+ */
29
+ (e: 'click', event: MouseEvent): void;
30
+ }