@vuetkit/components 0.0.19 → 0.0.20
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.
- package/dist/index.d.ts +19 -2
- package/dist/index.js +31 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestService } from "@vuetkit/core";
|
|
2
|
-
import { CollapseItemProps, CollapseModelValue, CollapseProps, ComponentSize, DescriptionItemProps, DescriptionProps, DialogProps, ElDropdown, ElMenu, FormRules, MessageProps, MessageType, NotificationOptions, PaginationProps, StepProps, StepsProps, TabPaneName, TableProps, TabsPaneContext, TabsProps } from "element-plus";
|
|
2
|
+
import { CollapseItemProps, CollapseModelValue, CollapseProps, ComponentSize, DescriptionItemProps, DescriptionProps, DialogProps, ElBreadcrumb, ElDropdown, ElMenu, FormRules, MessageProps, MessageType, NotificationOptions, PaginationProps, StepProps, StepsProps, TabPaneName, TableProps, TabsPaneContext, TabsProps } from "element-plus";
|
|
3
3
|
import { CSSProperties, Component, MaybeRef, Ref, VNode } from "vue";
|
|
4
4
|
import { TableColumnProps } from "element-plus/es/components/table/src/table-column/defaults.mjs";
|
|
5
5
|
|
|
@@ -134,6 +134,23 @@ declare function setDeepProperty(data: Recordable, propArr: string[], value: unk
|
|
|
134
134
|
declare function useForm(options: undefined): [null, Recordable];
|
|
135
135
|
declare function useForm<T extends object>(options: FormOptions<T>): FormReturnType<T>;
|
|
136
136
|
//#endregion
|
|
137
|
+
//#region src/navigation/useBreadcrumb/index.d.ts
|
|
138
|
+
type ElBreadcrumbProps = InstanceType<typeof ElBreadcrumb>['$props'];
|
|
139
|
+
interface BreadcrumbColumn {
|
|
140
|
+
label?: string;
|
|
141
|
+
to?: unknown;
|
|
142
|
+
replace?: boolean;
|
|
143
|
+
render?: (val: unknown) => VNode;
|
|
144
|
+
}
|
|
145
|
+
interface BreadcrumbOptions<T> extends Partial<ElBreadcrumbProps> {
|
|
146
|
+
items?: BreadcrumbColumn[];
|
|
147
|
+
service?: RequestService<T>;
|
|
148
|
+
params?: unknown;
|
|
149
|
+
formatData?: (data: T) => BreadcrumbColumn[];
|
|
150
|
+
}
|
|
151
|
+
type BreadcrumbReturnType = [Component];
|
|
152
|
+
declare function useBreadcrumb<T>(options: BreadcrumbOptions<T>): BreadcrumbReturnType;
|
|
153
|
+
//#endregion
|
|
137
154
|
//#region src/navigation/useDropdown/index.d.ts
|
|
138
155
|
type ElDropdownProps = InstanceType<typeof ElDropdown>['$props'];
|
|
139
156
|
interface DropdownItem {
|
|
@@ -291,4 +308,4 @@ interface TableOptions<T extends DefaultRow> extends TableProps<T> {
|
|
|
291
308
|
type TableReturn = [Component];
|
|
292
309
|
declare function useTable<T extends DefaultRow>(options: TableOptions<T>): TableReturn;
|
|
293
310
|
//#endregion
|
|
294
|
-
export { AsyncConfirmOptions, CollapseColumn, CollapseOptions, CollapseReturnType, CustomRender, DefaultComponentKey, DescriptionsColumn, DescriptionsOptions, DescriptionsReturnType, DropdownItem, DropdownOptions, DropdownReturnType, FormItemType, FormOptions, FormReturnType, FormRuleFn, FormSchema, MenuColumn, MenuOptions, MenuReturnType, PaginationOptions, Recordable, StepsColumn, StepsOptions, StepsReturnType, TableColumnOptions, TableOptions, TableReturn, TabsColumn, TabsOptions, TabsReturnType, setDeepProperty, useAsyncConfirm, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useNotification, useSteps, useTable, useTabs };
|
|
311
|
+
export { AsyncConfirmOptions, BreadcrumbColumn, BreadcrumbOptions, BreadcrumbReturnType, CollapseColumn, CollapseOptions, CollapseReturnType, CustomRender, DefaultComponentKey, DescriptionsColumn, DescriptionsOptions, DescriptionsReturnType, DropdownItem, DropdownOptions, DropdownReturnType, FormItemType, FormOptions, FormReturnType, FormRuleFn, FormSchema, MenuColumn, MenuOptions, MenuReturnType, PaginationOptions, Recordable, StepsColumn, StepsOptions, StepsReturnType, TableColumnOptions, TableOptions, TableReturn, TabsColumn, TabsOptions, TabsReturnType, setDeepProperty, useAsyncConfirm, useBreadcrumb, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useNotification, useSteps, useTable, useTabs };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRequest } from "@vuetkit/core";
|
|
2
|
-
import { ElButton, ElCascader, ElCheckbox, ElCol, ElCollapse, ElCollapseItem, ElColorPicker, ElDatePicker, ElDescriptions, ElDescriptionsItem, ElDialog, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElInput, ElInputNumber, ElInputOtp, ElMention, ElMenu, ElMenuItem, ElMenuItemGroup, ElMessage, ElMessageBox, ElNotification, ElPagination, ElRadio, ElRate, ElRow, ElScrollbar, ElSelect, ElSelectV2, ElSlider, ElStep, ElSteps, ElSubMenu, ElSwitch, ElTabPane, ElTable, ElTableColumn, ElTabs, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElUpload, vLoading } from "element-plus";
|
|
2
|
+
import { ElBreadcrumb, ElBreadcrumbItem, ElButton, ElCascader, ElCheckbox, ElCol, ElCollapse, ElCollapseItem, ElColorPicker, ElDatePicker, ElDescriptions, ElDescriptionsItem, ElDialog, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElInput, ElInputNumber, ElInputOtp, ElMention, ElMenu, ElMenuItem, ElMenuItemGroup, ElMessage, ElMessageBox, ElNotification, ElPagination, ElRadio, ElRate, ElRow, ElScrollbar, ElSelect, ElSelectV2, ElSlider, ElStep, ElSteps, ElSubMenu, ElSwitch, ElTabPane, ElTable, ElTableColumn, ElTabs, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElUpload, vLoading } from "element-plus";
|
|
3
3
|
import { computed, defineComponent, h, nextTick, onMounted, reactive, ref, toValue, useTemplateRef, watch, withDirectives } from "vue";
|
|
4
4
|
import { isFunc, realObj } from "@vuetkit/shared";
|
|
5
5
|
//#region src/data/useCollapse/index.ts
|
|
@@ -473,6 +473,35 @@ function useForm(options) {
|
|
|
473
473
|
}];
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
|
+
//#region src/navigation/useBreadcrumb/index.ts
|
|
477
|
+
function useBreadcrumb(options) {
|
|
478
|
+
const { items = [], service, params, formatData, ...rest } = options;
|
|
479
|
+
const { data, loading } = service ? useRequest(service, {
|
|
480
|
+
defaultParams: params,
|
|
481
|
+
formatData: formatData || void 0
|
|
482
|
+
}) : {};
|
|
483
|
+
const breadcrumbColumns = computed(() => (data === null || data === void 0 ? void 0 : data.value) || items);
|
|
484
|
+
const renderBreadcrumbItem = (item) => {
|
|
485
|
+
return h(ElBreadcrumbItem, {
|
|
486
|
+
to: item.to,
|
|
487
|
+
replace: item.replace
|
|
488
|
+
}, { default: () => {
|
|
489
|
+
if (item === null || item === void 0 ? void 0 : item.render) return item.render(item);
|
|
490
|
+
return item.label || "";
|
|
491
|
+
} });
|
|
492
|
+
};
|
|
493
|
+
return [defineComponent({ setup(_, { slots }) {
|
|
494
|
+
return () => {
|
|
495
|
+
var _loading$value;
|
|
496
|
+
return withDirectives(h(ElBreadcrumb, { ...rest }, { default: () => {
|
|
497
|
+
if (slots.default) return slots.default();
|
|
498
|
+
if (!breadcrumbColumns.value.length) return "";
|
|
499
|
+
return breadcrumbColumns.value.map((item) => renderBreadcrumbItem(item));
|
|
500
|
+
} }), [[vLoading, (_loading$value = loading === null || loading === void 0 ? void 0 : loading.value) !== null && _loading$value !== void 0 ? _loading$value : false]]);
|
|
501
|
+
};
|
|
502
|
+
} })];
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
476
505
|
//#region src/navigation/useDropdown/index.ts
|
|
477
506
|
function useDropdown(options) {
|
|
478
507
|
const { items = [], service, params, formatData, defaultCommand, onCommand, onVisibleChange, onClick, ...rest } = options;
|
|
@@ -879,4 +908,4 @@ function useTable(options) {
|
|
|
879
908
|
})];
|
|
880
909
|
}
|
|
881
910
|
//#endregion
|
|
882
|
-
export { setDeepProperty, useAsyncConfirm, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useNotification, useSteps, useTable, useTabs };
|
|
911
|
+
export { setDeepProperty, useAsyncConfirm, useBreadcrumb, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useNotification, useSteps, useTable, useTabs };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuetkit/components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.20",
|
|
5
5
|
"description": "Collection of business development components for Vue3 projects",
|
|
6
6
|
"author": "Kalu5",
|
|
7
7
|
"license": "MIT",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"vue": "^3.5.35"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@vuetkit/core": "0.0.
|
|
25
|
-
"@vuetkit/shared": "0.0.
|
|
24
|
+
"@vuetkit/core": "0.0.20",
|
|
25
|
+
"@vuetkit/shared": "0.0.20"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsdown --config-loader tsx"
|