@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
|
@@ -25,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
25
25
|
const prs = __props;
|
|
26
26
|
const props = index$3.usePropsDefault(data.name, prs, data.dataProps);
|
|
27
27
|
const placeholder = vue.computed(() => {
|
|
28
|
-
if (
|
|
28
|
+
if (props.placeholder === void 0) {
|
|
29
29
|
return getLocale("form.select");
|
|
30
30
|
} else {
|
|
31
31
|
return props.placeholder;
|
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
42
42
|
emit("click-multiple", listFuObj.getValueObjs(v)[0], is);
|
|
43
43
|
};
|
|
44
44
|
if (props.isEmpty) {
|
|
45
|
-
const emptyValue = "__Symbol('empty')__" +
|
|
45
|
+
const emptyValue = "__Symbol('empty')__" + Date.now();
|
|
46
46
|
onClickMultiple = (v, is) => {
|
|
47
47
|
if (v === emptyValue) {
|
|
48
48
|
v = "";
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
const prs = __props;
|
|
24
24
|
const props = usePropsDefault(name, prs, dataProps);
|
|
25
25
|
const placeholder = computed(() => {
|
|
26
|
-
if (
|
|
26
|
+
if (props.placeholder === void 0) {
|
|
27
27
|
return getLocale("form.select");
|
|
28
28
|
} else {
|
|
29
29
|
return props.placeholder;
|
|
@@ -40,7 +40,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
40
|
emit("click-multiple", listFuObj.getValueObjs(v)[0], is);
|
|
41
41
|
};
|
|
42
42
|
if (props.isEmpty) {
|
|
43
|
-
const emptyValue = "__Symbol('empty')__" +
|
|
43
|
+
const emptyValue = "__Symbol('empty')__" + Date.now();
|
|
44
44
|
onClickMultiple = (v, is) => {
|
|
45
45
|
if (v === emptyValue) {
|
|
46
46
|
v = "";
|
|
@@ -74,8 +74,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
74
74
|
vue.onMounted(() => {
|
|
75
75
|
if (props.isFixed) {
|
|
76
76
|
fRect.value = {
|
|
77
|
-
width:
|
|
78
|
-
height:
|
|
77
|
+
width: globalThis.innerWidth,
|
|
78
|
+
height: globalThis.innerHeight,
|
|
79
79
|
left: 0,
|
|
80
80
|
top: 0
|
|
81
81
|
};
|
|
@@ -72,8 +72,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
72
|
onMounted(() => {
|
|
73
73
|
if (props.isFixed) {
|
|
74
74
|
fRect.value = {
|
|
75
|
-
width:
|
|
76
|
-
height:
|
|
75
|
+
width: globalThis.innerWidth,
|
|
76
|
+
height: globalThis.innerHeight,
|
|
77
77
|
left: 0,
|
|
78
78
|
top: 0
|
|
79
79
|
};
|
|
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
30
30
|
const elRef = vue.ref();
|
|
31
31
|
const active = vue.ref({});
|
|
32
32
|
const inactive = vue.ref({});
|
|
33
|
-
const emptyValue = "__Symbol('empty')__" +
|
|
33
|
+
const emptyValue = "__Symbol('empty')__" + Date.now();
|
|
34
34
|
vue.watch(
|
|
35
35
|
() => props.options,
|
|
36
36
|
() => {
|
|
@@ -28,7 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
const elRef = ref();
|
|
29
29
|
const active = ref({});
|
|
30
30
|
const inactive = ref({});
|
|
31
|
-
const emptyValue = "__Symbol('empty')__" +
|
|
31
|
+
const emptyValue = "__Symbol('empty')__" + Date.now();
|
|
32
32
|
watch(
|
|
33
33
|
() => props.options,
|
|
34
34
|
() => {
|
|
@@ -70,7 +70,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
70
70
|
return props.class;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
return;
|
|
74
73
|
});
|
|
75
74
|
const color = vue.computed(() => {
|
|
76
75
|
if (props.isBackg) {
|
|
@@ -80,13 +79,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
80
79
|
} else {
|
|
81
80
|
return getValue();
|
|
82
81
|
}
|
|
83
|
-
return;
|
|
84
82
|
});
|
|
85
83
|
const backgroundColor = vue.computed(() => {
|
|
86
84
|
if (props.isBackg) {
|
|
87
85
|
return getValue();
|
|
88
86
|
}
|
|
89
|
-
return;
|
|
90
87
|
});
|
|
91
88
|
function getValue() {
|
|
92
89
|
if (props.formatter) {
|
|
@@ -68,7 +68,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
68
|
return props.class;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
return;
|
|
72
71
|
});
|
|
73
72
|
const color = computed(() => {
|
|
74
73
|
if (props.isBackg) {
|
|
@@ -78,13 +77,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
77
|
} else {
|
|
79
78
|
return getValue();
|
|
80
79
|
}
|
|
81
|
-
return;
|
|
82
80
|
});
|
|
83
81
|
const backgroundColor = computed(() => {
|
|
84
82
|
if (props.isBackg) {
|
|
85
83
|
return getValue();
|
|
86
84
|
}
|
|
87
|
-
return;
|
|
88
85
|
});
|
|
89
86
|
function getValue() {
|
|
90
87
|
if (props.formatter) {
|
|
@@ -93,6 +93,16 @@ export declare const dataProps: {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
export declare const dataEmit: string[];
|
|
96
|
+
/**
|
|
97
|
+
* 初始化表格组件的核心逻辑,包括分页、排序、选择、跨页多选等功能。
|
|
98
|
+
*
|
|
99
|
+
* @param props 组件传入的属性对象,包含配置信息和事件回调等
|
|
100
|
+
* @param emit 用于触发自定义事件的方法
|
|
101
|
+
* @param refTable 表格实例引用,用于调用表格方法(如清空选中)
|
|
102
|
+
* @param getLocale 国际化翻译函数
|
|
103
|
+
* @param defaultConfig 默认表格配置项
|
|
104
|
+
* @returns 包含各种状态、方法和响应式数据的对象
|
|
105
|
+
*/
|
|
96
106
|
export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit: Function, refTable: Ref, getLocale: Translator, defaultConfig?: TableConfig) => {
|
|
97
107
|
height: ComputedRef<any>;
|
|
98
108
|
tableConfig: Ref<{
|
|
@@ -221,6 +231,9 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
221
231
|
isdiv?: boolean | undefined;
|
|
222
232
|
orig?: boolean | undefined;
|
|
223
233
|
compon?: string | object | undefined;
|
|
234
|
+
slots?: string | VNode | {
|
|
235
|
+
[key: string]: () => string | VNode | undefined;
|
|
236
|
+
};
|
|
224
237
|
default?: any;
|
|
225
238
|
value?: any;
|
|
226
239
|
label?: string | Function | /*elided*/ any | undefined;
|
|
@@ -259,6 +272,9 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
259
272
|
isdiv?: boolean | undefined;
|
|
260
273
|
orig?: boolean | undefined;
|
|
261
274
|
compon?: string | object | undefined;
|
|
275
|
+
slots?: string | VNode | {
|
|
276
|
+
[key: string]: () => string | VNode | undefined;
|
|
277
|
+
};
|
|
262
278
|
default?: any;
|
|
263
279
|
value?: any;
|
|
264
280
|
label?: string | Function | /*elided*/ any | undefined;
|
|
@@ -16,7 +16,7 @@ function isGreaterThan(a, b, epsilon = 0.03) {
|
|
|
16
16
|
return a - b > epsilon;
|
|
17
17
|
}
|
|
18
18
|
const getPadding = (el) => {
|
|
19
|
-
const style =
|
|
19
|
+
const style = globalThis.getComputedStyle(el, null);
|
|
20
20
|
const paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
|
|
21
21
|
const paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
|
|
22
22
|
const paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
|
|
@@ -14,7 +14,7 @@ function isGreaterThan(a, b, epsilon = 0.03) {
|
|
|
14
14
|
return a - b > epsilon;
|
|
15
15
|
}
|
|
16
16
|
const getPadding = (el) => {
|
|
17
|
-
const style =
|
|
17
|
+
const style = globalThis.getComputedStyle(el, null);
|
|
18
18
|
const paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
|
|
19
19
|
const paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
|
|
20
20
|
const paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
|
|
@@ -1,9 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
+
const use = require("../../common/use.cjs");
|
|
4
5
|
const firstUpper = require("@fangzhongya/utils/basic/string/firstUpper");
|
|
5
6
|
const splitUpper = require("@fangzhongya/utils/basic/string/splitUpper");
|
|
6
7
|
const getAttrValue = require("../../../utils/vues/getAttrValue.cjs");
|
|
8
|
+
const css = require("../../../utils/css.cjs");
|
|
9
|
+
function getVNodeWidth(vnode) {
|
|
10
|
+
const container = document.createElement("div");
|
|
11
|
+
Object.assign(container.style, {
|
|
12
|
+
position: "absolute",
|
|
13
|
+
left: "-9999px",
|
|
14
|
+
top: "-9999px",
|
|
15
|
+
whiteSpace: "pre-wrap",
|
|
16
|
+
display: "inline-block",
|
|
17
|
+
visibility: "hidden"
|
|
18
|
+
});
|
|
19
|
+
document.body.appendChild(container);
|
|
20
|
+
vue.render(vnode, container);
|
|
21
|
+
const width = container.offsetWidth;
|
|
22
|
+
container.remove();
|
|
23
|
+
vue.render(null, container);
|
|
24
|
+
return width;
|
|
25
|
+
}
|
|
26
|
+
function setLabelWidth(obj, config) {
|
|
27
|
+
let label = use.useGetDomLabel(obj, {}, {}, {}, {}, () => {
|
|
28
|
+
}, 0);
|
|
29
|
+
if (!vue.isVNode(label)) {
|
|
30
|
+
label = vue.h(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
style: {
|
|
34
|
+
whiteSpace: "pre-wrap",
|
|
35
|
+
display: "inline-block"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
label
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const width = getVNodeWidth(label);
|
|
42
|
+
const interval = config.intervalHorizon ?? config.interval;
|
|
43
|
+
return width + css.getCssNumber(interval) * 2;
|
|
44
|
+
}
|
|
7
45
|
function setMinWidth(obj, props) {
|
|
8
46
|
const config = (props == null ? void 0 : props.table) ?? {};
|
|
9
47
|
if (obj.width) {
|
|
@@ -14,16 +52,18 @@ function setMinWidth(obj, props) {
|
|
|
14
52
|
if (typeof minWidth == "function") {
|
|
15
53
|
return minWidth(obj, config);
|
|
16
54
|
} else if (typeof minWidth == "boolean") {
|
|
17
|
-
return (obj
|
|
55
|
+
return setLabelWidth(obj, config);
|
|
18
56
|
} else {
|
|
19
57
|
return minWidth;
|
|
20
58
|
}
|
|
21
59
|
} else {
|
|
22
60
|
const minWidth2 = getAttrValue.getAttrValue(config, "minWidth");
|
|
23
|
-
if (minWidth2) {
|
|
24
|
-
return minWidth2;
|
|
61
|
+
if (typeof minWidth2 == "function") {
|
|
62
|
+
return minWidth2(obj, config);
|
|
63
|
+
} else if (typeof minWidth2 == "boolean") {
|
|
64
|
+
return setLabelWidth(obj, config);
|
|
25
65
|
} else {
|
|
26
|
-
return;
|
|
66
|
+
return minWidth2;
|
|
27
67
|
}
|
|
28
68
|
}
|
|
29
69
|
}
|
|
@@ -117,10 +157,8 @@ function setEmptyDisplay(value, emptyDisplay, isStr) {
|
|
|
117
157
|
if (value === "" || value === void 0 || value === null) {
|
|
118
158
|
return emptyDisplay;
|
|
119
159
|
}
|
|
120
|
-
} else {
|
|
121
|
-
|
|
122
|
-
return emptyDisplay;
|
|
123
|
-
}
|
|
160
|
+
} else if (value === void 0 || value === null) {
|
|
161
|
+
return emptyDisplay;
|
|
124
162
|
}
|
|
125
163
|
}
|
|
126
164
|
exports.eventAliass = eventAliass;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设置对象的最小宽度
|
|
3
|
+
* @param obj - 需要设置最小宽度的对象
|
|
4
|
+
* @param props - 可选的配置属性对象
|
|
5
|
+
* @returns 返回设置的最小宽度值,可能为具体数值、函数执行结果或undefined
|
|
6
|
+
*/
|
|
1
7
|
export declare function setMinWidth(obj: ObjAny, props?: ObjAny): any;
|
|
2
8
|
/**
|
|
3
9
|
* 支持事件别名处理
|
|
@@ -7,4 +13,11 @@ export declare function setMinWidth(obj: ObjAny, props?: ObjAny): any;
|
|
|
7
13
|
* @param {*} $event
|
|
8
14
|
*/
|
|
9
15
|
export declare function eventAliass(callback: Function, arr: string | string[], obj: ObjAny, $event: Event): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 设置空值显示内容
|
|
18
|
+
* @param value 需要检查的值
|
|
19
|
+
* @param emptyDisplay 空值时显示的内容,默认为undefined
|
|
20
|
+
* @param isStr 是否为字符串类型检查,默认为undefined
|
|
21
|
+
* @returns 如果值为空则返回emptyDisplay,否则返回undefined
|
|
22
|
+
*/
|
|
10
23
|
export declare function setEmptyDisplay(value: any, emptyDisplay?: string, isStr?: boolean): string | undefined;
|
|
@@ -1,7 +1,45 @@
|
|
|
1
|
-
import { withModifiers } from "vue";
|
|
1
|
+
import { render, isVNode, h, withModifiers } from "vue";
|
|
2
|
+
import { useGetDomLabel } from "../../common/use.js";
|
|
2
3
|
import { firstUpper } from "@fangzhongya/utils/basic/string/firstUpper";
|
|
3
4
|
import { splitUpper } from "@fangzhongya/utils/basic/string/splitUpper";
|
|
4
5
|
import { getAttrValue } from "../../../utils/vues/getAttrValue.js";
|
|
6
|
+
import { getCssNumber } from "../../../utils/css.js";
|
|
7
|
+
function getVNodeWidth(vnode) {
|
|
8
|
+
const container = document.createElement("div");
|
|
9
|
+
Object.assign(container.style, {
|
|
10
|
+
position: "absolute",
|
|
11
|
+
left: "-9999px",
|
|
12
|
+
top: "-9999px",
|
|
13
|
+
whiteSpace: "pre-wrap",
|
|
14
|
+
display: "inline-block",
|
|
15
|
+
visibility: "hidden"
|
|
16
|
+
});
|
|
17
|
+
document.body.appendChild(container);
|
|
18
|
+
render(vnode, container);
|
|
19
|
+
const width = container.offsetWidth;
|
|
20
|
+
container.remove();
|
|
21
|
+
render(null, container);
|
|
22
|
+
return width;
|
|
23
|
+
}
|
|
24
|
+
function setLabelWidth(obj, config) {
|
|
25
|
+
let label = useGetDomLabel(obj, {}, {}, {}, {}, () => {
|
|
26
|
+
}, 0);
|
|
27
|
+
if (!isVNode(label)) {
|
|
28
|
+
label = h(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
style: {
|
|
32
|
+
whiteSpace: "pre-wrap",
|
|
33
|
+
display: "inline-block"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
label
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
const width = getVNodeWidth(label);
|
|
40
|
+
const interval = config.intervalHorizon ?? config.interval;
|
|
41
|
+
return width + getCssNumber(interval) * 2;
|
|
42
|
+
}
|
|
5
43
|
function setMinWidth(obj, props) {
|
|
6
44
|
const config = (props == null ? void 0 : props.table) ?? {};
|
|
7
45
|
if (obj.width) {
|
|
@@ -12,16 +50,18 @@ function setMinWidth(obj, props) {
|
|
|
12
50
|
if (typeof minWidth == "function") {
|
|
13
51
|
return minWidth(obj, config);
|
|
14
52
|
} else if (typeof minWidth == "boolean") {
|
|
15
|
-
return (obj
|
|
53
|
+
return setLabelWidth(obj, config);
|
|
16
54
|
} else {
|
|
17
55
|
return minWidth;
|
|
18
56
|
}
|
|
19
57
|
} else {
|
|
20
58
|
const minWidth2 = getAttrValue(config, "minWidth");
|
|
21
|
-
if (minWidth2) {
|
|
22
|
-
return minWidth2;
|
|
59
|
+
if (typeof minWidth2 == "function") {
|
|
60
|
+
return minWidth2(obj, config);
|
|
61
|
+
} else if (typeof minWidth2 == "boolean") {
|
|
62
|
+
return setLabelWidth(obj, config);
|
|
23
63
|
} else {
|
|
24
|
-
return;
|
|
64
|
+
return minWidth2;
|
|
25
65
|
}
|
|
26
66
|
}
|
|
27
67
|
}
|
|
@@ -115,10 +155,8 @@ function setEmptyDisplay(value, emptyDisplay, isStr) {
|
|
|
115
155
|
if (value === "" || value === void 0 || value === null) {
|
|
116
156
|
return emptyDisplay;
|
|
117
157
|
}
|
|
118
|
-
} else {
|
|
119
|
-
|
|
120
|
-
return emptyDisplay;
|
|
121
|
-
}
|
|
158
|
+
} else if (value === void 0 || value === null) {
|
|
159
|
+
return emptyDisplay;
|
|
122
160
|
}
|
|
123
161
|
}
|
|
124
162
|
export {
|
|
@@ -40,14 +40,22 @@ function handlePropertyMapping(value, ckey, obj, robj) {
|
|
|
40
40
|
handler();
|
|
41
41
|
}
|
|
42
42
|
function setSslot(obj, scope, emit, slots, props, index$12) {
|
|
43
|
-
const
|
|
43
|
+
const optionss = props.options || {};
|
|
44
|
+
const slot = use.useSetSlot(
|
|
45
|
+
obj,
|
|
46
|
+
scope.row,
|
|
47
|
+
slots,
|
|
48
|
+
optionss,
|
|
49
|
+
emit,
|
|
50
|
+
index$12,
|
|
51
|
+
scope
|
|
52
|
+
);
|
|
44
53
|
if (slot) {
|
|
45
54
|
return slot;
|
|
46
55
|
}
|
|
47
56
|
if (obj.compon) {
|
|
48
57
|
const isComponSelected = props.isComponSelected;
|
|
49
58
|
if (isComponSelected(obj, scope)) {
|
|
50
|
-
const optionss = props.options || {};
|
|
51
59
|
const column = use.useSetCompon(
|
|
52
60
|
obj,
|
|
53
61
|
scope.row,
|
|
@@ -55,7 +63,7 @@ function setSslot(obj, scope, emit, slots, props, index$12) {
|
|
|
55
63
|
index.useComponsGet(config.provides.compons),
|
|
56
64
|
emit,
|
|
57
65
|
index$12,
|
|
58
|
-
{ ...scope, options:
|
|
66
|
+
{ ...scope, options: optionss, config: props.table }
|
|
59
67
|
);
|
|
60
68
|
if (column) {
|
|
61
69
|
return column;
|
|
@@ -100,7 +108,6 @@ function setDomValue(domValue, table) {
|
|
|
100
108
|
function setHeader(obj, scope, slots, emit, props, index$12) {
|
|
101
109
|
const optionss = props.options || {};
|
|
102
110
|
return use.useGetDomLabel(
|
|
103
|
-
obj.label,
|
|
104
111
|
obj,
|
|
105
112
|
scope.row,
|
|
106
113
|
slots,
|
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
import { VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 设置表头函数
|
|
4
|
+
* @param obj - 列表对象
|
|
5
|
+
* @param scope - 作用域对象
|
|
6
|
+
* @param slots - 插槽对象
|
|
7
|
+
* @param emit - 事件发射函数
|
|
8
|
+
* @param props - 属性对象
|
|
9
|
+
* @param index - 索引值
|
|
10
|
+
* @returns 返回处理后的DOM标签
|
|
11
|
+
*/
|
|
2
12
|
export declare function setHeader(obj: ListObj, scope: ObjAny, slots: ObjAny, emit: Function, props: ObjAny, index: number): any;
|
|
13
|
+
/**
|
|
14
|
+
* 获取表格列组件
|
|
15
|
+
* @param obj - 列配置对象,包含列的基本信息和配置
|
|
16
|
+
* @param emit - 事件发射函数,用于触发自定义事件
|
|
17
|
+
* @param props - 组件属性对象
|
|
18
|
+
* @param slots - 插槽对象,包含自定义插槽内容
|
|
19
|
+
* @param index - 列索引位置
|
|
20
|
+
* @param def - 默认渲染函数,可选参数
|
|
21
|
+
* @returns 返回Element Plus的TableColumn组件实例
|
|
22
|
+
*/
|
|
3
23
|
export declare function getTableColumn(obj: ListObj, emit: Function, props: ObjAny, slots: ObjAny, index: number, def?: Function): VNode<RendererNode, RendererElement, {
|
|
4
24
|
[key: string]: any;
|
|
5
25
|
}>;
|
|
26
|
+
/**
|
|
27
|
+
* 渲染列组件的函数
|
|
28
|
+
* @param obj - 列表对象,包含列的配置信息
|
|
29
|
+
* @param emit - 事件发射函数,用于触发自定义事件
|
|
30
|
+
* @param props - 组件属性对象,包含传入的props数据
|
|
31
|
+
* @param slots - 插槽对象,包含可用的插槽内容
|
|
32
|
+
* @param index - 当前项的索引位置
|
|
33
|
+
* @returns 返回渲染后的DOM元素
|
|
34
|
+
*/
|
|
6
35
|
export declare function columnRender(obj: ListObj, emit: Function, props: ObjAny, slots: ObjAny, index: number): VNode<RendererNode, RendererElement, {
|
|
7
36
|
[key: string]: any;
|
|
8
37
|
}>;
|
|
@@ -38,14 +38,22 @@ function handlePropertyMapping(value, ckey, obj, robj) {
|
|
|
38
38
|
handler();
|
|
39
39
|
}
|
|
40
40
|
function setSslot(obj, scope, emit, slots, props, index) {
|
|
41
|
-
const
|
|
41
|
+
const optionss = props.options || {};
|
|
42
|
+
const slot = useSetSlot(
|
|
43
|
+
obj,
|
|
44
|
+
scope.row,
|
|
45
|
+
slots,
|
|
46
|
+
optionss,
|
|
47
|
+
emit,
|
|
48
|
+
index,
|
|
49
|
+
scope
|
|
50
|
+
);
|
|
42
51
|
if (slot) {
|
|
43
52
|
return slot;
|
|
44
53
|
}
|
|
45
54
|
if (obj.compon) {
|
|
46
55
|
const isComponSelected = props.isComponSelected;
|
|
47
56
|
if (isComponSelected(obj, scope)) {
|
|
48
|
-
const optionss = props.options || {};
|
|
49
57
|
const column = useSetCompon(
|
|
50
58
|
obj,
|
|
51
59
|
scope.row,
|
|
@@ -53,7 +61,7 @@ function setSslot(obj, scope, emit, slots, props, index) {
|
|
|
53
61
|
useComponsGet(provides.compons),
|
|
54
62
|
emit,
|
|
55
63
|
index,
|
|
56
|
-
{ ...scope, options:
|
|
64
|
+
{ ...scope, options: optionss, config: props.table }
|
|
57
65
|
);
|
|
58
66
|
if (column) {
|
|
59
67
|
return column;
|
|
@@ -98,7 +106,6 @@ function setDomValue(domValue, table) {
|
|
|
98
106
|
function setHeader(obj, scope, slots, emit, props, index) {
|
|
99
107
|
const optionss = props.options || {};
|
|
100
108
|
return useGetDomLabel(
|
|
101
|
-
obj.label,
|
|
102
109
|
obj,
|
|
103
110
|
scope.row,
|
|
104
111
|
slots,
|
|
@@ -12,13 +12,7 @@ function getLists(arrs, emit, props, slots, listobj) {
|
|
|
12
12
|
if (obj.children && obj.children.length > 0) {
|
|
13
13
|
if (obj.isdiv) {
|
|
14
14
|
arr.push(
|
|
15
|
-
...getLists(
|
|
16
|
-
obj.children,
|
|
17
|
-
emit,
|
|
18
|
-
props,
|
|
19
|
-
slots,
|
|
20
|
-
obj
|
|
21
|
-
)
|
|
15
|
+
...getLists(obj.children, emit, props, slots, obj)
|
|
22
16
|
);
|
|
23
17
|
} else {
|
|
24
18
|
arr.push(
|
|
@@ -10,13 +10,7 @@ function getLists(arrs, emit, props, slots, listobj) {
|
|
|
10
10
|
if (obj.children && obj.children.length > 0) {
|
|
11
11
|
if (obj.isdiv) {
|
|
12
12
|
arr.push(
|
|
13
|
-
...getLists(
|
|
14
|
-
obj.children,
|
|
15
|
-
emit,
|
|
16
|
-
props,
|
|
17
|
-
slots,
|
|
18
|
-
obj
|
|
19
|
-
)
|
|
13
|
+
...getLists(obj.children, emit, props, slots, obj)
|
|
20
14
|
);
|
|
21
15
|
} else {
|
|
22
16
|
arr.push(
|
|
@@ -135,8 +135,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
135
135
|
return tableRef.value;
|
|
136
136
|
};
|
|
137
137
|
vue.onMounted(() => {
|
|
138
|
-
if (
|
|
139
|
-
|
|
138
|
+
if (globalThis) {
|
|
139
|
+
globalThis.addEventListener("click", () => {
|
|
140
140
|
isfocus.value = false;
|
|
141
141
|
});
|
|
142
142
|
}
|
|
@@ -183,7 +183,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
183
183
|
]),
|
|
184
184
|
default: vue.withCtx(() => [
|
|
185
185
|
vue.createVNode(columns_vue_vue_type_script_lang.default, {
|
|
186
|
-
table: vue.unref(attrs).assem,
|
|
186
|
+
table: { ...vue.unref(props), ...vue.unref(attrs).assem },
|
|
187
187
|
value: vue.unref(props).value,
|
|
188
188
|
list: vue.unref(props).list,
|
|
189
189
|
options: vue.unref(props).options,
|
|
@@ -133,8 +133,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
133
133
|
return tableRef.value;
|
|
134
134
|
};
|
|
135
135
|
onMounted(() => {
|
|
136
|
-
if (
|
|
137
|
-
|
|
136
|
+
if (globalThis) {
|
|
137
|
+
globalThis.addEventListener("click", () => {
|
|
138
138
|
isfocus.value = false;
|
|
139
139
|
});
|
|
140
140
|
}
|
|
@@ -181,7 +181,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
181
181
|
]),
|
|
182
182
|
default: withCtx(() => [
|
|
183
183
|
createVNode(_sfc_main$1, {
|
|
184
|
-
table: unref(attrs).assem,
|
|
184
|
+
table: { ...unref(props), ...unref(attrs).assem },
|
|
185
185
|
value: unref(props).value,
|
|
186
186
|
list: unref(props).list,
|
|
187
187
|
options: unref(props).options,
|
|
@@ -71,14 +71,22 @@ function handleSelectableConfig(obj, vxeconfig, table) {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
function setSslot(obj, scope, emit, slots, props, index$12) {
|
|
74
|
-
const
|
|
74
|
+
const optionss = props.options || {};
|
|
75
|
+
const slot = use.useSetSlot(
|
|
76
|
+
obj,
|
|
77
|
+
scope.row,
|
|
78
|
+
slots,
|
|
79
|
+
optionss,
|
|
80
|
+
emit,
|
|
81
|
+
index$12,
|
|
82
|
+
scope
|
|
83
|
+
);
|
|
75
84
|
if (slot) {
|
|
76
85
|
return slot;
|
|
77
86
|
}
|
|
78
87
|
if (obj.compon) {
|
|
79
88
|
const isComponSelected = props.isComponSelected;
|
|
80
89
|
if (isComponSelected(obj, scope)) {
|
|
81
|
-
const optionss = props.options || {};
|
|
82
90
|
const column2 = use.useSetCompon(
|
|
83
91
|
obj,
|
|
84
92
|
scope.row,
|
|
@@ -86,7 +94,7 @@ function setSslot(obj, scope, emit, slots, props, index$12) {
|
|
|
86
94
|
index.useComponsGet(config.provides.compons),
|
|
87
95
|
emit,
|
|
88
96
|
index$12,
|
|
89
|
-
{ ...scope, options:
|
|
97
|
+
{ ...scope, options: optionss, config: props.table }
|
|
90
98
|
);
|
|
91
99
|
if (column2) {
|
|
92
100
|
return column2;
|
|
@@ -131,7 +139,6 @@ function setDomValue(domValue, table) {
|
|
|
131
139
|
function setHeader(obj, scope, slots, emit, props, index$12) {
|
|
132
140
|
const optionss = props.options || {};
|
|
133
141
|
return use.useGetDomLabel(
|
|
134
|
-
obj.label,
|
|
135
142
|
obj,
|
|
136
143
|
scope.row,
|
|
137
144
|
slots,
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 设置对象属性
|
|
4
|
+
* @param obj - 列表对象,用于获取原始数据
|
|
5
|
+
* @param props - 属性配置对象,包含table和vxeconfig配置
|
|
6
|
+
* @returns 处理后的属性对象
|
|
7
|
+
*/
|
|
2
8
|
export declare function setProps(obj: ListObj, props: ObjAny): ObjAny;
|
|
9
|
+
/**
|
|
10
|
+
* 设置表头函数
|
|
11
|
+
* @param obj - 列表对象
|
|
12
|
+
* @param scope - 作用域对象
|
|
13
|
+
* @param slots - 插槽对象
|
|
14
|
+
* @param emit - 事件发射函数
|
|
15
|
+
* @param props - 属性对象
|
|
16
|
+
* @param index - 索引值
|
|
17
|
+
* @returns 返回处理后的DOM标签
|
|
18
|
+
*/
|
|
3
19
|
export declare function setHeader(obj: ListObj, scope: ObjAny, slots: ObjAny, emit: Function, props: ObjAny, index: number): any;
|
|
20
|
+
/**
|
|
21
|
+
* 渲染列组件的函数
|
|
22
|
+
* @param obj - 列表对象,包含列的相关配置信息
|
|
23
|
+
* @param emit - 事件发射函数,用于触发自定义事件
|
|
24
|
+
* @param props - 组件属性对象,包含传入的props数据
|
|
25
|
+
* @param slots - 插槽对象,包含可用的插槽内容
|
|
26
|
+
* @param index - 当前项的索引位置
|
|
27
|
+
* @returns 返回渲染后的DOM元素
|
|
28
|
+
*/
|
|
4
29
|
export declare function columnRender(obj: ListObj, emit: Function, props: ObjAny, slots: ObjAny, index: number): VNode<RendererNode, RendererElement, {
|
|
5
30
|
[key: string]: any;
|
|
6
31
|
}>;
|