@fangzhongya/fang-ui 0.1.38 → 0.1.40
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/components/common/css.d.ts +7 -0
- package/dist/components/common/list.d.ts +7 -0
- package/dist/components/common/urls.d.ts +6 -0
- package/dist/components/common/use.cjs +153 -125
- package/dist/components/common/use.d.ts +114 -8
- package/dist/components/common/use.js +154 -126
- package/dist/components/company-select/src/index2.cjs +1 -2
- package/dist/components/company-select/src/index2.js +1 -2
- package/dist/components/double/src/index2.cjs +2 -2
- package/dist/components/double/src/index2.js +2 -2
- package/dist/components/forms/index.css +18 -0
- package/dist/components/forms/src/index2.cjs +9 -6
- package/dist/components/forms/src/index2.js +9 -6
- package/dist/components/forms/src/setup.cjs +9 -12
- package/dist/components/forms/src/setup.d.ts +10 -0
- package/dist/components/forms/src/setup.js +9 -12
- package/dist/components/forms/src/util.cjs +8 -10
- package/dist/components/forms/src/util.d.ts +11 -6
- package/dist/components/forms/src/util.js +8 -10
- package/dist/components/forms-div/src/data.cjs +8 -5
- package/dist/components/forms-div/src/data.d.ts +21 -3
- package/dist/components/forms-div/src/data.js +8 -5
- package/dist/components/forms-div/src/index2.cjs +41 -70
- package/dist/components/forms-div/src/index2.js +43 -72
- package/dist/components/forms-item/src/data.cjs +6 -0
- package/dist/components/forms-item/src/data.d.ts +19 -0
- package/dist/components/forms-item/src/data.js +6 -0
- package/dist/components/forms-item/src/index2.cjs +11 -7
- package/dist/components/forms-item/src/index2.js +11 -7
- package/dist/components/forms-item/src/indexts.d.ts +40 -1
- package/dist/components/forms-item/src/label.cjs +7 -2
- package/dist/components/forms-item/src/label.d.ts +40 -1
- package/dist/components/forms-item/src/label.js +7 -2
- package/dist/components/forms-items/index.css +67 -0
- package/dist/components/forms-items/index.scss +21 -0
- package/dist/components/forms-items/src/data.cjs +9 -0
- package/dist/components/forms-items/src/data.d.ts +22 -0
- package/dist/components/forms-items/src/data.js +9 -0
- package/dist/components/forms-items/src/index2.cjs +22 -10
- package/dist/components/forms-items/src/index2.js +22 -10
- package/dist/components/forms-items/style/index2.scss +1 -0
- package/dist/components/icon/src/index2.cjs +1 -2
- package/dist/components/icon/src/index2.js +1 -2
- package/dist/components/input-history/src/index2.cjs +1 -1
- package/dist/components/input-history/src/index2.js +1 -1
- package/dist/components/input-select/src/index2.cjs +0 -2
- package/dist/components/input-select/src/index2.js +0 -2
- package/dist/components/inputs/src/index2.cjs +1 -1
- package/dist/components/inputs/src/index2.js +1 -1
- package/dist/components/list/src/index2.cjs +5 -19
- package/dist/components/list/src/index2.js +5 -19
- package/dist/components/list/src/util.cjs +9 -9
- package/dist/components/list/src/util.d.ts +30 -2
- package/dist/components/list/src/util.js +9 -9
- package/dist/components/lists/src/index2.cjs +1 -2
- package/dist/components/lists/src/index2.js +1 -2
- package/dist/components/menus/src/util.cjs +8 -24
- package/dist/components/menus/src/util.js +9 -25
- package/dist/components/page/index.css +18 -0
- package/dist/components/right-key/src/index2.cjs +3 -3
- package/dist/components/right-key/src/index2.js +3 -3
- package/dist/components/seamless-scroll/src/index2.cjs +1 -1
- package/dist/components/seamless-scroll/src/index2.js +1 -1
- package/dist/components/selects/src/index2.cjs +2 -2
- package/dist/components/selects/src/index2.js +2 -2
- package/dist/components/stick-edge/src/index2.cjs +2 -2
- package/dist/components/stick-edge/src/index2.js +2 -2
- package/dist/components/switchs/src/index2.cjs +1 -1
- package/dist/components/switchs/src/index2.js +1 -1
- package/dist/components/tables/common/com-color2.cjs +0 -3
- package/dist/components/tables/common/com-color2.js +0 -3
- package/dist/components/tables/common/com-lis2.cjs +0 -1
- package/dist/components/tables/common/com-lis2.js +0 -1
- package/dist/components/tables/common/pagin.d.ts +16 -0
- package/dist/components/tables/common/tooltip.cjs +1 -1
- package/dist/components/tables/common/tooltip.js +1 -1
- package/dist/components/tables/common/util.cjs +46 -8
- package/dist/components/tables/common/util.d.ts +13 -0
- package/dist/components/tables/common/util.js +47 -9
- package/dist/components/tables/src/column.cjs +11 -4
- package/dist/components/tables/src/column.d.ts +29 -0
- package/dist/components/tables/src/column.js +11 -4
- package/dist/components/tables/src/columns.d.ts +7 -0
- package/dist/components/tables/src/columns3.cjs +1 -7
- package/dist/components/tables/src/columns3.js +1 -7
- package/dist/components/tables/src/index2.cjs +3 -3
- package/dist/components/tables/src/index2.js +3 -3
- package/dist/components/tablesv/src/column.cjs +11 -4
- package/dist/components/tablesv/src/column.d.ts +25 -0
- package/dist/components/tablesv/src/column.js +11 -4
- package/dist/components/tablesv/src/columns.d.ts +7 -0
- package/dist/components/tablesv/src/columns3.cjs +1 -7
- package/dist/components/tablesv/src/columns3.js +1 -7
- package/dist/components/tablesv/src/index2.cjs +3 -3
- package/dist/components/tablesv/src/index2.js +3 -3
- package/dist/components/uploads/src/util.cjs +2 -3
- package/dist/components/uploads/src/util.d.ts +7 -0
- package/dist/components/uploads/src/util.js +2 -3
- package/dist/css/forms-items.css +67 -0
- package/dist/css/forms.css +18 -0
- package/dist/css/index.css +18 -0
- package/dist/css/page.css +18 -0
- package/dist/directives/adjust/index.cjs +4 -8
- package/dist/directives/adjust/index.js +4 -8
- package/dist/directives/drag/index.cjs +6 -1
- package/dist/directives/drag/index.js +6 -1
- package/dist/directives/expose/index.cjs +6 -0
- package/dist/directives/expose/index.js +6 -0
- package/dist/directives/inserted/index.cjs +5 -0
- package/dist/directives/inserted/index.js +5 -0
- package/dist/directives/locus/index.cjs +5 -0
- package/dist/directives/locus/index.js +5 -0
- package/dist/directives/scroll/index.cjs +10 -0
- package/dist/directives/scroll/index.d.ts +0 -5
- package/dist/directives/scroll/index.js +10 -0
- package/dist/directives/sortable/index.cjs +5 -0
- package/dist/directives/sortable/index.js +5 -0
- package/dist/directives/stick/index.cjs +13 -8
- package/dist/directives/stick/index.js +13 -8
- package/dist/hooks/attrs-default/index.d.ts +5 -3
- package/dist/hooks/compons/index.d.ts +13 -0
- package/dist/hooks/cssname/index.cjs +1 -1
- package/dist/hooks/cssname/index.d.ts +22 -1
- package/dist/hooks/cssname/index.js +1 -1
- package/dist/hooks/default-config/index.d.ts +10 -0
- package/dist/hooks/expose/index.cjs +2 -0
- package/dist/hooks/expose/index.d.ts +6 -0
- package/dist/hooks/expose/index.js +2 -0
- package/dist/hooks/full-screen/index.d.ts +6 -0
- package/dist/hooks/global-config/index.d.ts +16 -0
- package/dist/hooks/inherit/index.cjs +2 -0
- package/dist/hooks/inherit/index.d.ts +8 -0
- package/dist/hooks/inherit/index.js +2 -0
- package/dist/hooks/locale/index.d.ts +24 -0
- package/dist/hooks/props-default/index.d.ts +14 -5
- package/dist/icons/iconify.d.ts +7 -0
- package/dist/icons/iconifyCss.d.ts +6 -0
- package/dist/icons/index.json +1 -1
- package/dist/index.css +18 -0
- package/dist/locale/en.cjs +2 -1
- package/dist/locale/en.d.ts +1 -0
- package/dist/locale/en.js +2 -1
- package/dist/locale/zh-cn.cjs +2 -1
- package/dist/locale/zh-cn.d.ts +1 -0
- package/dist/locale/zh-cn.js +2 -1
- package/dist/type.d.ts +8 -0
- package/dist/utils/css.cjs +4 -0
- package/dist/utils/css.d.ts +1 -0
- package/dist/utils/css.js +4 -0
- package/dist/utils/local.cjs +12 -6
- package/dist/utils/local.js +12 -6
- package/dist/utils/util.cjs +7 -5
- package/dist/utils/util.js +7 -5
- package/package.json +1 -1
|
@@ -3,12 +3,6 @@ import { pressEvent } from "@fangzhongya/utils/dom/getShiftEvent";
|
|
|
3
3
|
import { attrValueSort } from "@fangzhongya/utils/basic/object/attrValueSort";
|
|
4
4
|
function setDom(dom, el, value) {
|
|
5
5
|
if (dom) {
|
|
6
|
-
let getDirection = function(obj2) {
|
|
7
|
-
return attrValueSort(
|
|
8
|
-
obj2,
|
|
9
|
-
value.directions || ["left", "right", "top", "bottom"]
|
|
10
|
-
)[0];
|
|
11
|
-
};
|
|
12
6
|
const obj = {
|
|
13
7
|
position: "fixed",
|
|
14
8
|
display: "flex",
|
|
@@ -21,6 +15,12 @@ function setDom(dom, el, value) {
|
|
|
21
15
|
obj[key] = "0";
|
|
22
16
|
obj["flex-direction"] = key == "left" || key == "right" ? "column" : "row";
|
|
23
17
|
setCss(el, obj);
|
|
18
|
+
const getDirection = (obj2) => {
|
|
19
|
+
return attrValueSort(
|
|
20
|
+
obj2,
|
|
21
|
+
value.directions || ["left", "right", "top", "bottom"]
|
|
22
|
+
)[0];
|
|
23
|
+
};
|
|
24
24
|
const bodyStyle = document.body.style;
|
|
25
25
|
const cursor = bodyStyle.cursor;
|
|
26
26
|
const setValue = (event) => {
|
|
@@ -28,8 +28,8 @@ function setDom(dom, el, value) {
|
|
|
28
28
|
key = getDirection({
|
|
29
29
|
left: event.clientX,
|
|
30
30
|
top: event.clientY,
|
|
31
|
-
right:
|
|
32
|
-
bottom:
|
|
31
|
+
right: globalThis.innerWidth - event.clientX,
|
|
32
|
+
bottom: globalThis.innerHeight - event.clientY
|
|
33
33
|
});
|
|
34
34
|
setCss(el, {
|
|
35
35
|
[key]: "0",
|
|
@@ -59,6 +59,11 @@ function setDom(dom, el, value) {
|
|
|
59
59
|
}
|
|
60
60
|
const vStick = {
|
|
61
61
|
name: "Stick",
|
|
62
|
+
/**
|
|
63
|
+
* Vue指令的mounted钩子函数,用于在元素挂载时设置DOM相关属性
|
|
64
|
+
* @param el - 指令绑定的DOM元素
|
|
65
|
+
* @param binding - 指令绑定的相关信息对象
|
|
66
|
+
*/
|
|
62
67
|
mounted(el, binding) {
|
|
63
68
|
const value = binding.value;
|
|
64
69
|
let dom;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 获取全局配置参数设置默认属性
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
3
|
+
* 根据全局配置决定是否使用默认属性值合并
|
|
4
|
+
*
|
|
5
|
+
* @param key - 配置项的键名,用于从默认配置中获取对应默认值
|
|
6
|
+
* @param attrs - 当前传入的属性对象,将与默认值进行合并
|
|
7
|
+
* @returns 如果全局配置禁用默认属性则直接返回原属性对象,否则返回合并后的属性对象
|
|
6
8
|
*/
|
|
7
9
|
export declare function useAttrsDefault<T extends Record<string | symbol, unknown>>(key: string, attrs: T): T;
|
|
@@ -2,6 +2,19 @@ import { Component } from 'vue';
|
|
|
2
2
|
type Compons = {
|
|
3
3
|
[key: string]: Component;
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* 自定义组合式API函数,用于处理组件合并和提供注入功能
|
|
7
|
+
* @param key - 用于provide/inject的键值,默认使用comkey常量
|
|
8
|
+
* @param props - 组件属性对象,包含isCompons和compons属性
|
|
9
|
+
* @param arrs - 可变参数数组,包含需要合并的组件配置
|
|
10
|
+
* @returns 返回合并后的组件对象
|
|
11
|
+
*/
|
|
5
12
|
export declare function useCompons(key: string | undefined, props: ObjAny, ...arrs: Compons[]): Compons;
|
|
13
|
+
/**
|
|
14
|
+
* 获取组件配置信息的自定义Hook函数
|
|
15
|
+
* @param key - 用于注入依赖的键名,默认值为comkey常量
|
|
16
|
+
* @param value - 默认的组件配置对象,默认为空对象
|
|
17
|
+
* @returns 返回合并后的组件配置对象
|
|
18
|
+
*/
|
|
6
19
|
export declare function useComponsGet(key?: string, value?: Compons): Compons;
|
|
7
20
|
export {};
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 根据BEM命名规范生成CSS类名
|
|
3
|
+
* @param block - 组件名称,作为类名的基础部分
|
|
4
|
+
* @param blockSuffix - 子样式名称,可选参数,用于扩展组件基础样式
|
|
5
|
+
* @param element - 元素名称,可选参数,表示组件内的元素,使用下标样式(__)连接
|
|
6
|
+
* @param modifier - 修饰符名称,可选参数,表示组件或元素的不同状态,使用后缀样式(--)连接
|
|
7
|
+
* @returns 返回按照BEM规范组合生成的完整CSS类名字符串
|
|
8
|
+
*/
|
|
1
9
|
declare function connected(// 组件名称
|
|
2
|
-
block
|
|
10
|
+
block?: string, blockSuffix?: string, element?: string, modifier?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* 获取组件的完整类名
|
|
13
|
+
* @param block - 组件名称
|
|
14
|
+
* @param blockSuffix - 子样式名称
|
|
15
|
+
* @param element - 下标样式 __
|
|
16
|
+
* @param modifier - 后缀样式 --
|
|
17
|
+
* @returns 完整的类名字符串
|
|
18
|
+
*/
|
|
3
19
|
declare function getClassName(block: string, blockSuffix?: string, element?: string, modifier?: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* 自定义 Hook,用于生成 CSS 类名和相关样式变量。
|
|
22
|
+
* @param block - 基础模块名称,通常表示一个组件或功能块。
|
|
23
|
+
* @returns 返回一组工具函数和属性,用于构建符合 BEM 规范的类名及 CSS 变量。
|
|
24
|
+
*/
|
|
4
25
|
export declare const useCssName: (block: string) => {
|
|
5
26
|
name: string;
|
|
6
27
|
cn: typeof getClassName;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设置默认配置的自定义hook函数
|
|
3
|
+
* @param key - 配置项的键名或包含多个配置项的对象
|
|
4
|
+
* @param keys - 子配置项的键名或包含多个子配置项的对象,默认为空对象
|
|
5
|
+
* @param value - 配置项的值,可选参数
|
|
6
|
+
*/
|
|
1
7
|
export declare function useDefaultConfig(key: string | ObjAny, keys?: string | ObjAny, value?: any): void;
|
|
8
|
+
/**
|
|
9
|
+
* 设置默认配置项
|
|
10
|
+
* @param value 配置对象,包含需要设置的默认配置项
|
|
11
|
+
*/
|
|
2
12
|
export declare function useDefaultConfigs(value: ObjAny): void;
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const useExpose = (obj, elRef) => {
|
|
4
4
|
return new Proxy(obj, {
|
|
5
|
+
// 拦截属性读取操作
|
|
5
6
|
get: (target, key) => {
|
|
6
7
|
var _a;
|
|
7
8
|
if (key in target) return target[key];
|
|
8
9
|
return (_a = elRef.value) == null ? void 0 : _a[key];
|
|
9
10
|
},
|
|
11
|
+
// 拦截 in 操作符,判断属性是否存在
|
|
10
12
|
has: (target, key) => {
|
|
11
13
|
if (key in target) return true;
|
|
12
14
|
return key in (elRef.value || {});
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 创建一个代理对象,用于暴露目标对象和元素引用的属性
|
|
4
|
+
* @param obj - 目标对象,优先访问此对象的属性
|
|
5
|
+
* @param elRef - 元素引用,当目标对象中不存在属性时,会尝试从该引用的value中查找
|
|
6
|
+
* @returns 返回一个代理对象,可以同时访问目标对象和元素引用中的属性
|
|
7
|
+
*/
|
|
2
8
|
export declare const useExpose: (obj: ObjAny, elRef: Ref) => ObjAny;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
const useExpose = (obj, elRef) => {
|
|
2
2
|
return new Proxy(obj, {
|
|
3
|
+
// 拦截属性读取操作
|
|
3
4
|
get: (target, key) => {
|
|
4
5
|
var _a;
|
|
5
6
|
if (key in target) return target[key];
|
|
6
7
|
return (_a = elRef.value) == null ? void 0 : _a[key];
|
|
7
8
|
},
|
|
9
|
+
// 拦截 in 操作符,判断属性是否存在
|
|
8
10
|
has: (target, key) => {
|
|
9
11
|
if (key in target) return true;
|
|
10
12
|
return key in (elRef.value || {});
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 提供全屏控制功能的组合式函数(Composable)
|
|
4
|
+
*
|
|
5
|
+
* 返回一组用于控制页面或元素全屏状态的方法和响应式数据。
|
|
6
|
+
* 支持现代浏览器及部分旧版浏览器(如 IE、Firefox、Safari)的全屏 API 兼容处理。
|
|
7
|
+
*/
|
|
2
8
|
export declare function useFullscreen(): {
|
|
3
9
|
isFullscreen: Ref<boolean, boolean>;
|
|
4
10
|
enter: (el?: HTMLElement) => Promise<void>;
|
|
@@ -8,6 +8,22 @@ export declare function useGlobalConfig(): Ref<DataProps>;
|
|
|
8
8
|
* @param obj
|
|
9
9
|
* @param key
|
|
10
10
|
*/
|
|
11
|
+
/**
|
|
12
|
+
* 设置全局配置项
|
|
13
|
+
* @param obj - 配置对象或配置项的值
|
|
14
|
+
* @param key - 配置项的键名,可选参数
|
|
15
|
+
*/
|
|
11
16
|
export declare function setGlobalConfig(obj: DataProps | DataProps[keyof DataProps], key?: keyof DataProps): void;
|
|
17
|
+
/**
|
|
18
|
+
* 设置全局配置对象
|
|
19
|
+
* @param obj - 包含配置数据的对象
|
|
20
|
+
*/
|
|
12
21
|
export declare function setGlobalConfigs(obj: DataProps): void;
|
|
22
|
+
/**
|
|
23
|
+
* 提供全局配置功能,用于在应用中设置和合并全局配置
|
|
24
|
+
* @param config - 要提供的配置数据,可以是响应式引用或普通对象
|
|
25
|
+
* @param app - 可选的应用实例,用于提供配置到特定应用上下文
|
|
26
|
+
* @param global - 是否设置为全局配置,默认为false
|
|
27
|
+
* @returns 返回计算属性,包含合并后的配置值
|
|
28
|
+
*/
|
|
13
29
|
export declare function provideGlobalConfig(config: MaybeRef<DataProps>, app?: App, global?: boolean): ComputedRef<Readonly<DataProps>>;
|
|
@@ -18,11 +18,13 @@ const useInherit = (attrs = vue.useAttrs(), name) => {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
return {
|
|
21
|
+
// root代理:普通属性访问代理
|
|
21
22
|
root: new Proxy(root, {
|
|
22
23
|
get(_target, k) {
|
|
23
24
|
return _target[k];
|
|
24
25
|
}
|
|
25
26
|
}),
|
|
27
|
+
// assem代理:具有特殊属性访问逻辑的代理
|
|
26
28
|
assem: new Proxy(assem, {
|
|
27
29
|
get(_target, k) {
|
|
28
30
|
if (k == "__B") {
|
|
@@ -3,6 +3,14 @@ export interface Assem {
|
|
|
3
3
|
__B: (key: string) => boolean;
|
|
4
4
|
}
|
|
5
5
|
type Data = Record<string | symbol, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* 自定义hook,用于继承和处理组件属性
|
|
8
|
+
* @param attrs - 组件属性对象,默认使用useAttrs()获取
|
|
9
|
+
* @param name - 组件名称,可选参数
|
|
10
|
+
* @returns 返回包含root和assem两个代理对象的结果对象
|
|
11
|
+
* root: 包含根属性的对象
|
|
12
|
+
* assem: 包含其他属性的对象,具有特殊的属性访问逻辑
|
|
13
|
+
*/
|
|
6
14
|
export declare const useInherit: (attrs?: {
|
|
7
15
|
[x: string]: unknown;
|
|
8
16
|
}, name?: string) => {
|
|
@@ -16,11 +16,13 @@ const useInherit = (attrs = useAttrs(), name) => {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
return {
|
|
19
|
+
// root代理:普通属性访问代理
|
|
19
20
|
root: new Proxy(root, {
|
|
20
21
|
get(_target, k) {
|
|
21
22
|
return _target[k];
|
|
22
23
|
}
|
|
23
24
|
}),
|
|
25
|
+
// assem代理:具有特殊属性访问逻辑的代理
|
|
24
26
|
assem: new Proxy(assem, {
|
|
25
27
|
get(_target, k) {
|
|
26
28
|
if (k == "__B") {
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { Locale, Translator } from '../../types/locale';
|
|
2
2
|
import { MaybeRef } from '../../types/hooks';
|
|
3
3
|
import { ComputedRef, Ref } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* 构建一个翻译器函数
|
|
6
|
+
* @param locale - 包含语言环境数据的响应式引用对象
|
|
7
|
+
* @returns 返回一个翻译函数,该函数可以根据路径获取对应的翻译文本并支持参数替换
|
|
8
|
+
*/
|
|
4
9
|
export declare function buildTranslator(locale: MaybeRef<Locale>): Translator;
|
|
10
|
+
/**
|
|
11
|
+
* 构建一个用于拼接本地化字符串的函数
|
|
12
|
+
* @param locale 本地化数据对象,可能为响应式引用
|
|
13
|
+
* @param lang 语言标识的计算属性引用
|
|
14
|
+
* @returns 返回一个函数,该函数接收多个字符串参数并根据语言设置拼接对应的本地化值
|
|
15
|
+
*/
|
|
5
16
|
export declare function buildLocaleAdd(locale: MaybeRef<Locale>, lang: ComputedRef<string>): (...arr: string[]) => string;
|
|
17
|
+
/**
|
|
18
|
+
* 构建本地化上下文对象
|
|
19
|
+
* @param locale - 本地化配置信息,可以是响应式引用或普通对象
|
|
20
|
+
* @returns 包含语言信息和本地化相关方法的上下文对象
|
|
21
|
+
*/
|
|
6
22
|
export declare function buildLocaleContext(locale: MaybeRef<Locale>): {
|
|
7
23
|
lang: ComputedRef<string>;
|
|
8
24
|
locale: Ref<{
|
|
@@ -29,6 +45,14 @@ export declare function buildLocaleContext(locale: MaybeRef<Locale>): {
|
|
|
29
45
|
getLocale: Translator;
|
|
30
46
|
getLocaleAdd: (...arr: string[]) => string;
|
|
31
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* 获取并构建本地化上下文
|
|
50
|
+
*
|
|
51
|
+
* 该函数用于根据全局配置中的locale值来构建对应的本地化上下文,
|
|
52
|
+
* 支持英文和简体中文两种语言,默认使用简体中文。
|
|
53
|
+
*
|
|
54
|
+
* @returns 返回构建好的本地化上下文对象
|
|
55
|
+
*/
|
|
32
56
|
export declare function useLocale(): {
|
|
33
57
|
lang: ComputedRef<string>;
|
|
34
58
|
locale: Ref<{
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取处理后的属性配置对象
|
|
3
|
+
*
|
|
4
|
+
* @template T - 属性对象的类型,必须是键值对形式的对象
|
|
5
|
+
* @param props - 原始属性配置对象
|
|
6
|
+
* @returns 处理后的属性配置对象,如果全局配置禁用则直接返回原对象
|
|
7
|
+
*/
|
|
1
8
|
export declare function getProps<T extends Record<string, any>>(props: T): T;
|
|
2
9
|
/**
|
|
3
10
|
* 获取全局配置参数默认参数
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
11
|
+
* 根据全局配置状态处理props默认值的自定义hook函数
|
|
12
|
+
*
|
|
13
|
+
* @param key - 配置项的键名,用于从默认配置中获取对应配置
|
|
14
|
+
* @param props - 原始props对象
|
|
15
|
+
* @param dataProps - 数据props,默认为空对象
|
|
16
|
+
* @param keyObj - 键值映射对象,可选参数
|
|
17
|
+
* @returns 返回处理后的props代理对象
|
|
9
18
|
*/
|
|
10
19
|
export declare function usePropsDefault<T extends Record<string | symbol, any>>(key: string, props: T, dataProps?: ObjAny, keyObj?: ObjAny): T;
|
|
11
20
|
/**
|
package/dist/icons/iconify.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
2
|
import { InstallOptions } from './config';
|
|
3
|
+
/**
|
|
4
|
+
* 将图标配置转换为Vue组件并注册到应用中
|
|
5
|
+
* @param app - Vue应用实例,用于注册组件
|
|
6
|
+
* @param ify - 图标配置对象,包含前缀、尺寸和图标数据
|
|
7
|
+
* @param options - 安装选项,可选参数
|
|
8
|
+
* @param options.prefix - 组件名称前缀,默认使用defaultPrefix
|
|
9
|
+
*/
|
|
3
10
|
export declare const iconify: (app: App, ify: {
|
|
4
11
|
[key: string]: any;
|
|
5
12
|
}, { prefix }?: InstallOptions) => void;
|
package/dist/icons/index.json
CHANGED
package/dist/index.css
CHANGED
|
@@ -49,6 +49,24 @@
|
|
|
49
49
|
display: grid;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.forms-items {
|
|
53
|
+
width: 100%;
|
|
54
|
+
}
|
|
55
|
+
.forms-items.row {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: row;
|
|
58
|
+
}
|
|
59
|
+
.forms-items.column {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
}
|
|
63
|
+
.forms-items-li.no-error {
|
|
64
|
+
--el-color-danger: var(--el-border-color);
|
|
65
|
+
}
|
|
66
|
+
.forms-items-li.no-error .el-input__wrapper.is-focus {
|
|
67
|
+
--el-color-danger: var(--el-input-focus-border);
|
|
68
|
+
}
|
|
69
|
+
|
|
52
70
|
.double {
|
|
53
71
|
width: 100%;
|
|
54
72
|
display: inline-flex;
|
package/dist/locale/en.cjs
CHANGED
package/dist/locale/en.d.ts
CHANGED
package/dist/locale/en.js
CHANGED
package/dist/locale/zh-cn.cjs
CHANGED
package/dist/locale/zh-cn.d.ts
CHANGED
package/dist/locale/zh-cn.js
CHANGED
package/dist/type.d.ts
CHANGED
package/dist/utils/css.cjs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const setObjStyle = require("@fangzhongya/utils/css/setObjStyle");
|
|
4
4
|
const getCss = require("@fangzhongya/utils/css/getCss");
|
|
5
|
+
function getCssNumber(str = "") {
|
|
6
|
+
return Number(String(str).replaceAll(/[^0-9.-]/g, ""));
|
|
7
|
+
}
|
|
5
8
|
Object.defineProperty(exports, "setObjStyle", {
|
|
6
9
|
enumerable: true,
|
|
7
10
|
get: () => setObjStyle.setObjStyle
|
|
@@ -10,3 +13,4 @@ Object.defineProperty(exports, "getCss", {
|
|
|
10
13
|
enumerable: true,
|
|
11
14
|
get: () => getCss.getCss
|
|
12
15
|
});
|
|
16
|
+
exports.getCssNumber = getCssNumber;
|
package/dist/utils/css.d.ts
CHANGED
package/dist/utils/css.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { setObjStyle } from "@fangzhongya/utils/css/setObjStyle";
|
|
2
2
|
import { getCss } from "@fangzhongya/utils/css/getCss";
|
|
3
|
+
function getCssNumber(str = "") {
|
|
4
|
+
return Number(String(str).replaceAll(/[^0-9.-]/g, ""));
|
|
5
|
+
}
|
|
3
6
|
export {
|
|
4
7
|
getCss,
|
|
8
|
+
getCssNumber,
|
|
5
9
|
setObjStyle
|
|
6
10
|
};
|
package/dist/utils/local.cjs
CHANGED
|
@@ -13,7 +13,8 @@ function getKey(key, isCom) {
|
|
|
13
13
|
function setLocal(key, value = "", isCom = false) {
|
|
14
14
|
try {
|
|
15
15
|
localStorage.setItem(getKey(key, isCom), JSON.stringify(value));
|
|
16
|
-
} catch (
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.log("error", error);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
function getLocal(key, isCom = false) {
|
|
@@ -23,7 +24,8 @@ function getLocal(key, isCom = false) {
|
|
|
23
24
|
if (obj && obj !== "null" && obj !== "undefined") {
|
|
24
25
|
e = JSON.parse(obj);
|
|
25
26
|
}
|
|
26
|
-
} catch (
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.log("error", error);
|
|
27
29
|
}
|
|
28
30
|
return e;
|
|
29
31
|
}
|
|
@@ -34,13 +36,15 @@ function clearLocal(key, isCom = false) {
|
|
|
34
36
|
} else {
|
|
35
37
|
localStorage.clear();
|
|
36
38
|
}
|
|
37
|
-
} catch (
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.log("error", error);
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
function setSession(key, value = "", isCom = false) {
|
|
41
44
|
try {
|
|
42
45
|
sessionStorage.setItem(getKey(key, isCom), JSON.stringify(value));
|
|
43
|
-
} catch (
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.log("error", error);
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
function getSession(key, isCom = false) {
|
|
@@ -50,7 +54,8 @@ function getSession(key, isCom = false) {
|
|
|
50
54
|
if (obj && obj !== "null" && obj !== "undefined") {
|
|
51
55
|
v = JSON.parse(obj);
|
|
52
56
|
}
|
|
53
|
-
} catch (
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.log("error", error);
|
|
54
59
|
}
|
|
55
60
|
return v;
|
|
56
61
|
}
|
|
@@ -61,7 +66,8 @@ function clearSession(key, isCom = false) {
|
|
|
61
66
|
} else {
|
|
62
67
|
sessionStorage.clear();
|
|
63
68
|
}
|
|
64
|
-
} catch (
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.log("error", error);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
exports.clearLocal = clearLocal;
|
package/dist/utils/local.js
CHANGED
|
@@ -11,7 +11,8 @@ function getKey(key, isCom) {
|
|
|
11
11
|
function setLocal(key, value = "", isCom = false) {
|
|
12
12
|
try {
|
|
13
13
|
localStorage.setItem(getKey(key, isCom), JSON.stringify(value));
|
|
14
|
-
} catch (
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.log("error", error);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
function getLocal(key, isCom = false) {
|
|
@@ -21,7 +22,8 @@ function getLocal(key, isCom = false) {
|
|
|
21
22
|
if (obj && obj !== "null" && obj !== "undefined") {
|
|
22
23
|
e = JSON.parse(obj);
|
|
23
24
|
}
|
|
24
|
-
} catch (
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.log("error", error);
|
|
25
27
|
}
|
|
26
28
|
return e;
|
|
27
29
|
}
|
|
@@ -32,13 +34,15 @@ function clearLocal(key, isCom = false) {
|
|
|
32
34
|
} else {
|
|
33
35
|
localStorage.clear();
|
|
34
36
|
}
|
|
35
|
-
} catch (
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.log("error", error);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
function setSession(key, value = "", isCom = false) {
|
|
39
42
|
try {
|
|
40
43
|
sessionStorage.setItem(getKey(key, isCom), JSON.stringify(value));
|
|
41
|
-
} catch (
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.log("error", error);
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
function getSession(key, isCom = false) {
|
|
@@ -48,7 +52,8 @@ function getSession(key, isCom = false) {
|
|
|
48
52
|
if (obj && obj !== "null" && obj !== "undefined") {
|
|
49
53
|
v = JSON.parse(obj);
|
|
50
54
|
}
|
|
51
|
-
} catch (
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.log("error", error);
|
|
52
57
|
}
|
|
53
58
|
return v;
|
|
54
59
|
}
|
|
@@ -59,7 +64,8 @@ function clearSession(key, isCom = false) {
|
|
|
59
64
|
} else {
|
|
60
65
|
sessionStorage.clear();
|
|
61
66
|
}
|
|
62
|
-
} catch (
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.log("error", error);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
export {
|
package/dist/utils/util.cjs
CHANGED
|
@@ -28,23 +28,25 @@ function processFatherObject(obj, currentValue, is, row) {
|
|
|
28
28
|
return row;
|
|
29
29
|
}
|
|
30
30
|
if (!obj.prop) {
|
|
31
|
-
return currentValue
|
|
31
|
+
return currentValue;
|
|
32
32
|
}
|
|
33
33
|
const nextValue = getNextValue(obj, currentValue);
|
|
34
34
|
if (is) {
|
|
35
|
+
const rv = nextValue ?? {};
|
|
35
36
|
if (obj.pars) {
|
|
36
|
-
objValue.setObjValue(currentValue, obj.prop,
|
|
37
|
+
objValue.setObjValue(currentValue, obj.prop, rv);
|
|
37
38
|
} else {
|
|
38
|
-
currentValue[obj.prop] =
|
|
39
|
+
currentValue[obj.prop] = rv;
|
|
39
40
|
}
|
|
41
|
+
return rv;
|
|
40
42
|
}
|
|
41
43
|
return nextValue;
|
|
42
44
|
}
|
|
43
45
|
function getNextValue(obj, currentValue) {
|
|
44
46
|
if (obj.pars) {
|
|
45
|
-
return objValue.getObjValue(obj.prop, currentValue) ?? obj.default
|
|
47
|
+
return objValue.getObjValue(obj.prop, currentValue) ?? obj.default;
|
|
46
48
|
}
|
|
47
|
-
return currentValue[obj.prop] ?? obj.default
|
|
49
|
+
return currentValue[obj.prop] ?? obj.default;
|
|
48
50
|
}
|
|
49
51
|
function executionMethod(fun, ...arr) {
|
|
50
52
|
var _a;
|