morghulis 3.0.17 → 3.0.19

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 (27) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/morghulis.es.js +8868 -5098
  3. package/dist/morghulis.es.js.map +1 -1
  4. package/dist/morghulis.umd.js +586 -26
  5. package/dist/morghulis.umd.js.map +1 -1
  6. package/dist/types/components/common/MCtrlBtn.vue.d.ts +23 -0
  7. package/dist/types/components/common/MOption.vue.d.ts +9 -0
  8. package/dist/types/components/table-data/DTable.vue.d.ts +11 -1
  9. package/dist/types/components/table-data/controller/DTableController.vue.d.ts +18 -0
  10. package/dist/types/components/table-data/types.d.ts +0 -2
  11. package/dist/types/components/table-morghulis/MTable.vue.d.ts +11 -6
  12. package/dist/types/components/table-morghulis/buttons/MTableButtonWrapper.vue.d.ts +6 -0
  13. package/dist/types/components/table-morghulis/buttons/MTableButtons.vue.d.ts +14 -0
  14. package/dist/types/components/table-morghulis/columns/MTableColumnWrapper.vue.d.ts +6 -0
  15. package/dist/types/components/table-morghulis/types.d.ts +12 -4
  16. package/dist/types/components/table-morghulis/widgets/MTableHeader.vue.d.ts +19 -0
  17. package/dist/types/components/table-morghulis/widgets/MTableIndex.vue.d.ts +12 -0
  18. package/dist/types/components/table-morghulis/widgets/MTablePopover.vue.d.ts +20 -0
  19. package/dist/types/components/table-simple/STable.vue.d.ts +12 -0
  20. package/dist/types/hooks/use-channel/types.d.ts +1 -0
  21. package/dist/types/hooks/use-dao/index.d.ts +1 -0
  22. package/dist/types/hooks/use-query/types.d.ts +2 -2
  23. package/dist/types/hooks/use-table-data/index.d.ts +33 -5
  24. package/dist/types/hooks/use-table-data/tool.d.ts +0 -0
  25. package/dist/types/hooks/use-table-morghulis/index.d.ts +22 -9
  26. package/dist/types/index.d.ts +4 -1
  27. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ type __VLS_Props = {
2
+ disabled?: boolean;
3
+ type?: "success" | "info" | "warning" | "danger" | 'primary' | '';
4
+ size?: 'default' | 'small' | 'large' | "";
5
+ title?: string;
6
+ icon?: string;
7
+ };
8
+ declare var __VLS_14: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_14) => any;
11
+ };
12
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ click: (...args: any[]) => void;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onClick?: ((...args: any[]) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,9 @@
1
+ type __VLS_Props = {
2
+ option: {
3
+ label: any;
4
+ value: any;
5
+ display: any;
6
+ };
7
+ };
8
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -1,3 +1,13 @@
1
1
  import { DTableProps } from "./types";
2
- declare const _default: import("vue").DefineComponent<DTableProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DTableProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
+ declare var __VLS_7: {};
3
+ type __VLS_Slots = {} & {
4
+ header?: (props: typeof __VLS_7) => any;
5
+ };
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
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
3
8
  export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,18 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ selection?: any;
3
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ remove: (...args: any[]) => void;
5
+ open: (...args: any[]) => void;
6
+ copy: (...args: any[]) => void;
7
+ upload: (...args: any[]) => void;
8
+ download: (...args: any[]) => void;
9
+ }, string, import("vue").PublicProps, Readonly<{
10
+ selection?: any;
11
+ }> & Readonly<{
12
+ onRemove?: ((...args: any[]) => any) | undefined;
13
+ onOpen?: ((...args: any[]) => any) | undefined;
14
+ onCopy?: ((...args: any[]) => any) | undefined;
15
+ onUpload?: ((...args: any[]) => any) | undefined;
16
+ onDownload?: ((...args: any[]) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
18
+ export default _default;
@@ -12,6 +12,4 @@ export type DTableProps = {
12
12
  export type DTableInfo = {
13
13
  current: number;
14
14
  total: number;
15
- page: number;
16
- size: number;
17
15
  };
@@ -1,20 +1,25 @@
1
1
  import { type MTableProps } from "./types";
2
2
  declare function getSelection(): any;
3
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_40: {
3
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_35: {
4
4
  field: import("../../hooks/use-mata/types").MetaField;
5
5
  row: any;
6
6
  prop: string | number;
7
- }, __VLS_42: {}, __VLS_44: {};
7
+ }, __VLS_43: {}, __VLS_45: {}, __VLS_54: {
8
+ type: import("./types").MTablePopperType;
9
+ data: any;
10
+ };
8
11
  type __VLS_Slots = {} & {
9
12
  header?: (props: typeof __VLS_1) => any;
10
13
  } & {
11
14
  'header-tool'?: (props: typeof __VLS_3) => any;
12
15
  } & {
13
- cell?: (props: typeof __VLS_40) => any;
16
+ cell?: (props: typeof __VLS_35) => any;
17
+ } & {
18
+ footer?: (props: typeof __VLS_43) => any;
14
19
  } & {
15
- footer?: (props: typeof __VLS_42) => any;
20
+ 'footer-tool'?: (props: typeof __VLS_45) => any;
16
21
  } & {
17
- 'footer-tool'?: (props: typeof __VLS_44) => any;
22
+ pop?: (props: typeof __VLS_54) => any;
18
23
  };
19
24
  declare const __VLS_component: import("vue").DefineComponent<MTableProps, {
20
25
  getSelection: typeof getSelection;
@@ -22,6 +27,7 @@ declare const __VLS_component: import("vue").DefineComponent<MTableProps, {
22
27
  closePopover: () => boolean;
23
28
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MTableProps> & Readonly<{}>, {
24
29
  border: boolean;
30
+ showOverflowTooltip: boolean;
25
31
  fit: boolean;
26
32
  showHeader: boolean;
27
33
  highlightCurrentRow: boolean;
@@ -31,7 +37,6 @@ declare const __VLS_component: import("vue").DefineComponent<MTableProps, {
31
37
  rowIndex: number;
32
38
  columnIndex: number;
33
39
  }) => string) | string;
34
- showOverflowTooltip: boolean;
35
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
41
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
37
42
  export default _default;
@@ -0,0 +1,6 @@
1
+ import { MTableButton } from "../types";
2
+ type __VLS_Props = {
3
+ buttons?: MTableButton[];
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { MTableButton } from "../types";
2
+ import { DataItem } from "../../../hooks/use-query/types";
3
+ type __VLS_Props = {
4
+ buttons: MTableButton[];
5
+ item: DataItem;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ click: (...args: any[]) => void;
9
+ width: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onClick?: ((...args: any[]) => any) | undefined;
12
+ onWidth?: ((...args: any[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { MTableColumn } from "../types";
2
+ type __VLS_Props = {
3
+ columns?: MTableColumn[];
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -124,11 +124,18 @@ export type MTableProps = TableProps & {
124
124
  columns?: MTableColumn[];
125
125
  sortableCallback?: MTableSortableFn;
126
126
  };
127
+ export type MTablePopperRef = {
128
+ getBoundingClientRect: () => {
129
+ x: number;
130
+ y: number;
131
+ };
132
+ };
133
+ export type MTablePopperType = 'meta' | 'search' | 'field' | 'cell' | 'index' | null | undefined;
127
134
  export type MTablePopper = {
128
- ref?: any;
129
- visible?: boolean;
130
- type?: string | null | undefined;
131
- data?: any;
135
+ vRef: MTablePopperRef;
136
+ visible: boolean;
137
+ type: MTablePopperType;
138
+ data: any;
132
139
  placement?: 'left' | 'right' | 'top' | 'bottom' | null | string;
133
140
  };
134
141
  export type MTableSortableFn = (newIndex: number, oldIndex: number) => void;
@@ -146,6 +153,7 @@ export type MTableButton = {
146
153
  dark?: boolean | Function;
147
154
  color?: string | Function;
148
155
  tag?: string | Function;
156
+ icon?: string | Function;
149
157
  };
150
158
  export type MTableColumn = {
151
159
  label: string;
@@ -0,0 +1,19 @@
1
+ import { MetaField, MetaView } from "../../../hooks/use-mata/types";
2
+ type __VLS_Props = {
3
+ view: MetaView;
4
+ field: MetaField;
5
+ order: object;
6
+ searchable: boolean;
7
+ metaEnable: boolean;
8
+ sortable: boolean;
9
+ };
10
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ search: (...args: any[]) => void;
12
+ meta: (...args: any[]) => void;
13
+ order: (...args: any[]) => void;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onSearch?: ((...args: any[]) => any) | undefined;
16
+ onMeta?: ((...args: any[]) => any) | undefined;
17
+ onOrder?: ((...args: any[]) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ disabled?: any;
3
+ selection?: any;
4
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ click: (...args: any[]) => void;
6
+ }, string, import("vue").PublicProps, Readonly<{
7
+ disabled?: any;
8
+ selection?: any;
9
+ }> & Readonly<{
10
+ onClick?: ((...args: any[]) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { MTablePopper } from "../types";
2
+ declare var __VLS_34: {
3
+ type: import("../types").MTablePopperType;
4
+ data: any;
5
+ };
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_34) => any;
8
+ };
9
+ declare const __VLS_component: import("vue").DefineComponent<MTablePopper, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: (...args: any[]) => void;
11
+ }, string, import("vue").PublicProps, Readonly<MTablePopper> & Readonly<{
12
+ onClose?: ((...args: any[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,12 @@
1
+ import { DataItem } from "../../hooks/use-query/types";
2
+ import { MetaView } from "../../hooks/use-mata/types";
3
+ import { MTableButton, MTableColumn } from "../table-morghulis/types";
4
+ type __VLS_Props = {
5
+ title?: string;
6
+ data: DataItem[];
7
+ view: MetaView;
8
+ buttons?: MTableButton[];
9
+ columns?: MTableColumn[];
10
+ };
11
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
@@ -6,6 +6,7 @@ export type MorghulisChannelConfig = {
6
6
  };
7
7
  export type MorghulisChannelSimple = {
8
8
  loading: Ref<boolean>;
9
+ payload: Ref<any>;
9
10
  activate: (body: any) => void;
10
11
  };
11
12
  export type MorghulisChannel = {
@@ -7,6 +7,7 @@ import { DataItem, Query } from "../use-query/types";
7
7
  */
8
8
  export declare function useMDao(meta: Ref<Meta>, channelConfig?: MorghulisChannelConfig, auth?: boolean): {
9
9
  loading: import("vue").ComputedRef<boolean>;
10
+ payload: Ref<any, any>;
10
11
  find_many: (query: Query) => Promise<{
11
12
  results: DataItem[];
12
13
  total?: number;
@@ -7,8 +7,8 @@ type Orders = {
7
7
  [key: string]: 1 | -1;
8
8
  };
9
9
  type Condition = {
10
- includes: DataItem;
11
- excludes: DataItem;
10
+ includes?: DataItem;
11
+ excludes?: DataItem;
12
12
  };
13
13
  export type QueryConfig = {
14
14
  includes?: DataItem;
@@ -1,9 +1,39 @@
1
1
  import { ComputedRef, Ref } from "vue";
2
2
  import { DTableInfo, DTableProps } from "../../components/table-data/types";
3
3
  import { Meta, MetaView } from "../use-mata/types";
4
- import { DataItem, Query } from "../use-query/types";
4
+ import { DataItem, Query, QueryConfig } from "../use-query/types";
5
5
  export declare function useDTable(table: Ref, props: DTableProps): {
6
6
  meta: ComputedRef<Meta>;
7
+ payload: Ref<any, any>;
8
+ config: Ref<{
9
+ includes?: {
10
+ [x: string]: any;
11
+ id?: (string | number) | undefined;
12
+ } | undefined;
13
+ excludes?: {
14
+ [x: string]: any;
15
+ id?: (string | number) | undefined;
16
+ } | undefined;
17
+ orders?: {
18
+ [key: string]: 1 | -1;
19
+ } | undefined;
20
+ page?: number | undefined;
21
+ size?: number | undefined;
22
+ }, QueryConfig | {
23
+ includes?: {
24
+ [x: string]: any;
25
+ id?: (string | number) | undefined;
26
+ } | undefined;
27
+ excludes?: {
28
+ [x: string]: any;
29
+ id?: (string | number) | undefined;
30
+ } | undefined;
31
+ orders?: {
32
+ [key: string]: 1 | -1;
33
+ } | undefined;
34
+ page?: number | undefined;
35
+ size?: number | undefined;
36
+ }>;
7
37
  query: ComputedRef<Query>;
8
38
  view: Ref<{
9
39
  fields?: {
@@ -55,13 +85,9 @@ export declare function useDTable(table: Ref, props: DTableProps): {
55
85
  info: Ref<{
56
86
  current: number;
57
87
  total: number;
58
- page: number;
59
- size: number;
60
88
  }, DTableInfo | {
61
89
  current: number;
62
90
  total: number;
63
- page: number;
64
- size: number;
65
91
  }>;
66
92
  results: Ref<{
67
93
  [x: string]: any;
@@ -73,4 +99,6 @@ export declare function useDTable(table: Ref, props: DTableProps): {
73
99
  selection: ComputedRef<any[]>;
74
100
  loading: ComputedRef<boolean>;
75
101
  load: () => void;
102
+ upload: (array: any[]) => void;
103
+ remove: (id?: number | string) => void;
76
104
  };
File without changes
@@ -1,11 +1,27 @@
1
1
  import { type Ref } from "vue";
2
- import { MTableProps } from "../../components/table-morghulis/types";
2
+ import { MTablePopperType, MTableProps } from "../../components/table-morghulis/types";
3
3
  export declare function useMTable(table: Ref, props: MTableProps): {
4
+ visible: import("vue").ComputedRef<{
5
+ popover: {
6
+ meta: boolean;
7
+ search: boolean;
8
+ field: boolean;
9
+ index: boolean;
10
+ cell: boolean;
11
+ };
12
+ header: boolean;
13
+ footer: boolean;
14
+ }>;
4
15
  popover: {
5
- ref?: any;
6
- visible?: boolean | undefined;
7
- type?: string | null | undefined | undefined;
8
- data?: any;
16
+ vRef: {
17
+ getBoundingClientRect: () => {
18
+ x: number;
19
+ y: number;
20
+ };
21
+ };
22
+ visible: boolean;
23
+ type: MTablePopperType;
24
+ data: any;
9
25
  placement?: "left" | "right" | "top" | "bottom" | null | string | undefined;
10
26
  };
11
27
  selection: import("vue").ComputedRef<any>;
@@ -16,10 +32,7 @@ export declare function useMTable(table: Ref, props: MTableProps): {
16
32
  showPopover: (event: {
17
33
  clientX: number;
18
34
  clientY: number;
19
- }, type: string, data?: any, placement?: string) => void;
35
+ }, type: MTablePopperType, data?: any, placement?: string) => void;
20
36
  closePopover: () => boolean;
21
37
  setSelection: (keys: any[]) => void;
22
- hasSearchSlot: import("vue").ComputedRef<boolean>;
23
- hasFieldSlot: import("vue").ComputedRef<boolean>;
24
- hasMetaViewSlot: import("vue").ComputedRef<boolean>;
25
38
  };
@@ -9,15 +9,18 @@ import MDialog from "./components/dialog/MDialog.vue";
9
9
  import MApp from "./MApp.vue";
10
10
  import MTable from "./components/table-morghulis/MTable.vue";
11
11
  import DTable from "./components/table-data/DTable.vue";
12
+ import type { MTableButton, MTableColumn } from "./components/table-morghulis/types";
13
+ import STable from "./components/table-simple/STable.vue";
12
14
  declare module "vue" {
13
15
  interface GlobalComponents {
14
16
  MApp: typeof MApp;
15
17
  MDialog: typeof MDialog;
16
18
  MTable: typeof MTable;
17
19
  DTable: typeof DTable;
20
+ STable: typeof STable;
18
21
  }
19
22
  }
20
23
  declare const createMorghulis: (options?: MorghulisOptions) => {
21
24
  install(Vue: App): void;
22
25
  };
23
- export { MApp, MDialog, MTable, DTable, createMorghulis, useMRequest, useMChannel, useMSockets, MorghulisChannelConfig };
26
+ export { MApp, MDialog, MTable, DTable, STable, createMorghulis, useMRequest, useMChannel, useMSockets, MorghulisChannelConfig, MTableButton, MTableColumn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "3.0.17",
3
+ "version": "3.0.19",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"