@fangzhongya/fang-ui 0.1.28 → 0.1.30
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 +66 -13
- package/dist/components/common/use.d.ts +29 -5
- package/dist/components/common/use.js +67 -14
- package/dist/components/forms/index.css +3 -0
- package/dist/components/forms/src/setup.cjs +3 -1
- package/dist/components/forms/src/setup.js +4 -2
- package/dist/components/forms/src/util.cjs +1 -2
- package/dist/components/forms/src/util.d.ts +1 -1
- package/dist/components/forms/src/util.js +1 -2
- package/dist/components/forms-div/src/index2.cjs +7 -1
- package/dist/components/forms-div/src/index2.js +8 -2
- package/dist/components/forms-item/index.scss +3 -0
- package/dist/components/forms-item/src/label.cjs +1 -1
- package/dist/components/forms-item/src/label.js +2 -2
- package/dist/components/{forms-item → forms-items}/index.css +3 -0
- package/dist/components/list/src/util.cjs +12 -26
- package/dist/components/list/src/util.d.ts +1 -1
- package/dist/components/list/src/util.js +13 -27
- package/dist/components/page/index.css +3 -0
- package/dist/components/scss/common.scss +3 -0
- package/dist/components/tables/common/pagin.d.ts +2 -0
- package/dist/components/tables/src/column.d.ts +1 -3
- package/dist/components/tablesv/src/column.d.ts +1 -3
- package/dist/css/{forms-item.css → forms-items.css} +3 -0
- package/dist/css/forms.css +3 -0
- package/dist/css/index.css +3 -0
- package/dist/css/page.css +3 -0
- package/dist/icons/index.json +1 -1
- package/dist/index.css +3 -0
- package/dist/type.d.ts +4 -0
- package/package.json +5 -5
|
@@ -305,7 +305,13 @@ function useSetCompon(obj, data, optionss, compons, emit, index, scope) {
|
|
|
305
305
|
compons
|
|
306
306
|
);
|
|
307
307
|
} else {
|
|
308
|
-
|
|
308
|
+
if (typeof obj.compon == "function") {
|
|
309
|
+
return obj.compon(componObj);
|
|
310
|
+
} else if (vue.isVNode(obj.compon)) {
|
|
311
|
+
return obj.compon;
|
|
312
|
+
} else {
|
|
313
|
+
return vue.h(obj.compon, componObj);
|
|
314
|
+
}
|
|
309
315
|
}
|
|
310
316
|
}
|
|
311
317
|
}
|
|
@@ -316,9 +322,13 @@ const useGetDomValue = (obj, data, options, index) => {
|
|
|
316
322
|
}
|
|
317
323
|
return value;
|
|
318
324
|
};
|
|
319
|
-
const useGetDomLabel = (label, obj, data, slots, optionss, compons, emit, index) => {
|
|
325
|
+
const useGetDomLabel = (label, obj, data, slots, optionss, compons, emit, index, isComponSelected = (obj2) => true) => {
|
|
320
326
|
if (label) {
|
|
321
|
-
if (
|
|
327
|
+
if (typeof label == "function") {
|
|
328
|
+
return label();
|
|
329
|
+
} else if (vue.isVNode(label)) {
|
|
330
|
+
return label;
|
|
331
|
+
} else if (isObject.isObject(label)) {
|
|
322
332
|
if (isArray.isArray(label)) {
|
|
323
333
|
return vue.h(
|
|
324
334
|
"div",
|
|
@@ -349,16 +359,18 @@ const useGetDomLabel = (label, obj, data, slots, optionss, compons, emit, index)
|
|
|
349
359
|
return slot;
|
|
350
360
|
}
|
|
351
361
|
if (label.compon) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
if (isComponSelected(obj)) {
|
|
363
|
+
const column = useSetCompon(
|
|
364
|
+
label,
|
|
365
|
+
data,
|
|
366
|
+
optionss,
|
|
367
|
+
compons,
|
|
368
|
+
emit,
|
|
369
|
+
index
|
|
370
|
+
);
|
|
371
|
+
if (column) {
|
|
372
|
+
return column;
|
|
373
|
+
}
|
|
362
374
|
}
|
|
363
375
|
}
|
|
364
376
|
return useGetDomValue(label, data, optionss, index);
|
|
@@ -391,12 +403,53 @@ function usePropsDefault(props, keyObj) {
|
|
|
391
403
|
}
|
|
392
404
|
});
|
|
393
405
|
}
|
|
406
|
+
function useAdditional(value, add) {
|
|
407
|
+
if (typeof value === "string" && typeof add === "string") {
|
|
408
|
+
return value + add;
|
|
409
|
+
} else {
|
|
410
|
+
return vue.h(vue.Fragment, {}, [value, add]);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function useLabelAdditional(value, add) {
|
|
414
|
+
if (typeof value === "string" && typeof add === "string") {
|
|
415
|
+
return value + add;
|
|
416
|
+
} else {
|
|
417
|
+
return vue.h(vue.Fragment, {}, [value, add]);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function getVNodeContent(vnode) {
|
|
421
|
+
const container = document.createElement("div");
|
|
422
|
+
vue.render(vnode, container);
|
|
423
|
+
const textContent = container.textContent || "";
|
|
424
|
+
vue.render(null, container);
|
|
425
|
+
return textContent;
|
|
426
|
+
}
|
|
427
|
+
function getLabelText(label) {
|
|
428
|
+
if (typeof label == "undefined") {
|
|
429
|
+
return "";
|
|
430
|
+
} else if (typeof label == "string") {
|
|
431
|
+
return label;
|
|
432
|
+
} else if (typeof label == "function") {
|
|
433
|
+
label = label();
|
|
434
|
+
}
|
|
435
|
+
if (vue.isVNode(label)) {
|
|
436
|
+
return getVNodeContent(label);
|
|
437
|
+
} else if (label instanceof Array) {
|
|
438
|
+
return label.join("");
|
|
439
|
+
} else {
|
|
440
|
+
return (label == null ? void 0 : label.toString()) || "";
|
|
441
|
+
}
|
|
442
|
+
}
|
|
394
443
|
exports.getFormRule = getFormRule;
|
|
444
|
+
exports.getLabelText = getLabelText;
|
|
395
445
|
exports.getOnObjs = getOnObjs;
|
|
446
|
+
exports.getVNodeContent = getVNodeContent;
|
|
396
447
|
exports.setFormDefaultValue = setFormDefaultValue;
|
|
448
|
+
exports.useAdditional = useAdditional;
|
|
397
449
|
exports.useGetDomLabel = useGetDomLabel;
|
|
398
450
|
exports.useGetDomValue = useGetDomValue;
|
|
399
451
|
exports.useHide = useHide;
|
|
452
|
+
exports.useLabelAdditional = useLabelAdditional;
|
|
400
453
|
exports.useObjComponSelected = useObjComponSelected;
|
|
401
454
|
exports.usePropsDefault = usePropsDefault;
|
|
402
455
|
exports.useSetCompon = useSetCompon;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, VNode
|
|
1
|
+
import { Component, VNode } from 'vue';
|
|
2
2
|
export declare function useVueValue(v: any, key: string | Function): any;
|
|
3
3
|
export declare function useSetValue(v: any, key: string | Function, value: any): any;
|
|
4
4
|
export declare function getFormRule(obj: ListObj): string | undefined;
|
|
@@ -11,13 +11,37 @@ type Compons = {
|
|
|
11
11
|
[key: string]: Component;
|
|
12
12
|
};
|
|
13
13
|
export declare function useSetSlot(obj: ListObj, data: ObjAny, slots: ObjAny, index?: number, scope?: ObjAny): any;
|
|
14
|
-
export declare function useSetCompon(obj: ListObj, data: ObjAny, optionss: ObjAny, compons: Compons, emit: Function, index?: number, scope?: ObjAny):
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}> | undefined;
|
|
14
|
+
export declare function useSetCompon(obj: ListObj, data: ObjAny, optionss: ObjAny, compons: Compons, emit: Function, index?: number, scope?: ObjAny): any;
|
|
17
15
|
export declare const useGetDomValue: (obj: ListObj, data: ObjAny, options: ObjAny, index?: number) => any;
|
|
18
|
-
export declare const useGetDomLabel: (label: string | ListObj | undefined, obj: ListObj, data: ObjAny, slots: ObjAny, optionss: ObjAny, compons: Compons, emit: Function, index: number) =>
|
|
16
|
+
export declare const useGetDomLabel: (label: string | ListObj | VNode | Function | undefined, obj: ListObj, data: ObjAny, slots: ObjAny, optionss: ObjAny, compons: Compons, emit: Function, index: number, isComponSelected?: (obj: ListObj) => boolean) => any;
|
|
19
17
|
export declare function useObjComponSelected(obj: ListObj, props: ObjAny): any;
|
|
18
|
+
/**
|
|
19
|
+
* 设置获取默认值
|
|
20
|
+
* @param props
|
|
21
|
+
* @param keyObj
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
20
24
|
export declare function usePropsDefault(props: any, keyObj: {
|
|
21
25
|
[key: string]: () => any;
|
|
22
26
|
}): any;
|
|
27
|
+
/**
|
|
28
|
+
* 追加内容
|
|
29
|
+
* @param value
|
|
30
|
+
* @param add
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
export declare function useAdditional(value: string | VNode, add: string | VNode): string | VNode;
|
|
34
|
+
export declare function useLabelAdditional(value: string | VNode, add: string | VNode): string | VNode;
|
|
35
|
+
/**
|
|
36
|
+
* 获取VNode的展示文本
|
|
37
|
+
* @param vnode
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
export declare function getVNodeContent(vnode: VNode): string;
|
|
41
|
+
/**
|
|
42
|
+
* 获取label的展示文本
|
|
43
|
+
* @param label
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
export declare function getLabelText(label: string | ListObj | VNode | Function | undefined): string;
|
|
23
47
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, resolveComponent, computed, useAttrs } from "vue";
|
|
1
|
+
import { h, resolveComponent, computed, useAttrs, isVNode, Fragment, render } from "vue";
|
|
2
2
|
import { isHTMLTag, isSVGTag } from "@vue/shared";
|
|
3
3
|
import "../../utils/index.js";
|
|
4
4
|
import { isObject } from "@fangzhongya/utils/basic/object/isObject";
|
|
@@ -303,7 +303,13 @@ function useSetCompon(obj, data, optionss, compons, emit, index, scope) {
|
|
|
303
303
|
compons
|
|
304
304
|
);
|
|
305
305
|
} else {
|
|
306
|
-
|
|
306
|
+
if (typeof obj.compon == "function") {
|
|
307
|
+
return obj.compon(componObj);
|
|
308
|
+
} else if (isVNode(obj.compon)) {
|
|
309
|
+
return obj.compon;
|
|
310
|
+
} else {
|
|
311
|
+
return h(obj.compon, componObj);
|
|
312
|
+
}
|
|
307
313
|
}
|
|
308
314
|
}
|
|
309
315
|
}
|
|
@@ -314,9 +320,13 @@ const useGetDomValue = (obj, data, options, index) => {
|
|
|
314
320
|
}
|
|
315
321
|
return value;
|
|
316
322
|
};
|
|
317
|
-
const useGetDomLabel = (label, obj, data, slots, optionss, compons, emit, index) => {
|
|
323
|
+
const useGetDomLabel = (label, obj, data, slots, optionss, compons, emit, index, isComponSelected = (obj2) => true) => {
|
|
318
324
|
if (label) {
|
|
319
|
-
if (
|
|
325
|
+
if (typeof label == "function") {
|
|
326
|
+
return label();
|
|
327
|
+
} else if (isVNode(label)) {
|
|
328
|
+
return label;
|
|
329
|
+
} else if (isObject(label)) {
|
|
320
330
|
if (isArray(label)) {
|
|
321
331
|
return h(
|
|
322
332
|
"div",
|
|
@@ -347,16 +357,18 @@ const useGetDomLabel = (label, obj, data, slots, optionss, compons, emit, index)
|
|
|
347
357
|
return slot;
|
|
348
358
|
}
|
|
349
359
|
if (label.compon) {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
+
if (isComponSelected(obj)) {
|
|
361
|
+
const column = useSetCompon(
|
|
362
|
+
label,
|
|
363
|
+
data,
|
|
364
|
+
optionss,
|
|
365
|
+
compons,
|
|
366
|
+
emit,
|
|
367
|
+
index
|
|
368
|
+
);
|
|
369
|
+
if (column) {
|
|
370
|
+
return column;
|
|
371
|
+
}
|
|
360
372
|
}
|
|
361
373
|
}
|
|
362
374
|
return useGetDomValue(label, data, optionss, index);
|
|
@@ -389,13 +401,54 @@ function usePropsDefault(props, keyObj) {
|
|
|
389
401
|
}
|
|
390
402
|
});
|
|
391
403
|
}
|
|
404
|
+
function useAdditional(value, add) {
|
|
405
|
+
if (typeof value === "string" && typeof add === "string") {
|
|
406
|
+
return value + add;
|
|
407
|
+
} else {
|
|
408
|
+
return h(Fragment, {}, [value, add]);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function useLabelAdditional(value, add) {
|
|
412
|
+
if (typeof value === "string" && typeof add === "string") {
|
|
413
|
+
return value + add;
|
|
414
|
+
} else {
|
|
415
|
+
return h(Fragment, {}, [value, add]);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function getVNodeContent(vnode) {
|
|
419
|
+
const container = document.createElement("div");
|
|
420
|
+
render(vnode, container);
|
|
421
|
+
const textContent = container.textContent || "";
|
|
422
|
+
render(null, container);
|
|
423
|
+
return textContent;
|
|
424
|
+
}
|
|
425
|
+
function getLabelText(label) {
|
|
426
|
+
if (typeof label == "undefined") {
|
|
427
|
+
return "";
|
|
428
|
+
} else if (typeof label == "string") {
|
|
429
|
+
return label;
|
|
430
|
+
} else if (typeof label == "function") {
|
|
431
|
+
label = label();
|
|
432
|
+
}
|
|
433
|
+
if (isVNode(label)) {
|
|
434
|
+
return getVNodeContent(label);
|
|
435
|
+
} else if (label instanceof Array) {
|
|
436
|
+
return label.join("");
|
|
437
|
+
} else {
|
|
438
|
+
return (label == null ? void 0 : label.toString()) || "";
|
|
439
|
+
}
|
|
440
|
+
}
|
|
392
441
|
export {
|
|
393
442
|
getFormRule,
|
|
443
|
+
getLabelText,
|
|
394
444
|
getOnObjs,
|
|
445
|
+
getVNodeContent,
|
|
395
446
|
setFormDefaultValue,
|
|
447
|
+
useAdditional,
|
|
396
448
|
useGetDomLabel,
|
|
397
449
|
useGetDomValue,
|
|
398
450
|
useHide,
|
|
451
|
+
useLabelAdditional,
|
|
399
452
|
useObjComponSelected,
|
|
400
453
|
usePropsDefault,
|
|
401
454
|
useSetCompon,
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
height: var(--forms-item-row-height);
|
|
41
41
|
line-height: var(--forms-item-row-height);
|
|
42
42
|
}
|
|
43
|
+
.forms-item-el-item .el-form-item__label {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
43
46
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
44
47
|
min-height: var(--forms-item-row-height);
|
|
45
48
|
display: grid;
|
|
@@ -120,8 +120,9 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
obj.config = obj.config ?? {};
|
|
123
|
+
const labeltext = obj.labelText ?? use.getLabelText(obj.label);
|
|
123
124
|
if (((_a = obj.config) == null ? void 0 : _a.placeholder) === void 0) {
|
|
124
|
-
obj.config.placeholder = (trigger == 1 ? getLocale("form.import") : getLocale("form.select")) +
|
|
125
|
+
obj.config.placeholder = (trigger == 1 ? getLocale("form.import") : getLocale("form.select")) + labeltext;
|
|
125
126
|
}
|
|
126
127
|
if (((_b = obj.config) == null ? void 0 : _b.clearable) === void 0) {
|
|
127
128
|
obj.config.clearable = true;
|
|
@@ -133,6 +134,7 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
133
134
|
rules[p] = obj.rules;
|
|
134
135
|
} else if (obj.rule) {
|
|
135
136
|
rules[p] = util.getRule(
|
|
137
|
+
labeltext,
|
|
136
138
|
trigger,
|
|
137
139
|
obj,
|
|
138
140
|
dataForm,
|
|
@@ -2,7 +2,7 @@ import { dataHandle } from "./data.js";
|
|
|
2
2
|
import { provides, changes } from "../common/config.js";
|
|
3
3
|
import { getRule } from "./util.js";
|
|
4
4
|
import "../../../utils/css.js";
|
|
5
|
-
import { setFormDefaultValue, getFormRule } from "../../common/use.js";
|
|
5
|
+
import { setFormDefaultValue, getLabelText, getFormRule } from "../../common/use.js";
|
|
6
6
|
import "../../../utils/index.js";
|
|
7
7
|
import { computed, provide, isProxy, ref, watch } from "vue";
|
|
8
8
|
import { useCompons } from "../../../hooks/compons/index.js";
|
|
@@ -118,8 +118,9 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
obj.config = obj.config ?? {};
|
|
121
|
+
const labeltext = obj.labelText ?? getLabelText(obj.label);
|
|
121
122
|
if (((_a = obj.config) == null ? void 0 : _a.placeholder) === void 0) {
|
|
122
|
-
obj.config.placeholder = (trigger == 1 ? getLocale("form.import") : getLocale("form.select")) +
|
|
123
|
+
obj.config.placeholder = (trigger == 1 ? getLocale("form.import") : getLocale("form.select")) + labeltext;
|
|
123
124
|
}
|
|
124
125
|
if (((_b = obj.config) == null ? void 0 : _b.clearable) === void 0) {
|
|
125
126
|
obj.config.clearable = true;
|
|
@@ -131,6 +132,7 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
131
132
|
rules[p] = obj.rules;
|
|
132
133
|
} else if (obj.rule) {
|
|
133
134
|
rules[p] = getRule(
|
|
135
|
+
labeltext,
|
|
134
136
|
trigger,
|
|
135
137
|
obj,
|
|
136
138
|
dataForm,
|
|
@@ -19,9 +19,8 @@ function _interopNamespaceDefault(e) {
|
|
|
19
19
|
return Object.freeze(n);
|
|
20
20
|
}
|
|
21
21
|
const judge__namespace = /* @__PURE__ */ _interopNamespaceDefault(judge);
|
|
22
|
-
function getRule(trigger, obj, data, refForm, getLocale) {
|
|
22
|
+
function getRule(name, trigger, obj, data, refForm, getLocale) {
|
|
23
23
|
var _a;
|
|
24
|
-
const name = obj.label;
|
|
25
24
|
let multiple = obj.multiple ?? ((_a = obj.config) == null ? void 0 : _a.multiple);
|
|
26
25
|
const rule = obj.rule;
|
|
27
26
|
if (typeof multiple != "boolean") {
|
|
@@ -18,5 +18,5 @@ export type Rules = {
|
|
|
18
18
|
* @param {any} refForm 表单引用
|
|
19
19
|
* @returns {{ required: boolean, validator: Function, trigger: string }}
|
|
20
20
|
*/
|
|
21
|
-
export declare function getRule(trigger: number, obj: ListObj, data: any, refForm: any, getLocale: Function): Rule;
|
|
21
|
+
export declare function getRule(name: string, trigger: number, obj: ListObj, data: any, refForm: any, getLocale: Function): Rule;
|
|
22
22
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useHide } from "../../common/use.js";
|
|
2
2
|
import * as judge from "@fangzhongya/utils/judge/judge";
|
|
3
|
-
function getRule(trigger, obj, data, refForm, getLocale) {
|
|
3
|
+
function getRule(name, trigger, obj, data, refForm, getLocale) {
|
|
4
4
|
var _a;
|
|
5
|
-
const name = obj.label;
|
|
6
5
|
let multiple = obj.multiple ?? ((_a = obj.config) == null ? void 0 : _a.multiple);
|
|
7
6
|
const rule = obj.rule;
|
|
8
7
|
if (typeof multiple != "boolean") {
|
|
@@ -180,7 +180,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
180
180
|
return vue.h(vue.resolveComponent(compon), componObj, slots);
|
|
181
181
|
}
|
|
182
182
|
} else {
|
|
183
|
-
|
|
183
|
+
if (typeof compon == "function") {
|
|
184
|
+
return compon(componObj, slots);
|
|
185
|
+
} else if (vue.isVNode(compon)) {
|
|
186
|
+
return compon;
|
|
187
|
+
} else {
|
|
188
|
+
return vue.h(compon, componObj, slots);
|
|
189
|
+
}
|
|
184
190
|
}
|
|
185
191
|
};
|
|
186
192
|
const setSslot = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, h, resolveComponent } from "vue";
|
|
1
|
+
import { defineComponent, computed, ref, h, resolveComponent, isVNode } from "vue";
|
|
2
2
|
import { name, dataProps, dataEmits, dataExpose } from "./data.js";
|
|
3
3
|
import "../../../utils/index.js";
|
|
4
4
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
@@ -178,7 +178,13 @@ const _sfc_main = defineComponent({
|
|
|
178
178
|
return h(resolveComponent(compon), componObj, slots);
|
|
179
179
|
}
|
|
180
180
|
} else {
|
|
181
|
-
|
|
181
|
+
if (typeof compon == "function") {
|
|
182
|
+
return compon(componObj, slots);
|
|
183
|
+
} else if (isVNode(compon)) {
|
|
184
|
+
return compon;
|
|
185
|
+
} else {
|
|
186
|
+
return h(compon, componObj, slots);
|
|
187
|
+
}
|
|
182
188
|
}
|
|
183
189
|
};
|
|
184
190
|
const setSslot = () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject } from "vue";
|
|
2
|
-
import { useGetDomLabel } from "../../common/use.js";
|
|
2
|
+
import { useGetDomLabel, useLabelAdditional } from "../../common/use.js";
|
|
3
3
|
import { provides } from "../../forms/common/config.js";
|
|
4
4
|
import { useComponsGet } from "../../../hooks/compons/index.js";
|
|
5
5
|
function render(props, emit, slots, form) {
|
|
@@ -26,7 +26,7 @@ function render(props, emit, slots, form) {
|
|
|
26
26
|
colon = ":";
|
|
27
27
|
}
|
|
28
28
|
if (label) {
|
|
29
|
-
return label
|
|
29
|
+
return useLabelAdditional(label, colon);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
return label;
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
height: var(--forms-item-row-height);
|
|
40
40
|
line-height: var(--forms-item-row-height);
|
|
41
41
|
}
|
|
42
|
+
.forms-item-el-item .el-form-item__label {
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
}
|
|
42
45
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
43
46
|
min-height: var(--forms-item-row-height);
|
|
44
47
|
display: grid;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("vue");
|
|
4
4
|
const use = require("../../common/use.cjs");
|
|
5
|
-
require("../../../utils/util.cjs");
|
|
6
|
-
const isObject = require("@fangzhongya/utils/basic/object/isObject");
|
|
7
5
|
const setClass = (item, data, index) => {
|
|
8
6
|
const v = data[item.state ?? item.prop];
|
|
9
7
|
if (item.setcss) {
|
|
@@ -37,29 +35,17 @@ function setSslot(obj, data, props, compons, emit, slots, isComponSelected, inde
|
|
|
37
35
|
function setLabel(obj, props, compons, emit, slots, isComponSelected, index) {
|
|
38
36
|
let label = obj.label ?? "";
|
|
39
37
|
if (label) {
|
|
40
|
-
|
|
41
|
-
label
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
props.optionss,
|
|
52
|
-
compons,
|
|
53
|
-
emit,
|
|
54
|
-
index
|
|
55
|
-
);
|
|
56
|
-
if (column) {
|
|
57
|
-
return column;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
label = use.useGetDomValue(label, props.value, props.optionss, index);
|
|
62
|
-
}
|
|
38
|
+
label = use.useGetDomLabel(
|
|
39
|
+
label,
|
|
40
|
+
obj,
|
|
41
|
+
props.value,
|
|
42
|
+
slots,
|
|
43
|
+
props.optionss,
|
|
44
|
+
compons,
|
|
45
|
+
emit,
|
|
46
|
+
index || 0,
|
|
47
|
+
isComponSelected
|
|
48
|
+
);
|
|
63
49
|
}
|
|
64
50
|
let colon = props.colon;
|
|
65
51
|
if (colon) {
|
|
@@ -67,7 +53,7 @@ function setLabel(obj, props, compons, emit, slots, isComponSelected, index) {
|
|
|
67
53
|
colon = ":";
|
|
68
54
|
}
|
|
69
55
|
if (label) {
|
|
70
|
-
return label
|
|
56
|
+
return use.useLabelAdditional(label, colon);
|
|
71
57
|
}
|
|
72
58
|
}
|
|
73
59
|
return label;
|
|
@@ -4,5 +4,5 @@ type Compons = {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const setClass: (item: ListObj, data: ObjStr, index: number) => any;
|
|
6
6
|
export declare function setSslot(obj: ListObj, data: ObjAny, props: ObjAny, compons: Compons, emit: Function, slots: ObjAny, isComponSelected: Function, index?: number): any;
|
|
7
|
-
export declare function setLabel(obj:
|
|
7
|
+
export declare function setLabel(obj: ObjAny, props: ObjAny, compons: Compons, emit: Function, slots: ObjAny, isComponSelected: (obj: ObjAny) => boolean, index?: number): any;
|
|
8
8
|
export {};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import { useSetSlot, useSetCompon, useGetDomValue } from "../../common/use.js";
|
|
3
|
-
import "../../../utils/util.js";
|
|
4
|
-
import { isObject } from "@fangzhongya/utils/basic/object/isObject";
|
|
2
|
+
import { useSetSlot, useSetCompon, useGetDomValue, useGetDomLabel, useLabelAdditional } from "../../common/use.js";
|
|
5
3
|
const setClass = (item, data, index) => {
|
|
6
4
|
const v = data[item.state ?? item.prop];
|
|
7
5
|
if (item.setcss) {
|
|
@@ -35,29 +33,17 @@ function setSslot(obj, data, props, compons, emit, slots, isComponSelected, inde
|
|
|
35
33
|
function setLabel(obj, props, compons, emit, slots, isComponSelected, index) {
|
|
36
34
|
let label = obj.label ?? "";
|
|
37
35
|
if (label) {
|
|
38
|
-
|
|
39
|
-
label
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
props.optionss,
|
|
50
|
-
compons,
|
|
51
|
-
emit,
|
|
52
|
-
index
|
|
53
|
-
);
|
|
54
|
-
if (column) {
|
|
55
|
-
return column;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
label = useGetDomValue(label, props.value, props.optionss, index);
|
|
60
|
-
}
|
|
36
|
+
label = useGetDomLabel(
|
|
37
|
+
label,
|
|
38
|
+
obj,
|
|
39
|
+
props.value,
|
|
40
|
+
slots,
|
|
41
|
+
props.optionss,
|
|
42
|
+
compons,
|
|
43
|
+
emit,
|
|
44
|
+
index || 0,
|
|
45
|
+
isComponSelected
|
|
46
|
+
);
|
|
61
47
|
}
|
|
62
48
|
let colon = props.colon;
|
|
63
49
|
if (colon) {
|
|
@@ -65,7 +51,7 @@ function setLabel(obj, props, compons, emit, slots, isComponSelected, index) {
|
|
|
65
51
|
colon = ":";
|
|
66
52
|
}
|
|
67
53
|
if (label) {
|
|
68
|
-
return label
|
|
54
|
+
return useLabelAdditional(label, colon);
|
|
69
55
|
}
|
|
70
56
|
}
|
|
71
57
|
return label;
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
height: var(--forms-item-row-height);
|
|
41
41
|
line-height: var(--forms-item-row-height);
|
|
42
42
|
}
|
|
43
|
+
.forms-item-el-item .el-form-item__label {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
43
46
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
44
47
|
min-height: var(--forms-item-row-height);
|
|
45
48
|
display: grid;
|
|
@@ -224,6 +224,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
224
224
|
default?: any;
|
|
225
225
|
value?: any;
|
|
226
226
|
label?: string | /*elided*/ any | undefined;
|
|
227
|
+
labelText?: string | undefined;
|
|
227
228
|
hideLabel?: boolean | undefined;
|
|
228
229
|
prop?: string | undefined;
|
|
229
230
|
slot?: string | undefined;
|
|
@@ -256,6 +257,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
256
257
|
default?: any;
|
|
257
258
|
value?: any;
|
|
258
259
|
label?: string | /*elided*/ any | undefined;
|
|
260
|
+
labelText?: string | undefined;
|
|
259
261
|
hideLabel?: boolean | undefined;
|
|
260
262
|
prop?: string | undefined;
|
|
261
263
|
slot?: string | undefined;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
-
export declare function setHeader(obj: ListObj, scope: ObjAny, slots: ObjAny, emit: Function, props: ObjAny, index: number):
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
}>;
|
|
2
|
+
export declare function setHeader(obj: ListObj, scope: ObjAny, slots: ObjAny, emit: Function, props: ObjAny, index: number): any;
|
|
5
3
|
export declare function getTableColumn(obj: ListObj, emit: Function, props: ObjAny, slots: ObjAny, index: number, def?: Function): VNode<RendererNode, RendererElement, {
|
|
6
4
|
[key: string]: any;
|
|
7
5
|
}>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { VNode, RendererNode, RendererElement } from 'vue';
|
|
2
2
|
export declare function setProps(obj: ListObj, props: ObjAny): ObjAny;
|
|
3
|
-
export declare function setHeader(obj: ListObj, scope: ObjAny, slots: ObjAny, emit: Function, props: ObjAny, index: number):
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}>;
|
|
3
|
+
export declare function setHeader(obj: ListObj, scope: ObjAny, slots: ObjAny, emit: Function, props: ObjAny, index: number): any;
|
|
6
4
|
export declare function columnRender(obj: ListObj, emit: Function, props: ObjAny, slots: ObjAny, index: number): VNode<RendererNode, RendererElement, {
|
|
7
5
|
[key: string]: any;
|
|
8
6
|
}>;
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
height: var(--forms-item-row-height);
|
|
40
40
|
line-height: var(--forms-item-row-height);
|
|
41
41
|
}
|
|
42
|
+
.forms-item-el-item .el-form-item__label {
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
}
|
|
42
45
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
43
46
|
min-height: var(--forms-item-row-height);
|
|
44
47
|
display: grid;
|
package/dist/css/forms.css
CHANGED
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
height: var(--forms-item-row-height);
|
|
41
41
|
line-height: var(--forms-item-row-height);
|
|
42
42
|
}
|
|
43
|
+
.forms-item-el-item .el-form-item__label {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
43
46
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
44
47
|
min-height: var(--forms-item-row-height);
|
|
45
48
|
display: grid;
|
package/dist/css/index.css
CHANGED
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
height: var(--forms-item-row-height);
|
|
41
41
|
line-height: var(--forms-item-row-height);
|
|
42
42
|
}
|
|
43
|
+
.forms-item-el-item .el-form-item__label {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
43
46
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
44
47
|
min-height: var(--forms-item-row-height);
|
|
45
48
|
display: grid;
|
package/dist/css/page.css
CHANGED
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
height: var(--forms-item-row-height);
|
|
41
41
|
line-height: var(--forms-item-row-height);
|
|
42
42
|
}
|
|
43
|
+
.forms-item-el-item .el-form-item__label {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
43
46
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
44
47
|
min-height: var(--forms-item-row-height);
|
|
45
48
|
display: grid;
|
package/dist/icons/index.json
CHANGED
package/dist/index.css
CHANGED
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
height: var(--forms-item-row-height);
|
|
41
41
|
line-height: var(--forms-item-row-height);
|
|
42
42
|
}
|
|
43
|
+
.forms-item-el-item .el-form-item__label {
|
|
44
|
+
white-space: pre-wrap;
|
|
45
|
+
}
|
|
43
46
|
.forms-item-el-item.is-top .el-form-item__content {
|
|
44
47
|
min-height: var(--forms-item-row-height);
|
|
45
48
|
display: grid;
|
package/dist/type.d.ts
CHANGED
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.30",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "fang-ui",
|
|
7
7
|
"keywords": [
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"vue": "^3.5.24",
|
|
51
51
|
"vue-tsc": "^3.1.4",
|
|
52
52
|
"vxe-table": "4.6.20",
|
|
53
|
+
"@fang-ui/directives": "0.0.1-0",
|
|
53
54
|
"@fang-ui/components": "0.0.1-0",
|
|
54
55
|
"@fang-ui/hooks": "0.0.1-0",
|
|
55
|
-
"@fang-ui/locale": "0.0.1-0",
|
|
56
|
-
"@fang-ui/directives": "0.0.1-0",
|
|
57
56
|
"@fang-ui/icons": "0.0.1-0",
|
|
57
|
+
"@fang-ui/locale": "0.0.1-0",
|
|
58
58
|
"@fang-ui/theme": "0.0.1-0",
|
|
59
|
-
"@fang-ui/
|
|
60
|
-
"@fang-ui/
|
|
59
|
+
"@fang-ui/utils": "0.0.1-0",
|
|
60
|
+
"@fang-ui/types": "0.0.1-0"
|
|
61
61
|
},
|
|
62
62
|
"main": "./dist/index.cjs",
|
|
63
63
|
"module": "./dist/index.js",
|