morghulis 3.0.22 → 3.0.24

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 (30) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/morghulis.es.js +4630 -4293
  3. package/dist/morghulis.es.js.map +1 -1
  4. package/dist/morghulis.umd.js +23 -23
  5. package/dist/morghulis.umd.js.map +1 -1
  6. package/dist/types/components/table/data/DTable.vue.d.ts +2 -2
  7. package/dist/types/components/table/data/controller/DTableController.vue.d.ts +8 -2
  8. package/dist/types/components/table/data/popover/DCellPopover.vue.d.ts +4 -4
  9. package/dist/types/components/table/data/popover/DFieldPopover.vue.d.ts +14 -0
  10. package/dist/types/components/table/data/popover/DIndexPopover.vue.d.ts +15 -0
  11. package/dist/types/components/table/data/popover/DMetaPopover.vue.d.ts +14 -0
  12. package/dist/types/components/table/data/popover/DSearchPopover.vue.d.ts +14 -0
  13. package/dist/types/components/table/data/search/SearchCell.vue.d.ts +2 -0
  14. package/dist/types/components/table/data/search/TableSearch.vue.d.ts +2 -0
  15. package/dist/types/components/table/data/widgets/DPopoverWrapper.vue.d.ts +20 -0
  16. package/dist/types/components/table/simple/MTable.vue.d.ts +6 -6
  17. package/dist/types/components/table/simple/types.d.ts +10 -9
  18. package/dist/types/components/table/simple/widgets/MTableHeader.vue.d.ts +5 -5
  19. package/dist/types/components/table/simple/widgets/MTableIndex.vue.d.ts +6 -2
  20. package/dist/types/hooks/use-channel/tools.d.ts +2 -1
  21. package/dist/types/hooks/use-channel/types.d.ts +0 -1
  22. package/dist/types/hooks/use-mata/types.d.ts +9 -2
  23. package/dist/types/hooks/use-query/types.d.ts +2 -2
  24. package/dist/types/hooks/use-request/index.d.ts +3 -2
  25. package/dist/types/hooks/{use-table-data → use-table/data}/index.d.ts +11 -13
  26. package/dist/types/hooks/{use-table-morghulis → use-table/simple}/index.d.ts +3 -1
  27. package/package.json +1 -1
  28. /package/dist/types/components/table/data/{popover/DTablePopWrapper.vue.d.ts → search/FieldSearch.vue.d.ts} +0 -0
  29. /package/dist/types/hooks/{use-table-data → use-table/data}/tool.d.ts +0 -0
  30. /package/dist/types/hooks/{use-table-morghulis → use-table/simple}/types.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { DTableProps } from "./types";
2
- declare var __VLS_15: {};
2
+ declare var __VLS_7: {};
3
3
  type __VLS_Slots = {} & {
4
- header?: (props: typeof __VLS_15) => any;
4
+ header?: (props: typeof __VLS_7) => any;
5
5
  };
