@farris/ui-vue 1.3.4 → 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 +9 -7
- 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 +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- 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 +3096 -3069
- 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 +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- 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 +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- 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 +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- 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 +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- 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 +296 -283
- 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 +634 -619
- 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 +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- 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 +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -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
|
@@ -1,117 +1,131 @@
|
|
|
1
|
-
import { ref as S, onMounted as
|
|
2
|
-
import { isPlainObject as V, cloneDeep as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { properties: t, title:
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import { ref as S, onMounted as X, defineComponent as A, createVNode as y, withDirectives as L, vShow as N, Teleport as C, Fragment as Y, inject as P } from "vue";
|
|
2
|
+
import { isPlainObject as V, cloneDeep as Z } from "lodash-es";
|
|
3
|
+
const G = {}, J = {};
|
|
4
|
+
function F(e) {
|
|
5
|
+
const { properties: t, title: l, ignore: n } = e, i = n && Array.isArray(n), c = Object.keys(t).reduce((u, d) => ((!i || !n.find((D) => D === d)) && (u[d] = t[d].type === "object" && t[d].properties ? F(t[d]) : Z(t[d].default)), u), {});
|
|
6
|
+
if (l && (!i || !n.find((u) => u === "id"))) {
|
|
7
|
+
const u = l.toLowerCase().replace(/-/g, "_");
|
|
8
|
+
c.id = `${u}_${Math.random().toString().slice(2, 6)}`;
|
|
9
9
|
}
|
|
10
|
-
return
|
|
10
|
+
return c;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
function K(e) {
|
|
13
|
+
const { properties: t, title: l, required: n } = e;
|
|
14
|
+
if (n && Array.isArray(n)) {
|
|
15
|
+
const i = n.reduce((c, u) => (c[u] = t[u].type === "object" && t[u].properties ? F(t[u]) : Z(t[u].default), c), {});
|
|
16
|
+
if (l && n.find((c) => c === "id")) {
|
|
17
|
+
const c = l.toLowerCase().replace(/-/g, "_");
|
|
18
|
+
i.id = `${c}_${Math.random().toString().slice(2, 6)}`;
|
|
19
|
+
}
|
|
20
|
+
return i;
|
|
18
21
|
}
|
|
19
|
-
return
|
|
22
|
+
return {
|
|
23
|
+
type: l
|
|
24
|
+
};
|
|
20
25
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
26
|
+
function Q(e, t = {}, l) {
|
|
27
|
+
const n = G[e];
|
|
28
|
+
if (n) {
|
|
29
|
+
let i = K(n);
|
|
30
|
+
const c = J[e];
|
|
31
|
+
return i = c ? c({ getSchemaByType: Q }, i, t, l) : i, i;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
24
34
|
}
|
|
25
35
|
function I(e, t) {
|
|
26
|
-
|
|
36
|
+
const l = F(t);
|
|
37
|
+
return Object.keys(l).reduce((n, i) => (Object.prototype.hasOwnProperty.call(e, i) && (n[i] && V(n[i]) && V(e[i] || !e[i]) ? Object.assign(n[i], e[i] || {}) : n[i] = e[i]), n), l), l;
|
|
38
|
+
}
|
|
39
|
+
function ee(e, t) {
|
|
40
|
+
return Object.keys(e).filter((n) => e[n] != null).reduce((n, i) => {
|
|
27
41
|
if (t.has(i)) {
|
|
28
|
-
const
|
|
29
|
-
if (typeof
|
|
30
|
-
|
|
42
|
+
const c = t.get(i);
|
|
43
|
+
if (typeof c == "string")
|
|
44
|
+
n[c] = e[i];
|
|
31
45
|
else {
|
|
32
|
-
const
|
|
33
|
-
Object.assign(
|
|
46
|
+
const u = c(i, e[i], e);
|
|
47
|
+
Object.assign(n, u);
|
|
34
48
|
}
|
|
35
49
|
} else
|
|
36
|
-
|
|
37
|
-
return
|
|
50
|
+
n[i] = e[i];
|
|
51
|
+
return n;
|
|
38
52
|
}, {});
|
|
39
53
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return
|
|
54
|
+
function te(e, t, l = /* @__PURE__ */ new Map()) {
|
|
55
|
+
const n = I(e, t);
|
|
56
|
+
return ee(n, l);
|
|
43
57
|
}
|
|
44
|
-
function
|
|
45
|
-
function t(r,
|
|
58
|
+
function ne(e = {}) {
|
|
59
|
+
function t(r, f, s, m) {
|
|
46
60
|
if (typeof s == "number")
|
|
47
|
-
return
|
|
61
|
+
return m[r].length === s;
|
|
48
62
|
if (typeof s == "object") {
|
|
49
63
|
const b = Object.keys(s)[0], g = s[b];
|
|
50
64
|
if (b === "not")
|
|
51
|
-
return Number(
|
|
65
|
+
return Number(m[r].length) !== Number(g);
|
|
52
66
|
if (b === "moreThan")
|
|
53
|
-
return Number(
|
|
67
|
+
return Number(m[r].length) >= Number(g);
|
|
54
68
|
if (b === "lessThan")
|
|
55
|
-
return Number(
|
|
69
|
+
return Number(m[r].length) <= Number(g);
|
|
56
70
|
}
|
|
57
71
|
return !1;
|
|
58
72
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
73
|
+
function l(r, f, s, m) {
|
|
74
|
+
return m[r] && m[r].propertyValue && String(m[r].propertyValue.value) === String(s);
|
|
61
75
|
}
|
|
62
|
-
const
|
|
76
|
+
const n = /* @__PURE__ */ new Map([
|
|
63
77
|
["length", t],
|
|
64
|
-
["getProperty",
|
|
78
|
+
["getProperty", l]
|
|
65
79
|
]);
|
|
66
|
-
Object.keys(e).reduce((r,
|
|
67
|
-
function i(r,
|
|
80
|
+
Object.keys(e).reduce((r, f) => (r.set(f, e[f]), r), n);
|
|
81
|
+
function i(r, f) {
|
|
68
82
|
const s = r;
|
|
69
|
-
return typeof
|
|
70
|
-
if (
|
|
71
|
-
return { target: s, operator: "length", param: null, value:
|
|
72
|
-
const b =
|
|
83
|
+
return typeof f == "number" ? [{ target: s, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: s, operator: "getProperty", param: r, value: !!f }] : typeof f == "object" ? Object.keys(f).map((m) => {
|
|
84
|
+
if (m === "length")
|
|
85
|
+
return { target: s, operator: "length", param: null, value: f[m] };
|
|
86
|
+
const b = m, g = f[m];
|
|
73
87
|
return { target: s, operator: "getProperty", param: b, value: g };
|
|
74
88
|
}) : [];
|
|
75
89
|
}
|
|
76
|
-
function
|
|
77
|
-
return Object.keys(r).reduce((s,
|
|
78
|
-
const b = i(
|
|
90
|
+
function c(r) {
|
|
91
|
+
return Object.keys(r).reduce((s, m) => {
|
|
92
|
+
const b = i(m, r[m]);
|
|
79
93
|
return s.push(...b), s;
|
|
80
94
|
}, []);
|
|
81
95
|
}
|
|
82
|
-
function
|
|
83
|
-
if (
|
|
84
|
-
const s =
|
|
85
|
-
return s && s(r.target, r.param, r.value,
|
|
96
|
+
function u(r, f) {
|
|
97
|
+
if (n.has(r.operator)) {
|
|
98
|
+
const s = n.get(r.operator);
|
|
99
|
+
return s && s(r.target, r.param, r.value, f) || !1;
|
|
86
100
|
}
|
|
87
101
|
return !1;
|
|
88
102
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
103
|
+
function d(r, f) {
|
|
104
|
+
return c(r).reduce((b, g) => b && u(g, f), !0);
|
|
91
105
|
}
|
|
92
|
-
function D(r,
|
|
93
|
-
const s = Object.keys(r),
|
|
94
|
-
return
|
|
106
|
+
function D(r, f) {
|
|
107
|
+
const s = Object.keys(r), m = s.includes("allOf"), b = s.includes("anyOf"), g = m || b, p = (g ? r[g ? m ? "allOf" : "anyOf" : "allOf"] : [r]).map((B) => d(B, f));
|
|
108
|
+
return m ? !p.includes(!1) : p.includes(!0);
|
|
95
109
|
}
|
|
96
110
|
return { parseValueSchema: D };
|
|
97
111
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
function
|
|
101
|
-
return
|
|
102
|
-
const
|
|
103
|
-
return Object.assign(D,
|
|
112
|
+
const oe = {}, ie = {};
|
|
113
|
+
ne();
|
|
114
|
+
function re(e, t, l = /* @__PURE__ */ new Map(), n = (u, d, D, r) => d, i = {}, c = (u) => u) {
|
|
115
|
+
return G[t.title] = t, J[t.title] = n, oe[t.title] = i, ie[t.title] = c, (u = {}) => {
|
|
116
|
+
const d = te(u, t, l), D = Object.keys(e).reduce((r, f) => (r[f] = e[f].default, r), {});
|
|
117
|
+
return Object.assign(D, d);
|
|
104
118
|
};
|
|
105
119
|
}
|
|
106
|
-
function
|
|
120
|
+
function se(e, t) {
|
|
107
121
|
return { customClass: t.class, customStyle: t.style };
|
|
108
122
|
}
|
|
109
|
-
function
|
|
123
|
+
function ae(e, t, l) {
|
|
110
124
|
return t;
|
|
111
125
|
}
|
|
112
126
|
const le = /* @__PURE__ */ new Map([
|
|
113
|
-
["appearance",
|
|
114
|
-
]),
|
|
127
|
+
["appearance", se]
|
|
128
|
+
]), ce = "https://json-schema.org/draft/2020-12/schema", ue = "https://farris-design.gitee.io/dropdown.schema.json", de = "dropdown", fe = "A Farris Component", pe = "object", me = {
|
|
115
129
|
id: {
|
|
116
130
|
description: "The unique identifier for dropdown",
|
|
117
131
|
type: "string"
|
|
@@ -173,18 +187,18 @@ const le = /* @__PURE__ */ new Map([
|
|
|
173
187
|
type: "boolean",
|
|
174
188
|
default: !0
|
|
175
189
|
}
|
|
176
|
-
},
|
|
190
|
+
}, ye = [
|
|
177
191
|
"id",
|
|
178
192
|
"type"
|
|
179
|
-
],
|
|
180
|
-
$schema:
|
|
181
|
-
$id:
|
|
182
|
-
title:
|
|
183
|
-
description:
|
|
184
|
-
type:
|
|
185
|
-
properties:
|
|
186
|
-
required:
|
|
187
|
-
},
|
|
193
|
+
], ge = {
|
|
194
|
+
$schema: ce,
|
|
195
|
+
$id: ue,
|
|
196
|
+
title: de,
|
|
197
|
+
description: fe,
|
|
198
|
+
type: pe,
|
|
199
|
+
properties: me,
|
|
200
|
+
required: ye
|
|
201
|
+
}, be = "dropdown", we = "A Farris Component", he = "object", ve = {
|
|
188
202
|
basic: {
|
|
189
203
|
description: "Basic Infomation",
|
|
190
204
|
title: "基本信息",
|
|
@@ -237,12 +251,12 @@ const le = /* @__PURE__ */ new Map([
|
|
|
237
251
|
}
|
|
238
252
|
}
|
|
239
253
|
}
|
|
240
|
-
},
|
|
241
|
-
title:
|
|
242
|
-
description:
|
|
243
|
-
type:
|
|
254
|
+
}, Se = {
|
|
255
|
+
title: be,
|
|
256
|
+
description: we,
|
|
257
|
+
type: he,
|
|
244
258
|
categories: ve
|
|
245
|
-
},
|
|
259
|
+
}, M = {
|
|
246
260
|
/** 默认展开或折叠 */
|
|
247
261
|
show: { type: Boolean, default: !1 },
|
|
248
262
|
/** 下拉按钮是否禁用 */
|
|
@@ -272,15 +286,15 @@ const le = /* @__PURE__ */ new Map([
|
|
|
272
286
|
},
|
|
273
287
|
onSelect: { type: Function, default: () => {
|
|
274
288
|
} }
|
|
275
|
-
},
|
|
276
|
-
function
|
|
277
|
-
let
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
289
|
+
}, _ = re(M, ge, le, ae, Se);
|
|
290
|
+
function U(e, t) {
|
|
291
|
+
let l;
|
|
292
|
+
const n = S(e.show), i = S(), c = S(), u = S(), d = 10;
|
|
293
|
+
X(() => {
|
|
294
|
+
l = c.value;
|
|
281
295
|
});
|
|
282
|
-
const D = (
|
|
283
|
-
const
|
|
296
|
+
const D = (p = 1) => {
|
|
297
|
+
const o = [
|
|
284
298
|
"body>.f-datagrid-settings-simple-host",
|
|
285
299
|
"body>div",
|
|
286
300
|
"body>farris-dialog>.farris-modal.show",
|
|
@@ -290,75 +304,75 @@ function Q(e, t) {
|
|
|
290
304
|
"body>.popover.show",
|
|
291
305
|
"body>filter-row-panel>.f-datagrid-filter-panel",
|
|
292
306
|
"body>.f-section-maximize"
|
|
293
|
-
], B = Array.from(document.body.querySelectorAll(
|
|
294
|
-
const { display:
|
|
295
|
-
return
|
|
296
|
-
}).filter((
|
|
297
|
-
let
|
|
298
|
-
return
|
|
299
|
-
}, r = (
|
|
307
|
+
], B = Array.from(document.body.querySelectorAll(o.join(","))).filter((a) => a).map((a) => {
|
|
308
|
+
const { display: h, zIndex: w } = window.getComputedStyle(a);
|
|
309
|
+
return h === "none" ? 0 : parseInt(w, 10);
|
|
310
|
+
}).filter((a) => a);
|
|
311
|
+
let v = Math.max(...B);
|
|
312
|
+
return v < 1040 && (v = 1040), v + p;
|
|
313
|
+
}, r = (p, o) => {
|
|
300
314
|
const {
|
|
301
315
|
height: B,
|
|
302
|
-
left:
|
|
303
|
-
top:
|
|
304
|
-
width:
|
|
305
|
-
} =
|
|
306
|
-
if (
|
|
307
|
-
const O = window.innerWidth -
|
|
308
|
-
if (
|
|
309
|
-
let
|
|
310
|
-
|
|
316
|
+
left: v,
|
|
317
|
+
top: a,
|
|
318
|
+
width: h
|
|
319
|
+
} = p.getBoundingClientRect(), { width: w, height: k, top: W } = o.getBoundingClientRect();
|
|
320
|
+
if (p.className.indexOf("dropdown-submenu") > -1 || p.closest(".dropdown-submenu") || p.classList.contains("dropright")) {
|
|
321
|
+
const O = window.innerWidth - v - p.offsetWidth, j = window.innerHeight - a, { position: H } = getComputedStyle(o);
|
|
322
|
+
if (H === "fixed") {
|
|
323
|
+
let E = v + p.offsetWidth;
|
|
324
|
+
o.offsetWidth > O && v > O && (E = v - w), o.style.left = E + "px", o.style.right = "auto", window.innerHeight - 2 * d < o.offsetHeight ? (o.style.top = d + "px", o.style.bottom = d + "px", o.style.maxHeight = window.innerHeight - 2 * d + "px", o.style.overflowY = "auto", o.className += " dropdown-menu-maxheight") : j < o.offsetHeight ? (o.style.top = "auto", o.style.bottom = d + "px") : (o.style.top = a + "px", o.style.bottom = "auto");
|
|
311
325
|
} else {
|
|
312
|
-
if (
|
|
313
|
-
const
|
|
314
|
-
|
|
326
|
+
if (o.offsetWidth > O) {
|
|
327
|
+
const E = -w;
|
|
328
|
+
o.style.left = E + "px";
|
|
315
329
|
}
|
|
316
|
-
window.innerHeight - 2 *
|
|
330
|
+
window.innerHeight - 2 * d < o.offsetHeight ? (o.style.top = -1 * (a - d) + "px", o.style.bottom = "auto", o.style.maxHeight = window.innerHeight - 2 * d + "px", o.style.overflowY = "auto", o.className += " dropdown-menu-maxheight") : j < o.offsetHeight && (o.style.top = j - o.offsetHeight - d + "px", o.style.bottom = "auto");
|
|
317
331
|
}
|
|
318
332
|
} else {
|
|
319
|
-
const { marginTop: O, marginBottom: j } = getComputedStyle(
|
|
320
|
-
let
|
|
321
|
-
const
|
|
322
|
-
let
|
|
323
|
-
window.innerHeight -
|
|
324
|
-
!important;top:${
|
|
333
|
+
const { marginTop: O, marginBottom: j } = getComputedStyle(o);
|
|
334
|
+
let H = 0;
|
|
335
|
+
const E = Math.ceil(parseFloat(O)) + Math.ceil(parseFloat(j));
|
|
336
|
+
let R = a + B, q = v;
|
|
337
|
+
window.innerHeight - R - E < k && (R = a - k, R < 0 && (window.innerHeight - a - B > a ? (R = a + B, H = window.innerHeight - R - E - d) : (R = d, H = a - R - E))), window.innerWidth - v < w && window.innerWidth - v < v + h && (q = v - w + h), document.body.append(o), o.style.cssText = `position:fixed;bottom:unset;left:${q}px
|
|
338
|
+
!important;top:${R}px !important;right: unset;${H ? "max-height:" + H + "px;overflow-y:auto;" : ""}`, H && (o.className += " dropdown-menu-maxheight"), o.style.zIndex = D().toString();
|
|
325
339
|
}
|
|
326
|
-
},
|
|
327
|
-
r(i.value,
|
|
340
|
+
}, f = () => {
|
|
341
|
+
r(i.value, c.value);
|
|
328
342
|
}, s = () => {
|
|
329
|
-
e.hover || (
|
|
343
|
+
e.hover || (n.value = !1, document.removeEventListener("click", s), l.removeEventListener("click", s), document.removeEventListener("scroll", s), l.removeEventListener("scroll", s));
|
|
330
344
|
};
|
|
331
345
|
return {
|
|
332
|
-
show:
|
|
346
|
+
show: n,
|
|
333
347
|
dropdownRef: i,
|
|
334
|
-
dropdownMenuRef:
|
|
335
|
-
clickEventRef:
|
|
336
|
-
showDropMenu: (
|
|
337
|
-
e.hover || e.disabled || (
|
|
338
|
-
|
|
339
|
-
}),
|
|
340
|
-
|
|
341
|
-
}),
|
|
342
|
-
|
|
348
|
+
dropdownMenuRef: c,
|
|
349
|
+
clickEventRef: u,
|
|
350
|
+
showDropMenu: (p) => {
|
|
351
|
+
e.hover || e.disabled || (p == null || p.stopPropagation(), n.value || setTimeout(() => {
|
|
352
|
+
f();
|
|
353
|
+
}), n.value = !n.value, document.addEventListener("click", s), document.addEventListener("scroll", s), e.hideOnClick || (l.addEventListener("click", (o) => {
|
|
354
|
+
o.stopPropagation();
|
|
355
|
+
}), l.addEventListener("scroll", (o) => {
|
|
356
|
+
o.stopPropagation();
|
|
343
357
|
})));
|
|
344
358
|
},
|
|
345
|
-
hoverDropdown: (
|
|
346
|
-
e.hover && (
|
|
347
|
-
}),
|
|
359
|
+
hoverDropdown: (p) => {
|
|
360
|
+
e.hover && (n.value || setTimeout(() => {
|
|
361
|
+
}), n.value = !n.value);
|
|
348
362
|
},
|
|
349
363
|
leftButtonClick: () => {
|
|
350
364
|
},
|
|
351
365
|
closeDropMenu: s,
|
|
352
|
-
selectItem: (
|
|
353
|
-
t.emit("select",
|
|
366
|
+
selectItem: (p) => {
|
|
367
|
+
t.emit("select", p);
|
|
354
368
|
},
|
|
355
|
-
resolveSize: (
|
|
356
|
-
const
|
|
357
|
-
return
|
|
369
|
+
resolveSize: (p) => {
|
|
370
|
+
const o = /px|em|rem|pt|%/;
|
|
371
|
+
return o.test(p) ? `${parseInt(p, 10)}${p.match(o)[0]}` : `${p}px`;
|
|
358
372
|
}
|
|
359
373
|
};
|
|
360
374
|
}
|
|
361
|
-
const
|
|
375
|
+
const De = {
|
|
362
376
|
/** 下拉框标签 */
|
|
363
377
|
label: { type: String, default: "XM1" },
|
|
364
378
|
/** 下拉框名称 */
|
|
@@ -369,44 +383,44 @@ const Se = {
|
|
|
369
383
|
divide: { type: Boolean, default: !1 },
|
|
370
384
|
onSelect: { type: Function, default: () => {
|
|
371
385
|
} }
|
|
372
|
-
},
|
|
386
|
+
}, x = /* @__PURE__ */ A({
|
|
373
387
|
name: "FDropdownItem",
|
|
374
|
-
props:
|
|
388
|
+
props: De,
|
|
375
389
|
emits: ["select"],
|
|
376
390
|
setup(e, t) {
|
|
377
|
-
const
|
|
391
|
+
const l = S(e.value), n = S(e.label), i = S(e.disabled), c = S(e.active), u = S(e.divide), d = () => {
|
|
378
392
|
i.value || t.emit("select", e);
|
|
379
393
|
};
|
|
380
394
|
return () => y("div", null, [L(y("div", {
|
|
381
395
|
class: "dropdown-divider"
|
|
382
|
-
}, null), [[N,
|
|
383
|
-
class: `dropdown-item${
|
|
384
|
-
onClick:
|
|
385
|
-
title:
|
|
386
|
-
}, [
|
|
396
|
+
}, null), [[N, u.value]]), y("li", {
|
|
397
|
+
class: `dropdown-item${c.value ? " active" : ""} ${i.value ? " disabled" : ""}`,
|
|
398
|
+
onClick: d,
|
|
399
|
+
title: l.value.toString()
|
|
400
|
+
}, [n.value])]);
|
|
387
401
|
}
|
|
388
|
-
}), z = /* @__PURE__ */
|
|
402
|
+
}), z = /* @__PURE__ */ A({
|
|
389
403
|
name: "FDropdown",
|
|
390
|
-
props:
|
|
404
|
+
props: M,
|
|
391
405
|
emits: ["select"],
|
|
392
406
|
setup(e, t) {
|
|
393
|
-
const
|
|
394
|
-
show:
|
|
407
|
+
const l = S(e.model), {
|
|
408
|
+
show: n,
|
|
395
409
|
dropdownMenuRef: i,
|
|
396
|
-
dropdownRef:
|
|
397
|
-
clickEventRef:
|
|
398
|
-
showDropMenu:
|
|
410
|
+
dropdownRef: c,
|
|
411
|
+
clickEventRef: u,
|
|
412
|
+
showDropMenu: d,
|
|
399
413
|
hoverDropdown: D,
|
|
400
414
|
leftButtonClick: r,
|
|
401
|
-
closeDropMenu:
|
|
415
|
+
closeDropMenu: f,
|
|
402
416
|
selectItem: s,
|
|
403
|
-
resolveSize:
|
|
404
|
-
} =
|
|
417
|
+
resolveSize: m
|
|
418
|
+
} = U(e, t);
|
|
405
419
|
function b(g) {
|
|
406
420
|
t.emit("select", g);
|
|
407
421
|
}
|
|
408
422
|
return () => y("div", {
|
|
409
|
-
ref:
|
|
423
|
+
ref: c
|
|
410
424
|
}, [y("div", {
|
|
411
425
|
class: ["farris-dropdown", "btn-group", {
|
|
412
426
|
dropup: e.position === "top"
|
|
@@ -438,7 +452,7 @@ const Se = {
|
|
|
438
452
|
style: "width:100%",
|
|
439
453
|
onClick: r
|
|
440
454
|
}, [e.title]), y("span", {
|
|
441
|
-
ref:
|
|
455
|
+
ref: u,
|
|
442
456
|
class: ["dropdown-toggle", {
|
|
443
457
|
btn: !e.nest
|
|
444
458
|
}, {
|
|
@@ -467,43 +481,43 @@ const Se = {
|
|
|
467
481
|
disabled: e.disabled
|
|
468
482
|
}],
|
|
469
483
|
style: "width:100%",
|
|
470
|
-
onClick:
|
|
484
|
+
onClick: d,
|
|
471
485
|
onMouseenter: D,
|
|
472
486
|
onMouseleave: D
|
|
473
487
|
}, [L(y("span", {
|
|
474
488
|
class: "sr-only"
|
|
475
489
|
}, null), [[N, e.splitButton]]), e.splitButton ? "" : e.title, L(y("span", {
|
|
476
490
|
class: `f-icon ${e.iconClass.toString()}`
|
|
477
|
-
}, null), [[N, e.iconClass]])]), y(
|
|
491
|
+
}, null), [[N, e.iconClass]])]), y(C, {
|
|
478
492
|
to: "body"
|
|
479
493
|
}, {
|
|
480
494
|
default: () => [y("div", {
|
|
481
495
|
ref: i,
|
|
482
|
-
class: `dropdown-menu${
|
|
483
|
-
}, [y(Y, null, [
|
|
496
|
+
class: `dropdown-menu${n.value ? " show" : ""}`
|
|
497
|
+
}, [y(Y, null, [l.value.map(({
|
|
484
498
|
label: g,
|
|
485
|
-
value:
|
|
486
|
-
disabled:
|
|
487
|
-
active:
|
|
488
|
-
divide:
|
|
489
|
-
}) => y(
|
|
490
|
-
value:
|
|
499
|
+
value: $,
|
|
500
|
+
disabled: T,
|
|
501
|
+
active: p,
|
|
502
|
+
divide: o
|
|
503
|
+
}) => y(x, {
|
|
504
|
+
value: $.toString(),
|
|
491
505
|
label: g,
|
|
492
|
-
disabled:
|
|
493
|
-
active:
|
|
494
|
-
divide:
|
|
506
|
+
disabled: T,
|
|
507
|
+
active: p,
|
|
508
|
+
divide: o,
|
|
495
509
|
onSelect: (B) => b(B)
|
|
496
510
|
}, null))])])]
|
|
497
511
|
})])]);
|
|
498
512
|
}
|
|
499
513
|
});
|
|
500
|
-
function
|
|
501
|
-
var
|
|
502
|
-
const
|
|
503
|
-
function
|
|
514
|
+
function Be(e, t, l) {
|
|
515
|
+
var v;
|
|
516
|
+
const n = "", i = "", c = S();
|
|
517
|
+
function u() {
|
|
504
518
|
return (t == null ? void 0 : t.schema.componentType) !== "frame";
|
|
505
519
|
}
|
|
506
|
-
function
|
|
520
|
+
function d() {
|
|
507
521
|
return !1;
|
|
508
522
|
}
|
|
509
523
|
function D() {
|
|
@@ -512,91 +526,91 @@ function De(e, t, a) {
|
|
|
512
526
|
function r() {
|
|
513
527
|
return (t == null ? void 0 : t.schema.componentType) === "frame";
|
|
514
528
|
}
|
|
515
|
-
function
|
|
516
|
-
if (!
|
|
529
|
+
function f(a) {
|
|
530
|
+
if (!a || !a.value)
|
|
517
531
|
return null;
|
|
518
|
-
if (
|
|
519
|
-
return
|
|
520
|
-
const
|
|
532
|
+
if (a.value.schema && a.value.schema.type === "component")
|
|
533
|
+
return a.value;
|
|
534
|
+
const h = S(a == null ? void 0 : a.value.parent), w = f(h);
|
|
521
535
|
return w || null;
|
|
522
536
|
}
|
|
523
|
-
function s(
|
|
524
|
-
const { componentInstance:
|
|
525
|
-
return !
|
|
537
|
+
function s(a = t) {
|
|
538
|
+
const { componentInstance: h, designerItemElementRef: w } = a;
|
|
539
|
+
return !h || !h.value ? null : h.value.canMove ? w : s(a.parent);
|
|
526
540
|
}
|
|
527
|
-
function
|
|
528
|
-
return !!
|
|
541
|
+
function m(a) {
|
|
542
|
+
return !!l;
|
|
529
543
|
}
|
|
530
544
|
function b() {
|
|
531
545
|
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
532
546
|
}
|
|
533
547
|
function g() {
|
|
534
548
|
}
|
|
535
|
-
function
|
|
549
|
+
function $(a, h) {
|
|
536
550
|
}
|
|
537
|
-
function
|
|
538
|
-
const { componentType: w } =
|
|
539
|
-
let k =
|
|
540
|
-
const
|
|
541
|
-
return k && !k.id && k.type === w && (k.id = `${
|
|
551
|
+
function T(a, h) {
|
|
552
|
+
const { componentType: w } = a;
|
|
553
|
+
let k = Q(w, a, h);
|
|
554
|
+
const W = w.toLowerCase().replace(/-/g, "_");
|
|
555
|
+
return k && !k.id && k.type === w && (k.id = `${W}_${Math.random().toString().slice(2, 6)}`), k;
|
|
542
556
|
}
|
|
543
|
-
function
|
|
557
|
+
function p(a) {
|
|
544
558
|
}
|
|
545
|
-
function
|
|
559
|
+
function o(...a) {
|
|
546
560
|
}
|
|
547
561
|
function B() {
|
|
548
|
-
t != null && t.schema.contents && t.schema.contents.map((
|
|
562
|
+
t != null && t.schema.contents && t.schema.contents.map((a) => {
|
|
549
563
|
var k;
|
|
550
|
-
let
|
|
551
|
-
|
|
552
|
-
const w = e.value.querySelector(`#${
|
|
564
|
+
let h = a.id;
|
|
565
|
+
a.type === "component-ref" && (h = a.component);
|
|
566
|
+
const w = e.value.querySelector(`#${h}-design-item`);
|
|
553
567
|
(k = w == null ? void 0 : w.componentInstance) != null && k.value.onRemoveComponent && w.componentInstance.value.onRemoveComponent();
|
|
554
568
|
});
|
|
555
569
|
}
|
|
556
|
-
return
|
|
557
|
-
canMove:
|
|
558
|
-
canSelectParent:
|
|
570
|
+
return c.value = {
|
|
571
|
+
canMove: u(),
|
|
572
|
+
canSelectParent: d(),
|
|
559
573
|
canDelete: D(),
|
|
560
574
|
canNested: !r(),
|
|
561
575
|
contents: t == null ? void 0 : t.schema.contents,
|
|
562
576
|
elementRef: e,
|
|
563
|
-
parent: (
|
|
577
|
+
parent: (v = t == null ? void 0 : t.parent) == null ? void 0 : v.componentInstance,
|
|
564
578
|
schema: t == null ? void 0 : t.schema,
|
|
565
|
-
styles:
|
|
579
|
+
styles: n,
|
|
566
580
|
designerClass: i,
|
|
567
|
-
canAccepts:
|
|
568
|
-
getBelongedComponentInstance:
|
|
581
|
+
canAccepts: m,
|
|
582
|
+
getBelongedComponentInstance: f,
|
|
569
583
|
getDraggableDesignItemElement: s,
|
|
570
584
|
getDraggingDisplayText: b,
|
|
571
|
-
getPropConfig:
|
|
585
|
+
getPropConfig: o,
|
|
572
586
|
getDragScopeElement: g,
|
|
573
|
-
onAcceptMovedChildElement:
|
|
574
|
-
onChildElementMovedOut:
|
|
575
|
-
addNewChildComponentSchema:
|
|
587
|
+
onAcceptMovedChildElement: $,
|
|
588
|
+
onChildElementMovedOut: p,
|
|
589
|
+
addNewChildComponentSchema: T,
|
|
576
590
|
triggerBelongedComponentToMoveWhenMoved: S(!1),
|
|
577
591
|
triggerBelongedComponentToDeleteWhenDeleted: S(!1),
|
|
578
592
|
onRemoveComponent: B
|
|
579
|
-
},
|
|
593
|
+
}, c;
|
|
580
594
|
}
|
|
581
|
-
const
|
|
595
|
+
const ke = /* @__PURE__ */ A({
|
|
582
596
|
name: "FDropdownDesign",
|
|
583
|
-
props:
|
|
597
|
+
props: M,
|
|
584
598
|
emits: ["select"],
|
|
585
599
|
setup(e, t) {
|
|
586
|
-
const
|
|
587
|
-
show:
|
|
600
|
+
const l = S(e.model), {
|
|
601
|
+
show: n,
|
|
588
602
|
showDropMenu: i,
|
|
589
|
-
hoverDropdown:
|
|
590
|
-
leftButtonClick:
|
|
591
|
-
closeDropMenu:
|
|
603
|
+
hoverDropdown: c,
|
|
604
|
+
leftButtonClick: u,
|
|
605
|
+
closeDropMenu: d,
|
|
592
606
|
selectItem: D,
|
|
593
607
|
resolveSize: r
|
|
594
|
-
} =
|
|
595
|
-
function
|
|
608
|
+
} = U(e, t);
|
|
609
|
+
function f(g) {
|
|
596
610
|
t.emit("select", g);
|
|
597
611
|
}
|
|
598
|
-
const s = S(),
|
|
599
|
-
return
|
|
612
|
+
const s = S(), m = P("design-item-context"), b = Be(s, m);
|
|
613
|
+
return X(() => {
|
|
600
614
|
s.value.componentInstance = b;
|
|
601
615
|
}), t.expose(b.value), () => y("div", {
|
|
602
616
|
ref: s
|
|
@@ -632,7 +646,7 @@ const Be = /* @__PURE__ */ F({
|
|
|
632
646
|
"btn-info": e.type === "info"
|
|
633
647
|
}],
|
|
634
648
|
style: "width:100%",
|
|
635
|
-
onClick:
|
|
649
|
+
onClick: u
|
|
636
650
|
}, [e.title]), y("span", {
|
|
637
651
|
class: ["dropdown-toggle", {
|
|
638
652
|
btn: !e.nest
|
|
@@ -663,43 +677,43 @@ const Be = /* @__PURE__ */ F({
|
|
|
663
677
|
}],
|
|
664
678
|
style: "width:100%",
|
|
665
679
|
onClick: i,
|
|
666
|
-
onMouseenter:
|
|
667
|
-
onMouseleave:
|
|
680
|
+
onMouseenter: c,
|
|
681
|
+
onMouseleave: c
|
|
668
682
|
}, [L(y("span", {
|
|
669
683
|
class: "sr-only"
|
|
670
684
|
}, null), [[N, e.splitButton]]), e.splitButton ? "" : e.title, L(y("span", {
|
|
671
685
|
class: `f-icon ${e.iconClass.toString()}`
|
|
672
686
|
}, null), [[N, e.iconClass]])]), y("div", {
|
|
673
|
-
class: `dropdown-menu${
|
|
674
|
-
}, [y(Y, null, [
|
|
687
|
+
class: `dropdown-menu${n.value ? " show" : ""}`
|
|
688
|
+
}, [y(Y, null, [l.value.map(({
|
|
675
689
|
label: g,
|
|
676
|
-
value:
|
|
677
|
-
disabled:
|
|
678
|
-
active:
|
|
679
|
-
divide:
|
|
680
|
-
}) => y(
|
|
681
|
-
value:
|
|
690
|
+
value: $,
|
|
691
|
+
disabled: T,
|
|
692
|
+
active: p,
|
|
693
|
+
divide: o
|
|
694
|
+
}) => y(x, {
|
|
695
|
+
value: $.toString(),
|
|
682
696
|
label: g,
|
|
683
|
-
disabled:
|
|
684
|
-
active:
|
|
685
|
-
divide:
|
|
686
|
-
onSelect: (B) =>
|
|
697
|
+
disabled: T,
|
|
698
|
+
active: p,
|
|
699
|
+
divide: o,
|
|
700
|
+
onSelect: (B) => f(B)
|
|
687
701
|
}, null))])])])]);
|
|
688
702
|
}
|
|
689
703
|
}), Te = {
|
|
690
704
|
install(e) {
|
|
691
705
|
e.component(z.name, z);
|
|
692
706
|
},
|
|
693
|
-
register(e, t,
|
|
694
|
-
e.dropdown = z, t.dropdown =
|
|
707
|
+
register(e, t, l, n) {
|
|
708
|
+
e.dropdown = z, t.dropdown = _;
|
|
695
709
|
},
|
|
696
|
-
registerDesigner(e, t,
|
|
697
|
-
e.dropdown =
|
|
710
|
+
registerDesigner(e, t, l) {
|
|
711
|
+
e.dropdown = ke, t.dropdown = _;
|
|
698
712
|
}
|
|
699
713
|
};
|
|
700
714
|
export {
|
|
701
715
|
z as Dropdown,
|
|
702
716
|
Te as default,
|
|
703
|
-
|
|
704
|
-
|
|
717
|
+
M as dropdownProps,
|
|
718
|
+
_ as propsResolver
|
|
705
719
|
};
|