@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
|
@@ -12,7 +12,7 @@ const Components = {
|
|
|
12
12
|
};
|
|
13
13
|
function setUp(props, emit, cs, refForm, getLocale) {
|
|
14
14
|
const buts = computed(() => {
|
|
15
|
-
if (
|
|
15
|
+
if (props.buts === void 0) {
|
|
16
16
|
return [
|
|
17
17
|
{
|
|
18
18
|
_id: "2",
|
|
@@ -136,12 +136,9 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
136
136
|
return rules;
|
|
137
137
|
}
|
|
138
138
|
const dataRules = ref(getRules());
|
|
139
|
-
watch(
|
|
140
|
-
()
|
|
141
|
-
|
|
142
|
-
dataRules.value = getRules();
|
|
143
|
-
}
|
|
144
|
-
);
|
|
139
|
+
watch([() => props.list, () => props.list.length], () => {
|
|
140
|
+
dataRules.value = getRules();
|
|
141
|
+
});
|
|
145
142
|
function validate() {
|
|
146
143
|
return new Promise((resolve, reject) => {
|
|
147
144
|
if (refForm.value) {
|
|
@@ -164,18 +161,18 @@ function setUp(props, emit, cs, refForm, getLocale) {
|
|
|
164
161
|
if (callback) {
|
|
165
162
|
callback(list, true);
|
|
166
163
|
}
|
|
167
|
-
emit("submit", list);
|
|
168
|
-
}).catch((
|
|
164
|
+
emit("submit", list, true);
|
|
165
|
+
}).catch((error) => {
|
|
169
166
|
if (callback) {
|
|
170
|
-
callback(
|
|
167
|
+
callback(error, false);
|
|
171
168
|
}
|
|
172
|
-
emit("submit",
|
|
169
|
+
emit("submit", error, false);
|
|
173
170
|
});
|
|
174
171
|
} else {
|
|
175
172
|
if (callback) {
|
|
176
173
|
callback(obj);
|
|
177
174
|
}
|
|
178
|
-
emit("submit", obj);
|
|
175
|
+
emit("submit", obj, true, true);
|
|
179
176
|
}
|
|
180
177
|
}).catch(() => {
|
|
181
178
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const use = require("../../common/use.cjs");
|
|
4
3
|
const judge = require("@fangzhongya/utils/judge/judge");
|
|
5
4
|
const config = require("../common/config.cjs");
|
|
6
5
|
const lineToLargeHump = require("@fangzhongya/utils/name/lineToLargeHump");
|
|
6
|
+
const use = require("../../common/use.cjs");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
9
|
if (e) {
|
|
@@ -125,14 +125,12 @@ function getLinkageJudge(jyjudgev, linkage) {
|
|
|
125
125
|
const v = judge2 == null ? void 0 : judge2(val, data);
|
|
126
126
|
if (v) {
|
|
127
127
|
callback(new Error(v));
|
|
128
|
-
} else {
|
|
129
|
-
|
|
130
|
-
refForm == null ? void 0 : refForm.validateField([prop], () => {
|
|
131
|
-
callback();
|
|
132
|
-
});
|
|
133
|
-
} else {
|
|
128
|
+
} else if (prop) {
|
|
129
|
+
refForm == null ? void 0 : refForm.validateField([prop], () => {
|
|
134
130
|
callback();
|
|
135
|
-
}
|
|
131
|
+
});
|
|
132
|
+
} else {
|
|
133
|
+
callback();
|
|
136
134
|
}
|
|
137
135
|
};
|
|
138
136
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getLabelText, useHide } from "../../common/use.js";
|
|
2
1
|
import * as judge from "@fangzhongya/utils/judge/judge";
|
|
3
2
|
import { changes } from "../common/config.js";
|
|
4
3
|
import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
|
|
4
|
+
import { getLabelText, useHide } from "../../common/use.js";
|
|
5
5
|
function isValue(value) {
|
|
6
6
|
if (value || value === 0 || value === false) {
|
|
7
7
|
return false;
|
|
@@ -106,14 +106,12 @@ function getLinkageJudge(jyjudgev, linkage) {
|
|
|
106
106
|
const v = judge2 == null ? void 0 : judge2(val, data);
|
|
107
107
|
if (v) {
|
|
108
108
|
callback(new Error(v));
|
|
109
|
-
} else {
|
|
110
|
-
|
|
111
|
-
refForm == null ? void 0 : refForm.validateField([prop], () => {
|
|
112
|
-
callback();
|
|
113
|
-
});
|
|
114
|
-
} else {
|
|
109
|
+
} else if (prop) {
|
|
110
|
+
refForm == null ? void 0 : refForm.validateField([prop], () => {
|
|
115
111
|
callback();
|
|
116
|
-
}
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
callback();
|
|
117
115
|
}
|
|
118
116
|
};
|
|
119
117
|
}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const name = "forms-div";
|
|
4
4
|
const dataProps = {
|
|
5
|
+
index: {
|
|
6
|
+
type: Array,
|
|
7
|
+
default() {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
},
|
|
5
11
|
/**
|
|
6
12
|
* @props { Object<ObjAny>} options={}
|
|
7
13
|
* 选择数据集合
|
|
@@ -37,13 +43,10 @@ const dataProps = {
|
|
|
37
43
|
},
|
|
38
44
|
/**
|
|
39
45
|
* 传入值
|
|
40
|
-
* @props { Object } modelValue
|
|
46
|
+
* @props { Object } modelValue ( )
|
|
41
47
|
*/
|
|
42
48
|
modelValue: {
|
|
43
|
-
type:
|
|
44
|
-
default() {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
49
|
+
type: null
|
|
47
50
|
},
|
|
48
51
|
/**
|
|
49
52
|
* @props { Object<ObjStr> } formvalue= ( )
|
|
@@ -4,6 +4,25 @@ import { ExtractPropTypes } from 'vue';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const name = "forms-div";
|
|
6
6
|
export declare const dataProps: {
|
|
7
|
+
index: {
|
|
8
|
+
type: {
|
|
9
|
+
(arrayLength: number): number[];
|
|
10
|
+
(...items: number[]): number[];
|
|
11
|
+
new (arrayLength: number): number[];
|
|
12
|
+
new (...items: number[]): number[];
|
|
13
|
+
isArray(arg: any): arg is any[];
|
|
14
|
+
readonly prototype: any[];
|
|
15
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
16
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
17
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
18
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
19
|
+
of<T>(...items: T[]): T[];
|
|
20
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
21
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
22
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
23
|
+
};
|
|
24
|
+
default(): never[];
|
|
25
|
+
};
|
|
7
26
|
/**
|
|
8
27
|
* @props { Object<ObjAny>} options={}
|
|
9
28
|
* 选择数据集合
|
|
@@ -35,11 +54,10 @@ export declare const dataProps: {
|
|
|
35
54
|
};
|
|
36
55
|
/**
|
|
37
56
|
* 传入值
|
|
38
|
-
* @props { Object } modelValue
|
|
57
|
+
* @props { Object } modelValue ( )
|
|
39
58
|
*/
|
|
40
59
|
modelValue: {
|
|
41
|
-
type:
|
|
42
|
-
default(): {};
|
|
60
|
+
type: null;
|
|
43
61
|
};
|
|
44
62
|
/**
|
|
45
63
|
* @props { Object<ObjStr> } formvalue= ( )
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
const name = "forms-div";
|
|
2
2
|
const dataProps = {
|
|
3
|
+
index: {
|
|
4
|
+
type: Array,
|
|
5
|
+
default() {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
},
|
|
3
9
|
/**
|
|
4
10
|
* @props { Object<ObjAny>} options={}
|
|
5
11
|
* 选择数据集合
|
|
@@ -35,13 +41,10 @@ const dataProps = {
|
|
|
35
41
|
},
|
|
36
42
|
/**
|
|
37
43
|
* 传入值
|
|
38
|
-
* @props { Object } modelValue
|
|
44
|
+
* @props { Object } modelValue ( )
|
|
39
45
|
*/
|
|
40
46
|
modelValue: {
|
|
41
|
-
type:
|
|
42
|
-
default() {
|
|
43
|
-
return {};
|
|
44
|
-
}
|
|
47
|
+
type: null
|
|
45
48
|
},
|
|
46
49
|
/**
|
|
47
50
|
* @props { Object<ObjStr> } formvalue= ( )
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const data = require("./data.cjs");
|
|
5
|
-
const lineToLargeHump = require("@fangzhongya/utils/name/lineToLargeHump");
|
|
6
5
|
const objValue = require("@fangzhongya/utils/basic/object/objValue");
|
|
7
6
|
const index = require("../../../hooks/cssname/index.cjs");
|
|
8
7
|
const use = require("../../common/use.cjs");
|
|
@@ -21,6 +20,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
21
20
|
const prs = index$1.usePropsDefault(data.name, p, data.dataProps);
|
|
22
21
|
const props = prs.listobj;
|
|
23
22
|
const compons = index$2.useComponsGet(config.provides.compons);
|
|
23
|
+
const form = vue.inject(config.provides.form, {});
|
|
24
24
|
const formvalue = vue.computed(() => {
|
|
25
25
|
const o = {};
|
|
26
26
|
if (typeof props.formvalue === "object") {
|
|
@@ -99,7 +99,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
99
99
|
return result;
|
|
100
100
|
}
|
|
101
101
|
function getSourceObject() {
|
|
102
|
-
let source = prs.modelValue
|
|
102
|
+
let source = prs.modelValue;
|
|
103
103
|
if (props.orig) {
|
|
104
104
|
source = prs.valueobj ?? {};
|
|
105
105
|
}
|
|
@@ -136,10 +136,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
136
136
|
if (props.computed) {
|
|
137
137
|
handleComputedSet(newValue, v);
|
|
138
138
|
}
|
|
139
|
-
if (!props.orig) {
|
|
140
|
-
emit("update:modelValue",
|
|
139
|
+
if (!props.orig && !prop) {
|
|
140
|
+
emit("update:modelValue", newValue);
|
|
141
141
|
}
|
|
142
|
-
if (
|
|
142
|
+
if (prop) {
|
|
143
143
|
emit("upform", newValue, props, v);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -167,78 +167,49 @@ const _sfc_main = vue.defineComponent({
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
if (typeof props.options === "string") {
|
|
173
|
-
const value2 = optionss[props.options];
|
|
174
|
-
if (typeof value2 == "function") {
|
|
175
|
-
return value2(optionss, value2.value, props) || [];
|
|
176
|
-
} else {
|
|
177
|
-
return value2 || [];
|
|
178
|
-
}
|
|
179
|
-
} else if (typeof props.options == "function") {
|
|
180
|
-
return props.options(optionss, value.value, props) || [];
|
|
181
|
-
} else {
|
|
182
|
-
return props.options || [];
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
const render = () => {
|
|
170
|
+
const setDom = () => {
|
|
171
|
+
var _a;
|
|
186
172
|
const compon = props.compon || prs.compon || "input";
|
|
187
173
|
const componValueName = prs.componValueName || "modelValue";
|
|
188
|
-
const
|
|
189
|
-
...
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
emit("upform", ...arr);
|
|
174
|
+
const obj = {
|
|
175
|
+
...props,
|
|
176
|
+
compon,
|
|
177
|
+
slots: props.slots ?? slots,
|
|
178
|
+
config: {
|
|
179
|
+
...binds.value,
|
|
180
|
+
index: prs.index,
|
|
181
|
+
class: [cs.z("com"), ((_a = props.config) == null ? void 0 : _a.class) ?? ""].join(
|
|
182
|
+
" "
|
|
183
|
+
),
|
|
184
|
+
[componValueName]: value.value,
|
|
185
|
+
["onUpdate:" + componValueName]: (v) => value.value = v,
|
|
186
|
+
["onUpform"]: (...arr) => {
|
|
187
|
+
if (props.prop) {
|
|
188
|
+
emit("upform", ...arr);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
206
191
|
}
|
|
207
192
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const setSslot = () => {
|
|
224
|
-
const slotname = props.slot ?? props.prop;
|
|
225
|
-
if (slotname) {
|
|
226
|
-
const slot = slots[slotname];
|
|
227
|
-
if (slot) {
|
|
228
|
-
return slot({
|
|
229
|
-
row: prs.valueobj,
|
|
230
|
-
value,
|
|
231
|
-
column: props,
|
|
232
|
-
options: options.value,
|
|
233
|
-
multiple: props.multiple,
|
|
234
|
-
optionss: prs.optionss
|
|
235
|
-
});
|
|
193
|
+
return use.useVNodeComponDom(
|
|
194
|
+
obj,
|
|
195
|
+
prs.valueobj ?? value.value,
|
|
196
|
+
slots,
|
|
197
|
+
emit,
|
|
198
|
+
{
|
|
199
|
+
options: prs.optionss,
|
|
200
|
+
compons,
|
|
201
|
+
index: prs.index,
|
|
202
|
+
scope: {
|
|
203
|
+
$index: prs.index[0] || 0,
|
|
204
|
+
config: form,
|
|
205
|
+
options: prs.optionss,
|
|
206
|
+
value
|
|
207
|
+
}
|
|
236
208
|
}
|
|
237
|
-
|
|
238
|
-
return render();
|
|
209
|
+
);
|
|
239
210
|
};
|
|
240
211
|
return () => {
|
|
241
|
-
return props.compon ? vue.h("div", { class: cs.z() }, [
|
|
212
|
+
return props.compon ? vue.h("div", { class: cs.z() }, [setDom()]) : "";
|
|
242
213
|
};
|
|
243
214
|
}
|
|
244
215
|
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, h
|
|
1
|
+
import { defineComponent, inject, computed, ref, h } from "vue";
|
|
2
2
|
import { name, dataProps, dataEmits, dataExpose } from "./data.js";
|
|
3
|
-
import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
|
|
4
3
|
import { setObjValue, getObjValue } from "@fangzhongya/utils/basic/object/objValue";
|
|
5
4
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
6
|
-
import {
|
|
5
|
+
import { useVNodeComponDom } from "../../common/use.js";
|
|
7
6
|
import { isEqual } from "@fangzhongya/utils/basic/object/isEqual";
|
|
8
7
|
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
9
8
|
import { useComponsGet } from "../../../hooks/compons/index.js";
|
|
@@ -19,6 +18,7 @@ const _sfc_main = defineComponent({
|
|
|
19
18
|
const prs = usePropsDefault(name, p, dataProps);
|
|
20
19
|
const props = prs.listobj;
|
|
21
20
|
const compons = useComponsGet(provides.compons);
|
|
21
|
+
const form = inject(provides.form, {});
|
|
22
22
|
const formvalue = computed(() => {
|
|
23
23
|
const o = {};
|
|
24
24
|
if (typeof props.formvalue === "object") {
|
|
@@ -97,7 +97,7 @@ const _sfc_main = defineComponent({
|
|
|
97
97
|
return result;
|
|
98
98
|
}
|
|
99
99
|
function getSourceObject() {
|
|
100
|
-
let source = prs.modelValue
|
|
100
|
+
let source = prs.modelValue;
|
|
101
101
|
if (props.orig) {
|
|
102
102
|
source = prs.valueobj ?? {};
|
|
103
103
|
}
|
|
@@ -134,10 +134,10 @@ const _sfc_main = defineComponent({
|
|
|
134
134
|
if (props.computed) {
|
|
135
135
|
handleComputedSet(newValue, v);
|
|
136
136
|
}
|
|
137
|
-
if (!props.orig) {
|
|
138
|
-
emit("update:modelValue",
|
|
137
|
+
if (!props.orig && !prop) {
|
|
138
|
+
emit("update:modelValue", newValue);
|
|
139
139
|
}
|
|
140
|
-
if (
|
|
140
|
+
if (prop) {
|
|
141
141
|
emit("upform", newValue, props, v);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -165,78 +165,49 @@ const _sfc_main = defineComponent({
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
if (typeof props.options === "string") {
|
|
171
|
-
const value2 = optionss[props.options];
|
|
172
|
-
if (typeof value2 == "function") {
|
|
173
|
-
return value2(optionss, value2.value, props) || [];
|
|
174
|
-
} else {
|
|
175
|
-
return value2 || [];
|
|
176
|
-
}
|
|
177
|
-
} else if (typeof props.options == "function") {
|
|
178
|
-
return props.options(optionss, value.value, props) || [];
|
|
179
|
-
} else {
|
|
180
|
-
return props.options || [];
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
const render = () => {
|
|
168
|
+
const setDom = () => {
|
|
169
|
+
var _a;
|
|
184
170
|
const compon = props.compon || prs.compon || "input";
|
|
185
171
|
const componValueName = prs.componValueName || "modelValue";
|
|
186
|
-
const
|
|
187
|
-
...
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
emit("upform", ...arr);
|
|
172
|
+
const obj = {
|
|
173
|
+
...props,
|
|
174
|
+
compon,
|
|
175
|
+
slots: props.slots ?? slots,
|
|
176
|
+
config: {
|
|
177
|
+
...binds.value,
|
|
178
|
+
index: prs.index,
|
|
179
|
+
class: [cs.z("com"), ((_a = props.config) == null ? void 0 : _a.class) ?? ""].join(
|
|
180
|
+
" "
|
|
181
|
+
),
|
|
182
|
+
[componValueName]: value.value,
|
|
183
|
+
["onUpdate:" + componValueName]: (v) => value.value = v,
|
|
184
|
+
["onUpform"]: (...arr) => {
|
|
185
|
+
if (props.prop) {
|
|
186
|
+
emit("upform", ...arr);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
204
189
|
}
|
|
205
190
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const setSslot = () => {
|
|
222
|
-
const slotname = props.slot ?? props.prop;
|
|
223
|
-
if (slotname) {
|
|
224
|
-
const slot = slots[slotname];
|
|
225
|
-
if (slot) {
|
|
226
|
-
return slot({
|
|
227
|
-
row: prs.valueobj,
|
|
228
|
-
value,
|
|
229
|
-
column: props,
|
|
230
|
-
options: options.value,
|
|
231
|
-
multiple: props.multiple,
|
|
232
|
-
optionss: prs.optionss
|
|
233
|
-
});
|
|
191
|
+
return useVNodeComponDom(
|
|
192
|
+
obj,
|
|
193
|
+
prs.valueobj ?? value.value,
|
|
194
|
+
slots,
|
|
195
|
+
emit,
|
|
196
|
+
{
|
|
197
|
+
options: prs.optionss,
|
|
198
|
+
compons,
|
|
199
|
+
index: prs.index,
|
|
200
|
+
scope: {
|
|
201
|
+
$index: prs.index[0] || 0,
|
|
202
|
+
config: form,
|
|
203
|
+
options: prs.optionss,
|
|
204
|
+
value
|
|
205
|
+
}
|
|
234
206
|
}
|
|
235
|
-
|
|
236
|
-
return render();
|
|
207
|
+
);
|
|
237
208
|
};
|
|
238
209
|
return () => {
|
|
239
|
-
return props.compon ? h("div", { class: cs.z() }, [
|
|
210
|
+
return props.compon ? h("div", { class: cs.z() }, [setDom()]) : "";
|
|
240
211
|
};
|
|
241
212
|
}
|
|
242
213
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
}
|
|
@@ -4,6 +4,25 @@ import { ExtractPropTypes } from 'vue';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const name = "forms-item";
|
|
6
6
|
export declare const dataProps: {
|
|
7
|
+
index: {
|
|
8
|
+
type: {
|
|
9
|
+
(arrayLength: number): number[];
|
|
10
|
+
(...items: number[]): number[];
|
|
11
|
+
new (arrayLength: number): number[];
|
|
12
|
+
new (...items: number[]): number[];
|
|
13
|
+
isArray(arg: any): arg is any[];
|
|
14
|
+
readonly prototype: any[];
|
|
15
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
16
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
17
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
18
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
19
|
+
of<T>(...items: T[]): T[];
|
|
20
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
21
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
22
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
23
|
+
};
|
|
24
|
+
default(): never[];
|
|
25
|
+
};
|
|
7
26
|
/**
|
|
8
27
|
* @props { Object<ObjAny>} options={}
|
|
9
28
|
* 选择数据集合
|