@done-coding/admin-core 0.16.1-alpha.0 → 0.17.1-alpha.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 (53) hide show
  1. package/es/components/app-layout/AppBody.vue.mjs +2 -2
  2. package/es/components/app-layout/AppBody.vue2.mjs +53 -54
  3. package/es/components/app-layout/keep-alive.mjs +22 -0
  4. package/es/components/data-view/DataListView.vue.mjs +2 -2
  5. package/es/components/data-view/DataListView.vue2.mjs +55 -53
  6. package/es/components/display/ActionConfirm.vue.mjs +2 -2
  7. package/es/components/display/ActionConfirm.vue2.mjs +1 -1
  8. package/es/components/display/TabsRefineFlow.vue.mjs +34 -32
  9. package/es/components/list-page/ListPage.vue.mjs +2 -2
  10. package/es/components/list-page/ListPage.vue2.mjs +74 -75
  11. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  12. package/es/components/misc/AutoRefreshGroup.vue2.mjs +42 -35
  13. package/es/components/modal/{ConfirmModal.vue.mjs → ModalConfirm.vue.mjs} +3 -3
  14. package/es/components/modal/{ConfirmModal.vue2.mjs → ModalConfirm.vue2.mjs} +34 -34
  15. package/es/components/modal/ModalDetail.vue.mjs +63 -0
  16. package/es/components/modal/ModalDetail.vue2.mjs +4 -0
  17. package/es/components/modal/ModalForm.vue.mjs +75 -0
  18. package/es/components/modal/ModalForm.vue2.mjs +4 -0
  19. package/es/components/panel/PanelItem.vue.mjs +5 -81
  20. package/es/components/panel/PanelItem.vue2.mjs +93 -2
  21. package/es/components/panel/PanelMain.vue2.mjs +14 -14
  22. package/es/components/table/TableMain.vue.mjs +2 -2
  23. package/es/components/table/TableMain.vue2.mjs +210 -174
  24. package/es/components/table/TableSkeleton.vue.mjs +7 -0
  25. package/es/components/table/TableSkeleton.vue2.mjs +89 -0
  26. package/es/components/table/TableToolbar.vue.mjs +2 -2
  27. package/es/components/table/TableToolbar.vue2.mjs +22 -21
  28. package/es/components/table/use-fill-height.mjs +14 -0
  29. package/es/components/table/use-table-skeleton.mjs +19 -0
  30. package/es/index.mjs +230 -223
  31. package/es/router/group-redirect.mjs +20 -0
  32. package/es/style.css +1 -1
  33. package/package.json +2 -2
  34. package/types/components/app-layout/keep-alive.d.ts +14 -0
  35. package/types/components/data-view/types.d.ts +1 -0
  36. package/types/components/misc/AutoRefreshGroup.vue.d.ts +2 -1
  37. package/types/components/misc/types.d.ts +1 -0
  38. package/types/components/modal/{ConfirmModal.vue.d.ts → ModalConfirm.vue.d.ts} +1 -1
  39. package/types/components/modal/{DetailModal.vue.d.ts → ModalDetail.vue.d.ts} +2 -2
  40. package/types/components/modal/ModalForm.vue.d.ts +24 -0
  41. package/types/components/modal/index.d.ts +4 -3
  42. package/types/components/modal/types.d.ts +26 -2
  43. package/types/components/panel/PanelItem.vue.d.ts +1 -1
  44. package/types/components/panel/types.d.ts +4 -1
  45. package/types/components/table/TableSkeleton.vue.d.ts +7 -0
  46. package/types/components/table/types.d.ts +10 -0
  47. package/types/components/table/use-fill-height.d.ts +11 -0
  48. package/types/components/table/use-table-skeleton.d.ts +17 -0
  49. package/types/injectInfo.json.d.ts +1 -1
  50. package/types/router/group-redirect.d.ts +5 -0
  51. package/types/router/index.d.ts +1 -0
  52. package/es/components/modal/DetailModal.vue.mjs +0 -74
  53. package/es/components/modal/DetailModal.vue2.mjs +0 -4
