@fangzhongya/fang-ui 0.1.39 → 0.1.41
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/use.cjs +148 -101
- package/dist/components/common/use.d.ts +26 -6
- package/dist/components/common/use.js +149 -102
- 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.js +9 -12
- package/dist/components/forms/src/util.cjs +6 -8
- package/dist/components/forms/src/util.js +6 -8
- 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/index.css +49 -0
- 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 -1
- package/dist/components/forms-item/src/label.d.ts +40 -1
- package/dist/components/forms-item/src/label.js +7 -1
- package/dist/components/forms-items/index.css +18 -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 +4 -8
- package/dist/components/list/src/index2.js +4 -8
- package/dist/components/list/src/util.cjs +7 -5
- package/dist/components/list/src/util.d.ts +29 -1
- package/dist/components/list/src/util.js +7 -5
- 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 +6 -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 +2 -4
- package/dist/components/tables/common/util.js +2 -4
- package/dist/components/tables/src/column.cjs +11 -3
- package/dist/components/tables/src/column.d.ts +29 -0
- package/dist/components/tables/src/column.js +11 -3
- 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 +2 -2
- package/dist/components/tables/src/index2.js +2 -2
- package/dist/components/tablesv/src/column.cjs +11 -3
- package/dist/components/tablesv/src/column.d.ts +25 -0
- package/dist/components/tablesv/src/column.js +11 -3
- 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 +2 -2
- package/dist/components/tablesv/src/index2.js +2 -2
- 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-item.css +49 -0
- package/dist/css/forms-items.css +18 -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/type.d.ts +8 -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 +3 -3
|
@@ -90,17 +90,26 @@ function handleComputedWithoutDefault(obj, v) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
function setFormDefaultValue(obj, value) {
|
|
93
|
-
let v = util.getChildrenData(obj, value
|
|
93
|
+
let v = util.getChildrenData(obj, value);
|
|
94
94
|
if (obj.orig) {
|
|
95
|
-
v = value;
|
|
95
|
+
v = value ?? {};
|
|
96
96
|
}
|
|
97
97
|
setComputed(obj, v);
|
|
98
98
|
const prop = obj.prop;
|
|
99
99
|
if (prop) {
|
|
100
|
-
if (
|
|
101
|
-
|
|
100
|
+
if (v) {
|
|
101
|
+
if (obj.pars) {
|
|
102
|
+
objValue.setObjValue(v, prop, objValue.getObjValue(prop, v) ?? obj.default);
|
|
103
|
+
} else {
|
|
104
|
+
v[prop] = v[prop] ?? obj.default;
|
|
105
|
+
}
|
|
102
106
|
} else {
|
|
103
|
-
v
|
|
107
|
+
v = util.getChildrenData(obj, value, true);
|
|
108
|
+
if (obj.pars) {
|
|
109
|
+
objValue.setObjValue(v, prop, objValue.getObjValue(prop, v) ?? obj.default);
|
|
110
|
+
} else {
|
|
111
|
+
v[prop] = v[prop] ?? obj.default;
|
|
112
|
+
}
|
|
104
113
|
}
|
|
105
114
|
}
|
|
106
115
|
}
|
|
@@ -150,48 +159,46 @@ function getValueObjs(value, multiple, options, config) {
|
|
|
150
159
|
return value;
|
|
151
160
|
}
|
|
152
161
|
}
|
|
153
|
-
function setOptionsValue(value, obj, data,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
options = value2(optionss, value2, obj, data) || [];
|
|
161
|
-
} else {
|
|
162
|
-
options = value2 || [];
|
|
163
|
-
}
|
|
164
|
-
} else if (typeof opt == "function") {
|
|
165
|
-
options = opt(optionss, value, obj, data) || [];
|
|
166
|
-
} else {
|
|
167
|
-
options = opt || [];
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return getValueObjs(value, obj.multiple, options, obj.config);
|
|
162
|
+
function setOptionsValue(value, obj, data, options = {}) {
|
|
163
|
+
return getValueObjs(
|
|
164
|
+
value,
|
|
165
|
+
obj.multiple,
|
|
166
|
+
processOptions(value, obj, data, options),
|
|
167
|
+
obj.config
|
|
168
|
+
);
|
|
171
169
|
}
|
|
172
170
|
function setValue(value, obj, data) {
|
|
173
|
-
let v = util.getChildrenData(obj, data)
|
|
171
|
+
let v = util.getChildrenData(obj, data);
|
|
174
172
|
if (obj.orig) {
|
|
175
173
|
v = data ?? {};
|
|
176
174
|
}
|
|
177
175
|
const prop = obj.prop;
|
|
178
176
|
if (prop) {
|
|
179
|
-
if (
|
|
180
|
-
|
|
177
|
+
if (v) {
|
|
178
|
+
if (obj.pars) {
|
|
179
|
+
objValue.setObjValue(v, prop, value);
|
|
180
|
+
} else {
|
|
181
|
+
v[prop] = value;
|
|
182
|
+
}
|
|
181
183
|
} else {
|
|
182
|
-
v
|
|
184
|
+
v = util.getChildrenData(obj, data, true);
|
|
185
|
+
if (obj.pars) {
|
|
186
|
+
objValue.setObjValue(v, prop, value);
|
|
187
|
+
} else {
|
|
188
|
+
v[prop] = value;
|
|
189
|
+
}
|
|
183
190
|
}
|
|
184
191
|
}
|
|
185
192
|
}
|
|
186
193
|
function getValue(obj, data, index) {
|
|
187
194
|
const prop = obj.prop;
|
|
188
|
-
const cdata = util.getChildrenData(obj, data
|
|
195
|
+
const cdata = util.getChildrenData(obj, data);
|
|
189
196
|
let cellValue;
|
|
190
197
|
if (prop) {
|
|
191
198
|
if (obj.pars) {
|
|
192
199
|
cellValue = objValue.getObjValue(prop, cdata);
|
|
193
200
|
} else {
|
|
194
|
-
cellValue = cdata[prop];
|
|
201
|
+
cellValue = cdata == null ? void 0 : cdata[prop];
|
|
195
202
|
}
|
|
196
203
|
} else {
|
|
197
204
|
cellValue = obj.value;
|
|
@@ -202,36 +209,51 @@ function getValue(obj, data, index) {
|
|
|
202
209
|
return cellValue ?? obj.default;
|
|
203
210
|
}
|
|
204
211
|
}
|
|
205
|
-
function setComponString(value, obj, componObj,
|
|
206
|
-
processOptions(obj, componObj, optionss, value, data);
|
|
212
|
+
function setComponString(value, obj, componObj, compons) {
|
|
207
213
|
const compon = obj.compon;
|
|
208
214
|
const tcom = lineToLargeHump.lineToLargeHump(compon);
|
|
209
|
-
return renderComponent(tcom, compon, componObj, value, compons);
|
|
215
|
+
return renderComponent(obj, tcom, compon, componObj, value, compons);
|
|
210
216
|
}
|
|
211
|
-
function processOptions(
|
|
212
|
-
if (!(obj == null ? void 0 : obj.options)) return;
|
|
213
|
-
let
|
|
217
|
+
function processOptions(value, obj, data, options) {
|
|
218
|
+
if (!(obj == null ? void 0 : obj.options)) return [];
|
|
219
|
+
let option = [];
|
|
214
220
|
const opt = obj.options;
|
|
215
221
|
if (typeof opt === "string") {
|
|
216
|
-
const optionsvalue =
|
|
217
|
-
|
|
222
|
+
const optionsvalue = options[opt];
|
|
223
|
+
option = typeof optionsvalue == "function" ? optionsvalue(options, value, obj, data) || [] : optionsvalue || [];
|
|
218
224
|
} else if (typeof opt == "function") {
|
|
219
|
-
|
|
225
|
+
option = opt(options, value, obj, data) || [];
|
|
220
226
|
} else {
|
|
221
|
-
|
|
227
|
+
option = opt || [];
|
|
222
228
|
}
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
return option;
|
|
230
|
+
}
|
|
231
|
+
function setSlots(obj) {
|
|
232
|
+
const slots = obj.slots;
|
|
233
|
+
if (vue.isVNode(slots)) {
|
|
234
|
+
return {
|
|
235
|
+
default: () => slots
|
|
236
|
+
};
|
|
237
|
+
} else if (typeof slots === "function") {
|
|
238
|
+
return {
|
|
239
|
+
default: slots
|
|
240
|
+
};
|
|
241
|
+
} else if (isObject.isObject(slots)) {
|
|
242
|
+
return slots;
|
|
243
|
+
} else if (slots) {
|
|
244
|
+
return {
|
|
245
|
+
default: () => slots
|
|
246
|
+
};
|
|
225
247
|
}
|
|
226
248
|
}
|
|
227
|
-
function renderComponent(tcom, compon, componObj, value, compons) {
|
|
249
|
+
function renderComponent(obj, tcom, compon, componObj, value, compons) {
|
|
228
250
|
if (Object.keys(compons).includes(tcom)) {
|
|
229
|
-
return vue.h(compons[tcom], componObj);
|
|
251
|
+
return vue.h(compons[tcom], componObj, setSlots(obj));
|
|
230
252
|
}
|
|
231
253
|
if (shared.isHTMLTag(compon) || shared.isSVGTag(compon)) {
|
|
232
254
|
return vue.h(compon, componObj, value);
|
|
233
255
|
}
|
|
234
|
-
return vue.h(vue.resolveComponent(compon), componObj);
|
|
256
|
+
return vue.h(vue.resolveComponent(compon), componObj, setSlots(obj));
|
|
235
257
|
}
|
|
236
258
|
function getOnObjs(obj, data, emit, ...arrs) {
|
|
237
259
|
const objs = {};
|
|
@@ -252,63 +274,74 @@ function getOnObjs(obj, data, emit, ...arrs) {
|
|
|
252
274
|
}
|
|
253
275
|
return objs;
|
|
254
276
|
}
|
|
255
|
-
function useSetSlot(obj, data, slots, index, scope) {
|
|
277
|
+
function useSetSlot(obj, data, slots, options, emit, index, scope) {
|
|
256
278
|
const slotname = obj.slot ?? obj.prop;
|
|
257
279
|
if (slotname) {
|
|
258
280
|
const slot = slots[slotname];
|
|
259
281
|
if (slot) {
|
|
260
|
-
|
|
282
|
+
let value = (scope == null ? void 0 : scope.value) ?? vue.computed({
|
|
261
283
|
get() {
|
|
262
284
|
return getValue(obj, data, index);
|
|
263
285
|
},
|
|
264
|
-
set(
|
|
265
|
-
setValue(
|
|
286
|
+
set(v) {
|
|
287
|
+
setValue(v, obj, data);
|
|
266
288
|
}
|
|
267
289
|
});
|
|
290
|
+
const componObj = getComponObj(
|
|
291
|
+
value == null ? void 0 : value.value,
|
|
292
|
+
obj,
|
|
293
|
+
data,
|
|
294
|
+
options,
|
|
295
|
+
emit,
|
|
296
|
+
scope
|
|
297
|
+
);
|
|
268
298
|
return slot({
|
|
269
|
-
comscope: scope,
|
|
270
299
|
column: obj,
|
|
271
300
|
row: data,
|
|
272
301
|
value,
|
|
273
|
-
index
|
|
302
|
+
index,
|
|
303
|
+
...componObj
|
|
274
304
|
});
|
|
275
305
|
}
|
|
276
306
|
}
|
|
277
307
|
}
|
|
278
|
-
function
|
|
308
|
+
function getComponObj(value, obj, data, options, emit, scope) {
|
|
309
|
+
const componValueName = obj.componValueName || "modelValue";
|
|
310
|
+
const componObj = {
|
|
311
|
+
// ...attrs,
|
|
312
|
+
[componValueName]: value,
|
|
313
|
+
["onUpdate:" + componValueName]: (v) => setValue(v, obj, data),
|
|
314
|
+
listobj: obj,
|
|
315
|
+
valueobj: data,
|
|
316
|
+
comscope: scope,
|
|
317
|
+
...obj.config,
|
|
318
|
+
...getOnObjs(obj, data, emit, scope)
|
|
319
|
+
};
|
|
320
|
+
if (obj.multiple) {
|
|
321
|
+
componObj.multiple = obj.multiple;
|
|
322
|
+
}
|
|
323
|
+
const option = processOptions(value, obj, data, options);
|
|
324
|
+
if (option.length > 0) {
|
|
325
|
+
componObj.options = option;
|
|
326
|
+
}
|
|
327
|
+
return componObj;
|
|
328
|
+
}
|
|
329
|
+
function useSetCompon(obj, data, options, compons, emit, index, scope) {
|
|
279
330
|
if (obj.compon) {
|
|
280
331
|
const value = getValue(obj, data, index);
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
componObj.multiple = obj.multiple;
|
|
295
|
-
}
|
|
296
|
-
if (typeof obj.compon == "string") {
|
|
297
|
-
return setComponString(
|
|
298
|
-
value,
|
|
299
|
-
obj,
|
|
300
|
-
componObj,
|
|
301
|
-
data,
|
|
302
|
-
optionss,
|
|
303
|
-
compons
|
|
304
|
-
);
|
|
305
|
-
} else if (typeof obj.compon == "function") {
|
|
306
|
-
return obj.compon(componObj);
|
|
307
|
-
} else if (vue.isVNode(obj.compon)) {
|
|
308
|
-
return obj.compon;
|
|
309
|
-
} else {
|
|
310
|
-
return vue.h(obj.compon, componObj);
|
|
311
|
-
}
|
|
332
|
+
const componObj = getComponObj(value, obj, data, options, emit, scope);
|
|
333
|
+
return useGetCompon(obj.compon, componObj, obj, compons, value);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function useGetCompon(compon, componObj, obj, compons, value) {
|
|
337
|
+
if (typeof compon == "string") {
|
|
338
|
+
return setComponString(value, obj, componObj, compons);
|
|
339
|
+
} else if (typeof compon == "function") {
|
|
340
|
+
return compon(componObj, setSlots(obj));
|
|
341
|
+
} else if (vue.isVNode(compon)) {
|
|
342
|
+
return compon;
|
|
343
|
+
} else {
|
|
344
|
+
return vue.h(compon, componObj, setSlots(obj));
|
|
312
345
|
}
|
|
313
346
|
}
|
|
314
347
|
const useGetDomValue = (obj, data, options, index) => {
|
|
@@ -318,7 +351,7 @@ const useGetDomValue = (obj, data, options, index) => {
|
|
|
318
351
|
}
|
|
319
352
|
return value;
|
|
320
353
|
};
|
|
321
|
-
const useGetDomLabel = (obj, data, slots,
|
|
354
|
+
const useGetDomLabel = (obj, data, slots, options, compons, emit, index) => {
|
|
322
355
|
const label = obj.label;
|
|
323
356
|
if (!label) {
|
|
324
357
|
return label;
|
|
@@ -333,48 +366,46 @@ const useGetDomLabel = (obj, data, slots, optionss, compons, emit, index) => {
|
|
|
333
366
|
return label;
|
|
334
367
|
}
|
|
335
368
|
if (Array.isArray(label)) {
|
|
336
|
-
return renderLabelArray(label, data,
|
|
369
|
+
return renderLabelArray(label, data, options, compons, emit, index);
|
|
337
370
|
}
|
|
338
|
-
return
|
|
339
|
-
|
|
340
|
-
data,
|
|
341
|
-
slots,
|
|
342
|
-
optionss,
|
|
371
|
+
return useVNodeComponDom(label, data, slots, emit, {
|
|
372
|
+
options,
|
|
343
373
|
compons,
|
|
344
|
-
emit,
|
|
345
374
|
index
|
|
346
|
-
);
|
|
375
|
+
});
|
|
347
376
|
};
|
|
348
|
-
const renderLabelArray = (labels, data,
|
|
377
|
+
const renderLabelArray = (labels, data, options, compons, emit, index) => {
|
|
349
378
|
return vue.h(
|
|
350
379
|
"div",
|
|
351
380
|
{ class: "com-lable-array" },
|
|
352
381
|
labels.map((v) => {
|
|
353
382
|
const labelObj = typeof v === "string" ? { value: v, compon: "div" } : v;
|
|
354
|
-
return useSetCompon(labelObj, data,
|
|
383
|
+
return useSetCompon(labelObj, data, options, compons, emit, index);
|
|
355
384
|
})
|
|
356
385
|
);
|
|
357
386
|
};
|
|
358
|
-
|
|
359
|
-
const
|
|
387
|
+
function useVNodeComponDom(obj, data, slots, emit, config) {
|
|
388
|
+
const { options, compons, index, scope } = config;
|
|
389
|
+
const slot = useSetSlot(obj, data, slots, options, emit, index, scope);
|
|
360
390
|
if (slot) {
|
|
361
391
|
return slot;
|
|
362
392
|
}
|
|
363
|
-
if (
|
|
393
|
+
if (obj.compon) {
|
|
364
394
|
const column = useSetCompon(
|
|
365
|
-
|
|
395
|
+
obj,
|
|
366
396
|
data,
|
|
367
|
-
|
|
397
|
+
options,
|
|
368
398
|
compons,
|
|
369
399
|
emit,
|
|
370
|
-
index
|
|
400
|
+
index,
|
|
401
|
+
scope
|
|
371
402
|
);
|
|
372
403
|
if (column) {
|
|
373
404
|
return column;
|
|
374
405
|
}
|
|
375
406
|
}
|
|
376
|
-
return useGetDomValue(
|
|
377
|
-
}
|
|
407
|
+
return useGetDomValue(obj, data, options, index);
|
|
408
|
+
}
|
|
378
409
|
function useObjComponSelected(obj, props) {
|
|
379
410
|
const arrs = [obj];
|
|
380
411
|
util.getFathers(obj, arrs);
|
|
@@ -417,6 +448,19 @@ function getLabelText(obj) {
|
|
|
417
448
|
if (obj.labelText) {
|
|
418
449
|
return obj.labelText;
|
|
419
450
|
}
|
|
451
|
+
if (!obj.label) {
|
|
452
|
+
const farrs = [];
|
|
453
|
+
util.getFathers(obj, farrs);
|
|
454
|
+
farrs.reverse();
|
|
455
|
+
for (const v of farrs) {
|
|
456
|
+
if (v.labelText) {
|
|
457
|
+
return v.labelText;
|
|
458
|
+
} else if (v.label) {
|
|
459
|
+
obj = v;
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
420
464
|
const label = useGetDomLabel(obj, {}, {}, {}, {}, () => {
|
|
421
465
|
}, 0);
|
|
422
466
|
if (vue.isVNode(label)) {
|
|
@@ -425,11 +469,13 @@ function getLabelText(obj) {
|
|
|
425
469
|
return (label == null ? void 0 : label.toString()) || "";
|
|
426
470
|
}
|
|
427
471
|
}
|
|
472
|
+
exports.getComponObj = getComponObj;
|
|
428
473
|
exports.getFormRule = getFormRule;
|
|
429
474
|
exports.getLabelText = getLabelText;
|
|
430
475
|
exports.getOnObjs = getOnObjs;
|
|
431
476
|
exports.getVNodeContent = getVNodeContent;
|
|
432
477
|
exports.setFormDefaultValue = setFormDefaultValue;
|
|
478
|
+
exports.useGetCompon = useGetCompon;
|
|
433
479
|
exports.useGetDomLabel = useGetDomLabel;
|
|
434
480
|
exports.useGetDomValue = useGetDomValue;
|
|
435
481
|
exports.useHide = useHide;
|
|
@@ -439,4 +485,5 @@ exports.usePropsDefault = usePropsDefault;
|
|
|
439
485
|
exports.useSetCompon = useSetCompon;
|
|
440
486
|
exports.useSetSlot = useSetSlot;
|
|
441
487
|
exports.useSetValue = useSetValue;
|
|
488
|
+
exports.useVNodeComponDom = useVNodeComponDom;
|
|
442
489
|
exports.useVueValue = useVueValue;
|
|
@@ -57,19 +57,26 @@ type Compons = {
|
|
|
57
57
|
* @param scope - 可选的作用域对象,传递给插槽函数
|
|
58
58
|
* @returns 插槽函数执行结果或undefined
|
|
59
59
|
*/
|
|
60
|
-
export declare function useSetSlot(obj: ListObj, data: ObjAny, slots: ObjAny, index?: number, scope?: ObjAny): any;
|
|
60
|
+
export declare function useSetSlot(obj: ListObj, data: ObjAny, slots: ObjAny, options: ObjAny, emit: Function, index?: number | number[], scope?: ObjAny): any;
|
|
61
|
+
export declare function getComponObj(value: any, obj: ListObj, data: ObjAny, options: ObjAny, emit: Function, scope?: ObjAny): {
|
|
62
|
+
[x: string]: any;
|
|
63
|
+
listobj: ListObj;
|
|
64
|
+
valueobj: ObjAny;
|
|
65
|
+
comscope: ObjAny | undefined;
|
|
66
|
+
};
|
|
61
67
|
/**
|
|
62
68
|
* 根据配置对象设置组件
|
|
63
69
|
* @param obj - 列表对象配置,包含组件相关配置信息
|
|
64
70
|
* @param data - 数据对象,用于获取和设置组件值
|
|
65
|
-
* @param
|
|
71
|
+
* @param options - 选项配置对象
|
|
66
72
|
* @param compons - 组件集合
|
|
67
73
|
* @param emit - 事件发射函数
|
|
68
74
|
* @param index - 索引值,可选参数
|
|
69
75
|
* @param scope - 作用域对象,可选参数
|
|
70
76
|
* @returns 返回创建的组件节点或组件调用结果
|
|
71
77
|
*/
|
|
72
|
-
export declare function useSetCompon(obj: ListObj, data: ObjAny,
|
|
78
|
+
export declare function useSetCompon(obj: ListObj, data: ObjAny, options: ObjAny, compons: Compons, emit: Function, index?: number | number[], scope?: ObjAny): any;
|
|
79
|
+
export declare function useGetCompon(compon: any, componObj: ObjAny, obj: ListObj, compons: Compons, value: any): any;
|
|
73
80
|
/**
|
|
74
81
|
* 获取DOM元素的值
|
|
75
82
|
* @param obj - 列表对象配置
|
|
@@ -78,19 +85,32 @@ export declare function useSetCompon(obj: ListObj, data: ObjAny, optionss: ObjAn
|
|
|
78
85
|
* @param index - 可选的索引值
|
|
79
86
|
* @returns 返回处理后的值
|
|
80
87
|
*/
|
|
81
|
-
export declare const useGetDomValue: (obj: ListObj, data: ObjAny, options: ObjAny, index?: number) => any;
|
|
88
|
+
export declare const useGetDomValue: (obj: ListObj, data: ObjAny, options: ObjAny, index?: number | number[]) => any;
|
|
82
89
|
/**
|
|
83
90
|
* 获取DOM标签的处理函数
|
|
84
91
|
* @param obj - 包含label属性的对象
|
|
85
92
|
* @param data - 数据对象
|
|
86
93
|
* @param slots - 插槽对象
|
|
87
|
-
* @param
|
|
94
|
+
* @param options - 选项配置对象
|
|
88
95
|
* @param compons - 组件对象
|
|
89
96
|
* @param emit - 事件发射函数
|
|
90
97
|
* @param index - 索引值
|
|
91
98
|
* @returns 返回处理后的标签内容,可能是字符串、VNode或渲染后的数组/对象
|
|
92
99
|
*/
|
|
93
|
-
export declare const useGetDomLabel: (obj: ListObj, data: ObjAny, slots: ObjAny,
|
|
100
|
+
export declare const useGetDomLabel: (obj: ListObj, data: ObjAny, slots: ObjAny, options: ObjAny, compons: Compons, emit: Function, index: number) => any;
|
|
101
|
+
/**
|
|
102
|
+
* 根据配置对象处理虚拟节点的组件或DOM渲染
|
|
103
|
+
* @param obj - 列表对象配置,包含标签和组件信息
|
|
104
|
+
* @param data - 数据对象,用于渲染的数据源
|
|
105
|
+
* @param slots - 插槽配置对象
|
|
106
|
+
* @param options - 选项配置对象
|
|
107
|
+
* @param compons - 组件集合
|
|
108
|
+
* @param emit - 事件发射函数
|
|
109
|
+
* @param index - 当前项的索引
|
|
110
|
+
* @param config - 可选的额外配置对象
|
|
111
|
+
* @returns 处理后的虚拟节点、组件或DOM值
|
|
112
|
+
*/
|
|
113
|
+
export declare function useVNodeComponDom(obj: ListObj, data: ObjAny, slots: ObjAny, emit: Function, config: ObjAny): any;
|
|
94
114
|
/**
|
|
95
115
|
* 获取对象及其父级链中选中的组件
|
|
96
116
|
* @param obj - 当前列表对象
|