@fangzhongya/fang-ui 0.0.58 → 0.0.60
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/array/src/data.cjs +3 -3
- package/dist/components/array/src/data.d.ts +0 -3
- package/dist/components/array/src/data.js +3 -3
- package/dist/components/array/src/index2.cjs +27 -11
- package/dist/components/array/src/index2.js +23 -7
- package/dist/components/common/use.cjs +1 -1
- package/dist/components/common/use.js +1 -1
- package/dist/components/dialogs/src/data.cjs +2 -4
- package/dist/components/dialogs/src/data.d.ts +0 -2
- package/dist/components/dialogs/src/data.js +2 -4
- package/dist/components/dialogs/src/index2.cjs +24 -12
- package/dist/components/dialogs/src/index2.js +17 -5
- package/dist/components/forms/index.css +3 -0
- package/dist/components/forms/index.scss +3 -0
- package/dist/components/forms/src/index2.cjs +16 -14
- package/dist/components/forms/src/index2.js +3 -1
- package/dist/components/forms/src/setup.cjs +11 -5
- package/dist/components/forms/src/setup.d.ts +1 -1
- package/dist/components/forms/src/setup.js +11 -5
- package/dist/components/forms/src/util.cjs +5 -4
- package/dist/components/forms/src/util.d.ts +1 -1
- package/dist/components/forms/src/util.js +5 -4
- package/dist/components/forms-drag/src/index2.cjs +96 -45
- package/dist/components/forms-drag/src/index2.js +91 -40
- package/dist/components/icon-picker/index.css +1 -0
- package/dist/components/icon-picker/index.scss +1 -0
- package/dist/components/iframe/index.css +4 -0
- package/dist/components/iframe/index.scss +4 -0
- package/dist/components/iframe/src/index2.cjs +19 -7
- package/dist/components/iframe/src/index2.js +20 -8
- package/dist/components/iframe/style/index2.scss +3 -0
- package/dist/components/index.cjs +110 -108
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.scss +2 -1
- package/dist/components/index2.scss +3 -2
- package/dist/components/input-history/index.css +7 -17
- package/dist/components/input-history/index.scss +34 -42
- package/dist/components/input-history/src/index2.cjs +3 -12
- package/dist/components/input-history/src/index2.js +3 -12
- package/dist/components/inputs/src/index2.cjs +11 -9
- package/dist/components/inputs/src/index2.js +3 -1
- package/dist/components/keep-com/src/data.d.ts +3 -0
- package/dist/components/lists/index.css +0 -5
- package/dist/components/lists/index.scss +0 -5
- package/dist/components/lists/src/index2.cjs +2 -5
- package/dist/components/lists/src/index2.js +3 -6
- package/dist/components/listsp/index.css +1 -5
- package/dist/components/listsp/src/index2.cjs +11 -9
- package/dist/components/listsp/src/index2.js +3 -1
- package/dist/components/no-data/index.cjs +9 -0
- package/dist/components/no-data/index.css +19 -0
- package/dist/components/no-data/index.d.ts +4 -0
- package/dist/components/no-data/index.js +9 -0
- package/dist/components/no-data/index.scss +8 -0
- package/dist/components/no-data/src/data.cjs +24 -0
- package/dist/components/no-data/src/data.d.ts +26 -0
- package/dist/components/no-data/src/data.js +24 -0
- package/dist/components/no-data/src/index.cjs +4 -0
- package/dist/components/no-data/src/index.js +4 -0
- package/dist/components/no-data/src/index2.cjs +34 -0
- package/dist/components/no-data/src/index2.js +34 -0
- package/dist/components/page/index.css +4 -0
- package/dist/components/page/set-column.css +8 -8
- package/dist/components/page/src/index2.cjs +41 -39
- package/dist/components/page/src/index2.js +15 -13
- package/dist/components/page/src/set-column.cjs +1 -1
- package/dist/components/page/src/set-column.js +1 -1
- package/dist/components/page/src/set-column2.cjs +3 -6
- package/dist/components/page/src/set-column2.js +4 -7
- package/dist/components/paging/index.css +1 -0
- package/dist/components/paging/index.scss +1 -0
- package/dist/components/paging/src/index2.cjs +18 -10
- package/dist/components/paging/src/index2.js +12 -4
- package/dist/components/selector/src/index2.cjs +17 -15
- package/dist/components/selector/src/index2.js +8 -6
- package/dist/components/tables/common/pagin.cjs +3 -3
- package/dist/components/tables/common/pagin.d.ts +1 -1
- package/dist/components/tables/common/pagin.js +3 -3
- package/dist/components/tables/src/index2.cjs +4 -7
- package/dist/components/tables/src/index2.js +3 -6
- package/dist/components/tablesp/index.css +1 -0
- package/dist/components/tablesp/src/index2.cjs +11 -9
- package/dist/components/tablesp/src/index2.js +3 -1
- package/dist/components/tabless/src/index2.cjs +11 -9
- package/dist/components/tabless/src/index2.js +3 -1
- package/dist/components/tablesv/src/index2.cjs +2 -5
- package/dist/components/tablesv/src/index2.js +3 -6
- package/dist/components/tablesvp/index.css +1 -0
- package/dist/components/tablesvp/src/index2.cjs +9 -7
- package/dist/components/tablesvp/src/index2.js +3 -1
- package/dist/css/forms.css +3 -0
- package/dist/css/icon-picker.css +1 -0
- package/dist/css/iframe.css +4 -0
- package/dist/css/index.css +44 -22
- package/dist/css/input-history.css +7 -17
- package/dist/css/lists.css +0 -5
- package/dist/css/listsp.css +1 -5
- package/dist/css/no-data.css +19 -0
- package/dist/css/page/set-column.css +8 -8
- package/dist/css/page.css +4 -0
- package/dist/css/paging.css +1 -0
- package/dist/css/tablesp.css +1 -0
- package/dist/css/tablesvp.css +1 -0
- package/dist/expand/{chunk-ID2WVA6N.js → chunk-3HYUAX6P.js} +2 -0
- package/dist/expand/{chunk-NEHCZ3EJ.cjs → chunk-IPHLXLMM.cjs} +2 -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/hooks/index.cjs +2 -0
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/locale/index.cjs +51 -2
- package/dist/hooks/locale/index.d.ts +64 -3
- package/dist/hooks/locale/index.js +51 -2
- package/dist/icons/index.css +31 -31
- package/dist/icons/index.json +7 -7
- package/dist/index.cjs +128 -126
- package/dist/index.css +44 -22
- package/dist/index.js +2 -0
- package/dist/locale/en.cjs +38 -15
- package/dist/locale/en.d.ts +27 -4
- package/dist/locale/en.js +38 -15
- package/dist/locale/zh-cn.cjs +24 -3
- package/dist/locale/zh-cn.d.ts +23 -2
- package/dist/locale/zh-cn.js +24 -3
- package/dist/types/locale.d.ts +1 -1
- package/package.json +11 -11
- /package/dist/components/{forms-item → forms-items}/index.css +0 -0
- /package/dist/components/{option → keep-com}/index.css +0 -0
- /package/dist/css/{forms-item.css → forms-items.css} +0 -0
- /package/dist/css/{option.css → keep-com.css} +0 -0
|
@@ -20,18 +20,18 @@ const Changes = [
|
|
|
20
20
|
"Switch",
|
|
21
21
|
"Cascader"
|
|
22
22
|
];
|
|
23
|
-
function setUp(props, emit, cs, refForm) {
|
|
23
|
+
function setUp(props, emit, cs, refForm, getLocale) {
|
|
24
24
|
const buts = computed(() => {
|
|
25
25
|
if (typeof props.buts == "undefined") {
|
|
26
26
|
return [
|
|
27
27
|
{
|
|
28
28
|
_id: "2",
|
|
29
|
-
label: "
|
|
29
|
+
label: getLocale("close")
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
_id: "1",
|
|
33
33
|
type: "primary",
|
|
34
|
-
label: "
|
|
34
|
+
label: getLocale("form.confirm")
|
|
35
35
|
}
|
|
36
36
|
];
|
|
37
37
|
} else {
|
|
@@ -116,7 +116,7 @@ function setUp(props, emit, cs, refForm) {
|
|
|
116
116
|
}
|
|
117
117
|
obj.config = obj.config ?? {};
|
|
118
118
|
if (((_a = obj.config) == null ? void 0 : _a.placeholder) === void 0) {
|
|
119
|
-
obj.config.placeholder = (trigger == 1 ? "
|
|
119
|
+
obj.config.placeholder = (trigger == 1 ? getLocale("form.import") : getLocale("form.select")) + obj.label;
|
|
120
120
|
}
|
|
121
121
|
if (((_b = obj.config) == null ? void 0 : _b.clearable) === void 0) {
|
|
122
122
|
obj.config.clearable = true;
|
|
@@ -127,7 +127,13 @@ function setUp(props, emit, cs, refForm) {
|
|
|
127
127
|
if (obj.rules) {
|
|
128
128
|
rules[p] = obj.rules;
|
|
129
129
|
} else if (obj.rule) {
|
|
130
|
-
rules[p] = getRule(
|
|
130
|
+
rules[p] = getRule(
|
|
131
|
+
trigger,
|
|
132
|
+
obj,
|
|
133
|
+
dataForm,
|
|
134
|
+
refForm,
|
|
135
|
+
getLocale
|
|
136
|
+
);
|
|
131
137
|
} else {
|
|
132
138
|
rules[p] = [];
|
|
133
139
|
}
|
|
@@ -19,7 +19,7 @@ function _interopNamespaceDefault(e) {
|
|
|
19
19
|
return Object.freeze(n);
|
|
20
20
|
}
|
|
21
21
|
const judge__namespace = /* @__PURE__ */ _interopNamespaceDefault(judge);
|
|
22
|
-
function getRule(trigger, obj, data, refForm) {
|
|
22
|
+
function getRule(trigger, obj, data, refForm, getLocale) {
|
|
23
23
|
var _a;
|
|
24
24
|
const name = obj.label;
|
|
25
25
|
let multiple = obj.multiple ?? ((_a = obj.config) == null ? void 0 : _a.multiple);
|
|
@@ -52,7 +52,8 @@ function getRule(trigger, obj, data, refForm) {
|
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
required = obj.required ?? required;
|
|
55
|
-
let inputPrompt = trigger == 1 ? "
|
|
55
|
+
let inputPrompt = trigger == 1 ? getLocale("form.import") : getLocale("form.select");
|
|
56
|
+
const verif = getLocale("form.verif");
|
|
56
57
|
let validator = function(rule2, value, callback) {
|
|
57
58
|
callback();
|
|
58
59
|
};
|
|
@@ -82,7 +83,7 @@ function getRule(trigger, obj, data, refForm) {
|
|
|
82
83
|
} else if (multiple && value.length == 0) {
|
|
83
84
|
callback(new Error(inputPrompt + name));
|
|
84
85
|
} else if (isJudgeFailed(value)) {
|
|
85
|
-
callback(new Error(name +
|
|
86
|
+
callback(new Error(name + verif));
|
|
86
87
|
} else {
|
|
87
88
|
processCallback(
|
|
88
89
|
callback,
|
|
@@ -98,7 +99,7 @@ function getRule(trigger, obj, data, refForm) {
|
|
|
98
99
|
if (use.useHide(obj, data.value)) {
|
|
99
100
|
callback();
|
|
100
101
|
} else if (value && value !== 0 && isJudgeFailed(value)) {
|
|
101
|
-
callback(new Error(name +
|
|
102
|
+
callback(new Error(name + verif));
|
|
102
103
|
} else {
|
|
103
104
|
processCallback(
|
|
104
105
|
callback,
|
|
@@ -18,5 +18,5 @@ export type Rules = {
|
|
|
18
18
|
* @param {any} refForm 表单引用
|
|
19
19
|
* @returns {{ required: boolean, validator: Function, trigger: string }}
|
|
20
20
|
*/
|
|
21
|
-
export declare function getRule(trigger: number, obj: ListObj, data: any, refForm: any): Rule;
|
|
21
|
+
export declare function getRule(trigger: number, obj: ListObj, data: any, refForm: any, getLocale: Function): Rule;
|
|
22
22
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useHide } from "../../common/use.js";
|
|
2
2
|
import * as judge from "@fangzhongya/utils/judge/judge";
|
|
3
|
-
function getRule(trigger, obj, data, refForm) {
|
|
3
|
+
function getRule(trigger, obj, data, refForm, getLocale) {
|
|
4
4
|
var _a;
|
|
5
5
|
const name = obj.label;
|
|
6
6
|
let multiple = obj.multiple ?? ((_a = obj.config) == null ? void 0 : _a.multiple);
|
|
@@ -33,7 +33,8 @@ function getRule(trigger, obj, data, refForm) {
|
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
required = obj.required ?? required;
|
|
36
|
-
let inputPrompt = trigger == 1 ? "
|
|
36
|
+
let inputPrompt = trigger == 1 ? getLocale("form.import") : getLocale("form.select");
|
|
37
|
+
const verif = getLocale("form.verif");
|
|
37
38
|
let validator = function(rule2, value, callback) {
|
|
38
39
|
callback();
|
|
39
40
|
};
|
|
@@ -63,7 +64,7 @@ function getRule(trigger, obj, data, refForm) {
|
|
|
63
64
|
} else if (multiple && value.length == 0) {
|
|
64
65
|
callback(new Error(inputPrompt + name));
|
|
65
66
|
} else if (isJudgeFailed(value)) {
|
|
66
|
-
callback(new Error(name +
|
|
67
|
+
callback(new Error(name + verif));
|
|
67
68
|
} else {
|
|
68
69
|
processCallback(
|
|
69
70
|
callback,
|
|
@@ -79,7 +80,7 @@ function getRule(trigger, obj, data, refForm) {
|
|
|
79
80
|
if (useHide(obj, data.value)) {
|
|
80
81
|
callback();
|
|
81
82
|
} else if (value && value !== 0 && isJudgeFailed(value)) {
|
|
82
|
-
callback(new Error(name +
|
|
83
|
+
callback(new Error(name + verif));
|
|
83
84
|
} else {
|
|
84
85
|
processCallback(
|
|
85
86
|
callback,
|
|
@@ -3,16 +3,16 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const Draggable = require("vuedraggable");
|
|
5
5
|
const data = require("../../forms/src/data.cjs");
|
|
6
|
-
const index$
|
|
7
|
-
const index$
|
|
8
|
-
const index$
|
|
9
|
-
const
|
|
10
|
-
require("../../../hooks/index.cjs");
|
|
6
|
+
const index$5 = require("../../forms-div/index.cjs");
|
|
7
|
+
const index$6 = require("../../forms-item/index.cjs");
|
|
8
|
+
const index$3 = require("element-plus/es/components/form/index");
|
|
9
|
+
const index$4 = require("element-plus/es/components/button/index");
|
|
10
|
+
const index$2 = require("../../../hooks/cssname/index.cjs");
|
|
11
|
+
const index$1 = require("../../../hooks/inherit/index.cjs");
|
|
11
12
|
const use = require("../../common/use.cjs");
|
|
12
13
|
const setup = require("../../forms/src/setup.cjs");
|
|
13
|
-
const index$
|
|
14
|
-
const index = require("../../../hooks/
|
|
15
|
-
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
14
|
+
const index$7 = require("../../../directives/adjust/index.cjs");
|
|
15
|
+
const index = require("../../../hooks/locale/index.cjs");
|
|
16
16
|
const _hoisted_1 = ["onClick", "data-key"];
|
|
17
17
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
18
18
|
...{ inheritAttrs: false },
|
|
@@ -39,10 +39,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
42
|
-
const
|
|
42
|
+
const { getLocale } = index.useLocale();
|
|
43
|
+
const slots = vue.useSlots();
|
|
44
|
+
const attrs = index$1.useInherit(vue.useAttrs());
|
|
43
45
|
const props = __props;
|
|
44
46
|
const emit = __emit;
|
|
45
|
-
const cs = index$
|
|
47
|
+
const cs = index$2.useCssName("forms");
|
|
46
48
|
const refForm = vue.ref();
|
|
47
49
|
const {
|
|
48
50
|
buts,
|
|
@@ -56,7 +58,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
56
58
|
closeForm,
|
|
57
59
|
dataForm,
|
|
58
60
|
validate
|
|
59
|
-
} = setup.setUp(props, emit, cs, refForm);
|
|
61
|
+
} = setup.setUp(props, emit, cs, refForm, getLocale);
|
|
60
62
|
const refEl = vue.ref();
|
|
61
63
|
const drag = vue.ref(false);
|
|
62
64
|
const dragOptions = {
|
|
@@ -65,7 +67,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
65
67
|
disabled: false,
|
|
66
68
|
ghostClass: "ghost"
|
|
67
69
|
};
|
|
68
|
-
const
|
|
70
|
+
const lists = vue.computed({
|
|
69
71
|
get() {
|
|
70
72
|
return props.list;
|
|
71
73
|
},
|
|
@@ -88,6 +90,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
88
90
|
function onChangeAdjust(item, index2, obj, data2) {
|
|
89
91
|
emit("adjust", item, index2, obj, data2);
|
|
90
92
|
}
|
|
93
|
+
function setKey(value, index2) {
|
|
94
|
+
return [index2, value.label, value.prop, value.compon].join(",");
|
|
95
|
+
}
|
|
91
96
|
__expose({
|
|
92
97
|
el: refEl,
|
|
93
98
|
dataForm,
|
|
@@ -100,103 +105,149 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
100
105
|
return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
101
106
|
ref_key: "refEl",
|
|
102
107
|
ref: refEl,
|
|
103
|
-
class: [vue.unref(cs).z(), "drag"]
|
|
108
|
+
class: [vue.unref(cs).z(), "drag"],
|
|
109
|
+
style: vue.unref(cs).vdo({
|
|
110
|
+
itemBottom: _ctx.itemBottom,
|
|
111
|
+
inlineRight: _ctx.inlineRight,
|
|
112
|
+
queryInterval: _ctx.queryInterval,
|
|
113
|
+
rowHeight: _ctx.rowHeight
|
|
114
|
+
})
|
|
104
115
|
}, vue.unref(attrs).root), [
|
|
105
116
|
vue.createElementVNode("div", {
|
|
106
117
|
class: vue.normalizeClass([
|
|
107
118
|
vue.unref(cs).z("div"),
|
|
108
119
|
vue.unref(cs).zis("div", "inline", props.inline),
|
|
109
|
-
vue.unref(cs).zis("div", "box", props.inlineBox)
|
|
120
|
+
vue.unref(cs).zis("div", "box", props.inlineBox),
|
|
121
|
+
vue.unref(cs).zis("div", "query", props.query),
|
|
122
|
+
vue.unref(cs).zis("div", "column", props.column > 1)
|
|
110
123
|
]),
|
|
111
124
|
style: vue.normalizeStyle(vue.unref(styles))
|
|
112
125
|
}, [
|
|
113
|
-
vue.
|
|
114
|
-
|
|
126
|
+
(vue.openBlock(), vue.createBlock(vue.unref(index$3.ElForm), vue.mergeProps(vue.unref(attrs).assem, {
|
|
127
|
+
key: props.list.length,
|
|
128
|
+
class: [vue.unref(cs).z("elf"), props.labelPosition],
|
|
115
129
|
model: vue.unref(dataForm),
|
|
116
130
|
disabled: props.disabled,
|
|
117
131
|
rules: vue.unref(dataRules),
|
|
118
|
-
"label-width": props.labelWidth,
|
|
119
|
-
|
|
120
|
-
}, ["prevent"])),
|
|
132
|
+
"label-width": props.labelPosition == "auto" ? "" : props.labelWidth,
|
|
133
|
+
"label-position": props.labelPosition == "auto" ? void 0 : props.labelPosition,
|
|
121
134
|
ref_key: "refForm",
|
|
122
|
-
ref: refForm
|
|
135
|
+
ref: refForm,
|
|
136
|
+
onSubmit: _cache[3] || (_cache[3] = vue.withModifiers(() => {
|
|
137
|
+
}, ["prevent"]))
|
|
123
138
|
}), {
|
|
124
139
|
default: vue.withCtx(() => [
|
|
125
140
|
vue.createVNode(vue.unref(Draggable), vue.mergeProps(dragOptions, {
|
|
126
141
|
onStart,
|
|
127
142
|
onEnd,
|
|
128
|
-
modelValue:
|
|
129
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) =>
|
|
143
|
+
modelValue: lists.value,
|
|
144
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => lists.value = $event),
|
|
130
145
|
"item-key": (key) => key,
|
|
131
146
|
handle: ".handle"
|
|
132
147
|
}), {
|
|
133
148
|
header: vue.withCtx(() => [
|
|
134
149
|
vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).header)
|
|
135
150
|
]),
|
|
136
|
-
item: vue.withCtx(({
|
|
151
|
+
item: vue.withCtx(({ element, index: index2 }) => [
|
|
137
152
|
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
138
153
|
class: vue.normalizeClass(["handle", [
|
|
139
154
|
vue.unref(cs).z("li"),
|
|
140
|
-
vue.unref(cs).is("div",
|
|
141
|
-
|
|
155
|
+
vue.unref(cs).is("div", element == null ? void 0 : element.isdiv),
|
|
156
|
+
element == null ? void 0 : element.class,
|
|
142
157
|
props.itemClass,
|
|
143
158
|
vue.unref(cs).is("hover", props.index == index2)
|
|
144
159
|
]]),
|
|
145
|
-
style: vue.normalizeStyle(vue.unref(setStyles)(
|
|
146
|
-
onClick: vue.withModifiers(($event) => onClickHandle(
|
|
160
|
+
style: vue.normalizeStyle(vue.unref(setStyles)(element)),
|
|
161
|
+
onClick: vue.withModifiers(($event) => onClickHandle(element, index2), ["stop"]),
|
|
147
162
|
"data-key": index2
|
|
148
163
|
}, [
|
|
149
|
-
(
|
|
164
|
+
(element == null ? void 0 : element.isdiv) ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.FormsDiv), {
|
|
150
165
|
key: 0,
|
|
151
|
-
listobj:
|
|
166
|
+
listobj: element,
|
|
152
167
|
optionss: props.options,
|
|
153
168
|
valueobj: vue.unref(dataForm),
|
|
154
169
|
modelValue: vue.unref(dataForm),
|
|
155
170
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(dataForm) ? dataForm.value = $event : null)
|
|
156
|
-
},
|
|
171
|
+
}, vue.createSlots({ _: 2 }, [
|
|
172
|
+
vue.renderList(Object.keys(vue.unref(slots)), (k) => {
|
|
173
|
+
return {
|
|
174
|
+
name: k,
|
|
175
|
+
fn: vue.withCtx((scope) => [
|
|
176
|
+
vue.renderSlot(_ctx.$slots, k, vue.normalizeProps(vue.guardReactiveProps(scope)))
|
|
177
|
+
])
|
|
178
|
+
};
|
|
179
|
+
})
|
|
180
|
+
]), 1032, ["listobj", "optionss", "valueobj", "modelValue"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$6.FormsItem), {
|
|
157
181
|
key: 1,
|
|
158
|
-
listobj:
|
|
182
|
+
listobj: element,
|
|
159
183
|
optionss: props.options,
|
|
160
184
|
valueobj: vue.unref(dataForm),
|
|
161
185
|
modelValue: vue.unref(dataForm),
|
|
162
186
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(dataForm) ? dataForm.value = $event : null)
|
|
163
|
-
},
|
|
187
|
+
}, vue.createSlots({ _: 2 }, [
|
|
188
|
+
vue.renderList(Object.keys(vue.unref(slots)), (k) => {
|
|
189
|
+
return {
|
|
190
|
+
name: k,
|
|
191
|
+
fn: vue.withCtx((scope) => [
|
|
192
|
+
vue.renderSlot(_ctx.$slots, k, vue.normalizeProps(vue.guardReactiveProps(scope)))
|
|
193
|
+
])
|
|
194
|
+
};
|
|
195
|
+
})
|
|
196
|
+
]), 1032, ["listobj", "optionss", "valueobj", "modelValue"]))
|
|
164
197
|
], 14, _hoisted_1)), [
|
|
165
|
-
[vue.unref(index$
|
|
198
|
+
[vue.unref(index$7.default), {
|
|
166
199
|
right: true,
|
|
167
200
|
onChange: (obj, data2) => {
|
|
168
|
-
onChangeAdjust(
|
|
201
|
+
onChangeAdjust(element, index2, obj, data2);
|
|
169
202
|
}
|
|
170
203
|
}],
|
|
171
|
-
[vue.vShow, !vue.unref(use.useHide)(
|
|
204
|
+
[vue.vShow, !vue.unref(use.useHide)(element, vue.unref(dataForm))]
|
|
172
205
|
])
|
|
173
206
|
]),
|
|
174
207
|
footer: vue.withCtx(() => [
|
|
175
208
|
vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).footer),
|
|
176
209
|
vue.unref(buts) && vue.unref(buts).length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
177
210
|
key: 0,
|
|
178
|
-
class: vue.normalizeClass([vue.unref(cs).z("li"), vue.unref(cs).z("buts")])
|
|
211
|
+
class: vue.normalizeClass([vue.unref(cs).z("li"), vue.unref(cs).z("buts")]),
|
|
212
|
+
style: vue.normalizeStyle(vue.unref(setStyles)({}))
|
|
179
213
|
}, [
|
|
180
|
-
vue.createVNode(vue.unref(
|
|
214
|
+
vue.createVNode(vue.unref(index$3.ElFormItem), {
|
|
181
215
|
"label-width": props.butLeft
|
|
182
216
|
}, {
|
|
183
217
|
default: vue.withCtx(() => [
|
|
184
|
-
vue.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
},
|
|
218
|
+
vue.createElementVNode("div", {
|
|
219
|
+
style: vue.normalizeStyle({
|
|
220
|
+
height: props.butHeight ?? props.rowHeight
|
|
221
|
+
}),
|
|
222
|
+
class: vue.normalizeClass(vue.unref(cs).z("buts-div"))
|
|
223
|
+
}, [
|
|
224
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(buts), (item, index2) => {
|
|
225
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
|
|
226
|
+
!vue.unref(use.useHide)(item, vue.unref(dataForm)) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.ElButton), vue.mergeProps({
|
|
227
|
+
key: 0,
|
|
228
|
+
ref_for: true
|
|
229
|
+
}, item, {
|
|
230
|
+
disabled: item.disabled ?? props.disabled,
|
|
231
|
+
onClick: vue.withModifiers(($event) => vue.unref(onClickButs)(item, index2, $event), ["stop"])
|
|
232
|
+
}), {
|
|
233
|
+
default: vue.withCtx(() => [
|
|
234
|
+
vue.createTextVNode(vue.toDisplayString(item.label), 1)
|
|
235
|
+
]),
|
|
236
|
+
_: 2
|
|
237
|
+
}, 1040, ["disabled", "onClick"])) : vue.createCommentVNode("", true)
|
|
238
|
+
], 64);
|
|
239
|
+
}), 128))
|
|
240
|
+
], 6)
|
|
190
241
|
]),
|
|
191
242
|
_: 1
|
|
192
243
|
}, 8, ["label-width"])
|
|
193
|
-
],
|
|
244
|
+
], 6)) : vue.createCommentVNode("", true)
|
|
194
245
|
]),
|
|
195
246
|
_: 3
|
|
196
247
|
}, 16, ["modelValue", "item-key"])
|
|
197
248
|
]),
|
|
198
249
|
_: 3
|
|
199
|
-
}, 16, ["class", "model", "disabled", "rules", "label-width"])
|
|
250
|
+
}, 16, ["class", "model", "disabled", "rules", "label-width", "label-position"]))
|
|
200
251
|
], 6)
|
|
201
252
|
], 16);
|
|
202
253
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeStyle, normalizeClass,
|
|
1
|
+
import { defineComponent, useSlots, useAttrs, ref, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeStyle, normalizeClass, createBlock, withModifiers, withCtx, createVNode, renderSlot, createCommentVNode, Fragment, renderList, createTextVNode, toDisplayString, withDirectives, isRef, createSlots, normalizeProps, guardReactiveProps, vShow } from "vue";
|
|
2
2
|
import Draggable from "vuedraggable";
|
|
3
3
|
import { dataSlot, dataEmits, dataProps } from "../../forms/src/data.js";
|
|
4
4
|
import { FormsDiv } from "../../forms-div/index.js";
|
|
5
5
|
import { FormsItem } from "../../forms-item/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "../../../hooks/index.js";
|
|
6
|
+
import { ElForm, ElFormItem } from "element-plus/es/components/form/index";
|
|
7
|
+
import { ElButton } from "element-plus/es/components/button/index";
|
|
8
|
+
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
9
|
+
import { useInherit } from "../../../hooks/inherit/index.js";
|
|
9
10
|
import { useHide } from "../../common/use.js";
|
|
10
11
|
import { setUp } from "../../forms/src/setup.js";
|
|
11
12
|
import vAdjust from "../../../directives/adjust/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
13
|
+
import { useLocale } from "../../../hooks/locale/index.js";
|
|
14
14
|
const _hoisted_1 = ["onClick", "data-key"];
|
|
15
15
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
16
|
...{ inheritAttrs: false },
|
|
@@ -37,7 +37,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
40
|
-
const
|
|
40
|
+
const { getLocale } = useLocale();
|
|
41
|
+
const slots = useSlots();
|
|
42
|
+
const attrs = useInherit(useAttrs());
|
|
41
43
|
const props = __props;
|
|
42
44
|
const emit = __emit;
|
|
43
45
|
const cs = useCssName("forms");
|
|
@@ -54,7 +56,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
56
|
closeForm,
|
|
55
57
|
dataForm,
|
|
56
58
|
validate
|
|
57
|
-
} = setUp(props, emit, cs, refForm);
|
|
59
|
+
} = setUp(props, emit, cs, refForm, getLocale);
|
|
58
60
|
const refEl = ref();
|
|
59
61
|
const drag = ref(false);
|
|
60
62
|
const dragOptions = {
|
|
@@ -63,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
63
65
|
disabled: false,
|
|
64
66
|
ghostClass: "ghost"
|
|
65
67
|
};
|
|
66
|
-
const
|
|
68
|
+
const lists = computed({
|
|
67
69
|
get() {
|
|
68
70
|
return props.list;
|
|
69
71
|
},
|
|
@@ -86,6 +88,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
88
|
function onChangeAdjust(item, index, obj, data) {
|
|
87
89
|
emit("adjust", item, index, obj, data);
|
|
88
90
|
}
|
|
91
|
+
function setKey(value, index) {
|
|
92
|
+
return [index, value.label, value.prop, value.compon].join(",");
|
|
93
|
+
}
|
|
89
94
|
__expose({
|
|
90
95
|
el: refEl,
|
|
91
96
|
dataForm,
|
|
@@ -98,103 +103,149 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
98
103
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
99
104
|
ref_key: "refEl",
|
|
100
105
|
ref: refEl,
|
|
101
|
-
class: [unref(cs).z(), "drag"]
|
|
106
|
+
class: [unref(cs).z(), "drag"],
|
|
107
|
+
style: unref(cs).vdo({
|
|
108
|
+
itemBottom: _ctx.itemBottom,
|
|
109
|
+
inlineRight: _ctx.inlineRight,
|
|
110
|
+
queryInterval: _ctx.queryInterval,
|
|
111
|
+
rowHeight: _ctx.rowHeight
|
|
112
|
+
})
|
|
102
113
|
}, unref(attrs).root), [
|
|
103
114
|
createElementVNode("div", {
|
|
104
115
|
class: normalizeClass([
|
|
105
116
|
unref(cs).z("div"),
|
|
106
117
|
unref(cs).zis("div", "inline", props.inline),
|
|
107
|
-
unref(cs).zis("div", "box", props.inlineBox)
|
|
118
|
+
unref(cs).zis("div", "box", props.inlineBox),
|
|
119
|
+
unref(cs).zis("div", "query", props.query),
|
|
120
|
+
unref(cs).zis("div", "column", props.column > 1)
|
|
108
121
|
]),
|
|
109
122
|
style: normalizeStyle(unref(styles))
|
|
110
123
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
124
|
+
(openBlock(), createBlock(unref(ElForm), mergeProps(unref(attrs).assem, {
|
|
125
|
+
key: props.list.length,
|
|
126
|
+
class: [unref(cs).z("elf"), props.labelPosition],
|
|
113
127
|
model: unref(dataForm),
|
|
114
128
|
disabled: props.disabled,
|
|
115
129
|
rules: unref(dataRules),
|
|
116
|
-
"label-width": props.labelWidth,
|
|
117
|
-
|
|
118
|
-
}, ["prevent"])),
|
|
130
|
+
"label-width": props.labelPosition == "auto" ? "" : props.labelWidth,
|
|
131
|
+
"label-position": props.labelPosition == "auto" ? void 0 : props.labelPosition,
|
|
119
132
|
ref_key: "refForm",
|
|
120
|
-
ref: refForm
|
|
133
|
+
ref: refForm,
|
|
134
|
+
onSubmit: _cache[3] || (_cache[3] = withModifiers(() => {
|
|
135
|
+
}, ["prevent"]))
|
|
121
136
|
}), {
|
|
122
137
|
default: withCtx(() => [
|
|
123
138
|
createVNode(unref(Draggable), mergeProps(dragOptions, {
|
|
124
139
|
onStart,
|
|
125
140
|
onEnd,
|
|
126
|
-
modelValue:
|
|
127
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) =>
|
|
141
|
+
modelValue: lists.value,
|
|
142
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => lists.value = $event),
|
|
128
143
|
"item-key": (key) => key,
|
|
129
144
|
handle: ".handle"
|
|
130
145
|
}), {
|
|
131
146
|
header: withCtx(() => [
|
|
132
147
|
renderSlot(_ctx.$slots, unref(dataSlot).header)
|
|
133
148
|
]),
|
|
134
|
-
item: withCtx(({
|
|
149
|
+
item: withCtx(({ element, index }) => [
|
|
135
150
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
136
151
|
class: normalizeClass(["handle", [
|
|
137
152
|
unref(cs).z("li"),
|
|
138
|
-
unref(cs).is("div",
|
|
139
|
-
|
|
153
|
+
unref(cs).is("div", element == null ? void 0 : element.isdiv),
|
|
154
|
+
element == null ? void 0 : element.class,
|
|
140
155
|
props.itemClass,
|
|
141
156
|
unref(cs).is("hover", props.index == index)
|
|
142
157
|
]]),
|
|
143
|
-
style: normalizeStyle(unref(setStyles)(
|
|
144
|
-
onClick: withModifiers(($event) => onClickHandle(
|
|
158
|
+
style: normalizeStyle(unref(setStyles)(element)),
|
|
159
|
+
onClick: withModifiers(($event) => onClickHandle(element, index), ["stop"]),
|
|
145
160
|
"data-key": index
|
|
146
161
|
}, [
|
|
147
|
-
(
|
|
162
|
+
(element == null ? void 0 : element.isdiv) ? (openBlock(), createBlock(unref(FormsDiv), {
|
|
148
163
|
key: 0,
|
|
149
|
-
listobj:
|
|
164
|
+
listobj: element,
|
|
150
165
|
optionss: props.options,
|
|
151
166
|
valueobj: unref(dataForm),
|
|
152
167
|
modelValue: unref(dataForm),
|
|
153
168
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(dataForm) ? dataForm.value = $event : null)
|
|
154
|
-
},
|
|
169
|
+
}, createSlots({ _: 2 }, [
|
|
170
|
+
renderList(Object.keys(unref(slots)), (k) => {
|
|
171
|
+
return {
|
|
172
|
+
name: k,
|
|
173
|
+
fn: withCtx((scope) => [
|
|
174
|
+
renderSlot(_ctx.$slots, k, normalizeProps(guardReactiveProps(scope)))
|
|
175
|
+
])
|
|
176
|
+
};
|
|
177
|
+
})
|
|
178
|
+
]), 1032, ["listobj", "optionss", "valueobj", "modelValue"])) : (openBlock(), createBlock(unref(FormsItem), {
|
|
155
179
|
key: 1,
|
|
156
|
-
listobj:
|
|
180
|
+
listobj: element,
|
|
157
181
|
optionss: props.options,
|
|
158
182
|
valueobj: unref(dataForm),
|
|
159
183
|
modelValue: unref(dataForm),
|
|
160
184
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(dataForm) ? dataForm.value = $event : null)
|
|
161
|
-
},
|
|
185
|
+
}, createSlots({ _: 2 }, [
|
|
186
|
+
renderList(Object.keys(unref(slots)), (k) => {
|
|
187
|
+
return {
|
|
188
|
+
name: k,
|
|
189
|
+
fn: withCtx((scope) => [
|
|
190
|
+
renderSlot(_ctx.$slots, k, normalizeProps(guardReactiveProps(scope)))
|
|
191
|
+
])
|
|
192
|
+
};
|
|
193
|
+
})
|
|
194
|
+
]), 1032, ["listobj", "optionss", "valueobj", "modelValue"]))
|
|
162
195
|
], 14, _hoisted_1)), [
|
|
163
196
|
[unref(vAdjust), {
|
|
164
197
|
right: true,
|
|
165
198
|
onChange: (obj, data) => {
|
|
166
|
-
onChangeAdjust(
|
|
199
|
+
onChangeAdjust(element, index, obj, data);
|
|
167
200
|
}
|
|
168
201
|
}],
|
|
169
|
-
[vShow, !unref(useHide)(
|
|
202
|
+
[vShow, !unref(useHide)(element, unref(dataForm))]
|
|
170
203
|
])
|
|
171
204
|
]),
|
|
172
205
|
footer: withCtx(() => [
|
|
173
206
|
renderSlot(_ctx.$slots, unref(dataSlot).footer),
|
|
174
207
|
unref(buts) && unref(buts).length > 0 ? (openBlock(), createElementBlock("div", {
|
|
175
208
|
key: 0,
|
|
176
|
-
class: normalizeClass([unref(cs).z("li"), unref(cs).z("buts")])
|
|
209
|
+
class: normalizeClass([unref(cs).z("li"), unref(cs).z("buts")]),
|
|
210
|
+
style: normalizeStyle(unref(setStyles)({}))
|
|
177
211
|
}, [
|
|
178
212
|
createVNode(unref(ElFormItem), {
|
|
179
213
|
"label-width": props.butLeft
|
|
180
214
|
}, {
|
|
181
215
|
default: withCtx(() => [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
},
|
|
216
|
+
createElementVNode("div", {
|
|
217
|
+
style: normalizeStyle({
|
|
218
|
+
height: props.butHeight ?? props.rowHeight
|
|
219
|
+
}),
|
|
220
|
+
class: normalizeClass(unref(cs).z("buts-div"))
|
|
221
|
+
}, [
|
|
222
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(buts), (item, index) => {
|
|
223
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
224
|
+
!unref(useHide)(item, unref(dataForm)) ? (openBlock(), createBlock(unref(ElButton), mergeProps({
|
|
225
|
+
key: 0,
|
|
226
|
+
ref_for: true
|
|
227
|
+
}, item, {
|
|
228
|
+
disabled: item.disabled ?? props.disabled,
|
|
229
|
+
onClick: withModifiers(($event) => unref(onClickButs)(item, index, $event), ["stop"])
|
|
230
|
+
}), {
|
|
231
|
+
default: withCtx(() => [
|
|
232
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
233
|
+
]),
|
|
234
|
+
_: 2
|
|
235
|
+
}, 1040, ["disabled", "onClick"])) : createCommentVNode("", true)
|
|
236
|
+
], 64);
|
|
237
|
+
}), 128))
|
|
238
|
+
], 6)
|
|
188
239
|
]),
|
|
189
240
|
_: 1
|
|
190
241
|
}, 8, ["label-width"])
|
|
191
|
-
],
|
|
242
|
+
], 6)) : createCommentVNode("", true)
|
|
192
243
|
]),
|
|
193
244
|
_: 3
|
|
194
245
|
}, 16, ["modelValue", "item-key"])
|
|
195
246
|
]),
|
|
196
247
|
_: 3
|
|
197
|
-
}, 16, ["class", "model", "disabled", "rules", "label-width"])
|
|
248
|
+
}, 16, ["class", "model", "disabled", "rules", "label-width", "label-position"]))
|
|
198
249
|
], 6)
|
|
199
250
|
], 16);
|
|
200
251
|
};
|