@fangzhongya/fang-ui 0.1.51 → 0.1.53
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/bin/fang-ui.js +2 -2
- package/dist/components/box-fun/index.cjs +1 -0
- package/dist/components/box-fun/index.js +1 -0
- package/dist/components/box-fun/index.scss +8 -0
- package/dist/components/box-fun/style/index2.scss +4 -0
- package/dist/components/buttons/src/data.d.ts +14 -11
- package/dist/components/cascaders/src/data.d.ts +14 -11
- package/dist/components/cascaders/src/index2.cjs +15 -8
- package/dist/components/cascaders/src/index2.js +15 -8
- package/dist/components/checks/src/data.d.ts +14 -11
- package/dist/components/checks/src/index2.cjs +6 -6
- package/dist/components/checks/src/index2.js +6 -6
- package/dist/components/common/list.cjs +34 -15
- package/dist/components/common/list.d.ts +25 -12
- package/dist/components/common/list.js +34 -15
- package/dist/components/common/use.cjs +9 -5
- package/dist/components/common/use.js +9 -5
- package/dist/components/dates/src/data.d.ts +14 -11
- package/dist/components/dates2/src/data.d.ts +14 -11
- package/dist/components/draggable/style/index2.scss +1 -0
- package/dist/components/edit-data/index.cjs +9 -0
- package/dist/components/edit-data/index.d.ts +5 -0
- package/dist/components/edit-data/index.js +9 -0
- package/dist/components/edit-data/index.scss +95 -0
- package/dist/components/edit-data/src/area/array-json.cjs +4 -0
- package/dist/components/edit-data/src/area/array-json.js +4 -0
- package/dist/components/edit-data/src/area/array-json2.cjs +109 -0
- package/dist/components/edit-data/src/area/array-json2.js +109 -0
- package/dist/components/edit-data/src/area/array.cjs +4 -0
- package/dist/components/edit-data/src/area/array.js +4 -0
- package/dist/components/edit-data/src/area/array2.cjs +135 -0
- package/dist/components/edit-data/src/area/array2.js +135 -0
- package/dist/components/edit-data/src/area/code.cjs +4 -0
- package/dist/components/edit-data/src/area/code.js +4 -0
- package/dist/components/edit-data/src/area/code2.cjs +52 -0
- package/dist/components/edit-data/src/area/code2.js +52 -0
- package/dist/components/edit-data/src/area/editor.cjs +4 -0
- package/dist/components/edit-data/src/area/editor.js +4 -0
- package/dist/components/edit-data/src/area/editor2.cjs +170 -0
- package/dist/components/edit-data/src/area/editor2.js +170 -0
- package/dist/components/edit-data/src/area/general.cjs +4 -0
- package/dist/components/edit-data/src/area/general.js +4 -0
- package/dist/components/edit-data/src/area/general2.cjs +88 -0
- package/dist/components/edit-data/src/area/general2.js +88 -0
- package/dist/components/edit-data/src/area/object-json.cjs +4 -0
- package/dist/components/edit-data/src/area/object-json.js +4 -0
- package/dist/components/edit-data/src/area/object-json2.cjs +109 -0
- package/dist/components/edit-data/src/area/object-json2.js +109 -0
- package/dist/components/edit-data/src/area/object.cjs +4 -0
- package/dist/components/edit-data/src/area/object.js +4 -0
- package/dist/components/edit-data/src/area/object2.cjs +116 -0
- package/dist/components/edit-data/src/area/object2.js +116 -0
- package/dist/components/edit-data/src/data/array.cjs +4 -0
- package/dist/components/edit-data/src/data/array.js +4 -0
- package/dist/components/edit-data/src/data/array2.cjs +68 -0
- package/dist/components/edit-data/src/data/array2.js +68 -0
- package/dist/components/edit-data/src/data/bigint.cjs +4 -0
- package/dist/components/edit-data/src/data/bigint.js +4 -0
- package/dist/components/edit-data/src/data/bigint2.cjs +42 -0
- package/dist/components/edit-data/src/data/bigint2.js +42 -0
- package/dist/components/edit-data/src/data/boolean.cjs +4 -0
- package/dist/components/edit-data/src/data/boolean.js +4 -0
- package/dist/components/edit-data/src/data/boolean2.cjs +53 -0
- package/dist/components/edit-data/src/data/boolean2.js +53 -0
- package/dist/components/edit-data/src/data/function.cjs +4 -0
- package/dist/components/edit-data/src/data/function.js +4 -0
- package/dist/components/edit-data/src/data/function2.cjs +61 -0
- package/dist/components/edit-data/src/data/function2.js +61 -0
- package/dist/components/edit-data/src/data/not.cjs +4 -0
- package/dist/components/edit-data/src/data/not.js +4 -0
- package/dist/components/edit-data/src/data/not2.cjs +56 -0
- package/dist/components/edit-data/src/data/not2.js +56 -0
- package/dist/components/edit-data/src/data/null.cjs +4 -0
- package/dist/components/edit-data/src/data/null.js +4 -0
- package/dist/components/edit-data/src/data/null2.cjs +24 -0
- package/dist/components/edit-data/src/data/null2.js +24 -0
- package/dist/components/edit-data/src/data/number.cjs +4 -0
- package/dist/components/edit-data/src/data/number.js +4 -0
- package/dist/components/edit-data/src/data/number2.cjs +42 -0
- package/dist/components/edit-data/src/data/number2.js +42 -0
- package/dist/components/edit-data/src/data/object.cjs +4 -0
- package/dist/components/edit-data/src/data/object.js +4 -0
- package/dist/components/edit-data/src/data/object2.cjs +68 -0
- package/dist/components/edit-data/src/data/object2.js +68 -0
- package/dist/components/edit-data/src/data/other.cjs +4 -0
- package/dist/components/edit-data/src/data/other.js +4 -0
- package/dist/components/edit-data/src/data/other2.cjs +59 -0
- package/dist/components/edit-data/src/data/other2.js +59 -0
- package/dist/components/edit-data/src/data/string.cjs +4 -0
- package/dist/components/edit-data/src/data/string.js +4 -0
- package/dist/components/edit-data/src/data/string2.cjs +43 -0
- package/dist/components/edit-data/src/data/string2.js +43 -0
- package/dist/components/edit-data/src/data/symbol.cjs +4 -0
- package/dist/components/edit-data/src/data/symbol.js +4 -0
- package/dist/components/edit-data/src/data/symbol2.cjs +55 -0
- package/dist/components/edit-data/src/data/symbol2.js +55 -0
- package/dist/components/edit-data/src/data/undefined.cjs +4 -0
- package/dist/components/edit-data/src/data/undefined.js +4 -0
- package/dist/components/edit-data/src/data/undefined2.cjs +24 -0
- package/dist/components/edit-data/src/data/undefined2.js +24 -0
- package/dist/components/edit-data/src/data.cjs +57 -0
- package/dist/components/edit-data/src/data.d.ts +131 -0
- package/dist/components/edit-data/src/data.js +57 -0
- package/dist/components/edit-data/src/index.cjs +4 -0
- package/dist/components/edit-data/src/index.js +4 -0
- package/dist/components/edit-data/src/index2.cjs +134 -0
- package/dist/components/edit-data/src/index2.js +134 -0
- package/dist/components/edit-data/src/util.cjs +99 -0
- package/dist/components/edit-data/src/util.d.ts +1 -0
- package/dist/components/edit-data/src/util.js +99 -0
- package/dist/components/edit-data/style/index2.scss +13 -0
- package/dist/components/edit-data-add/index.cjs +9 -0
- package/dist/components/edit-data-add/index.css +144 -0
- package/dist/components/edit-data-add/index.d.ts +5 -0
- package/dist/components/edit-data-add/index.js +9 -0
- package/dist/components/edit-data-add/index.scss +5 -0
- package/dist/components/edit-data-add/src/data.cjs +24 -0
- package/dist/components/edit-data-add/src/data.d.ts +36 -0
- package/dist/components/edit-data-add/src/data.js +24 -0
- package/dist/components/edit-data-add/src/index.cjs +4 -0
- package/dist/components/edit-data-add/src/index.js +4 -0
- package/dist/components/edit-data-add/src/index2.cjs +241 -0
- package/dist/components/edit-data-add/src/index2.js +241 -0
- package/dist/components/edit-data-add/style/comm.scss +38 -0
- package/dist/components/edit-data-add/style/index2.scss +2 -0
- package/dist/components/history/src/data.cjs +9 -1
- package/dist/components/history/src/data.d.ts +13 -1
- package/dist/components/history/src/data.js +9 -1
- package/dist/components/history/src/index2.cjs +27 -9
- package/dist/components/history/src/index2.js +27 -9
- package/dist/components/index.cjs +60 -56
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.scss +3 -0
- package/dist/components/index2.scss +5 -2
- package/dist/components/labels/src/data.d.ts +14 -11
- package/dist/components/labels/src/index2.cjs +13 -2
- package/dist/components/labels/src/index2.js +13 -2
- package/dist/components/page/index.css +8 -0
- package/dist/components/retract/index.css +20 -0
- package/dist/components/retract/index.scss +24 -0
- package/dist/components/retract/src/data.cjs +10 -0
- package/dist/components/retract/src/data.d.ts +10 -0
- package/dist/components/retract/src/data.js +10 -0
- package/dist/components/retract/src/index2.cjs +24 -4
- package/dist/components/retract/src/index2.js +23 -3
- package/dist/components/retract/style/index2.scss +1 -0
- package/dist/components/selects/src/data.d.ts +14 -11
- package/dist/components/selects/src/index2.cjs +1 -1
- package/dist/components/selects/src/index2.js +1 -1
- package/dist/components/switchs/src/data.d.ts +14 -11
- package/dist/components/switchs/src/index2.cjs +9 -5
- package/dist/components/switchs/src/index2.js +9 -5
- package/dist/components/tables/common/com-limit.cjs +4 -0
- package/dist/components/tables/common/com-limit.js +4 -0
- package/dist/components/tables/common/com-limit2.cjs +103 -0
- package/dist/components/tables/common/com-limit2.js +103 -0
- package/dist/components/tables/common/com.scss +12 -0
- package/dist/components/tables/index.css +9 -0
- package/dist/components/tables/index.scss +2 -0
- package/dist/components/tables/src/columns2.cjs +3 -1
- package/dist/components/tables/src/columns2.js +7 -5
- package/dist/components/tablesp/index.css +9 -0
- package/dist/components/tablespd/index.css +9 -0
- package/dist/components/uploads/src/data.d.ts +14 -11
- package/dist/css/edit-data-add.css +144 -0
- package/dist/css/index.css +149 -0
- package/dist/css/page.css +8 -0
- package/dist/css/retract.css +20 -0
- package/dist/css/tables.css +9 -0
- package/dist/css/tablesp.css +9 -0
- package/dist/css/tablespd.css +9 -0
- package/dist/directives/adjust/index.cjs +14 -6
- package/dist/directives/adjust/index.js +14 -6
- package/dist/directives/adjustment/index.cjs +622 -0
- package/dist/directives/adjustment/index.d.ts +7 -0
- package/dist/directives/adjustment/index.js +622 -0
- package/dist/directives/index.cjs +18 -16
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/index.js +16 -14
- package/dist/expand/{chunk-A7IW6WRD.cjs → chunk-BJVT6JH7.cjs} +6 -0
- package/dist/expand/{chunk-L4FI5HCY.js → chunk-I5UJEJJB.js} +6 -0
- package/dist/expand/components.cjs +5 -5
- package/dist/expand/components.js +1 -1
- package/dist/expand/config.cjs +2 -2
- package/dist/expand/config.js +1 -1
- package/dist/icons/index.json +1 -1
- package/dist/index.cjs +84 -78
- package/dist/index.css +149 -0
- package/dist/index.js +20 -14
- package/dist/utils/util.cjs +1 -1
- package/dist/utils/util.js +2 -2
- package/dist/utils/vues/withInstall.cjs +2 -1
- package/dist/utils/vues/withInstall.js +2 -1
- package/package.json +12 -11
- /package/dist/components/{draggable → keep-com}/index.css +0 -0
- /package/dist/css/{draggable.css → keep-com.css} +0 -0
package/bin/fang-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
import { add, update, batUp } from '../node/cli.js';
|
|
@@ -16,7 +16,7 @@ const father = argv[3];
|
|
|
16
16
|
const props = argv[4];
|
|
17
17
|
console.log('argv', argv);
|
|
18
18
|
if (catalogue) {
|
|
19
|
-
if (type == 'add') {
|
|
19
|
+
if (type == 'add' || type == 'a') {
|
|
20
20
|
add(curUrl, catalogue, argv[2], father, props);
|
|
21
21
|
} else if (type == 'u') {
|
|
22
22
|
// if (argv[2]) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
;/* empty css */
|
|
3
4
|
const index = require("./src/index.cjs");
|
|
4
5
|
const _function = require("./src/function.cjs");
|
|
5
6
|
const BoxFun = _function.withInstall(index.default, "BoxFun");
|
|
@@ -16,10 +16,10 @@ export declare const dataProps: {
|
|
|
16
16
|
};
|
|
17
17
|
options: {
|
|
18
18
|
type: {
|
|
19
|
-
(arrayLength: number): ObjAny[];
|
|
20
|
-
(...items: ObjAny[]): ObjAny[];
|
|
21
|
-
new (arrayLength: number): ObjAny[];
|
|
22
|
-
new (...items: ObjAny[]): ObjAny[];
|
|
19
|
+
(arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
20
|
+
(...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
21
|
+
new (arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
22
|
+
new (...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
23
23
|
isArray(arg: any): arg is any[];
|
|
24
24
|
readonly prototype: any[];
|
|
25
25
|
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
@@ -33,9 +33,6 @@ export declare const dataProps: {
|
|
|
33
33
|
};
|
|
34
34
|
default(): never[];
|
|
35
35
|
};
|
|
36
|
-
clearAbsent: {
|
|
37
|
-
type: BooleanConstructor;
|
|
38
|
-
};
|
|
39
36
|
label: {
|
|
40
37
|
type: (StringConstructor | FunctionConstructor)[];
|
|
41
38
|
default: string;
|
|
@@ -50,11 +47,17 @@ export declare const dataProps: {
|
|
|
50
47
|
multiple: {
|
|
51
48
|
type: (BooleanConstructor | StringConstructor)[];
|
|
52
49
|
};
|
|
53
|
-
|
|
54
|
-
type: BooleanConstructor
|
|
50
|
+
isLoad: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
};
|
|
53
|
+
isClearAbsent: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
};
|
|
56
|
+
isOptobj: {
|
|
57
|
+
type: BooleanConstructor;
|
|
55
58
|
};
|
|
56
|
-
|
|
57
|
-
type:
|
|
59
|
+
default: {
|
|
60
|
+
type: null;
|
|
58
61
|
};
|
|
59
62
|
};
|
|
60
63
|
export type DataProps = ExtractPropTypes<typeof dataProps>;
|
|
@@ -26,10 +26,10 @@ export declare const dataProps: {
|
|
|
26
26
|
};
|
|
27
27
|
options: {
|
|
28
28
|
type: {
|
|
29
|
-
(arrayLength: number): ObjAny[];
|
|
30
|
-
(...items: ObjAny[]): ObjAny[];
|
|
31
|
-
new (arrayLength: number): ObjAny[];
|
|
32
|
-
new (...items: ObjAny[]): ObjAny[];
|
|
29
|
+
(arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
30
|
+
(...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
31
|
+
new (arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
32
|
+
new (...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
33
33
|
isArray(arg: any): arg is any[];
|
|
34
34
|
readonly prototype: any[];
|
|
35
35
|
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
@@ -43,9 +43,6 @@ export declare const dataProps: {
|
|
|
43
43
|
};
|
|
44
44
|
default(): never[];
|
|
45
45
|
};
|
|
46
|
-
clearAbsent: {
|
|
47
|
-
type: BooleanConstructor;
|
|
48
|
-
};
|
|
49
46
|
label: {
|
|
50
47
|
type: (StringConstructor | FunctionConstructor)[];
|
|
51
48
|
default: string;
|
|
@@ -60,11 +57,17 @@ export declare const dataProps: {
|
|
|
60
57
|
multiple: {
|
|
61
58
|
type: (BooleanConstructor | StringConstructor)[];
|
|
62
59
|
};
|
|
63
|
-
|
|
64
|
-
type: BooleanConstructor
|
|
60
|
+
isLoad: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
};
|
|
63
|
+
isClearAbsent: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
};
|
|
66
|
+
isOptobj: {
|
|
67
|
+
type: BooleanConstructor;
|
|
65
68
|
};
|
|
66
|
-
|
|
67
|
-
type:
|
|
69
|
+
default: {
|
|
70
|
+
type: null;
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
73
|
export type DataProps = ExtractPropTypes<typeof dataProps>;
|
|
@@ -40,15 +40,22 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
40
|
});
|
|
41
41
|
const setAllName = (arr, names) => {
|
|
42
42
|
arr.forEach((o) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
if (o && typeof o === "object") {
|
|
44
|
+
const c = o[propss.value.children];
|
|
45
|
+
const m = use.useVueValue(o, propss.value.label);
|
|
46
|
+
const arr2 = [...names];
|
|
47
|
+
arr2.push(m);
|
|
48
|
+
o[allname] = arr2.join(props.separator);
|
|
49
|
+
if (c) {
|
|
50
|
+
setAllName(c, arr2);
|
|
51
|
+
}
|
|
52
|
+
return o;
|
|
53
|
+
} else {
|
|
54
|
+
const m = use.useVueValue(o, propss.value.label);
|
|
55
|
+
const arr2 = [...names];
|
|
56
|
+
arr2.push(m);
|
|
57
|
+
return o;
|
|
50
58
|
}
|
|
51
|
-
return o;
|
|
52
59
|
});
|
|
53
60
|
};
|
|
54
61
|
const options = vue.computed(() => {
|
|
@@ -38,15 +38,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
38
|
});
|
|
39
39
|
const setAllName = (arr, names) => {
|
|
40
40
|
arr.forEach((o) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
if (o && typeof o === "object") {
|
|
42
|
+
const c = o[propss.value.children];
|
|
43
|
+
const m = useVueValue(o, propss.value.label);
|
|
44
|
+
const arr2 = [...names];
|
|
45
|
+
arr2.push(m);
|
|
46
|
+
o[allname] = arr2.join(props.separator);
|
|
47
|
+
if (c) {
|
|
48
|
+
setAllName(c, arr2);
|
|
49
|
+
}
|
|
50
|
+
return o;
|
|
51
|
+
} else {
|
|
52
|
+
const m = useVueValue(o, propss.value.label);
|
|
53
|
+
const arr2 = [...names];
|
|
54
|
+
arr2.push(m);
|
|
55
|
+
return o;
|
|
48
56
|
}
|
|
49
|
-
return o;
|
|
50
57
|
});
|
|
51
58
|
};
|
|
52
59
|
const options = computed(() => {
|
|
@@ -14,10 +14,10 @@ export declare const dataProps: {
|
|
|
14
14
|
};
|
|
15
15
|
options: {
|
|
16
16
|
type: {
|
|
17
|
-
(arrayLength: number): ObjAny[];
|
|
18
|
-
(...items: ObjAny[]): ObjAny[];
|
|
19
|
-
new (arrayLength: number): ObjAny[];
|
|
20
|
-
new (...items: ObjAny[]): ObjAny[];
|
|
17
|
+
(arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
18
|
+
(...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
19
|
+
new (arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
20
|
+
new (...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
21
21
|
isArray(arg: any): arg is any[];
|
|
22
22
|
readonly prototype: any[];
|
|
23
23
|
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
@@ -31,9 +31,6 @@ export declare const dataProps: {
|
|
|
31
31
|
};
|
|
32
32
|
default(): never[];
|
|
33
33
|
};
|
|
34
|
-
clearAbsent: {
|
|
35
|
-
type: BooleanConstructor;
|
|
36
|
-
};
|
|
37
34
|
label: {
|
|
38
35
|
type: (StringConstructor | FunctionConstructor)[];
|
|
39
36
|
default: string;
|
|
@@ -48,11 +45,17 @@ export declare const dataProps: {
|
|
|
48
45
|
multiple: {
|
|
49
46
|
type: (BooleanConstructor | StringConstructor)[];
|
|
50
47
|
};
|
|
51
|
-
|
|
52
|
-
type: BooleanConstructor
|
|
48
|
+
isLoad: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
};
|
|
51
|
+
isClearAbsent: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
};
|
|
54
|
+
isOptobj: {
|
|
55
|
+
type: BooleanConstructor;
|
|
53
56
|
};
|
|
54
|
-
|
|
55
|
-
type:
|
|
57
|
+
default: {
|
|
58
|
+
type: null;
|
|
56
59
|
};
|
|
57
60
|
};
|
|
58
61
|
export type DataProps = ExtractPropTypes<typeof dataProps>;
|
|
@@ -71,8 +71,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
71
71
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).options, (item) => {
|
|
72
72
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(comps.value), {
|
|
73
73
|
value: vue.unref(use.useVueValue)(item, vue.unref(props).prop),
|
|
74
|
-
border: item
|
|
75
|
-
disabled: item
|
|
74
|
+
border: typeof item === "object" && item !== null ? item.border : void 0,
|
|
75
|
+
disabled: typeof item === "object" && item !== null ? item.disabled : void 0,
|
|
76
76
|
onChange: (is) => onChange(item, is)
|
|
77
77
|
}, {
|
|
78
78
|
default: vue.withCtx(() => [
|
|
@@ -95,15 +95,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
95
95
|
default: vue.withCtx(() => [
|
|
96
96
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(props).options, (item) => {
|
|
97
97
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(comps.value), {
|
|
98
|
-
border: item
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
border: typeof item === "object" && item !== null ? item.border : void 0,
|
|
99
|
+
disabled: typeof item === "object" && item !== null ? item.disabled : void 0,
|
|
100
|
+
value: vue.unref(use.useVueValue)(item, vue.unref(props).prop)
|
|
101
101
|
}, {
|
|
102
102
|
default: vue.withCtx(() => [
|
|
103
103
|
vue.createTextVNode(vue.toDisplayString(vue.unref(use.useVueValue)(item, vue.unref(props).label)), 1)
|
|
104
104
|
]),
|
|
105
105
|
_: 2
|
|
106
|
-
}, 1032, ["border", "
|
|
106
|
+
}, 1032, ["border", "disabled", "value"]);
|
|
107
107
|
}), 256))
|
|
108
108
|
]),
|
|
109
109
|
_: 1
|
|
@@ -69,8 +69,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
69
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(props).options, (item) => {
|
|
70
70
|
return openBlock(), createBlock(resolveDynamicComponent(comps.value), {
|
|
71
71
|
value: unref(useVueValue)(item, unref(props).prop),
|
|
72
|
-
border: item
|
|
73
|
-
disabled: item
|
|
72
|
+
border: typeof item === "object" && item !== null ? item.border : void 0,
|
|
73
|
+
disabled: typeof item === "object" && item !== null ? item.disabled : void 0,
|
|
74
74
|
onChange: (is) => onChange(item, is)
|
|
75
75
|
}, {
|
|
76
76
|
default: withCtx(() => [
|
|
@@ -93,15 +93,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
93
93
|
default: withCtx(() => [
|
|
94
94
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(props).options, (item) => {
|
|
95
95
|
return openBlock(), createBlock(resolveDynamicComponent(comps.value), {
|
|
96
|
-
border: item
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
border: typeof item === "object" && item !== null ? item.border : void 0,
|
|
97
|
+
disabled: typeof item === "object" && item !== null ? item.disabled : void 0,
|
|
98
|
+
value: unref(useVueValue)(item, unref(props).prop)
|
|
99
99
|
}, {
|
|
100
100
|
default: withCtx(() => [
|
|
101
101
|
createTextVNode(toDisplayString(unref(useVueValue)(item, unref(props).label)), 1)
|
|
102
102
|
]),
|
|
103
103
|
_: 2
|
|
104
|
-
}, 1032, ["border", "
|
|
104
|
+
}, 1032, ["border", "disabled", "value"]);
|
|
105
105
|
}), 256))
|
|
106
106
|
]),
|
|
107
107
|
_: 1
|
|
@@ -12,10 +12,6 @@ const props = {
|
|
|
12
12
|
return [];
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
// 清除不存在的值
|
|
16
|
-
clearAbsent: {
|
|
17
|
-
type: Boolean
|
|
18
|
-
},
|
|
19
15
|
/**
|
|
20
16
|
* @props { String, Function } label=label 列表中展示名称
|
|
21
17
|
*/
|
|
@@ -42,14 +38,29 @@ const props = {
|
|
|
42
38
|
multiple: {
|
|
43
39
|
type: [Boolean, String]
|
|
44
40
|
},
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @props { Boolean } isLoad 是否监听options 返回最新值 load
|
|
43
|
+
*/
|
|
44
|
+
isLoad: {
|
|
45
|
+
type: Boolean
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* @props { Boolean } isClearAbsent 清除不存在的值
|
|
49
|
+
*/
|
|
50
|
+
isClearAbsent: {
|
|
51
|
+
type: Boolean
|
|
47
52
|
},
|
|
48
53
|
/**
|
|
49
|
-
* 是否获取对应对象数据
|
|
54
|
+
* @props { Boolean } isOptobj 是否获取对应对象数据
|
|
50
55
|
*/
|
|
51
|
-
|
|
52
|
-
type:
|
|
56
|
+
isOptobj: {
|
|
57
|
+
type: Boolean
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* @props { } default 值为是undefined时使用默认值据
|
|
61
|
+
*/
|
|
62
|
+
default: {
|
|
63
|
+
type: null
|
|
53
64
|
}
|
|
54
65
|
};
|
|
55
66
|
const emits = ["update:modelValue", "change", "load"];
|
|
@@ -64,11 +75,19 @@ function comHandle(props2, emit, config) {
|
|
|
64
75
|
};
|
|
65
76
|
const value = vue.computed({
|
|
66
77
|
get() {
|
|
67
|
-
|
|
78
|
+
const v = setMultipleValue(props2.modelValue);
|
|
79
|
+
if (v === void 0 && props2.default !== void 0) {
|
|
80
|
+
value.value = props2.default;
|
|
81
|
+
} else {
|
|
82
|
+
return v;
|
|
83
|
+
}
|
|
68
84
|
},
|
|
69
85
|
set(d) {
|
|
86
|
+
if (d === void 0 && props2.default !== void 0) {
|
|
87
|
+
d = props2.default;
|
|
88
|
+
}
|
|
70
89
|
const v = getMultipleValue(d);
|
|
71
|
-
if (props2.
|
|
90
|
+
if (props2.isOptobj) {
|
|
72
91
|
emit("change", v, getValueObjs(d), props2.modelValue);
|
|
73
92
|
} else {
|
|
74
93
|
emit("change", v, void 0, props2.modelValue);
|
|
@@ -144,15 +163,15 @@ function comHandle(props2, emit, config) {
|
|
|
144
163
|
}
|
|
145
164
|
}
|
|
146
165
|
}
|
|
147
|
-
if (props2.
|
|
166
|
+
if (props2.isLoad) {
|
|
148
167
|
vue.watch(
|
|
149
|
-
() => props2.options,
|
|
168
|
+
[() => props2.options, () => props2.options.length],
|
|
150
169
|
() => {
|
|
151
170
|
if (props2.options && props2.options.length > 0) {
|
|
152
171
|
const v = getMultipleValue(value.value);
|
|
153
|
-
if (props2.
|
|
172
|
+
if (props2.isOptobj) {
|
|
154
173
|
const obj = getValueObjs(value.value);
|
|
155
|
-
if (props2.
|
|
174
|
+
if (props2.isClearAbsent) {
|
|
156
175
|
setClearAbsentValue(obj);
|
|
157
176
|
}
|
|
158
177
|
emit("load", v, obj);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WritableComputedRef, Ref } from 'vue';
|
|
2
|
+
type Options = ObjAny | string | number | boolean;
|
|
2
3
|
/**
|
|
3
4
|
* 列表数据,带单多选择的
|
|
4
5
|
*/
|
|
@@ -8,10 +9,10 @@ export declare const props: {
|
|
|
8
9
|
*/
|
|
9
10
|
options: {
|
|
10
11
|
type: {
|
|
11
|
-
(arrayLength: number):
|
|
12
|
-
(...items:
|
|
13
|
-
new (arrayLength: number):
|
|
14
|
-
new (...items:
|
|
12
|
+
(arrayLength: number): Options[];
|
|
13
|
+
(...items: Options[]): Options[];
|
|
14
|
+
new (arrayLength: number): Options[];
|
|
15
|
+
new (...items: Options[]): Options[];
|
|
15
16
|
isArray(arg: any): arg is any[];
|
|
16
17
|
readonly prototype: any[];
|
|
17
18
|
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
@@ -25,9 +26,6 @@ export declare const props: {
|
|
|
25
26
|
};
|
|
26
27
|
default(): never[];
|
|
27
28
|
};
|
|
28
|
-
clearAbsent: {
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
};
|
|
31
29
|
/**
|
|
32
30
|
* @props { String, Function } label=label 列表中展示名称
|
|
33
31
|
*/
|
|
@@ -54,14 +52,29 @@ export declare const props: {
|
|
|
54
52
|
multiple: {
|
|
55
53
|
type: (BooleanConstructor | StringConstructor)[];
|
|
56
54
|
};
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @props { Boolean } isLoad 是否监听options 返回最新值 load
|
|
57
|
+
*/
|
|
58
|
+
isLoad: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @props { Boolean } isClearAbsent 清除不存在的值
|
|
63
|
+
*/
|
|
64
|
+
isClearAbsent: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @props { Boolean } isOptobj 是否获取对应对象数据
|
|
69
|
+
*/
|
|
70
|
+
isOptobj: {
|
|
71
|
+
type: BooleanConstructor;
|
|
59
72
|
};
|
|
60
73
|
/**
|
|
61
|
-
*
|
|
74
|
+
* @props { } default 值为是undefined时使用默认值据
|
|
62
75
|
*/
|
|
63
|
-
|
|
64
|
-
type:
|
|
76
|
+
default: {
|
|
77
|
+
type: null;
|
|
65
78
|
};
|
|
66
79
|
};
|
|
67
80
|
/**
|
|
@@ -10,10 +10,6 @@ const props = {
|
|
|
10
10
|
return [];
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
-
// 清除不存在的值
|
|
14
|
-
clearAbsent: {
|
|
15
|
-
type: Boolean
|
|
16
|
-
},
|
|
17
13
|
/**
|
|
18
14
|
* @props { String, Function } label=label 列表中展示名称
|
|
19
15
|
*/
|
|
@@ -40,14 +36,29 @@ const props = {
|
|
|
40
36
|
multiple: {
|
|
41
37
|
type: [Boolean, String]
|
|
42
38
|
},
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @props { Boolean } isLoad 是否监听options 返回最新值 load
|
|
41
|
+
*/
|
|
42
|
+
isLoad: {
|
|
43
|
+
type: Boolean
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* @props { Boolean } isClearAbsent 清除不存在的值
|
|
47
|
+
*/
|
|
48
|
+
isClearAbsent: {
|
|
49
|
+
type: Boolean
|
|
45
50
|
},
|
|
46
51
|
/**
|
|
47
|
-
* 是否获取对应对象数据
|
|
52
|
+
* @props { Boolean } isOptobj 是否获取对应对象数据
|
|
48
53
|
*/
|
|
49
|
-
|
|
50
|
-
type:
|
|
54
|
+
isOptobj: {
|
|
55
|
+
type: Boolean
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* @props { } default 值为是undefined时使用默认值据
|
|
59
|
+
*/
|
|
60
|
+
default: {
|
|
61
|
+
type: null
|
|
51
62
|
}
|
|
52
63
|
};
|
|
53
64
|
const emits = ["update:modelValue", "change", "load"];
|
|
@@ -62,11 +73,19 @@ function comHandle(props2, emit, config) {
|
|
|
62
73
|
};
|
|
63
74
|
const value = computed({
|
|
64
75
|
get() {
|
|
65
|
-
|
|
76
|
+
const v = setMultipleValue(props2.modelValue);
|
|
77
|
+
if (v === void 0 && props2.default !== void 0) {
|
|
78
|
+
value.value = props2.default;
|
|
79
|
+
} else {
|
|
80
|
+
return v;
|
|
81
|
+
}
|
|
66
82
|
},
|
|
67
83
|
set(d) {
|
|
84
|
+
if (d === void 0 && props2.default !== void 0) {
|
|
85
|
+
d = props2.default;
|
|
86
|
+
}
|
|
68
87
|
const v = getMultipleValue(d);
|
|
69
|
-
if (props2.
|
|
88
|
+
if (props2.isOptobj) {
|
|
70
89
|
emit("change", v, getValueObjs(d), props2.modelValue);
|
|
71
90
|
} else {
|
|
72
91
|
emit("change", v, void 0, props2.modelValue);
|
|
@@ -142,15 +161,15 @@ function comHandle(props2, emit, config) {
|
|
|
142
161
|
}
|
|
143
162
|
}
|
|
144
163
|
}
|
|
145
|
-
if (props2.
|
|
164
|
+
if (props2.isLoad) {
|
|
146
165
|
watch(
|
|
147
|
-
() => props2.options,
|
|
166
|
+
[() => props2.options, () => props2.options.length],
|
|
148
167
|
() => {
|
|
149
168
|
if (props2.options && props2.options.length > 0) {
|
|
150
169
|
const v = getMultipleValue(value.value);
|
|
151
|
-
if (props2.
|
|
170
|
+
if (props2.isOptobj) {
|
|
152
171
|
const obj = getValueObjs(value.value);
|
|
153
|
-
if (props2.
|
|
172
|
+
if (props2.isClearAbsent) {
|
|
154
173
|
setClearAbsentValue(obj);
|
|
155
174
|
}
|
|
156
175
|
emit("load", v, obj);
|
|
@@ -8,11 +8,15 @@ 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
10
|
function useVueValue(v, key) {
|
|
11
|
-
if (key
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
if (key) {
|
|
12
|
+
if (v && isObject.isObject(v)) {
|
|
13
|
+
if (typeof key == "function") {
|
|
14
|
+
return key(v);
|
|
15
|
+
} else if (typeof key == "string") {
|
|
16
|
+
return v[key];
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
return v;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
return v;
|
|
@@ -6,11 +6,15 @@ 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
8
|
function useVueValue(v, key) {
|
|
9
|
-
if (key
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
if (key) {
|
|
10
|
+
if (v && isObject(v)) {
|
|
11
|
+
if (typeof key == "function") {
|
|
12
|
+
return key(v);
|
|
13
|
+
} else if (typeof key == "string") {
|
|
14
|
+
return v[key];
|
|
15
|
+
}
|
|
16
|
+
} else {
|
|
17
|
+
return v;
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
return v;
|
|
@@ -19,10 +19,10 @@ export declare const dataProps: {
|
|
|
19
19
|
};
|
|
20
20
|
options: {
|
|
21
21
|
type: {
|
|
22
|
-
(arrayLength: number): ObjAny[];
|
|
23
|
-
(...items: ObjAny[]): ObjAny[];
|
|
24
|
-
new (arrayLength: number): ObjAny[];
|
|
25
|
-
new (...items: ObjAny[]): ObjAny[];
|
|
22
|
+
(arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
23
|
+
(...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
24
|
+
new (arrayLength: number): (string | number | boolean | ObjAny)[];
|
|
25
|
+
new (...items: (string | number | boolean | ObjAny)[]): (string | number | boolean | ObjAny)[];
|
|
26
26
|
isArray(arg: any): arg is any[];
|
|
27
27
|
readonly prototype: any[];
|
|
28
28
|
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
@@ -36,9 +36,6 @@ export declare const dataProps: {
|
|
|
36
36
|
};
|
|
37
37
|
default(): never[];
|
|
38
38
|
};
|
|
39
|
-
clearAbsent: {
|
|
40
|
-
type: BooleanConstructor;
|
|
41
|
-
};
|
|
42
39
|
label: {
|
|
43
40
|
type: (StringConstructor | FunctionConstructor)[];
|
|
44
41
|
default: string;
|
|
@@ -50,11 +47,17 @@ export declare const dataProps: {
|
|
|
50
47
|
multiple: {
|
|
51
48
|
type: (BooleanConstructor | StringConstructor)[];
|
|
52
49
|
};
|
|
53
|
-
|
|
54
|
-
type: BooleanConstructor
|
|
50
|
+
isLoad: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
};
|
|
53
|
+
isClearAbsent: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
};
|
|
56
|
+
isOptobj: {
|
|
57
|
+
type: BooleanConstructor;
|
|
55
58
|
};
|
|
56
|
-
|
|
57
|
-
type:
|
|
59
|
+
default: {
|
|
60
|
+
type: null;
|
|
58
61
|
};
|
|
59
62
|
};
|
|
60
63
|
export type DataProps = ExtractPropTypes<typeof dataProps>;
|