@morghulis/core 0.0.6 → 0.0.7

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 (40) hide show
  1. package/dist/morghulis-core.es.js +13997 -9669
  2. package/dist/morghulis-core.es.js.map +1 -1
  3. package/dist/morghulis-core.umd.js +143 -67
  4. package/dist/morghulis-core.umd.js.map +1 -1
  5. package/dist/types/hooks/core/use-channel/Channel.d.ts +1 -1
  6. package/dist/types/hooks/core/use-channel/ChannelHub.d.ts +4 -2
  7. package/dist/types/hooks/core/use-channel/config.d.ts +1 -1
  8. package/dist/types/hooks/core/use-channel/index.d.ts +20 -5
  9. package/dist/types/{types.d.ts → hooks/core/use-core/types.d.ts} +1 -1
  10. package/dist/types/hooks/core/use-request/index.d.ts +2 -1
  11. package/dist/types/hooks/data/use-dao/index.d.ts +12 -3
  12. package/dist/types/hooks/data/use-dao/types.d.ts +6 -17
  13. package/dist/types/hooks/data/use-data/index.d.ts +118 -0
  14. package/dist/types/hooks/data/use-data/types.d.ts +4 -0
  15. package/dist/types/hooks/data/use-meta/MetaField.d.ts +1 -1
  16. package/dist/types/hooks/data/use-meta/MetaView.d.ts +1 -1
  17. package/dist/types/hooks/data/use-meta/types.d.ts +7 -2
  18. package/dist/types/hooks/data/use-model/DataModel.d.ts +13 -0
  19. package/dist/types/hooks/data/use-model/TableModel.d.ts +17 -0
  20. package/dist/types/hooks/data/use-model/TreeModel.d.ts +25 -0
  21. package/dist/types/hooks/data/use-query/Finder.d.ts +12 -0
  22. package/dist/types/hooks/data/use-query/Lookup.d.ts +26 -0
  23. package/dist/types/hooks/data/use-query/index.d.ts +98 -8
  24. package/dist/types/hooks/data/use-query/types.d.ts +32 -0
  25. package/dist/types/hooks/utils/use-aoa/index.d.ts +5 -0
  26. package/dist/types/hooks/utils/use-aoa/types.d.ts +8 -0
  27. package/dist/types/hooks/utils/use-xlsx/index.d.ts +5 -4
  28. package/dist/types/hooks/utils/use-xlsx/types.d.ts +15 -6
  29. package/dist/types/index.d.ts +17 -4
  30. package/package.json +1 -1
  31. package/dist/types/hooks/data/types.d.ts +0 -18
  32. package/dist/types/hooks/data/use-dao/TableModel.d.ts +0 -4
  33. package/dist/types/hooks/data/use-dao/TreeModel.d.ts +0 -4
  34. package/dist/types/hooks/data/use-dao/config.d.ts +0 -0
  35. package/dist/types/hooks/data/use-query/Query.d.ts +0 -11
  36. package/dist/types/hooks/data/use-query/tools.d.ts +0 -8
  37. package/dist/types/hooks/data/use-query/types/config.d.ts +0 -18
  38. package/dist/types/hooks/data/use-query/types/finder.d.ts +0 -18
  39. package/dist/types/hooks/data/use-query/types/search.d.ts +0 -23
  40. /package/dist/types/{core.d.ts → hooks/core/use-core/index.d.ts} +0 -0
