@web-utils/form-ui 1.0.0-beta52 → 1.0.0-beta54
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/chunks/{C2zgFLYO.mjs → 4rnKCvCw.mjs} +35 -31
- package/chunks/{Dt3lfDnL.mjs → 7GmKqdbC.mjs} +48 -33
- package/chunks/{DitpKWMd.mjs → 9MExJqL-.mjs} +2 -2
- package/chunks/{DZJ-ShZA2.mjs → B3yVc-P62.mjs} +4 -4
- package/chunks/{DkXlFWjs.mjs → B6yWUT6z.mjs} +2 -2
- package/chunks/{CkjtCuMs.mjs → BEvOkSfB.mjs} +119 -118
- package/chunks/{D3mFJzGr.mjs → BHbMJZPp.mjs} +63 -62
- package/chunks/{BSU2FqMP2.mjs → BJYlobMz2.mjs} +2 -2
- package/chunks/{KuAMIZnG.mjs → BNXbI4OG.mjs} +1 -1
- package/chunks/{CzHaJsnD.mjs → BV-XUugQ.mjs} +3 -3
- package/chunks/{DcFllKOf2.mjs → BgTCTXs72.mjs} +4 -3
- package/chunks/{BshE3RnA.mjs → BjGlxyi6.mjs} +2 -2
- package/chunks/{BAw6wxW1.mjs → BqC_VU52.mjs} +2 -2
- package/chunks/{B1k8ydde.mjs → BqzJ6vY6.mjs} +2 -2
- package/chunks/{DhVmHzB7.mjs → ByTyNsWf.mjs} +1 -1
- package/chunks/{DVbw6xIr.mjs → CB9QUXUX.mjs} +2 -2
- package/chunks/{GMFHxPJq.mjs → CGuDBVCB.mjs} +4 -3
- package/chunks/{C7G-cAoI.mjs → CPvdsnRN.mjs} +1 -1
- package/chunks/{D2MB3CnR.mjs → CgN7m-1v.mjs} +4 -3
- package/chunks/{CtHmTtVP.mjs → D5EQJdPL.mjs} +3 -3
- package/chunks/{CGHcOyNC2.mjs → D7R9Or2m2.mjs} +3 -3
- package/chunks/D9IFsT272.mjs +513 -0
- package/chunks/{C6hLXCPk.mjs → DFFNxlqD.mjs} +3 -3
- package/chunks/{BWh6u1O0.mjs → DWMePN6q.mjs} +1 -1
- package/chunks/{CBFbSsTJ.mjs → DawYTjoT.mjs} +2 -2
- package/chunks/{JKFepPeL.mjs → DjnHvHXo.mjs} +2 -2
- package/chunks/{v-O82KSn.mjs → DwkOWXIR.mjs} +4 -4
- package/chunks/{BQyL45PF2.mjs → DyCO22Ia2.mjs} +1 -1
- package/chunks/{B75qfA0z.mjs → Dytof5EW.mjs} +2 -2
- package/chunks/{eBESsR-G.mjs → H70Z56YY.mjs} +9 -3
- package/chunks/{CVKPpQdS.mjs → XwerN1TU.mjs} +2 -2
- package/chunks/{BXVB-H8_.mjs → c0Niqotr.mjs} +2 -2
- package/chunks/{DLgFBI_X.mjs → z5FJgzdc.mjs} +4 -3
- package/constants/index.d.ts +1 -0
- package/editable-tree/index.mjs +1 -1
- package/form-cascader/index.mjs +1 -1
- package/form-checkbox/index.d.ts +2 -2
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.mjs +1 -1
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.mjs +1 -1
- package/form-image/index.mjs +1 -1
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.mjs +1 -1
- package/form-input-time/index.mjs +1 -1
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -1
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.mjs +1 -1
- package/form-select/index.mjs +1 -1
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.mjs +1 -1
- package/form-table/index.mjs +1 -1
- package/form-table-plus/index.mjs +1 -1
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.mjs +1 -1
- package/form-time-select/index.mjs +1 -1
- package/index.css +1 -1
- package/index.mjs +33 -33
- package/package.json +1 -1
- package/pageable-table/index.mjs +1 -1
- package/sub-table/index.mjs +1 -1
- package/sub-table-plus/index.mjs +1 -1
- package/table-view/index.mjs +5 -5
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.mjs +1 -1
- package/toolbar-button/style.css +1 -0
- package/vue-cron/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +1 -1
- package/chunks/CjRZ71IY2.mjs +0 -512
|
@@ -96,69 +96,73 @@ var _ = {
|
|
|
96
96
|
inheritAttrs: !1,
|
|
97
97
|
props: { ..._ },
|
|
98
98
|
emits: {},
|
|
99
|
-
setup(_, { slots: v, expose: b }) {
|
|
100
|
-
let { autoBindProps:
|
|
99
|
+
setup(_, { slots: v, expose: b, attrs: x }) {
|
|
100
|
+
let { autoBindProps: S, listeners: C } = e(_, { predicate: y }), w = c(n, null), T = m("form"), E = o(() => _.notTableForm === void 0 ? (w == null ? void 0 : w.tableForm) === void 0 ? !1 : w == null ? void 0 : w.tableForm : !_.notTableForm), D = o(() => E.value ? !1 : _.showMessage), O = o(() => {
|
|
101
101
|
let e = {};
|
|
102
102
|
return _.disabledFields && _.disabledFields.forEach((t) => {
|
|
103
103
|
e[t] = !0;
|
|
104
104
|
}), e;
|
|
105
|
-
}),
|
|
105
|
+
}), k = o(() => {
|
|
106
106
|
let e = {};
|
|
107
107
|
return _.enabledFields && _.enabledFields.length && _.enabledFields.forEach((t) => {
|
|
108
108
|
e[t] = !0;
|
|
109
109
|
}), e;
|
|
110
|
-
}),
|
|
110
|
+
}), A = o(() => {
|
|
111
111
|
let e = {};
|
|
112
112
|
return _.requiredFields && _.requiredFields.length && _.requiredFields.forEach((t) => {
|
|
113
113
|
e[t] = !0;
|
|
114
114
|
}), e;
|
|
115
|
-
}),
|
|
115
|
+
}), j = o(() => _.disabled === !0 ? !0 : _.disabled), M = p(() => _.enabledFields), N = p(() => _.requiredFields), P = p(() => _.disabledFields), F = async () => {
|
|
116
116
|
await u();
|
|
117
|
-
let e =
|
|
117
|
+
let e = T.value.$el.querySelector(".el-form-item.is-error");
|
|
118
118
|
e && e.scrollIntoView({
|
|
119
119
|
block: "center",
|
|
120
120
|
inline: "center",
|
|
121
121
|
behavior: "smooth"
|
|
122
122
|
});
|
|
123
|
-
},
|
|
124
|
-
tableForm:
|
|
125
|
-
disabled:
|
|
126
|
-
enabledFields:
|
|
127
|
-
requiredFields:
|
|
128
|
-
enabledFieldsMap:
|
|
129
|
-
disabledFieldsMap:
|
|
130
|
-
requiredFieldsMap:
|
|
131
|
-
disabledFields:
|
|
132
|
-
scrollIntoRequiredField:
|
|
133
|
-
formRef:
|
|
123
|
+
}, I = f({
|
|
124
|
+
tableForm: E,
|
|
125
|
+
disabled: j,
|
|
126
|
+
enabledFields: M,
|
|
127
|
+
requiredFields: N,
|
|
128
|
+
enabledFieldsMap: k,
|
|
129
|
+
disabledFieldsMap: O,
|
|
130
|
+
requiredFieldsMap: A,
|
|
131
|
+
disabledFields: P,
|
|
132
|
+
scrollIntoRequiredField: F,
|
|
133
|
+
formRef: T,
|
|
134
134
|
validate: async () => {
|
|
135
135
|
try {
|
|
136
|
-
return await
|
|
136
|
+
return await T.value.validate();
|
|
137
137
|
} catch {
|
|
138
|
-
throw await
|
|
138
|
+
throw await F(), T.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
|
|
139
139
|
a(e, "breathe-animation");
|
|
140
140
|
}), Error("表单验证不通过!");
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
|
-
validateField: (e) =>
|
|
144
|
-
resetFields: (e) =>
|
|
145
|
-
scrollToField: (e) =>
|
|
146
|
-
clearValidate: (e) =>
|
|
147
|
-
getField: () =>
|
|
148
|
-
setInitialValues: (e) =>
|
|
149
|
-
getFields: () =>
|
|
143
|
+
validateField: (e) => T.value.validateField(e),
|
|
144
|
+
resetFields: (e) => T.value.resetFields(e),
|
|
145
|
+
scrollToField: (e) => T.value.scrollToField(e),
|
|
146
|
+
clearValidate: (e) => T.value.clearValidate(e),
|
|
147
|
+
getField: () => T.value.getField(),
|
|
148
|
+
setInitialValues: (e) => T.value.setInitialValues(e),
|
|
149
|
+
getFields: () => T.value.fields
|
|
150
150
|
});
|
|
151
|
-
return d(t,
|
|
151
|
+
return d(t, I), b(I), () => s(h, l(C.value, S.value, x, {
|
|
152
152
|
ref: "form",
|
|
153
|
-
class:
|
|
154
|
-
|
|
153
|
+
class: [
|
|
154
|
+
"form-holder",
|
|
155
|
+
"clear-fix",
|
|
156
|
+
{ "red-form": E }
|
|
157
|
+
],
|
|
158
|
+
"show-message": D.value
|
|
155
159
|
}), { default: () => {
|
|
156
|
-
if (
|
|
160
|
+
if (E.value) {
|
|
157
161
|
var e, t, n;
|
|
158
162
|
return [
|
|
159
163
|
(e = v.top) == null ? void 0 : e.call(v),
|
|
160
164
|
s(i, {
|
|
161
|
-
class: { "hide-error-message":
|
|
165
|
+
class: { "hide-error-message": E.value },
|
|
162
166
|
columns: _.columns,
|
|
163
167
|
"col-count": _.colCount
|
|
164
168
|
}, { default: () => {
|
|
@@ -2,11 +2,11 @@ import { f as e } from "./DcTVYqeJ.mjs";
|
|
|
2
2
|
import { hasAuthority as t } from "../api/index.mjs";
|
|
3
3
|
import { toolbarContextKey as n } from "../constants/index.mjs";
|
|
4
4
|
import { isArray as r, isFunction as i } from "@web-utils/core";
|
|
5
|
-
import { computed as a, createVNode as o,
|
|
6
|
-
import { ElMessage as
|
|
7
|
-
import { ElButton as
|
|
5
|
+
import { computed as a, createVNode as o, getCurrentInstance as s, inject as c, mergeProps as l, ref as u } from "vue";
|
|
6
|
+
import { ElMessage as d, ElMessageBox as f } from "element-plus";
|
|
7
|
+
import { ElButton as p } from "element-plus/es";
|
|
8
8
|
//#region src/components/toolbar/button.ts
|
|
9
|
-
var
|
|
9
|
+
var m = {
|
|
10
10
|
size: {
|
|
11
11
|
type: String,
|
|
12
12
|
default: "default"
|
|
@@ -91,34 +91,49 @@ var h = {
|
|
|
91
91
|
title: String,
|
|
92
92
|
cancelButtonText: String,
|
|
93
93
|
confirmButtonText: String
|
|
94
|
-
},
|
|
94
|
+
}, h = {
|
|
95
95
|
icon: !0,
|
|
96
96
|
type: !0,
|
|
97
97
|
text: !0,
|
|
98
98
|
title: !0,
|
|
99
99
|
disabled: !0,
|
|
100
|
-
loading: !0
|
|
101
|
-
|
|
100
|
+
loading: !0,
|
|
101
|
+
label: !0,
|
|
102
|
+
loadable: !0,
|
|
103
|
+
footer: !0,
|
|
104
|
+
primary: !0,
|
|
105
|
+
warning: !0,
|
|
106
|
+
privilege: !0,
|
|
107
|
+
condition: !0,
|
|
108
|
+
conditionTips: !0,
|
|
109
|
+
confirm: !0,
|
|
110
|
+
confirmTips: !0,
|
|
111
|
+
beforeExecute: !0,
|
|
112
|
+
afterExecute: !0,
|
|
113
|
+
route: !0,
|
|
114
|
+
cancelButtonText: !0,
|
|
115
|
+
confirmButtonText: !0
|
|
116
|
+
}, g = (e) => h[e] !== !0, _ = {
|
|
102
117
|
name: "ToolbarButton",
|
|
103
118
|
inheritAttrs: !1,
|
|
104
|
-
props: { ...
|
|
105
|
-
setup(
|
|
106
|
-
let v =
|
|
119
|
+
props: { ...m },
|
|
120
|
+
setup(m, { attrs: h, slots: _ }) {
|
|
121
|
+
let v = s(), y = c(n, null), b = u(!1), x = a(() => m.privilege ? t(m.privilege) : !0), S = async (e) => {
|
|
107
122
|
try {
|
|
108
|
-
if (i(
|
|
109
|
-
if (
|
|
123
|
+
if (i(m.beforeExecute) && await m.beforeExecute() === !1) return;
|
|
124
|
+
if (m.conditionTips) {
|
|
110
125
|
let e;
|
|
111
|
-
if (e = r(
|
|
112
|
-
|
|
126
|
+
if (e = r(m.condition) ? m.condition.length <= 0 : i(m.condition) ? !m.condition() : !m.condition, e) {
|
|
127
|
+
d.warning(m.conditionTips);
|
|
113
128
|
return;
|
|
114
129
|
}
|
|
115
130
|
}
|
|
116
|
-
if (
|
|
117
|
-
await
|
|
131
|
+
if (m.confirm || m.confirmTips) try {
|
|
132
|
+
await f.confirm(m.confirmTips || "你确定要删除该记录吗?", "系统提示", {
|
|
118
133
|
type: "warning",
|
|
119
134
|
distinguishCancelAndClose: !0,
|
|
120
|
-
cancelButtonText:
|
|
121
|
-
confirmButtonText:
|
|
135
|
+
cancelButtonText: m.cancelButtonText,
|
|
136
|
+
confirmButtonText: m.confirmButtonText
|
|
122
137
|
});
|
|
123
138
|
} catch (e) {
|
|
124
139
|
if (e === "cancel") {
|
|
@@ -132,35 +147,35 @@ var h = {
|
|
|
132
147
|
}
|
|
133
148
|
b.value = !0;
|
|
134
149
|
let n;
|
|
135
|
-
if (
|
|
150
|
+
if (m.route) {
|
|
136
151
|
var t;
|
|
137
|
-
await ((t = v.proxy.$router) == null ? void 0 : t.push(
|
|
152
|
+
await ((t = v.proxy.$router) == null ? void 0 : t.push(m.route));
|
|
138
153
|
} else {
|
|
139
154
|
let { onClick: t } = h;
|
|
140
155
|
if (i(t)) try {
|
|
141
156
|
n = await t(e);
|
|
142
157
|
} catch {}
|
|
143
158
|
}
|
|
144
|
-
b.value = !1, i(
|
|
159
|
+
b.value = !1, i(m.afterExecute) && await m.afterExecute(n);
|
|
145
160
|
} catch {}
|
|
146
|
-
}, C = a(() =>
|
|
147
|
-
if (!C.value) return
|
|
148
|
-
}), T = e(
|
|
149
|
-
return () => x.value ? o(
|
|
150
|
-
title:
|
|
151
|
-
disabled:
|
|
152
|
-
loading:
|
|
161
|
+
}, C = a(() => m.text ? !0 : m.type === "text"), w = a(() => {
|
|
162
|
+
if (!C.value) return m.primary ? "primary" : m.warning ? "warning" : m.type;
|
|
163
|
+
}), T = e(m, g);
|
|
164
|
+
return () => x.value ? o(p, l(T.value, {
|
|
165
|
+
title: m.footer || y != null && y.footer ? null : m.title,
|
|
166
|
+
disabled: m.disabled || b.value,
|
|
167
|
+
loading: m.loadable ? b.value : !1,
|
|
153
168
|
type: w.value,
|
|
154
169
|
text: C.value,
|
|
155
170
|
class: h.class,
|
|
156
171
|
style: h.style,
|
|
157
172
|
onClick: S
|
|
158
173
|
}), {
|
|
159
|
-
default: !
|
|
160
|
-
loading:
|
|
161
|
-
icon:
|
|
174
|
+
default: !m.circle && (m.label || _.default) ? () => _.default ? _.default() : m.label : null,
|
|
175
|
+
loading: _.loading,
|
|
176
|
+
icon: _.icon ? _.icon : m.icon ? () => o("i", { class: m.icon }, null) : null
|
|
162
177
|
}) : null;
|
|
163
178
|
}
|
|
164
|
-
}
|
|
179
|
+
};
|
|
165
180
|
//#endregion
|
|
166
|
-
export {
|
|
181
|
+
export { _ as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n, t as r } from "./
|
|
1
|
+
import { i as e, n as t } from "./BHbMJZPp.mjs";
|
|
2
|
+
import { n, t as r } from "./BNXbI4OG.mjs";
|
|
3
3
|
import i from "../x-input-tag/index.mjs";
|
|
4
4
|
import { createVNode as a, mergeProps as o } from "vue";
|
|
5
5
|
//#region src/components/form/props/input-tag.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as e } from "./DcTVYqeJ.mjs";
|
|
2
|
-
import { i as t, n } from "./
|
|
3
|
-
import { n as r, t as i } from "./
|
|
4
|
-
import { r as a } from "./
|
|
5
|
-
import { n as o, t as s } from "./
|
|
2
|
+
import { i as t, n } from "./BHbMJZPp.mjs";
|
|
3
|
+
import { n as r, t as i } from "./BNXbI4OG.mjs";
|
|
4
|
+
import { r as a } from "./DwkOWXIR.mjs";
|
|
5
|
+
import { n as o, t as s } from "./D9IFsT272.mjs";
|
|
6
6
|
import { isArray as c, isString as l, trace as u, warning as d } from "@web-utils/core";
|
|
7
7
|
import { computed as f, createVNode as p, getCurrentInstance as m, mergeProps as h, useModel as g, useTemplateRef as _ } from "vue";
|
|
8
8
|
import { useEventBus as v } from "@web-utils/vue/hooks/useEventBus";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./
|
|
2
|
-
import { n as t, t as n } from "./
|
|
1
|
+
import { n as e } from "./BHbMJZPp.mjs";
|
|
2
|
+
import { n as t, t as n } from "./DwkOWXIR.mjs";
|
|
3
3
|
import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
|
|
4
4
|
//#region src/components/form/FormInputPhoneNumber.vue?vue&type=script&lang.jsx
|
|
5
5
|
function s(e) {
|