6
6
  declare const __VLS_component: import("vue").DefineComponent<DTableProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DTableProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -3,7 +3,10 @@ declare const _default: import("vue").DefineComponent<{
3
3
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
4
  remove: (...args: any[]) => void;
5
5
  open: (...args: any[]) => void;
6
- copy: (...args: any[]) => void;
6
+ check: (...args: any[]) => void;
7
+ paste: (...args: any[]) => void;
8
+ uncheck: (...args: any[]) => void;
9
+ clone: (...args: any[]) => void;
7
10
  upload: (...args: any[]) => void;
8
11
  download: (...args: any[]) => void;
9
12
  }, string, import("vue").PublicProps, Readonly<{
@@ -11,7 +14,10 @@ declare const _default: import("vue").DefineComponent<{
11
14
  }> & Readonly<{
12
15
  onRemove?: ((...args: any[]) => any) | undefined;
13
16
  onOpen?: ((...args: any[]) => any) | undefined;
14
- onCopy?: ((...args: any[]) => any) | undefined;
17
+ onCheck?: ((...args: any[]) => any) | undefined;
18
+ onPaste?: ((...args: any[]) => any) | undefined;
19
+ onUncheck?: ((...args: any[]) => any) | undefined;
20
+ onClone?: ((...args: any[]) => any) | undefined;
15
21
  onUpload?: ((...args: any[]) => any) | undefined;
16
22
  onDownload?: ((...args: any[]) => any) | undefined;
17
23
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -9,10 +9,10 @@ type __VLS_Props = {
9
9
  db: MetaDatabase;
10
10
  };
11
11
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
- cancel: (...args: any[]) => void;
13
- save: (...args: any[]) => void;
12
+ close: (...args: any[]) => void;
13
+ change: (...args: any[]) => void;
14
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
- onCancel?: ((...args: any[]) => any) | undefined;
16
- onSave?: ((...args: any[]) => any) | undefined;
15
+ onClose?: ((...args: any[]) => any) | undefined;
16
+ onChange?: ((...args: any[]) => any) | undefined;
17
17
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  export default _default;
@@ -0,0 +1,14 @@
1
+ import { MetaDatabase, MetaField, MetaView } from "../../../../hooks/use-mata/types";
2
+ type __VLS_Props = {
3
+ view: MetaView;
4
+ data: MetaField;
5
+ db: MetaDatabase;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ close: (...args: any[]) => void;
9
+ change: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onClose?: ((...args: any[]) => any) | undefined;
12
+ onChange?: ((...args: any[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { MetaDatabase, MetaView } from "../../../../hooks/use-mata/types";
2
+ import { DataItem } from "../../../../hooks/use-query/types";
3
+ type __VLS_Props = {
4
+ view: MetaView;
5
+ data: DataItem;
6
+ db: MetaDatabase;
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ close: (...args: any[]) => void;
10
+ change: (...args: any[]) => void;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ onClose?: ((...args: any[]) => any) | undefined;
13
+ onChange?: ((...args: any[]) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { MetaDatabase, MetaView } from "../../../../hooks/use-mata/types";
2
+ type __VLS_Props = {
3
+ view: MetaView;
4
+ data: any;
5
+ db: MetaDatabase;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ close: (...args: any[]) => void;
9
+ change: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onClose?: ((...args: any[]) => any) | undefined;
12
+ onChange?: ((...args: any[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { MetaDatabase, MetaField, MetaView } from "../../../../hooks/use-mata/types";
2
+ type __VLS_Props = {
3
+ view: MetaView;
4
+ data: MetaField;
5
+ db: MetaDatabase;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ close: (...args: any[]) => void;
9
+ change: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onClose?: ((...args: any[]) => any) | undefined;
12
+ onChange?: ((...args: any[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { MTablePopperType } from "../../simple/types";
2
+ import { MetaDatabase, MetaView } from "../../../../hooks/use-mata/types";
3
+ type __VLS_Props = {
4
+ type: MTablePopperType;
5
+ db: MetaDatabase;
6
+ view: MetaView;
7
+ data: any;
8
+ };
9
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ search: (...args: any[]) => void;
11
+ close: (...args: any[]) => void;
12
+ save: (...args: any[]) => void;
13
+ reload: (...args: any[]) => void;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onSearch?: ((...args: any[]) => any) | undefined;
16
+ onClose?: ((...args: any[]) => any) | undefined;
17
+ onSave?: ((...args: any[]) => any) | undefined;
18
+ onReload?: ((...args: any[]) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
@@ -1,10 +1,10 @@
1
1
  import { type MTableProps } from "./types";
2
2
  declare function getSelection(): any;
3
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_35: {
3
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_38: {
4
4
  field: import("../../../hooks/use-mata/types").MetaField;
5
5
  row: any;
6
6
  prop: string | number;
7
- }, __VLS_43: {}, __VLS_45: {}, __VLS_50: {
7
+ }, __VLS_46: {}, __VLS_48: {}, __VLS_53: {
8
8
  type: import("./types").MTablePopperType;
9
9
  data: any;
10
10
  };
@@ -13,13 +13,13 @@ type __VLS_Slots = {} & {
13
13
  } & {
14
14
  'header-tool'?: (props: typeof __VLS_3) => any;
15
15
  } & {
16
- cell?: (props: typeof __VLS_35) => any;
16
+ cell?: (props: typeof __VLS_38) => any;
17
17
  } & {
18
- footer?: (props: typeof __VLS_43) => any;
18
+ footer?: (props: typeof __VLS_46) => any;
19
19
  } & {
20
- 'footer-tool'?: (props: typeof __VLS_45) => any;
20
+ 'footer-tool'?: (props: typeof __VLS_48) => any;
21
21
  } & {
22
- pop?: (props: typeof __VLS_50) => any;
22
+ pop?: (props: typeof __VLS_53) => any;
23
23
  };
24
24
  declare const __VLS_component: import("vue").DefineComponent<MTableProps, {
25
25
  getSelection: typeof getSelection;
@@ -2,6 +2,7 @@ import type { Component } from "vue";
2
2
  import { type CSSProperties, type VNode } from "vue";
3
3
  import { type ElTooltipProps, type Sort, type TreeNode } from "element-plus";
4
4
  import { MetaView } from "../../../hooks/use-mata/types";
5
+ import { Orders } from "../../../hooks/use-query/types";
5
6
  /**
6
7
  * style function
7
8
  */
@@ -120,25 +121,25 @@ export interface TableProps {
120
121
  export type MTableProps = TableProps & {
121
122
  loading?: boolean;
122
123
  view: MetaView;
124
+ orders?: Orders;
123
125
  buttons?: MTableButton[];
124
126
  columns?: MTableColumn[];
125
- sortableCallback?: MTableSortableFn;
126
- };
127
- export type MTablePopperRef = {
128
- getBoundingClientRect: () => {
129
- x: number;
130
- y: number;
131
- };
127
+ sortCallback?: (newIndex: number, oldIndex: number) => void;
128
+ orderCallback?: (prop: string, dir: 1 | -1) => void;
132
129
  };
133
130
  export type MTablePopperType = 'meta' | 'search' | 'field' | 'cell' | 'index' | null | undefined;
134
131
  export type MTablePopper = {
135
- vRef: MTablePopperRef;
132
+ vRef: {
133
+ getBoundingClientRect: () => {
134
+ x: number;
135
+ y: number;
136
+ };
137
+ };
136
138
  visible: boolean;
137
139
  type: MTablePopperType;
138
140
  data: any;
139
141
  placement?: 'left' | 'right' | 'top' | 'bottom' | null | string;
140
142
  };
141
- export type MTableSortableFn = (newIndex: number, oldIndex: number) => void;
142
143
  export type MTableButton = {
143
144
  size?: 'default' | 'small' | 'large' | "";
144
145
  handler?: (row: any, event?: Event) => void;
@@ -1,19 +1,19 @@
1
- import { MetaField, MetaView } from "../../../../hooks/use-mata/types";
1
+ import type { MetaField, MetaView } from "../../../../hooks/use-mata/types";
2
+ import { Orders } from "../../../../hooks/use-query/types";
2
3
  type __VLS_Props = {
3
4
  view: MetaView;
4
5
  field: MetaField;
5
- order: object;
6
+ orders?: Orders;
6
7
  searchable: boolean;
7
8
  metaEnable: boolean;
8
- sortable: boolean;
9
9
  };
10
10
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
11
  search: (...args: any[]) => void;
12
- meta: (...args: any[]) => void;
12
+ field: (...args: any[]) => void;
13
13
  order: (...args: any[]) => void;
14
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
15
  onSearch?: ((...args: any[]) => any) | undefined;
16
- onMeta?: ((...args: any[]) => any) | undefined;
16
+ onField?: ((...args: any[]) => any) | undefined;
17
17
  onOrder?: ((...args: any[]) => any) | undefined;
18
18
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
19
  export default _default;
@@ -2,11 +2,15 @@ declare const _default: import("vue").DefineComponent<{
2
2
  disabled?: any;
3
3
  selection?: any;
4
4
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
- click: (...args: any[]) => void;
5
+ check: (...args: any[]) => void;
6
+ meta: (...args: any[]) => void;
7
+ uncheck: (...args: any[]) => void;
6
8
  }, string, import("vue").PublicProps, Readonly<{
7
9
  disabled?: any;
8
10
  selection?: any;
9
11
  }> & Readonly<{
10
- onClick?: ((...args: any[]) => any) | undefined;
12
+ onCheck?: ((...args: any[]) => any) | undefined;
13
+ onMeta?: ((...args: any[]) => any) | undefined;
14
+ onUncheck?: ((...args: any[]) => any) | undefined;
11
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
16
  export default _default;
@@ -1,2 +1,3 @@
1
1
  import type { MorghulisChannel, MorghulisChannelConfig } from "./types";
2
- export declare function createChannel(url: string, channel?: MorghulisChannelConfig, auth?: boolean): MorghulisChannel;
2
+ import { AxiosInstance } from "axios";
3
+ export declare function createChannel(request: AxiosInstance, url: string, channel?: MorghulisChannelConfig): MorghulisChannel;
@@ -13,7 +13,6 @@ export type MorghulisChannel = {
13
13
  payload: Ref<any>;
14
14
  loading: Ref<boolean>;
15
15
  activate: (body: any) => void;
16
- $url: string;
17
16
  $start: () => void;
18
17
  $stop: () => void;
19
18
  $proceed: (payload: any) => void;
@@ -8,7 +8,7 @@ export type MetaView = {
8
8
  fields?: {
9
9
  [key: string]: MetaField;
10
10
  };
11
- path?: string;
11
+ entity?: string;
12
12
  code?: string;
13
13
  meta_name?: string;
14
14
  view_name?: string;
@@ -28,11 +28,18 @@ export type MetaView = {
28
28
  allow_download?: boolean;
29
29
  allow_upload?: boolean;
30
30
  };
31
+ export type ManyField = 'ManyToManyField' | 'ManyToManyRel' | 'ManyToOneRef';
32
+ export type RefField = 'OneOnOneField' | 'OneOnOneRel' | 'ForeignKey';
33
+ export type SimpleField = 'CharField' | 'TextField' | 'BooleanField';
34
+ export type NumberField = 'IntegerField' | 'FloatField' | 'BigIntegerField' | 'DecimalField' | 'SmallIntegerField';
35
+ export type DateField = 'DateField' | 'DateTimeField' | 'TimeField';
36
+ export type SpecialField = 'JSONField' | 'FileField';
37
+ export type ReadonlyField = 'UUIDField' | 'BigAutoField' | 'Custom';
31
38
  export type MetaField = {
32
39
  prop?: string;
33
40
  label?: string;
34
41
  name?: string;
35
- domain?: string;
42
+ domain?: SimpleField | ManyField | RefField | SpecialField | ReadonlyField | NumberField | DateField;
36
43
  tool?: string;
37
44
  refer?: MetaRefer;
38
45
  format?: MetaFormat;
@@ -3,10 +3,10 @@ export type DataItem = {
3
3
  [key: string]: any;
4
4
  };
5
5
  type DataItemId = string | number;
6
- type Orders = {
6
+ export type Orders = {
7
7
  [key: string]: 1 | -1;
8
8
  };
9
- type Condition = {
9
+ export type Condition = {
10
10
  includes?: DataItem;
11
11
  excludes?: DataItem;
12
12
  };
@@ -1,6 +1,7 @@
1
+ import { AxiosInstance } from 'axios';
1
2
  import 'nprogress/nprogress.css';
2
3
  export declare function useMRequest(): {
3
- getHttpRequest: (auth?: boolean) => import("axios").AxiosInstance;
4
- getMinioRequest: () => import("axios").AxiosInstance;
4
+ getHttpRequest: (auth?: boolean) => AxiosInstance;
5
+ getMinioRequest: () => AxiosInstance;
5
6
  all: () => void;
6
7
  };
@@ -1,8 +1,9 @@
1
1
  import { ComputedRef, Ref } from "vue";
2
- import { MetaView } from "../use-mata/types";
3
- import { DataItem, QueryConfig } from "../use-query/types";
4
- import { DTableInfo, DTableProps } from "../../components/table/data/types";
2
+ import { MetaView } from "../../use-mata/types";
3
+ import { DataItem, Query, QueryConfig } from "../../use-query/types";
4
+ import { DTableInfo, DTableProps } from "../../../components/table/data/types";
5
5
  export declare function useDTable(table: Ref, props: DTableProps): {
6
+ query: ComputedRef<Query>;
6
7
  config: Ref<{
7
8
  includes?: {
8
9
  [x: string]: any;
@@ -12,9 +13,7 @@ export declare function useDTable(table: Ref, props: DTableProps): {
12
13
  [x: string]: any;
13
14
  id?: (string | number) | undefined;
14
15
  } | undefined;
15
- orders?: {
16
- [key: string]: 1 | -1;
17
- } | undefined;
16
+ orders?: import("../../use-query/types").Orders | undefined;
18
17
  page?: number | undefined;
19
18
  size?: number | undefined;
20
19
  }, QueryConfig | {
@@ -26,18 +25,16 @@ export declare function useDTable(table: Ref, props: DTableProps): {
26
25
  [x: string]: any;
27
26
  id?: (string | number) | undefined;
28
27
  } | undefined;
29
- orders?: {
30
- [key: string]: 1 | -1;
31
- } | undefined;
28
+ orders?: import("../../use-query/types").Orders | undefined;
32
29
  page?: number | undefined;
33
30
  size?: number | undefined;
34
31
  }>;
35
32
  payload: Ref<any, any>;
36
33
  view: Ref<{
37
34
  fields?: {
38
- [key: string]: import("../use-mata/types").MetaField;
35
+ [key: string]: import("../../use-mata/types").MetaField;
39
36
  } | undefined;
40
- path?: string | undefined;
37
+ entity?: string | undefined;
41
38
  code?: string | undefined;
42
39
  meta_name?: string | undefined;
43
40
  view_name?: string | undefined;
@@ -58,9 +55,9 @@ export declare function useDTable(table: Ref, props: DTableProps): {
58
55
  allow_upload?: boolean | undefined;
59
56
  }, MetaView | {
60
57
  fields?: {
61
- [key: string]: import("../use-mata/types").MetaField;
58
+ [key: string]: import("../../use-mata/types").MetaField;
62
59
  } | undefined;
63
- path?: string | undefined;
60
+ entity?: string | undefined;
64
61
  code?: string | undefined;
65
62
  meta_name?: string | undefined;
66
63
  view_name?: string | undefined;
@@ -100,4 +97,5 @@ export declare function useDTable(table: Ref, props: DTableProps): {
100
97
  collect: (callback: (item: DataItem) => void) => void;
101
98
  upload: (array: any[]) => void;
102
99
  remove: (id?: number | string) => void;
100
+ clip: () => void;
103
101
  };
@@ -1,6 +1,8 @@
1
1
  import { type Ref } from "vue";
2
- import { MTablePopperType, MTableProps } from "../../components/table/simple/types";
2
+ import { MTablePopperType, MTableProps } from "../../../components/table/simple/types";
3
3
  export declare function useMTable(table: Ref, props: MTableProps): {
4
+ handleOrder: (prop: string, dir: 1 | -1) => void;
5
+ check: (flag: boolean) => void;
4
6
  visible: import("vue").ComputedRef<{
5
7
  popover: {
6
8
  meta: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "3.0.22",
3
+ "version": "3.0.24",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"