@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
|
@@ -69,14 +69,22 @@ function handleSelectableConfig(obj, vxeconfig, table) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
function setSslot(obj, scope, emit, slots, props, index) {
|
|
72
|
-
const
|
|
72
|
+
const optionss = props.options || {};
|
|
73
|
+
const slot = useSetSlot(
|
|
74
|
+
obj,
|
|
75
|
+
scope.row,
|
|
76
|
+
slots,
|
|
77
|
+
optionss,
|
|
78
|
+
emit,
|
|
79
|
+
index,
|
|
80
|
+
scope
|
|
81
|
+
);
|
|
73
82
|
if (slot) {
|
|
74
83
|
return slot;
|
|
75
84
|
}
|
|
76
85
|
if (obj.compon) {
|
|
77
86
|
const isComponSelected = props.isComponSelected;
|
|
78
87
|
if (isComponSelected(obj, scope)) {
|
|
79
|
-
const optionss = props.options || {};
|
|
80
88
|
const column = useSetCompon(
|
|
81
89
|
obj,
|
|
82
90
|
scope.row,
|
|
@@ -84,7 +92,7 @@ function setSslot(obj, scope, emit, slots, props, index) {
|
|
|
84
92
|
useComponsGet(provides.compons),
|
|
85
93
|
emit,
|
|
86
94
|
index,
|
|
87
|
-
{ ...scope, options:
|
|
95
|
+
{ ...scope, options: optionss, config: props.table }
|
|
88
96
|
);
|
|
89
97
|
if (column) {
|
|
90
98
|
return column;
|
|
@@ -129,7 +137,6 @@ function setDomValue(domValue, table) {
|
|
|
129
137
|
function setHeader(obj, scope, slots, emit, props, index) {
|
|
130
138
|
const optionss = props.options || {};
|
|
131
139
|
return useGetDomLabel(
|
|
132
|
-
obj.label,
|
|
133
140
|
obj,
|
|
134
141
|
scope.row,
|
|
135
142
|
slots,
|
|
@@ -18,13 +18,7 @@ function getLists(arrs, emit, props, slots, listobj) {
|
|
|
18
18
|
if (obj.children && obj.children.length > 0) {
|
|
19
19
|
const slotObj = {
|
|
20
20
|
default: (scope) => {
|
|
21
|
-
return getLists(
|
|
22
|
-
obj.children,
|
|
23
|
-
emit,
|
|
24
|
-
props,
|
|
25
|
-
slots,
|
|
26
|
-
obj
|
|
27
|
-
);
|
|
21
|
+
return getLists(obj.children, emit, props, slots, obj);
|
|
28
22
|
}
|
|
29
23
|
};
|
|
30
24
|
if (obj.type != "selection") {
|
|
@@ -16,13 +16,7 @@ function getLists(arrs, emit, props, slots, listobj) {
|
|
|
16
16
|
if (obj.children && obj.children.length > 0) {
|
|
17
17
|
const slotObj = {
|
|
18
18
|
default: (scope) => {
|
|
19
|
-
return getLists(
|
|
20
|
-
obj.children,
|
|
21
|
-
emit,
|
|
22
|
-
props,
|
|
23
|
-
slots,
|
|
24
|
-
obj
|
|
25
|
-
);
|
|
19
|
+
return getLists(obj.children, emit, props, slots, obj);
|
|
26
20
|
}
|
|
27
21
|
};
|
|
28
22
|
if (obj.type != "selection") {
|
|
@@ -206,8 +206,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
206
206
|
return tableRef.value;
|
|
207
207
|
};
|
|
208
208
|
vue.onMounted(() => {
|
|
209
|
-
if (
|
|
210
|
-
|
|
209
|
+
if (globalThis) {
|
|
210
|
+
globalThis.addEventListener("click", () => {
|
|
211
211
|
isfocus.value = false;
|
|
212
212
|
});
|
|
213
213
|
}
|
|
@@ -256,7 +256,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
256
256
|
]),
|
|
257
257
|
default: vue.withCtx(() => [
|
|
258
258
|
vue.createVNode(columns_vue_vue_type_script_lang.default, {
|
|
259
|
-
table: vue.unref(attrs).assem,
|
|
259
|
+
table: { ...vue.unref(props), ...vue.unref(attrs).assem },
|
|
260
260
|
vxeconfig: config$1.value,
|
|
261
261
|
value: vue.unref(props).value,
|
|
262
262
|
list: vue.unref(props).list,
|
|
@@ -204,8 +204,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
204
204
|
return tableRef.value;
|
|
205
205
|
};
|
|
206
206
|
onMounted(() => {
|
|
207
|
-
if (
|
|
208
|
-
|
|
207
|
+
if (globalThis) {
|
|
208
|
+
globalThis.addEventListener("click", () => {
|
|
209
209
|
isfocus.value = false;
|
|
210
210
|
});
|
|
211
211
|
}
|
|
@@ -254,7 +254,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
254
254
|
]),
|
|
255
255
|
default: withCtx(() => [
|
|
256
256
|
createVNode(_sfc_main$1, {
|
|
257
|
-
table: unref(attrs).assem,
|
|
257
|
+
table: { ...unref(props), ...unref(attrs).assem },
|
|
258
258
|
vxeconfig: config.value,
|
|
259
259
|
value: unref(props).value,
|
|
260
260
|
list: unref(props).list,
|
|
@@ -7,8 +7,7 @@ const getExtension = (fileName) => {
|
|
|
7
7
|
const extension = fileName.toLowerCase();
|
|
8
8
|
if (extension) {
|
|
9
9
|
const ks = Object.keys(data.types);
|
|
10
|
-
for (
|
|
11
|
-
const key = ks[index];
|
|
10
|
+
for (const key of ks) {
|
|
12
11
|
if (data.types[key].includes(extension)) {
|
|
13
12
|
return key;
|
|
14
13
|
}
|
|
@@ -65,7 +64,7 @@ function smartFileHandler(url) {
|
|
|
65
64
|
iframe.style.display = "none";
|
|
66
65
|
iframe.src = url;
|
|
67
66
|
iframe.onload = function() {
|
|
68
|
-
|
|
67
|
+
globalThis.open(url, "_blank");
|
|
69
68
|
iframe.remove();
|
|
70
69
|
};
|
|
71
70
|
iframe.onerror = function() {
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ListValue } from '../../players/common/util';
|
|
2
2
|
export declare const getType: (accept?: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* 获取列表项的类型
|
|
5
|
+
* @param obj - 列表值对象,可选参数
|
|
6
|
+
* @param type - 指定的类型,可选参数
|
|
7
|
+
* @param accept - 接受的类型,可选参数
|
|
8
|
+
* @returns 返回确定的类型字符串
|
|
9
|
+
*/
|
|
3
10
|
export declare const getListType: (obj?: ListValue, type?: string, accept?: string) => string;
|
|
4
11
|
/**
|
|
5
12
|
* 从 URL 下载文件
|
|
@@ -5,8 +5,7 @@ const getExtension = (fileName) => {
|
|
|
5
5
|
const extension = fileName.toLowerCase();
|
|
6
6
|
if (extension) {
|
|
7
7
|
const ks = Object.keys(types);
|
|
8
|
-
for (
|
|
9
|
-
const key = ks[index];
|
|
8
|
+
for (const key of ks) {
|
|
10
9
|
if (types[key].includes(extension)) {
|
|
11
10
|
return key;
|
|
12
11
|
}
|
|
@@ -63,7 +62,7 @@ function smartFileHandler(url) {
|
|
|
63
62
|
iframe.style.display = "none";
|
|
64
63
|
iframe.src = url;
|
|
65
64
|
iframe.onload = function() {
|
|
66
|
-
|
|
65
|
+
globalThis.open(url, "_blank");
|
|
67
66
|
iframe.remove();
|
|
68
67
|
};
|
|
69
68
|
iframe.onerror = function() {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--on: rgb(91, 189, 246);
|
|
3
|
+
--color-primary: #409eff;
|
|
4
|
+
--bag-primary: #409eff;
|
|
5
|
+
--bag-primary-text: #ffffff;
|
|
6
|
+
--border: #eee;
|
|
7
|
+
--layout-panel-gap: 10px;
|
|
8
|
+
--layout-panel-padding: 20px;
|
|
9
|
+
--layout-form-item-padding-right: var(
|
|
10
|
+
--layout-panel-gap
|
|
11
|
+
);
|
|
12
|
+
--g-main-bg: var(--bg-color-page);
|
|
13
|
+
--lable-array-height: 20px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.com-footer {
|
|
17
|
+
border-top: 1px solid var(--border);
|
|
18
|
+
padding: 20px 20px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.com-lable-array {
|
|
22
|
+
line-height: var(--lable-array-height);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.forms-div {
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
.forms-div-com {
|
|
30
|
+
height: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.forms-item {
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
.forms-item-el-item.is-height {
|
|
37
|
+
min-height: var(--forms-item-row-height);
|
|
38
|
+
}
|
|
39
|
+
.forms-item-el-item.is-height .el-form-item__label {
|
|
40
|
+
height: var(--forms-item-row-height);
|
|
41
|
+
line-height: var(--forms-item-row-height);
|
|
42
|
+
}
|
|
43
|
+
.forms-item-el-item .el-form-item__label {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
46
|
+
.forms-item-el-item.is-top .el-form-item__content {
|
|
47
|
+
min-height: var(--forms-item-row-height);
|
|
48
|
+
display: grid;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.forms-items {
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
.forms-items.row {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
}
|
|
58
|
+
.forms-items.column {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
}
|
|
62
|
+
.forms-items-li.no-error {
|
|
63
|
+
--el-color-danger: var(--el-border-color);
|
|
64
|
+
}
|
|
65
|
+
.forms-items-li.no-error .el-input__wrapper.is-focus {
|
|
66
|
+
--el-color-danger: var(--el-input-focus-border);
|
|
67
|
+
}
|
package/dist/css/forms.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/css/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/css/page.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;
|
|
@@ -22,9 +22,7 @@ function getPosition(el) {
|
|
|
22
22
|
return obj;
|
|
23
23
|
}
|
|
24
24
|
function getNext(el, paren) {
|
|
25
|
-
|
|
26
|
-
paren = el.parentElement || el;
|
|
27
|
-
}
|
|
25
|
+
paren ?? (paren = el.parentElement ?? el);
|
|
28
26
|
const cs = paren.childNodes;
|
|
29
27
|
let index = 0;
|
|
30
28
|
let k = cs.length;
|
|
@@ -40,9 +38,7 @@ function getNext(el, paren) {
|
|
|
40
38
|
return cs[index];
|
|
41
39
|
}
|
|
42
40
|
function getFront(el, paren) {
|
|
43
|
-
|
|
44
|
-
paren = el.parentElement || el;
|
|
45
|
-
}
|
|
41
|
+
paren ?? (paren = el.parentElement ?? el);
|
|
46
42
|
const cs = paren.childNodes;
|
|
47
43
|
let index = cs.length - 1;
|
|
48
44
|
let k = -1;
|
|
@@ -500,8 +496,8 @@ const vAdjust = {
|
|
|
500
496
|
if (value && Object.keys(value).length > 0) {
|
|
501
497
|
let getVobj = function(e) {
|
|
502
498
|
let is = true;
|
|
503
|
-
for (
|
|
504
|
-
const v =
|
|
499
|
+
for (const fun of arr) {
|
|
500
|
+
const v = fun(e, eps);
|
|
505
501
|
if (v) {
|
|
506
502
|
vobj = v;
|
|
507
503
|
isCur = true;
|
|
@@ -20,9 +20,7 @@ function getPosition(el) {
|
|
|
20
20
|
return obj;
|
|
21
21
|
}
|
|
22
22
|
function getNext(el, paren) {
|
|
23
|
-
|
|
24
|
-
paren = el.parentElement || el;
|
|
25
|
-
}
|
|
23
|
+
paren ?? (paren = el.parentElement ?? el);
|
|
26
24
|
const cs = paren.childNodes;
|
|
27
25
|
let index = 0;
|
|
28
26
|
let k = cs.length;
|
|
@@ -38,9 +36,7 @@ function getNext(el, paren) {
|
|
|
38
36
|
return cs[index];
|
|
39
37
|
}
|
|
40
38
|
function getFront(el, paren) {
|
|
41
|
-
|
|
42
|
-
paren = el.parentElement || el;
|
|
43
|
-
}
|
|
39
|
+
paren ?? (paren = el.parentElement ?? el);
|
|
44
40
|
const cs = paren.childNodes;
|
|
45
41
|
let index = cs.length - 1;
|
|
46
42
|
let k = -1;
|
|
@@ -498,8 +494,8 @@ const vAdjust = {
|
|
|
498
494
|
if (value && Object.keys(value).length > 0) {
|
|
499
495
|
let getVobj = function(e) {
|
|
500
496
|
let is = true;
|
|
501
|
-
for (
|
|
502
|
-
const v =
|
|
497
|
+
for (const fun of arr) {
|
|
498
|
+
const v = fun(e, eps);
|
|
503
499
|
if (v) {
|
|
504
500
|
vobj = v;
|
|
505
501
|
isCur = true;
|
|
@@ -28,7 +28,7 @@ function setDom(dom, el, value) {
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
const handleMouseMove = (event) => {
|
|
31
|
-
if (
|
|
31
|
+
if (value.often === void 0 || value.often) {
|
|
32
32
|
setValue(event);
|
|
33
33
|
}
|
|
34
34
|
if (value.onMouseMove) {
|
|
@@ -77,6 +77,11 @@ function setDom(dom, el, value) {
|
|
|
77
77
|
}
|
|
78
78
|
const vDrag = {
|
|
79
79
|
name: "Drag",
|
|
80
|
+
/**
|
|
81
|
+
* Vue指令的mounted钩子函数,用于在元素挂载时设置DOM相关属性
|
|
82
|
+
* @param el - 指令绑定的DOM元素
|
|
83
|
+
* @param binding - 指令绑定的相关信息对象
|
|
84
|
+
*/
|
|
80
85
|
mounted(el, binding) {
|
|
81
86
|
const value = binding.value;
|
|
82
87
|
let dom;
|
|
@@ -26,7 +26,7 @@ function setDom(dom, el, value) {
|
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
const handleMouseMove = (event) => {
|
|
29
|
-
if (
|
|
29
|
+
if (value.often === void 0 || value.often) {
|
|
30
30
|
setValue(event);
|
|
31
31
|
}
|
|
32
32
|
if (value.onMouseMove) {
|
|
@@ -75,6 +75,11 @@ function setDom(dom, el, value) {
|
|
|
75
75
|
}
|
|
76
76
|
const vDrag = {
|
|
77
77
|
name: "Drag",
|
|
78
|
+
/**
|
|
79
|
+
* Vue指令的mounted钩子函数,用于在元素挂载时设置DOM相关属性
|
|
80
|
+
* @param el - 指令绑定的DOM元素
|
|
81
|
+
* @param binding - 指令绑定的相关信息对象
|
|
82
|
+
*/
|
|
78
83
|
mounted(el, binding) {
|
|
79
84
|
const value = binding.value;
|
|
80
85
|
let dom;
|
|
@@ -3,6 +3,12 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const hasOwn = require("@fangzhongya/utils/basic/object/hasOwn");
|
|
4
4
|
const index = {
|
|
5
5
|
name: "expose",
|
|
6
|
+
/**
|
|
7
|
+
* Vue指令的created钩子函数,在指令绑定元素被创建时执行
|
|
8
|
+
* @param el 指令绑定的DOM元素
|
|
9
|
+
* @param binding 包含指令信息的绑定对象
|
|
10
|
+
* @param vnode 虚拟节点对象
|
|
11
|
+
*/
|
|
6
12
|
created(el, binding, vnode) {
|
|
7
13
|
var _a, _b, _c, _d;
|
|
8
14
|
if (!(binding == null ? void 0 : binding.instance)) return;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { hasOwn } from "@fangzhongya/utils/basic/object/hasOwn";
|
|
2
2
|
const index = {
|
|
3
3
|
name: "expose",
|
|
4
|
+
/**
|
|
5
|
+
* Vue指令的created钩子函数,在指令绑定元素被创建时执行
|
|
6
|
+
* @param el 指令绑定的DOM元素
|
|
7
|
+
* @param binding 包含指令信息的绑定对象
|
|
8
|
+
* @param vnode 虚拟节点对象
|
|
9
|
+
*/
|
|
4
10
|
created(el, binding, vnode) {
|
|
5
11
|
var _a, _b, _c, _d;
|
|
6
12
|
if (!(binding == null ? void 0 : binding.instance)) return;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vInserted = {
|
|
4
4
|
name: "inserted",
|
|
5
|
+
/**
|
|
6
|
+
* Vue指令的created钩子函数,在绑定元素被创建时执行
|
|
7
|
+
* @param el 指令绑定的DOM元素
|
|
8
|
+
* @param binding 包含指令相关信息的绑定对象
|
|
9
|
+
*/
|
|
5
10
|
created(el, binding) {
|
|
6
11
|
const value = binding.value;
|
|
7
12
|
let dom = el;
|
|
@@ -23,6 +23,11 @@ function setDom(el, value) {
|
|
|
23
23
|
}
|
|
24
24
|
const index = {
|
|
25
25
|
name: "Locus",
|
|
26
|
+
/**
|
|
27
|
+
* Vue指令的mounted钩子函数,在元素挂载到DOM时执行
|
|
28
|
+
* @param el - 指令绑定的DOM元素
|
|
29
|
+
* @param binding - 指令绑定的相关信息对象
|
|
30
|
+
*/
|
|
26
31
|
mounted(el, binding) {
|
|
27
32
|
const value = binding.value;
|
|
28
33
|
if (value) {
|
|
@@ -21,6 +21,11 @@ function setDom(el, value) {
|
|
|
21
21
|
}
|
|
22
22
|
const index = {
|
|
23
23
|
name: "Locus",
|
|
24
|
+
/**
|
|
25
|
+
* Vue指令的mounted钩子函数,在元素挂载到DOM时执行
|
|
26
|
+
* @param el - 指令绑定的DOM元素
|
|
27
|
+
* @param binding - 指令绑定的相关信息对象
|
|
28
|
+
*/
|
|
24
29
|
mounted(el, binding) {
|
|
25
30
|
const value = binding.value;
|
|
26
31
|
if (value) {
|
|
@@ -107,6 +107,11 @@ function createScrollHandler(scrollContainer, config, value) {
|
|
|
107
107
|
}
|
|
108
108
|
const vScroll = {
|
|
109
109
|
name: "scroll",
|
|
110
|
+
/**
|
|
111
|
+
* Vue指令的mounted钩子函数,用于初始化滚动相关的功能
|
|
112
|
+
* @param el - 指令绑定的DOM元素
|
|
113
|
+
* @param binding - 指令绑定的对象,包含value属性
|
|
114
|
+
*/
|
|
110
115
|
mounted(el, binding) {
|
|
111
116
|
const value = binding.value;
|
|
112
117
|
const config = parseConfig(el, value);
|
|
@@ -132,6 +137,11 @@ const vScroll = {
|
|
|
132
137
|
scrollContainer.removeEventListener("scroll", scrollHandler);
|
|
133
138
|
};
|
|
134
139
|
},
|
|
140
|
+
/**
|
|
141
|
+
* 组件卸载时的清理函数
|
|
142
|
+
*
|
|
143
|
+
* @param el - 需要清理的HTML元素
|
|
144
|
+
*/
|
|
135
145
|
unmounted(el) {
|
|
136
146
|
if (el._scrollCleanup) {
|
|
137
147
|
el._scrollCleanup();
|
|
@@ -105,6 +105,11 @@ function createScrollHandler(scrollContainer, config, value) {
|
|
|
105
105
|
}
|
|
106
106
|
const vScroll = {
|
|
107
107
|
name: "scroll",
|
|
108
|
+
/**
|
|
109
|
+
* Vue指令的mounted钩子函数,用于初始化滚动相关的功能
|
|
110
|
+
* @param el - 指令绑定的DOM元素
|
|
111
|
+
* @param binding - 指令绑定的对象,包含value属性
|
|
112
|
+
*/
|
|
108
113
|
mounted(el, binding) {
|
|
109
114
|
const value = binding.value;
|
|
110
115
|
const config = parseConfig(el, value);
|
|
@@ -130,6 +135,11 @@ const vScroll = {
|
|
|
130
135
|
scrollContainer.removeEventListener("scroll", scrollHandler);
|
|
131
136
|
};
|
|
132
137
|
},
|
|
138
|
+
/**
|
|
139
|
+
* 组件卸载时的清理函数
|
|
140
|
+
*
|
|
141
|
+
* @param el - 需要清理的HTML元素
|
|
142
|
+
*/
|
|
133
143
|
unmounted(el) {
|
|
134
144
|
if (el._scrollCleanup) {
|
|
135
145
|
el._scrollCleanup();
|
|
@@ -3,6 +3,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const Sortable = require("sortablejs");
|
|
4
4
|
const vSortable = {
|
|
5
5
|
name: "Sortable",
|
|
6
|
+
/**
|
|
7
|
+
* Vue指令的mounted钩子函数,用于初始化sortable功能
|
|
8
|
+
* @param el 指令绑定的DOM元素
|
|
9
|
+
* @param binding Vue指令绑定对象,包含value等属性
|
|
10
|
+
*/
|
|
6
11
|
mounted(el, binding) {
|
|
7
12
|
const value = binding.value;
|
|
8
13
|
let selector = el.getAttribute(`sortable-selector`);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import Sortable from "sortablejs";
|
|
2
2
|
const vSortable = {
|
|
3
3
|
name: "Sortable",
|
|
4
|
+
/**
|
|
5
|
+
* Vue指令的mounted钩子函数,用于初始化sortable功能
|
|
6
|
+
* @param el 指令绑定的DOM元素
|
|
7
|
+
* @param binding Vue指令绑定对象,包含value等属性
|
|
8
|
+
*/
|
|
4
9
|
mounted(el, binding) {
|
|
5
10
|
const value = binding.value;
|
|
6
11
|
let selector = el.getAttribute(`sortable-selector`);
|
|
@@ -5,12 +5,6 @@ const getShiftEvent = require("@fangzhongya/utils/dom/getShiftEvent");
|
|
|
5
5
|
const attrValueSort = require("@fangzhongya/utils/basic/object/attrValueSort");
|
|
6
6
|
function setDom(dom, el, value) {
|
|
7
7
|
if (dom) {
|
|
8
|
-
let getDirection = function(obj2) {
|
|
9
|
-
return attrValueSort.attrValueSort(
|
|
10
|
-
obj2,
|
|
11
|
-
value.directions || ["left", "right", "top", "bottom"]
|
|
12
|
-
)[0];
|
|
13
|
-
};
|
|
14
8
|
const obj = {
|
|
15
9
|
position: "fixed",
|
|
16
10
|
display: "flex",
|
|
@@ -23,6 +17,12 @@ function setDom(dom, el, value) {
|
|
|
23
17
|
obj[key] = "0";
|
|
24
18
|
obj["flex-direction"] = key == "left" || key == "right" ? "column" : "row";
|
|
25
19
|
setCss.setCss(el, obj);
|
|
20
|
+
const getDirection = (obj2) => {
|
|
21
|
+
return attrValueSort.attrValueSort(
|
|
22
|
+
obj2,
|
|
23
|
+
value.directions || ["left", "right", "top", "bottom"]
|
|
24
|
+
)[0];
|
|
25
|
+
};
|
|
26
26
|
const bodyStyle = document.body.style;
|
|
27
27
|
const cursor = bodyStyle.cursor;
|
|
28
28
|
const setValue = (event) => {
|
|
@@ -30,8 +30,8 @@ function setDom(dom, el, value) {
|
|
|
30
30
|
key = getDirection({
|
|
31
31
|
left: event.clientX,
|
|
32
32
|
top: event.clientY,
|
|
33
|
-
right:
|
|
34
|
-
bottom:
|
|
33
|
+
right: globalThis.innerWidth - event.clientX,
|
|
34
|
+
bottom: globalThis.innerHeight - event.clientY
|
|
35
35
|
});
|
|
36
36
|
setCss.setCss(el, {
|
|
37
37
|
[key]: "0",
|
|
@@ -61,6 +61,11 @@ function setDom(dom, el, value) {
|
|
|
61
61
|
}
|
|
62
62
|
const vStick = {
|
|
63
63
|
name: "Stick",
|
|
64
|
+
/**
|
|
65
|
+
* Vue指令的mounted钩子函数,用于在元素挂载时设置DOM相关属性
|
|
66
|
+
* @param el - 指令绑定的DOM元素
|
|
67
|
+
* @param binding - 指令绑定的相关信息对象
|
|
68
|
+
*/
|
|
64
69
|
mounted(el, binding) {
|
|
65
70
|
const value = binding.value;
|
|
66
71
|
let dom;
|