@@ -1,4 +1,4 @@
1
- import { AutoRefreshGroupProps } from './types.ts';
1
+ import { AutoRefreshGroupProps } from './types';
2
2
  type __VLS_Props = AutoRefreshGroupProps;
3
3
  type __VLS_PublicProps = {
4
4
  "isAutoRefresh"?: boolean;
@@ -13,5 +13,6 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
13
13
  }>, {
14
14
  showAutoRefresh: boolean;
15
15
  showRefresh: boolean;
16
+ needRootNode: boolean;
16
17
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
18
  export default _default;
@@ -6,4 +6,5 @@ export interface AutoRefreshGroupProps extends Omit<AutoRefreshProps, "disabled"
6
6
  showAutoRefresh?: boolean;
7
7
  showRefresh?: boolean;
8
8
  loading?: boolean;
9
+ needRootNode?: boolean;
9
10
  }
@@ -6,7 +6,7 @@ type __VLS_Props = {
6
6
  onClose?: (status?: boolean) => void;
7
7
  onCancel?: () => void | Promise<boolean | void>;
8
8
  onConfirm?: () => void | Promise<boolean | void>;
9
- title?: string | (() => VNode);
9
+ title?: string | (() => VNode | VNode[]);
10
10
  content?: string | (() => VNode);
11
11
  cancelText?: string | (() => VNode);
12
12
  confirmText?: string | (() => VNode);
@@ -1,11 +1,11 @@
1
1
  import { ExtractFormStringifyFromObject } from '../form';
2
- import { DetailModalProps } from './types';
2
+ import { ModalDetailProps } from './types';
3
3
  declare const _default: <PO extends Record<string, any>, SO extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
5
  readonly "onUpdate:show"?: ((value: boolean) => any) | undefined;
6
6
  readonly onAfterAdd?: ((data: import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>>) => any) | undefined;
7
7
  readonly onAfterEdit?: ((data: import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>>) => any) | undefined;
8
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:show" | "onAfterAdd" | "onAfterEdit"> & DetailModalProps<PO, SO> & Partial<{}>> & import('vue').PublicProps;
8
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:show" | "onAfterAdd" | "onAfterEdit"> & ModalDetailProps<PO, SO> & Partial<{}>> & import('vue').PublicProps;
9
9
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
10
10
  attrs: any;
11
11
  slots: {
@@ -0,0 +1,24 @@
1
+ import { FormMainInstance } from '../form';
2
+ import { ModalFormProps } from './types';
3
+ declare const _default: <PO extends Record<string, any>, SO extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly "onUpdate:show"?: ((value: boolean) => any) | undefined;
6
+ readonly onSubmitSuccess?: ((data: import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>>) => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:show" | "onSubmitSuccess"> & ModalFormProps<PO, SO> & Partial<{}>> & import('vue').PublicProps;
8
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
9
+ attrs: any;
10
+ slots: {
11
+ header?(_: {}): any;
12
+ footer?(_: {}): any;
13
+ };
14
+ emit: {
15
+ (e: "update:show", value: boolean): void;
16
+ (e: "submitSuccess", data: ReturnType<FormMainInstance<PO, SO>["stringify"]>): void;
17
+ };
18
+ }>) => import('vue').VNode & {
19
+ __ctx?: Awaited<typeof __VLS_setup>;
20
+ };
21
+ export default _default;
22
+ type __VLS_PrettifyLocal<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
@@ -1,7 +1,8 @@
1
- import { default as ConfirmModal } from './ConfirmModal.vue';
2
- import { default as DetailModal } from './DetailModal.vue';
1
+ import { default as ModalConfirm } from './ModalConfirm.vue';
2
+ import { default as ModalForm } from './ModalForm.vue';
3
+ import { default as ModalDetail } from './ModalDetail.vue';
3
4
  import { default as ModalShelf } from './ModalShelf.vue';
4
5
  import { default as ModalPorter } from './ModalPorter.vue';
5
6
  export * from './types';
6
7
  export * from './modal-shelf-types';
7
- export { ConfirmModal, DetailModal, ModalShelf, ModalPorter };
8
+ export { ModalConfirm, ModalForm, ModalDetail, ModalShelf, ModalPorter, ModalConfirm as ConfirmModal, ModalForm as FormModal, ModalDetail as DetailModal, };
@@ -1,17 +1,41 @@
1
+ import { VNode } from 'vue';
1
2
  import { ExtractFormStringifyFromObject, FormItemConfigList, FormMainProps } from '../form';
2
3
  import { FormProps } from 'element-plus';
3
4
  export type DetailType = "add" | "edit" | "read";
4
- export interface DetailModalProps<PO extends Record<string, any>, SO extends Record<string, any>> {
5
+ export type ModalLayerType = "modal" | "drawer";
6
+ export type ModalDirection = "rtl" | "ltr" | "ttb" | "btt";
7
+ export interface ModalFormProps<PO extends Record<string, any>, SO extends Record<string, any>> {
8
+ show: boolean;
9
+ data: PO;
10
+ list: FormItemConfigList<PO, SO>;
11
+ submitFn: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any> | any;
12
+ title?: string | (() => VNode[]);
13
+ width?: number | string;
14
+ layerType?: ModalLayerType;
15
+ direction?: ModalDirection;
16
+ formLayout?: FormMainProps<PO, SO>["layout"];
17
+ formProps?: Partial<FormProps>;
18
+ formRowGutter?: number;
19
+ labelWidth?: string;
20
+ headerDivider?: boolean;
21
+ footerDivider?: boolean;
22
+ }
23
+ export type FormModalProps<PO extends Record<string, any>, SO extends Record<string, any>> = ModalFormProps<PO, SO>;
24
+ export interface ModalDetailProps<PO extends Record<string, any>, SO extends Record<string, any>> {
5
25
  data: PO;
6
26
  list: FormItemConfigList<PO, SO>;
7
27
  type: DetailType;
28
+ title?: () => VNode[];
8
29
  subTitle?: string;
9
30
  show: boolean;
10
31
  addApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
11
32
  editApi?: (data: ExtractFormStringifyFromObject<PO, SO>) => Promise<any>;
12
- modalWidth?: number | string;
33
+ width?: number | string;
13
34
  formLayout?: FormMainProps<PO, SO>["layout"];
14
35
  formProps?: Partial<FormProps>;
15
36
  formRowGutter?: number;
16
37
  labelWidth?: string;
38
+ layerType?: ModalLayerType;
39
+ direction?: ModalDirection;
17
40
  }
41
+ export type DetailModalProps<PO extends Record<string, any>, SO extends Record<string, any>> = ModalDetailProps<PO, SO>;
@@ -2,8 +2,8 @@ import { PanelItemProps } from './types';
2
2
  import { FormDataInfo } from '../form/types.ts';
3
3
  declare const _default: <PO extends Record<string, any>, SO extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
- readonly "onUpdate:editing"?: ((value: boolean) => any) | undefined;
6
5
  readonly onSubmitSuccess?: ((data: import('../form/types.ts').ExcludeNeverProperties<import('../form/types.ts').ExtractFormStringifyRawFromObject<PO, SO>>) => any) | undefined;
6
+ readonly "onUpdate:editing"?: ((value: boolean) => any) | undefined;
7
7
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onSubmitSuccess" | "onUpdate:editing"> & ({
8
8
  editing?: boolean;
9
9
  } & PanelItemProps<PO, SO>) & Partial<{}>> & import('vue').PublicProps;
