@quiteer/naive-extra 0.0.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.
Files changed (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +86 -0
  3. package/dist/components/breadcrumb/index.d.ts +0 -0
  4. package/dist/components/breadcrumb/index.vue.d.ts +3 -0
  5. package/dist/components/breadcrumb/props.d.ts +0 -0
  6. package/dist/components/button/action/index.d.ts +3 -0
  7. package/dist/components/button/action/index.vue.d.ts +118 -0
  8. package/dist/components/button/action/props.d.ts +63 -0
  9. package/dist/components/button/action/utils.d.ts +8 -0
  10. package/dist/components/button/base/index.d.ts +3 -0
  11. package/dist/components/button/base/index.vue.d.ts +36 -0
  12. package/dist/components/button/base/props.d.ts +27 -0
  13. package/dist/components/button/index.d.ts +4 -0
  14. package/dist/components/button/types.d.ts +2 -0
  15. package/dist/components/form/helper.d.ts +11 -0
  16. package/dist/components/form/index.d.ts +3 -0
  17. package/dist/components/form/index.vue.d.ts +642 -0
  18. package/dist/components/form/props.d.ts +34 -0
  19. package/dist/components/icon/IconPicker.vue.d.ts +13 -0
  20. package/dist/components/icon/iconify.d.ts +25 -0
  21. package/dist/components/icon/index.d.ts +3 -0
  22. package/dist/components/icon/index.vue.d.ts +12 -0
  23. package/dist/components/layout/const.d.ts +22 -0
  24. package/dist/components/layout/context.d.ts +77 -0
  25. package/dist/components/layout/index.d.ts +5 -0
  26. package/dist/components/layout/index.vue.d.ts +80 -0
  27. package/dist/components/layout/layout-parts/AppBreadcrumb.vue.d.ts +3 -0
  28. package/dist/components/layout/layout-parts/AppFooter.vue.d.ts +18 -0
  29. package/dist/components/layout/layout-parts/AppHeader.vue.d.ts +18 -0
  30. package/dist/components/layout/layout-parts/AppLeftLogoInfo.vue.d.ts +3 -0
  31. package/dist/components/layout/layout-parts/AppMain.vue.d.ts +18 -0
  32. package/dist/components/layout/layout-parts/AppSidebar.vue.d.ts +4067 -0
  33. package/dist/components/layout/layout-parts/LayoutTransition.vue.d.ts +58 -0
  34. package/dist/components/layout/mode.d.ts +0 -0
  35. package/dist/components/layout/props.d.ts +35 -0
  36. package/dist/components/layout/types.d.ts +59 -0
  37. package/dist/components/layout/utils.d.ts +97 -0
  38. package/dist/components/provider/index.d.ts +3 -0
  39. package/dist/components/provider/index.vue.d.ts +19 -0
  40. package/dist/components/provider/props.d.ts +33 -0
  41. package/dist/components/search-bar/index.d.ts +3 -0
  42. package/dist/components/search-bar/index.vue.d.ts +1288 -0
  43. package/dist/components/search-bar/props.d.ts +15 -0
  44. package/dist/components/table/TableSetting.vue.d.ts +15 -0
  45. package/dist/components/table/index.d.ts +4 -0
  46. package/dist/components/table/index.vue.d.ts +17246 -0
  47. package/dist/components/table/props.d.ts +26 -0
  48. package/dist/components/table/useColumn.d.ts +15 -0
  49. package/dist/components/upload/enum.d.ts +18 -0
  50. package/dist/components/upload/index.d.ts +4 -0
  51. package/dist/components/upload/index.vue.d.ts +17 -0
  52. package/dist/components/upload/props.d.ts +7 -0
  53. package/dist/const/defaults.d.ts +7 -0
  54. package/dist/const/index.d.ts +2 -0
  55. package/dist/const/types.d.ts +134 -0
  56. package/dist/context/color.d.ts +13 -0
  57. package/dist/context/common.d.ts +117 -0
  58. package/dist/context/index.d.ts +41 -0
  59. package/dist/context/layout.d.ts +52 -0
  60. package/dist/context/loading-bar.d.ts +14 -0
  61. package/dist/context/locale.d.ts +143 -0
  62. package/dist/context/menu.d.ts +212 -0
  63. package/dist/context/message.d.ts +14 -0
  64. package/dist/context/notification.d.ts +14 -0
  65. package/dist/context/table.d.ts +917 -0
  66. package/dist/context/theme.d.ts +20 -0
  67. package/dist/hooks/index.d.ts +6 -0
  68. package/dist/hooks/useAdmin.d.ts +0 -0
  69. package/dist/hooks/useForm.d.ts +54 -0
  70. package/dist/hooks/useLayout.d.ts +116 -0
  71. package/dist/hooks/useProviderContext.d.ts +17 -0
  72. package/dist/hooks/useTable.d.ts +66 -0
  73. package/dist/hooks/useThemeOverrides.d.ts +8 -0
  74. package/dist/hooks/useUpload.d.ts +22 -0
  75. package/dist/index.css +36 -0
  76. package/dist/index.d.ts +29 -0
  77. package/dist/index.js +6771 -0
  78. package/dist/share/compact.d.ts +16 -0
  79. package/dist/share/index.d.ts +2 -0
  80. package/dist/share/menu.d.ts +0 -0
  81. package/dist/share/route.d.ts +0 -0
  82. package/dist/share/slot.d.ts +6 -0
  83. package/dist/utils/form.d.ts +0 -0
  84. package/dist/utils/index.d.ts +0 -0
  85. package/dist/utils/transformRoutes.d.ts +67 -0
  86. package/dist/utils/tree.d.ts +6 -0
  87. package/package.json +53 -0
  88. package/src/auto-imports.d.ts +73 -0
  89. package/src/components/breadcrumb/index.ts +0 -0
  90. package/src/components/breadcrumb/index.vue +0 -0
  91. package/src/components/breadcrumb/props.ts +0 -0
  92. package/src/components/button/action/index.ts +4 -0
  93. package/src/components/button/action/index.vue +313 -0
  94. package/src/components/button/action/props.ts +78 -0
  95. package/src/components/button/action/utils.ts +122 -0
  96. package/src/components/button/base/index.ts +4 -0
  97. package/src/components/button/base/index.vue +156 -0
  98. package/src/components/button/base/props.ts +29 -0
  99. package/src/components/button/index.ts +4 -0
  100. package/src/components/button/types.ts +2 -0
  101. package/src/components/form/helper.ts +73 -0
  102. package/src/components/form/index.ts +5 -0
  103. package/src/components/form/index.vue +243 -0
  104. package/src/components/form/props.ts +75 -0
  105. package/src/components/icon/IconPicker.vue +255 -0
  106. package/src/components/icon/iconify.ts +80 -0
  107. package/src/components/icon/index.ts +7 -0
  108. package/src/components/icon/index.vue +23 -0
  109. package/src/components/layout/const.ts +102 -0
  110. package/src/components/layout/context.ts +189 -0
  111. package/src/components/layout/index.ts +8 -0
  112. package/src/components/layout/index.vue +64 -0
  113. package/src/components/layout/layout-parts/AppBreadcrumb.vue +108 -0
  114. package/src/components/layout/layout-parts/AppFooter.vue +26 -0
  115. package/src/components/layout/layout-parts/AppHeader.vue +112 -0
  116. package/src/components/layout/layout-parts/AppLeftLogoInfo.vue +30 -0
  117. package/src/components/layout/layout-parts/AppMain.vue +34 -0
  118. package/src/components/layout/layout-parts/AppSidebar.vue +174 -0
  119. package/src/components/layout/layout-parts/LayoutTransition.vue +366 -0
  120. package/src/components/layout/mode.ts +0 -0
  121. package/src/components/layout/props.ts +36 -0
  122. package/src/components/layout/types.ts +79 -0
  123. package/src/components/layout/utils.ts +201 -0
  124. package/src/components/provider/index.ts +5 -0
  125. package/src/components/provider/index.vue +69 -0
  126. package/src/components/provider/props.ts +45 -0
  127. package/src/components/search-bar/index.ts +5 -0
  128. package/src/components/search-bar/index.vue +282 -0
  129. package/src/components/search-bar/props.ts +26 -0
  130. package/src/components/table/TableSetting.vue +253 -0
  131. package/src/components/table/index.ts +14 -0
  132. package/src/components/table/index.vue +179 -0
  133. package/src/components/table/props.ts +29 -0
  134. package/src/components/table/useColumn.ts +104 -0
  135. package/src/components/upload/enum.ts +21 -0
  136. package/src/components/upload/index.ts +9 -0
  137. package/src/components/upload/index.vue +267 -0
  138. package/src/components/upload/props.ts +8 -0
  139. package/src/components.d.ts +154 -0
  140. package/src/const/defaults.ts +94 -0
  141. package/src/const/index.ts +2 -0
  142. package/src/const/types.ts +139 -0
  143. package/src/context/color.ts +53 -0
  144. package/src/context/common.ts +27 -0
  145. package/src/context/index.ts +141 -0
  146. package/src/context/layout.ts +34 -0
  147. package/src/context/loading-bar.ts +26 -0
  148. package/src/context/locale.ts +22 -0
  149. package/src/context/menu.ts +26 -0
  150. package/src/context/message.ts +30 -0
  151. package/src/context/notification.ts +29 -0
  152. package/src/context/table.ts +32 -0
  153. package/src/context/theme.ts +35 -0
  154. package/src/hooks/index.ts +6 -0
  155. package/src/hooks/useAdmin.ts +0 -0
  156. package/src/hooks/useForm.ts +272 -0
  157. package/src/hooks/useLayout.ts +300 -0
  158. package/src/hooks/useProviderContext.ts +47 -0
  159. package/src/hooks/useTable.ts +241 -0
  160. package/src/hooks/useThemeOverrides.ts +18 -0
  161. package/src/hooks/useUpload.ts +82 -0
  162. package/src/index.ts +59 -0
  163. package/src/share/compact.ts +35 -0
  164. package/src/share/index.ts +2 -0
  165. package/src/share/menu.ts +0 -0
  166. package/src/share/route.ts +0 -0
  167. package/src/share/slot.ts +29 -0
  168. package/src/utils/form.ts +0 -0
  169. package/src/utils/index.ts +0 -0
  170. package/src/utils/transformRoutes.ts +163 -0
  171. package/src/utils/tree.ts +31 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Soybean
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # @quiteer/naive-extra
2
+
3
+ - [使用文档](https://quiteerjs.github.io/web/plugins/naive-extra/)
4
+ - [示例项目](https://web-naive-extra-test.vercel.app/)
5
+
6
+ 基于 Naive UI 的业务组件库封装,旨在让开发者更多关注数据逻辑,减少 UI 实现的繁琐细节。
7
+
8
+ ## 特性
9
+
10
+ - 🚀 **数据驱动**:通过配置对象生成表单、表格等组件,简化模板代码。
11
+ - 🧩 **高度封装**:内置常见业务逻辑(如搜索栏、确认按钮、带提示的按钮等)。
12
+ - 🎨 **响应式设计**:目标一切皆是响应式,配置极其灵活。
13
+ - 📦 **类型友好**:提供完整的 TypeScript 类型定义,支持类型推断。
14
+ - 🔌 **UnoCSS 集成**:推荐结合 UnoCSS 使用,样式更灵活。
15
+
16
+ ## 安装
17
+
18
+ ```bash
19
+ pnpm add @quiteer/naive-extra
20
+ ```
21
+
22
+ ## 核心组件
23
+
24
+ - **QuiForm**: 配置化表单组件。
25
+ - **QuiTable**: 增强型表格组件,支持自定义列配置 hook。
26
+ - **QuiSearchBar**: 基于表单配置的搜索栏组件。
27
+ - **QuiUpload**: 封装了常见文件类型限制和上传逻辑的上传组件。
28
+ - **QuiLayout**: 灵活的布局组件,支持多种布局模式。
29
+ - **QuiProvider**: 全局配置注入组件,简化 `NConfigProvider` 等的使用。
30
+ - **QuiButton**: 包含 `QuiPopconfirmButton` (二次确认) 和 `QuiTooltipButton` (带提示) 等。
31
+
32
+ ## 使用示例
33
+
34
+ ```vue
35
+ <script setup lang="ts">
36
+ import {
37
+ QuiForm,
38
+ QuiTable,
39
+ QuiSearchBar,
40
+ useUploadProps,
41
+ AcceptType
42
+ } from '@quiteer/naive-extra'
43
+ import type { FormSchema, TableProps } from '@quiteer/naive-extra'
44
+
45
+ // 1. 表单配置
46
+ const schemas: FormSchema[] = [
47
+ { field: 'name', label: '姓名', component: 'NInput', rules: [{ required: true }] },
48
+ { field: 'age', label: '年龄', component: 'NInputNumber' }
49
+ ]
50
+
51
+ // 2. 表格配置
52
+ const tableProps: TableProps = {
53
+ columns: [
54
+ { title: '姓名', key: 'name' },
55
+ { title: '年龄', key: 'age' }
56
+ ],
57
+ data: [
58
+ { name: 'John', age: 30 }
59
+ ]
60
+ }
61
+
62
+ // 3. 上传配置
63
+ const uploadProps = useUploadProps({
64
+ accept: AcceptType.Image
65
+ })
66
+
67
+ function handleSubmit(values: any) {
68
+ console.log('Search:', values)
69
+ }
70
+ </script>
71
+
72
+ <template>
73
+ <!-- 搜索栏 -->
74
+ <QuiSearchBar :schemas="schemas" @submit="handleSubmit" />
75
+
76
+ <!-- 表单 -->
77
+ <QuiForm :schemas="schemas" />
78
+
79
+ <!-- 表格 -->
80
+ <QuiTable v-bind="tableProps" />
81
+ </template>
82
+ ```
83
+
84
+ ## License
85
+
86
+ MIT
File without changes
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
3
+ export default _default;
File without changes
@@ -0,0 +1,3 @@
1
+ import { default as QuiActionButton } from './index.vue';
2
+ export * from './props';
3
+ export { QuiActionButton };
@@ -0,0 +1,118 @@
1
+ import { ActionButtonProps, ActionItem, ActionButtonMode } from './props';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, Ref, ComputedRef, GlobalComponents, GlobalDirectives } from 'vue';
3
+ import { Size } from 'naive-ui/es/button/src/interface';
4
+ import { ButtonProps, FlexAlign, FlexJustify } from 'naive-ui';
5
+ import { Theme } from 'naive-ui/es/_mixins';
6
+ import { ExtractThemeOverrides } from 'naive-ui/es/_mixins/use-theme';
7
+ import { RtlItem } from 'naive-ui/es/config-provider/src/internal-interface';
8
+ declare const _default: DefineComponent<ActionButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ActionButtonProps> & Readonly<{}>, {
9
+ size: Size;
10
+ mode: ActionButtonMode;
11
+ actions: ActionItem[];
12
+ max: number;
13
+ buttonProps: ButtonProps;
14
+ showDivider: boolean;
15
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
16
+ containerRef: CreateComponentPublicInstanceWithMixins<Readonly<globalThis.ExtractPropTypes<{
17
+ readonly align: PropType< FlexAlign>;
18
+ readonly justify: {
19
+ readonly type: PropType< FlexJustify>;
20
+ readonly default: "start";
21
+ };
22
+ readonly inline: BooleanConstructor;
23
+ readonly vertical: BooleanConstructor;
24
+ readonly reverse: BooleanConstructor;
25
+ readonly size: {
26
+ readonly type: PropType<"small" | "medium" | "large" | number | [number, number]>;
27
+ readonly default: "medium";
28
+ };
29
+ readonly wrap: {
30
+ readonly type: BooleanConstructor;
31
+ readonly default: true;
32
+ };
33
+ readonly theme: PropType< Theme<"Flex", {
34
+ gapSmall: string;
35
+ gapMedium: string;
36
+ gapLarge: string;
37
+ }, any>>;
38
+ readonly themeOverrides: PropType< ExtractThemeOverrides<Theme<"Flex", {
39
+ gapSmall: string;
40
+ gapMedium: string;
41
+ gapLarge: string;
42
+ }, any>>>;
43
+ readonly builtinThemeOverrides: PropType< ExtractThemeOverrides<Theme<"Flex", {
44
+ gapSmall: string;
45
+ gapMedium: string;
46
+ gapLarge: string;
47
+ }, any>>>;
48
+ }>> & Readonly<{}>, {
49
+ rtlEnabled: Ref< RtlItem | undefined, RtlItem | undefined> | undefined;
50
+ mergedClsPrefix: Ref<string, string>;
51
+ margin: ComputedRef<{
52
+ horizontal: number;
53
+ vertical: number;
54
+ }>;
55
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
56
+ readonly inline: boolean;
57
+ readonly size: number | [number, number] | "small" | "medium" | "large";
58
+ readonly reverse: boolean;
59
+ readonly wrap: boolean;
60
+ readonly vertical: boolean;
61
+ readonly justify: import("csstype").Property.JustifyContent;
62
+ }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
63
+ P: {};
64
+ B: {};
65
+ D: {};
66
+ C: {};
67
+ M: {};
68
+ Defaults: {};
69
+ }, Readonly<globalThis.ExtractPropTypes<{
70
+ readonly align: PropType< FlexAlign>;
71
+ readonly justify: {
72
+ readonly type: PropType< FlexJustify>;
73
+ readonly default: "start";
74
+ };
75
+ readonly inline: BooleanConstructor;
76
+ readonly vertical: BooleanConstructor;
77
+ readonly reverse: BooleanConstructor;
78
+ readonly size: {
79
+ readonly type: PropType<"small" | "medium" | "large" | number | [number, number]>;
80
+ readonly default: "medium";
81
+ };
82
+ readonly wrap: {
83
+ readonly type: BooleanConstructor;
84
+ readonly default: true;
85
+ };
86
+ readonly theme: PropType< Theme<"Flex", {
87
+ gapSmall: string;
88
+ gapMedium: string;
89
+ gapLarge: string;
90
+ }, any>>;
91
+ readonly themeOverrides: PropType< ExtractThemeOverrides<Theme<"Flex", {
92
+ gapSmall: string;
93
+ gapMedium: string;
94
+ gapLarge: string;
95
+ }, any>>>;
96
+ readonly builtinThemeOverrides: PropType< ExtractThemeOverrides<Theme<"Flex", {
97
+ gapSmall: string;
98
+ gapMedium: string;
99
+ gapLarge: string;
100
+ }, any>>>;
101
+ }>> & Readonly<{}>, {
102
+ rtlEnabled: Ref< RtlItem | undefined, RtlItem | undefined> | undefined;
103
+ mergedClsPrefix: Ref<string, string>;
104
+ margin: ComputedRef<{
105
+ horizontal: number;
106
+ vertical: number;
107
+ }>;
108
+ }, {}, {}, {}, {
109
+ readonly inline: boolean;
110
+ readonly size: number | [number, number] | "small" | "medium" | "large";
111
+ readonly reverse: boolean;
112
+ readonly wrap: boolean;
113
+ readonly vertical: boolean;
114
+ readonly justify: import("csstype").Property.JustifyContent;
115
+ }> | null;
116
+ shadowRef: HTMLDivElement;
117
+ }, any>;
118
+ export default _default;
@@ -0,0 +1,63 @@
1
+ import { ButtonProps, PopconfirmProps } from 'naive-ui';
2
+ import { Ref } from 'vue';
3
+ import { ButtonPermission } from '../base/props';
4
+ export type ActionButtonMode = 'icon' | 'text' | 'icon-text' | 'button' | 'secondary';
5
+ export declare enum ActionEnum {
6
+ EDIT = "edit",
7
+ DELETE = "delete",
8
+ VIEW = "view",
9
+ ADD = "add",
10
+ SEARCH = "search",
11
+ DOWNLOAD = "download",
12
+ UPLOAD = "upload",
13
+ SETTING = "setting"
14
+ }
15
+ export interface ActionItem {
16
+ /** 唯一标识,也是默认的图标映射键值 */
17
+ key: ActionEnum | string;
18
+ /** 按钮显示文本 */
19
+ label: string;
20
+ /** 按钮尺寸 */
21
+ size?: ButtonProps['size'];
22
+ /** 图标名称,如果不传则显示 defaultIcon */
23
+ icon?: string;
24
+ /** 按钮属性 */
25
+ props?: ButtonProps;
26
+ /** 点击事件 */
27
+ onClick?: (key: ActionEnum | string, item: ActionItem) => void;
28
+ /** 是否显示 */
29
+ show?: boolean | (() => boolean) | Ref<boolean>;
30
+ /** 是否禁用 */
31
+ disabled?: boolean | (() => boolean) | Ref<boolean>;
32
+ /** 提示文本,默认使用 label */
33
+ tooltip?: string;
34
+ /** 二次确认框配置,存在则开启二次确认 */
35
+ popconfirm?: PopconfirmProps;
36
+ /** 确认框内容 */
37
+ popText?: string;
38
+ /** 确认按钮文字 */
39
+ positiveText?: string;
40
+ /** 取消按钮文字 */
41
+ negativeText?: string;
42
+ /** 确认回调 */
43
+ onPositiveClick?: (key: ActionEnum | string, item: ActionItem) => void;
44
+ /** 权限控制 */
45
+ permission?: ButtonPermission;
46
+ }
47
+ export declare const DEFAULT_ACTION_ICONS: Record<string, string>;
48
+ export interface ActionButtonProps {
49
+ /** 操作按钮列表 */
50
+ actions?: ActionItem[];
51
+ /** 显示模式:纯图标 | 纯文字 | 图标+文字 */
52
+ mode?: ActionButtonMode;
53
+ /** 最大显示数量,超过折叠 */
54
+ max?: number;
55
+ /** 统一的按钮属性 */
56
+ buttonProps?: ButtonProps;
57
+ /** 按钮尺寸 */
58
+ size?: ButtonProps['size'];
59
+ /** 是否显示分割线 */
60
+ showDivider?: boolean;
61
+ /** 是否开启响应式折叠,开启后 max 属性失效,根据宽度自动计算显示数量 */
62
+ responsive?: boolean;
63
+ }
@@ -0,0 +1,8 @@
1
+ import { ButtonProps } from 'naive-ui';
2
+ import { BaseButtonProps } from '../base/props';
3
+ import { ActionButtonMode, ActionItem } from './props';
4
+ export declare function getIcon(item: ActionItem): string;
5
+ export declare function isDisabled(item: ActionItem): boolean;
6
+ export declare function getPopconfirmProps(item: ActionItem): any;
7
+ export declare function resolveButtonProps(item: ActionItem, mode?: ActionButtonMode, defaultButtonProps?: ButtonProps): Omit<Partial<BaseButtonProps>, 'onClick'>;
8
+ export declare function resolveMoreButtonProps(mode?: ActionButtonMode, defaultButtonProps?: ButtonProps): Omit<Partial<BaseButtonProps>, 'onClick'>;
@@ -0,0 +1,3 @@
1
+ import { default as QuiBaseButton } from './index.vue';
2
+ export * from './props';
3
+ export { QuiBaseButton };
@@ -0,0 +1,36 @@
1
+ import { BaseButtonProps } from './props';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ import { Size, Type } from 'naive-ui/es/button/src/interface';
4
+ declare function __VLS_template(): {
5
+ attrs: Partial<{}>;
6
+ slots: {
7
+ default?(_: {}): any;
8
+ default?(_: {}): any;
9
+ default?(_: {}): any;
10
+ popconfirm?(_: {}): any;
11
+ tooltip?(_: {}): any;
12
+ };
13
+ refs: {};
14
+ rootEl: any;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: DefineComponent<BaseButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
18
+ click: (e: MouseEvent) => any;
19
+ positiveClick: (e: MouseEvent) => any;
20
+ }, string, PublicProps, Readonly<BaseButtonProps> & Readonly<{
21
+ onClick?: ((e: MouseEvent) => any) | undefined;
22
+ onPositiveClick?: ((e: MouseEvent) => any) | undefined;
23
+ }>, {
24
+ text: boolean;
25
+ disabled: boolean;
26
+ size: Size;
27
+ secondary: boolean;
28
+ type: Type;
29
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
30
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
+ export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,27 @@
1
+ import { ButtonProps, PopconfirmProps } from 'naive-ui';
2
+ export interface ButtonPermission {
3
+ /** 权限组:[拥有的权限列表, 需要的权限] */
4
+ group: [string[], string];
5
+ /** 是否禁用 */
6
+ disabled?: boolean;
7
+ /** 是否显示 */
8
+ show?: boolean;
9
+ }
10
+ export interface BaseButtonProps extends /* @vue-ignore */ ButtonProps {
11
+ /** 图标名称 */
12
+ icon?: string;
13
+ /** 提示文本 */
14
+ tooltip?: string;
15
+ /** 是否为文本按钮 */
16
+ text?: boolean;
17
+ /** Popconfirm 配置 */
18
+ popconfirm?: PopconfirmProps;
19
+ /** Popconfirm 内容文本 */
20
+ popText?: string;
21
+ /** Popconfirm 确认按钮文本 */
22
+ positiveText?: string;
23
+ /** Popconfirm 取消按钮文本 */
24
+ negativeText?: string;
25
+ /** 权限 */
26
+ permission?: ButtonPermission;
27
+ }
@@ -0,0 +1,4 @@
1
+ export { QuiActionButton } from './action';
2
+ export type { ActionItem } from './action';
3
+ export { QuiBaseButton } from './base';
4
+ export type { BaseButtonProps } from './base';
@@ -0,0 +1,2 @@
1
+ export type { ActionButtonMode, ActionItem } from './action';
2
+ export type { BaseButtonProps } from './base';
@@ -0,0 +1,11 @@
1
+ import { Recordable } from '../../const';
2
+ import { FormSchema } from './props';
3
+ export declare function handleFormValues(values: Recordable): Recordable;
4
+ export declare function getComponentProps(schema: FormSchema, disabled: boolean): {
5
+ readonly: boolean;
6
+ clearable: boolean;
7
+ } | {
8
+ clearable: boolean;
9
+ disabled: boolean;
10
+ };
11
+ export declare function getComponent(schema: FormSchema): any;
@@ -0,0 +1,3 @@
1
+ import { default as QuiForm } from './index.vue';
2
+ export { QuiForm };
3
+ export type { CustomSwitchProps, Props as FormProps, FormSchema } from './props';