@wapri/element-pro 3.0.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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/dist/CheckCard/Group.vue.d.ts +54 -0
  3. package/dist/CheckCard/context.d.ts +12 -0
  4. package/dist/CheckCard/index.d.ts +443 -0
  5. package/dist/CheckCard/index.vue.d.ts +53 -0
  6. package/dist/CheckCard/selection.d.ts +4 -0
  7. package/dist/CheckCard/types.d.ts +29 -0
  8. package/dist/ConfigProvider/context.d.ts +11 -0
  9. package/dist/ConfigProvider/index.d.ts +50 -0
  10. package/dist/ConfigProvider/index.vue.d.ts +28 -0
  11. package/dist/CropperUpload/CropperDialog.vue.d.ts +23 -0
  12. package/dist/CropperUpload/index.d.ts +241 -0
  13. package/dist/CropperUpload/index.vue.d.ts +81 -0
  14. package/dist/CropperUpload/types.d.ts +137 -0
  15. package/dist/CropperUpload/utils.d.ts +42 -0
  16. package/dist/DateQuickSelect/index.d.ts +65 -0
  17. package/dist/DateQuickSelect/index.vue.d.ts +55 -0
  18. package/dist/DateQuickSelect/types.d.ts +19 -0
  19. package/dist/DateQuickSelect/utils.d.ts +9 -0
  20. package/dist/DrawerForm/index.d.ts +201 -0
  21. package/dist/DrawerForm/index.vue.d.ts +76 -0
  22. package/dist/Ellipsis/index.d.ts +35 -0
  23. package/dist/Ellipsis/types.d.ts +23 -0
  24. package/dist/Layout/components/SidebarTrigger.vue.d.ts +21 -0
  25. package/dist/Layout/index.d.ts +147 -0
  26. package/dist/Layout/index.vue.d.ts +65 -0
  27. package/dist/Layout/types.d.ts +24 -0
  28. package/dist/MainContent/index.d.ts +115 -0
  29. package/dist/MainContent/index.vue.d.ts +51 -0
  30. package/dist/MainContent/types.d.ts +17 -0
  31. package/dist/ModalForm/index.d.ts +201 -0
  32. package/dist/ModalForm/index.vue.d.ts +76 -0
  33. package/dist/ProTable/components/ProTablePagination.vue.d.ts +43 -0
  34. package/dist/ProTable/components/ProTableSearchForm.vue.d.ts +34 -0
  35. package/dist/ProTable/components/ProTableSelectedFilters.vue.d.ts +21 -0
  36. package/dist/ProTable/components/ProTableSelectionActions.vue.d.ts +36 -0
  37. package/dist/ProTable/components/ProTableToolbar.vue.d.ts +47 -0
  38. package/dist/ProTable/composables/useProTableData.d.ts +34 -0
  39. package/dist/ProTable/composables/useProTableSelection.d.ts +10 -0
  40. package/dist/ProTable/composables/useStickyTable.d.ts +18 -0
  41. package/dist/ProTable/index.d.ts +412 -0
  42. package/dist/ProTable/index.vue.d.ts +54 -0
  43. package/dist/ProTable/types.d.ts +265 -0
  44. package/dist/ProTable/utils.d.ts +25 -0
  45. package/dist/ShareButton/index.d.ts +157 -0
  46. package/dist/ShareButton/index.vue.d.ts +60 -0
  47. package/dist/ShareButton/steps.d.ts +13 -0
  48. package/dist/ShareButton/types.d.ts +34 -0
  49. package/dist/Sidebar/components/SidebarGroup.vue.d.ts +53 -0
  50. package/dist/Sidebar/components/SidebarIcon.vue.d.ts +23 -0
  51. package/dist/Sidebar/components/SidebarItem.vue.d.ts +33 -0
  52. package/dist/Sidebar/components/SidebarItemContent.vue.d.ts +27 -0
  53. package/dist/Sidebar/components/SidebarLink.vue.d.ts +54 -0
  54. package/dist/Sidebar/components/SidebarLogo.vue.d.ts +48 -0
  55. package/dist/Sidebar/composables/useActiveMenuScroll.d.ts +18 -0
  56. package/dist/Sidebar/context.d.ts +10 -0
  57. package/dist/Sidebar/index.d.ts +350 -0
  58. package/dist/Sidebar/index.vue.d.ts +72 -0
  59. package/dist/Sidebar/types.d.ts +154 -0
  60. package/dist/Sidebar/utils.d.ts +16 -0
  61. package/dist/SvgIcon/iconfont.d.ts +11 -0
  62. package/dist/SvgIcon/index.d.ts +35 -0
  63. package/dist/SvgIcon/index.vue.d.ts +38 -0
  64. package/dist/TagSelector/index.d.ts +51 -0
  65. package/dist/TagSelector/index.vue.d.ts +49 -0
  66. package/dist/TagSelector/types.d.ts +6 -0
  67. package/dist/VH100/index.d.ts +40 -0
  68. package/dist/VH100/index.vue.d.ts +26 -0
  69. package/dist/constant/index.d.ts +1 -0
  70. package/dist/index.d.ts +38 -0
  71. package/dist/index.mjs +3985 -0
  72. package/dist/shared/overlayForm/types.d.ts +25 -0
  73. package/dist/shared/overlayForm/useOverlayForm.d.ts +18 -0
  74. package/dist/style.css +1 -0
  75. package/dist/utils/install.d.ts +10 -0
  76. package/package.json +39 -0
