@fangzhongya/fang-ui 0.1.50 → 0.1.52
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/date-picker/style/element.scss +7 -4
- 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.css +144 -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.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 +91 -0
- package/dist/components/tables/common/com-limit2.js +91 -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.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 +13 -12
- /package/dist/components/{option → draggable}/index.css +0 -0
- /package/dist/css/{option.css → draggable.css} +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, withDirectives, createBlock, createVNode, withCtx, createTextVNode, Fragment, renderList, createElementVNode, toDisplayString, mergeProps } from "vue";
|
|
2
|
+
import { NoData } from "../../../no-data/index.js";
|
|
3
|
+
import { Icon } from "../../../icon/index.js";
|
|
4
|
+
import Delete from "../../../../icons/vue/delete.js";
|
|
5
|
+
import { name, dataDataEmits, dataDataProps } from "../data.js";
|
|
6
|
+
import { useCssName } from "../../../../hooks/cssname/index.js";
|
|
7
|
+
import { useLocale } from "../../../../hooks/locale/index.js";
|
|
8
|
+
import "../index.js";
|
|
9
|
+
import vSortable from "../../../../directives/sortable/index.js";
|
|
10
|
+
import { Button } from "../../../button/index.js";
|
|
11
|
+
import { EditDataAdd } from "../../../edit-data-add/index.js";
|
|
12
|
+
import _sfc_main$1 from "../index2.js";
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "array",
|
|
15
|
+
props: dataDataProps,
|
|
16
|
+
emits: dataDataEmits,
|
|
17
|
+
setup(__props, { emit: __emit }) {
|
|
18
|
+
const cs = useCssName(name);
|
|
19
|
+
const { getLocale } = useLocale();
|
|
20
|
+
const props = __props;
|
|
21
|
+
const emit = __emit;
|
|
22
|
+
const box = ref(false);
|
|
23
|
+
const value = computed({
|
|
24
|
+
get() {
|
|
25
|
+
return props.modelValue;
|
|
26
|
+
},
|
|
27
|
+
set(value2) {
|
|
28
|
+
emit("update:modelValue", value2);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const key = ref(0);
|
|
32
|
+
const onEnd = (obj) => {
|
|
33
|
+
const { oldIndex, newIndex } = obj;
|
|
34
|
+
if (oldIndex === newIndex) return;
|
|
35
|
+
const movedItem = value.value.splice(oldIndex, 1)[0];
|
|
36
|
+
value.value.splice(newIndex, 0, movedItem);
|
|
37
|
+
key.value++;
|
|
38
|
+
};
|
|
39
|
+
const sortable = {
|
|
40
|
+
handle: "." + cs.z("area-comp-li-div"),
|
|
41
|
+
onEnd
|
|
42
|
+
};
|
|
43
|
+
const updateValue = (index, v) => {
|
|
44
|
+
value.value[index] = v;
|
|
45
|
+
};
|
|
46
|
+
const onAdd = () => {
|
|
47
|
+
box.value = true;
|
|
48
|
+
};
|
|
49
|
+
const onSubmit = (v) => {
|
|
50
|
+
value.value.push(v.value);
|
|
51
|
+
};
|
|
52
|
+
const onDelete = (index) => {
|
|
53
|
+
value.value.splice(index, 1);
|
|
54
|
+
};
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return openBlock(), createElementBlock("div", {
|
|
57
|
+
class: normalizeClass(unref(cs).z("area-array"))
|
|
58
|
+
}, [
|
|
59
|
+
props.addable || props.editable ? (openBlock(), createElementBlock("div", {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: normalizeClass(unref(cs).z("area-array-add"))
|
|
62
|
+
}, [
|
|
63
|
+
createVNode(unref(Button), {
|
|
64
|
+
type: "primary",
|
|
65
|
+
onClick: onAdd
|
|
66
|
+
}, {
|
|
67
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
68
|
+
createTextVNode(" 添加 ", -1)
|
|
69
|
+
])]),
|
|
70
|
+
_: 1
|
|
71
|
+
})
|
|
72
|
+
], 2)) : createCommentVNode("", true),
|
|
73
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
74
|
+
class: normalizeClass(unref(cs).z("area-comp")),
|
|
75
|
+
key: key.value
|
|
76
|
+
}, [
|
|
77
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(value.value, (item, index) => {
|
|
78
|
+
return openBlock(), createElementBlock("div", {
|
|
79
|
+
class: normalizeClass(unref(cs).z("area-comp-li")),
|
|
80
|
+
key: index
|
|
81
|
+
}, [
|
|
82
|
+
createElementVNode("div", {
|
|
83
|
+
class: normalizeClass(unref(cs).z("area-comp-li-div"))
|
|
84
|
+
}, [
|
|
85
|
+
createElementVNode("span", {
|
|
86
|
+
class: normalizeClass(unref(cs).z("area-comp-li-name"))
|
|
87
|
+
}, toDisplayString(index), 3),
|
|
88
|
+
createVNode(_sfc_main$1, mergeProps({ ref_for: true }, props, {
|
|
89
|
+
type: void 0,
|
|
90
|
+
modelValue: item,
|
|
91
|
+
"onUpdate:modelValue": (val) => updateValue(index, val)
|
|
92
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
93
|
+
], 2),
|
|
94
|
+
createElementVNode("div", null, [
|
|
95
|
+
props.editable ? (openBlock(), createBlock(unref(Button), {
|
|
96
|
+
key: 0,
|
|
97
|
+
type: "danger",
|
|
98
|
+
onClick: ($event) => onDelete(index),
|
|
99
|
+
text: ""
|
|
100
|
+
}, {
|
|
101
|
+
default: withCtx(() => [
|
|
102
|
+
createVNode(unref(Icon), { title: "删除" }, {
|
|
103
|
+
default: withCtx(() => [
|
|
104
|
+
createVNode(Delete)
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
})
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
111
|
+
])
|
|
112
|
+
], 2);
|
|
113
|
+
}), 128))
|
|
114
|
+
], 2)), [
|
|
115
|
+
[unref(vSortable), sortable]
|
|
116
|
+
]),
|
|
117
|
+
value.value.length == 0 ? (openBlock(), createBlock(unref(NoData), {
|
|
118
|
+
key: 1,
|
|
119
|
+
value: "空数组"
|
|
120
|
+
})) : createCommentVNode("", true),
|
|
121
|
+
createVNode(unref(EditDataAdd), mergeProps(props, {
|
|
122
|
+
type: "array",
|
|
123
|
+
labelName: "数组",
|
|
124
|
+
title: "新增数组",
|
|
125
|
+
modelValue: box.value,
|
|
126
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => box.value = $event),
|
|
127
|
+
onSubmit
|
|
128
|
+
}), null, 16, ["modelValue"])
|
|
129
|
+
], 2);
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
export {
|
|
134
|
+
_sfc_main as default
|
|
135
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
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 = require("../../../../hooks/cssname/index.cjs");
|
|
6
|
+
const index$1 = require("../../../../hooks/locale/index.cjs");
|
|
7
|
+
const index$2 = require("../../../inputs/index.cjs");
|
|
8
|
+
const json5 = require("json5");
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
10
|
+
__name: "code",
|
|
11
|
+
props: data.dataDataProps,
|
|
12
|
+
emits: data.dataDataEmits,
|
|
13
|
+
setup(__props, { emit: __emit }) {
|
|
14
|
+
const cs = index.useCssName(data.name);
|
|
15
|
+
const { getLocale } = index$1.useLocale();
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const value = vue.computed({
|
|
19
|
+
get() {
|
|
20
|
+
const v = props.modelValue;
|
|
21
|
+
if (typeof v === "string") {
|
|
22
|
+
return v;
|
|
23
|
+
} else {
|
|
24
|
+
if (typeof v === "function") {
|
|
25
|
+
return v.toString();
|
|
26
|
+
} else {
|
|
27
|
+
return json5.stringify(v, null, 4);
|
|
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("code"))
|
|
38
|
+
}, [
|
|
39
|
+
props.compon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.compon), vue.mergeProps({ key: 0 }, props, {
|
|
40
|
+
modelValue: value.value,
|
|
41
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
42
|
+
}), null, 16, ["modelValue"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$2.Inputs), {
|
|
43
|
+
key: 1,
|
|
44
|
+
type: "textarea",
|
|
45
|
+
modelValue: value.value,
|
|
46
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => value.value = $event)
|
|
47
|
+
}, null, 8, ["modelValue"]))
|
|
48
|
+
], 2);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, createBlock, resolveDynamicComponent, mergeProps } from "vue";
|
|
2
|
+
import { name, dataDataEmits, dataDataProps } from "../data.js";
|
|
3
|
+
import { useCssName } from "../../../../hooks/cssname/index.js";
|
|
4
|
+
import { useLocale } from "../../../../hooks/locale/index.js";
|
|
5
|
+
import { Inputs } from "../../../inputs/index.js";
|
|
6
|
+
import json5 from "json5";
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "code",
|
|
9
|
+
props: dataDataProps,
|
|
10
|
+
emits: dataDataEmits,
|
|
11
|
+
setup(__props, { emit: __emit }) {
|
|
12
|
+
const cs = useCssName(name);
|
|
13
|
+
const { getLocale } = useLocale();
|
|
14
|
+
const props = __props;
|
|
15
|
+
const emit = __emit;
|
|
16
|
+
const value = computed({
|
|
17
|
+
get() {
|
|
18
|
+
const v = props.modelValue;
|
|
19
|
+
if (typeof v === "string") {
|
|
20
|
+
return v;
|
|
21
|
+
} else {
|
|
22
|
+
if (typeof v === "function") {
|
|
23
|
+
return v.toString();
|
|
24
|
+
} else {
|
|
25
|
+
return json5.stringify(v, null, 4);
|
|
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("code"))
|
|
36
|
+
}, [
|
|
37
|
+
props.compon ? (openBlock(), createBlock(resolveDynamicComponent(props.compon), mergeProps({ key: 0 }, props, {
|
|
38
|
+
modelValue: value.value,
|
|
39
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event)
|
|
40
|
+
}), null, 16, ["modelValue"])) : (openBlock(), createBlock(unref(Inputs), {
|
|
41
|
+
key: 1,
|
|
42
|
+
type: "textarea",
|
|
43
|
+
modelValue: value.value,
|
|
44
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => value.value = $event)
|
|
45
|
+
}, null, 8, ["modelValue"]))
|
|
46
|
+
], 2);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
_sfc_main as default
|
|
52
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const editor_vue_vue_type_script_setup_true_lang = require("./editor2.cjs");
|
|
4
|
+
exports.default = editor_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -0,0 +1,170 @@
|
|
|
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 = require("../../../../hooks/cssname/index.cjs");
|
|
6
|
+
const index$1 = require("../../../../hooks/locale/index.cjs");
|
|
7
|
+
const index$3 = require("../../../button/index.cjs");
|
|
8
|
+
const index$2 = require("../../../window/index.cjs");
|
|
9
|
+
require("./code.cjs");
|
|
10
|
+
require("./array.cjs");
|
|
11
|
+
require("./array-json.cjs");
|
|
12
|
+
require("./object.cjs");
|
|
13
|
+
require("./object-json.cjs");
|
|
14
|
+
const arrayJson_vue_vue_type_script_setup_true_lang = require("./array-json2.cjs");
|
|
15
|
+
const code_vue_vue_type_script_setup_true_lang = require("./code2.cjs");
|
|
16
|
+
const array_vue_vue_type_script_setup_true_lang = require("./array2.cjs");
|
|
17
|
+
const objectJson_vue_vue_type_script_setup_true_lang = require("./object-json2.cjs");
|
|
18
|
+
const object_vue_vue_type_script_setup_true_lang = require("./object2.cjs");
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
20
|
+
...{
|
|
21
|
+
inheritAttrs: false
|
|
22
|
+
},
|
|
23
|
+
__name: "editor",
|
|
24
|
+
props: {
|
|
25
|
+
...data.dataDataProps,
|
|
26
|
+
type: { type: String },
|
|
27
|
+
title: { type: String, default: "设置" },
|
|
28
|
+
value: { type: null }
|
|
29
|
+
},
|
|
30
|
+
emits: [...data.dataDataEmits, "submit"],
|
|
31
|
+
setup(__props, { emit: __emit }) {
|
|
32
|
+
const cs = index.useCssName(data.name);
|
|
33
|
+
const { getLocale } = index$1.useLocale();
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emit = __emit;
|
|
36
|
+
const code = vue.ref(props.value);
|
|
37
|
+
const value = vue.computed({
|
|
38
|
+
get() {
|
|
39
|
+
const v = props.modelValue;
|
|
40
|
+
if (v) {
|
|
41
|
+
code.value = props.value;
|
|
42
|
+
}
|
|
43
|
+
return v;
|
|
44
|
+
},
|
|
45
|
+
set(value2) {
|
|
46
|
+
emit("update:modelValue", value2);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const size = vue.ref(0);
|
|
50
|
+
function onClick(key) {
|
|
51
|
+
if (key == 9) {
|
|
52
|
+
code.value = props.value;
|
|
53
|
+
} else if (key == 1) {
|
|
54
|
+
submit();
|
|
55
|
+
} else {
|
|
56
|
+
code.value = "";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function submit() {
|
|
60
|
+
emit("submit", code.value);
|
|
61
|
+
}
|
|
62
|
+
function onChangesize() {
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
size.value++;
|
|
65
|
+
}, 100);
|
|
66
|
+
}
|
|
67
|
+
return (_ctx, _cache) => {
|
|
68
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index$2.Window), {
|
|
69
|
+
isMin: false,
|
|
70
|
+
title: props.title,
|
|
71
|
+
onChangesize,
|
|
72
|
+
modelValue: value.value,
|
|
73
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => value.value = $event)
|
|
74
|
+
}, {
|
|
75
|
+
default: vue.withCtx(() => [
|
|
76
|
+
vue.createElementVNode("div", {
|
|
77
|
+
class: vue.normalizeClass(vue.unref(cs).z("editor"))
|
|
78
|
+
}, [
|
|
79
|
+
vue.createElementVNode("div", {
|
|
80
|
+
class: vue.normalizeClass(vue.unref(cs).z("editor-main"))
|
|
81
|
+
}, [
|
|
82
|
+
vue.createElementVNode("div", {
|
|
83
|
+
class: vue.normalizeClass(vue.unref(cs).z("editor-content"))
|
|
84
|
+
}, [
|
|
85
|
+
props.type == "array" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
86
|
+
props.isJson ? (vue.openBlock(), vue.createBlock(arrayJson_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({ key: 0 }, props, {
|
|
87
|
+
modelValue: code.value,
|
|
88
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => code.value = $event)
|
|
89
|
+
}), {
|
|
90
|
+
default: vue.withCtx(() => [
|
|
91
|
+
vue.createVNode(code_vue_vue_type_script_setup_true_lang.default, {
|
|
92
|
+
size: size.value,
|
|
93
|
+
compon: props.compon,
|
|
94
|
+
modelValue: code.value,
|
|
95
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => code.value = $event)
|
|
96
|
+
}, null, 8, ["size", "compon", "modelValue"])
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
}, 16, ["modelValue"])) : (vue.openBlock(), vue.createBlock(array_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({ key: 1 }, props, {
|
|
100
|
+
modelValue: code.value,
|
|
101
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => code.value = $event)
|
|
102
|
+
}), null, 16, ["modelValue"]))
|
|
103
|
+
], 64)) : props.type == "object" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
104
|
+
props.isJson ? (vue.openBlock(), vue.createBlock(objectJson_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({ key: 0 }, props, {
|
|
105
|
+
modelValue: code.value,
|
|
106
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => code.value = $event)
|
|
107
|
+
}), {
|
|
108
|
+
default: vue.withCtx(() => [
|
|
109
|
+
vue.createVNode(code_vue_vue_type_script_setup_true_lang.default, {
|
|
110
|
+
size: size.value,
|
|
111
|
+
compon: props.compon,
|
|
112
|
+
modelValue: code.value,
|
|
113
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => code.value = $event)
|
|
114
|
+
}, null, 8, ["size", "compon", "modelValue"])
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 16, ["modelValue"])) : (vue.openBlock(), vue.createBlock(object_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({ key: 1 }, props, {
|
|
118
|
+
modelValue: code.value,
|
|
119
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => code.value = $event)
|
|
120
|
+
}), null, 16, ["modelValue"]))
|
|
121
|
+
], 64)) : (vue.openBlock(), vue.createBlock(code_vue_vue_type_script_setup_true_lang.default, {
|
|
122
|
+
key: 2,
|
|
123
|
+
size: size.value,
|
|
124
|
+
compon: props.compon,
|
|
125
|
+
modelValue: code.value,
|
|
126
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => code.value = $event)
|
|
127
|
+
}, null, 8, ["size", "compon", "modelValue"]))
|
|
128
|
+
], 2)
|
|
129
|
+
], 2),
|
|
130
|
+
vue.createElementVNode("div", {
|
|
131
|
+
class: vue.normalizeClass(vue.unref(cs).z("editor-footer"))
|
|
132
|
+
}, [
|
|
133
|
+
vue.createElementVNode("div", {
|
|
134
|
+
class: vue.normalizeClass(vue.unref(cs).z("editor-top-but"))
|
|
135
|
+
}, [
|
|
136
|
+
vue.createVNode(vue.unref(index$3.Button), {
|
|
137
|
+
onClick: _cache[7] || (_cache[7] = ($event) => onClick(9))
|
|
138
|
+
}, {
|
|
139
|
+
default: vue.withCtx(() => [..._cache[11] || (_cache[11] = [
|
|
140
|
+
vue.createTextVNode("重置", -1)
|
|
141
|
+
])]),
|
|
142
|
+
_: 1
|
|
143
|
+
}),
|
|
144
|
+
vue.createVNode(vue.unref(index$3.Button), {
|
|
145
|
+
onClick: _cache[8] || (_cache[8] = ($event) => onClick(0))
|
|
146
|
+
}, {
|
|
147
|
+
default: vue.withCtx(() => [..._cache[12] || (_cache[12] = [
|
|
148
|
+
vue.createTextVNode("清空", -1)
|
|
149
|
+
])]),
|
|
150
|
+
_: 1
|
|
151
|
+
}),
|
|
152
|
+
vue.createVNode(vue.unref(index$3.Button), {
|
|
153
|
+
onClick: _cache[9] || (_cache[9] = ($event) => onClick(1)),
|
|
154
|
+
type: "primary"
|
|
155
|
+
}, {
|
|
156
|
+
default: vue.withCtx(() => [..._cache[13] || (_cache[13] = [
|
|
157
|
+
vue.createTextVNode("确认", -1)
|
|
158
|
+
])]),
|
|
159
|
+
_: 1
|
|
160
|
+
})
|
|
161
|
+
], 2)
|
|
162
|
+
], 2)
|
|
163
|
+
], 2)
|
|
164
|
+
]),
|
|
165
|
+
_: 1
|
|
166
|
+
}, 8, ["title", "modelValue"]);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, Fragment, mergeProps, createVNode, createTextVNode } from "vue";
|
|
2
|
+
import { dataDataEmits, dataDataProps, name } from "../data.js";
|
|
3
|
+
import { useCssName } from "../../../../hooks/cssname/index.js";
|
|
4
|
+
import { useLocale } from "../../../../hooks/locale/index.js";
|
|
5
|
+
import { Button } from "../../../button/index.js";
|
|
6
|
+
import { Window } from "../../../window/index.js";
|
|
7
|
+
import "./code.js";
|
|
8
|
+
import "./array.js";
|
|
9
|
+
import "./array-json.js";
|
|
10
|
+
import "./object.js";
|
|
11
|
+
import "./object-json.js";
|
|
12
|
+
import _sfc_main$1 from "./array-json2.js";
|
|
13
|
+
import _sfc_main$2 from "./code2.js";
|
|
14
|
+
import _sfc_main$3 from "./array2.js";
|
|
15
|
+
import _sfc_main$4 from "./object-json2.js";
|
|
16
|
+
import _sfc_main$5 from "./object2.js";
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
+
...{
|
|
19
|
+
inheritAttrs: false
|
|
20
|
+
},
|
|
21
|
+
__name: "editor",
|
|
22
|
+
props: {
|
|
23
|
+
...dataDataProps,
|
|
24
|
+
type: { type: String },
|
|
25
|
+
title: { type: String, default: "设置" },
|
|
26
|
+
value: { type: null }
|
|
27
|
+
},
|
|
28
|
+
emits: [...dataDataEmits, "submit"],
|
|
29
|
+
setup(__props, { emit: __emit }) {
|
|
30
|
+
const cs = useCssName(name);
|
|
31
|
+
const { getLocale } = useLocale();
|
|
32
|
+
const props = __props;
|
|
33
|
+
const emit = __emit;
|
|
34
|
+
const code = ref(props.value);
|
|
35
|
+
const value = computed({
|
|
36
|
+
get() {
|
|
37
|
+
const v = props.modelValue;
|
|
38
|
+
if (v) {
|
|
39
|
+
code.value = props.value;
|
|
40
|
+
}
|
|
41
|
+
return v;
|
|
42
|
+
},
|
|
43
|
+
set(value2) {
|
|
44
|
+
emit("update:modelValue", value2);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const size = ref(0);
|
|
48
|
+
function onClick(key) {
|
|
49
|
+
if (key == 9) {
|
|
50
|
+
code.value = props.value;
|
|
51
|
+
} else if (key == 1) {
|
|
52
|
+
submit();
|
|
53
|
+
} else {
|
|
54
|
+
code.value = "";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function submit() {
|
|
58
|
+
emit("submit", code.value);
|
|
59
|
+
}
|
|
60
|
+
function onChangesize() {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
size.value++;
|
|
63
|
+
}, 100);
|
|
64
|
+
}
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return openBlock(), createBlock(unref(Window), {
|
|
67
|
+
isMin: false,
|
|
68
|
+
title: props.title,
|
|
69
|
+
onChangesize,
|
|
70
|
+
modelValue: value.value,
|
|
71
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => value.value = $event)
|
|
72
|
+
}, {
|
|
73
|
+
default: withCtx(() => [
|
|
74
|
+
createElementVNode("div", {
|
|
75
|
+
class: normalizeClass(unref(cs).z("editor"))
|
|
76
|
+
}, [
|
|
77
|
+
createElementVNode("div", {
|
|
78
|
+
class: normalizeClass(unref(cs).z("editor-main"))
|
|
79
|
+
}, [
|
|
80
|
+
createElementVNode("div", {
|
|
81
|
+
class: normalizeClass(unref(cs).z("editor-content"))
|
|
82
|
+
}, [
|
|
83
|
+
props.type == "array" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
84
|
+
props.isJson ? (openBlock(), createBlock(_sfc_main$1, mergeProps({ key: 0 }, props, {
|
|
85
|
+
modelValue: code.value,
|
|
86
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => code.value = $event)
|
|
87
|
+
}), {
|
|
88
|
+
default: withCtx(() => [
|
|
89
|
+
createVNode(_sfc_main$2, {
|
|
90
|
+
size: size.value,
|
|
91
|
+
compon: props.compon,
|
|
92
|
+
modelValue: code.value,
|
|
93
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => code.value = $event)
|
|
94
|
+
}, null, 8, ["size", "compon", "modelValue"])
|
|
95
|
+
]),
|
|
96
|
+
_: 1
|
|
97
|
+
}, 16, ["modelValue"])) : (openBlock(), createBlock(_sfc_main$3, mergeProps({ key: 1 }, props, {
|
|
98
|
+
modelValue: code.value,
|
|
99
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => code.value = $event)
|
|
100
|
+
}), null, 16, ["modelValue"]))
|
|
101
|
+
], 64)) : props.type == "object" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
102
|
+
props.isJson ? (openBlock(), createBlock(_sfc_main$4, mergeProps({ key: 0 }, props, {
|
|
103
|
+
modelValue: code.value,
|
|
104
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => code.value = $event)
|
|
105
|
+
}), {
|
|
106
|
+
default: withCtx(() => [
|
|
107
|
+
createVNode(_sfc_main$2, {
|
|
108
|
+
size: size.value,
|
|
109
|
+
compon: props.compon,
|
|
110
|
+
modelValue: code.value,
|
|
111
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => code.value = $event)
|
|
112
|
+
}, null, 8, ["size", "compon", "modelValue"])
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
}, 16, ["modelValue"])) : (openBlock(), createBlock(_sfc_main$5, mergeProps({ key: 1 }, props, {
|
|
116
|
+
modelValue: code.value,
|
|
117
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => code.value = $event)
|
|
118
|
+
}), null, 16, ["modelValue"]))
|
|
119
|
+
], 64)) : (openBlock(), createBlock(_sfc_main$2, {
|
|
120
|
+
key: 2,
|
|
121
|
+
size: size.value,
|
|
122
|
+
compon: props.compon,
|
|
123
|
+
modelValue: code.value,
|
|
124
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => code.value = $event)
|
|
125
|
+
}, null, 8, ["size", "compon", "modelValue"]))
|
|
126
|
+
], 2)
|
|
127
|
+
], 2),
|
|
128
|
+
createElementVNode("div", {
|
|
129
|
+
class: normalizeClass(unref(cs).z("editor-footer"))
|
|
130
|
+
}, [
|
|
131
|
+
createElementVNode("div", {
|
|
132
|
+
class: normalizeClass(unref(cs).z("editor-top-but"))
|
|
133
|
+
}, [
|
|
134
|
+
createVNode(unref(Button), {
|
|
135
|
+
onClick: _cache[7] || (_cache[7] = ($event) => onClick(9))
|
|
136
|
+
}, {
|
|
137
|
+
default: withCtx(() => [..._cache[11] || (_cache[11] = [
|
|
138
|
+
createTextVNode("重置", -1)
|
|
139
|
+
])]),
|
|
140
|
+
_: 1
|
|
141
|
+
}),
|
|
142
|
+
createVNode(unref(Button), {
|
|
143
|
+
onClick: _cache[8] || (_cache[8] = ($event) => onClick(0))
|
|
144
|
+
}, {
|
|
145
|
+
default: withCtx(() => [..._cache[12] || (_cache[12] = [
|
|
146
|
+
createTextVNode("清空", -1)
|
|
147
|
+
])]),
|
|
148
|
+
_: 1
|
|
149
|
+
}),
|
|
150
|
+
createVNode(unref(Button), {
|
|
151
|
+
onClick: _cache[9] || (_cache[9] = ($event) => onClick(1)),
|
|
152
|
+
type: "primary"
|
|
153
|
+
}, {
|
|
154
|
+
default: withCtx(() => [..._cache[13] || (_cache[13] = [
|
|
155
|
+
createTextVNode("确认", -1)
|
|
156
|
+
])]),
|
|
157
|
+
_: 1
|
|
158
|
+
})
|
|
159
|
+
], 2)
|
|
160
|
+
], 2)
|
|
161
|
+
], 2)
|
|
162
|
+
]),
|
|
163
|
+
_: 1
|
|
164
|
+
}, 8, ["title", "modelValue"]);
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
export {
|
|
169
|
+
_sfc_main as default
|
|
170
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const general_vue_vue_type_script_setup_true_lang = require("./general2.cjs");
|
|
4
|
+
exports.default = general_vue_vue_type_script_setup_true_lang.default;
|