@@ -9,7 +9,7 @@ export default class Channel {
9
9
  channelKey: string;
10
10
  url: string;
11
11
  request: AxiosInstance;
12
- constructor(config: ChannelConfig);
12
+ constructor(config: ChannelConfig, request: AxiosInstance);
13
13
  execute(data?: any): void;
14
14
  ready(): void;
15
15
  start(): void;
@@ -1,10 +1,12 @@
1
1
  import { ChannelContainer } from "./types";
2
2
  import Channel from "./Channel";
3
+ import { AxiosInstance } from "axios";
3
4
  import { ChannelConfig } from "./config";
4
5
  export default class ChannelHub {
5
6
  container: ChannelContainer;
6
- constructor();
7
+ getHttpRequest: (auth?: boolean) => AxiosInstance;
8
+ constructor(getHttpRequest: (auth?: boolean) => AxiosInstance);
7
9
  loadChannel(handlerKey: string, channelKey: string): Promise<Channel>;
8
10
  destroy(handlerKey: string, channelKey: string): void;
9
- register(config: ChannelConfig): Channel;
11
+ register(config: ChannelConfig, auth?: boolean): Channel;
10
12
  }
@@ -10,7 +10,7 @@ export type IChannelConfig = {
10
10
  export type ChannelConfig = {
11
11
  handlerKey: string;
12
12
  channelKey: string;
13
- url: string;
13
+ url?: string;
14
14
  auth?: boolean;
15
15
  onStart(): void;
16
16
  onStop(): void;
@@ -1,9 +1,24 @@
1
- import { IChannelConfig } from "./config";
2
- import { Ref } from "vue";
1
+ import { ChannelConfig, IChannelConfig } from "./config";
3
2
  import Channel from "./Channel";
4
- export declare function createChannel(config: IChannelConfig): Channel;
5
- export declare function useChannel(config: Ref<IChannelConfig>): {
6
- channel: Ref<{
3
+ export declare function useChannel($config: IChannelConfig): {
4
+ config: import("vue").Ref<{
5
+ handlerKey: string;
6
+ channelKey: string;
7
+ url?: string | undefined;
8
+ auth?: boolean | undefined;
9
+ onStart: () => void;
10
+ onStop: () => void;
11
+ onProceed?: ((payload: any) => void) | undefined;
12
+ }, ChannelConfig | {
13
+ handlerKey: string;
14
+ channelKey: string;
15
+ url?: string | undefined;
16
+ auth?: boolean | undefined;
17
+ onStart: () => void;
18
+ onStop: () => void;
19
+ onProceed?: ((payload: any) => void) | undefined;
20
+ }>;
21
+ channel: import("vue").Ref<{
7
22
  status: {
8
23
  loading: boolean;
9
24
  payload: any;
@@ -1,5 +1,5 @@
1
1
  import { Ref } from "vue";
2
- import ChannelHub from "./hooks/core/use-channel/ChannelHub";
2
+ import ChannelHub from "../use-channel/ChannelHub";
3
3
  export type IOptions = {
4
4
  baseURL?: string;
5
5
  minioURL?: string;
@@ -1,5 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
- export declare function useRequest(): {
2
+ import { Options } from "../use-core/types";
3
+ export declare function useRequest(options?: Options): {
3
4
  getHttpRequest: (auth?: boolean) => AxiosInstance;
4
5
  download: (path: string) => void;
5
6
  all: (mapping: {
@@ -1,8 +1,17 @@
1
- import { Meta } from "../use-meta/types";
1
+ import { IMeta, Meta } from "../use-meta/types";
2
+ import { Ref } from "vue";
2
3
  import { Dao } from "./types";
3
- export declare function createDao(meta: Meta, token?: string, auth?: boolean): {
4
+ export declare function useDao($meta: IMeta, auth?: boolean): {
5
+ meta: Ref<{
6
+ db: import("./types").Database;
7
+ entity: string;
8
+ code: string;
9
+ }, Meta | {
10
+ db: import("./types").Database;
11
+ entity: string;
12
+ code: string;
13
+ }>;
4
14
  dao: Dao;
5
15
  loading: import("vue").ComputedRef<boolean>;
6
16
  payload: import("vue").ComputedRef<any>;
7
- destroy: () => void;
8
17
  };
@@ -1,20 +1,9 @@
1
- import { DataItem, DataItemId, TreeItem } from "../types";
2
- import { Condition, Search } from "../use-query/types/search";
3
- import TableModel from "./TableModel";
4
- import TreeModel from "./TreeModel";
5
1
  import MetaView from "../use-meta/MetaView";
6
- export type QueryInfo = {
7
- current: number;
8
- total: number;
9
- };
10
- export type TreeMapping = {
11
- [id: string | number]: TreeItem;
12
- };
13
- export type TableResults = {
14
- results: DataItem[];
15
- total: number;
16
- };
17
- export type TreeResults = TreeItem[];
2
+ import { DataItem, DataItemId } from "../use-model/DataModel";
3
+ import TableModel from "../use-model/TableModel";
4
+ import TreeModel from "../use-model/TreeModel";
5
+ import { Condition, Search } from "../use-query/types";
6
+ export type Database = 'orm' | 'mon';
18
7
  export type Dao = {
19
8
  save_many: (array: DataItem[]) => void;
20
9
  delete_many: (...conditions: Condition[]) => void;
@@ -25,5 +14,5 @@ export type Dao = {
25
14
  find: (...conditions: Condition[]) => Promise<DataItem[]>;
26
15
  table: (search: Search) => Promise<TableModel>;
27
16
  tree: (search: Search) => Promise<TreeModel>;
28
- meta_view: (code: string) => Promise<MetaView>;
17
+ meta_view: () => Promise<MetaView>;
29
18
  };
@@ -0,0 +1,118 @@
1
+ import { Search } from "../use-query/types";
2
+ import { ComputedRef } from "vue";
3
+ import MetaView from "../use-meta/MetaView";
4
+ import { Dao } from "../use-dao/types";
5
+ import TableModel from "../use-model/TableModel";
6
+ import TreeModel from "../use-model/TreeModel";
7
+ import { DataType, IDataConfig } from "./types";
8
+ export declare function useData($config: IDataConfig, type?: DataType, auth?: boolean): {
9
+ meta: import("vue").Ref<{
10
+ db: import("../use-dao/types").Database;
11
+ entity: string;
12
+ code: string;
13
+ }, import("../use-meta/types").Meta | {
14
+ db: import("../use-dao/types").Database;
15
+ entity: string;
16
+ code: string;
17
+ }>;
18
+ config: import("vue").Ref<{
19
+ includes: {
20
+ [x: string]: any;
21
+ id?: import("../use-model/DataModel").DataItemId | undefined;
22
+ };
23
+ excludes: {
24
+ [x: string]: any;
25
+ id?: import("../use-model/DataModel").DataItemId | undefined;
26
+ };
27
+ orders: import("../use-query/types").Orders;
28
+ page: number;
29
+ size: number;
30
+ root: import("../use-model/DataModel").DataItemId;
31
+ }, import("../use-query/types").QueryConfig | {
32
+ includes: {
33
+ [x: string]: any;
34
+ id?: import("../use-model/DataModel").DataItemId | undefined;
35
+ };
36
+ excludes: {
37
+ [x: string]: any;
38
+ id?: import("../use-model/DataModel").DataItemId | undefined;
39
+ };
40
+ orders: import("../use-query/types").Orders;
41
+ page: number;
42
+ size: number;
43
+ root: import("../use-model/DataModel").DataItemId;
44
+ }>;
45
+ finders: import("vue").Ref<{
46
+ includes: {
47
+ prop: string;
48
+ value: any;
49
+ isnull: boolean;
50
+ decorate: boolean;
51
+ lookup: import("../use-query/Lookup").LookupType;
52
+ load: (param: import("../use-query/Lookup").ILookup) => void;
53
+ equals: (that: import("../use-query/Lookup").default) => boolean;
54
+ fromKV: (key: string, value: any) => import("../use-query/Lookup").default;
55
+ toDataItem: () => {
56
+ [k: string]: any;
57
+ };
58
+ }[];
59
+ excludes: {
60
+ prop: string;
61
+ value: any;
62
+ isnull: boolean;
63
+ decorate: boolean;
64
+ lookup: import("../use-query/Lookup").LookupType;
65
+ load: (param: import("../use-query/Lookup").ILookup) => void;
66
+ equals: (that: import("../use-query/Lookup").default) => boolean;
67
+ fromKV: (key: string, value: any) => import("../use-query/Lookup").default;
68
+ toDataItem: () => {
69
+ [k: string]: any;
70
+ };
71
+ }[];
72
+ add: (type: import("../use-query/types").ConditionType, lookup: import("../use-query/Lookup").default) => void;
73
+ toCondition: () => {
74
+ includes: {};
75
+ excludes: {};
76
+ };
77
+ }[], import("../use-query/Finder").default[] | {
78
+ includes: {
79
+ prop: string;
80
+ value: any;
81
+ isnull: boolean;
82
+ decorate: boolean;
83
+ lookup: import("../use-query/Lookup").LookupType;
84
+ load: (param: import("../use-query/Lookup").ILookup) => void;
85
+ equals: (that: import("../use-query/Lookup").default) => boolean;
86
+ fromKV: (key: string, value: any) => import("../use-query/Lookup").default;
87
+ toDataItem: () => {
88
+ [k: string]: any;
89
+ };
90
+ }[];
91
+ excludes: {
92
+ prop: string;
93
+ value: any;
94
+ isnull: boolean;
95
+ decorate: boolean;
96
+ lookup: import("../use-query/Lookup").LookupType;
97
+ load: (param: import("../use-query/Lookup").ILookup) => void;
98
+ equals: (that: import("../use-query/Lookup").default) => boolean;
99
+ fromKV: (key: string, value: any) => import("../use-query/Lookup").default;
100
+ toDataItem: () => {
101
+ [k: string]: any;
102
+ };
103
+ }[];
104
+ add: (type: import("../use-query/types").ConditionType, lookup: import("../use-query/Lookup").default) => void;
105
+ toCondition: () => {
106
+ includes: {};
107
+ excludes: {};
108
+ };
109
+ }[]>;
110
+ dao: Dao;
111
+ loading: ComputedRef<boolean>;
112
+ payload: ComputedRef<any>;
113
+ template: ComputedRef<import("../use-model/DataModel").DataItem>;
114
+ search: ComputedRef<Search>;
115
+ view: import("vue").Ref<MetaView | undefined, MetaView | undefined>;
116
+ model: import("vue").Ref<TableModel | undefined, TableModel | undefined> | import("vue").Ref<TreeModel | undefined, TreeModel | undefined>;
117
+ load: (() => void) | (() => void);
118
+ };
@@ -0,0 +1,4 @@
1
+ import { IMeta } from "../use-meta/types";
2
+ import { IQueryConfig } from "../use-query/types";
3
+ export type DataType = 'table' | 'tree';
4
+ export type IDataConfig = IMeta & IQueryConfig;
@@ -1,7 +1,7 @@
1
- import { Database } from "../types";
2
1
  import { MetaFieldDomain, MetaFieldTool } from "./frame";
3
2
  import MetaRefer, { IMetaRefer } from "./MetaRefer";
4
3
  import MetaFormat, { IMetaFormat } from "./MetaFormat";
4
+ import { Database } from "../use-dao/types";
5
5
  export type IMetaField = {
6
6
  $db?: Database;
7
7
  $entity?: string;
@@ -1,5 +1,5 @@
1
- import { Database } from "../types";
2
1
  import MetaField, { IMetaField } from "./MetaField";
2
+ import { Database } from "../use-dao/types";
3
3
  export type IMetaView = {
4
4
  $db?: Database;
5
5
  $entity?: string;
@@ -1,6 +1,11 @@
1
- import { Database } from "../types";
1
+ import { Database } from "../use-dao/types";
2
+ export type IMeta = {
3
+ db?: Database;
4
+ entity: string;
5
+ code?: string;
6
+ };
2
7
  export type Meta = {
3
8
  db: Database;
4
9
  entity: string;
5
- code?: string;
10
+ code: string;
6
11
  };
@@ -0,0 +1,13 @@
1
+ export type DataItemId = string | number;
2
+ export type DataItem = {
3
+ id?: DataItemId;
4
+ [prop: string]: any;
5
+ };
6
+ export default class DataModel {
7
+ length: number;
8
+ items: DataItem[];
9
+ props: string[];
10
+ constructor(data?: DataItem[]);
11
+ load(data?: DataItem[]): void;
12
+ getProps(): string[];
13
+ }
@@ -0,0 +1,17 @@
1
+ import DataModel, { DataItem } from "./DataModel";
2
+ export type TableResults = {
3
+ results: DataItem[];
4
+ total: number;
5
+ };
6
+ export type TableMapping = {
7
+ [id: string | number]: DataItem;
8
+ };
9
+ export default class TableModel {
10
+ length: number;
11
+ total: number;
12
+ results: DataItem[];
13
+ mapping: TableMapping;
14
+ constructor(res?: TableResults);
15
+ load(res?: TableResults): void;
16
+ getDataModel(): DataModel;
17
+ }
@@ -0,0 +1,25 @@
1
+ import { IconNames } from "../../utils/use-icon/types";
2
+ import { DataItem } from "./DataModel";
3
+ export type TreeItem = {
4
+ pid: number | string;
5
+ isLeaf: boolean;
6
+ icon?: IconNames;
7
+ children: TreeItem[];
8
+ } & DataItem;
9
+ export type TreeResults = {
10
+ results: TreeItem[];
11
+ root?: number;
12
+ };
13
+ export type TreeMapping = {
14
+ [id: string | number]: TreeItem;
15
+ };
16
+ export default class TreeModel {
17
+ nodes: TreeItem[];
18
+ root_id: number | string;
19
+ root: TreeItem | null;
20
+ options: TreeItem[];
21
+ mapping: TreeMapping;
22
+ constructor(res: TreeResults);
23
+ load(res: TreeResults): void;
24
+ private initMapping;
25
+ }
@@ -0,0 +1,12 @@
1
+ import Lookup from "./Lookup";
2
+ import { Condition, ConditionType } from "./types";
3
+ export default class Finder {
4
+ includes: Lookup[];
5
+ excludes: Lookup[];
6
+ add(type: ConditionType, lookup: Lookup): void;
7
+ toCondition(): {
8
+ includes: {};
9
+ excludes: {};
10
+ };
11
+ constructor(condition?: Condition);
12
+ }
@@ -0,0 +1,26 @@
1
+ export type LookupType = 'contains' | 'exact' | 'startswith' | 'endswith' | 'gt' | 'lt' | 'isnull';
2
+ export declare const char_decorated_lookup: string[];
3
+ export declare const number_decorated_lookup: string[];
4
+ export declare const simple_lookup: LookupType[];
5
+ export declare const lookups: string[];
6
+ export type ILookup = {
7
+ prop: string;
8
+ value: any;
9
+ isnull: boolean;
10
+ decorate: boolean;
11
+ lookup: LookupType;
12
+ };
13
+ export default class Lookup {
14
+ prop: string;
15
+ value: any;
16
+ isnull: boolean;
17
+ decorate: boolean;
18
+ lookup: LookupType;
19
+ constructor(param?: ILookup);
20
+ load(param: ILookup): void;
21
+ equals(that: Lookup): boolean;
22
+ fromKV(key: string, value: any): this;
23
+ toDataItem(): {
24
+ [k: string]: any;
25
+ };
26
+ }
@@ -1,9 +1,99 @@
1
- import { IQueryConfig } from "./types/config";
2
- import { Ref } from "vue";
3
- import Query from "./Query";
4
- import { Finder } from "./types/finder";
5
- import { QueryType } from "./types/search";
6
- export declare function useQuery(config: Ref<IQueryConfig>, finders: Ref<Finder[]>, type?: QueryType): {
7
- search: import("vue").ComputedRef<import("./types/search").Search>;
8
- query: import("vue").ComputedRef<Query>;
1
+ import { DataItem } from "../use-model/DataModel";
2
+ import Finder from "./Finder";
3
+ import { IQueryConfig, QueryConfig, Search } from "./types";
4
+ export declare function useQuery($config?: IQueryConfig): {
5
+ config: import("vue").Ref<{
6
+ includes: {
7
+ [x: string]: any;
8
+ id?: import("../use-model/DataModel").DataItemId | undefined;
9
+ };
10
+ excludes: {
11
+ [x: string]: any;
12
+ id?: import("../use-model/DataModel").DataItemId | undefined;
13
+ };
14
+ orders: import("./types").Orders;
15
+ page: number;
16
+ size: number;
17
+ root: import("../use-model/DataModel").DataItemId;
18
+ }, QueryConfig | {
19
+ includes: {
20
+ [x: string]: any;
21
+ id?: import("../use-model/DataModel").DataItemId | undefined;
22
+ };
23
+ excludes: {
24
+ [x: string]: any;
25
+ id?: import("../use-model/DataModel").DataItemId | undefined;
26
+ };
27
+ orders: import("./types").Orders;
28
+ page: number;
29
+ size: number;
30
+ root: import("../use-model/DataModel").DataItemId;
31
+ }>;
32
+ template: import("vue").ComputedRef<DataItem>;
33
+ finders: import("vue").Ref<{
34
+ includes: {
35
+ prop: string;
36
+ value: any;
37
+ isnull: boolean;
38
+ decorate: boolean;
39
+ lookup: import("./Lookup").LookupType;
40
+ load: (param: import("./Lookup").ILookup) => void;
41
+ equals: (that: import("./Lookup").default) => boolean;
42
+ fromKV: (key: string, value: any) => import("./Lookup").default;
43
+ toDataItem: () => {
44
+ [k: string]: any;
45
+ };
46
+ }[];
47
+ excludes: {
48
+ prop: string;
49
+ value: any;
50
+ isnull: boolean;
51
+ decorate: boolean;
52
+ lookup: import("./Lookup").LookupType;
53
+ load: (param: import("./Lookup").ILookup) => void;
54
+ equals: (that: import("./Lookup").default) => boolean;
55
+ fromKV: (key: string, value: any) => import("./Lookup").default;
56
+ toDataItem: () => {
57
+ [k: string]: any;
58
+ };
59
+ }[];
60
+ add: (type: import("./types").ConditionType, lookup: import("./Lookup").default) => void;
61
+ toCondition: () => {
62
+ includes: {};
63
+ excludes: {};
64
+ };
65
+ }[], Finder[] | {
66
+ includes: {
67
+ prop: string;
68
+ value: any;
69
+ isnull: boolean;
70
+ decorate: boolean;
71
+ lookup: import("./Lookup").LookupType;
72
+ load: (param: import("./Lookup").ILookup) => void;
73
+ equals: (that: import("./Lookup").default) => boolean;
74
+ fromKV: (key: string, value: any) => import("./Lookup").default;
75
+ toDataItem: () => {
76
+ [k: string]: any;
77
+ };
78
+ }[];
79
+ excludes: {
80
+ prop: string;
81
+ value: any;
82
+ isnull: boolean;
83
+ decorate: boolean;
84
+ lookup: import("./Lookup").LookupType;
85
+ load: (param: import("./Lookup").ILookup) => void;
86
+ equals: (that: import("./Lookup").default) => boolean;
87
+ fromKV: (key: string, value: any) => import("./Lookup").default;
88
+ toDataItem: () => {
89
+ [k: string]: any;
90
+ };
91
+ }[];
92
+ add: (type: import("./types").ConditionType, lookup: import("./Lookup").default) => void;
93
+ toCondition: () => {
94
+ includes: {};
95
+ excludes: {};
96
+ };
97
+ }[]>;
98
+ search: import("vue").ComputedRef<Search>;
9
99
  };
@@ -0,0 +1,32 @@
1
+ import { DataItem, DataItemId } from "../use-model/DataModel";
2
+ export type IQueryConfig = {
3
+ includes?: DataItem;
4
+ excludes?: DataItem;
5
+ orders?: Orders;
6
+ page?: number;
7
+ size?: number;
8
+ root?: DataItemId;
9
+ };
10
+ export type QueryConfig = {
11
+ includes: DataItem;
12
+ excludes: DataItem;
13
+ orders: Orders;
14
+ page: number;
15
+ size: number;
16
+ root: DataItemId;
17
+ };
18
+ export type ConditionType = 'includes' | 'excludes';
19
+ export type Orders = {
20
+ [key: string]: 1 | -1;
21
+ };
22
+ export type Condition = {
23
+ includes: DataItem;
24
+ excludes: DataItem;
25
+ };
26
+ export type Search = {
27
+ conditions: Condition[];
28
+ orders: Orders;
29
+ page: number;
30
+ size: number;
31
+ root: DataItemId;
32
+ };
@@ -0,0 +1,5 @@
1
+ import { Aoa, Separator } from "./types";
2
+ export declare function useAoa(separator?: Separator): {
3
+ fromText: (text: string) => Aoa;
4
+ toText: (aoa: Aoa[]) => string;
5
+ };
@@ -0,0 +1,8 @@
1
+ export type Separator = {
2
+ cell: string;
3
+ line: string;
4
+ };
5
+ export type Aoa = any[][];
6
+ export type AoaMap = {
7
+ [name: string]: Aoa;
8
+ };
@@ -1,5 +1,6 @@
1
- import { Aoa, AoaMap, Separator } from "./types";
2
- export declare function useXlsx(separator?: Separator): {
3
- fromText: (text: string) => Aoa;
4
- fromFile: (file: File) => Promise<AoaMap>;
1
+ import { XlsSheet } from "./types";
2
+ import { AoaMap } from "../use-aoa/types";
3
+ export declare function useXlsx(): {
4
+ readXlsx: (file: File) => Promise<AoaMap>;
5
+ writeXlsx: (title: string, ...sheets: XlsSheet[]) => void;
5
6
  };
@@ -1,8 +1,17 @@
1
- export type Separator = {
2
- cell: string;
3
- line: string;
1
+ import { Aoa } from "../use-aoa/types";
2
+ type XlsCell = {
3
+ r: number;
4
+ c: number;
5
+ value?: any;
4
6
  };
5
- export type Aoa = any[][];
6
- export type AoaMap = {
7
- [name: string]: Aoa;
7
+ export type XlsSheetMerge = {
8
+ s: XlsCell;
9
+ e: XlsCell;
8
10
  };
11
+ export type XlsSheet = {
12
+ name?: string;
13
+ data: Aoa;
14
+ headers?: string[];
15
+ merges?: XlsSheetMerge[];
16
+ };
17
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { App } from "vue";
2
2
  import 'nprogress/nprogress.css';
3
- import { IOptions } from "./types";
4
- import { createChannel, useChannel } from "./hooks/core/use-channel";
3
+ import type { IOptions, Options } from "./hooks/core/use-core/types";
4
+ import { useChannel } from "./hooks/core/use-channel";
5
5
  import { useRequest } from "./hooks/core/use-request";
6
6
  import { useAuth } from "./hooks/utils/use-auth";
7
7
  import { useCookies } from "./hooks/utils/use-cookie";
@@ -9,8 +9,21 @@ import { usePaster } from "./hooks/utils/use-paster";
9
9
  import { useXlsx } from "./hooks/utils/use-xlsx";
10
10
  import { useSocket } from "./hooks/core/use-socket";
11
11
  import { useQuery } from "./hooks/data/use-query";
12
- import { createDao } from "./hooks/data/use-dao";
12
+ import { useDao } from "./hooks/data/use-dao";
13
+ import { useAoa } from "./hooks/utils/use-aoa";
14
+ import type { XlsSheet, XlsSheetMerge } from "./hooks/utils/use-xlsx/types";
15
+ import type { Aoa } from "./hooks/utils/use-aoa/types";
16
+ import MetaField from "./hooks/data/use-meta/MetaField";
17
+ import MetaView from "./hooks/data/use-meta/MetaView";
18
+ import type { Meta } from "./hooks/data/use-meta/types";
19
+ import DataModel, { type DataItem, type DataItemId } from "./hooks/data/use-model/DataModel";
20
+ import TableModel from "./hooks/data/use-model/TableModel";
21
+ import TreeModel, { type TreeItem } from "./hooks/data/use-model/TreeModel";
22
+ import type { IQueryConfig } from "./hooks/data/use-query/types";
23
+ import Lookup from "./hooks/data/use-query/Lookup";
24
+ import { useData } from "./hooks/data/use-data";
25
+ import type { IDataConfig } from "./hooks/data/use-data/types";
13
26
  declare const createMorghulisCore: (options?: IOptions) => {
14
27
  install(app: App): void;
15
28
  };
16
- export { createMorghulisCore, useRequest, createChannel, useChannel, useAuth, useCookies, useXlsx, usePaster, useSocket, useQuery, createDao };
29
+ export { Options, createMorghulisCore, useRequest, useChannel, useAuth, useCookies, usePaster, useSocket, XlsSheet, XlsSheetMerge, useXlsx, Aoa, useAoa, useDao, Meta, MetaView, MetaField, DataItem, DataItemId, TreeItem, DataModel, TableModel, TreeModel, IQueryConfig, Lookup, useQuery, useData, IDataConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morghulis/core",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,18 +0,0 @@
1
- import { IconNames } from "../utils/use-icon/types";
2
- export type Database = 'orm' | 'mon';
3
- export type DataItemId = string | number;
4
- export type DataItem = {
5
- id?: DataItemId;
6
- [key: string]: any;
7
- };
8
- export type TreeItem = {
9
- pid: number | string;
10
- isLeaf: boolean;
11
- icon?: IconNames;
12
- children: TreeItem[];
13
- } & DataItem;
14
- export type PropItem = {
15
- label: string;
16
- value: string;
17
- display?: string;
18
- };
@@ -1,4 +0,0 @@
1
- import { TableResults } from "./types";
2
- export default class TableModel {
3
- constructor(res: TableResults);
4
- }