@fangzhongya/fang-ui 0.1.55 → 0.1.57
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/audios/src/index2.cjs +16 -10
- package/dist/components/audios/src/index2.js +16 -10
- package/dist/components/box-adjust/src/index2.cjs +6 -4
- package/dist/components/box-adjust/src/index2.js +6 -4
- package/dist/components/box-title/src/index2.cjs +3 -2
- package/dist/components/box-title/src/index2.js +3 -2
- package/dist/components/buttons/src/data.d.ts +5 -5
- package/dist/components/buttons/src/index2.cjs +2 -2
- package/dist/components/buttons/src/index2.js +2 -2
- package/dist/components/cascaders/src/data.d.ts +5 -5
- package/dist/components/checks/src/data.d.ts +5 -5
- package/dist/components/common/list.d.ts +1 -1
- package/dist/components/common/use.cjs +1 -1
- package/dist/components/common/use.js +1 -1
- package/dist/components/dates/src/data.d.ts +5 -5
- package/dist/components/dates2/src/data.d.ts +5 -5
- package/dist/components/double/src/index2.cjs +3 -2
- package/dist/components/double/src/index2.js +3 -2
- package/dist/components/edit/index.css +5 -5
- package/dist/components/edit/index.scss +5 -5
- package/dist/components/edit/src/data.cjs +3 -2
- package/dist/components/edit/src/data.d.ts +5 -1
- package/dist/components/edit/src/data.js +3 -2
- package/dist/components/edit/src/index2.cjs +32 -23
- package/dist/components/edit/src/index2.js +32 -23
- package/dist/components/edit-data/src/area/array-json2.cjs +8 -4
- package/dist/components/edit-data/src/area/array-json2.js +8 -4
- package/dist/components/edit-data/src/area/array2.cjs +46 -8
- package/dist/components/edit-data/src/area/array2.js +47 -9
- package/dist/components/edit-data/src/area/editor2.cjs +22 -4
- package/dist/components/edit-data/src/area/editor2.js +22 -4
- package/dist/components/edit-data/src/area/general2.cjs +8 -1
- package/dist/components/edit-data/src/area/general2.js +8 -1
- package/dist/components/edit-data/src/area/object-json2.cjs +5 -1
- package/dist/components/edit-data/src/area/object-json2.js +5 -1
- package/dist/components/edit-data/src/area/object2.cjs +48 -11
- package/dist/components/edit-data/src/area/object2.js +49 -12
- package/dist/components/edit-data/src/data/array2.cjs +9 -5
- package/dist/components/edit-data/src/data/array2.js +9 -5
- package/dist/components/edit-data/src/data/bigint2.cjs +7 -3
- package/dist/components/edit-data/src/data/bigint2.js +7 -3
- package/dist/components/edit-data/src/data/boolean2.cjs +7 -3
- package/dist/components/edit-data/src/data/boolean2.js +7 -3
- package/dist/components/edit-data/src/data/date.cjs +4 -0
- package/dist/components/edit-data/src/data/date.js +4 -0
- package/dist/components/edit-data/src/data/date2.cjs +48 -0
- package/dist/components/edit-data/src/data/date2.js +48 -0
- package/dist/components/edit-data/src/data/function2.cjs +16 -7
- package/dist/components/edit-data/src/data/function2.js +17 -8
- package/dist/components/edit-data/src/data/null2.cjs +3 -1
- package/dist/components/edit-data/src/data/null2.js +4 -2
- package/dist/components/edit-data/src/data/number2.cjs +7 -3
- package/dist/components/edit-data/src/data/number2.js +7 -3
- package/dist/components/edit-data/src/data/object2.cjs +9 -5
- package/dist/components/edit-data/src/data/object2.js +9 -5
- package/dist/components/edit-data/src/data/other2.cjs +13 -5
- package/dist/components/edit-data/src/data/other2.js +14 -6
- package/dist/components/edit-data/src/data/string2.cjs +7 -3
- package/dist/components/edit-data/src/data/string2.js +7 -3
- package/dist/components/edit-data/src/data/symbol2.cjs +7 -3
- package/dist/components/edit-data/src/data/symbol2.js +7 -3
- package/dist/components/edit-data/src/data/undefined2.cjs +3 -1
- package/dist/components/edit-data/src/data/undefined2.js +4 -2
- package/dist/components/edit-data/src/data.cjs +10 -0
- package/dist/components/edit-data/src/data.d.ts +20 -0
- package/dist/components/edit-data/src/data.js +10 -0
- package/dist/components/edit-data/src/index2.cjs +31 -2
- package/dist/components/edit-data/src/index2.js +45 -16
- package/dist/components/edit-data-add/src/index2.cjs +2 -0
- package/dist/components/edit-data-add/src/index2.js +2 -0
- package/dist/components/edit-float/src/index2.cjs +3 -2
- package/dist/components/edit-float/src/index2.js +3 -2
- package/dist/components/history/src/index2.cjs +6 -4
- package/dist/components/history/src/index2.js +6 -4
- package/dist/components/input-array/src/index2.cjs +3 -2
- package/dist/components/input-array/src/index2.js +3 -2
- package/dist/components/input-history/src/index2.cjs +3 -2
- package/dist/components/input-history/src/index2.js +3 -2
- package/dist/components/input-select/src/index2.cjs +6 -4
- package/dist/components/input-select/src/index2.js +6 -4
- package/dist/components/labels/src/data.d.ts +5 -5
- package/dist/components/message/index.d.ts +11 -4
- package/dist/components/message/src/function.d.ts +11 -4
- package/dist/components/message-box/index.d.ts +2 -3
- package/dist/components/message-box/src/function.d.ts +2 -3
- package/dist/components/retract/index.css +23 -20
- package/dist/components/retract/index.scss +39 -20
- package/dist/components/retract/src/data.cjs +4 -1
- package/dist/components/retract/src/data.d.ts +4 -1
- package/dist/components/retract/src/data.js +4 -1
- package/dist/components/retract/src/index2.cjs +12 -10
- package/dist/components/retract/src/index2.js +9 -7
- package/dist/components/right-key/index.css +2 -1
- package/dist/components/right-key/index.scss +2 -1
- package/dist/components/right-key/src/data.cjs +7 -2
- package/dist/components/right-key/src/data.d.ts +5 -0
- package/dist/components/right-key/src/data.js +7 -2
- package/dist/components/right-key/src/index2.cjs +134 -60
- package/dist/components/right-key/src/index2.js +135 -61
- package/dist/components/selects/src/data.d.ts +5 -5
- package/dist/components/stick-window/src/index2.cjs +3 -2
- package/dist/components/stick-window/src/index2.js +3 -2
- package/dist/components/switchs/src/data.d.ts +5 -4
- package/dist/components/uploads/src/data.d.ts +5 -5
- package/dist/components/uploads/src/index2.cjs +26 -21
- package/dist/components/uploads/src/index2.js +15 -10
- package/dist/components/videos/src/index2.cjs +30 -19
- package/dist/components/videos/src/index2.js +30 -19
- package/dist/components/window/src/index2.cjs +9 -6
- package/dist/components/window/src/index2.js +9 -6
- package/dist/css/edit.css +5 -5
- package/dist/css/index.css +30 -26
- package/dist/css/retract.css +23 -20
- package/dist/css/right-key.css +2 -1
- package/dist/hooks/model/index.cjs +25 -0
- package/dist/hooks/model/index.d.ts +2 -0
- package/dist/hooks/model/index.js +25 -0
- package/dist/icons/index.json +1 -1
- package/dist/icons/vue/bar.cjs +2 -18
- package/dist/icons/vue/bar.js +1 -17
- package/dist/icons/vue/bar2.cjs +21 -2
- package/dist/icons/vue/bar2.js +21 -2
- package/dist/icons/vue/below.cjs +2 -18
- package/dist/icons/vue/below.js +1 -17
- package/dist/icons/vue/below2.cjs +21 -2
- package/dist/icons/vue/below2.js +21 -2
- package/dist/icons/vue/bicycle.cjs +2 -15
- package/dist/icons/vue/bicycle.js +1 -14
- package/dist/icons/vue/bicycle2.cjs +18 -2
- package/dist/icons/vue/bicycle2.js +18 -2
- package/dist/icons/vue/bottom-left.cjs +2 -22
- package/dist/icons/vue/bottom-left.js +1 -21
- package/dist/icons/vue/bottom-left2.cjs +25 -2
- package/dist/icons/vue/bottom-left2.js +25 -2
- package/dist/icons/vue/bottom-right.cjs +2 -22
- package/dist/icons/vue/bottom-right.js +1 -21
- package/dist/icons/vue/bottom-right2.cjs +25 -2
- package/dist/icons/vue/bottom-right2.js +25 -2
- package/dist/icons/vue/bottom.cjs +2 -18
- package/dist/icons/vue/bottom.js +1 -17
- package/dist/icons/vue/bottom2.cjs +21 -2
- package/dist/icons/vue/bottom2.js +21 -2
- package/dist/icons/vue/catalogue.cjs +2 -23
- package/dist/icons/vue/catalogue.js +1 -22
- package/dist/icons/vue/catalogue2.cjs +26 -2
- package/dist/icons/vue/catalogue2.js +26 -2
- package/dist/icons/vue/clear.cjs +2 -23
- package/dist/icons/vue/clear.js +1 -22
- package/dist/icons/vue/clear2.cjs +26 -2
- package/dist/icons/vue/clear2.js +26 -2
- package/dist/icons/vue/close.cjs +2 -18
- package/dist/icons/vue/close.js +1 -17
- package/dist/icons/vue/close2.cjs +21 -2
- package/dist/icons/vue/close2.js +21 -2
- package/dist/icons/vue/delete.cjs +2 -18
- package/dist/icons/vue/delete.js +1 -17
- package/dist/icons/vue/delete2.cjs +21 -2
- package/dist/icons/vue/delete2.js +21 -2
- package/dist/icons/vue/document.cjs +2 -23
- package/dist/icons/vue/document.js +1 -22
- package/dist/icons/vue/document2.cjs +26 -2
- package/dist/icons/vue/document2.js +26 -2
- package/dist/icons/vue/down.cjs +2 -18
- package/dist/icons/vue/down.js +1 -17
- package/dist/icons/vue/down2.cjs +21 -2
- package/dist/icons/vue/down2.js +21 -2
- package/dist/icons/vue/download.cjs +2 -18
- package/dist/icons/vue/download.js +1 -17
- package/dist/icons/vue/download2.cjs +21 -2
- package/dist/icons/vue/download2.js +21 -2
- package/dist/icons/vue/edit.cjs +2 -23
- package/dist/icons/vue/edit.js +1 -22
- package/dist/icons/vue/edit2.cjs +26 -2
- package/dist/icons/vue/edit2.js +26 -2
- package/dist/icons/vue/enter.cjs +2 -19
- package/dist/icons/vue/enter.js +1 -18
- package/dist/icons/vue/enter2.cjs +22 -2
- package/dist/icons/vue/enter2.js +22 -2
- package/dist/icons/vue/frame.cjs +2 -15
- package/dist/icons/vue/frame.js +1 -14
- package/dist/icons/vue/frame2.cjs +18 -2
- package/dist/icons/vue/frame2.js +18 -2
- package/dist/icons/vue/index.cjs +81 -54
- package/dist/icons/vue/index.js +54 -27
- package/dist/icons/vue/left.cjs +2 -18
- package/dist/icons/vue/left.js +1 -17
- package/dist/icons/vue/left2.cjs +21 -2
- package/dist/icons/vue/left2.js +21 -2
- package/dist/icons/vue/mute.cjs +2 -18
- package/dist/icons/vue/mute.js +1 -17
- package/dist/icons/vue/mute2.cjs +21 -2
- package/dist/icons/vue/mute2.js +21 -2
- package/dist/icons/vue/pause.cjs +2 -24
- package/dist/icons/vue/pause.js +1 -23
- package/dist/icons/vue/pause2.cjs +27 -2
- package/dist/icons/vue/pause2.js +27 -2
- package/dist/icons/vue/play.cjs +2 -19
- package/dist/icons/vue/play.js +1 -18
- package/dist/icons/vue/play2.cjs +22 -2
- package/dist/icons/vue/play2.js +22 -2
- package/dist/icons/vue/plus.cjs +2 -18
- package/dist/icons/vue/plus.js +1 -17
- package/dist/icons/vue/plus2.cjs +21 -2
- package/dist/icons/vue/plus2.js +21 -2
- package/dist/icons/vue/retreat.cjs +2 -19
- package/dist/icons/vue/retreat.js +1 -18
- package/dist/icons/vue/retreat2.cjs +22 -2
- package/dist/icons/vue/retreat2.js +22 -2
- package/dist/icons/vue/right.cjs +2 -18
- package/dist/icons/vue/right.js +1 -17
- package/dist/icons/vue/right2.cjs +21 -2
- package/dist/icons/vue/right2.js +21 -2
- package/dist/icons/vue/sound.cjs +2 -22
- package/dist/icons/vue/sound.js +1 -21
- package/dist/icons/vue/sound2.cjs +25 -2
- package/dist/icons/vue/sound2.js +25 -2
- package/dist/icons/vue/star.cjs +2 -22
- package/dist/icons/vue/star.js +1 -21
- package/dist/icons/vue/star2.cjs +25 -2
- package/dist/icons/vue/star2.js +25 -2
- package/dist/icons/vue/up.cjs +2 -18
- package/dist/icons/vue/up.js +1 -17
- package/dist/icons/vue/up2.cjs +21 -2
- package/dist/icons/vue/up2.js +21 -2
- package/dist/icons/vue/views.cjs +2 -18
- package/dist/icons/vue/views.js +1 -17
- package/dist/icons/vue/views2.cjs +21 -2
- package/dist/icons/vue/views2.js +21 -2
- package/dist/index.css +30 -26
- package/dist/utils/vues/index.d.ts +1 -0
- package/dist/utils/vues/shared.cjs +19 -0
- package/dist/utils/vues/shared.d.ts +5 -0
- package/dist/utils/vues/shared.js +19 -0
- package/package.json +10 -11
- package/dist/_virtual/_plugin-vue_export-helper.cjs +0 -10
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
- /package/dist/components/{keep-com → global-config}/index.css +0 -0
- /package/dist/css/{keep-com.css → global-config.css} +0 -0
|
@@ -8,6 +8,7 @@ const index$2 = require("../../../inputs/index.cjs");
|
|
|
8
8
|
const index$3 = require("../../../button/index.cjs");
|
|
9
9
|
require("./editor.cjs");
|
|
10
10
|
const index$4 = require("../../../message/index.cjs");
|
|
11
|
+
const deepCopy = require("@fangzhongya/utils/basic/object/deepCopy");
|
|
11
12
|
const json5 = require("json5");
|
|
12
13
|
const editor_vue_vue_type_script_setup_true_lang = require("./editor2.cjs");
|
|
13
14
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -32,6 +33,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
33
|
emit("update:modelValue", value2);
|
|
33
34
|
}
|
|
34
35
|
});
|
|
36
|
+
const code = vue.ref();
|
|
35
37
|
const inputValue = vue.computed(() => {
|
|
36
38
|
if (value.value) {
|
|
37
39
|
return json5.stringify(value.value);
|
|
@@ -51,6 +53,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
51
53
|
box.value = false;
|
|
52
54
|
};
|
|
53
55
|
const onClick = () => {
|
|
56
|
+
if (props.isConfirmUpdate) {
|
|
57
|
+
code.value = deepCopy.deepCopy(props.modelValue);
|
|
58
|
+
} else {
|
|
59
|
+
code.value = value.value;
|
|
60
|
+
}
|
|
54
61
|
box.value = true;
|
|
55
62
|
};
|
|
56
63
|
return (_ctx, _cache) => {
|
|
@@ -78,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
85
|
vue.createVNode(editor_vue_vue_type_script_setup_true_lang.default, vue.mergeProps(props, {
|
|
79
86
|
modelValue: box.value,
|
|
80
87
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => box.value = $event),
|
|
81
|
-
value:
|
|
88
|
+
value: code.value,
|
|
82
89
|
onSubmit
|
|
83
90
|
}), null, 16, ["modelValue", "value"])
|
|
84
91
|
], 2);
|
|
@@ -6,6 +6,7 @@ import { Inputs } from "../../../inputs/index.js";
|
|
|
6
6
|
import { Button } from "../../../button/index.js";
|
|
7
7
|
import "./editor.js";
|
|
8
8
|
import { Message } from "../../../message/index.js";
|
|
9
|
+
import { deepCopy } from "@fangzhongya/utils/basic/object/deepCopy";
|
|
9
10
|
import json5 from "json5";
|
|
10
11
|
import _sfc_main$1 from "./editor2.js";
|
|
11
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -30,6 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
31
|
emit("update:modelValue", value2);
|
|
31
32
|
}
|
|
32
33
|
});
|
|
34
|
+
const code = ref();
|
|
33
35
|
const inputValue = computed(() => {
|
|
34
36
|
if (value.value) {
|
|
35
37
|
return json5.stringify(value.value);
|
|
@@ -49,6 +51,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
51
|
box.value = false;
|
|
50
52
|
};
|
|
51
53
|
const onClick = () => {
|
|
54
|
+
if (props.isConfirmUpdate) {
|
|
55
|
+
code.value = deepCopy(props.modelValue);
|
|
56
|
+
} else {
|
|
57
|
+
code.value = value.value;
|
|
58
|
+
}
|
|
52
59
|
box.value = true;
|
|
53
60
|
};
|
|
54
61
|
return (_ctx, _cache) => {
|
|
@@ -76,7 +83,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
76
83
|
createVNode(_sfc_main$1, mergeProps(props, {
|
|
77
84
|
modelValue: box.value,
|
|
78
85
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => box.value = $event),
|
|
79
|
-
value:
|
|
86
|
+
value: code.value,
|
|
80
87
|
onSubmit
|
|
81
88
|
}), null, 16, ["modelValue", "value"])
|
|
82
89
|
], 2);
|
|
@@ -55,7 +55,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
55
55
|
if (typeof value.value === "string") {
|
|
56
56
|
value.value = value.value;
|
|
57
57
|
} else {
|
|
58
|
-
|
|
58
|
+
let o = value.value;
|
|
59
|
+
if (!props.isEmpty) {
|
|
60
|
+
o = o || {};
|
|
61
|
+
}
|
|
62
|
+
const v = json5.stringify(o, null, 4);
|
|
59
63
|
value.value = v;
|
|
60
64
|
}
|
|
61
65
|
return true;
|
|
@@ -53,7 +53,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
53
53
|
if (typeof value.value === "string") {
|
|
54
54
|
value.value = value.value;
|
|
55
55
|
} else {
|
|
56
|
-
|
|
56
|
+
let o = value.value;
|
|
57
|
+
if (!props.isEmpty) {
|
|
58
|
+
o = o || {};
|
|
59
|
+
}
|
|
60
|
+
const v = json5.stringify(o, null, 4);
|
|
57
61
|
value.value = v;
|
|
58
62
|
}
|
|
59
63
|
return true;
|
|
@@ -3,7 +3,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const index$4 = require("../../../no-data/index.cjs");
|
|
5
5
|
const index$3 = require("../../../icon/index.cjs");
|
|
6
|
-
|
|
6
|
+
require("../../../../icons/vue/edit.cjs");
|
|
7
|
+
require("../../../../icons/vue/delete.cjs");
|
|
7
8
|
const data = require("../data.cjs");
|
|
8
9
|
const index = require("../../../../hooks/cssname/index.cjs");
|
|
9
10
|
const index$1 = require("../../../../hooks/locale/index.cjs");
|
|
@@ -11,16 +12,22 @@ require("../index.cjs");
|
|
|
11
12
|
const index$2 = require("../../../button/index.cjs");
|
|
12
13
|
const index$5 = require("../../../edit-data-add/index.cjs");
|
|
13
14
|
const index_vue_vue_type_script_setup_true_lang = require("../index2.cjs");
|
|
15
|
+
const edit_vue_vue_type_script_setup_true_lang = require("../../../../icons/vue/edit2.cjs");
|
|
16
|
+
const delete_vue_vue_type_script_setup_true_lang = require("../../../../icons/vue/delete2.cjs");
|
|
14
17
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
15
18
|
__name: "object",
|
|
16
19
|
props: data.dataDataProps,
|
|
17
20
|
emits: data.dataDataEmits,
|
|
18
|
-
setup(__props, {
|
|
21
|
+
setup(__props, { emit: __emit }) {
|
|
19
22
|
const cs = index.useCssName(data.name);
|
|
20
23
|
const { getLocale } = index$1.useLocale();
|
|
21
24
|
const props = __props;
|
|
22
25
|
const emit = __emit;
|
|
23
|
-
const box = vue.
|
|
26
|
+
const box = vue.reactive({
|
|
27
|
+
value: false,
|
|
28
|
+
type: 0,
|
|
29
|
+
row: ""
|
|
30
|
+
});
|
|
24
31
|
const value = vue.computed({
|
|
25
32
|
get() {
|
|
26
33
|
return props.modelValue;
|
|
@@ -34,15 +41,29 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
34
41
|
};
|
|
35
42
|
const onAdd = () => {
|
|
36
43
|
box.value = true;
|
|
44
|
+
box.type = 0;
|
|
45
|
+
box.row = "";
|
|
37
46
|
};
|
|
38
47
|
const onSubmit = (v) => {
|
|
39
|
-
value.value
|
|
48
|
+
if (value.value === void 0) {
|
|
49
|
+
value.value = { [v.label]: v.value };
|
|
50
|
+
} else {
|
|
51
|
+
if (box.type == 0) {
|
|
52
|
+
value.value[v.label] = v.value;
|
|
53
|
+
} else {
|
|
54
|
+
value.value[box.row] = v.value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
40
57
|
};
|
|
41
58
|
const onDelete = (index2) => {
|
|
42
59
|
value.value[index2] = void 0;
|
|
43
60
|
delete value.value[index2];
|
|
44
61
|
};
|
|
45
|
-
|
|
62
|
+
const onEdit = (index2) => {
|
|
63
|
+
box.value = true;
|
|
64
|
+
box.type = 1;
|
|
65
|
+
box.row = index2;
|
|
66
|
+
};
|
|
46
67
|
return (_ctx, _cache) => {
|
|
47
68
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
48
69
|
class: vue.normalizeClass(vue.unref(cs).z("area-object"))
|
|
@@ -79,8 +100,24 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
79
100
|
}), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
80
101
|
], 2),
|
|
81
102
|
vue.createElementVNode("div", null, [
|
|
82
|
-
props.
|
|
103
|
+
props.isEmpty && item === void 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.Button), {
|
|
83
104
|
key: 0,
|
|
105
|
+
type: "primary",
|
|
106
|
+
onClick: ($event) => onEdit(index2),
|
|
107
|
+
text: ""
|
|
108
|
+
}, {
|
|
109
|
+
default: vue.withCtx(() => [
|
|
110
|
+
vue.createVNode(vue.unref(index$3.Icon), { title: "修改" }, {
|
|
111
|
+
default: vue.withCtx(() => [
|
|
112
|
+
vue.createVNode(edit_vue_vue_type_script_setup_true_lang.default)
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
})
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}, 8, ["onClick"])) : vue.createCommentVNode("", true),
|
|
119
|
+
props.editable ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.Button), {
|
|
120
|
+
key: 1,
|
|
84
121
|
type: "danger",
|
|
85
122
|
onClick: ($event) => onDelete(index2),
|
|
86
123
|
text: ""
|
|
@@ -88,7 +125,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
88
125
|
default: vue.withCtx(() => [
|
|
89
126
|
vue.createVNode(vue.unref(index$3.Icon), { title: "删除" }, {
|
|
90
127
|
default: vue.withCtx(() => [
|
|
91
|
-
vue.createVNode(
|
|
128
|
+
vue.createVNode(delete_vue_vue_type_script_setup_true_lang.default)
|
|
92
129
|
]),
|
|
93
130
|
_: 1
|
|
94
131
|
})
|
|
@@ -98,17 +135,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
98
135
|
])
|
|
99
136
|
], 2);
|
|
100
137
|
}), 128)),
|
|
101
|
-
Object.keys(value.value).length == 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.NoData), {
|
|
138
|
+
(value.value ? Object.keys(value.value).length == 0 : true) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.NoData), {
|
|
102
139
|
key: 1,
|
|
103
140
|
value: "空对象"
|
|
104
141
|
})) : vue.createCommentVNode("", true),
|
|
105
142
|
vue.createVNode(vue.unref(index$5.EditDataAdd), vue.mergeProps(props, {
|
|
106
|
-
type: "object",
|
|
107
|
-
title: "新增对象",
|
|
143
|
+
type: box.type == 1 ? "array" : "object",
|
|
144
|
+
title: box.type == 1 ? "修改对象" : "新增对象",
|
|
108
145
|
modelValue: box.value,
|
|
109
146
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => box.value = $event),
|
|
110
147
|
onSubmit
|
|
111
|
-
}), null, 16, ["modelValue"])
|
|
148
|
+
}), null, 16, ["type", "title", "modelValue"])
|
|
112
149
|
], 2);
|
|
113
150
|
};
|
|
114
151
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, reactive, computed, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createBlock, createVNode, withCtx, createTextVNode, Fragment, renderList, createElementVNode, toDisplayString, mergeProps } from "vue";
|
|
2
2
|
import { NoData } from "../../../no-data/index.js";
|
|
3
3
|
import { Icon } from "../../../icon/index.js";
|
|
4
|
-
import
|
|
4
|
+
import "../../../../icons/vue/edit.js";
|
|
5
|
+
import "../../../../icons/vue/delete.js";
|
|
5
6
|
import { dataDataEmits, dataDataProps, name } from "../data.js";
|
|
6
7
|
import { useCssName } from "../../../../hooks/cssname/index.js";
|
|
7
8
|
import { useLocale } from "../../../../hooks/locale/index.js";
|
|
@@ -9,16 +10,22 @@ import "../index.js";
|
|
|
9
10
|
import { Button } from "../../../button/index.js";
|
|
10
11
|
import { EditDataAdd } from "../../../edit-data-add/index.js";
|
|
11
12
|
import _sfc_main$1 from "../index2.js";
|
|
13
|
+
import _sfc_main$2 from "../../../../icons/vue/edit2.js";
|
|
14
|
+
import _sfc_main$3 from "../../../../icons/vue/delete2.js";
|
|
12
15
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
16
|
__name: "object",
|
|
14
17
|
props: dataDataProps,
|
|
15
18
|
emits: dataDataEmits,
|
|
16
|
-
setup(__props, {
|
|
19
|
+
setup(__props, { emit: __emit }) {
|
|
17
20
|
const cs = useCssName(name);
|
|
18
21
|
const { getLocale } = useLocale();
|
|
19
22
|
const props = __props;
|
|
20
23
|
const emit = __emit;
|
|
21
|
-
const box =
|
|
24
|
+
const box = reactive({
|
|
25
|
+
value: false,
|
|
26
|
+
type: 0,
|
|
27
|
+
row: ""
|
|
28
|
+
});
|
|
22
29
|
const value = computed({
|
|
23
30
|
get() {
|
|
24
31
|
return props.modelValue;
|
|
@@ -32,15 +39,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
39
|
};
|
|
33
40
|
const onAdd = () => {
|
|
34
41
|
box.value = true;
|
|
42
|
+
box.type = 0;
|
|
43
|
+
box.row = "";
|
|
35
44
|
};
|
|
36
45
|
const onSubmit = (v) => {
|
|
37
|
-
value.value
|
|
46
|
+
if (value.value === void 0) {
|
|
47
|
+
value.value = { [v.label]: v.value };
|
|
48
|
+
} else {
|
|
49
|
+
if (box.type == 0) {
|
|
50
|
+
value.value[v.label] = v.value;
|
|
51
|
+
} else {
|
|
52
|
+
value.value[box.row] = v.value;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
38
55
|
};
|
|
39
56
|
const onDelete = (index) => {
|
|
40
57
|
value.value[index] = void 0;
|
|
41
58
|
delete value.value[index];
|
|
42
59
|
};
|
|
43
|
-
|
|
60
|
+
const onEdit = (index) => {
|
|
61
|
+
box.value = true;
|
|
62
|
+
box.type = 1;
|
|
63
|
+
box.row = index;
|
|
64
|
+
};
|
|
44
65
|
return (_ctx, _cache) => {
|
|
45
66
|
return openBlock(), createElementBlock("div", {
|
|
46
67
|
class: normalizeClass(unref(cs).z("area-object"))
|
|
@@ -77,8 +98,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
98
|
}), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
78
99
|
], 2),
|
|
79
100
|
createElementVNode("div", null, [
|
|
80
|
-
props.
|
|
101
|
+
props.isEmpty && item === void 0 ? (openBlock(), createBlock(unref(Button), {
|
|
81
102
|
key: 0,
|
|
103
|
+
type: "primary",
|
|
104
|
+
onClick: ($event) => onEdit(index),
|
|
105
|
+
text: ""
|
|
106
|
+
}, {
|
|
107
|
+
default: withCtx(() => [
|
|
108
|
+
createVNode(unref(Icon), { title: "修改" }, {
|
|
109
|
+
default: withCtx(() => [
|
|
110
|
+
createVNode(_sfc_main$2)
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
})
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
117
|
+
props.editable ? (openBlock(), createBlock(unref(Button), {
|
|
118
|
+
key: 1,
|
|
82
119
|
type: "danger",
|
|
83
120
|
onClick: ($event) => onDelete(index),
|
|
84
121
|
text: ""
|
|
@@ -86,7 +123,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
123
|
default: withCtx(() => [
|
|
87
124
|
createVNode(unref(Icon), { title: "删除" }, {
|
|
88
125
|
default: withCtx(() => [
|
|
89
|
-
createVNode(
|
|
126
|
+
createVNode(_sfc_main$3)
|
|
90
127
|
]),
|
|
91
128
|
_: 1
|
|
92
129
|
})
|
|
@@ -96,17 +133,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
133
|
])
|
|
97
134
|
], 2);
|
|
98
135
|
}), 128)),
|
|
99
|
-
Object.keys(value.value).length == 0 ? (openBlock(), createBlock(unref(NoData), {
|
|
136
|
+
(value.value ? Object.keys(value.value).length == 0 : true) ? (openBlock(), createBlock(unref(NoData), {
|
|
100
137
|
key: 1,
|
|
101
138
|
value: "空对象"
|
|
102
139
|
})) : createCommentVNode("", true),
|
|
103
140
|
createVNode(unref(EditDataAdd), mergeProps(props, {
|
|
104
|
-
type: "object",
|
|
105
|
-
title: "新增对象",
|
|
141
|
+
type: box.type == 1 ? "array" : "object",
|
|
142
|
+
title: box.type == 1 ? "修改对象" : "新增对象",
|
|
106
143
|
modelValue: box.value,
|
|
107
144
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => box.value = $event),
|
|
108
145
|
onSubmit
|
|
109
|
-
}), null, 16, ["modelValue"])
|
|
146
|
+
}), null, 16, ["type", "title", "modelValue"])
|
|
110
147
|
], 2);
|
|
111
148
|
};
|
|
112
149
|
}
|
|
@@ -21,8 +21,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21
21
|
return v;
|
|
22
22
|
} else {
|
|
23
23
|
if (v) {
|
|
24
|
-
return json5.parse(v)
|
|
25
|
-
} else {
|
|
24
|
+
return json5.parse(v);
|
|
25
|
+
} else if (!props.isEmpty) {
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -40,9 +40,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
40
|
get() {
|
|
41
41
|
if (props.modelValue) {
|
|
42
42
|
return props.modelValue;
|
|
43
|
-
} else {
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
} else if (!props.isEmpty) {
|
|
44
|
+
if (props.default) {
|
|
45
|
+
return props.default;
|
|
46
|
+
} else {
|
|
47
|
+
emit("update:modelValue", []);
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
52
|
set(value2) {
|
|
@@ -19,8 +19,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
return v;
|
|
20
20
|
} else {
|
|
21
21
|
if (v) {
|
|
22
|
-
return json5.parse(v)
|
|
23
|
-
} else {
|
|
22
|
+
return json5.parse(v);
|
|
23
|
+
} else if (!props.isEmpty) {
|
|
24
24
|
return [];
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -38,9 +38,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
38
|
get() {
|
|
39
39
|
if (props.modelValue) {
|
|
40
40
|
return props.modelValue;
|
|
41
|
-
} else {
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
} else if (!props.isEmpty) {
|
|
42
|
+
if (props.default) {
|
|
43
|
+
return props.default;
|
|
44
|
+
} else {
|
|
45
|
+
emit("update:modelValue", []);
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
49
|
},
|
|
46
50
|
set(value2) {
|
|
@@ -18,9 +18,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
18
18
|
get() {
|
|
19
19
|
if (props.modelValue || props.modelValue === 0) {
|
|
20
20
|
return props.modelValue;
|
|
21
|
-
} else {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
} else if (!props.isEmpty) {
|
|
22
|
+
if (props.default) {
|
|
23
|
+
return props.default;
|
|
24
|
+
} else {
|
|
25
|
+
emit("update:modelValue", BigInt(0));
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
set(value2) {
|
|
@@ -16,9 +16,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
get() {
|
|
17
17
|
if (props.modelValue || props.modelValue === 0) {
|
|
18
18
|
return props.modelValue;
|
|
19
|
-
} else {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
} else if (!props.isEmpty) {
|
|
20
|
+
if (props.default) {
|
|
21
|
+
return props.default;
|
|
22
|
+
} else {
|
|
23
|
+
emit("update:modelValue", BigInt(0));
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
set(value2) {
|
|
@@ -28,9 +28,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
28
28
|
get() {
|
|
29
29
|
if (props.modelValue || props.modelValue === false) {
|
|
30
30
|
return props.modelValue;
|
|
31
|
-
} else {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
} else if (!props.isEmpty) {
|
|
32
|
+
if (props.default) {
|
|
33
|
+
return props.default;
|
|
34
|
+
} else {
|
|
35
|
+
emit("update:modelValue", false);
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
34
38
|
}
|
|
35
39
|
},
|
|
36
40
|
set(value2) {
|
|
@@ -26,9 +26,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
get() {
|
|
27
27
|
if (props.modelValue || props.modelValue === false) {
|
|
28
28
|
return props.modelValue;
|
|
29
|
-
} else {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
} else if (!props.isEmpty) {
|
|
30
|
+
if (props.default) {
|
|
31
|
+
return props.default;
|
|
32
|
+
} else {
|
|
33
|
+
emit("update:modelValue", false);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
set(value2) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const data = require("../data.cjs");
|
|
5
|
+
const index$2 = require("../../../dates/index.cjs");
|
|
6
|
+
const index = require("../../../../hooks/cssname/index.cjs");
|
|
7
|
+
const index$1 = require("../../../../hooks/locale/index.cjs");
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
__name: "date",
|
|
10
|
+
props: data.dataDataProps,
|
|
11
|
+
emits: data.dataDataEmits,
|
|
12
|
+
setup(__props, { emit: __emit }) {
|
|
13
|
+
const cs = index.useCssName(data.name);
|
|
14
|
+
const { getLocale } = index$1.useLocale();
|
|
15
|
+
const props = __props;
|
|
16
|
+
const emit = __emit;
|
|
17
|
+
const value = vue.computed({
|
|
18
|
+
get() {
|
|
19
|
+
if (props.modelValue) {
|
|
20
|
+
return props.modelValue;
|
|
21
|
+
} else if (!props.isEmpty) {
|
|
22
|
+
if (props.default) {
|
|
23
|
+
return props.default;
|
|
24
|
+
} else {
|
|
25
|
+
const v = /* @__PURE__ */ new Date();
|
|
26
|
+
emit("update:modelValue", v);
|
|
27
|
+
return v;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
set(value2) {
|
|
32
|
+
emit("update:modelValue", value2);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
37
|
+
class: vue.normalizeClass(vue.unref(cs).z("date"))
|
|
38
|
+
}, [
|
|
39
|
+
vue.createVNode(vue.unref(index$2.Dates), {
|
|
40
|
+
modelValue: value.value,
|
|
41
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
42
|
+
type: "datetime"
|
|
43
|
+
}, null, 8, ["modelValue"])
|
|
44
|
+
], 2);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, createVNode } from "vue";
|
|
2
|
+
import { dataDataEmits, dataDataProps, name } from "../data.js";
|
|
3
|
+
import { Dates } from "../../../dates/index.js";
|
|
4
|
+
import { useCssName } from "../../../../hooks/cssname/index.js";
|
|
5
|
+
import { useLocale } from "../../../../hooks/locale/index.js";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "date",
|
|
8
|
+
props: dataDataProps,
|
|
9
|
+
emits: dataDataEmits,
|
|
10
|
+
setup(__props, { emit: __emit }) {
|
|
11
|
+
const cs = useCssName(name);
|
|
12
|
+
const { getLocale } = useLocale();
|
|
13
|
+
const props = __props;
|
|
14
|
+
const emit = __emit;
|
|
15
|
+
const value = computed({
|
|
16
|
+
get() {
|
|
17
|
+
if (props.modelValue) {
|
|
18
|
+
return props.modelValue;
|
|
19
|
+
} else if (!props.isEmpty) {
|
|
20
|
+
if (props.default) {
|
|
21
|
+
return props.default;
|
|
22
|
+
} else {
|
|
23
|
+
const v = /* @__PURE__ */ new Date();
|
|
24
|
+
emit("update:modelValue", v);
|
|
25
|
+
return v;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
set(value2) {
|
|
30
|
+
emit("update:modelValue", value2);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return openBlock(), createElementBlock("div", {
|
|
35
|
+
class: normalizeClass(unref(cs).z("date"))
|
|
36
|
+
}, [
|
|
37
|
+
createVNode(unref(Dates), {
|
|
38
|
+
modelValue: value.value,
|
|
39
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
40
|
+
type: "datetime"
|
|
41
|
+
}, null, 8, ["modelValue"])
|
|
42
|
+
], 2);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
_sfc_main as default
|
|
48
|
+
};
|
|
@@ -17,7 +17,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
17
17
|
const props = __props;
|
|
18
18
|
const emit = __emit;
|
|
19
19
|
const getValue = (v) => {
|
|
20
|
-
|
|
20
|
+
if (v) {
|
|
21
|
+
return toFunction.toFunction(v);
|
|
22
|
+
} else if (!props.isEmpty) {
|
|
23
|
+
return function() {
|
|
24
|
+
};
|
|
25
|
+
}
|
|
21
26
|
};
|
|
22
27
|
const check = (v) => {
|
|
23
28
|
try {
|
|
@@ -32,10 +37,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
37
|
get() {
|
|
33
38
|
if (props.modelValue) {
|
|
34
39
|
return props.modelValue.toString();
|
|
35
|
-
} else {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
} else if (!props.isEmpty) {
|
|
41
|
+
if (props.default) {
|
|
42
|
+
return props.default;
|
|
43
|
+
} else {
|
|
44
|
+
emit("update:modelValue", function() {
|
|
45
|
+
});
|
|
46
|
+
return "function () {}";
|
|
47
|
+
}
|
|
39
48
|
}
|
|
40
49
|
},
|
|
41
50
|
set(value2) {
|
|
@@ -47,13 +56,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
47
56
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
48
57
|
class: vue.normalizeClass(vue.unref(cs).z("function"))
|
|
49
58
|
}, [
|
|
50
|
-
vue.createVNode(general_vue_vue_type_script_setup_true_lang.default, {
|
|
59
|
+
vue.createVNode(general_vue_vue_type_script_setup_true_lang.default, vue.mergeProps(props, {
|
|
51
60
|
check,
|
|
52
61
|
modelValue: value.value,
|
|
53
62
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
54
63
|
title: "方法设置",
|
|
55
64
|
type: "function"
|
|
56
|
-
}, null,
|
|
65
|
+
}), null, 16, ["modelValue"])
|
|
57
66
|
], 2);
|
|
58
67
|
};
|
|
59
68
|
}
|