@@ -1,4 +1,4 @@
1
- import { VNode } from 'vue';
1
+ import { CSSProperties, VNode } from 'vue';
2
2
  import { ColProps, CardProps } from 'element-plus';
3
3
  import { ExtractFormStringifyFromObject, FormDataInfo, FormItemConfig, FormSubmitPanelProps } from '../form';
4
4
  export interface PanelScopeBase<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
@@ -14,6 +14,9 @@ export interface PanelRenderScope<PO extends Record<string, any> = Record<string
14
14
  export interface PanelItemConfig<PO extends Record<string, any> = Record<string, any>, SO extends Record<string, any> = Record<string, any>> {
15
15
  key: string;
16
16
  label?: string;
17
+ labelHide?: boolean;
18
+ labelStyle?: CSSProperties | string;
19
+ labelPosition?: "inline" | "top";
17
20
  layout?: Partial<ColProps>;
18
21
  hide?: boolean | ((scope: PanelScopeBase<PO, SO>) => boolean);
19
22
  render?: string | Record<string, any> | ((scope: PanelRenderScope<PO, SO>) => VNode[]);
@@ -0,0 +1,7 @@
1
+ import { TableSkeletonProps } from './types';
2
+ declare const _default: import('vue').DefineComponent<TableSkeletonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TableSkeletonProps> & Readonly<{}>, {
3
+ mode: "table" | "grid";
4
+ rows: number;
5
+ columns: number;
6
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
7
+ export default _default;
@@ -80,6 +80,13 @@ export type ElTableColumnProps<T extends Record<string, any> = Record<string, an
80
80
  render: string | Record<string, any> | ((props: TableColumnComponentProps<T, F>) => VNode);
81
81
  headerRender: string | Record<string, any> | ((props: TableColumnHeaderScope<T, F>) => VNode);
82
82
  }>;
83
+ export interface TableSkeletonProps {
84
+ mode?: "table" | "grid";
85
+ rows?: number;
86
+ columns?: number;
87
+ maxHeight?: number;
88
+ minHeight?: number;
89
+ }
83
90
  export interface TableMainProps<T extends Record<string, any>, SQ extends Record<string, any>, F extends Record<string, any>> {
84
91
  showPager?: boolean;
85
92
  showSwitchView?: boolean;
@@ -99,6 +106,9 @@ export interface TableMainProps<T extends Record<string, any>, SQ extends Record
99
106
  refineReduceHeight?: number;
100
107
  injectInfo?: F;
101
108
  dataViewMaxHeightMinValue?: number;
109
+ skeleton?: boolean;
110
+ skeletonRows?: number;
111
+ fillHeight?: boolean;
102
112
  viewportHeight?: number;
103
113
  parentChannel?: string;
104
114
  }
@@ -0,0 +1,11 @@
1
+ import { ComputedRef } from 'vue';
2
+ export interface UseFillHeightOptions {
3
+ enabled: () => boolean;
4
+ rawAvailableHeight: () => number | undefined;
5
+ }
6
+ export interface UseFillHeightReturn {
7
+ fillActive: ComputedRef<boolean>;
8
+ fillMinHeight: ComputedRef<number | undefined>;
9
+ fillMinHeightCss: ComputedRef<string>;
10
+ }
11
+ export declare const useFillHeight: (options: UseFillHeightOptions) => UseFillHeightReturn;
@@ -0,0 +1,17 @@
1
+ import { ComputedRef } from 'vue';
2
+ export interface UseTableSkeletonOptions {
3
+ enabled: () => boolean;
4
+ loading: () => boolean;
5
+ dataLength: () => number;
6
+ isGrid: () => boolean;
7
+ columnCount: () => number;
8
+ skeletonRows: () => number | undefined;
9
+ availableHeight: () => number | undefined;
10
+ }
11
+ export interface UseTableSkeletonReturn {
12
+ showSkeleton: ComputedRef<boolean>;
13
+ skeletonMode: ComputedRef<"table" | "grid">;
14
+ skeletonColumns: ComputedRef<number>;
15
+ skeletonRowsFinal: ComputedRef<number>;
16
+ }
17
+ export declare const useTableSkeleton: (options: UseTableSkeletonOptions) => UseTableSkeletonReturn;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@done-coding/admin-core",
3
- "version": "0.16.1-alpha.0",
3
+ "version": "0.17.1-alpha.0",
4
4
  "description": "内部前端库"
5
5
  };