@@ -0,0 +1,265 @@
1
+ import { AlertProps, CascaderProps, ColProps, DatePickerProps, FormItemProps, InputNumberProps, InputProps, SelectProps, SwitchProps, TableProps } from 'element-plus';
2
+ import { Ref, VNode, VNodeChild } from 'vue';
3
+ import { DateQuickSelectConfig as DateQuickSelectConfigProps, DateQuickSelectSelection, DateQuickSelectValueType } from '../DateQuickSelect';
4
+
5
+ export type Key = string | number;
6
+ export type DataIndex = string | string[];
7
+ export type SortOrder = 'ascend' | 'descend' | null;
8
+ export type ProTableMode = 'table' | 'list';
9
+ export type ValueType = 'text' | 'textarea' | 'password' | 'digit' | 'money' | 'select' | 'tag' | 'treeSelect' | 'cascader' | 'date' | 'dateRange' | 'time' | 'timeRange' | 'switch' | 'customer';
10
+ export type ProTableDateValueType = DateQuickSelectValueType;
11
+ export interface ValueEnumItem {
12
+ text: string;
13
+ value: Key;
14
+ status?: string;
15
+ disabled?: boolean;
16
+ children?: ValueEnumItem[];
17
+ }
18
+ export type ValueEnum = Record<string, string | number | Omit<ValueEnumItem, 'value'>> | ValueEnumItem[];
19
+ /** 标签选择器配置。 */
20
+ export interface TagSelectorProps {
21
+ /** 是否允许多选,默认 false。 */
22
+ multiple?: boolean;
23
+ /** 是否展示用于清空筛选条件的“全部”标签,默认 true。 */
24
+ showAll?: boolean;
25
+ /** “全部”标签的文案,默认“全部”。 */
26
+ allText?: string;
27
+ }
28
+ export type DateQuickSelectConfig = DateQuickSelectConfigProps;
29
+ export type DateQuickSelect = boolean | DateQuickSelectConfig;
30
+ export type ProTableDateQuickSelection = DateQuickSelectSelection;
31
+ export interface ProTableRequestContext {
32
+ /** 当前请求中通过日期快捷项选中的字段;手动选择的字段不会出现在此对象中。 */
33
+ quickDateSelections: Record<string, ProTableDateQuickSelection>;
34
+ }
35
+ export type CellRenderer<T> = (value: unknown, record: T, index: number) => VNodeChild;
36
+ /** 组件 props 允许补充 Vue 事件监听等 Element Plus 未声明在 props 类型中的属性。 */
37
+ export type ProComponentProps<T extends object = Record<string, unknown>> = Partial<T> & Record<string, unknown>;
38
+ export type SearchFormItemRenderer<T> = (value: unknown, column: ProColumn<T>, setValue: (value: unknown) => void) => VNodeChild;
39
+ export interface ProColumn<T = Record<string, unknown>> {
40
+ title: string;
41
+ dataIndex: DataIndex;
42
+ valueType?: ValueType;
43
+ valueEnum?: ValueEnum;
44
+ render?: CellRenderer<T>;
45
+ renderText?: (value: unknown, record: T, index: number) => unknown;
46
+ renderFormItem?: SearchFormItemRenderer<T>;
47
+ search?: boolean;
48
+ hideInTable?: boolean;
49
+ hideInForm?: boolean;
50
+ width?: number | string;
51
+ fixed?: boolean | 'left' | 'right';
52
+ ellipsis?: boolean;
53
+ sorter?: boolean | ((left: T, right: T) => number);
54
+ filters?: boolean | Array<{
55
+ text: string;
56
+ value: Key;
57
+ }>;
58
+ initialValue?: unknown;
59
+ fieldProps?: {
60
+ col?: ColProps;
61
+ labelWidth?: number;
62
+ requestNow?: boolean;
63
+ } & Record<string, unknown>;
64
+ /** 搜索表单项的 props,透传给 ElFormItem。 */
65
+ formItemProps?: ProComponentProps<FormItemProps>;
66
+ /** 搜索项栅格的 props,优先级高于 fieldProps.col。 */
67
+ colProps?: ColProps;
68
+ /** 表格列的 props,透传给 ElTableColumn。 */
69
+ columnProps?: ProComponentProps;
70
+ /** valueType=text/textarea/password/money 使用的 ElInput props。 */
71
+ inputProps?: ProComponentProps<InputProps>;
72
+ /** valueType=digit 使用的 ElInputNumber props。 */
73
+ inputNumberProps?: ProComponentProps<InputNumberProps>;
74
+ /** valueType=select 使用的 ElSelect props。 */
75
+ selectProps?: ProComponentProps<SelectProps>;
76
+ /** valueType=tag 使用的标签选择器配置,选项由 valueEnum 提供,搜索项默认占满一行。 */
77
+ tagProps?: TagSelectorProps;
78
+ /** valueType=treeSelect 使用的 ElTreeSelect props。 */
79
+ treeSelectProps?: ProComponentProps<SelectProps>;
80
+ /** valueType=cascader 使用的 ElCascader props。 */
81
+ cascaderProps?: ProComponentProps<CascaderProps>;
82
+ /** valueType=date/dateRange/time/timeRange 使用的 ElDatePicker props。 */
83
+ datePickerProps?: ProComponentProps<DatePickerProps>;
84
+ /** date/dateRange/time/timeRange 的快捷选择配置,默认关闭。开启时搜索项默认占满一行,且与自定义日期选择互斥。 */
85
+ dateQuickSelect?: DateQuickSelect;
86
+ /** valueType=switch 使用的 ElSwitch props。 */
87
+ switchProps?: ProComponentProps<SwitchProps>;
88
+ }
89
+ export type SortState = Record<string, SortOrder>;
90
+ export type FilterState = Record<string, Key[] | null>;
91
+ export type RequestParams<U extends Record<string, unknown> = Record<string, unknown>> = U & {
92
+ current: number;
93
+ pageSize: number;
94
+ };
95
+ export interface RequestResult<T> {
96
+ data: T[];
97
+ success?: boolean;
98
+ total?: number;
99
+ }
100
+ export type RequestFn<T, U extends Record<string, unknown> = Record<string, unknown>> = (params: RequestParams<U>, sort: SortState, filter: FilterState, context: ProTableRequestContext) => Promise<RequestResult<T>>;
101
+ export type DownloadFn<U extends Record<string, unknown> = Record<string, unknown>> = (params: RequestParams<U>, sort: SortState, filter: FilterState, context: ProTableRequestContext) => void | Promise<void>;
102
+ export interface PaginationConfig {
103
+ current?: number;
104
+ pageSize?: number;
105
+ pageSizeOptions?: number[];
106
+ showQuickJumper?: boolean;
107
+ showTotal?: boolean;
108
+ }
109
+ export interface RowSelectionConfig<T> {
110
+ selectedRowKeys?: Key[];
111
+ onChange?: (keys: Key[], rows: T[]) => void;
112
+ /** 没有选中行时是否仍显示选中操作行。 */
113
+ alwaysShowActions?: boolean;
114
+ /** @deprecated 请使用 alwaysShowActions。 */
115
+ alwaysShowAlert?: boolean;
116
+ }
117
+ export interface SearchConfig {
118
+ searchText?: string;
119
+ resetText?: string;
120
+ labelWidth?: number | 'auto';
121
+ }
122
+ export interface ProTableFormConfig extends SearchConfig {
123
+ filterType?: 'query' | 'light';
124
+ }
125
+ export interface PageInfo {
126
+ current: number;
127
+ pageSize: number;
128
+ total: number;
129
+ }
130
+ export interface ProTableTabItem {
131
+ key: Key;
132
+ tab: string;
133
+ /** Tab 右侧的数量徽标。 */
134
+ count?: number | string;
135
+ disabled?: boolean;
136
+ }
137
+ export interface ProTableTabMoreConfig {
138
+ /** 更多状态下拉菜单的触发文案,默认“更多状态”。 */
139
+ text?: string;
140
+ /** 下拉中的更多状态项。 */
141
+ options: ProTableTabItem[];
142
+ }
143
+ export interface ProTableListProps {
144
+ /** 列表网格列数,默认 3。 */
145
+ columns?: number;
146
+ /** 列表网格间距,默认 12px。 */
147
+ gap?: number | string;
148
+ }
149
+ export interface ProTableFormAction {
150
+ /** 获取当前查询表单的全部字段值。 */
151
+ getFieldsValue: () => Record<string, unknown>;
152
+ /** 获取指定查询字段的值。 */
153
+ getFieldValue: (field: string) => unknown;
154
+ /** 批量设置查询表单字段值,不会自动提交查询。 */
155
+ setFieldsValue: (values: Record<string, unknown>) => void;
156
+ /** 设置指定查询字段的值,不会自动提交查询。 */
157
+ setFieldValue: (field: string, value: unknown) => void;
158
+ /** 提交当前查询表单并刷新数据。 */
159
+ submit: () => Promise<void>;
160
+ /** 重置查询表单。 */
161
+ resetFields: (names?: string[] | undefined) => void;
162
+ }
163
+ export interface ActionType<T extends object = object> {
164
+ reload: (resetPageIndex?: boolean) => Promise<void>;
165
+ reloadAndRest: () => Promise<void>;
166
+ reset: () => Promise<void>;
167
+ clearSelected: () => void;
168
+ setPageInfo: (page: Partial<PageInfo>) => void;
169
+ /** 控制指定树形数据行的展开状态;不传 expanded 时切换当前状态。 */
170
+ toggleRowExpansion: (row: T, expanded?: boolean) => void;
171
+ /** 展开当前已加载树形数据中的全部父级节点。 */
172
+ expandAll: () => void;
173
+ /** 收起当前已加载树形数据中的全部父级节点。 */
174
+ collapseAll: () => void;
175
+ formRef: ProTableFormAction;
176
+ }
177
+ /**
178
+ * actionRef 容器:可直接传 Vue ref(JSX / JS 作用域传参),
179
+ * 也可传 `{ current }` 容器对象(模板 `:action-ref` 绑定不会被解包的形态)。
180
+ */
181
+ export type ActionRef<T extends object = object> = Ref<ActionType<T> | undefined> | {
182
+ current?: ActionType<T>;
183
+ };
184
+ export interface ProTableOptions {
185
+ reload?: boolean;
186
+ }
187
+ export type ProTableDownload = boolean | string | VNode;
188
+ /**
189
+ * 粘性布局配置,对齐 ant-design Table `sticky`:
190
+ * 表格模式下页面滚动时表头吸顶,横向溢出时底部滚动条吸底;列表模式下分页 footer 仍吸底。
191
+ */
192
+ export interface StickyConfig {
193
+ /** 粘性表头距离滚动容器顶部的偏移,默认 0 */
194
+ offsetHeader?: number;
195
+ /** 粘性滚动条距离滚动容器底部的偏移,默认 0 */
196
+ offsetScroll?: number;
197
+ /** 滚动容器,默认 window */
198
+ getContainer?: () => HTMLElement | Window;
199
+ }
200
+ export interface ProTableProps<T extends object = Record<string, unknown>, U extends Record<string, unknown> = Record<string, unknown>> {
201
+ columns: ProColumn<T>[];
202
+ dataSource?: T[];
203
+ defaultData?: T[];
204
+ request?: RequestFn<T, U>;
205
+ params?: U;
206
+ pagination?: false | PaginationConfig;
207
+ rowKey?: string | ((record: T, index: number) => Key);
208
+ rowSelection?: false | RowSelectionConfig<T>;
209
+ search?: false | SearchConfig;
210
+ form?: ProTableFormConfig;
211
+ tabs?: ProTableTabItem[];
212
+ /** 更多状态下拉配置。 */
213
+ tabMore?: ProTableTabMoreConfig;
214
+ /** 可用的数据展示模式,默认仅展示表格。 */
215
+ modes?: ProTableMode[];
216
+ /** 列表模式的内置网格配置。 */
217
+ listProps?: ProTableListProps;
218
+ tabActiveKey?: Key;
219
+ defaultTabActiveKey?: Key;
220
+ headerTitle?: VNodeChild;
221
+ headerSubtitle?: VNodeChild;
222
+ headerAlert?: AlertProps;
223
+ /** 工具栏导出按钮配置;传 true 时默认显示“导出”。 */
224
+ download?: ProTableDownload;
225
+ /**
226
+ * 已选条件条前缀文案
227
+ * @default '已筛选'
228
+ */
229
+ selectedFiltersTitle?: string;
230
+ toolBarRender?: (action: ActionType<T>, context: {
231
+ selectedRowKeys: Key[];
232
+ selectedRows: T[];
233
+ }) => Array<VNodeChild> | false;
234
+ options?: false | ProTableOptions;
235
+ beforeSearchSubmit?: (params: RequestParams<U>) => RequestParams<U>;
236
+ manualRequest?: boolean;
237
+ columnEmptyText?: string | false;
238
+ loading?: boolean;
239
+ onLoad?: (data: T[]) => void;
240
+ onRequestError?: (error: Error) => void;
241
+ onSubmit?: (params: RequestParams<U>) => void;
242
+ onReset?: () => void;
243
+ /** 查询表单字段值发生变化时触发,支持同步或异步回调;第三个参数可区分日期快捷选择和手动选择。 */
244
+ onFieldChange?: (fieldKey: string, value: unknown, context: ProTableRequestContext) => void | Promise<void>;
245
+ onTabChange?: (key: Key) => void;
246
+ /** 数据展示模式切换时触发。 */
247
+ onModeChange?: (mode: ProTableMode) => void;
248
+ onDataSourceChange?: (data: T[]) => void;
249
+ /** 点击工具栏导出按钮时触发。 */
250
+ onDownload?: DownloadFn<U>;
251
+ actionRef?: ActionRef<T>;
252
+ /**
253
+ * 粘性表头与底部横向滚动条,行为对齐 ant-design Table `sticky`。
254
+ * `true` 等同 `{ offsetHeader: 0, offsetScroll: 0 }`。
255
+ */
256
+ sticky?: boolean | StickyConfig;
257
+ /**
258
+ * @default false
259
+ * */
260
+ showRequestError?: boolean;
261
+ /**
262
+ * 可透传给Table的props
263
+ * */
264
+ tableProps?: TableProps;
265
+ }
@@ -0,0 +1,25 @@
1
+ import { DataIndex, Key, ValueEnum, ValueEnumItem } from './types';
2
+
3
+ export interface TreeSelectOption {
4
+ label: string;
5
+ value: Key;
6
+ disabled?: boolean;
7
+ children?: TreeSelectOption[];
8
+ /** 索引签名:兼容 el-cascader 的 CascaderOption 结构。 */
9
+ [key: string]: unknown;
10
+ }
11
+ export declare function getDataIndexValue<T extends object>(record: T, dataIndex: DataIndex): unknown;
12
+ export declare function getDataIndexKey(dataIndex: DataIndex): string;
13
+ export declare function getValueEnumOptions(valueEnum?: ValueEnum): ValueEnumItem[];
14
+ /** 将 valueEnum 转为 el-tree-select / el-cascader 可用的树形数据。 */
15
+ export declare function toTreeOptions(valueEnum?: ValueEnum): TreeSelectOption[];
16
+ /** 在树形枚举中查找值的完整路径(含自身),未命中返回 null。 */
17
+ export declare function findEnumPath(options: ValueEnumItem[], target: Key): ValueEnumItem[] | null;
18
+ /**
19
+ * 格式化单元格文本:
20
+ * - 空值返回占位符
21
+ * - valueEnum 命中(支持 children 深层)返回枚举文本,深层值用 " / " 拼接父级
22
+ * - 数组值(dateRange / timeRange / cascader 路径)逐项解析后用 " ~ " 连接
23
+ */
24
+ export declare function formatCellValue(value: unknown, columnEmptyText?: string | false, valueEnum?: ValueEnum): string;
25
+ export declare function getRecordKey<T extends object>(record: T, index: number, rowKey?: string | ((record: T, index: number) => Key)): Key;
@@ -0,0 +1,157 @@
1
+ export declare const ShareButton: import('../utils/install').SFCWithInstall<{
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
3
+ disabled: {
4
+ type: import('vue').PropType<boolean>;
5
+ default: boolean;
6
+ };
7
+ link: {
8
+ type: import('vue').PropType<string>;
9
+ required: true;
10
+ };
11
+ text: {
12
+ type: import('vue').PropType<string>;
13
+ default: string;
14
+ };
15
+ showArrow: {
16
+ type: import('vue').PropType<boolean>;
17
+ default: boolean;
18
+ };
19
+ forceGuide: {
20
+ type: import('vue').PropType<boolean>;
21
+ default: boolean;
22
+ };
23
+ guideTitle: {
24
+ type: import('vue').PropType<string>;
25
+ default: string;
26
+ };
27
+ guideSteps: {
28
+ type: import('vue').PropType<string[]>;
29
+ default: () => string[];
30
+ };
31
+ actionText: {
32
+ type: import('vue').PropType<string>;
33
+ default: string;
34
+ };
35
+ }>> & Readonly<{
36
+ onCopy?: ((link: string) => any) | undefined;
37
+ onShare?: ((link: string) => any) | undefined;
38
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
39
+ copy: (link: string) => void;
40
+ share: (link: string) => void;
41
+ }, import('vue').PublicProps, {
42
+ disabled: boolean;
43
+ text: string;
44
+ showArrow: boolean;
45
+ forceGuide: boolean;
46
+ guideTitle: string;
47
+ guideSteps: string[];
48
+ actionText: string;
49
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
50
+ P: {};
51
+ B: {};
52
+ D: {};
53
+ C: {};
54
+ M: {};
55
+ Defaults: {};
56
+ }, Readonly<import('vue').ExtractPropTypes<{
57
+ disabled: {
58
+ type: import('vue').PropType<boolean>;
59
+ default: boolean;
60
+ };
61
+ link: {
62
+ type: import('vue').PropType<string>;
63
+ required: true;
64
+ };
65
+ text: {
66
+ type: import('vue').PropType<string>;
67
+ default: string;
68
+ };
69
+ showArrow: {
70
+ type: import('vue').PropType<boolean>;
71
+ default: boolean;
72
+ };
73
+ forceGuide: {
74
+ type: import('vue').PropType<boolean>;
75
+ default: boolean;
76
+ };
77
+ guideTitle: {
78
+ type: import('vue').PropType<string>;
79
+ default: string;
80
+ };
81
+ guideSteps: {
82
+ type: import('vue').PropType<string[]>;
83
+ default: () => string[];
84
+ };
85
+ actionText: {
86
+ type: import('vue').PropType<string>;
87
+ default: string;
88
+ };
89
+ }>> & Readonly<{
90
+ onCopy?: ((link: string) => any) | undefined;
91
+ onShare?: ((link: string) => any) | undefined;
92
+ }>, {}, {}, {}, {}, {
93
+ disabled: boolean;
94
+ text: string;
95
+ showArrow: boolean;
96
+ forceGuide: boolean;
97
+ guideTitle: string;
98
+ guideSteps: string[];
99
+ actionText: string;
100
+ }>;
101
+ __isFragment?: never;
102
+ __isTeleport?: never;
103
+ __isSuspense?: never;
104
+ } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
105
+ disabled: {
106
+ type: import('vue').PropType<boolean>;
107
+ default: boolean;
108
+ };
109
+ link: {
110
+ type: import('vue').PropType<string>;
111
+ required: true;
112
+ };
113
+ text: {
114
+ type: import('vue').PropType<string>;
115
+ default: string;
116
+ };
117
+ showArrow: {
118
+ type: import('vue').PropType<boolean>;
119
+ default: boolean;
120
+ };
121
+ forceGuide: {
122
+ type: import('vue').PropType<boolean>;
123
+ default: boolean;
124
+ };
125
+ guideTitle: {
126
+ type: import('vue').PropType<string>;
127
+ default: string;
128
+ };
129
+ guideSteps: {
130
+ type: import('vue').PropType<string[]>;
131
+ default: () => string[];
132
+ };
133
+ actionText: {
134
+ type: import('vue').PropType<string>;
135
+ default: string;
136
+ };
137
+ }>> & Readonly<{
138
+ onCopy?: ((link: string) => any) | undefined;
139
+ onShare?: ((link: string) => any) | undefined;
140
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
141
+ copy: (link: string) => void;
142
+ share: (link: string) => void;
143
+ }, string, {
144
+ disabled: boolean;
145
+ text: string;
146
+ showArrow: boolean;
147
+ forceGuide: boolean;
148
+ guideTitle: string;
149
+ guideSteps: string[];
150
+ actionText: string;
151
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
152
+ $slots: {
153
+ default?(_: {}): any;
154
+ };
155
+ })> & Record<string, unknown>;
156
+ export * from './types';
157
+ export default ShareButton;
@@ -0,0 +1,60 @@
1
+ import { ShareButtonProps } from './types';
2
+
3
+ declare function __VLS_template(): {
4
+ default?(_: {}): any;
5
+ };
6
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ShareButtonProps>, {
7
+ text: string;
8
+ disabled: boolean;
9
+ forceGuide: boolean;
10
+ guideTitle: string;
11
+ showArrow: boolean;
12
+ guideSteps: () => string[];
13
+ actionText: string;
14
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ copy: (link: string) => void;
16
+ share: (link: string) => void;
17
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ShareButtonProps>, {
18
+ text: string;
19
+ disabled: boolean;
20
+ forceGuide: boolean;
21
+ guideTitle: string;
22
+ showArrow: boolean;
23
+ guideSteps: () => string[];
24
+ actionText: string;
25
+ }>>> & Readonly<{
26
+ onCopy?: ((link: string) => any) | undefined;
27
+ onShare?: ((link: string) => any) | undefined;
28
+ }>, {
29
+ disabled: boolean;
30
+ text: string;
31
+ showArrow: boolean;
32
+ forceGuide: boolean;
33
+ guideTitle: string;
34
+ guideSteps: string[];
35
+ actionText: string;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
37
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
38
+ export default _default;
39
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
40
+ type __VLS_TypePropsToRuntimeProps<T> = {
41
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
42
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
43
+ } : {
44
+ type: import('vue').PropType<T[K]>;
45
+ required: true;
46
+ };
47
+ };
48
+ type __VLS_WithDefaults<P, D> = {
49
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
50
+ default: D[K];
51
+ }> : P[K];
52
+ };
53
+ type __VLS_Prettify<T> = {
54
+ [K in keyof T]: T[K];
55
+ } & {};
56
+ type __VLS_WithTemplateSlots<T, S> = T & {
57
+ new (): {
58
+ $slots: S;
59
+ };
60
+ };
@@ -0,0 +1,13 @@
1
+ /** 引导步骤里的一段文本,`bold` 为 true 时渲染为加粗 */
2
+ export interface GuideStepSegment {
3
+ text: string;
4
+ bold: boolean;
5
+ }
6
+ /**
7
+ * 解析单条引导步骤,把 `**文案**` 拆成加粗片段,其余按普通文本处理。
8
+ * 用于在引导文案里突出「在浏览器中打开」这类关键动作。
9
+ *
10
+ * @param step 原始步骤文案
11
+ * @returns 按顺序排列的文本片段,至少返回一段
12
+ */
13
+ export declare function parseGuideStep(step: string): GuideStepSegment[];
@@ -0,0 +1,34 @@
1
+ export interface ShareButtonProps {
2
+ /**
3
+ * 分享目标链接。
4
+ * 非微信内置浏览器内点击直接跳转,微信内改为弹出「到浏览器打开」的引导浮层。
5
+ */
6
+ link: string;
7
+ /** 按钮文案,默认「分享」;也可通过默认插槽自定义内容。 */
8
+ text?: string;
9
+ /** 是否禁用。 */
10
+ disabled?: boolean;
11
+ /**
12
+ * 是否强制展示引导浮层。
13
+ * 默认按 `os.isWeixin()` 判断,置为 true 可在非微信环境预览、调试引导浮层。
14
+ * @default false
15
+ */
16
+ forceGuide?: boolean;
17
+ /** 引导浮层标题。 */
18
+ guideTitle?: string;
19
+ /**
20
+ * 是否展示右上角的引导箭头,指向微信「···」所在位置。
21
+ * @default true
22
+ */
23
+ showArrow?: boolean;
24
+ /** 引导浮层步骤文案,按序展示;`**文案**` 会渲染为加粗。 */
25
+ guideSteps?: string[];
26
+ /** 引导浮层底部按钮文案,点击后复制 `link`。 */
27
+ actionText?: string;
28
+ }
29
+ export interface ShareButtonEmits {
30
+ /** 点击时触发,无论最终是跳转还是弹引导浮层。 */
31
+ share: [link: string];
32
+ /** 引导浮层里点击「复制链接」成功后触发。 */
33
+ copy: [link: string];
34
+ }
@@ -0,0 +1,53 @@
1
+ import { Component } from 'vue';
2
+ import { SidebarIconRender, SidebarMenuItem } from '../types';
3
+
4
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ /** 一级菜单项 */
6
+ item: SidebarMenuItem;
7
+ /** 当前激活菜单路径 */
8
+ activeMenu: string;
9
+ /** 是否折叠 */
10
+ collapse?: boolean;
11
+ /** 自定义图标渲染函数 */
12
+ renderIcon?: SidebarIconRender;
13
+ /** 内部链接使用的组件 */
14
+ linkComponent?: string | Component;
15
+ }>, {
16
+ collapse: boolean;
17
+ linkComponent: string;
18
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
19
+ /** 一级菜单项 */
20
+ item: SidebarMenuItem;
21
+ /** 当前激活菜单路径 */
22
+ activeMenu: string;
23
+ /** 是否折叠 */
24
+ collapse?: boolean;
25
+ /** 自定义图标渲染函数 */
26
+ renderIcon?: SidebarIconRender;
27
+ /** 内部链接使用的组件 */
28
+ linkComponent?: string | Component;
29
+ }>, {
30
+ collapse: boolean;
31
+ linkComponent: string;
32
+ }>>> & Readonly<{}>, {
33
+ collapse: boolean;
34
+ linkComponent: string | Component;
35
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
36
+ export default _default;
37
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
38
+ type __VLS_TypePropsToRuntimeProps<T> = {
39
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
40
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
41
+ } : {
42
+ type: import('vue').PropType<T[K]>;
43
+ required: true;
44
+ };
45
+ };
46
+ type __VLS_WithDefaults<P, D> = {
47
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
48
+ default: D[K];
49
+ }> : P[K];
50
+ };
51
+ type __VLS_Prettify<T> = {
52
+ [K in keyof T]: T[K];
53
+ } & {};
@@ -0,0 +1,23 @@
1
+ import { SidebarIconRender } from '../types';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ /** 图标名称 */
5
+ icon?: string;
6
+ /** 自定义图标渲染函数 */
7
+ renderIcon?: SidebarIconRender;
8
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
+ /** 图标名称 */
10
+ icon?: string;
11
+ /** 自定义图标渲染函数 */
12
+ renderIcon?: SidebarIconRender;
13
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ export default _default;
15
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
+ type __VLS_TypePropsToRuntimeProps<T> = {
17
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
18
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
+ } : {
20
+ type: import('vue').PropType<T[K]>;
21
+ required: true;
22
+ };
23
+ };
@@ -0,0 +1,33 @@
1
+ import { SidebarItemProps } from '../types';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SidebarItemProps>, {
4
+ isNest: boolean;
5
+ basePath: string;
6
+ linkComponent: string;
7
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SidebarItemProps>, {
8
+ isNest: boolean;
9
+ basePath: string;
10
+ linkComponent: string;
11
+ }>>> & Readonly<{}>, {
12
+ linkComponent: string | import('vue').Component;
13
+ isNest: boolean;
14
+ basePath: string;
15
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
16
+ export default _default;
17
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
18
+ type __VLS_TypePropsToRuntimeProps<T> = {
19
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
20
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
21
+ } : {
22
+ type: import('vue').PropType<T[K]>;
23
+ required: true;
24
+ };
25
+ };
26
+ type __VLS_WithDefaults<P, D> = {
27
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
28
+ default: D[K];
29
+ }> : P[K];
30
+ };
31
+ type __VLS_Prettify<T> = {
32
+ [K in keyof T]: T[K];
33
+ } & {};