@farris/ui-vue 1.3.5 → 1.3.6
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/components/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +7 -5
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4057 -4304
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2450 -2467
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3593 -3585
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +163 -2643
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +500 -486
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +485 -470
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +2611 -2623
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +3825 -3837
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +3720 -3712
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +312 -296
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +4748 -4992
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4215 -4462
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +3015 -3027
- package/components/query-solution/index.umd.cjs +5 -5
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +293 -280
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +632 -617
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +2994 -3006
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +749 -733
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +7750 -7990
- package/farris.all.umd.cjs +12 -12
- package/package.json +1 -1
- package/types/data-view/composition/types.d.ts +0 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
- package/components/event-parameter/index.css +0 -1
- package/types/data-grid/src/components/data/data-grid-area.component.d.ts +0 -8
- package/types/data-grid/src/components/data/data-grid-area.props.d.ts +0 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var ue = Object.defineProperty;
|
|
2
2
|
var ce = (e, t, n) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var T = (e, t, n) => ce(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { defineComponent as V, inject as
|
|
5
|
-
import { useCheck as he, useGuid as
|
|
6
|
-
import { isPlainObject as
|
|
7
|
-
import { DgControl as
|
|
4
|
+
import { defineComponent as V, inject as q, onMounted as L, createVNode as g, Fragment as J, computed as P, ref as w, provide as de, Teleport as pe, createApp as fe, onUnmounted as me, watch as U, nextTick as z, withDirectives as j, vShow as ye, mergeProps as ge, createTextVNode as A, vModelText as X } from "vue";
|
|
5
|
+
import { useCheck as he, useGuid as Y } from "../common/index.esm.js";
|
|
6
|
+
import { isPlainObject as _, cloneDeep as G } from "lodash-es";
|
|
7
|
+
import { DgControl as H } from "../designer-canvas/index.esm.js";
|
|
8
8
|
import { resolveAppearance as ve, createPropsResolver as be } from "../dynamic-resolver/index.esm.js";
|
|
9
9
|
import Ce from "../tags/index.esm.js";
|
|
10
10
|
import ke from "../popover/index.esm.js";
|
|
@@ -20,16 +20,16 @@ const Me = {
|
|
|
20
20
|
label: { type: String, default: "" },
|
|
21
21
|
/** 标识 */
|
|
22
22
|
id: { type: String, default: "" }
|
|
23
|
-
},
|
|
23
|
+
}, Z = Symbol("radioGroupContext"), Q = /* @__PURE__ */ V({
|
|
24
24
|
name: "FRadio",
|
|
25
25
|
props: Me,
|
|
26
26
|
emits: ["update:value"],
|
|
27
27
|
setup(e, t) {
|
|
28
|
-
const n =
|
|
28
|
+
const n = q(Z, null), {
|
|
29
29
|
buttonClass: a,
|
|
30
30
|
checked: o,
|
|
31
31
|
disabled: l,
|
|
32
|
-
name:
|
|
32
|
+
name: s,
|
|
33
33
|
tagClass: c,
|
|
34
34
|
shouldRenderButton: p,
|
|
35
35
|
shouldRenderNative: r,
|
|
@@ -38,12 +38,12 @@ const Me = {
|
|
|
38
38
|
} = he(e, t, n == null ? void 0 : n.parentProps, n == null ? void 0 : n.parentContext);
|
|
39
39
|
return L(() => {
|
|
40
40
|
}), () => {
|
|
41
|
-
var
|
|
42
|
-
return g(
|
|
41
|
+
var u, f, m, y, F, k;
|
|
42
|
+
return g(J, null, [p.value && g("div", {
|
|
43
43
|
class: a.value,
|
|
44
44
|
style: "border-radius:0;border: 1px solid #E8EBF2;",
|
|
45
45
|
onClick: i
|
|
46
|
-
}, [(f = (
|
|
46
|
+
}, [(f = (u = t.slots).default) == null ? void 0 : f.call(u)]), d.value && g("div", {
|
|
47
47
|
class: c.value,
|
|
48
48
|
onClick: i
|
|
49
49
|
}, [g("div", {
|
|
@@ -58,7 +58,7 @@ const Me = {
|
|
|
58
58
|
}, [g("input", {
|
|
59
59
|
type: "radio",
|
|
60
60
|
class: "custom-control-input",
|
|
61
|
-
name:
|
|
61
|
+
name: s.value,
|
|
62
62
|
id: e.id,
|
|
63
63
|
value: e.value,
|
|
64
64
|
checked: o.value,
|
|
@@ -75,37 +75,51 @@ function we(e, t, n) {
|
|
|
75
75
|
function Se(e, t, n) {
|
|
76
76
|
return t;
|
|
77
77
|
}
|
|
78
|
-
const
|
|
78
|
+
const K = {}, ee = {};
|
|
79
79
|
function W(e) {
|
|
80
|
-
const { properties: t, title: n, ignore: a } = e, o = a && Array.isArray(a), l = Object.keys(t).reduce((
|
|
81
|
-
if (n && (!o || !a.find((
|
|
82
|
-
const
|
|
83
|
-
l.id = `${
|
|
80
|
+
const { properties: t, title: n, ignore: a } = e, o = a && Array.isArray(a), l = Object.keys(t).reduce((s, c) => ((!o || !a.find((p) => p === c)) && (s[c] = t[c].type === "object" && t[c].properties ? W(t[c]) : G(t[c].default)), s), {});
|
|
81
|
+
if (n && (!o || !a.find((s) => s === "id"))) {
|
|
82
|
+
const s = n.toLowerCase().replace(/-/g, "_");
|
|
83
|
+
l.id = `${s}_${Math.random().toString().slice(2, 6)}`;
|
|
84
84
|
}
|
|
85
85
|
return l;
|
|
86
86
|
}
|
|
87
|
+
function Te(e) {
|
|
88
|
+
const { properties: t, title: n, required: a } = e;
|
|
89
|
+
if (a && Array.isArray(a)) {
|
|
90
|
+
const o = a.reduce((l, s) => (l[s] = t[s].type === "object" && t[s].properties ? W(t[s]) : G(t[s].default), l), {});
|
|
91
|
+
if (n && a.find((l) => l === "id")) {
|
|
92
|
+
const l = n.toLowerCase().replace(/-/g, "_");
|
|
93
|
+
o.id = `${l}_${Math.random().toString().slice(2, 6)}`;
|
|
94
|
+
}
|
|
95
|
+
return o;
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
type: n
|
|
99
|
+
};
|
|
100
|
+
}
|
|
87
101
|
function te(e, t = {}, n) {
|
|
88
|
-
const a =
|
|
102
|
+
const a = K[e];
|
|
89
103
|
if (a) {
|
|
90
|
-
let o =
|
|
104
|
+
let o = Te(a);
|
|
91
105
|
const l = ee[e];
|
|
92
106
|
return o = l ? l({ getSchemaByType: te }, o, t, n) : o, o;
|
|
93
107
|
}
|
|
94
108
|
return null;
|
|
95
109
|
}
|
|
96
|
-
function
|
|
110
|
+
function Ee(e, t) {
|
|
97
111
|
const n = W(t);
|
|
98
|
-
return Object.keys(n).reduce((a, o) => (a[o] &&
|
|
112
|
+
return Object.keys(n).reduce((a, o) => (Object.prototype.hasOwnProperty.call(e, o) && (a[o] && _(a[o]) && _(e[o] || !e[o]) ? Object.assign(a[o], e[o] || {}) : a[o] = e[o]), a), n), n;
|
|
99
113
|
}
|
|
100
|
-
function
|
|
114
|
+
function Pe(e, t) {
|
|
101
115
|
return Object.keys(e).filter((a) => e[a] != null).reduce((a, o) => {
|
|
102
116
|
if (t.has(o)) {
|
|
103
117
|
const l = t.get(o);
|
|
104
118
|
if (typeof l == "string")
|
|
105
119
|
a[l] = e[o];
|
|
106
120
|
else {
|
|
107
|
-
const
|
|
108
|
-
Object.assign(a,
|
|
121
|
+
const s = l(o, e[o], e);
|
|
122
|
+
Object.assign(a, s);
|
|
109
123
|
}
|
|
110
124
|
} else
|
|
111
125
|
a[o] = e[o];
|
|
@@ -113,26 +127,26 @@ function Ee(e, t) {
|
|
|
113
127
|
}, {});
|
|
114
128
|
}
|
|
115
129
|
function Ie(e, t, n = /* @__PURE__ */ new Map()) {
|
|
116
|
-
const a =
|
|
117
|
-
return
|
|
130
|
+
const a = Ee(e, t);
|
|
131
|
+
return Pe(a, n);
|
|
118
132
|
}
|
|
119
|
-
function
|
|
120
|
-
function t(r, d, i,
|
|
133
|
+
function xe(e = {}) {
|
|
134
|
+
function t(r, d, i, u) {
|
|
121
135
|
if (typeof i == "number")
|
|
122
|
-
return
|
|
136
|
+
return u[r].length === i;
|
|
123
137
|
if (typeof i == "object") {
|
|
124
138
|
const f = Object.keys(i)[0], m = i[f];
|
|
125
139
|
if (f === "not")
|
|
126
|
-
return Number(
|
|
140
|
+
return Number(u[r].length) !== Number(m);
|
|
127
141
|
if (f === "moreThan")
|
|
128
|
-
return Number(
|
|
142
|
+
return Number(u[r].length) >= Number(m);
|
|
129
143
|
if (f === "lessThan")
|
|
130
|
-
return Number(
|
|
144
|
+
return Number(u[r].length) <= Number(m);
|
|
131
145
|
}
|
|
132
146
|
return !1;
|
|
133
147
|
}
|
|
134
|
-
function n(r, d, i,
|
|
135
|
-
return
|
|
148
|
+
function n(r, d, i, u) {
|
|
149
|
+
return u[r] && u[r].propertyValue && String(u[r].propertyValue.value) === String(i);
|
|
136
150
|
}
|
|
137
151
|
const a = /* @__PURE__ */ new Map([
|
|
138
152
|
["length", t],
|
|
@@ -141,20 +155,20 @@ function Pe(e = {}) {
|
|
|
141
155
|
Object.keys(e).reduce((r, d) => (r.set(d, e[d]), r), a);
|
|
142
156
|
function o(r, d) {
|
|
143
157
|
const i = r;
|
|
144
|
-
return typeof d == "number" ? [{ target: i, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: i, operator: "getProperty", param: r, value: !!d }] : typeof d == "object" ? Object.keys(d).map((
|
|
145
|
-
if (
|
|
146
|
-
return { target: i, operator: "length", param: null, value: d[
|
|
147
|
-
const f =
|
|
158
|
+
return typeof d == "number" ? [{ target: i, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: i, operator: "getProperty", param: r, value: !!d }] : typeof d == "object" ? Object.keys(d).map((u) => {
|
|
159
|
+
if (u === "length")
|
|
160
|
+
return { target: i, operator: "length", param: null, value: d[u] };
|
|
161
|
+
const f = u, m = d[u];
|
|
148
162
|
return { target: i, operator: "getProperty", param: f, value: m };
|
|
149
163
|
}) : [];
|
|
150
164
|
}
|
|
151
165
|
function l(r) {
|
|
152
|
-
return Object.keys(r).reduce((i,
|
|
153
|
-
const f = o(
|
|
166
|
+
return Object.keys(r).reduce((i, u) => {
|
|
167
|
+
const f = o(u, r[u]);
|
|
154
168
|
return i.push(...f), i;
|
|
155
169
|
}, []);
|
|
156
170
|
}
|
|
157
|
-
function
|
|
171
|
+
function s(r, d) {
|
|
158
172
|
if (a.has(r.operator)) {
|
|
159
173
|
const i = a.get(r.operator);
|
|
160
174
|
return i && i(r.target, r.param, r.value, d) || !1;
|
|
@@ -162,11 +176,11 @@ function Pe(e = {}) {
|
|
|
162
176
|
return !1;
|
|
163
177
|
}
|
|
164
178
|
function c(r, d) {
|
|
165
|
-
return l(r).reduce((f, m) => f &&
|
|
179
|
+
return l(r).reduce((f, m) => f && s(m, d), !0);
|
|
166
180
|
}
|
|
167
181
|
function p(r, d) {
|
|
168
|
-
const i = Object.keys(r),
|
|
169
|
-
return
|
|
182
|
+
const i = Object.keys(r), u = i.includes("allOf"), f = i.includes("anyOf"), m = u || f, k = (m ? r[m ? u ? "allOf" : "anyOf" : "allOf"] : [r]).map((B) => c(B, d));
|
|
183
|
+
return u ? !k.includes(!1) : k.includes(!0);
|
|
170
184
|
}
|
|
171
185
|
return { parseValueSchema: p };
|
|
172
186
|
}
|
|
@@ -210,20 +224,20 @@ const b = {
|
|
|
210
224
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
211
225
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
212
226
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
function ne(e, t, n = /* @__PURE__ */ new Map(), a = (
|
|
216
|
-
return
|
|
217
|
-
const c = Ie(
|
|
227
|
+
}, Ve = {}, Ae = {};
|
|
228
|
+
xe();
|
|
229
|
+
function ne(e, t, n = /* @__PURE__ */ new Map(), a = (s, c, p, r) => c, o = {}, l = (s) => s) {
|
|
230
|
+
return K[t.title] = t, ee[t.title] = a, Ve[t.title] = o, Ae[t.title] = l, (s = {}) => {
|
|
231
|
+
const c = Ie(s, t, n), p = Object.keys(e).reduce((r, d) => (r[d] = e[d].default, r), {});
|
|
218
232
|
return Object.assign(p, c);
|
|
219
233
|
};
|
|
220
234
|
}
|
|
221
|
-
function
|
|
235
|
+
function Oe(e, t) {
|
|
222
236
|
return { customClass: t.class, customStyle: t.style };
|
|
223
237
|
}
|
|
224
|
-
const
|
|
225
|
-
["appearance",
|
|
226
|
-
]),
|
|
238
|
+
const De = /* @__PURE__ */ new Map([
|
|
239
|
+
["appearance", Oe]
|
|
240
|
+
]), Le = /* @__PURE__ */ new Map([]), $e = "https://json-schema.org/draft/2020-12/schema", qe = "https://farris-design.gitee.io/radio-group.schema.json", Ne = "radio-group", Ge = "A Farris Input Component", je = "object", Ue = {
|
|
227
241
|
id: {
|
|
228
242
|
description: "The unique identifier for a radio-group",
|
|
229
243
|
type: "string"
|
|
@@ -294,24 +308,23 @@ const Oe = /* @__PURE__ */ new Map([
|
|
|
294
308
|
description: "",
|
|
295
309
|
type: "array"
|
|
296
310
|
}
|
|
297
|
-
},
|
|
298
|
-
"id",
|
|
311
|
+
}, We = [
|
|
299
312
|
"type"
|
|
300
|
-
],
|
|
313
|
+
], Re = [
|
|
301
314
|
"id",
|
|
302
315
|
"appearance",
|
|
303
316
|
"binding",
|
|
304
317
|
"visible"
|
|
305
|
-
],
|
|
306
|
-
$schema:
|
|
307
|
-
$id:
|
|
318
|
+
], ze = {
|
|
319
|
+
$schema: $e,
|
|
320
|
+
$id: qe,
|
|
308
321
|
title: Ne,
|
|
309
|
-
description:
|
|
310
|
-
type:
|
|
311
|
-
properties:
|
|
312
|
-
required:
|
|
313
|
-
ignore:
|
|
314
|
-
},
|
|
322
|
+
description: Ge,
|
|
323
|
+
type: je,
|
|
324
|
+
properties: Ue,
|
|
325
|
+
required: We,
|
|
326
|
+
ignore: Re
|
|
327
|
+
}, Xe = {
|
|
315
328
|
/**
|
|
316
329
|
* 是否被选中
|
|
317
330
|
*/
|
|
@@ -329,7 +342,7 @@ const Oe = /* @__PURE__ */ new Map([
|
|
|
329
342
|
*/
|
|
330
343
|
size: { type: String, default: "middle" }
|
|
331
344
|
}, R = {
|
|
332
|
-
...
|
|
345
|
+
...Xe,
|
|
333
346
|
/**
|
|
334
347
|
* 组件标识
|
|
335
348
|
*/
|
|
@@ -388,13 +401,13 @@ const Oe = /* @__PURE__ */ new Map([
|
|
|
388
401
|
* 枚举数组中枚举值的key值。
|
|
389
402
|
*/
|
|
390
403
|
valueField: { type: String, default: "value" }
|
|
391
|
-
}, oe = ne(R,
|
|
404
|
+
}, oe = ne(R, ze, De, we);
|
|
392
405
|
function ae(e, t, n) {
|
|
393
|
-
const a =
|
|
406
|
+
const a = P(() => !e.disabled), o = P(() => e.data || e.enumData || []);
|
|
394
407
|
function l(p) {
|
|
395
408
|
return p[e.valueField];
|
|
396
409
|
}
|
|
397
|
-
function
|
|
410
|
+
function s(p) {
|
|
398
411
|
return p[e.textField];
|
|
399
412
|
}
|
|
400
413
|
function c(p, r) {
|
|
@@ -407,7 +420,7 @@ function ae(e, t, n) {
|
|
|
407
420
|
return {
|
|
408
421
|
enumData: o,
|
|
409
422
|
getValue: l,
|
|
410
|
-
getText:
|
|
423
|
+
getText: s,
|
|
411
424
|
onClickRadio: c
|
|
412
425
|
};
|
|
413
426
|
}
|
|
@@ -420,11 +433,11 @@ const D = /* @__PURE__ */ V({
|
|
|
420
433
|
enumData: a,
|
|
421
434
|
onClickRadio: o,
|
|
422
435
|
getValue: l,
|
|
423
|
-
getText:
|
|
424
|
-
} = ae(e, t, n), c =
|
|
436
|
+
getText: s
|
|
437
|
+
} = ae(e, t, n), c = P(() => ({
|
|
425
438
|
"farris-checkradio-hor": e.direction === "horizontal"
|
|
426
439
|
})), p = w([]);
|
|
427
|
-
return de(
|
|
440
|
+
return de(Z, {
|
|
428
441
|
radios: p,
|
|
429
442
|
parentProps: e,
|
|
430
443
|
parentContext: t
|
|
@@ -443,18 +456,18 @@ const D = /* @__PURE__ */ V({
|
|
|
443
456
|
checked: l(r) === n.value,
|
|
444
457
|
disabled: e.readonly || e.disabled,
|
|
445
458
|
tabindex: e.tabIndex,
|
|
446
|
-
onClick: (
|
|
459
|
+
onClick: (u) => o(r, u)
|
|
447
460
|
}, null), g("label", {
|
|
448
461
|
class: "custom-control-label",
|
|
449
462
|
for: i
|
|
450
|
-
}, [
|
|
463
|
+
}, [s(r)])]);
|
|
451
464
|
})]);
|
|
452
465
|
}
|
|
453
466
|
});
|
|
454
|
-
function
|
|
455
|
-
var
|
|
467
|
+
function _e(e, t, n) {
|
|
468
|
+
var I;
|
|
456
469
|
const a = n && n.getStyles && n.getStyles() || "", o = n && n.getDesignerClass && n.getDesignerClass() || "", l = w();
|
|
457
|
-
function
|
|
470
|
+
function s() {
|
|
458
471
|
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
|
|
459
472
|
}
|
|
460
473
|
function c() {
|
|
@@ -478,7 +491,7 @@ function Xe(e, t, n) {
|
|
|
478
491
|
const { componentInstance: E, designerItemElementRef: S } = C;
|
|
479
492
|
return !E || !E.value ? null : E.value.canMove ? S : i(C.parent);
|
|
480
493
|
}
|
|
481
|
-
function
|
|
494
|
+
function u(C) {
|
|
482
495
|
return !!n && n.canAccepts(C);
|
|
483
496
|
}
|
|
484
497
|
function f() {
|
|
@@ -512,17 +525,17 @@ function Xe(e, t, n) {
|
|
|
512
525
|
});
|
|
513
526
|
}
|
|
514
527
|
return l.value = {
|
|
515
|
-
canMove:
|
|
528
|
+
canMove: s(),
|
|
516
529
|
canSelectParent: c(),
|
|
517
530
|
canDelete: p(),
|
|
518
531
|
canNested: !r(),
|
|
519
532
|
contents: t == null ? void 0 : t.schema.contents,
|
|
520
533
|
elementRef: e,
|
|
521
|
-
parent: (
|
|
534
|
+
parent: (I = t == null ? void 0 : t.parent) == null ? void 0 : I.componentInstance,
|
|
522
535
|
schema: t == null ? void 0 : t.schema,
|
|
523
536
|
styles: a,
|
|
524
537
|
designerClass: o,
|
|
525
|
-
canAccepts:
|
|
538
|
+
canAccepts: u,
|
|
526
539
|
getBelongedComponentInstance: d,
|
|
527
540
|
getDraggableDesignItemElement: i,
|
|
528
541
|
getDraggingDisplayText: f,
|
|
@@ -628,7 +641,7 @@ class He {
|
|
|
628
641
|
const a = n && n.parent && n.parent.schema;
|
|
629
642
|
if (!a)
|
|
630
643
|
return;
|
|
631
|
-
const o = a.contents.findIndex((
|
|
644
|
+
const o = a.contents.findIndex((s) => s.id === t), l = G(a.contents[o]);
|
|
632
645
|
a.contents.splice(o, 1), a.contents.splice(o, 0, l);
|
|
633
646
|
}
|
|
634
647
|
}
|
|
@@ -702,9 +715,9 @@ T(O, "fieldControlTypeMapping", {
|
|
|
702
715
|
{ key: b["radio-group"].type, value: b["radio-group"].name }
|
|
703
716
|
]
|
|
704
717
|
});
|
|
705
|
-
let
|
|
706
|
-
const
|
|
707
|
-
class
|
|
718
|
+
let N = O;
|
|
719
|
+
const Qe = w(0);
|
|
720
|
+
class Je {
|
|
708
721
|
constructor() {
|
|
709
722
|
/** 控件标题 */
|
|
710
723
|
T(this, "label", "");
|
|
@@ -734,7 +747,7 @@ class Ke {
|
|
|
734
747
|
T(this, "fieldSetId", "");
|
|
735
748
|
}
|
|
736
749
|
}
|
|
737
|
-
function
|
|
750
|
+
function Ye(e) {
|
|
738
751
|
let t, n;
|
|
739
752
|
const a = /* @__PURE__ */ new Map();
|
|
740
753
|
let o = [];
|
|
@@ -747,33 +760,33 @@ function Qe(e) {
|
|
|
747
760
|
let m = f.find((h) => /^col-([1-9]|10|11|12)$/.test(h)), y = f.find((h) => /^col-md-([1-9]|10|11|12)$/.test(h)), F = f.find((h) => /^col-xl-([1-9]|10|11|12)$/.test(h)), k = f.find((h) => /^col-el-([1-9]|10|11|12)$/.test(h));
|
|
748
761
|
m = m || "col-12", i.columnInSM = parseInt(m.replace("col-", ""), 10), i.displayWidthInSM = i.columnInSM / 12, i.displayWidthInSM !== 1 && (i.isSupportedClass = !1), y = y || "col-md-" + i.columnInSM, i.columnInMD = parseInt(y.replace("col-md-", ""), 10), i.displayWidthInMD = i.columnInMD / 6, [1, 2].includes(i.displayWidthInMD) || (i.isSupportedClass = !1), F = F || "col-xl-" + i.columnInMD, i.columnInLG = parseInt(F.replace("col-xl-", ""), 10), i.displayWidthInLG = i.columnInLG / 3, [1, 2, 3, 4].includes(i.displayWidthInLG) || (i.isSupportedClass = !1), k = k || "col-el-" + i.columnInLG, i.columnInEL = parseInt(k.replace("col-el-", ""), 10), i.displayWidthInEL = i.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(i.displayWidthInEL) || (i.isSupportedClass = !1);
|
|
749
762
|
}
|
|
750
|
-
function
|
|
763
|
+
function s(d, i, u, f = !1) {
|
|
751
764
|
let m = !1;
|
|
752
765
|
d.contents.forEach((y) => {
|
|
753
766
|
if (y.type === "fieldset") {
|
|
754
|
-
|
|
767
|
+
u += 1, s(y, i, u, !0), m = !0;
|
|
755
768
|
return;
|
|
756
769
|
}
|
|
757
|
-
m && (
|
|
758
|
-
const F = y.appearance && y.appearance.class, k = new
|
|
759
|
-
F ? l(F, k) : k.isSupportedClass = !1, k.label = y.label || y.id, k.id = y.id, k.group =
|
|
770
|
+
m && (u += 1, m = !1);
|
|
771
|
+
const F = y.appearance && y.appearance.class, k = new Je();
|
|
772
|
+
F ? l(F, k) : k.isSupportedClass = !1, k.label = y.label || y.id, k.id = y.id, k.group = u, f && (k.fieldSetId = d.id), n === y.id && (t = u), a.set(y.id, y), i.push(k);
|
|
760
773
|
});
|
|
761
774
|
}
|
|
762
775
|
function c(d) {
|
|
763
776
|
const i = e.getComponentById(d);
|
|
764
777
|
if (!i || !i.componentType || !i.componentType.startsWith("form"))
|
|
765
778
|
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
766
|
-
const
|
|
767
|
-
return !
|
|
779
|
+
const u = e.selectNode(i, (f) => f.type === H["response-form"].type);
|
|
780
|
+
return !u || !u.contents || u.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: u };
|
|
768
781
|
}
|
|
769
782
|
function p(d, i) {
|
|
770
783
|
i = i || d.id;
|
|
771
|
-
const { result:
|
|
772
|
-
if (!
|
|
773
|
-
return { result:
|
|
784
|
+
const { result: u, message: f, formNode: m } = c(i);
|
|
785
|
+
if (!u)
|
|
786
|
+
return { result: u, message: f };
|
|
774
787
|
n = d.id, o = [], a.clear();
|
|
775
|
-
const y = m.contents[0].type ===
|
|
776
|
-
|
|
788
|
+
const y = m.contents[0].type === H.fieldset.type ? 0 : 1;
|
|
789
|
+
s(m, o, y);
|
|
777
790
|
const F = o.find((h) => !h.isSupportedClass);
|
|
778
791
|
return {
|
|
779
792
|
defaultState: {
|
|
@@ -785,20 +798,20 @@ function Qe(e) {
|
|
|
785
798
|
}
|
|
786
799
|
function r(d, i) {
|
|
787
800
|
i = i;
|
|
788
|
-
const { result:
|
|
789
|
-
if (!
|
|
801
|
+
const { result: u, formNode: f } = c(i);
|
|
802
|
+
if (!u)
|
|
790
803
|
return "";
|
|
791
804
|
const m = [];
|
|
792
805
|
return d.forEach((y) => {
|
|
793
806
|
var h;
|
|
794
807
|
const F = a.get(y.id), k = F.appearance && F.appearance.class;
|
|
795
808
|
if (k) {
|
|
796
|
-
const
|
|
809
|
+
const I = k.split(" ").filter((x) => !x.startsWith("col-")), C = "col-" + y.columnInSM, E = "col-md-" + y.columnInMD, S = "col-xl-" + y.columnInLG, M = "col-el-" + y.columnInEL, v = [C, E, S, M].concat(I);
|
|
797
810
|
F.appearance.class = v.join(" ");
|
|
798
811
|
}
|
|
799
812
|
if (y.fieldSetId) {
|
|
800
|
-
const B = f.contents.find((C) => C.id === y.fieldSetId),
|
|
801
|
-
|
|
813
|
+
const B = f.contents.find((C) => C.id === y.fieldSetId), I = m.find((C) => C.id === y.fieldSetId);
|
|
814
|
+
I ? (h = I.contents) == null || h.push(F) : (m.push(B), B.contents = [F]);
|
|
802
815
|
} else
|
|
803
816
|
m.push(F);
|
|
804
817
|
}), f.contents = m, f.id;
|
|
@@ -807,14 +820,14 @@ function Qe(e) {
|
|
|
807
820
|
checkCanFindFormNode: c,
|
|
808
821
|
checkCanOpenLayoutEditor: p,
|
|
809
822
|
changeFormControlsByResponseLayoutConfig: r,
|
|
810
|
-
getResonseFormLayoutConfig:
|
|
823
|
+
getResonseFormLayoutConfig: s
|
|
811
824
|
};
|
|
812
825
|
}
|
|
813
|
-
class
|
|
826
|
+
class Ze extends He {
|
|
814
827
|
constructor(n, a) {
|
|
815
828
|
super(n, a);
|
|
816
829
|
T(this, "responseLayoutEditorFunction");
|
|
817
|
-
this.responseLayoutEditorFunction =
|
|
830
|
+
this.responseLayoutEditorFunction = Ye(this.formSchemaUtils);
|
|
818
831
|
}
|
|
819
832
|
getPropertyConfig(n, a) {
|
|
820
833
|
return this.propertyConfig.categories.basic = this.getBasicProperties(n, a), this.propertyConfig.categories.appearance = this.getAppearanceProperties(n, a), this.propertyConfig.categories.editor = this.getEditorProperties(n), this.propertyConfig;
|
|
@@ -822,7 +835,7 @@ class Je extends He {
|
|
|
822
835
|
getBasicProperties(n, a) {
|
|
823
836
|
var l;
|
|
824
837
|
const o = this;
|
|
825
|
-
return this.setDesignViewModelField(n),
|
|
838
|
+
return this.setDesignViewModelField(n), {
|
|
826
839
|
description: "Basic Information",
|
|
827
840
|
title: "基本信息",
|
|
828
841
|
properties: {
|
|
@@ -843,7 +856,7 @@ class Je extends He {
|
|
|
843
856
|
textField: "value",
|
|
844
857
|
valueField: "key",
|
|
845
858
|
editable: !1,
|
|
846
|
-
data: o.designViewModelField ?
|
|
859
|
+
data: o.designViewModelField ? N.getEditorTypesByMDataType((l = o.designViewModelField.type) == null ? void 0 : l.name) : N.getAllInputTypes()
|
|
847
860
|
}
|
|
848
861
|
},
|
|
849
862
|
label: {
|
|
@@ -868,15 +881,15 @@ class Je extends He {
|
|
|
868
881
|
}
|
|
869
882
|
}
|
|
870
883
|
},
|
|
871
|
-
setPropertyRelates(
|
|
872
|
-
if (
|
|
873
|
-
switch (
|
|
884
|
+
setPropertyRelates(s, c) {
|
|
885
|
+
if (s)
|
|
886
|
+
switch (s && s.propertyID) {
|
|
874
887
|
case "type": {
|
|
875
|
-
o.changeControlType(n,
|
|
888
|
+
o.changeControlType(n, s, a);
|
|
876
889
|
break;
|
|
877
890
|
}
|
|
878
891
|
case "label": {
|
|
879
|
-
|
|
892
|
+
s.needRefreshControlTree = !0;
|
|
880
893
|
break;
|
|
881
894
|
}
|
|
882
895
|
}
|
|
@@ -914,7 +927,7 @@ class Je extends He {
|
|
|
914
927
|
}
|
|
915
928
|
}
|
|
916
929
|
},
|
|
917
|
-
setPropertyRelates(l,
|
|
930
|
+
setPropertyRelates(l, s) {
|
|
918
931
|
if (l)
|
|
919
932
|
switch (l && l.propertyID) {
|
|
920
933
|
case "responseLayout":
|
|
@@ -936,11 +949,11 @@ class Je extends He {
|
|
|
936
949
|
* @param newControlType 新控件类型
|
|
937
950
|
*/
|
|
938
951
|
changeControlType(n, a, o) {
|
|
939
|
-
var d, i,
|
|
940
|
-
const l = a.propertyValue,
|
|
941
|
-
if (!
|
|
952
|
+
var d, i, u, f;
|
|
953
|
+
const l = a.propertyValue, s = o && o.parent && o.parent.schema;
|
|
954
|
+
if (!s)
|
|
942
955
|
return;
|
|
943
|
-
const c =
|
|
956
|
+
const c = s.contents.findIndex((m) => m.id === n.id), p = s.contents[c];
|
|
944
957
|
let r;
|
|
945
958
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
946
959
|
editor: {
|
|
@@ -960,11 +973,11 @@ class Je extends He {
|
|
|
960
973
|
isTextArea: r.isTextArea && p.isTextArea,
|
|
961
974
|
placeholder: (d = p.editor) == null ? void 0 : d.placeholder,
|
|
962
975
|
holdPlace: (i = p.editor) == null ? void 0 : i.holdPlace,
|
|
963
|
-
readonly: (
|
|
976
|
+
readonly: (u = p.editor) == null ? void 0 : u.readonly,
|
|
964
977
|
require: (f = p.editor) == null ? void 0 : f.require
|
|
965
|
-
}),
|
|
978
|
+
}), s.contents.splice(c, 1), s.contents.splice(c, 0, r), o.schema = Object.assign(p, r), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
966
979
|
(m) => m.classList.remove("dgComponentSelected")
|
|
967
|
-
),
|
|
980
|
+
), Qe.value++;
|
|
968
981
|
}
|
|
969
982
|
getComponentConfig(n, a = {}, o = {}) {
|
|
970
983
|
const l = Object.assign({
|
|
@@ -972,7 +985,7 @@ class Je extends He {
|
|
|
972
985
|
title: "编辑器",
|
|
973
986
|
type: "input-group",
|
|
974
987
|
$converter: "/converter/property-editor.converter"
|
|
975
|
-
}, a),
|
|
988
|
+
}, a), s = Object.assign({
|
|
976
989
|
readonly: {
|
|
977
990
|
description: "",
|
|
978
991
|
title: "只读",
|
|
@@ -994,7 +1007,7 @@ class Je extends He {
|
|
|
994
1007
|
type: "string"
|
|
995
1008
|
}
|
|
996
1009
|
}, o);
|
|
997
|
-
return { ...l, properties: { ...
|
|
1010
|
+
return { ...l, properties: { ...s } };
|
|
998
1011
|
}
|
|
999
1012
|
/**
|
|
1000
1013
|
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
@@ -1004,11 +1017,11 @@ class Je extends He {
|
|
|
1004
1017
|
*/
|
|
1005
1018
|
updateUnifiedLayoutAfterControlChanged(n, a, o) {
|
|
1006
1019
|
const l = n.split(" ");
|
|
1007
|
-
let
|
|
1008
|
-
|
|
1020
|
+
let s = l.find((i) => /^col-([1-9]|10|11|12)$/.test(i)), c = l.find((i) => /^col-md-([1-9]|10|11|12)$/.test(i)), p = l.find((i) => /^col-xl-([1-9]|10|11|12)$/.test(i)), r = l.find((i) => /^col-el-([1-9]|10|11|12)$/.test(i));
|
|
1021
|
+
s = s || "col-12", c = c || "col-md-" + s.replace("col-", ""), p = p || "col-xl-" + c.replace("col-md-", ""), r = r || "col-el-" + p.replace("col-xl-", "");
|
|
1009
1022
|
const d = {
|
|
1010
1023
|
id: a,
|
|
1011
|
-
columnInSM: parseInt(
|
|
1024
|
+
columnInSM: parseInt(s.replace("col-", ""), 10),
|
|
1012
1025
|
columnInMD: parseInt(c.replace("col-md-", ""), 10),
|
|
1013
1026
|
columnInLG: parseInt(p.replace("col-xl-", ""), 10),
|
|
1014
1027
|
columnInEL: parseInt(r.replace("col-el-", ""), 10)
|
|
@@ -1029,11 +1042,11 @@ class Je extends He {
|
|
|
1029
1042
|
const m = l.find((y) => y.id === a.id);
|
|
1030
1043
|
Object.assign(m || {}, a);
|
|
1031
1044
|
}
|
|
1032
|
-
const
|
|
1045
|
+
const s = l.map((m) => m.columnInSM), c = l.map((m) => m.columnInMD), p = l.map((m) => m.columnInLG), r = l.map((m) => m.columnInEL), d = this.checkIsUniqueColumn(s) ? s[0] : null, i = this.checkIsUniqueColumn(c) ? c[0] : null, u = this.checkIsUniqueColumn(p) ? p[0] : null, f = this.checkIsUniqueColumn(r) ? r[0] : null;
|
|
1033
1046
|
Object.assign(o.unifiedLayout, {
|
|
1034
1047
|
uniqueColClassInSM: d,
|
|
1035
1048
|
uniqueColClassInMD: i,
|
|
1036
|
-
uniqueColClassInLG:
|
|
1049
|
+
uniqueColClassInLG: u,
|
|
1037
1050
|
uniqueColClassInEL: f
|
|
1038
1051
|
});
|
|
1039
1052
|
}
|
|
@@ -1045,7 +1058,7 @@ class Je extends He {
|
|
|
1045
1058
|
return Array.from(a).length === 1;
|
|
1046
1059
|
}
|
|
1047
1060
|
}
|
|
1048
|
-
class
|
|
1061
|
+
class Ke extends Ze {
|
|
1049
1062
|
constructor(t, n) {
|
|
1050
1063
|
super(t, n);
|
|
1051
1064
|
}
|
|
@@ -1105,14 +1118,14 @@ class Ye extends Je {
|
|
|
1105
1118
|
}, n;
|
|
1106
1119
|
}
|
|
1107
1120
|
}
|
|
1108
|
-
function
|
|
1121
|
+
function et(e, t) {
|
|
1109
1122
|
const n = e.schema;
|
|
1110
1123
|
function a(o, l) {
|
|
1111
|
-
return new
|
|
1124
|
+
return new Ke(o, t).getPropertyConfig(n, l);
|
|
1112
1125
|
}
|
|
1113
1126
|
return { getPropsConfig: a };
|
|
1114
1127
|
}
|
|
1115
|
-
const
|
|
1128
|
+
const tt = /* @__PURE__ */ V({
|
|
1116
1129
|
name: "FRadioGroupDesign",
|
|
1117
1130
|
props: R,
|
|
1118
1131
|
emits: ["changeValue", "update:modelValue"],
|
|
@@ -1121,13 +1134,13 @@ const et = /* @__PURE__ */ V({
|
|
|
1121
1134
|
enumData: a,
|
|
1122
1135
|
onClickRadio: o,
|
|
1123
1136
|
getValue: l,
|
|
1124
|
-
getText:
|
|
1125
|
-
} = ae(e, t, n), c =
|
|
1137
|
+
getText: s
|
|
1138
|
+
} = ae(e, t, n), c = P(() => ({
|
|
1126
1139
|
"farris-checkradio-hor": e.horizontal
|
|
1127
|
-
})), p = w(), r =
|
|
1140
|
+
})), p = w(), r = q("designer-host-service"), d = q("design-item-context"), i = et(d, r), u = _e(p, d, i);
|
|
1128
1141
|
return L(() => {
|
|
1129
|
-
p.value.componentInstance =
|
|
1130
|
-
}), t.expose(
|
|
1142
|
+
p.value.componentInstance = u;
|
|
1143
|
+
}), t.expose(u.value), () => g("div", {
|
|
1131
1144
|
class: ["farris-input-wrap", c.value],
|
|
1132
1145
|
ref: p
|
|
1133
1146
|
}, [a.value.map((f, m) => {
|
|
@@ -1147,16 +1160,16 @@ const et = /* @__PURE__ */ V({
|
|
|
1147
1160
|
}, null), g("label", {
|
|
1148
1161
|
class: "custom-control-label",
|
|
1149
1162
|
for: y
|
|
1150
|
-
}, [
|
|
1163
|
+
}, [s(f)])]);
|
|
1151
1164
|
})]);
|
|
1152
1165
|
}
|
|
1153
|
-
}),
|
|
1166
|
+
}), nt = /* @__PURE__ */ new Map([
|
|
1154
1167
|
["appearance", ve]
|
|
1155
1168
|
]);
|
|
1156
|
-
function
|
|
1169
|
+
function ot(e, t, n) {
|
|
1157
1170
|
return t;
|
|
1158
1171
|
}
|
|
1159
|
-
const
|
|
1172
|
+
const at = "https://json-schema.org/draft/2020-12/schema", it = "https://farris-design.gitee.io/button-edit.schema.json", lt = "button-edit", rt = "A Farris Input Component", st = "object", ut = {
|
|
1160
1173
|
id: {
|
|
1161
1174
|
description: "The unique identifier for a Input Group",
|
|
1162
1175
|
type: "string"
|
|
@@ -1340,18 +1353,18 @@ const ot = "https://json-schema.org/draft/2020-12/schema", at = "https://farris-
|
|
|
1340
1353
|
type: "string",
|
|
1341
1354
|
default: ""
|
|
1342
1355
|
}
|
|
1343
|
-
},
|
|
1356
|
+
}, ct = [
|
|
1344
1357
|
"id",
|
|
1345
1358
|
"type"
|
|
1346
|
-
],
|
|
1347
|
-
$schema:
|
|
1348
|
-
$id:
|
|
1349
|
-
title:
|
|
1350
|
-
description:
|
|
1351
|
-
type:
|
|
1352
|
-
properties:
|
|
1353
|
-
required:
|
|
1354
|
-
},
|
|
1359
|
+
], dt = {
|
|
1360
|
+
$schema: at,
|
|
1361
|
+
$id: it,
|
|
1362
|
+
title: lt,
|
|
1363
|
+
description: rt,
|
|
1364
|
+
type: st,
|
|
1365
|
+
properties: ut,
|
|
1366
|
+
required: ct
|
|
1367
|
+
}, pt = "buttonEdit", ft = "A Farris Component", mt = "object", yt = {
|
|
1355
1368
|
basic: {
|
|
1356
1369
|
description: "Basic Infomation",
|
|
1357
1370
|
title: "基本信息",
|
|
@@ -1433,11 +1446,11 @@ const ot = "https://json-schema.org/draft/2020-12/schema", at = "https://farris-
|
|
|
1433
1446
|
}
|
|
1434
1447
|
}
|
|
1435
1448
|
}
|
|
1436
|
-
},
|
|
1437
|
-
title:
|
|
1438
|
-
description:
|
|
1439
|
-
type:
|
|
1440
|
-
categories:
|
|
1449
|
+
}, gt = {
|
|
1450
|
+
title: pt,
|
|
1451
|
+
description: ft,
|
|
1452
|
+
type: mt,
|
|
1453
|
+
categories: yt
|
|
1441
1454
|
}, ie = {
|
|
1442
1455
|
/**
|
|
1443
1456
|
* 组件标识
|
|
@@ -1547,24 +1560,24 @@ const ot = "https://json-schema.org/draft/2020-12/schema", at = "https://farris-
|
|
|
1547
1560
|
/** 更新方式 blur | change */
|
|
1548
1561
|
updateOn: { type: String, default: "change" }
|
|
1549
1562
|
};
|
|
1550
|
-
ne(ie,
|
|
1551
|
-
const
|
|
1563
|
+
ne(ie, dt, nt, ot, gt);
|
|
1564
|
+
const ht = {
|
|
1552
1565
|
popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
|
|
1553
1566
|
host: { type: Object },
|
|
1554
1567
|
backgroundColor: { type: String, default: "" }
|
|
1555
|
-
},
|
|
1568
|
+
}, vt = /* @__PURE__ */ V({
|
|
1556
1569
|
name: "FOverlay",
|
|
1557
|
-
props:
|
|
1570
|
+
props: ht,
|
|
1558
1571
|
emits: ["click"],
|
|
1559
1572
|
setup(e, t) {
|
|
1560
|
-
const n = w(e.popupContentPosition), a = w(e.host), o =
|
|
1573
|
+
const n = w(e.popupContentPosition), a = w(e.host), o = P(() => ({
|
|
1561
1574
|
backgroundColor: e.backgroundColor || "",
|
|
1562
1575
|
pointerEvents: "auto"
|
|
1563
1576
|
}));
|
|
1564
1577
|
function l(c) {
|
|
1565
1578
|
t.emit("click"), c.preventDefault(), c.stopPropagation();
|
|
1566
1579
|
}
|
|
1567
|
-
|
|
1580
|
+
P(() => {
|
|
1568
1581
|
const c = a.value;
|
|
1569
1582
|
if (c) {
|
|
1570
1583
|
const p = c.getBoundingClientRect(), {
|
|
@@ -1579,7 +1592,7 @@ const gt = {
|
|
|
1579
1592
|
}
|
|
1580
1593
|
return n.value;
|
|
1581
1594
|
});
|
|
1582
|
-
const
|
|
1595
|
+
const s = P(() => ({
|
|
1583
1596
|
// position: 'relative',
|
|
1584
1597
|
// left: `${position.value.left}px`,
|
|
1585
1598
|
// top: `${position.value.top}px`
|
|
@@ -1594,19 +1607,19 @@ const gt = {
|
|
|
1594
1607
|
onClick: (r) => l(r),
|
|
1595
1608
|
style: o.value
|
|
1596
1609
|
}, [g("div", {
|
|
1597
|
-
style:
|
|
1610
|
+
style: s.value
|
|
1598
1611
|
}, [(p = (c = t.slots).default) == null ? void 0 : p.call(c)])])];
|
|
1599
1612
|
}
|
|
1600
1613
|
});
|
|
1601
1614
|
}
|
|
1602
1615
|
});
|
|
1603
|
-
function
|
|
1616
|
+
function bt(e) {
|
|
1604
1617
|
if (e.content && e.content.render)
|
|
1605
1618
|
return e.content.render;
|
|
1606
1619
|
if (e.render && typeof e.render == "function")
|
|
1607
1620
|
return e.render;
|
|
1608
1621
|
}
|
|
1609
|
-
function
|
|
1622
|
+
function Ct(e) {
|
|
1610
1623
|
const t = document.createElement("div");
|
|
1611
1624
|
t.style.display = "contents";
|
|
1612
1625
|
let n;
|
|
@@ -1619,8 +1632,8 @@ function bt(e) {
|
|
|
1619
1632
|
me(() => {
|
|
1620
1633
|
document.body.removeChild(t);
|
|
1621
1634
|
});
|
|
1622
|
-
const l =
|
|
1623
|
-
return () => g(
|
|
1635
|
+
const l = bt(e);
|
|
1636
|
+
return () => g(vt, {
|
|
1624
1637
|
"popup-content-position": e.popupPosition,
|
|
1625
1638
|
host: e.host,
|
|
1626
1639
|
onClick: o,
|
|
@@ -1631,12 +1644,12 @@ function bt(e) {
|
|
|
1631
1644
|
}
|
|
1632
1645
|
}), document.body.appendChild(t), n.mount(t), n;
|
|
1633
1646
|
}
|
|
1634
|
-
class
|
|
1647
|
+
class kt {
|
|
1635
1648
|
static show(t) {
|
|
1636
|
-
return
|
|
1649
|
+
return Ct(t);
|
|
1637
1650
|
}
|
|
1638
1651
|
}
|
|
1639
|
-
const
|
|
1652
|
+
const Ft = Symbol("FModalService");
|
|
1640
1653
|
function le(e, t) {
|
|
1641
1654
|
function n() {
|
|
1642
1655
|
const a = e.beforeOpen || e.beforeClickButton || null;
|
|
@@ -1651,12 +1664,12 @@ function le(e, t) {
|
|
|
1651
1664
|
}
|
|
1652
1665
|
return { judgeCanOpen: n };
|
|
1653
1666
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const l = w(e.buttonBehavior),
|
|
1667
|
+
function Bt(e, t, n, a, o) {
|
|
1668
|
+
const l = w(e.buttonBehavior), s = w(e.popupOnInput), c = P(() => ({
|
|
1656
1669
|
"input-group-append": !0,
|
|
1657
1670
|
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
1658
|
-
})), { judgeCanOpen: p } = le(e, o), r =
|
|
1659
|
-
async function
|
|
1671
|
+
})), { judgeCanOpen: p } = le(e, o), r = P(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable), d = q(Ft, null), i = w();
|
|
1672
|
+
async function u(y) {
|
|
1660
1673
|
if (await p() && r.value) {
|
|
1661
1674
|
const F = !!t.slots.default;
|
|
1662
1675
|
if (l.value === "Modal") {
|
|
@@ -1666,12 +1679,12 @@ function Ft(e, t, n, a, o) {
|
|
|
1666
1679
|
});
|
|
1667
1680
|
i.value = h == null ? void 0 : h.modalRef;
|
|
1668
1681
|
}
|
|
1669
|
-
l.value === "Overlay" &&
|
|
1682
|
+
l.value === "Overlay" && kt.show({
|
|
1670
1683
|
// host: buttonEditRef.value,
|
|
1671
1684
|
host: document.body,
|
|
1672
1685
|
backgroundColor: "rgba(0,0,0,.15)",
|
|
1673
1686
|
render: () => t.slots.default && t.slots.default()
|
|
1674
|
-
}), F && l.value === "Popup" && a.togglePopup(!0), F &&
|
|
1687
|
+
}), F && l.value === "Popup" && a.togglePopup(!0), F && s.value && a.hidePopup(), t.emit("clickButton", { origin: y, value: e.modelValue });
|
|
1675
1688
|
}
|
|
1676
1689
|
}
|
|
1677
1690
|
function f(y) {
|
|
@@ -1682,23 +1695,23 @@ function Ft(e, t, n, a, o) {
|
|
|
1682
1695
|
}
|
|
1683
1696
|
return {
|
|
1684
1697
|
buttonGroupClass: c,
|
|
1685
|
-
onClickButton:
|
|
1698
|
+
onClickButton: u,
|
|
1686
1699
|
onMouseEnterButton: f,
|
|
1687
1700
|
onMouseLeaveButton: m,
|
|
1688
1701
|
modalRef: i
|
|
1689
1702
|
};
|
|
1690
1703
|
}
|
|
1691
|
-
function
|
|
1692
|
-
const
|
|
1704
|
+
function Mt(e, t, n, a, o, l) {
|
|
1705
|
+
const s = w(!1), c = P(() => e.enableClear && !e.readonly && !e.disable), { changeTextBoxValue: p } = l;
|
|
1693
1706
|
function r(f) {
|
|
1694
|
-
|
|
1707
|
+
s.value = f;
|
|
1695
1708
|
}
|
|
1696
|
-
|
|
1709
|
+
U(o, () => {
|
|
1697
1710
|
r(!!o.value);
|
|
1698
1711
|
});
|
|
1699
1712
|
function d(f) {
|
|
1700
1713
|
const m = !e.readonly && !e.disable && e.editable, y = !e.editable;
|
|
1701
|
-
f.stopPropagation(), (m || y) && (p("", !1), r(!
|
|
1714
|
+
f.stopPropagation(), (m || y) && (p("", !1), r(!s.value), t.emit("clear"));
|
|
1702
1715
|
}
|
|
1703
1716
|
function i(f) {
|
|
1704
1717
|
if (c.value) {
|
|
@@ -1709,30 +1722,30 @@ function Bt(e, t, n, a, o, l) {
|
|
|
1709
1722
|
!e.disable && !e.readonly && r(!0);
|
|
1710
1723
|
}
|
|
1711
1724
|
}
|
|
1712
|
-
function
|
|
1725
|
+
function u(f) {
|
|
1713
1726
|
c.value && r(!1);
|
|
1714
1727
|
}
|
|
1715
1728
|
return {
|
|
1716
1729
|
enableClearButton: c,
|
|
1717
|
-
showClearButton:
|
|
1730
|
+
showClearButton: s,
|
|
1718
1731
|
onClearValue: d,
|
|
1719
1732
|
onMouseEnterTextBox: i,
|
|
1720
|
-
onMouseLeaveTextBox:
|
|
1733
|
+
onMouseLeaveTextBox: u
|
|
1721
1734
|
};
|
|
1722
1735
|
}
|
|
1723
|
-
function
|
|
1724
|
-
const l =
|
|
1736
|
+
function wt(e, t, n, a, o) {
|
|
1737
|
+
const l = P(() => e.popupOnInput), s = P(() => e.popupOnFocus), { shouldPopupContent: c } = o, p = P(() => e.enableTitle ? n.value : ""), r = P(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), d = P(() => e.readonly || !e.editable), i = w(!1), u = P(() => !e.disable && i.value), f = P(() => ({
|
|
1725
1738
|
"text-left": e.textAlign === "left",
|
|
1726
1739
|
"text-center": e.textAlign === "center",
|
|
1727
1740
|
"text-right": e.textAlign === "right",
|
|
1728
1741
|
"form-control": !0,
|
|
1729
1742
|
"f-utils-fill": !0
|
|
1730
|
-
})), m =
|
|
1743
|
+
})), m = P(() => ({
|
|
1731
1744
|
"input-group": !0,
|
|
1732
1745
|
"f-state-disable": e.disable,
|
|
1733
1746
|
"f-state-editable": e.editable && !e.disable && !e.readonly,
|
|
1734
1747
|
"f-state-readonly": e.readonly && !e.disable,
|
|
1735
|
-
"f-state-focus":
|
|
1748
|
+
"f-state-focus": u.value
|
|
1736
1749
|
}));
|
|
1737
1750
|
function y(v, x = !0) {
|
|
1738
1751
|
n.value !== v && (n.value = v, x && (t.emit("change", v), t.emit("update:modelValue", v)));
|
|
@@ -1740,7 +1753,7 @@ function Mt(e, t, n, a, o) {
|
|
|
1740
1753
|
function F(v) {
|
|
1741
1754
|
c.value = !1, y(v, !0);
|
|
1742
1755
|
}
|
|
1743
|
-
|
|
1756
|
+
U(
|
|
1744
1757
|
() => e.modelValue,
|
|
1745
1758
|
(v) => {
|
|
1746
1759
|
n.value = v;
|
|
@@ -1753,9 +1766,9 @@ function Mt(e, t, n, a, o) {
|
|
|
1753
1766
|
t.emit("click", v);
|
|
1754
1767
|
}
|
|
1755
1768
|
function B(v) {
|
|
1756
|
-
e.disable || (i.value = !0, d.value || (t.emit("focus", v),
|
|
1769
|
+
e.disable || (i.value = !0, d.value || (t.emit("focus", v), s.value && !c.value && o.popup()));
|
|
1757
1770
|
}
|
|
1758
|
-
function
|
|
1771
|
+
function I(v) {
|
|
1759
1772
|
t.emit("input", v.target.value);
|
|
1760
1773
|
const x = v.target.value;
|
|
1761
1774
|
a.value = x, n.value !== x && y(x, e.updateOn === "change"), l.value && !c.value && o.popup();
|
|
@@ -1767,14 +1780,14 @@ function Mt(e, t, n, a, o) {
|
|
|
1767
1780
|
t.emit("keydown", v);
|
|
1768
1781
|
}
|
|
1769
1782
|
function S(v) {
|
|
1770
|
-
v.key === "Enter" && (l.value ||
|
|
1783
|
+
v.key === "Enter" && (l.value || s.value) && o.hidePopup(), t.emit("keyup", v);
|
|
1771
1784
|
}
|
|
1772
1785
|
function M(v) {
|
|
1773
1786
|
const x = v.target.value;
|
|
1774
1787
|
v.stopPropagation(), y(x);
|
|
1775
1788
|
}
|
|
1776
1789
|
return {
|
|
1777
|
-
hasFocusedTextBox:
|
|
1790
|
+
hasFocusedTextBox: u,
|
|
1778
1791
|
isTextBoxReadonly: d,
|
|
1779
1792
|
textBoxClass: f,
|
|
1780
1793
|
textBoxPlaceholder: r,
|
|
@@ -1785,29 +1798,29 @@ function Mt(e, t, n, a, o) {
|
|
|
1785
1798
|
onBlurTextBox: k,
|
|
1786
1799
|
onClickTextBox: h,
|
|
1787
1800
|
onFocusTextBox: B,
|
|
1788
|
-
onInput:
|
|
1801
|
+
onInput: I,
|
|
1789
1802
|
onKeyDownTextBox: E,
|
|
1790
1803
|
onKeyUpTextBox: S,
|
|
1791
1804
|
onMouseDownTextBox: C,
|
|
1792
1805
|
onTextBoxValueChange: M
|
|
1793
1806
|
};
|
|
1794
1807
|
}
|
|
1795
|
-
function
|
|
1796
|
-
const o = w(), l = w(!1), { judgeCanOpen:
|
|
1808
|
+
function St(e, t, n, a) {
|
|
1809
|
+
const o = w(), l = w(!1), { judgeCanOpen: s } = le(e, a);
|
|
1797
1810
|
function c() {
|
|
1798
1811
|
const i = o.value;
|
|
1799
1812
|
i && i.show(n.value);
|
|
1800
1813
|
}
|
|
1801
1814
|
async function p(i = !1) {
|
|
1802
1815
|
if (!!t.slots.default) {
|
|
1803
|
-
if (!i && !l.value && !await
|
|
1816
|
+
if (!i && !l.value && !await s())
|
|
1804
1817
|
return;
|
|
1805
1818
|
l.value = !l.value, await z(), c();
|
|
1806
1819
|
}
|
|
1807
1820
|
}
|
|
1808
1821
|
async function r(i = !1) {
|
|
1809
1822
|
if (!!t.slots.default) {
|
|
1810
|
-
if (!i && !await
|
|
1823
|
+
if (!i && !await s())
|
|
1811
1824
|
return;
|
|
1812
1825
|
l.value = !0, await z(), c();
|
|
1813
1826
|
}
|
|
@@ -1817,17 +1830,17 @@ function wt(e, t, n, a) {
|
|
|
1817
1830
|
}
|
|
1818
1831
|
return { hidePopup: d, popup: r, shouldPopupContent: l, togglePopup: p, popoverRef: o };
|
|
1819
1832
|
}
|
|
1820
|
-
function
|
|
1833
|
+
function Tt(e, t, n) {
|
|
1821
1834
|
const a = w(), {
|
|
1822
1835
|
isTextBoxReadonly: o,
|
|
1823
1836
|
textBoxClass: l,
|
|
1824
|
-
textBoxPlaceholder:
|
|
1837
|
+
textBoxPlaceholder: s,
|
|
1825
1838
|
textBoxTitle: c,
|
|
1826
1839
|
onBlurTextBox: p,
|
|
1827
1840
|
onClickTextBox: r,
|
|
1828
1841
|
onFocusTextBox: d,
|
|
1829
1842
|
onInput: i,
|
|
1830
|
-
onKeyDownTextBox:
|
|
1843
|
+
onKeyDownTextBox: u,
|
|
1831
1844
|
onKeyUpTextBox: f,
|
|
1832
1845
|
onMouseDownTextBox: m,
|
|
1833
1846
|
onTextBoxValueChange: y
|
|
@@ -1843,7 +1856,7 @@ function St(e, t, n) {
|
|
|
1843
1856
|
disabled: e.disable,
|
|
1844
1857
|
maxlength: e.maxLength,
|
|
1845
1858
|
minlength: e.minLength,
|
|
1846
|
-
placeholder:
|
|
1859
|
+
placeholder: s.value,
|
|
1847
1860
|
readonly: o.value,
|
|
1848
1861
|
tabindex: e.tabIndex,
|
|
1849
1862
|
title: c.value,
|
|
@@ -1854,19 +1867,19 @@ function St(e, t, n) {
|
|
|
1854
1867
|
onClick: r,
|
|
1855
1868
|
onFocus: d,
|
|
1856
1869
|
onInput: i,
|
|
1857
|
-
onKeydown:
|
|
1870
|
+
onKeydown: u,
|
|
1858
1871
|
onKeyup: f,
|
|
1859
1872
|
onMousedown: m
|
|
1860
1873
|
}, null);
|
|
1861
1874
|
}
|
|
1862
|
-
function
|
|
1875
|
+
function Et(e, t, n) {
|
|
1863
1876
|
const a = w(e.separator), {
|
|
1864
1877
|
changeTextBoxValue: o
|
|
1865
|
-
} = n, l =
|
|
1878
|
+
} = n, l = P(() => t.value ? t.value.split(a.value).map((c) => ({
|
|
1866
1879
|
name: c,
|
|
1867
1880
|
selectable: !0
|
|
1868
1881
|
})) : []);
|
|
1869
|
-
function
|
|
1882
|
+
function s(c) {
|
|
1870
1883
|
o(c.map((p) => p.name).join(a.value), !0);
|
|
1871
1884
|
}
|
|
1872
1885
|
return () => g(Ce, {
|
|
@@ -1875,14 +1888,14 @@ function Tt(e, t, n) {
|
|
|
1875
1888
|
data: l.value,
|
|
1876
1889
|
showClose: !0,
|
|
1877
1890
|
showInput: !0,
|
|
1878
|
-
onChange:
|
|
1891
|
+
onChange: s
|
|
1879
1892
|
}, null);
|
|
1880
1893
|
}
|
|
1881
|
-
function
|
|
1894
|
+
function Pt(e, t, n, a) {
|
|
1882
1895
|
const {
|
|
1883
1896
|
buttonGroupClass: o,
|
|
1884
1897
|
onClickButton: l,
|
|
1885
|
-
onMouseEnterButton:
|
|
1898
|
+
onMouseEnterButton: s,
|
|
1886
1899
|
onMouseLeaveButton: c
|
|
1887
1900
|
} = n, {
|
|
1888
1901
|
enableClearButton: p,
|
|
@@ -1893,7 +1906,7 @@ function Et(e, t, n, a) {
|
|
|
1893
1906
|
renderButtonGroup: () => g("div", {
|
|
1894
1907
|
id: `${e.id}-button-group`,
|
|
1895
1908
|
class: o.value
|
|
1896
|
-
}, [p.value &&
|
|
1909
|
+
}, [p.value && j(g("span", {
|
|
1897
1910
|
class: "input-group-text input-group-clear",
|
|
1898
1911
|
onClick: d
|
|
1899
1912
|
}, [g("i", {
|
|
@@ -1901,14 +1914,14 @@ function Et(e, t, n, a) {
|
|
|
1901
1914
|
}, null)]), [[ye, r.value]]), t.slots.buttonContent ? g("span", {
|
|
1902
1915
|
class: "input-group-text input-group-append-button",
|
|
1903
1916
|
onClick: l,
|
|
1904
|
-
onMouseenter:
|
|
1917
|
+
onMouseenter: s,
|
|
1905
1918
|
onMouseleave: c
|
|
1906
1919
|
}, [t.slots.buttonContent()]) : e.buttonContent ? g("span", {
|
|
1907
1920
|
class: "input-group-text input-group-append-button",
|
|
1908
1921
|
innerHTML: e.buttonContent,
|
|
1909
1922
|
ref: i,
|
|
1910
1923
|
onClick: l,
|
|
1911
|
-
onMouseenter:
|
|
1924
|
+
onMouseenter: s,
|
|
1912
1925
|
onMouseleave: c
|
|
1913
1926
|
}, null) : null]),
|
|
1914
1927
|
buttonHandleElement: i
|
|
@@ -1933,28 +1946,28 @@ function It(e, t, n) {
|
|
|
1933
1946
|
onHidden: o
|
|
1934
1947
|
}, {
|
|
1935
1948
|
default: () => {
|
|
1936
|
-
var
|
|
1937
|
-
return [(c = (
|
|
1949
|
+
var s, c;
|
|
1950
|
+
return [(c = (s = t.slots).default) == null ? void 0 : c.call(s)];
|
|
1938
1951
|
}
|
|
1939
1952
|
});
|
|
1940
1953
|
}
|
|
1941
|
-
const
|
|
1954
|
+
const xt = /* @__PURE__ */ V({
|
|
1942
1955
|
name: "FButtonEdit",
|
|
1943
1956
|
props: ie,
|
|
1944
1957
|
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
|
|
1945
1958
|
setup(e, t) {
|
|
1946
|
-
const n = w(), a = w(e.customClass), o = w(e.modelValue), l =
|
|
1947
|
-
shouldPopupContent:
|
|
1959
|
+
const n = w(), a = w(e.customClass), o = w(e.modelValue), l = St(e, t, n, o), {
|
|
1960
|
+
shouldPopupContent: s,
|
|
1948
1961
|
hidePopup: c,
|
|
1949
1962
|
togglePopup: p
|
|
1950
|
-
} = l, r =
|
|
1951
|
-
hasFocusedTextBox:
|
|
1963
|
+
} = l, r = Bt(e, t, n, l, o), d = w(""), i = wt(e, t, o, d, l), {
|
|
1964
|
+
hasFocusedTextBox: u,
|
|
1952
1965
|
commitValue: f,
|
|
1953
1966
|
inputGroupClass: m
|
|
1954
|
-
} = i, y =
|
|
1967
|
+
} = i, y = Mt(e, t, o, u, d, i), {
|
|
1955
1968
|
onMouseEnterTextBox: F,
|
|
1956
1969
|
onMouseLeaveTextBox: k
|
|
1957
|
-
} = y, h =
|
|
1970
|
+
} = y, h = P(() => {
|
|
1958
1971
|
const v = {
|
|
1959
1972
|
"f-button-edit": !0,
|
|
1960
1973
|
"f-cmp-inputgroup": !0,
|
|
@@ -1963,20 +1976,20 @@ const Pt = /* @__PURE__ */ V({
|
|
|
1963
1976
|
return a.value && a.value.split(" ").reduce((x, $) => (x[$] = !0, x), v), v;
|
|
1964
1977
|
});
|
|
1965
1978
|
function B() {
|
|
1966
|
-
return e.multiSelect && e.inputType === "tag" ?
|
|
1979
|
+
return e.multiSelect && e.inputType === "tag" ? Et(e, o, i) : Tt(e, o, i);
|
|
1967
1980
|
}
|
|
1968
|
-
let
|
|
1969
|
-
|
|
1970
|
-
|
|
1981
|
+
let I = B();
|
|
1982
|
+
U([() => e.multiSelect, () => e.inputType], () => {
|
|
1983
|
+
I = B();
|
|
1971
1984
|
});
|
|
1972
1985
|
const {
|
|
1973
1986
|
renderButtonGroup: C,
|
|
1974
1987
|
buttonHandleElement: E
|
|
1975
|
-
} =
|
|
1988
|
+
} = Pt(e, t, r, y), S = It(e, t, l), M = {
|
|
1976
1989
|
commitValue: f,
|
|
1977
1990
|
elementRef: n,
|
|
1978
1991
|
hidePopup: c,
|
|
1979
|
-
shouldPopupContent:
|
|
1992
|
+
shouldPopupContent: s,
|
|
1980
1993
|
togglePopup: p,
|
|
1981
1994
|
openDialog: () => {
|
|
1982
1995
|
E.value && e.buttonBehavior === "Modal" && E.value.click();
|
|
@@ -1990,7 +2003,7 @@ const Pt = /* @__PURE__ */ V({
|
|
|
1990
2003
|
n.value.componentInstance = M, window.onresize = () => {
|
|
1991
2004
|
document.body.click();
|
|
1992
2005
|
};
|
|
1993
|
-
}), t.expose(M), () => g(
|
|
2006
|
+
}), t.expose(M), () => g(J, null, [g("div", ge(t.attrs, {
|
|
1994
2007
|
ref: n,
|
|
1995
2008
|
class: h.value,
|
|
1996
2009
|
id: e.id
|
|
@@ -1999,9 +2012,9 @@ const Pt = /* @__PURE__ */ V({
|
|
|
1999
2012
|
class: m.value,
|
|
2000
2013
|
onMouseenter: F,
|
|
2001
2014
|
onMouseleave: k
|
|
2002
|
-
}, [
|
|
2015
|
+
}, [I(), C()])]), s.value && S()]);
|
|
2003
2016
|
}
|
|
2004
|
-
}),
|
|
2017
|
+
}), Vt = "https://json-schema.org/draft/2020-12/schema", At = "https://farris-design.gitee.io/radio-group.schema.json", Ot = "item-collection-editor", Dt = "A Farris Input Component", Lt = "object", $t = {
|
|
2005
2018
|
id: {
|
|
2006
2019
|
description: "The unique identifier for a item-collection-editor",
|
|
2007
2020
|
type: "string"
|
|
@@ -2065,17 +2078,17 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2065
2078
|
type: "string",
|
|
2066
2079
|
default: ""
|
|
2067
2080
|
}
|
|
2068
|
-
},
|
|
2081
|
+
}, qt = [
|
|
2069
2082
|
"id",
|
|
2070
2083
|
"type"
|
|
2071
|
-
], Nt = [],
|
|
2072
|
-
$schema:
|
|
2073
|
-
$id:
|
|
2074
|
-
title:
|
|
2075
|
-
description:
|
|
2076
|
-
type:
|
|
2077
|
-
properties:
|
|
2078
|
-
required:
|
|
2084
|
+
], Nt = [], Gt = {
|
|
2085
|
+
$schema: Vt,
|
|
2086
|
+
$id: At,
|
|
2087
|
+
title: Ot,
|
|
2088
|
+
description: Dt,
|
|
2089
|
+
type: Lt,
|
|
2090
|
+
properties: $t,
|
|
2091
|
+
required: qt,
|
|
2079
2092
|
ignore: Nt
|
|
2080
2093
|
}, re = {
|
|
2081
2094
|
/**
|
|
@@ -2123,7 +2136,7 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2123
2136
|
* 列表只有一列时,将结果集转化为字符串数组
|
|
2124
2137
|
*/
|
|
2125
2138
|
// isSimpleArray: { type: Boolean, default: false }
|
|
2126
|
-
},
|
|
2139
|
+
}, jt = be(re, Gt, Le, Se), Ut = {
|
|
2127
2140
|
/**
|
|
2128
2141
|
* 必填的列
|
|
2129
2142
|
*/
|
|
@@ -2153,14 +2166,14 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2153
2166
|
* 组件值
|
|
2154
2167
|
*/
|
|
2155
2168
|
datas: { type: Array, default: [] }
|
|
2156
|
-
},
|
|
2169
|
+
}, Wt = /* @__PURE__ */ V({
|
|
2157
2170
|
name: "FItemCollectionEditorInner",
|
|
2158
|
-
props:
|
|
2171
|
+
props: Ut,
|
|
2159
2172
|
emits: ["change"],
|
|
2160
2173
|
setup(e, t) {
|
|
2161
2174
|
const {
|
|
2162
2175
|
guid: n
|
|
2163
|
-
} =
|
|
2176
|
+
} = Y(), a = new Be(), o = w(e.valueField), l = w(e.nameField), s = {
|
|
2164
2177
|
editMode: "cell"
|
|
2165
2178
|
}, c = w(), p = e.columns;
|
|
2166
2179
|
let r = e.datas;
|
|
@@ -2180,7 +2193,7 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2180
2193
|
}
|
|
2181
2194
|
return !0;
|
|
2182
2195
|
}
|
|
2183
|
-
function
|
|
2196
|
+
function u(h) {
|
|
2184
2197
|
const B = "不允许重复。";
|
|
2185
2198
|
if (!i())
|
|
2186
2199
|
return !1;
|
|
@@ -2189,17 +2202,17 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2189
2202
|
position: "top-center",
|
|
2190
2203
|
message: "请添加值"
|
|
2191
2204
|
}), !1);
|
|
2192
|
-
const
|
|
2205
|
+
const I = e.requiredFields || [], C = "不允许为空";
|
|
2193
2206
|
for (const S of h)
|
|
2194
2207
|
for (const M of Object.keys(S)) {
|
|
2195
2208
|
const v = p.find((x) => x.field === M);
|
|
2196
2209
|
if (v && v.editor && (v.editor.type === "checkbox" || v.editor.type === "switch")) {
|
|
2197
|
-
if (
|
|
2210
|
+
if (I.includes(M) && (S[M] === null || S[M] === void 0))
|
|
2198
2211
|
return a.warning({
|
|
2199
2212
|
position: "top-center",
|
|
2200
2213
|
message: v.title + C
|
|
2201
2214
|
}), !1;
|
|
2202
|
-
} else if (
|
|
2215
|
+
} else if (I.includes(M) && (S[M] === void 0 || S[M] === "" || S[M] === null))
|
|
2203
2216
|
return a.warning({
|
|
2204
2217
|
position: "top-center",
|
|
2205
2218
|
message: v.title + C
|
|
@@ -2237,12 +2250,12 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2237
2250
|
if (!h || h.length === 0)
|
|
2238
2251
|
return h;
|
|
2239
2252
|
const B = [];
|
|
2240
|
-
return h.forEach((
|
|
2253
|
+
return h.forEach((I) => {
|
|
2241
2254
|
const {
|
|
2242
2255
|
value: C,
|
|
2243
2256
|
name: E,
|
|
2244
2257
|
...S
|
|
2245
|
-
} =
|
|
2258
|
+
} = I, M = Object.assign({}, S);
|
|
2246
2259
|
M[o.value.trim()] = C, M[l.value.trim()] = E, B.push(M);
|
|
2247
2260
|
}), B;
|
|
2248
2261
|
}
|
|
@@ -2250,11 +2263,11 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2250
2263
|
let h = [];
|
|
2251
2264
|
return c.value.getVisibleData().forEach((B) => {
|
|
2252
2265
|
const {
|
|
2253
|
-
hId:
|
|
2266
|
+
hId: I,
|
|
2254
2267
|
...C
|
|
2255
2268
|
} = B.raw;
|
|
2256
2269
|
h.push(C);
|
|
2257
|
-
}),
|
|
2270
|
+
}), u(h) ? (e.dynamicMappingKeys ? (h = F(h), t.emit("change", {
|
|
2258
2271
|
value: h,
|
|
2259
2272
|
parameters: {
|
|
2260
2273
|
valueField: o.value.trim(),
|
|
@@ -2288,11 +2301,11 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2288
2301
|
columns: p,
|
|
2289
2302
|
data: r,
|
|
2290
2303
|
editable: !0,
|
|
2291
|
-
"edit-option":
|
|
2304
|
+
"edit-option": s,
|
|
2292
2305
|
fit: "true"
|
|
2293
2306
|
}, null)])]);
|
|
2294
2307
|
}
|
|
2295
|
-
}),
|
|
2308
|
+
}), Rt = /* @__PURE__ */ V({
|
|
2296
2309
|
name: "FItemCollectionEditor",
|
|
2297
2310
|
props: re,
|
|
2298
2311
|
components: {},
|
|
@@ -2300,25 +2313,25 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2300
2313
|
setup(e, t) {
|
|
2301
2314
|
const {
|
|
2302
2315
|
guid: n
|
|
2303
|
-
} =
|
|
2316
|
+
} = Y(), a = w(`共 ${(e.modelValue || []).length} 项`), o = w(e.valueField), l = w(e.nameField), s = w();
|
|
2304
2317
|
function c() {
|
|
2305
|
-
let
|
|
2306
|
-
return e.dynamicMappingKeys ? (
|
|
2318
|
+
let u = [];
|
|
2319
|
+
return e.dynamicMappingKeys ? (u = [], o.value = o.value.trim(), l.value = l.value.trim(), (e.modelValue || []).forEach((f) => {
|
|
2307
2320
|
if (o.value && l.value) {
|
|
2308
2321
|
const {
|
|
2309
2322
|
[o.value]: m,
|
|
2310
2323
|
[l.value]: y,
|
|
2311
2324
|
...F
|
|
2312
2325
|
} = f, k = F || {};
|
|
2313
|
-
k.value = m, k.name = y, k.hId = n(),
|
|
2326
|
+
k.value = m, k.name = y, k.hId = n(), u.push(k);
|
|
2314
2327
|
}
|
|
2315
|
-
})) : (
|
|
2328
|
+
})) : (u = G(e.modelValue || []), u.forEach((f) => {
|
|
2316
2329
|
f.hId = n();
|
|
2317
|
-
})),
|
|
2330
|
+
})), u;
|
|
2318
2331
|
}
|
|
2319
2332
|
function p() {
|
|
2320
|
-
let
|
|
2321
|
-
return e.columns && e.columns.length > 0 ?
|
|
2333
|
+
let u = [];
|
|
2334
|
+
return e.columns && e.columns.length > 0 ? u = e.columns : u = [{
|
|
2322
2335
|
field: e.valueField,
|
|
2323
2336
|
title: "值",
|
|
2324
2337
|
dataType: "string"
|
|
@@ -2326,7 +2339,7 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2326
2339
|
field: e.nameField,
|
|
2327
2340
|
title: "名称",
|
|
2328
2341
|
dataType: "string"
|
|
2329
|
-
}],
|
|
2342
|
+
}], u;
|
|
2330
2343
|
}
|
|
2331
2344
|
function r() {
|
|
2332
2345
|
}
|
|
@@ -2339,23 +2352,23 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2339
2352
|
name: "cancel",
|
|
2340
2353
|
text: "取消",
|
|
2341
2354
|
class: "btn btn-secondary",
|
|
2342
|
-
handle: (
|
|
2355
|
+
handle: (u) => !0
|
|
2343
2356
|
}, {
|
|
2344
2357
|
name: "accept",
|
|
2345
2358
|
text: "确定",
|
|
2346
2359
|
class: "btn btn-primary",
|
|
2347
|
-
handle: (
|
|
2360
|
+
handle: (u) => !!s.value.clickConfirm()
|
|
2348
2361
|
}]
|
|
2349
2362
|
};
|
|
2350
|
-
function i(
|
|
2351
|
-
a.value = `共 ${
|
|
2363
|
+
function i(u) {
|
|
2364
|
+
a.value = `共 ${u.value.length} 项`, t.emit("change", u);
|
|
2352
2365
|
}
|
|
2353
2366
|
return L(() => {
|
|
2354
|
-
}), () => g(
|
|
2367
|
+
}), () => g(xt, {
|
|
2355
2368
|
"button-behavior": "Modal",
|
|
2356
2369
|
"modal-options": d,
|
|
2357
2370
|
modelValue: a.value,
|
|
2358
|
-
"onUpdate:modelValue": (
|
|
2371
|
+
"onUpdate:modelValue": (u) => a.value = u,
|
|
2359
2372
|
editable: !1,
|
|
2360
2373
|
beforeOpen: r
|
|
2361
2374
|
}, {
|
|
@@ -2375,10 +2388,10 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2375
2388
|
class: "farris-label-text"
|
|
2376
2389
|
}, [A("枚举值字段")])]), g("div", {
|
|
2377
2390
|
class: "farris-input-wrap"
|
|
2378
|
-
}, [
|
|
2391
|
+
}, [j(g("input", {
|
|
2379
2392
|
type: "input",
|
|
2380
2393
|
class: "form-control",
|
|
2381
|
-
"onUpdate:modelValue": (
|
|
2394
|
+
"onUpdate:modelValue": (u) => o.value = u,
|
|
2382
2395
|
readonly: e.readonly
|
|
2383
2396
|
}, null), [[X, o.value]])])])]), g("div", {
|
|
2384
2397
|
class: "farris-group-wrap"
|
|
@@ -2392,13 +2405,13 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2392
2405
|
class: "farris-label-text"
|
|
2393
2406
|
}, [A("枚举名称字段")])]), g("div", {
|
|
2394
2407
|
class: "farris-input-wrap"
|
|
2395
|
-
}, [
|
|
2408
|
+
}, [j(g("input", {
|
|
2396
2409
|
type: "input",
|
|
2397
2410
|
class: "form-control",
|
|
2398
|
-
"onUpdate:modelValue": (
|
|
2411
|
+
"onUpdate:modelValue": (u) => l.value = u,
|
|
2399
2412
|
readonly: e.readonly
|
|
2400
|
-
}, null), [[X, l.value]])])])])]), g(
|
|
2401
|
-
ref:
|
|
2413
|
+
}, null), [[X, l.value]])])])])]), g(Wt, {
|
|
2414
|
+
ref: s,
|
|
2402
2415
|
valueField: o.value,
|
|
2403
2416
|
nameField: l.value,
|
|
2404
2417
|
requiredFields: e.requiredFields,
|
|
@@ -2407,19 +2420,19 @@ const Pt = /* @__PURE__ */ V({
|
|
|
2407
2420
|
canEmpty: e.canEmpty,
|
|
2408
2421
|
datas: c(),
|
|
2409
2422
|
columns: p(),
|
|
2410
|
-
onChange: (
|
|
2423
|
+
onChange: (u) => i(u)
|
|
2411
2424
|
}, null)])]
|
|
2412
2425
|
});
|
|
2413
2426
|
}
|
|
2414
2427
|
});
|
|
2415
2428
|
D.install = (e) => {
|
|
2416
|
-
e.component(D.name, D), e.component(
|
|
2429
|
+
e.component(D.name, D), e.component(Q.name, Q);
|
|
2417
2430
|
};
|
|
2418
2431
|
D.register = (e, t, n, a) => {
|
|
2419
|
-
e["radio-group"] = D, t["radio-group"] = oe, e["item-collection-editor"] =
|
|
2432
|
+
e["radio-group"] = D, t["radio-group"] = oe, e["item-collection-editor"] = Rt, t["item-collection-editor"] = jt;
|
|
2420
2433
|
};
|
|
2421
2434
|
D.registerDesigner = (e, t, n) => {
|
|
2422
|
-
e["radio-group"] =
|
|
2435
|
+
e["radio-group"] = tt, t["radio-group"] = oe;
|
|
2423
2436
|
};
|
|
2424
2437
|
export {
|
|
2425
2438
|
D as RadioGroup,
|