6
6
 
@@ -0,0 +1,5 @@
1
+ import { RouteRecordRaw } from 'vue-router';
2
+ export interface WithGroupRedirectOptions {
3
+ onParentComponent?: "warn" | "error";
4
+ }
5
+ export declare const withGroupRedirect: (routes: RouteRecordRaw[], options?: WithGroupRedirectOptions) => RouteRecordRaw[];
@@ -1 +1,2 @@
1
1
  export * from './guard';
2
+ export * from './group-redirect';
@@ -1,74 +0,0 @@
1
- import { defineComponent as g, ref as b, computed as s, watch as p, openBlock as A, createBlock as W, withCtx as d, createVNode as v, unref as C, mergeProps as M, renderSlot as f } from "vue";
2
- import D from "../form/FormMain.vue.mjs";
3
- import { stringifyFormData as $ } from "../form/utils.mjs";
4
- import k from "./ConfirmModal.vue.mjs";
5
- const E = /* @__PURE__ */ g({
6
- __name: "DetailModal",
7
- props: {
8
- data: {},
9
- list: {},
10
- type: {},
11
- subTitle: {},
12
- show: { type: Boolean },
13
- addApi: {},
14
- editApi: {},
15
- modalWidth: { default: 600 },
16
- formLayout: { default: () => ({ span: 24 }) },
17
- formProps: {},
18
- formRowGutter: {},
19
- labelWidth: { default: "auto" }
20
- },
21
- emits: ["update:show", "afterAdd", "afterEdit"],
22
- setup(o, { emit: m }) {
23
- const t = o, i = m, l = b(), u = s(() => t.data), c = s(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), h = (e) => {
24
- i("update:show", e);
25
- }, w = () => {
26
- var e;
27
- return (e = l.value) == null ? void 0 : e.validate().then(async () => {
28
- var r, n;
29
- const a = $(t.data, t.list);
30
- console.log("confirm", a), t.type === "add" ? (await ((r = t.addApi) == null ? void 0 : r.call(t, a)), i("afterAdd", a)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, a)), i("afterEdit", a));
31
- });
32
- }, y = () => {
33
- console.log("cancel");
34
- };
35
- return p(
36
- () => t.show,
37
- (e) => {
38
- var a;
39
- e || (a = l.value) == null || a.clearValidate();
40
- }
41
- ), (e, a) => (A(), W(k, {
42
- class: "dc-detail-modal",
43
- title: c.value,
44
- show: o.show,
45
- onConfirm: w,
46
- onCancel: y,
47
- useLoading: "",
48
- width: o.modalWidth,
49
- "onUpdate:show": h
50
- }, {
51
- "main-header": d(() => [
52
- f(e.$slots, "header")
53
- ]),
54
- "main-footer": d(() => [
55
- f(e.$slots, "footer")
56
- ]),
57
- default: d(() => [
58
- v(C(D), M({
59
- ref_key: "formMain",
60
- ref: l,
61
- list: o.list,
62
- data: u.value,
63
- layout: o.formLayout,
64
- labelWidth: o.labelWidth,
65
- "row-gutter": o.formRowGutter
66
- }, o.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
67
- ]),
68
- _: 3
69
- }, 8, ["title", "show", "width"]));
70
- }
71
- });
72
- export {
73
- E as default
74
- };
@@ -1,4 +0,0 @@
1
- import f from "./DetailModal.vue.mjs";
2
- export {
3
- f as default
4
- };