@fangzhongya/fang-ui 0.1.77 → 0.1.79
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/buttons/src/data.cjs +4 -0
- package/dist/components/buttons/src/data.d.ts +3 -0
- package/dist/components/buttons/src/data.js +4 -0
- package/dist/components/buttons/src/index2.cjs +7 -4
- package/dist/components/buttons/src/index2.js +7 -4
- package/dist/components/common/use.cjs +49 -9
- package/dist/components/common/use.js +46 -6
- package/dist/components/forms/src/index2.cjs +3 -1
- package/dist/components/forms/src/index2.js +3 -1
- package/dist/components/forms-drag/src/index2.cjs +3 -1
- package/dist/components/forms-drag/src/index2.js +3 -1
- package/dist/components/forms-items/src/index2.cjs +3 -1
- package/dist/components/forms-items/src/index2.js +3 -1
- package/dist/components/menus/src/menu-ll2.cjs +2 -2
- package/dist/components/menus/src/menu-ll2.js +1 -1
- package/dist/components/page/src/index2.cjs +16 -9
- package/dist/components/page/src/index2.js +16 -9
- package/dist/components/tables/src/column.cjs +1 -0
- package/dist/components/tables/src/column.js +1 -0
- package/dist/components/tableset/common/pagin.d.ts +2 -0
- package/dist/hooks/model/index copy.d.ts +2 -0
- package/dist/hooks/model/index.cjs +20 -7
- package/dist/hooks/model/index.d.ts +2 -2
- package/dist/hooks/model/index.js +21 -8
- package/dist/icons/index.json +1 -1
- package/dist/type.d.ts +2 -0
- package/dist/utils/getFathers.cjs +9 -0
- package/dist/utils/getFathers.d.ts +1 -0
- package/dist/utils/getFathers.js +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/util.cjs +0 -49
- package/dist/utils/util.d.ts +0 -8
- package/dist/utils/util.js +1 -50
- package/package.json +4 -4
- /package/dist/components/{box → box-fun}/index.css +0 -0
- /package/dist/components/{edit-data → edit-data-add}/index.css +0 -0
- /package/dist/css/{box.css → box-fun.css} +0 -0
- /package/dist/css/{edit-data.css → edit-data-add.css} +0 -0
|
@@ -25,17 +25,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
25
25
|
return props.options;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
function onClick(obj, index2,
|
|
28
|
+
function onClick(obj, index2, event) {
|
|
29
|
+
if (props.isStop) {
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
}
|
|
29
32
|
const is = index$2.eventAliass(
|
|
30
33
|
(callback) => {
|
|
31
|
-
callback(obj, index2,
|
|
34
|
+
callback(obj, index2, event);
|
|
32
35
|
},
|
|
33
36
|
"click",
|
|
34
37
|
obj,
|
|
35
|
-
|
|
38
|
+
event
|
|
36
39
|
);
|
|
37
40
|
if (!is) {
|
|
38
|
-
emit("clicks", obj, index2,
|
|
41
|
+
emit("clicks", obj, index2, event);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
__expose({
|
|
@@ -23,17 +23,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
return props.options;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
function onClick(obj, index,
|
|
26
|
+
function onClick(obj, index, event) {
|
|
27
|
+
if (props.isStop) {
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
}
|
|
27
30
|
const is = eventAliass(
|
|
28
31
|
(callback) => {
|
|
29
|
-
callback(obj, index,
|
|
32
|
+
callback(obj, index, event);
|
|
30
33
|
},
|
|
31
34
|
"click",
|
|
32
35
|
obj,
|
|
33
|
-
|
|
36
|
+
event
|
|
34
37
|
);
|
|
35
38
|
if (!is) {
|
|
36
|
-
emit("clicks", obj, index,
|
|
39
|
+
emit("clicks", obj, index, event);
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
__expose({
|
|
@@ -3,10 +3,50 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const shared = require("../../utils/vues/shared.cjs");
|
|
5
5
|
const index = require("../../hooks/event-aliass/index.cjs");
|
|
6
|
-
const
|
|
6
|
+
const getFathers = require("../../utils/getFathers.cjs");
|
|
7
7
|
const isObject = require("@fangzhongya/utils/basic/object/isObject");
|
|
8
8
|
const lineToLargeHump = require("@fangzhongya/utils/name/lineToLargeHump");
|
|
9
9
|
const objValue = require("@fangzhongya/utils/basic/object/objValue");
|
|
10
|
+
function getFatherData(obj, row, is) {
|
|
11
|
+
if (obj.orig) {
|
|
12
|
+
return row;
|
|
13
|
+
}
|
|
14
|
+
const farrs = [];
|
|
15
|
+
getFathers.getFathers(obj, farrs);
|
|
16
|
+
if (farrs.length === 0) {
|
|
17
|
+
return row;
|
|
18
|
+
}
|
|
19
|
+
let currentValue = row;
|
|
20
|
+
for (const v of farrs) {
|
|
21
|
+
currentValue = processFatherObject(v, currentValue, row, is);
|
|
22
|
+
}
|
|
23
|
+
return currentValue;
|
|
24
|
+
}
|
|
25
|
+
function processFatherObject(obj, currentValue, row, is) {
|
|
26
|
+
if (obj.orig) {
|
|
27
|
+
return row;
|
|
28
|
+
}
|
|
29
|
+
if (!obj.prop) {
|
|
30
|
+
return currentValue;
|
|
31
|
+
}
|
|
32
|
+
const rValue = getFatherValue(obj, currentValue);
|
|
33
|
+
if (is) {
|
|
34
|
+
const rv = rValue ?? {};
|
|
35
|
+
if (obj.pars) {
|
|
36
|
+
objValue.setObjValue(currentValue, obj.prop, rv);
|
|
37
|
+
} else {
|
|
38
|
+
currentValue[obj.prop] = rv;
|
|
39
|
+
}
|
|
40
|
+
return rv;
|
|
41
|
+
}
|
|
42
|
+
return rValue;
|
|
43
|
+
}
|
|
44
|
+
function getFatherValue(obj, currentValue) {
|
|
45
|
+
if (obj.pars) {
|
|
46
|
+
return objValue.getObjValue(obj.prop, currentValue) ?? obj.default;
|
|
47
|
+
}
|
|
48
|
+
return (currentValue == null ? void 0 : currentValue[obj.prop]) ?? obj.default;
|
|
49
|
+
}
|
|
10
50
|
function useVueValue(v, key) {
|
|
11
51
|
if (key) {
|
|
12
52
|
if (v && isObject.isObject(v)) {
|
|
@@ -48,7 +88,7 @@ function getFormRule(obj) {
|
|
|
48
88
|
return prop;
|
|
49
89
|
}
|
|
50
90
|
const farrs = [];
|
|
51
|
-
|
|
91
|
+
getFathers.getFathers(obj, farrs);
|
|
52
92
|
if (farrs.length === 0) {
|
|
53
93
|
return prop;
|
|
54
94
|
}
|
|
@@ -105,7 +145,7 @@ function handleComputedWithoutDefault(obj, v) {
|
|
|
105
145
|
}
|
|
106
146
|
}
|
|
107
147
|
function setFormDefaultValue(obj, value) {
|
|
108
|
-
let v =
|
|
148
|
+
let v = getFatherData(obj, value);
|
|
109
149
|
if (obj.orig) {
|
|
110
150
|
v = value ?? {};
|
|
111
151
|
}
|
|
@@ -119,7 +159,7 @@ function setFormDefaultValue(obj, value) {
|
|
|
119
159
|
v[prop] = v[prop] ?? obj.default;
|
|
120
160
|
}
|
|
121
161
|
} else {
|
|
122
|
-
v =
|
|
162
|
+
v = getFatherData(obj, value, true);
|
|
123
163
|
if (obj.pars) {
|
|
124
164
|
objValue.setObjValue(v, prop, objValue.getObjValue(prop, v) ?? obj.default);
|
|
125
165
|
} else {
|
|
@@ -129,7 +169,7 @@ function setFormDefaultValue(obj, value) {
|
|
|
129
169
|
}
|
|
130
170
|
}
|
|
131
171
|
function setValue(value, obj, data) {
|
|
132
|
-
let v =
|
|
172
|
+
let v = getFatherData(obj, data);
|
|
133
173
|
if (obj.orig) {
|
|
134
174
|
v = data ?? {};
|
|
135
175
|
}
|
|
@@ -142,7 +182,7 @@ function setValue(value, obj, data) {
|
|
|
142
182
|
v[prop] = value;
|
|
143
183
|
}
|
|
144
184
|
} else {
|
|
145
|
-
v =
|
|
185
|
+
v = getFatherData(obj, data, true);
|
|
146
186
|
if (obj.pars) {
|
|
147
187
|
objValue.setObjValue(v, prop, value);
|
|
148
188
|
} else {
|
|
@@ -153,7 +193,7 @@ function setValue(value, obj, data) {
|
|
|
153
193
|
}
|
|
154
194
|
function getValue(obj, data, index2) {
|
|
155
195
|
const prop = obj.prop;
|
|
156
|
-
const cdata =
|
|
196
|
+
const cdata = getFatherData(obj, data);
|
|
157
197
|
let cellValue;
|
|
158
198
|
if (prop) {
|
|
159
199
|
if (obj.pars) {
|
|
@@ -423,7 +463,7 @@ function useVNodeComponDom(obj, data, slots, emit, config) {
|
|
|
423
463
|
}
|
|
424
464
|
function useObjComponSelected(obj, props) {
|
|
425
465
|
const arrs = [obj];
|
|
426
|
-
|
|
466
|
+
getFathers.getFathers(obj, arrs);
|
|
427
467
|
let componSelected = props.componSelected;
|
|
428
468
|
for (const v of arrs) {
|
|
429
469
|
componSelected = v.componSelected ?? componSelected;
|
|
@@ -465,7 +505,7 @@ function getLabelText(obj) {
|
|
|
465
505
|
}
|
|
466
506
|
if (!obj.label) {
|
|
467
507
|
const farrs = [];
|
|
468
|
-
|
|
508
|
+
getFathers.getFathers(obj, farrs);
|
|
469
509
|
farrs.reverse();
|
|
470
510
|
for (const v of farrs) {
|
|
471
511
|
if (v.labelText) {
|
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
import { isVNode, h, resolveComponent, computed, Fragment, render } from "vue";
|
|
2
2
|
import { isHTMLTag, isSVGTag } from "../../utils/vues/shared.js";
|
|
3
3
|
import { getEventKey, eventAliass } from "../../hooks/event-aliass/index.js";
|
|
4
|
-
import { getFathers
|
|
4
|
+
import { getFathers } from "../../utils/getFathers.js";
|
|
5
5
|
import { isObject } from "@fangzhongya/utils/basic/object/isObject";
|
|
6
6
|
import { lineToLargeHump } from "@fangzhongya/utils/name/lineToLargeHump";
|
|
7
7
|
import { setObjValue, getObjValue } from "@fangzhongya/utils/basic/object/objValue";
|
|
8
|
+
function getFatherData(obj, row, is) {
|
|
9
|
+
if (obj.orig) {
|
|
10
|
+
return row;
|
|
11
|
+
}
|
|
12
|
+
const farrs = [];
|
|
13
|
+
getFathers(obj, farrs);
|
|
14
|
+
if (farrs.length === 0) {
|
|
15
|
+
return row;
|
|
16
|
+
}
|
|
17
|
+
let currentValue = row;
|
|
18
|
+
for (const v of farrs) {
|
|
19
|
+
currentValue = processFatherObject(v, currentValue, row, is);
|
|
20
|
+
}
|
|
21
|
+
return currentValue;
|
|
22
|
+
}
|
|
23
|
+
function processFatherObject(obj, currentValue, row, is) {
|
|
24
|
+
if (obj.orig) {
|
|
25
|
+
return row;
|
|
26
|
+
}
|
|
27
|
+
if (!obj.prop) {
|
|
28
|
+
return currentValue;
|
|
29
|
+
}
|
|
30
|
+
const rValue = getFatherValue(obj, currentValue);
|
|
31
|
+
if (is) {
|
|
32
|
+
const rv = rValue ?? {};
|
|
33
|
+
if (obj.pars) {
|
|
34
|
+
setObjValue(currentValue, obj.prop, rv);
|
|
35
|
+
} else {
|
|
36
|
+
currentValue[obj.prop] = rv;
|
|
37
|
+
}
|
|
38
|
+
return rv;
|
|
39
|
+
}
|
|
40
|
+
return rValue;
|
|
41
|
+
}
|
|
42
|
+
function getFatherValue(obj, currentValue) {
|
|
43
|
+
if (obj.pars) {
|
|
44
|
+
return getObjValue(obj.prop, currentValue) ?? obj.default;
|
|
45
|
+
}
|
|
46
|
+
return (currentValue == null ? void 0 : currentValue[obj.prop]) ?? obj.default;
|
|
47
|
+
}
|
|
8
48
|
function useVueValue(v, key) {
|
|
9
49
|
if (key) {
|
|
10
50
|
if (v && isObject(v)) {
|
|
@@ -103,7 +143,7 @@ function handleComputedWithoutDefault(obj, v) {
|
|
|
103
143
|
}
|
|
104
144
|
}
|
|
105
145
|
function setFormDefaultValue(obj, value) {
|
|
106
|
-
let v =
|
|
146
|
+
let v = getFatherData(obj, value);
|
|
107
147
|
if (obj.orig) {
|
|
108
148
|
v = value ?? {};
|
|
109
149
|
}
|
|
@@ -117,7 +157,7 @@ function setFormDefaultValue(obj, value) {
|
|
|
117
157
|
v[prop] = v[prop] ?? obj.default;
|
|
118
158
|
}
|
|
119
159
|
} else {
|
|
120
|
-
v =
|
|
160
|
+
v = getFatherData(obj, value, true);
|
|
121
161
|
if (obj.pars) {
|
|
122
162
|
setObjValue(v, prop, getObjValue(prop, v) ?? obj.default);
|
|
123
163
|
} else {
|
|
@@ -127,7 +167,7 @@ function setFormDefaultValue(obj, value) {
|
|
|
127
167
|
}
|
|
128
168
|
}
|
|
129
169
|
function setValue(value, obj, data) {
|
|
130
|
-
let v =
|
|
170
|
+
let v = getFatherData(obj, data);
|
|
131
171
|
if (obj.orig) {
|
|
132
172
|
v = data ?? {};
|
|
133
173
|
}
|
|
@@ -140,7 +180,7 @@ function setValue(value, obj, data) {
|
|
|
140
180
|
v[prop] = value;
|
|
141
181
|
}
|
|
142
182
|
} else {
|
|
143
|
-
v =
|
|
183
|
+
v = getFatherData(obj, data, true);
|
|
144
184
|
if (obj.pars) {
|
|
145
185
|
setObjValue(v, prop, value);
|
|
146
186
|
} else {
|
|
@@ -151,7 +191,7 @@ function setValue(value, obj, data) {
|
|
|
151
191
|
}
|
|
152
192
|
function getValue(obj, data, index) {
|
|
153
193
|
const prop = obj.prop;
|
|
154
|
-
const cdata =
|
|
194
|
+
const cdata = getFatherData(obj, data);
|
|
155
195
|
let cellValue;
|
|
156
196
|
if (prop) {
|
|
157
197
|
if (obj.pars) {
|
|
@@ -43,7 +43,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43
43
|
getListValue
|
|
44
44
|
} = setup.setUp(props, emit, cs, refForm, getLocale);
|
|
45
45
|
function setKey(value, index2) {
|
|
46
|
-
return [index2, value.label, value.prop, value.compon].join(
|
|
46
|
+
return [index2, value.key, value.label, value.prop, value.compon].join(
|
|
47
|
+
"-"
|
|
48
|
+
);
|
|
47
49
|
}
|
|
48
50
|
const onUpform = (...arr) => emit("upform", ...arr);
|
|
49
51
|
__expose({
|
|
@@ -41,7 +41,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
getListValue
|
|
42
42
|
} = setUp(props, emit, cs, refForm, getLocale);
|
|
43
43
|
function setKey(value, index) {
|
|
44
|
-
return [index, value.label, value.prop, value.compon].join(
|
|
44
|
+
return [index, value.key, value.label, value.prop, value.compon].join(
|
|
45
|
+
"-"
|
|
46
|
+
);
|
|
45
47
|
}
|
|
46
48
|
const onUpform = (...arr) => emit("upform", ...arr);
|
|
47
49
|
__expose({
|
|
@@ -88,7 +88,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
88
88
|
emit("adjust", item, index2, obj, data2);
|
|
89
89
|
}
|
|
90
90
|
function setKey(value, index2) {
|
|
91
|
-
return [index2, value.label, value.prop, value.compon].join(
|
|
91
|
+
return [index2, value.key, value.label, value.prop, value.compon].join(
|
|
92
|
+
"-"
|
|
93
|
+
);
|
|
92
94
|
}
|
|
93
95
|
__expose({
|
|
94
96
|
el: refEl,
|
|
@@ -86,7 +86,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
86
|
emit("adjust", item, index, obj, data);
|
|
87
87
|
}
|
|
88
88
|
function setKey(value, index) {
|
|
89
|
-
return [index, value.label, value.prop, value.compon].join(
|
|
89
|
+
return [index, value.key, value.label, value.prop, value.compon].join(
|
|
90
|
+
"-"
|
|
91
|
+
);
|
|
90
92
|
}
|
|
91
93
|
__expose({
|
|
92
94
|
el: refEl,
|
|
@@ -43,7 +43,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
function setKey(value2, index2) {
|
|
46
|
-
return [index2, value2.label, value2.prop, value2.compon].join(
|
|
46
|
+
return [index2, value2.key, value2.label, value2.prop, value2.compon].join(
|
|
47
|
+
"-"
|
|
48
|
+
);
|
|
47
49
|
}
|
|
48
50
|
const onUpform = (...arr) => emit("upform", ...arr);
|
|
49
51
|
function setStyles(v) {
|
|
@@ -41,7 +41,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
function setKey(value2, index) {
|
|
44
|
-
return [index, value2.label, value2.prop, value2.compon].join(
|
|
44
|
+
return [index, value2.key, value2.label, value2.prop, value2.compon].join(
|
|
45
|
+
"-"
|
|
46
|
+
);
|
|
45
47
|
}
|
|
46
48
|
const onUpform = (...arr) => emit("upform", ...arr);
|
|
47
49
|
function setStyles(v) {
|
|
@@ -7,7 +7,7 @@ const index$2 = require("../../icon/index.cjs");
|
|
|
7
7
|
const use = require("../../common/use.cjs");
|
|
8
8
|
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
9
9
|
const util = require("./util.cjs");
|
|
10
|
-
const
|
|
10
|
+
const getFathers = require("../../../utils/getFathers.cjs");
|
|
11
11
|
const only = require("../../../utils/only.cjs");
|
|
12
12
|
const index = require("../../../hooks/props-default/index.cjs");
|
|
13
13
|
const name = "menu-li";
|
|
@@ -86,7 +86,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
86
86
|
const setIndexValue = (v, obj, config = {}) => {
|
|
87
87
|
if (props.level) {
|
|
88
88
|
const farr = [obj];
|
|
89
|
-
|
|
89
|
+
getFathers.getFathers(obj, farr);
|
|
90
90
|
const p = config.prop;
|
|
91
91
|
const j = typeof props.level === "boolean" ? "-" : props.level;
|
|
92
92
|
return farr.map((o) => o[p]).join(j);
|
|
@@ -5,7 +5,7 @@ import { Icon } from "../../icon/index.js";
|
|
|
5
5
|
import { useHide } from "../../common/use.js";
|
|
6
6
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
7
7
|
import { setLabel } from "./util.js";
|
|
8
|
-
import { getFathers } from "../../../utils/
|
|
8
|
+
import { getFathers } from "../../../utils/getFathers.js";
|
|
9
9
|
import { getOnly } from "../../../utils/only.js";
|
|
10
10
|
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
11
11
|
const name = "menu-li";
|
|
@@ -86,20 +86,21 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
86
86
|
return getColumnList(v);
|
|
87
87
|
} else {
|
|
88
88
|
return getColumnList(props.list, (obj) => {
|
|
89
|
+
var _a2;
|
|
89
90
|
obj.required = false;
|
|
90
91
|
obj.whole = false;
|
|
91
|
-
return Boolean(obj.query);
|
|
92
|
+
return Boolean((_a2 = obj.page) == null ? void 0 : _a2.query);
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
};
|
|
95
96
|
const listQuery = vue.ref([]);
|
|
96
97
|
const setListQuery = () => {
|
|
97
|
-
var _a;
|
|
98
|
+
var _a, _b;
|
|
98
99
|
const list2 = getListQuery();
|
|
99
100
|
if ((_a = props.config.query) == null ? void 0 : _a.senior) {
|
|
100
101
|
let i = 0;
|
|
101
102
|
for (const obj of list2) {
|
|
102
|
-
if (obj.querybasis) {
|
|
103
|
+
if ((_b = obj.page) == null ? void 0 : _b.querybasis) {
|
|
103
104
|
i++;
|
|
104
105
|
} else {
|
|
105
106
|
obj.hide = () => {
|
|
@@ -108,7 +109,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
if (i == 0) {
|
|
111
|
-
list2[0]
|
|
112
|
+
if (list2[0]) {
|
|
113
|
+
list2[0].hide = void 0;
|
|
114
|
+
}
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
listQuery.value = list2;
|
|
@@ -179,7 +182,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
179
182
|
};
|
|
180
183
|
const getList = () => {
|
|
181
184
|
return getColumnList(props.list, (obj) => {
|
|
182
|
-
|
|
185
|
+
var _a;
|
|
186
|
+
if (((_a = obj.page) == null ? void 0 : _a.componform) === true) {
|
|
183
187
|
obj.compon = void 0;
|
|
184
188
|
}
|
|
185
189
|
return true;
|
|
@@ -464,7 +468,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
464
468
|
return getColumnList(v);
|
|
465
469
|
} else {
|
|
466
470
|
return getColumnList(props.list, (obj) => {
|
|
467
|
-
|
|
471
|
+
var _a2, _b2;
|
|
472
|
+
return ((_a2 = obj.page) == null ? void 0 : _a2.form) && ((_b2 = obj.page) == null ? void 0 : _b2.isedit) === false;
|
|
468
473
|
});
|
|
469
474
|
}
|
|
470
475
|
} else {
|
|
@@ -473,7 +478,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
473
478
|
return getColumnList(v);
|
|
474
479
|
} else {
|
|
475
480
|
return getColumnList(props.list, (obj) => {
|
|
476
|
-
|
|
481
|
+
var _a2;
|
|
482
|
+
return Boolean((_a2 = obj.page) == null ? void 0 : _a2.form);
|
|
477
483
|
});
|
|
478
484
|
}
|
|
479
485
|
}
|
|
@@ -617,7 +623,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
617
623
|
key: 0,
|
|
618
624
|
class: vue.normalizeClass(vue.unref(cs).z("query"))
|
|
619
625
|
}, [
|
|
620
|
-
vue.
|
|
626
|
+
listQuery.value.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$6.Forms), vue.mergeProps({ key: 0 }, (_b = vue.unref(props).config.query) == null ? void 0 : _b.config, {
|
|
621
627
|
query: "",
|
|
622
628
|
"label-position": "auto",
|
|
623
629
|
"model-value": vue.unref(props).query,
|
|
@@ -636,7 +642,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
636
642
|
])
|
|
637
643
|
};
|
|
638
644
|
})
|
|
639
|
-
]), 1040, ["model-value", "options", "compons", "list", "buts"])
|
|
645
|
+
]), 1040, ["model-value", "options", "compons", "list", "buts"])) : vue.createCommentVNode("", true)
|
|
640
646
|
], 2)) : vue.createCommentVNode("", true)
|
|
641
647
|
], 2),
|
|
642
648
|
vue.createElementVNode("div", {
|
|
@@ -683,6 +689,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
683
689
|
class: vue.normalizeClass(vue.unref(cs).z("operations"))
|
|
684
690
|
}, [
|
|
685
691
|
vue.createVNode(vue.unref(index$8.Buttons), {
|
|
692
|
+
isStop: "",
|
|
686
693
|
options: vue.unref(operationColumn),
|
|
687
694
|
onClicks: (item) => onOperation(item, row)
|
|
688
695
|
}, null, 8, ["options", "onClicks"]),
|
|
@@ -84,20 +84,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
84
|
return getColumnList(v);
|
|
85
85
|
} else {
|
|
86
86
|
return getColumnList(props.list, (obj) => {
|
|
87
|
+
var _a2;
|
|
87
88
|
obj.required = false;
|
|
88
89
|
obj.whole = false;
|
|
89
|
-
return Boolean(obj.query);
|
|
90
|
+
return Boolean((_a2 = obj.page) == null ? void 0 : _a2.query);
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
93
|
};
|
|
93
94
|
const listQuery = ref([]);
|
|
94
95
|
const setListQuery = () => {
|
|
95
|
-
var _a;
|
|
96
|
+
var _a, _b;
|
|
96
97
|
const list2 = getListQuery();
|
|
97
98
|
if ((_a = props.config.query) == null ? void 0 : _a.senior) {
|
|
98
99
|
let i = 0;
|
|
99
100
|
for (const obj of list2) {
|
|
100
|
-
if (obj.querybasis) {
|
|
101
|
+
if ((_b = obj.page) == null ? void 0 : _b.querybasis) {
|
|
101
102
|
i++;
|
|
102
103
|
} else {
|
|
103
104
|
obj.hide = () => {
|
|
@@ -106,7 +107,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
if (i == 0) {
|
|
109
|
-
list2[0]
|
|
110
|
+
if (list2[0]) {
|
|
111
|
+
list2[0].hide = void 0;
|
|
112
|
+
}
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
listQuery.value = list2;
|
|
@@ -177,7 +180,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
177
180
|
};
|
|
178
181
|
const getList = () => {
|
|
179
182
|
return getColumnList(props.list, (obj) => {
|
|
180
|
-
|
|
183
|
+
var _a;
|
|
184
|
+
if (((_a = obj.page) == null ? void 0 : _a.componform) === true) {
|
|
181
185
|
obj.compon = void 0;
|
|
182
186
|
}
|
|
183
187
|
return true;
|
|
@@ -462,7 +466,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
462
466
|
return getColumnList(v);
|
|
463
467
|
} else {
|
|
464
468
|
return getColumnList(props.list, (obj) => {
|
|
465
|
-
|
|
469
|
+
var _a2, _b2;
|
|
470
|
+
return ((_a2 = obj.page) == null ? void 0 : _a2.form) && ((_b2 = obj.page) == null ? void 0 : _b2.isedit) === false;
|
|
466
471
|
});
|
|
467
472
|
}
|
|
468
473
|
} else {
|
|
@@ -471,7 +476,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
471
476
|
return getColumnList(v);
|
|
472
477
|
} else {
|
|
473
478
|
return getColumnList(props.list, (obj) => {
|
|
474
|
-
|
|
479
|
+
var _a2;
|
|
480
|
+
return Boolean((_a2 = obj.page) == null ? void 0 : _a2.form);
|
|
475
481
|
});
|
|
476
482
|
}
|
|
477
483
|
}
|
|
@@ -615,7 +621,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
615
621
|
key: 0,
|
|
616
622
|
class: normalizeClass(unref(cs).z("query"))
|
|
617
623
|
}, [
|
|
618
|
-
|
|
624
|
+
listQuery.value.length > 0 ? (openBlock(), createBlock(unref(Forms), mergeProps({ key: 0 }, (_b = unref(props).config.query) == null ? void 0 : _b.config, {
|
|
619
625
|
query: "",
|
|
620
626
|
"label-position": "auto",
|
|
621
627
|
"model-value": unref(props).query,
|
|
@@ -634,7 +640,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
634
640
|
])
|
|
635
641
|
};
|
|
636
642
|
})
|
|
637
|
-
]), 1040, ["model-value", "options", "compons", "list", "buts"])
|
|
643
|
+
]), 1040, ["model-value", "options", "compons", "list", "buts"])) : createCommentVNode("", true)
|
|
638
644
|
], 2)) : createCommentVNode("", true)
|
|
639
645
|
], 2),
|
|
640
646
|
createElementVNode("div", {
|
|
@@ -681,6 +687,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
681
687
|
class: normalizeClass(unref(cs).z("operations"))
|
|
682
688
|
}, [
|
|
683
689
|
createVNode(unref(Buttons), {
|
|
690
|
+
isStop: "",
|
|
684
691
|
options: unref(operationColumn),
|
|
685
692
|
onClicks: (item) => onOperation(item, row)
|
|
686
693
|
}, null, 8, ["options", "onClicks"]),
|
|
@@ -130,6 +130,7 @@ function getTableColumn(obj, emit, props, slots, index2, def) {
|
|
|
130
130
|
index$1.TableColumn,
|
|
131
131
|
{
|
|
132
132
|
...setProps(obj, props),
|
|
133
|
+
key: [index2, obj.key, obj.label, obj.prop, obj.compon].join("-"),
|
|
133
134
|
className: obj.class,
|
|
134
135
|
minWidth: util.setMinWidth(obj, props)
|
|
135
136
|
},
|
|
@@ -128,6 +128,7 @@ function getTableColumn(obj, emit, props, slots, index, def) {
|
|
|
128
128
|
TableColumn,
|
|
129
129
|
{
|
|
130
130
|
...setProps(obj, props),
|
|
131
|
+
key: [index, obj.key, obj.label, obj.prop, obj.compon].join("-"),
|
|
131
132
|
className: obj.class,
|
|
132
133
|
minWidth: setMinWidth(obj, props)
|
|
133
134
|
},
|
|
@@ -267,6 +267,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
267
267
|
minWidth?: string | number | undefined;
|
|
268
268
|
whole?: boolean | undefined;
|
|
269
269
|
type?: string | undefined;
|
|
270
|
+
key?: string | undefined;
|
|
270
271
|
}[], ListObj[] | {
|
|
271
272
|
[x: string]: any;
|
|
272
273
|
isdiv?: boolean | undefined;
|
|
@@ -308,6 +309,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
308
309
|
minWidth?: string | number | undefined;
|
|
309
310
|
whole?: boolean | undefined;
|
|
310
311
|
type?: string | undefined;
|
|
312
|
+
key?: string | undefined;
|
|
311
313
|
}[]>;
|
|
312
314
|
onRadioChange: (obj: ObjAny) => void;
|
|
313
315
|
getSelection: () => ObjStr[];
|
|
@@ -2,24 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
function useModel(props, emit, defaultValue, key = "modelValue") {
|
|
5
|
-
const internalValue = vue.ref(defaultValue);
|
|
6
5
|
const instance = vue.getCurrentInstance();
|
|
7
6
|
const hasExternalValue = vue.computed(() => {
|
|
8
7
|
if (!instance) return false;
|
|
9
8
|
const vnodeProps = instance.vnode.props || {};
|
|
10
9
|
return key in vnodeProps;
|
|
11
10
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const state = vue.reactive({
|
|
12
|
+
internalValue: defaultValue == null ? void 0 : defaultValue(),
|
|
13
|
+
get value() {
|
|
14
|
+
if (hasExternalValue.value) {
|
|
15
|
+
const z = props[key];
|
|
16
|
+
if (z === void 0) {
|
|
17
|
+
const v = defaultValue == null ? void 0 : defaultValue();
|
|
18
|
+
if (v) {
|
|
19
|
+
emit(`update:${key}`, v);
|
|
20
|
+
return v;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return z;
|
|
24
|
+
} else {
|
|
25
|
+
return this.internalValue;
|
|
26
|
+
}
|
|
15
27
|
},
|
|
16
|
-
set(v) {
|
|
28
|
+
set value(v) {
|
|
17
29
|
if (hasExternalValue.value) {
|
|
18
|
-
emit(
|
|
30
|
+
emit(`update:${key}`, v);
|
|
19
31
|
} else {
|
|
20
|
-
internalValue
|
|
32
|
+
this.internalValue = v;
|
|
21
33
|
}
|
|
22
34
|
}
|
|
23
35
|
});
|
|
36
|
+
return vue.toRef(state, "value");
|
|
24
37
|
}
|
|
25
38
|
exports.useModel = useModel;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useModel<T>(props: ObjAny, emit: Function, defaultValue?: T, key?: string):
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare function useModel<T>(props: ObjAny, emit: Function, defaultValue?: () => T, key?: string): Ref<any, any>;
|
|
@@ -1,24 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCurrentInstance, computed, reactive, toRef } from "vue";
|
|
2
2
|
function useModel(props, emit, defaultValue, key = "modelValue") {
|
|
3
|
-
const internalValue = ref(defaultValue);
|
|
4
3
|
const instance = getCurrentInstance();
|
|
5
4
|
const hasExternalValue = computed(() => {
|
|
6
5
|
if (!instance) return false;
|
|
7
6
|
const vnodeProps = instance.vnode.props || {};
|
|
8
7
|
return key in vnodeProps;
|
|
9
8
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const state = reactive({
|
|
10
|
+
internalValue: defaultValue == null ? void 0 : defaultValue(),
|
|
11
|
+
get value() {
|
|
12
|
+
if (hasExternalValue.value) {
|
|
13
|
+
const z = props[key];
|
|
14
|
+
if (z === void 0) {
|
|
15
|
+
const v = defaultValue == null ? void 0 : defaultValue();
|
|
16
|
+
if (v) {
|
|
17
|
+
emit(`update:${key}`, v);
|
|
18
|
+
return v;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return z;
|
|
22
|
+
} else {
|
|
23
|
+
return this.internalValue;
|
|
24
|
+
}
|
|
13
25
|
},
|
|
14
|
-
set(v) {
|
|
26
|
+
set value(v) {
|
|
15
27
|
if (hasExternalValue.value) {
|
|
16
|
-
emit(
|
|
28
|
+
emit(`update:${key}`, v);
|
|
17
29
|
} else {
|
|
18
|
-
internalValue
|
|
30
|
+
this.internalValue = v;
|
|
19
31
|
}
|
|
20
32
|
}
|
|
21
33
|
});
|
|
34
|
+
return toRef(state, "value");
|
|
22
35
|
}
|
|
23
36
|
export {
|
|
24
37
|
useModel
|
package/dist/icons/index.json
CHANGED
package/dist/type.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getFathers(obj: ListObj, arr: ListObj[]): void;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/util.cjs
CHANGED
|
@@ -1,53 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const objValue = require("@fangzhongya/utils/basic/object/objValue");
|
|
4
3
|
const getContent = require("@fangzhongya/utils/basic/string/getContent");
|
|
5
|
-
function getFathers(obj, arr) {
|
|
6
|
-
if (obj.__father) {
|
|
7
|
-
arr.unshift(obj.__father);
|
|
8
|
-
getFathers(obj.__father, arr);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
function getChildrenData(obj, row, is) {
|
|
12
|
-
if (obj.orig) {
|
|
13
|
-
return row;
|
|
14
|
-
}
|
|
15
|
-
const farrs = [];
|
|
16
|
-
getFathers(obj, farrs);
|
|
17
|
-
if (farrs.length === 0) {
|
|
18
|
-
return row;
|
|
19
|
-
}
|
|
20
|
-
let currentValue = row;
|
|
21
|
-
for (const obj2 of farrs) {
|
|
22
|
-
currentValue = processFatherObject(obj2, currentValue, is, row);
|
|
23
|
-
}
|
|
24
|
-
return currentValue;
|
|
25
|
-
}
|
|
26
|
-
function processFatherObject(obj, currentValue, is, row) {
|
|
27
|
-
if (obj.orig) {
|
|
28
|
-
return row;
|
|
29
|
-
}
|
|
30
|
-
if (!obj.prop) {
|
|
31
|
-
return currentValue;
|
|
32
|
-
}
|
|
33
|
-
const nextValue = getNextValue(obj, currentValue);
|
|
34
|
-
if (is) {
|
|
35
|
-
const rv = nextValue ?? {};
|
|
36
|
-
if (obj.pars) {
|
|
37
|
-
objValue.setObjValue(currentValue, obj.prop, rv);
|
|
38
|
-
} else {
|
|
39
|
-
currentValue[obj.prop] = rv;
|
|
40
|
-
}
|
|
41
|
-
return rv;
|
|
42
|
-
}
|
|
43
|
-
return nextValue;
|
|
44
|
-
}
|
|
45
|
-
function getNextValue(obj, currentValue) {
|
|
46
|
-
if (obj.pars) {
|
|
47
|
-
return objValue.getObjValue(obj.prop, currentValue) ?? obj.default;
|
|
48
|
-
}
|
|
49
|
-
return (currentValue == null ? void 0 : currentValue[obj.prop]) ?? obj.default;
|
|
50
|
-
}
|
|
51
4
|
function executionMethod(fun, ...arr) {
|
|
52
5
|
var _a;
|
|
53
6
|
if (typeof fun === "string") {
|
|
@@ -57,5 +10,3 @@ function executionMethod(fun, ...arr) {
|
|
|
57
10
|
}
|
|
58
11
|
}
|
|
59
12
|
exports.executionMethod = executionMethod;
|
|
60
|
-
exports.getChildrenData = getChildrenData;
|
|
61
|
-
exports.getFathers = getFathers;
|
package/dist/utils/util.d.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export declare function getFathers(obj: ListObj, arr: ListObj[]): void;
|
|
2
|
-
/**
|
|
3
|
-
* @error
|
|
4
|
-
* 代码过于复杂,
|
|
5
|
-
* 做了些无用的工作,
|
|
6
|
-
* 使用情况极低
|
|
7
|
-
*/
|
|
8
|
-
export declare function getChildrenData(obj: ListObj, row: ObjAny, is?: boolean): ObjAny;
|
|
9
1
|
export declare function executionMethod<T>(fun: Function | string, ...arr: any[]): T;
|
package/dist/utils/util.js
CHANGED
|
@@ -1,51 +1,4 @@
|
|
|
1
|
-
import { setObjValue, getObjValue } from "@fangzhongya/utils/basic/object/objValue";
|
|
2
1
|
import { getContents } from "@fangzhongya/utils/basic/string/getContent";
|
|
3
|
-
function getFathers(obj, arr) {
|
|
4
|
-
if (obj.__father) {
|
|
5
|
-
arr.unshift(obj.__father);
|
|
6
|
-
getFathers(obj.__father, arr);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
function getChildrenData(obj, row, is) {
|
|
10
|
-
if (obj.orig) {
|
|
11
|
-
return row;
|
|
12
|
-
}
|
|
13
|
-
const farrs = [];
|
|
14
|
-
getFathers(obj, farrs);
|
|
15
|
-
if (farrs.length === 0) {
|
|
16
|
-
return row;
|
|
17
|
-
}
|
|
18
|
-
let currentValue = row;
|
|
19
|
-
for (const obj2 of farrs) {
|
|
20
|
-
currentValue = processFatherObject(obj2, currentValue, is, row);
|
|
21
|
-
}
|
|
22
|
-
return currentValue;
|
|
23
|
-
}
|
|
24
|
-
function processFatherObject(obj, currentValue, is, row) {
|
|
25
|
-
if (obj.orig) {
|
|
26
|
-
return row;
|
|
27
|
-
}
|
|
28
|
-
if (!obj.prop) {
|
|
29
|
-
return currentValue;
|
|
30
|
-
}
|
|
31
|
-
const nextValue = getNextValue(obj, currentValue);
|
|
32
|
-
if (is) {
|
|
33
|
-
const rv = nextValue ?? {};
|
|
34
|
-
if (obj.pars) {
|
|
35
|
-
setObjValue(currentValue, obj.prop, rv);
|
|
36
|
-
} else {
|
|
37
|
-
currentValue[obj.prop] = rv;
|
|
38
|
-
}
|
|
39
|
-
return rv;
|
|
40
|
-
}
|
|
41
|
-
return nextValue;
|
|
42
|
-
}
|
|
43
|
-
function getNextValue(obj, currentValue) {
|
|
44
|
-
if (obj.pars) {
|
|
45
|
-
return getObjValue(obj.prop, currentValue) ?? obj.default;
|
|
46
|
-
}
|
|
47
|
-
return (currentValue == null ? void 0 : currentValue[obj.prop]) ?? obj.default;
|
|
48
|
-
}
|
|
49
2
|
function executionMethod(fun, ...arr) {
|
|
50
3
|
var _a;
|
|
51
4
|
if (typeof fun === "string") {
|
|
@@ -55,7 +8,5 @@ function executionMethod(fun, ...arr) {
|
|
|
55
8
|
}
|
|
56
9
|
}
|
|
57
10
|
export {
|
|
58
|
-
executionMethod
|
|
59
|
-
getChildrenData,
|
|
60
|
-
getFathers
|
|
11
|
+
executionMethod
|
|
61
12
|
};
|
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.79",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "fang-ui",
|
|
7
7
|
"keywords": [
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"vue": "^3.5.27",
|
|
52
52
|
"vue-tsc": "^3.2.2",
|
|
53
53
|
"vxe-table": "4.6.20",
|
|
54
|
+
"@fang-ui/components": "0.0.1-0",
|
|
54
55
|
"@fang-ui/directives": "0.0.1-0",
|
|
55
56
|
"@fang-ui/hooks": "0.0.1-0",
|
|
56
|
-
"@fang-ui/components": "0.0.1-0",
|
|
57
57
|
"@fang-ui/icons": "0.0.1-0",
|
|
58
58
|
"@fang-ui/locale": "0.0.1-0",
|
|
59
|
+
"@fang-ui/theme": "0.0.1-0",
|
|
59
60
|
"@fang-ui/types": "0.0.1-0",
|
|
60
|
-
"@fang-ui/utils": "0.0.1-0"
|
|
61
|
-
"@fang-ui/theme": "0.0.1-0"
|
|
61
|
+
"@fang-ui/utils": "0.0.1-0"
|
|
62
62
|
},
|
|
63
63
|
"main": "./dist/index.cjs",
|
|
64
64
|
"module": "./dist/index.js",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|