morghulis 3.0.14 → 3.0.16

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.
@@ -0,0 +1,12 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
@@ -31,11 +31,15 @@ declare const __VLS_component: import("vue").DefineComponent<MorghulisDialogProp
31
31
  "onUpdate:title"?: ((...args: any[]) => any) | undefined;
32
32
  "onUpdate:subtitle"?: ((...args: any[]) => any) | undefined;
33
33
  }>, {
34
+ showClose: boolean;
35
+ zIndex: number;
36
+ appendTo: string;
34
37
  title: string;
38
+ confirm: (data: any, done: () => void) => void;
39
+ cancel: (data: any, done: () => void) => void;
35
40
  subtitle: string;
36
41
  confirmButtonText: string;
37
42
  cancelButtonText: string;
38
- cancel: (data: any, done: () => void) => void;
39
43
  width: string | number;
40
44
  fullscreen: boolean;
41
45
  top: string;
@@ -45,13 +49,11 @@ declare const __VLS_component: import("vue").DefineComponent<MorghulisDialogProp
45
49
  bodyClass: string;
46
50
  footerClass: string;
47
51
  appendToBody: boolean;
48
- appendTo: string;
49
52
  lockScroll: boolean;
50
53
  openDelay: number;
51
54
  closeDelay: number;
52
55
  closeOnClickModal: boolean;
53
56
  closeOnPressEscape: boolean;
54
- showClose: boolean;
55
57
  beforeClose: (done: () => void) => void;
56
58
  draggable: boolean;
57
59
  overFlow: boolean;
@@ -59,9 +61,7 @@ declare const __VLS_component: import("vue").DefineComponent<MorghulisDialogProp
59
61
  alignCenter: boolean;
60
62
  destroyOnClose: boolean;
61
63
  closeIcon: string;
62
- zIndex: number;
63
64
  headerAriaLevel: string;
64
- confirm: (data: any, done: () => void) => void;
65
65
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
66
66
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
67
67
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare function useMorghulisAuthorize(): {
1
+ export declare function useMAuth(): {
2
2
  $client: string;
3
3
  user: () => any;
4
4
  check: (uid?: any) => boolean;
@@ -1,9 +1,5 @@
1
- import { MorghulisChannel } from "../use-core/types";
2
- export declare function useMorghulisChannel(auth?: boolean): {
3
- register: (handler: string, channel: MorghulisChannel, url?: string) => void;
4
- activate: (body: any) => void;
5
- status: {
6
- loading: boolean;
7
- payload?: any;
8
- };
1
+ import type { MorghulisChannel, MorghulisChannelConfig } from "./types";
2
+ export declare function useMChannel(auth?: boolean): {
3
+ register: (handler: string, channel?: MorghulisChannelConfig, socketURL?: string) => void;
4
+ getChannel: (handler: string) => MorghulisChannel | undefined;
9
5
  };
@@ -1,3 +1,2 @@
1
- import { MorghulisChannel } from "../use-core/types";
2
- import { ChannelStatus } from "./types";
3
- export declare function getChannel(status: ChannelStatus, channel?: MorghulisChannel): MorghulisChannel;
1
+ import type { MorghulisChannel, MorghulisChannelConfig } from "./types";
2
+ export declare function createChannel(url: string, channel?: MorghulisChannelConfig, auth?: boolean): MorghulisChannel;
@@ -1,4 +1,18 @@
1
- export type ChannelStatus = {
2
- loading: boolean;
3
- payload?: any;
1
+ import { Ref } from "vue";
2
+ export type MorghulisChannelConfig = {
3
+ onStart?: () => void;
4
+ onStop?: () => void;
5
+ onProceed?: (payload: any) => void;
6
+ };
7
+ export type MorghulisChannel = {
8
+ payload: Ref<any>;
9
+ loading: Ref<boolean>;
10
+ activate: (body: any) => void;
11
+ $url: string;
12
+ $start: () => void;
13
+ $stop: () => void;
14
+ $proceed?: (payload: any) => void;
15
+ };
16
+ export type MorghulisChannels = {
17
+ [key: string]: MorghulisChannel;
4
18
  };
@@ -1,4 +1,4 @@
1
- export declare function useMorghulisCookies(): {
1
+ export declare function useMCookies(): {
2
2
  get: (path: string) => any;
3
3
  set: (path: string, value?: any) => void;
4
4
  remove: (path: string) => void;
@@ -0,0 +1,9 @@
1
+ import { type Ref } from "vue";
2
+ import { type Meta } from "../use-mata/types";
3
+ import { MorghulisChannelConfig } from "../use-channel/types";
4
+ /**
5
+ * http和socket的loading冲突问题
6
+ */
7
+ export declare function useMDao(meta: Ref<Meta>, channel?: MorghulisChannelConfig, auth?: boolean): {
8
+ handler: import("vue").ComputedRef<string>;
9
+ };
@@ -0,0 +1,20 @@
1
+ import { DataItem, Query } from "../use-query/types";
2
+ import { MetaView } from "../use-mata/types";
3
+ import { ComputedRef } from "vue";
4
+ import { MorghulisChannelConfig } from "../use-channel/types";
5
+ export type DaoConfig = {
6
+ auth?: boolean;
7
+ channel: MorghulisChannelConfig;
8
+ };
9
+ export type DaoPayload = {
10
+ results: DataItem[];
11
+ total?: number;
12
+ };
13
+ export type DaoCallback = (item: DataItem | DaoPayload | MetaView | null) => void;
14
+ export interface Dao {
15
+ handler: ComputedRef<string>;
16
+ find_many: (query: Query) => Promise<{
17
+ results: DataItem[];
18
+ total?: number;
19
+ }>;
20
+ }
File without changes
@@ -0,0 +1,85 @@
1
+ export type MetaDatabase = 'orm' | 'mon';
2
+ export type Meta = {
3
+ db: MetaDatabase;
4
+ entity: string;
5
+ code?: string;
6
+ };
7
+ export type MetaView = {
8
+ fields?: {
9
+ [key: string]: MetaField;
10
+ };
11
+ path?: string;
12
+ code?: string;
13
+ meta_name?: string;
14
+ view_name?: string;
15
+ form_width?: number;
16
+ form_height?: number;
17
+ table_width?: number;
18
+ table_height?: number;
19
+ enable?: boolean;
20
+ show_header?: boolean;
21
+ allow_batch?: boolean;
22
+ allow_search?: boolean;
23
+ allow_sort?: boolean;
24
+ allow_pop?: boolean;
25
+ allow_insert?: boolean;
26
+ allow_edit?: boolean;
27
+ allow_remove?: boolean;
28
+ allow_download?: boolean;
29
+ allow_upload?: boolean;
30
+ };
31
+ export type MetaField = {
32
+ prop?: string;
33
+ label?: string;
34
+ name?: string;
35
+ domain?: string;
36
+ tool?: string;
37
+ refer?: MetaRefer;
38
+ format?: MetaFormat;
39
+ unit?: string | null;
40
+ not_null?: boolean;
41
+ read_only?: boolean;
42
+ sortable?: boolean;
43
+ allow_search?: boolean;
44
+ allow_download?: boolean;
45
+ allow_upload?: boolean;
46
+ allow_update?: boolean;
47
+ column_width?: number;
48
+ align?: 'left' | 'center' | 'right';
49
+ fixed?: '' | 'left' | 'right';
50
+ header_color?: string | null;
51
+ cell_color?: string | null;
52
+ edit_on_table?: boolean;
53
+ hide_on_table?: boolean;
54
+ span?: number;
55
+ hide_on_form?: boolean;
56
+ hide_on_form_edit?: boolean;
57
+ hide_on_form_insert?: boolean;
58
+ hide_on_form_branch?: boolean;
59
+ hide_on_form_leaf?: boolean;
60
+ };
61
+ export type MetaRefer = {
62
+ entity?: string;
63
+ value?: string;
64
+ label?: string;
65
+ display?: string;
66
+ multiple?: boolean;
67
+ strict?: boolean;
68
+ remote?: boolean;
69
+ includes?: object;
70
+ excludes?: object;
71
+ root?: number;
72
+ };
73
+ export type MetaFormat = {
74
+ maxlength?: number;
75
+ type?: 'date' | 'datetime';
76
+ min?: number | null;
77
+ max?: number | null;
78
+ step?: number | null;
79
+ precision?: number | null;
80
+ step_strictly?: boolean;
81
+ accept?: string;
82
+ width?: number | string;
83
+ height?: number | string;
84
+ locket?: boolean;
85
+ };
@@ -0,0 +1,2 @@
1
+ import { MorghulisCore, MorghulisOptions } from "./types";
2
+ export declare function useMorghulis(options?: MorghulisOptions): MorghulisCore;
@@ -1,12 +1,5 @@
1
1
  import { Ref } from "vue";
2
- export type MorghulisChannel = {
3
- start?: () => void;
4
- stop?: () => void;
5
- proceed?: (payload: any) => void;
6
- };
7
- export type MorghulisChannels = {
8
- [key: string]: MorghulisChannel;
9
- };
2
+ import { MorghulisChannels } from "../use-channel/types";
10
3
  export type MorghulisOptions = {
11
4
  baseURL?: string;
12
5
  minioURL?: string;
@@ -0,0 +1,2 @@
1
+ import { QueryTemplate } from "./types";
2
+ export declare function useMQuery(template?: QueryTemplate): void;
File without changes
@@ -0,0 +1,20 @@
1
+ export type DataItem = {
2
+ id?: DataItem;
3
+ [key: string]: any;
4
+ };
5
+ export type DataItemId = string | number;
6
+ export type Orders = {
7
+ [key: string]: 1 | -1;
8
+ };
9
+ export type Condition = {
10
+ includes: DataItem;
11
+ excludes: DataItem;
12
+ };
13
+ export type QueryTemplate = {
14
+ includes?: DataItem;
15
+ excludes?: DataItem;
16
+ orders?: Orders;
17
+ page?: number;
18
+ size?: number;
19
+ };
20
+ export type Query = {};
@@ -1,5 +1,5 @@
1
1
  import 'nprogress/nprogress.css';
2
- export declare function useMorghulisRequest(): {
2
+ export declare function useMRequest(): {
3
3
  getHttpRequest: (auth?: boolean) => import("axios").AxiosInstance;
4
4
  getMinioRequest: () => import("axios").AxiosInstance;
5
5
  all: () => void;
@@ -1,4 +1,4 @@
1
- export declare function useMorghulisSockets(): {
1
+ export declare function useMSockets(): {
2
2
  open: () => void;
3
3
  status: import("vue").Ref<string, string>;
4
4
  };
@@ -1,16 +1,19 @@
1
1
  import './style.css';
2
2
  import { App } from "vue";
3
+ import { useMRequest } from "./hooks/use-request";
4
+ import { useMChannel } from "./hooks/use-channel";
5
+ import { useMSockets } from "./hooks/use-socket";
6
+ import { MorghulisOptions } from "./hooks/use-morghulis/types";
7
+ import type { MorghulisChannelConfig } from "./hooks/use-channel/types";
8
+ import MApp from "./MApp.vue";
3
9
  import MDialog from "./components/dialog/MDialog.vue";
4
- import { type MorghulisChannel, MorghulisOptions } from "./hooks/use-core/types";
5
- import { useMorghulisRequest } from "./hooks/use-request";
6
- import { useMorghulisChannel } from "./hooks/use-channel";
7
- import { useMorghulisSockets } from "./hooks/use-socket";
8
10
  declare module "vue" {
9
11
  interface GlobalComponents {
12
+ MApp: typeof MApp;
10
13
  MDialog: typeof MDialog;
11
14
  }
12
15
  }
13
- export declare const createMorghulis: (options?: MorghulisOptions) => {
16
+ declare const createMorghulis: (options?: MorghulisOptions) => {
14
17
  install(Vue: App): void;
15
18
  };
16
- export { MDialog, useMorghulisRequest, useMorghulisChannel, useMorghulisSockets, MorghulisChannel };
19
+ export { MApp, MDialog, createMorghulis, useMRequest, useMChannel, useMSockets, MorghulisChannelConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "3.0.14",
3
+ "version": "3.0.16",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,2 +0,0 @@
1
- import { MorghulisCore, MorghulisOptions } from "./types";
2
- export declare function initMorghulis(options?: MorghulisOptions): MorghulisCore;