@duxweb/dvha-core 0.1.18 → 0.1.20
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.
- package/dist/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/json/index.cjs +1 -0
- package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -0
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -0
- package/dist/cjs/hooks/json/vFor.cjs +1 -0
- package/dist/cjs/hooks/json/vIf.cjs +1 -0
- package/dist/cjs/hooks/json/vModel.cjs +1 -0
- package/dist/cjs/hooks/json/vOn.cjs +1 -0
- package/dist/cjs/hooks/json/vShow.cjs +1 -0
- package/dist/cjs/hooks/json/vText.cjs +1 -0
- package/dist/cjs/hooks/json.cjs +1 -0
- package/dist/cjs/hooks/overlay.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +2 -2
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/node_modules/jsep/dist/jsep.cjs +2 -0
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/utils/theme.cjs +1 -1
- package/dist/esm/components/auth/can.js +6 -5
- package/dist/esm/components/overlay/overlay.js +31 -22
- package/dist/esm/directive/permission.js +3 -2
- package/dist/esm/hooks/data.js +96 -96
- package/dist/esm/hooks/json/index.js +23 -0
- package/dist/esm/hooks/json/utils/contextManager.js +31 -0
- package/dist/esm/hooks/json/utils/expressionParser.js +134 -0
- package/dist/esm/hooks/json/vFor.js +57 -0
- package/dist/esm/hooks/json/vIf.js +17 -0
- package/dist/esm/hooks/json/vModel.js +78 -0
- package/dist/esm/hooks/json/vOn.js +32 -0
- package/dist/esm/hooks/json/vShow.js +24 -0
- package/dist/esm/hooks/json/vText.js +54 -0
- package/dist/esm/hooks/json.js +80 -0
- package/dist/esm/hooks/overlay.js +3 -2
- package/dist/esm/hooks/theme.js +62 -62
- package/dist/esm/index.js +107 -91
- package/dist/esm/node_modules/jsep/dist/jsep.js +737 -0
- package/dist/esm/preset/i18nProvider.js +18 -9
- package/dist/esm/provider/app.js +3 -2
- package/dist/esm/utils/theme.js +1 -1
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/json/index.d.ts +10 -0
- package/dist/types/hooks/json/types.d.ts +29 -0
- package/dist/types/hooks/json/utils/contextManager.d.ts +34 -0
- package/dist/types/hooks/json/utils/expressionParser.d.ts +10 -0
- package/dist/types/hooks/json/vFor.d.ts +2 -0
- package/dist/types/hooks/json/vIf.d.ts +2 -0
- package/dist/types/hooks/json/vModel.d.ts +2 -0
- package/dist/types/hooks/json/vOn.d.ts +2 -0
- package/dist/types/hooks/json/vShow.d.ts +2 -0
- package/dist/types/hooks/json/vText.d.ts +2 -0
- package/dist/types/hooks/json.d.ts +14 -0
- package/dist/types/hooks/overlay.d.ts +4 -0
- package/dist/types/types/data.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import { createI18n as
|
|
2
|
-
function
|
|
3
|
-
const c =
|
|
1
|
+
import { createI18n as o } from "petite-vue-i18n";
|
|
2
|
+
function i(e) {
|
|
3
|
+
const c = o({
|
|
4
4
|
legacy: !1,
|
|
5
5
|
locale: e == null ? void 0 : e.locale,
|
|
6
6
|
fallbackLocale: e == null ? void 0 : e.fallbackLocale,
|
|
7
|
-
messages: e == null ? void 0 : e.messages
|
|
7
|
+
messages: e == null ? void 0 : e.messages,
|
|
8
|
+
missingWarn: !1,
|
|
9
|
+
fallbackWarn: !1
|
|
8
10
|
});
|
|
9
11
|
return {
|
|
10
|
-
t: (l,
|
|
11
|
-
|
|
12
|
+
t: (l, n, a) => {
|
|
13
|
+
try {
|
|
14
|
+
const t = c.global.t(l, n);
|
|
15
|
+
return t === l && a ? a : t;
|
|
16
|
+
} catch {
|
|
17
|
+
return a || l;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
changeLocale: (l, n) => new Promise((a) => {
|
|
12
21
|
c.global.locale.value = l, a(l);
|
|
13
22
|
}),
|
|
14
|
-
loadLocale: (l,
|
|
15
|
-
c.global.setLocaleMessage(l,
|
|
23
|
+
loadLocale: (l, n) => new Promise((a) => {
|
|
24
|
+
c.global.setLocaleMessage(l, n), a(l);
|
|
16
25
|
}),
|
|
17
26
|
getLocale: () => c.global.locale.value
|
|
18
27
|
};
|
|
19
28
|
}
|
|
20
29
|
export {
|
|
21
|
-
|
|
30
|
+
i as i18nProvider
|
|
22
31
|
};
|
package/dist/esm/provider/app.js
CHANGED
|
@@ -13,10 +13,11 @@ import "pinia";
|
|
|
13
13
|
import { useManageStore as T } from "../stores/manage.js";
|
|
14
14
|
import { useI18nStore as W } from "../stores/i18n.js";
|
|
15
15
|
import "@vueuse/core";
|
|
16
|
+
import "../hooks/json/index.js";
|
|
16
17
|
import "clsx";
|
|
17
18
|
import "colorizr";
|
|
18
19
|
import "axios";
|
|
19
|
-
const
|
|
20
|
+
const ve = /* @__PURE__ */ O({
|
|
20
21
|
name: "DuxAppProvider",
|
|
21
22
|
props: {},
|
|
22
23
|
setup(X, {
|
|
@@ -145,5 +146,5 @@ const ge = /* @__PURE__ */ O({
|
|
|
145
146
|
}
|
|
146
147
|
});
|
|
147
148
|
export {
|
|
148
|
-
|
|
149
|
+
ve as DuxAppProvider
|
|
149
150
|
};
|
package/dist/esm/utils/theme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function r(c) {
|
|
2
|
-
return `
|
|
2
|
+
return `rgba(var(${c}))`;
|
|
3
3
|
}
|
|
4
4
|
function s(c) {
|
|
5
5
|
const t = {}, i = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"], l = ["primary", "info", "success", "warning", "error", "gray"], n = ["hover", "pressed", "focus", "disabled"];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IJsonAdaptor } from './types';
|
|
2
|
+
import { vForAdaptor } from './vFor';
|
|
3
|
+
import { vIfAdaptor } from './vIf';
|
|
4
|
+
import { vModelAdaptor } from './vModel';
|
|
5
|
+
import { vOnAdaptor } from './vOn';
|
|
6
|
+
import { vShowAdaptor } from './vShow';
|
|
7
|
+
import { vTextAdaptor } from './vText';
|
|
8
|
+
export declare const defaultAdaptors: IJsonAdaptor[];
|
|
9
|
+
export * from './types';
|
|
10
|
+
export { vForAdaptor, vIfAdaptor, vModelAdaptor, vOnAdaptor, vShowAdaptor, vTextAdaptor, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
export interface JsonSchemaNode {
|
|
3
|
+
tag: string | Component;
|
|
4
|
+
attrs?: Record<string, any>;
|
|
5
|
+
children?: JsonSchemaNode | JsonSchemaNode[] | string;
|
|
6
|
+
slots?: Record<string, SlotContent>;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export type SlotContent = string | JsonSchemaNode | JsonSchemaNode[] | ((slotProps?: any) => SlotContent);
|
|
10
|
+
export interface IJsonAdaptorResult {
|
|
11
|
+
props: Record<string, any>;
|
|
12
|
+
skip?: boolean;
|
|
13
|
+
nodes?: JsonSchemaNode[];
|
|
14
|
+
}
|
|
15
|
+
export interface IJsonAdaptor {
|
|
16
|
+
name: string;
|
|
17
|
+
priority: number;
|
|
18
|
+
process: (node: JsonSchemaNode, props: Record<string, any>) => IJsonAdaptorResult | null;
|
|
19
|
+
}
|
|
20
|
+
export interface JsonAdaptorOptions {
|
|
21
|
+
adaptors?: IJsonAdaptor[];
|
|
22
|
+
}
|
|
23
|
+
export type EventModifier = 'prevent' | 'stop' | 'once' | 'capture' | 'self' | 'passive';
|
|
24
|
+
export interface VForConfig {
|
|
25
|
+
list: any[];
|
|
26
|
+
item?: string;
|
|
27
|
+
index?: string;
|
|
28
|
+
}
|
|
29
|
+
export type VModelBinding = [object, string] | [() => any, (val: any) => void];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 合并父子上下文
|
|
3
|
+
*/
|
|
4
|
+
export declare function mergeContext(parentContext: Record<string, any>, childContext: Record<string, any>): Record<string, any>;
|
|
5
|
+
/**
|
|
6
|
+
* 从属性中提取上下文
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractContext(props: Record<string, any>): Record<string, any>;
|
|
9
|
+
/**
|
|
10
|
+
* 注入上下文到属性
|
|
11
|
+
*/
|
|
12
|
+
export declare function injectContext(props: Record<string, any>, context: Record<string, any>): Record<string, any>;
|
|
13
|
+
/**
|
|
14
|
+
* 清理属性中的内部字段
|
|
15
|
+
*/
|
|
16
|
+
export declare function cleanProps(props: Record<string, any>): Record<string, any>;
|
|
17
|
+
/**
|
|
18
|
+
* 创建适配器处理结果
|
|
19
|
+
*/
|
|
20
|
+
export declare function createAdaptorResult(props: Record<string, any>, options?: {
|
|
21
|
+
skip?: boolean;
|
|
22
|
+
nodes?: any[];
|
|
23
|
+
cleanKeys?: string[];
|
|
24
|
+
}): {
|
|
25
|
+
props: {
|
|
26
|
+
[x: string]: any;
|
|
27
|
+
};
|
|
28
|
+
skip: boolean | undefined;
|
|
29
|
+
nodes: any[] | undefined;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 通用条件求值函数
|
|
33
|
+
*/
|
|
34
|
+
export declare function evaluateCondition(value: any, context: Record<string, any>, evaluateExpression: (expr: string, ctx: Record<string, any>) => any): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import jsep from 'jsep';
|
|
2
|
+
export declare function parseExpression(expression: string): jsep.Expression | null;
|
|
3
|
+
export declare function evaluateExpression(expression: string, context: Record<string, any>): any;
|
|
4
|
+
export interface VForParseResult {
|
|
5
|
+
items: any[];
|
|
6
|
+
itemName: string;
|
|
7
|
+
indexName: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseVForExpression(expression: string, context: Record<string, any>): VForParseResult;
|
|
10
|
+
export declare function extractVariables(ast: jsep.Expression): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { JsonAdaptorOptions, JsonSchemaNode } from './json/index';
|
|
3
|
+
export type JsonSchemaData = JsonSchemaNode[] | Ref<JsonSchemaNode[]>;
|
|
4
|
+
export interface UseJsonSchemaProps extends JsonAdaptorOptions {
|
|
5
|
+
data: JsonSchemaData;
|
|
6
|
+
components?: Record<string, any>;
|
|
7
|
+
context?: Record<string, any> | Ref<Record<string, any>>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* JSON Schema 渲染器
|
|
11
|
+
*/
|
|
12
|
+
export declare function useJsonSchema(props: UseJsonSchemaProps): {
|
|
13
|
+
render: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface UseOverlayProps {
|
|
2
2
|
component?: () => any;
|
|
3
3
|
componentProps?: Record<string, any>;
|
|
4
|
+
mask?: boolean;
|
|
5
|
+
maskClosable?: boolean;
|
|
6
|
+
duration?: number;
|
|
7
|
+
zIndex?: number;
|
|
4
8
|
}
|
|
5
9
|
export declare function useOverlay(): {
|
|
6
10
|
show: (props: UseOverlayProps) => import("@overlastic/core").Deferred<unknown>;
|
|
@@ -80,7 +80,7 @@ export interface IDataProviderDeleteManyOptions {
|
|
|
80
80
|
export interface IDataProviderDeleteOptions {
|
|
81
81
|
path?: string;
|
|
82
82
|
meta?: Record<string, any>;
|
|
83
|
-
id
|
|
83
|
+
id?: string | number;
|
|
84
84
|
}
|
|
85
85
|
export interface IDataProviderProgress {
|
|
86
86
|
loaded: number;
|