@fangzhongya/fang-ui 0.1.41 → 0.1.43
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/audios/src/index2.cjs +0 -1
- package/dist/components/audios/src/index2.js +0 -1
- package/dist/components/common/urls.cjs +0 -1
- package/dist/components/common/urls.js +0 -1
- package/dist/components/common/use.cjs +53 -48
- package/dist/components/common/use.d.ts +8 -7
- package/dist/components/common/use.js +53 -48
- package/dist/components/double/src/index2.cjs +0 -2
- package/dist/components/double/src/index2.js +0 -2
- package/dist/components/forms/src/index2.cjs +7 -2
- package/dist/components/forms/src/index2.js +7 -2
- package/dist/components/forms/src/setup.cjs +49 -38
- package/dist/components/forms/src/setup.d.ts +1 -0
- package/dist/components/forms/src/setup.js +50 -39
- package/dist/components/full-screen/src/index2.cjs +0 -1
- package/dist/components/full-screen/src/index2.js +0 -1
- package/dist/components/input-select/src/index2.cjs +1 -1
- package/dist/components/input-select/src/index2.js +1 -1
- package/dist/components/page/src/index2.cjs +0 -1
- package/dist/components/page/src/index2.js +0 -1
- package/dist/components/selects/src/index2.cjs +1 -4
- package/dist/components/selects/src/index2.js +1 -4
- package/dist/components/switchs/src/index2.cjs +2 -3
- package/dist/components/switchs/src/index2.js +2 -3
- package/dist/components/tables/common/pagin.cjs +0 -1
- package/dist/components/tables/common/pagin.js +0 -1
- package/dist/components/videos/src/index2.cjs +0 -1
- package/dist/components/videos/src/index2.js +0 -1
- package/dist/components/window/src/index2.cjs +0 -2
- package/dist/components/window/src/index2.js +0 -2
- package/dist/hooks/full-screen/index.cjs +0 -1
- package/dist/hooks/full-screen/index.js +0 -1
- package/dist/icons/index.json +1 -1
- package/dist/utils/css.cjs +1 -1
- package/dist/utils/css.js +1 -1
- package/package.json +4 -4
- /package/dist/components/{draggable → input-tag}/index.css +0 -0
- /package/dist/css/{draggable.css → input-tag.css} +0 -0
|
@@ -27,6 +27,17 @@ function useSetValue(v, key, value) {
|
|
|
27
27
|
}
|
|
28
28
|
return v;
|
|
29
29
|
}
|
|
30
|
+
function useHide(v, form) {
|
|
31
|
+
if (v == null ? void 0 : v.hide) {
|
|
32
|
+
if (typeof v.hide == "function") {
|
|
33
|
+
return v.hide(form, v);
|
|
34
|
+
} else {
|
|
35
|
+
return v.hide;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
30
41
|
function getFormRule(obj) {
|
|
31
42
|
const prop = obj.prop;
|
|
32
43
|
if (obj.orig) {
|
|
@@ -113,16 +124,51 @@ function setFormDefaultValue(obj, value) {
|
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
126
|
}
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
function setValue(value, obj, data) {
|
|
128
|
+
let v = util.getChildrenData(obj, data);
|
|
129
|
+
if (obj.orig) {
|
|
130
|
+
v = data ?? {};
|
|
131
|
+
}
|
|
132
|
+
const prop = obj.prop;
|
|
133
|
+
if (prop) {
|
|
134
|
+
if (v) {
|
|
135
|
+
if (obj.pars) {
|
|
136
|
+
objValue.setObjValue(v, prop, value);
|
|
137
|
+
} else {
|
|
138
|
+
v[prop] = value;
|
|
139
|
+
}
|
|
120
140
|
} else {
|
|
121
|
-
|
|
141
|
+
v = util.getChildrenData(obj, data, true);
|
|
142
|
+
if (obj.pars) {
|
|
143
|
+
objValue.setObjValue(v, prop, value);
|
|
144
|
+
} else {
|
|
145
|
+
v[prop] = value;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function getValue(obj, data, index) {
|
|
151
|
+
const prop = obj.prop;
|
|
152
|
+
const cdata = util.getChildrenData(obj, data);
|
|
153
|
+
let cellValue;
|
|
154
|
+
if (prop) {
|
|
155
|
+
if (obj.pars) {
|
|
156
|
+
cellValue = objValue.getObjValue(prop, cdata);
|
|
157
|
+
} else {
|
|
158
|
+
cellValue = cdata == null ? void 0 : cdata[prop];
|
|
122
159
|
}
|
|
123
160
|
} else {
|
|
124
|
-
|
|
161
|
+
cellValue = obj.value;
|
|
125
162
|
}
|
|
163
|
+
if (obj.formatter) {
|
|
164
|
+
return obj.formatter(data, obj, cellValue, index, cdata);
|
|
165
|
+
} else {
|
|
166
|
+
return cellValue ?? obj.default;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function getListObjValue(value, obj, data, index) {
|
|
170
|
+
const v = getValue(obj, data, index);
|
|
171
|
+
setValue(v, obj, value);
|
|
126
172
|
}
|
|
127
173
|
function getValueObjs(value, multiple, options, config) {
|
|
128
174
|
if (value !== void 0 && value !== null) {
|
|
@@ -167,48 +213,6 @@ function setOptionsValue(value, obj, data, options = {}) {
|
|
|
167
213
|
obj.config
|
|
168
214
|
);
|
|
169
215
|
}
|
|
170
|
-
function setValue(value, obj, data) {
|
|
171
|
-
let v = util.getChildrenData(obj, data);
|
|
172
|
-
if (obj.orig) {
|
|
173
|
-
v = data ?? {};
|
|
174
|
-
}
|
|
175
|
-
const prop = obj.prop;
|
|
176
|
-
if (prop) {
|
|
177
|
-
if (v) {
|
|
178
|
-
if (obj.pars) {
|
|
179
|
-
objValue.setObjValue(v, prop, value);
|
|
180
|
-
} else {
|
|
181
|
-
v[prop] = value;
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
v = util.getChildrenData(obj, data, true);
|
|
185
|
-
if (obj.pars) {
|
|
186
|
-
objValue.setObjValue(v, prop, value);
|
|
187
|
-
} else {
|
|
188
|
-
v[prop] = value;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
function getValue(obj, data, index) {
|
|
194
|
-
const prop = obj.prop;
|
|
195
|
-
const cdata = util.getChildrenData(obj, data);
|
|
196
|
-
let cellValue;
|
|
197
|
-
if (prop) {
|
|
198
|
-
if (obj.pars) {
|
|
199
|
-
cellValue = objValue.getObjValue(prop, cdata);
|
|
200
|
-
} else {
|
|
201
|
-
cellValue = cdata == null ? void 0 : cdata[prop];
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
cellValue = obj.value;
|
|
205
|
-
}
|
|
206
|
-
if (obj.formatter) {
|
|
207
|
-
return obj.formatter(data, obj, cellValue, index, cdata);
|
|
208
|
-
} else {
|
|
209
|
-
return cellValue ?? obj.default;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
216
|
function setComponString(value, obj, componObj, compons) {
|
|
213
217
|
const compon = obj.compon;
|
|
214
218
|
const tcom = lineToLargeHump.lineToLargeHump(compon);
|
|
@@ -472,6 +476,7 @@ function getLabelText(obj) {
|
|
|
472
476
|
exports.getComponObj = getComponObj;
|
|
473
477
|
exports.getFormRule = getFormRule;
|
|
474
478
|
exports.getLabelText = getLabelText;
|
|
479
|
+
exports.getListObjValue = getListObjValue;
|
|
475
480
|
exports.getOnObjs = getOnObjs;
|
|
476
481
|
exports.getVNodeContent = getVNodeContent;
|
|
477
482
|
exports.setFormDefaultValue = setFormDefaultValue;
|
|
@@ -14,6 +14,13 @@ export declare function useVueValue(v: any, key: string | Function): any;
|
|
|
14
14
|
* @returns 返回修改后的对象
|
|
15
15
|
*/
|
|
16
16
|
export declare function useSetValue(v: any, key: string | Function, value: any): any;
|
|
17
|
+
/**
|
|
18
|
+
* 判断列表对象是否应该隐藏
|
|
19
|
+
* @param v - 列表对象,可能包含hide属性
|
|
20
|
+
* @param form - 表单数据,可选参数,用于hide函数的计算
|
|
21
|
+
* @returns 返回是否隐藏的布尔值,如果v.hide是函数则执行函数返回结果,如果是布尔值则直接返回,否则返回false
|
|
22
|
+
*/
|
|
23
|
+
export declare function useHide(v: ListObj, form?: any): boolean;
|
|
17
24
|
/**
|
|
18
25
|
* 获取表单规则路径
|
|
19
26
|
* @param obj - 包含属性和父子关系的对象
|
|
@@ -26,13 +33,7 @@ export declare function getFormRule(obj: ListObj): string | undefined;
|
|
|
26
33
|
* @param value - 表单值对象,用于设置默认值的数据源
|
|
27
34
|
*/
|
|
28
35
|
export declare function setFormDefaultValue(obj: ListObj, value: ObjAny): void;
|
|
29
|
-
|
|
30
|
-
* 判断列表对象是否应该隐藏
|
|
31
|
-
* @param v - 列表对象,可能包含hide属性
|
|
32
|
-
* @param form - 表单数据,可选参数,用于hide函数的计算
|
|
33
|
-
* @returns 返回是否隐藏的布尔值,如果v.hide是函数则执行函数返回结果,如果是布尔值则直接返回,否则返回false
|
|
34
|
-
*/
|
|
35
|
-
export declare function useHide(v: ListObj, form?: any): boolean;
|
|
36
|
+
export declare function getListObjValue(value: ObjAny, obj: ListObj, data: ObjAny, index: number | number[]): void;
|
|
36
37
|
/**
|
|
37
38
|
* 获取事件处理对象集合
|
|
38
39
|
* @param obj - 包含事件配置的对象
|
|
@@ -25,6 +25,17 @@ function useSetValue(v, key, value) {
|
|
|
25
25
|
}
|
|
26
26
|
return v;
|
|
27
27
|
}
|
|
28
|
+
function useHide(v, form) {
|
|
29
|
+
if (v == null ? void 0 : v.hide) {
|
|
30
|
+
if (typeof v.hide == "function") {
|
|
31
|
+
return v.hide(form, v);
|
|
32
|
+
} else {
|
|
33
|
+
return v.hide;
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
28
39
|
function getFormRule(obj) {
|
|
29
40
|
const prop = obj.prop;
|
|
30
41
|
if (obj.orig) {
|
|
@@ -111,16 +122,51 @@ function setFormDefaultValue(obj, value) {
|
|
|
111
122
|
}
|
|
112
123
|
}
|
|
113
124
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
125
|
+
function setValue(value, obj, data) {
|
|
126
|
+
let v = getChildrenData(obj, data);
|
|
127
|
+
if (obj.orig) {
|
|
128
|
+
v = data ?? {};
|
|
129
|
+
}
|
|
130
|
+
const prop = obj.prop;
|
|
131
|
+
if (prop) {
|
|
132
|
+
if (v) {
|
|
133
|
+
if (obj.pars) {
|
|
134
|
+
setObjValue(v, prop, value);
|
|
135
|
+
} else {
|
|
136
|
+
v[prop] = value;
|
|
137
|
+
}
|
|
118
138
|
} else {
|
|
119
|
-
|
|
139
|
+
v = getChildrenData(obj, data, true);
|
|
140
|
+
if (obj.pars) {
|
|
141
|
+
setObjValue(v, prop, value);
|
|
142
|
+
} else {
|
|
143
|
+
v[prop] = value;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function getValue(obj, data, index) {
|
|
149
|
+
const prop = obj.prop;
|
|
150
|
+
const cdata = getChildrenData(obj, data);
|
|
151
|
+
let cellValue;
|
|
152
|
+
if (prop) {
|
|
153
|
+
if (obj.pars) {
|
|
154
|
+
cellValue = getObjValue(prop, cdata);
|
|
155
|
+
} else {
|
|
156
|
+
cellValue = cdata == null ? void 0 : cdata[prop];
|
|
120
157
|
}
|
|
121
158
|
} else {
|
|
122
|
-
|
|
159
|
+
cellValue = obj.value;
|
|
123
160
|
}
|
|
161
|
+
if (obj.formatter) {
|
|
162
|
+
return obj.formatter(data, obj, cellValue, index, cdata);
|
|
163
|
+
} else {
|
|
164
|
+
return cellValue ?? obj.default;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function getListObjValue(value, obj, data, index) {
|
|
168
|
+
const v = getValue(obj, data, index);
|
|
169
|
+
setValue(v, obj, value);
|
|
124
170
|
}
|
|
125
171
|
function getValueObjs(value, multiple, options, config) {
|
|
126
172
|
if (value !== void 0 && value !== null) {
|
|
@@ -165,48 +211,6 @@ function setOptionsValue(value, obj, data, options = {}) {
|
|
|
165
211
|
obj.config
|
|
166
212
|
);
|
|
167
213
|
}
|
|
168
|
-
function setValue(value, obj, data) {
|
|
169
|
-
let v = getChildrenData(obj, data);
|
|
170
|
-
if (obj.orig) {
|
|
171
|
-
v = data ?? {};
|
|
172
|
-
}
|
|
173
|
-
const prop = obj.prop;
|
|
174
|
-
if (prop) {
|
|
175
|
-
if (v) {
|
|
176
|
-
if (obj.pars) {
|
|
177
|
-
setObjValue(v, prop, value);
|
|
178
|
-
} else {
|
|
179
|
-
v[prop] = value;
|
|
180
|
-
}
|
|
181
|
-
} else {
|
|
182
|
-
v = getChildrenData(obj, data, true);
|
|
183
|
-
if (obj.pars) {
|
|
184
|
-
setObjValue(v, prop, value);
|
|
185
|
-
} else {
|
|
186
|
-
v[prop] = value;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function getValue(obj, data, index) {
|
|
192
|
-
const prop = obj.prop;
|
|
193
|
-
const cdata = getChildrenData(obj, data);
|
|
194
|
-
let cellValue;
|
|
195
|
-
if (prop) {
|
|
196
|
-
if (obj.pars) {
|
|
197
|
-
cellValue = getObjValue(prop, cdata);
|
|
198
|
-
} else {
|
|
199
|
-
cellValue = cdata == null ? void 0 : cdata[prop];
|
|
200
|
-
}
|
|
201
|
-
} else {
|
|
202
|
-
cellValue = obj.value;
|
|
203
|
-
}
|
|
204
|
-
if (obj.formatter) {
|
|
205
|
-
return obj.formatter(data, obj, cellValue, index, cdata);
|
|
206
|
-
} else {
|
|
207
|
-
return cellValue ?? obj.default;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
214
|
function setComponString(value, obj, componObj, compons) {
|
|
211
215
|
const compon = obj.compon;
|
|
212
216
|
const tcom = lineToLargeHump(compon);
|
|
@@ -471,6 +475,7 @@ export {
|
|
|
471
475
|
getComponObj,
|
|
472
476
|
getFormRule,
|
|
473
477
|
getLabelText,
|
|
478
|
+
getListObjValue,
|
|
474
479
|
getOnObjs,
|
|
475
480
|
getVNodeContent,
|
|
476
481
|
setFormDefaultValue,
|
|
@@ -202,9 +202,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
202
202
|
}
|
|
203
203
|
vue.onMounted(() => {
|
|
204
204
|
if (globalThis) {
|
|
205
|
-
console.log("onMounted");
|
|
206
205
|
globalThis.addEventListener("click", () => {
|
|
207
|
-
console.log("click");
|
|
208
206
|
isfocus.value = false;
|
|
209
207
|
});
|
|
210
208
|
}
|
|
@@ -39,7 +39,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
39
|
resetFields,
|
|
40
40
|
closeForm,
|
|
41
41
|
dataForm,
|
|
42
|
-
validate
|
|
42
|
+
validate,
|
|
43
|
+
getListValue
|
|
43
44
|
} = setup.setUp(props, emit, cs, refForm, getLocale);
|
|
44
45
|
function setKey(value, index2) {
|
|
45
46
|
return [index2, value.label, value.prop, value.compon].join(",");
|
|
@@ -71,7 +72,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
71
72
|
* @expose { [Promise] Promise对象true成功false失败 } validate
|
|
72
73
|
* 校验表单
|
|
73
74
|
*/
|
|
74
|
-
validate
|
|
75
|
+
validate,
|
|
76
|
+
getListValue,
|
|
77
|
+
getValue() {
|
|
78
|
+
return dataForm.value;
|
|
79
|
+
}
|
|
75
80
|
});
|
|
76
81
|
return (_ctx, _cache) => {
|
|
77
82
|
return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
@@ -37,7 +37,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
resetFields,
|
|
38
38
|
closeForm,
|
|
39
39
|
dataForm,
|
|
40
|
-
validate
|
|
40
|
+
validate,
|
|
41
|
+
getListValue
|
|
41
42
|
} = setUp(props, emit, cs, refForm, getLocale);
|
|
42
43
|
function setKey(value, index) {
|
|
43
44
|
return [index, value.label, value.prop, value.compon].join(",");
|
|
@@ -69,7 +70,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
70
|
* @expose { [Promise] Promise对象true成功false失败 } validate
|
|
70
71
|
* 校验表单
|
|
71
72
|
*/
|
|
72
|
-
validate
|
|
73
|
+
validate,
|
|
74
|
+
getListValue,
|
|
75
|
+
getValue() {
|
|
76
|
+
return dataForm.value;
|
|
77
|
+
}
|
|
73
78
|
});
|
|
74
79
|
return (_ctx, _cache) => {
|
|
75
80
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
@@ -83,19 +83,39 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
83
83
|
}
|
|
84
84
|
return setObjStyle.setObjStyle(vst, obj);
|
|
85
85
|
}
|
|
86
|
+
const setListValue = (arr, listobj, callback) => {
|
|
87
|
+
arr == null ? void 0 : arr.forEach((obj) => {
|
|
88
|
+
if (listobj) {
|
|
89
|
+
obj.father = obj.father ?? listobj;
|
|
90
|
+
}
|
|
91
|
+
if (obj.children) {
|
|
92
|
+
setListValue(obj.children, obj, callback);
|
|
93
|
+
}
|
|
94
|
+
use.setFormDefaultValue(obj, dataForm.value);
|
|
95
|
+
if (callback) {
|
|
96
|
+
callback(obj);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
86
100
|
function setReset() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
setListValue(props.list);
|
|
102
|
+
}
|
|
103
|
+
function getListValue() {
|
|
104
|
+
const value = {};
|
|
105
|
+
const data2 = dataForm.value;
|
|
106
|
+
const getValue = (arr, indexs) => {
|
|
107
|
+
arr == null ? void 0 : arr.forEach((obj, index2) => {
|
|
108
|
+
const indss = [...indexs, index2];
|
|
109
|
+
if (obj.prop) {
|
|
110
|
+
use.getListObjValue(value, obj, data2, indss);
|
|
91
111
|
}
|
|
92
112
|
if (obj.children) {
|
|
93
|
-
|
|
113
|
+
getValue(obj.children, indss);
|
|
94
114
|
}
|
|
95
|
-
use.setFormDefaultValue(obj, dataForm.value);
|
|
96
115
|
});
|
|
97
116
|
};
|
|
98
|
-
|
|
117
|
+
getValue(props.list, []);
|
|
118
|
+
return value;
|
|
99
119
|
}
|
|
100
120
|
const triggerMap = {
|
|
101
121
|
blur: getLocale("form.import"),
|
|
@@ -104,37 +124,27 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
104
124
|
};
|
|
105
125
|
function getRules() {
|
|
106
126
|
const rules = {};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
util.
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const p = use.getFormRule(obj) ?? obj.prop;
|
|
126
|
-
obj.__prop = p;
|
|
127
|
-
if (obj.rules) {
|
|
128
|
-
rules[p] = obj.rules;
|
|
129
|
-
} else if (obj.rule) {
|
|
130
|
-
rules[p] = util.getRule(obj, dataForm, refForm, triggerMap);
|
|
131
|
-
} else {
|
|
132
|
-
rules[p] = [];
|
|
133
|
-
}
|
|
127
|
+
setListValue(props.list, void 0, (obj) => {
|
|
128
|
+
var _a;
|
|
129
|
+
obj.config = obj.config ?? {};
|
|
130
|
+
if (((_a = obj.config) == null ? void 0 : _a.clearable) === void 0) {
|
|
131
|
+
obj.config.clearable = true;
|
|
132
|
+
}
|
|
133
|
+
if (!obj.rule) {
|
|
134
|
+
util.setPlaceholder(obj, triggerMap);
|
|
135
|
+
}
|
|
136
|
+
if (obj.prop) {
|
|
137
|
+
const p = use.getFormRule(obj) ?? obj.prop;
|
|
138
|
+
obj.__prop = p;
|
|
139
|
+
if (obj.rules) {
|
|
140
|
+
rules[p] = obj.rules;
|
|
141
|
+
} else if (obj.rule) {
|
|
142
|
+
rules[p] = util.getRule(obj, dataForm, refForm, triggerMap);
|
|
143
|
+
} else {
|
|
144
|
+
rules[p] = [];
|
|
134
145
|
}
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
setListValue(props.list);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
138
148
|
return rules;
|
|
139
149
|
}
|
|
140
150
|
const dataRules = vue.ref(getRules());
|
|
@@ -217,7 +227,8 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
217
227
|
validateField,
|
|
218
228
|
resetFields,
|
|
219
229
|
closeForm,
|
|
220
|
-
validate
|
|
230
|
+
validate,
|
|
231
|
+
getListValue
|
|
221
232
|
};
|
|
222
233
|
}
|
|
223
234
|
exports.setUp = setUp;
|
|
@@ -2,7 +2,7 @@ import { dataHandle } from "./data.js";
|
|
|
2
2
|
import { provides } from "../common/config.js";
|
|
3
3
|
import { setPlaceholder, getRule } from "./util.js";
|
|
4
4
|
import "../../../utils/css.js";
|
|
5
|
-
import { setFormDefaultValue, getFormRule } from "../../common/use.js";
|
|
5
|
+
import { setFormDefaultValue, getListObjValue, getFormRule } from "../../common/use.js";
|
|
6
6
|
import { computed, provide, isProxy, ref, watch } from "vue";
|
|
7
7
|
import { useCompons } from "../../../hooks/compons/index.js";
|
|
8
8
|
import { FormsItems } from "../../forms-items/index.js";
|
|
@@ -81,19 +81,39 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
81
81
|
}
|
|
82
82
|
return setObjStyle(vst, obj);
|
|
83
83
|
}
|
|
84
|
+
const setListValue = (arr, listobj, callback) => {
|
|
85
|
+
arr == null ? void 0 : arr.forEach((obj) => {
|
|
86
|
+
if (listobj) {
|
|
87
|
+
obj.father = obj.father ?? listobj;
|
|
88
|
+
}
|
|
89
|
+
if (obj.children) {
|
|
90
|
+
setListValue(obj.children, obj, callback);
|
|
91
|
+
}
|
|
92
|
+
setFormDefaultValue(obj, dataForm.value);
|
|
93
|
+
if (callback) {
|
|
94
|
+
callback(obj);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
};
|
|
84
98
|
function setReset() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
setListValue(props.list);
|
|
100
|
+
}
|
|
101
|
+
function getListValue() {
|
|
102
|
+
const value = {};
|
|
103
|
+
const data = dataForm.value;
|
|
104
|
+
const getValue = (arr, indexs) => {
|
|
105
|
+
arr == null ? void 0 : arr.forEach((obj, index) => {
|
|
106
|
+
const indss = [...indexs, index];
|
|
107
|
+
if (obj.prop) {
|
|
108
|
+
getListObjValue(value, obj, data, indss);
|
|
89
109
|
}
|
|
90
110
|
if (obj.children) {
|
|
91
|
-
|
|
111
|
+
getValue(obj.children, indss);
|
|
92
112
|
}
|
|
93
|
-
setFormDefaultValue(obj, dataForm.value);
|
|
94
113
|
});
|
|
95
114
|
};
|
|
96
|
-
|
|
115
|
+
getValue(props.list, []);
|
|
116
|
+
return value;
|
|
97
117
|
}
|
|
98
118
|
const triggerMap = {
|
|
99
119
|
blur: getLocale("form.import"),
|
|
@@ -102,37 +122,27 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
102
122
|
};
|
|
103
123
|
function getRules() {
|
|
104
124
|
const rules = {};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const p = getFormRule(obj) ?? obj.prop;
|
|
124
|
-
obj.__prop = p;
|
|
125
|
-
if (obj.rules) {
|
|
126
|
-
rules[p] = obj.rules;
|
|
127
|
-
} else if (obj.rule) {
|
|
128
|
-
rules[p] = getRule(obj, dataForm, refForm, triggerMap);
|
|
129
|
-
} else {
|
|
130
|
-
rules[p] = [];
|
|
131
|
-
}
|
|
125
|
+
setListValue(props.list, void 0, (obj) => {
|
|
126
|
+
var _a;
|
|
127
|
+
obj.config = obj.config ?? {};
|
|
128
|
+
if (((_a = obj.config) == null ? void 0 : _a.clearable) === void 0) {
|
|
129
|
+
obj.config.clearable = true;
|
|
130
|
+
}
|
|
131
|
+
if (!obj.rule) {
|
|
132
|
+
setPlaceholder(obj, triggerMap);
|
|
133
|
+
}
|
|
134
|
+
if (obj.prop) {
|
|
135
|
+
const p = getFormRule(obj) ?? obj.prop;
|
|
136
|
+
obj.__prop = p;
|
|
137
|
+
if (obj.rules) {
|
|
138
|
+
rules[p] = obj.rules;
|
|
139
|
+
} else if (obj.rule) {
|
|
140
|
+
rules[p] = getRule(obj, dataForm, refForm, triggerMap);
|
|
141
|
+
} else {
|
|
142
|
+
rules[p] = [];
|
|
132
143
|
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
setListValue(props.list);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
136
146
|
return rules;
|
|
137
147
|
}
|
|
138
148
|
const dataRules = ref(getRules());
|
|
@@ -215,7 +225,8 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
215
225
|
validateField,
|
|
216
226
|
resetFields,
|
|
217
227
|
closeForm,
|
|
218
|
-
validate
|
|
228
|
+
validate,
|
|
229
|
+
getListValue
|
|
219
230
|
};
|
|
220
231
|
}
|
|
221
232
|
export {
|
|
@@ -19,7 +19,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
19
19
|
const emit = __emit;
|
|
20
20
|
const domRef = vue.ref();
|
|
21
21
|
const { isFullscreen, toggle } = index$3.useFullscreen();
|
|
22
|
-
console.log("isFullscreen", isFullscreen);
|
|
23
22
|
const onClick = () => {
|
|
24
23
|
if (props.isBody) {
|
|
25
24
|
toggle();
|
|
@@ -17,7 +17,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
const emit = __emit;
|
|
18
18
|
const domRef = ref();
|
|
19
19
|
const { isFullscreen, toggle } = useFullscreen();
|
|
20
|
-
console.log("isFullscreen", isFullscreen);
|
|
21
20
|
const onClick = () => {
|
|
22
21
|
if (props.isBody) {
|
|
23
22
|
toggle();
|
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
42
42
|
const options = vue.computed(() => {
|
|
43
43
|
if (props.filterable && value.value && isFiletr.value) {
|
|
44
44
|
return props.options.filter((o) => {
|
|
45
|
-
return (use.useVueValue(o, props.prop)
|
|
45
|
+
return String(use.useVueValue(o, props.prop) ?? "").includes(
|
|
46
46
|
value.value || ""
|
|
47
47
|
);
|
|
48
48
|
});
|
|
@@ -40,7 +40,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
40
|
const options = computed(() => {
|
|
41
41
|
if (props.filterable && value.value && isFiletr.value) {
|
|
42
42
|
return props.options.filter((o) => {
|
|
43
|
-
return (useVueValue(o, props.prop)
|
|
43
|
+
return String(useVueValue(o, props.prop) ?? "").includes(
|
|
44
44
|
value.value || ""
|
|
45
45
|
);
|
|
46
46
|
});
|
|
@@ -417,7 +417,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
const handleOperation = (type, data2, operationName) => {
|
|
420
|
-
console.log(operationName, data2);
|
|
421
420
|
const operationConfig = type === "add" ? props.config.add : props.config.edit;
|
|
422
421
|
const ajax = operationConfig == null ? void 0 : operationConfig.ajax;
|
|
423
422
|
if (ajax) {
|
|
@@ -415,7 +415,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
417
|
const handleOperation = (type, data, operationName) => {
|
|
418
|
-
console.log(operationName, data);
|
|
419
418
|
const operationConfig = type === "add" ? props.config.add : props.config.edit;
|
|
420
419
|
const ajax = operationConfig == null ? void 0 : operationConfig.ajax;
|
|
421
420
|
if (ajax) {
|
|
@@ -50,10 +50,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
50
50
|
emit("click-multiple", listFuObj.getValueObjs(v)[0], is);
|
|
51
51
|
};
|
|
52
52
|
const isOptionsEmpty = vue.computed(() => {
|
|
53
|
-
|
|
54
|
-
return use.useVueValue(o, props.prop) === "";
|
|
55
|
-
});
|
|
56
|
-
return arr.length > 0;
|
|
53
|
+
return props.options.some((o) => use.useVueValue(o, props.prop) === "");
|
|
57
54
|
});
|
|
58
55
|
const setEmptyFun = () => {
|
|
59
56
|
setValue = (item) => {
|
|
@@ -48,10 +48,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
48
48
|
emit("click-multiple", listFuObj.getValueObjs(v)[0], is);
|
|
49
49
|
};
|
|
50
50
|
const isOptionsEmpty = computed(() => {
|
|
51
|
-
|
|
52
|
-
return useVueValue(o, props.prop) === "";
|
|
53
|
-
});
|
|
54
|
-
return arr.length > 0;
|
|
51
|
+
return props.options.some((o) => useVueValue(o, props.prop) === "");
|
|
55
52
|
});
|
|
56
53
|
const setEmptyFun = () => {
|
|
57
54
|
setValue = (item) => {
|
|
@@ -67,7 +67,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
67
67
|
for (let k in inactive.value) {
|
|
68
68
|
obj["inactive-" + k] = inactive.value[k];
|
|
69
69
|
}
|
|
70
|
-
console.log("obj", obj);
|
|
71
70
|
return obj;
|
|
72
71
|
});
|
|
73
72
|
const value = vue.computed({
|
|
@@ -84,9 +83,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
84
83
|
}
|
|
85
84
|
emit("update:modelValue", value2);
|
|
86
85
|
if (props.optobj) {
|
|
87
|
-
const obj = props.options.
|
|
86
|
+
const obj = props.options.find((o) => {
|
|
88
87
|
return use.useVueValue(o, props.prop) === value2;
|
|
89
|
-
})
|
|
88
|
+
});
|
|
90
89
|
emit("change", value2, obj);
|
|
91
90
|
} else {
|
|
92
91
|
emit("change", value2);
|
|
@@ -65,7 +65,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
for (let k in inactive.value) {
|
|
66
66
|
obj["inactive-" + k] = inactive.value[k];
|
|
67
67
|
}
|
|
68
|
-
console.log("obj", obj);
|
|
69
68
|
return obj;
|
|
70
69
|
});
|
|
71
70
|
const value = computed({
|
|
@@ -82,9 +81,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
82
81
|
}
|
|
83
82
|
emit("update:modelValue", value2);
|
|
84
83
|
if (props.optobj) {
|
|
85
|
-
const obj = props.options.
|
|
84
|
+
const obj = props.options.find((o) => {
|
|
86
85
|
return useVueValue(o, props.prop) === value2;
|
|
87
|
-
})
|
|
86
|
+
});
|
|
88
87
|
emit("change", value2, obj);
|
|
89
88
|
} else {
|
|
90
89
|
emit("change", value2);
|
|
@@ -262,7 +262,6 @@ const useInit = (props2, emit, refTable, getLocale, defaultConfig = {}) => {
|
|
|
262
262
|
});
|
|
263
263
|
function setCrossPage() {
|
|
264
264
|
const v = data.current;
|
|
265
|
-
console.log("v", v);
|
|
266
265
|
crossPageData.value[v] = refTable.value.getSelections();
|
|
267
266
|
console.log("crossPageData", crossPageData);
|
|
268
267
|
}
|
|
@@ -260,7 +260,6 @@ const useInit = (props2, emit, refTable, getLocale, defaultConfig = {}) => {
|
|
|
260
260
|
});
|
|
261
261
|
function setCrossPage() {
|
|
262
262
|
const v = data.current;
|
|
263
|
-
console.log("v", v);
|
|
264
263
|
crossPageData.value[v] = refTable.value.getSelections();
|
|
265
264
|
console.log("crossPageData", crossPageData);
|
|
266
265
|
}
|
|
@@ -121,7 +121,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
121
121
|
const onChangeSlider = () => {
|
|
122
122
|
if (videoRef.value) {
|
|
123
123
|
const v = slider.value * duration.value / 100;
|
|
124
|
-
console.log("v", v);
|
|
125
124
|
videoRef.value.currentTime = v;
|
|
126
125
|
}
|
|
127
126
|
isMouse.value = true;
|
|
@@ -119,7 +119,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
119
119
|
const onChangeSlider = () => {
|
|
120
120
|
if (videoRef.value) {
|
|
121
121
|
const v = slider.value * duration.value / 100;
|
|
122
|
-
console.log("v", v);
|
|
123
122
|
videoRef.value.currentTime = v;
|
|
124
123
|
}
|
|
125
124
|
isMouse.value = true;
|
|
@@ -44,7 +44,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
44
|
vue.watch(
|
|
45
45
|
() => props.modelValue,
|
|
46
46
|
() => {
|
|
47
|
-
console.log("props.modelValue", props.modelValue);
|
|
48
47
|
if (props.modelValue) {
|
|
49
48
|
isClose.value = false;
|
|
50
49
|
isMin.value = false;
|
|
@@ -121,7 +120,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
121
120
|
setCss.setCss(refBox.value, "display", "block");
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
|
-
console.log("isClose", isClose);
|
|
125
123
|
}
|
|
126
124
|
function setMax() {
|
|
127
125
|
if (refBody.value) {
|
|
@@ -42,7 +42,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
watch(
|
|
43
43
|
() => props.modelValue,
|
|
44
44
|
() => {
|
|
45
|
-
console.log("props.modelValue", props.modelValue);
|
|
46
45
|
if (props.modelValue) {
|
|
47
46
|
isClose.value = false;
|
|
48
47
|
isMin.value = false;
|
|
@@ -119,7 +118,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
119
118
|
setCss(refBox.value, "display", "block");
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
|
-
console.log("isClose", isClose);
|
|
123
121
|
}
|
|
124
122
|
function setMax() {
|
|
125
123
|
if (refBody.value) {
|
|
@@ -5,7 +5,6 @@ function useFullscreen() {
|
|
|
5
5
|
const isFullscreen = vue.ref(false);
|
|
6
6
|
const target = vue.ref(null);
|
|
7
7
|
const onFullscreenChange = () => {
|
|
8
|
-
console.log("onFullscreenChange");
|
|
9
8
|
if (!document.fullscreenElement && //@ts-ignore
|
|
10
9
|
!document.mozFullScreenElement && //@ts-ignore
|
|
11
10
|
!document.webkitFullscreenElement && //@ts-ignore
|
|
@@ -3,7 +3,6 @@ function useFullscreen() {
|
|
|
3
3
|
const isFullscreen = ref(false);
|
|
4
4
|
const target = ref(null);
|
|
5
5
|
const onFullscreenChange = () => {
|
|
6
|
-
console.log("onFullscreenChange");
|
|
7
6
|
if (!document.fullscreenElement && //@ts-ignore
|
|
8
7
|
!document.mozFullScreenElement && //@ts-ignore
|
|
9
8
|
!document.webkitFullscreenElement && //@ts-ignore
|
package/dist/icons/index.json
CHANGED
package/dist/utils/css.cjs
CHANGED
|
@@ -3,7 +3,7 @@ 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
5
|
function getCssNumber(str = "") {
|
|
6
|
-
return Number(String(str).replaceAll(/[^0-9.-]/g, ""));
|
|
6
|
+
return Number(String(str ?? "").replaceAll(/[^0-9.-]/g, ""));
|
|
7
7
|
}
|
|
8
8
|
Object.defineProperty(exports, "setObjStyle", {
|
|
9
9
|
enumerable: true,
|
package/dist/utils/css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setObjStyle } from "@fangzhongya/utils/css/setObjStyle";
|
|
2
2
|
import { getCss } from "@fangzhongya/utils/css/getCss";
|
|
3
3
|
function getCssNumber(str = "") {
|
|
4
|
-
return Number(String(str).replaceAll(/[^0-9.-]/g, ""));
|
|
4
|
+
return Number(String(str ?? "").replaceAll(/[^0-9.-]/g, ""));
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
7
|
getCss,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fangzhongya/fang-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.43",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "fang-ui",
|
|
7
7
|
"keywords": [
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"vue": "^3.5.25",
|
|
51
51
|
"vue-tsc": "^3.1.5",
|
|
52
52
|
"vxe-table": "4.6.20",
|
|
53
|
-
"@fang-ui/components": "0.0.1-0",
|
|
54
53
|
"@fang-ui/directives": "0.0.1-0",
|
|
54
|
+
"@fang-ui/components": "0.0.1-0",
|
|
55
55
|
"@fang-ui/hooks": "0.0.1-0",
|
|
56
56
|
"@fang-ui/locale": "0.0.1-0",
|
|
57
|
-
"@fang-ui/
|
|
57
|
+
"@fang-ui/icons": "0.0.1-0",
|
|
58
58
|
"@fang-ui/theme": "0.0.1-0",
|
|
59
59
|
"@fang-ui/types": "0.0.1-0",
|
|
60
|
-
"@fang-ui/
|
|
60
|
+
"@fang-ui/utils": "0.0.1-0"
|
|
61
61
|
},
|
|
62
62
|
"main": "./dist/index.cjs",
|
|
63
63
|
"module": "./dist/index.js",
|
|
File without changes
|
|
File without changes
|