@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,241 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createVNode, toDisplayString, mergeProps, createTextVNode } from "vue";
|
|
2
|
+
import { name, dataProps, dataExpose, dataEmits as dataEmits$1 } from "./data.js";
|
|
3
|
+
import { dataEmits, dataProps as dataProps$1 } from "../../edit-data/src/data.js";
|
|
4
|
+
import { getObjTypes } from "../../edit-data/src/util.js";
|
|
5
|
+
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
6
|
+
import { useLocale } from "../../../hooks/locale/index.js";
|
|
7
|
+
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
8
|
+
import { Button } from "../../button/index.js";
|
|
9
|
+
import { Window } from "../../window/index.js";
|
|
10
|
+
import { Inputs } from "../../inputs/index.js";
|
|
11
|
+
import { Selects } from "../../selects/index.js";
|
|
12
|
+
import { EditData } from "../../edit-data/index.js";
|
|
13
|
+
import { Message } from "../../message/index.js";
|
|
14
|
+
const _hoisted_1 = { key: 0 };
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...{
|
|
17
|
+
inheritAttrs: false
|
|
18
|
+
},
|
|
19
|
+
__name: "index",
|
|
20
|
+
props: getProps({ ...dataProps$1, ...dataProps }),
|
|
21
|
+
emits: [...dataEmits, ...dataEmits$1],
|
|
22
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
23
|
+
const cs = useCssName(name);
|
|
24
|
+
const { getLocale } = useLocale();
|
|
25
|
+
const prs = __props;
|
|
26
|
+
const props = usePropsDefault(name, prs, dataProps);
|
|
27
|
+
const emit = __emit;
|
|
28
|
+
const label = ref(props.label);
|
|
29
|
+
const value = computed({
|
|
30
|
+
get() {
|
|
31
|
+
const v = props.modelValue;
|
|
32
|
+
if (v) {
|
|
33
|
+
onEmptied();
|
|
34
|
+
}
|
|
35
|
+
return v;
|
|
36
|
+
},
|
|
37
|
+
set(value2) {
|
|
38
|
+
emit("update:modelValue", value2);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const typevalue = ref("");
|
|
42
|
+
const valueData = ref();
|
|
43
|
+
const Map = {
|
|
44
|
+
string: "字符串",
|
|
45
|
+
number: "数字",
|
|
46
|
+
boolean: "是否",
|
|
47
|
+
object: "对象",
|
|
48
|
+
array: "数组",
|
|
49
|
+
function: "方法",
|
|
50
|
+
symbol: "唯一值",
|
|
51
|
+
bigint: "大数字",
|
|
52
|
+
not: "不存在",
|
|
53
|
+
null: "空值",
|
|
54
|
+
undefined: "未定义",
|
|
55
|
+
other: "其他"
|
|
56
|
+
};
|
|
57
|
+
const getAll = () => {
|
|
58
|
+
const arr = [
|
|
59
|
+
"string",
|
|
60
|
+
"number",
|
|
61
|
+
"boolean",
|
|
62
|
+
"object",
|
|
63
|
+
"array",
|
|
64
|
+
"function",
|
|
65
|
+
"symbol",
|
|
66
|
+
"bigint",
|
|
67
|
+
"other"
|
|
68
|
+
];
|
|
69
|
+
if (props.isNot) {
|
|
70
|
+
arr.push("not");
|
|
71
|
+
} else {
|
|
72
|
+
arr.push("null", "undefined");
|
|
73
|
+
}
|
|
74
|
+
return arr;
|
|
75
|
+
};
|
|
76
|
+
const tps = ref([]);
|
|
77
|
+
const getType = (type) => {
|
|
78
|
+
const t = type.toLowerCase();
|
|
79
|
+
if (t.startsWith("array")) {
|
|
80
|
+
tps.value = getObjTypes(t);
|
|
81
|
+
console.log("tps.value ", tps.value);
|
|
82
|
+
return "array";
|
|
83
|
+
} else if (t.startsWith("object")) {
|
|
84
|
+
tps.value = getObjTypes(t);
|
|
85
|
+
return "object";
|
|
86
|
+
} else {
|
|
87
|
+
return t;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const options = computed(() => {
|
|
91
|
+
let arr = [];
|
|
92
|
+
if (props.typeObj) {
|
|
93
|
+
if (typeof props.typeObj === "string") {
|
|
94
|
+
arr.push(props.typeObj);
|
|
95
|
+
} else {
|
|
96
|
+
arr = props.typeObj;
|
|
97
|
+
}
|
|
98
|
+
arr = arr.filter((v2) => Boolean(v2)).map((v2) => getType(v2));
|
|
99
|
+
}
|
|
100
|
+
if (arr.length == 0) {
|
|
101
|
+
arr = getAll();
|
|
102
|
+
}
|
|
103
|
+
const v = arr.map((v2) => ({ label: Map[v2], value: v2 }));
|
|
104
|
+
if (v.length > 0) {
|
|
105
|
+
typevalue.value = v[0].value;
|
|
106
|
+
}
|
|
107
|
+
return v;
|
|
108
|
+
});
|
|
109
|
+
const typeobjs = computed(() => {
|
|
110
|
+
if (tps.value.length > 0) {
|
|
111
|
+
return tps.value;
|
|
112
|
+
} else {
|
|
113
|
+
if (props.typeObj) {
|
|
114
|
+
if (typeof props.typeObj === "string") {
|
|
115
|
+
return [props.typeObj];
|
|
116
|
+
} else {
|
|
117
|
+
return props.typeObj;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
function onEmptied() {
|
|
124
|
+
label.value = props.label;
|
|
125
|
+
valueData.value = void 0;
|
|
126
|
+
}
|
|
127
|
+
function onClick(key) {
|
|
128
|
+
if (key == 1) {
|
|
129
|
+
if (props.type === "object" && !label.value) {
|
|
130
|
+
Message.error("请输入" + props.labelName + "名称");
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
emit("submit", {
|
|
134
|
+
label: label.value,
|
|
135
|
+
type: typevalue.value,
|
|
136
|
+
value: valueData.value
|
|
137
|
+
});
|
|
138
|
+
value.value = false;
|
|
139
|
+
} else {
|
|
140
|
+
value.value = false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
__expose({
|
|
144
|
+
...dataExpose
|
|
145
|
+
});
|
|
146
|
+
return (_ctx, _cache) => {
|
|
147
|
+
return openBlock(), createBlock(unref(Window), {
|
|
148
|
+
isMin: false,
|
|
149
|
+
title: unref(props).title,
|
|
150
|
+
modelValue: value.value,
|
|
151
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => value.value = $event)
|
|
152
|
+
}, {
|
|
153
|
+
default: withCtx(() => [
|
|
154
|
+
createElementVNode("div", {
|
|
155
|
+
class: normalizeClass(unref(cs).z())
|
|
156
|
+
}, [
|
|
157
|
+
createElementVNode("div", {
|
|
158
|
+
class: normalizeClass(unref(cs).z("main"))
|
|
159
|
+
}, [
|
|
160
|
+
createElementVNode("div", {
|
|
161
|
+
class: normalizeClass(unref(cs).z("main-top"))
|
|
162
|
+
}, [
|
|
163
|
+
_ctx.type === "object" ? (openBlock(), createElementBlock("div", {
|
|
164
|
+
key: 0,
|
|
165
|
+
class: normalizeClass(unref(cs).z("main-top-li"))
|
|
166
|
+
}, [
|
|
167
|
+
createElementVNode("span", null, toDisplayString(unref(props).labelName + "名称") + ":", 1),
|
|
168
|
+
createVNode(unref(Inputs), {
|
|
169
|
+
class: normalizeClass(unref(cs).z("main-top-li-value")),
|
|
170
|
+
placeholder: "请输入" + unref(props).labelName + "名称",
|
|
171
|
+
modelValue: label.value,
|
|
172
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => label.value = $event)
|
|
173
|
+
}, null, 8, ["class", "placeholder", "modelValue"])
|
|
174
|
+
], 2)) : createCommentVNode("", true),
|
|
175
|
+
createElementVNode("div", {
|
|
176
|
+
class: normalizeClass(unref(cs).z("main-top-li"))
|
|
177
|
+
}, [
|
|
178
|
+
_cache[7] || (_cache[7] = createElementVNode("span", null, "类型:", -1)),
|
|
179
|
+
createVNode(unref(Selects), {
|
|
180
|
+
class: normalizeClass(unref(cs).z("main-top-li-value")),
|
|
181
|
+
placeholder: "类型",
|
|
182
|
+
options: options.value,
|
|
183
|
+
modelValue: typevalue.value,
|
|
184
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => typevalue.value = $event),
|
|
185
|
+
onChange: _cache[2] || (_cache[2] = ($event) => valueData.value = void 0)
|
|
186
|
+
}, null, 8, ["class", "options", "modelValue"])
|
|
187
|
+
], 2)
|
|
188
|
+
], 2),
|
|
189
|
+
createElementVNode("div", {
|
|
190
|
+
class: normalizeClass(unref(cs).z("main-content"))
|
|
191
|
+
}, [
|
|
192
|
+
createElementVNode("div", {
|
|
193
|
+
class: normalizeClass(unref(cs).z("main-content-name"))
|
|
194
|
+
}, [
|
|
195
|
+
createElementVNode("span", null, toDisplayString(unref(props).labelName) + "值:", 1)
|
|
196
|
+
], 2),
|
|
197
|
+
typevalue.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
198
|
+
(openBlock(), createBlock(unref(EditData), mergeProps({ key: typevalue.value }, unref(props), {
|
|
199
|
+
typeObj: typeobjs.value,
|
|
200
|
+
type: typevalue.value,
|
|
201
|
+
modelValue: valueData.value,
|
|
202
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => valueData.value = $event)
|
|
203
|
+
}), null, 16, ["typeObj", "type", "modelValue"]))
|
|
204
|
+
])) : createCommentVNode("", true)
|
|
205
|
+
], 2)
|
|
206
|
+
], 2),
|
|
207
|
+
createElementVNode("div", {
|
|
208
|
+
class: normalizeClass(unref(cs).z("footer"))
|
|
209
|
+
}, [
|
|
210
|
+
createElementVNode("div", {
|
|
211
|
+
class: normalizeClass(unref(cs).z("top-but"))
|
|
212
|
+
}, [
|
|
213
|
+
createVNode(unref(Button), {
|
|
214
|
+
onClick: _cache[4] || (_cache[4] = ($event) => onClick(0))
|
|
215
|
+
}, {
|
|
216
|
+
default: withCtx(() => [..._cache[8] || (_cache[8] = [
|
|
217
|
+
createTextVNode("取消", -1)
|
|
218
|
+
])]),
|
|
219
|
+
_: 1
|
|
220
|
+
}),
|
|
221
|
+
createVNode(unref(Button), {
|
|
222
|
+
onClick: _cache[5] || (_cache[5] = ($event) => onClick(1)),
|
|
223
|
+
type: "primary"
|
|
224
|
+
}, {
|
|
225
|
+
default: withCtx(() => [..._cache[9] || (_cache[9] = [
|
|
226
|
+
createTextVNode("确认", -1)
|
|
227
|
+
])]),
|
|
228
|
+
_: 1
|
|
229
|
+
})
|
|
230
|
+
], 2)
|
|
231
|
+
], 2)
|
|
232
|
+
], 2)
|
|
233
|
+
]),
|
|
234
|
+
_: 1
|
|
235
|
+
}, 8, ["title", "modelValue"]);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
export {
|
|
240
|
+
_sfc_main as default
|
|
241
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@use '../../scss/common.scss' as *;
|
|
2
|
+
$edit-data-add: 'edit-data-add';
|
|
3
|
+
@include b($edit-data-add) {
|
|
4
|
+
// 占位符,为将来扩展预留
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
&-main {
|
|
10
|
+
flex: 1;
|
|
11
|
+
width: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
&-top {
|
|
15
|
+
width: 100%;
|
|
16
|
+
&-li {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
padding: 10px;
|
|
20
|
+
&-value {
|
|
21
|
+
flex: 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
&-content {
|
|
26
|
+
flex: 1;
|
|
27
|
+
width: 100%;
|
|
28
|
+
margin: 10px;
|
|
29
|
+
&-name {
|
|
30
|
+
margin-bottom: 10px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&-footer {
|
|
35
|
+
padding-top: 20px;
|
|
36
|
+
text-align: right;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -12,9 +12,17 @@ const dataProps = {
|
|
|
12
12
|
record: {
|
|
13
13
|
type: [Number, String],
|
|
14
14
|
default: 0
|
|
15
|
+
},
|
|
16
|
+
isCur: { type: Boolean, default: true },
|
|
17
|
+
isModel: { type: Boolean, default: false },
|
|
18
|
+
copyFilter: {
|
|
19
|
+
type: Function,
|
|
20
|
+
default() {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
15
23
|
}
|
|
16
24
|
};
|
|
17
|
-
const dataEmits = ["update:modelValue"];
|
|
25
|
+
const dataEmits = ["update:modelValue", "change"];
|
|
18
26
|
const dataSlot = {
|
|
19
27
|
iconRetreat: "icon-retreat",
|
|
20
28
|
iconForward: "icon-forward"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtractPropTypes } from 'vue';
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* @title {h3} history
|
|
4
4
|
*/
|
|
@@ -15,6 +15,18 @@ export declare const dataProps: {
|
|
|
15
15
|
type: (StringConstructor | NumberConstructor)[];
|
|
16
16
|
default: number;
|
|
17
17
|
};
|
|
18
|
+
isCur: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
isModel: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
copyFilter: {
|
|
27
|
+
type: PropType<(key: string) => boolean>;
|
|
28
|
+
default(): boolean;
|
|
29
|
+
};
|
|
18
30
|
};
|
|
19
31
|
export type DataProps = ExtractPropTypes<typeof dataProps>;
|
|
20
32
|
/**
|
|
@@ -10,9 +10,17 @@ const dataProps = {
|
|
|
10
10
|
record: {
|
|
11
11
|
type: [Number, String],
|
|
12
12
|
default: 0
|
|
13
|
+
},
|
|
14
|
+
isCur: { type: Boolean, default: true },
|
|
15
|
+
isModel: { type: Boolean, default: false },
|
|
16
|
+
copyFilter: {
|
|
17
|
+
type: Function,
|
|
18
|
+
default() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
13
21
|
}
|
|
14
22
|
};
|
|
15
|
-
const dataEmits = ["update:modelValue"];
|
|
23
|
+
const dataEmits = ["update:modelValue", "change"];
|
|
16
24
|
const dataSlot = {
|
|
17
25
|
iconRetreat: "icon-retreat",
|
|
18
26
|
iconForward: "icon-forward"
|
|
@@ -21,14 +21,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21
21
|
const index$3 = vue.ref(0);
|
|
22
22
|
const current = vue.ref();
|
|
23
23
|
const isRetreat = vue.computed(() => {
|
|
24
|
-
|
|
24
|
+
const i = props.isModel ? 1 : 0;
|
|
25
|
+
if (history.value.length > i && index$3.value <= history.value.length - 1 - i) {
|
|
25
26
|
return false;
|
|
26
27
|
} else {
|
|
27
28
|
return true;
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
const isForward = vue.computed(() => {
|
|
31
|
-
|
|
32
|
+
const i = props.isModel ? 1 : 0;
|
|
33
|
+
if (history.value.length > i && index$3.value != 0) {
|
|
32
34
|
return false;
|
|
33
35
|
} else {
|
|
34
36
|
return true;
|
|
@@ -41,35 +43,51 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
41
43
|
}
|
|
42
44
|
);
|
|
43
45
|
function getWz() {
|
|
44
|
-
|
|
46
|
+
if (props.isModel) {
|
|
47
|
+
return history.value.length - index$3.value - 1;
|
|
48
|
+
} else {
|
|
49
|
+
return history.value.length - index$3.value;
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
function setRecord() {
|
|
47
53
|
if (index$3.value != 0) {
|
|
48
|
-
history.value.
|
|
54
|
+
const i = history.value.length - index$3.value;
|
|
55
|
+
history.value.splice(i);
|
|
49
56
|
index$3.value = 0;
|
|
50
57
|
}
|
|
51
58
|
let v = props.modelValue;
|
|
52
59
|
if (v && typeof v == "object") {
|
|
53
|
-
v = deepCopy.deepCopy(props.modelValue);
|
|
60
|
+
v = deepCopy.deepCopy(props.modelValue, props.copyFilter);
|
|
54
61
|
}
|
|
55
62
|
history.value.push(v);
|
|
56
63
|
}
|
|
57
64
|
function onRetreat() {
|
|
58
65
|
if (!isRetreat.value) {
|
|
59
|
-
if (index$3.value === 0) {
|
|
66
|
+
if (props.isCur && index$3.value === 0) {
|
|
60
67
|
current.value = props.modelValue;
|
|
61
68
|
}
|
|
62
69
|
index$3.value++;
|
|
63
|
-
|
|
70
|
+
let v = history.value[getWz()];
|
|
71
|
+
if (props.isModel) {
|
|
72
|
+
v = deepCopy.deepCopy(v, props.copyFilter);
|
|
73
|
+
}
|
|
74
|
+
emit("update:modelValue", v);
|
|
75
|
+
emit("change", v);
|
|
64
76
|
}
|
|
65
77
|
}
|
|
66
78
|
function onForward() {
|
|
67
79
|
if (!isForward.value) {
|
|
68
80
|
index$3.value--;
|
|
69
|
-
if (index$3.value == 0) {
|
|
81
|
+
if (props.isCur && index$3.value == 0) {
|
|
70
82
|
emit("update:modelValue", current.value);
|
|
83
|
+
emit("change", current.value);
|
|
71
84
|
} else {
|
|
72
|
-
|
|
85
|
+
let v = history.value[getWz()];
|
|
86
|
+
if (props.isModel) {
|
|
87
|
+
v = deepCopy.deepCopy(v, props.copyFilter);
|
|
88
|
+
}
|
|
89
|
+
emit("update:modelValue", v);
|
|
90
|
+
emit("change", v);
|
|
73
91
|
}
|
|
74
92
|
}
|
|
75
93
|
}
|
|
@@ -19,14 +19,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
const index = ref(0);
|
|
20
20
|
const current = ref();
|
|
21
21
|
const isRetreat = computed(() => {
|
|
22
|
-
|
|
22
|
+
const i = props.isModel ? 1 : 0;
|
|
23
|
+
if (history.value.length > i && index.value <= history.value.length - 1 - i) {
|
|
23
24
|
return false;
|
|
24
25
|
} else {
|
|
25
26
|
return true;
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
const isForward = computed(() => {
|
|
29
|
-
|
|
30
|
+
const i = props.isModel ? 1 : 0;
|
|
31
|
+
if (history.value.length > i && index.value != 0) {
|
|
30
32
|
return false;
|
|
31
33
|
} else {
|
|
32
34
|
return true;
|
|
@@ -39,35 +41,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
41
|
}
|
|
40
42
|
);
|
|
41
43
|
function getWz() {
|
|
42
|
-
|
|
44
|
+
if (props.isModel) {
|
|
45
|
+
return history.value.length - index.value - 1;
|
|
46
|
+
} else {
|
|
47
|
+
return history.value.length - index.value;
|
|
48
|
+
}
|
|
43
49
|
}
|
|
44
50
|
function setRecord() {
|
|
45
51
|
if (index.value != 0) {
|
|
46
|
-
history.value.
|
|
52
|
+
const i = history.value.length - index.value;
|
|
53
|
+
history.value.splice(i);
|
|
47
54
|
index.value = 0;
|
|
48
55
|
}
|
|
49
56
|
let v = props.modelValue;
|
|
50
57
|
if (v && typeof v == "object") {
|
|
51
|
-
v = deepCopy(props.modelValue);
|
|
58
|
+
v = deepCopy(props.modelValue, props.copyFilter);
|
|
52
59
|
}
|
|
53
60
|
history.value.push(v);
|
|
54
61
|
}
|
|
55
62
|
function onRetreat() {
|
|
56
63
|
if (!isRetreat.value) {
|
|
57
|
-
if (index.value === 0) {
|
|
64
|
+
if (props.isCur && index.value === 0) {
|
|
58
65
|
current.value = props.modelValue;
|
|
59
66
|
}
|
|
60
67
|
index.value++;
|
|
61
|
-
|
|
68
|
+
let v = history.value[getWz()];
|
|
69
|
+
if (props.isModel) {
|
|
70
|
+
v = deepCopy(v, props.copyFilter);
|
|
71
|
+
}
|
|
72
|
+
emit("update:modelValue", v);
|
|
73
|
+
emit("change", v);
|
|
62
74
|
}
|
|
63
75
|
}
|
|
64
76
|
function onForward() {
|
|
65
77
|
if (!isForward.value) {
|
|
66
78
|
index.value--;
|
|
67
|
-
if (index.value == 0) {
|
|
79
|
+
if (props.isCur && index.value == 0) {
|
|
68
80
|
emit("update:modelValue", current.value);
|
|
81
|
+
emit("change", current.value);
|
|
69
82
|
} else {
|
|
70
|
-
|
|
83
|
+
let v = history.value[getWz()];
|
|
84
|
+
if (props.isModel) {
|
|
85
|
+
v = deepCopy(v, props.copyFilter);
|
|
86
|
+
}
|
|
87
|
+
emit("update:modelValue", v);
|
|
88
|
+
emit("change", v);
|
|
71
89
|
}
|
|
72
90
|
}
|
|
73
91
|
}
|
|
@@ -104,34 +104,36 @@ const index$2g = require("./dates-picker/index.cjs");
|
|
|
104
104
|
const index$2h = require("./dates/index.cjs");
|
|
105
105
|
const index$2i = require("./dates2/index.cjs");
|
|
106
106
|
const index$2j = require("./double/index.cjs");
|
|
107
|
-
const index$2k = require("./edit-
|
|
108
|
-
const index$2l = require("./edit/index.cjs");
|
|
109
|
-
const index$2m = require("./
|
|
110
|
-
const index$2n = require("./
|
|
111
|
-
const index$2o = require("./
|
|
112
|
-
const index$2p = require("./input-
|
|
113
|
-
const index$2q = require("./input-
|
|
114
|
-
const index$2r = require("./
|
|
115
|
-
const index$2s = require("./
|
|
116
|
-
const index$2t = require("./
|
|
117
|
-
const index$2u = require("./
|
|
118
|
-
const index$2v = require("./
|
|
119
|
-
const index$2w = require("./
|
|
120
|
-
const index$2x = require("./
|
|
121
|
-
const index$2y = require("./
|
|
122
|
-
const index$2z = require("./
|
|
123
|
-
const index$2A = require("./
|
|
124
|
-
const index$2B = require("./
|
|
125
|
-
const index$2C = require("./
|
|
126
|
-
const index$2D = require("./
|
|
127
|
-
const index$2E = require("./
|
|
128
|
-
const index$2F = require("./
|
|
129
|
-
const index$2G = require("./
|
|
130
|
-
const index$2H = require("./
|
|
131
|
-
const index$2I = require("./
|
|
132
|
-
const index$2J = require("./
|
|
133
|
-
const index$2K = require("./
|
|
134
|
-
const index$2L = require("./
|
|
107
|
+
const index$2k = require("./edit-data-add/index.cjs");
|
|
108
|
+
const index$2l = require("./edit-data/index.cjs");
|
|
109
|
+
const index$2m = require("./edit-float/index.cjs");
|
|
110
|
+
const index$2n = require("./edit/index.cjs");
|
|
111
|
+
const index$2o = require("./history/index.cjs");
|
|
112
|
+
const index$2p = require("./input-array/index.cjs");
|
|
113
|
+
const index$2q = require("./input-history/index.cjs");
|
|
114
|
+
const index$2r = require("./input-num/index.cjs");
|
|
115
|
+
const index$2s = require("./input-select/index.cjs");
|
|
116
|
+
const index$2t = require("./inputs/index.cjs");
|
|
117
|
+
const index$2u = require("./labels/index.cjs");
|
|
118
|
+
const index$2v = require("./select-scroll/index.cjs");
|
|
119
|
+
const index$2w = require("./selector/index.cjs");
|
|
120
|
+
const index$2x = require("./selects/index.cjs");
|
|
121
|
+
const index$2y = require("./sliders/index.cjs");
|
|
122
|
+
const index$2z = require("./switchs/index.cjs");
|
|
123
|
+
const index$2A = require("./texts/index.cjs");
|
|
124
|
+
const index$2B = require("./uploads/index.cjs");
|
|
125
|
+
const index$2C = require("./list/index.cjs");
|
|
126
|
+
const index$2D = require("./lists/index.cjs");
|
|
127
|
+
const index$2E = require("./listsp/index.cjs");
|
|
128
|
+
const index$2F = require("./listspd/index.cjs");
|
|
129
|
+
const index$2G = require("./paging/index.cjs");
|
|
130
|
+
const index$2H = require("./tables/index.cjs");
|
|
131
|
+
const index$2I = require("./tablesp/index.cjs");
|
|
132
|
+
const index$2J = require("./tablespd/index.cjs");
|
|
133
|
+
const index$2K = require("./tabless/index.cjs");
|
|
134
|
+
const index$2L = require("./tablesv/index.cjs");
|
|
135
|
+
const index$2M = require("./tablesvp/index.cjs");
|
|
136
|
+
const index$2N = require("./tablesvpd/index.cjs");
|
|
135
137
|
const index$2 = require("element-plus/es/components/button/index");
|
|
136
138
|
const index$4 = require("element-plus/es/components/card/index");
|
|
137
139
|
const index$6 = require("element-plus/es/components/color-picker/index");
|
|
@@ -280,34 +282,36 @@ exports.DatesPicker = index$2g.DatesPicker;
|
|
|
280
282
|
exports.Dates = index$2h.Dates;
|
|
281
283
|
exports.Dates2 = index$2i.Dates2;
|
|
282
284
|
exports.Double = index$2j.Double;
|
|
283
|
-
exports.
|
|
284
|
-
exports.
|
|
285
|
-
exports.
|
|
286
|
-
exports.
|
|
287
|
-
exports.
|
|
288
|
-
exports.
|
|
289
|
-
exports.
|
|
290
|
-
exports.
|
|
291
|
-
exports.
|
|
292
|
-
exports.
|
|
293
|
-
exports.
|
|
294
|
-
exports.
|
|
295
|
-
exports.
|
|
296
|
-
exports.
|
|
297
|
-
exports.
|
|
298
|
-
exports.
|
|
299
|
-
exports.
|
|
300
|
-
exports.
|
|
301
|
-
exports.
|
|
302
|
-
exports.
|
|
303
|
-
exports.
|
|
304
|
-
exports.
|
|
305
|
-
exports.
|
|
306
|
-
exports.
|
|
307
|
-
exports.
|
|
308
|
-
exports.
|
|
309
|
-
exports.
|
|
310
|
-
exports.
|
|
285
|
+
exports.EditDataAdd = index$2k.EditDataAdd;
|
|
286
|
+
exports.EditData = index$2l.EditData;
|
|
287
|
+
exports.EditFloat = index$2m.EditFloat;
|
|
288
|
+
exports.Edit = index$2n.Edit;
|
|
289
|
+
exports.History = index$2o.History;
|
|
290
|
+
exports.InputArray = index$2p.InputArray;
|
|
291
|
+
exports.InputHistory = index$2q.InputHistory;
|
|
292
|
+
exports.InputNum = index$2r.InputNum;
|
|
293
|
+
exports.InputSelect = index$2s.InputSelect;
|
|
294
|
+
exports.Inputs = index$2t.Inputs;
|
|
295
|
+
exports.Labels = index$2u.Labels;
|
|
296
|
+
exports.SelectScroll = index$2v.SelectScroll;
|
|
297
|
+
exports.Selector = index$2w.Selector;
|
|
298
|
+
exports.Selects = index$2x.Selects;
|
|
299
|
+
exports.Sliders = index$2y.Sliders;
|
|
300
|
+
exports.Switchs = index$2z.Switchs;
|
|
301
|
+
exports.Texts = index$2A.Texts;
|
|
302
|
+
exports.Uploads = index$2B.Uploads;
|
|
303
|
+
exports.List = index$2C.List;
|
|
304
|
+
exports.Lists = index$2D.Lists;
|
|
305
|
+
exports.Listsp = index$2E.Listsp;
|
|
306
|
+
exports.Listspd = index$2F.Listspd;
|
|
307
|
+
exports.Paging = index$2G.Paging;
|
|
308
|
+
exports.Tables = index$2H.Tables;
|
|
309
|
+
exports.Tablesp = index$2I.Tablesp;
|
|
310
|
+
exports.Tablespd = index$2J.Tablespd;
|
|
311
|
+
exports.Tabless = index$2K.Tabless;
|
|
312
|
+
exports.Tablesv = index$2L.Tablesv;
|
|
313
|
+
exports.Tablesvp = index$2M.Tablesvp;
|
|
314
|
+
exports.Tablesvpd = index$2N.Tablesvpd;
|
|
311
315
|
Object.keys(index$2).forEach((k) => {
|
|
312
316
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
313
317
|
enumerable: true,
|
|
@@ -101,6 +101,8 @@ export * from './dates-picker/index';
|
|
|
101
101
|
export * from './dates/index';
|
|
102
102
|
export * from './dates2/index';
|
|
103
103
|
export * from './double/index';
|
|
104
|
+
export * from './edit-data-add/index';
|
|
105
|
+
export * from './edit-data/index';
|
|
104
106
|
export * from './edit-float/index';
|
|
105
107
|
export * from './edit/index';
|
|
106
108
|
export * from './history/index';
|
package/dist/components/index.js
CHANGED
|
@@ -102,6 +102,8 @@ import { DatesPicker } from "./dates-picker/index.js";
|
|
|
102
102
|
import { Dates } from "./dates/index.js";
|
|
103
103
|
import { Dates2 } from "./dates2/index.js";
|
|
104
104
|
import { Double } from "./double/index.js";
|
|
105
|
+
import { EditDataAdd } from "./edit-data-add/index.js";
|
|
106
|
+
import { EditData } from "./edit-data/index.js";
|
|
105
107
|
import { EditFloat } from "./edit-float/index.js";
|
|
106
108
|
import { Edit } from "./edit/index.js";
|
|
107
109
|
import { History } from "./history/index.js";
|
|
@@ -216,6 +218,8 @@ export {
|
|
|
216
218
|
DropdownItem,
|
|
217
219
|
DropdownMenu,
|
|
218
220
|
Edit,
|
|
221
|
+
EditData,
|
|
222
|
+
EditDataAdd,
|
|
219
223
|
EditFloat,
|
|
220
224
|
Form,
|
|
221
225
|
FormItem,
|