@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,102 +1,116 @@
|
|
|
1
|
-
import { ref as z, computed as
|
|
2
|
-
import { isPlainObject as
|
|
1
|
+
import { ref as z, computed as k, defineComponent as $, provide as V, createVNode as S, watch as ne, inject as D, onMounted as W } from "vue";
|
|
2
|
+
import { isPlainObject as q, cloneDeep as _ } from "lodash-es";
|
|
3
3
|
import "bignumber.js";
|
|
4
4
|
const G = {}, Y = {};
|
|
5
5
|
function L(t) {
|
|
6
|
-
const { properties: e, title: n, ignore: o } = t,
|
|
7
|
-
if (n && (!
|
|
8
|
-
const
|
|
9
|
-
l.id = `${
|
|
6
|
+
const { properties: e, title: n, ignore: o } = t, i = o && Array.isArray(o), l = Object.keys(e).reduce((s, v) => ((!i || !o.find((P) => P === v)) && (s[v] = e[v].type === "object" && e[v].properties ? L(e[v]) : _(e[v].default)), s), {});
|
|
7
|
+
if (n && (!i || !o.find((s) => s === "id"))) {
|
|
8
|
+
const s = n.toLowerCase().replace(/-/g, "_");
|
|
9
|
+
l.id = `${s}_${Math.random().toString().slice(2, 6)}`;
|
|
10
10
|
}
|
|
11
11
|
return l;
|
|
12
12
|
}
|
|
13
|
+
function oe(t) {
|
|
14
|
+
const { properties: e, title: n, required: o } = t;
|
|
15
|
+
if (o && Array.isArray(o)) {
|
|
16
|
+
const i = o.reduce((l, s) => (l[s] = e[s].type === "object" && e[s].properties ? L(e[s]) : _(e[s].default), l), {});
|
|
17
|
+
if (n && o.find((l) => l === "id")) {
|
|
18
|
+
const l = n.toLowerCase().replace(/-/g, "_");
|
|
19
|
+
i.id = `${l}_${Math.random().toString().slice(2, 6)}`;
|
|
20
|
+
}
|
|
21
|
+
return i;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
type: n
|
|
25
|
+
};
|
|
26
|
+
}
|
|
13
27
|
function X(t, e = {}, n) {
|
|
14
28
|
const o = G[t];
|
|
15
29
|
if (o) {
|
|
16
|
-
let
|
|
30
|
+
let i = oe(o);
|
|
17
31
|
const l = Y[t];
|
|
18
|
-
return
|
|
32
|
+
return i = l ? l({ getSchemaByType: X }, i, e, n) : i, i;
|
|
19
33
|
}
|
|
20
34
|
return null;
|
|
21
35
|
}
|
|
22
|
-
function
|
|
36
|
+
function ae(t, e) {
|
|
23
37
|
const n = L(e);
|
|
24
|
-
return Object.keys(n).reduce((o,
|
|
38
|
+
return Object.keys(n).reduce((o, i) => (Object.prototype.hasOwnProperty.call(t, i) && (o[i] && q(o[i]) && q(t[i] || !t[i]) ? Object.assign(o[i], t[i] || {}) : o[i] = t[i]), o), n), n;
|
|
25
39
|
}
|
|
26
|
-
function
|
|
27
|
-
return Object.keys(t).filter((o) => t[o] != null).reduce((o,
|
|
28
|
-
if (e.has(
|
|
29
|
-
const l = e.get(
|
|
40
|
+
function ie(t, e) {
|
|
41
|
+
return Object.keys(t).filter((o) => t[o] != null).reduce((o, i) => {
|
|
42
|
+
if (e.has(i)) {
|
|
43
|
+
const l = e.get(i);
|
|
30
44
|
if (typeof l == "string")
|
|
31
|
-
o[l] = t[
|
|
45
|
+
o[l] = t[i];
|
|
32
46
|
else {
|
|
33
|
-
const
|
|
34
|
-
Object.assign(o,
|
|
47
|
+
const s = l(i, t[i], t);
|
|
48
|
+
Object.assign(o, s);
|
|
35
49
|
}
|
|
36
50
|
} else
|
|
37
|
-
o[
|
|
51
|
+
o[i] = t[i];
|
|
38
52
|
return o;
|
|
39
53
|
}, {});
|
|
40
54
|
}
|
|
41
|
-
function
|
|
42
|
-
const o =
|
|
43
|
-
return
|
|
55
|
+
function re(t, e, n = /* @__PURE__ */ new Map()) {
|
|
56
|
+
const o = ae(t, e);
|
|
57
|
+
return ie(o, n);
|
|
44
58
|
}
|
|
45
|
-
function
|
|
46
|
-
function e(
|
|
47
|
-
if (typeof
|
|
48
|
-
return b[
|
|
49
|
-
if (typeof
|
|
50
|
-
const C = Object.keys(
|
|
59
|
+
function le(t = {}) {
|
|
60
|
+
function e(r, f, u, b) {
|
|
61
|
+
if (typeof u == "number")
|
|
62
|
+
return b[r].length === u;
|
|
63
|
+
if (typeof u == "object") {
|
|
64
|
+
const C = Object.keys(u)[0], O = u[C];
|
|
51
65
|
if (C === "not")
|
|
52
|
-
return Number(b[
|
|
66
|
+
return Number(b[r].length) !== Number(O);
|
|
53
67
|
if (C === "moreThan")
|
|
54
|
-
return Number(b[
|
|
68
|
+
return Number(b[r].length) >= Number(O);
|
|
55
69
|
if (C === "lessThan")
|
|
56
|
-
return Number(b[
|
|
70
|
+
return Number(b[r].length) <= Number(O);
|
|
57
71
|
}
|
|
58
72
|
return !1;
|
|
59
73
|
}
|
|
60
|
-
function n(
|
|
61
|
-
return b[
|
|
74
|
+
function n(r, f, u, b) {
|
|
75
|
+
return b[r] && b[r].propertyValue && String(b[r].propertyValue.value) === String(u);
|
|
62
76
|
}
|
|
63
77
|
const o = /* @__PURE__ */ new Map([
|
|
64
78
|
["length", e],
|
|
65
79
|
["getProperty", n]
|
|
66
80
|
]);
|
|
67
|
-
Object.keys(t).reduce((
|
|
68
|
-
function r
|
|
69
|
-
const
|
|
70
|
-
return typeof f == "number" ? [{ target:
|
|
81
|
+
Object.keys(t).reduce((r, f) => (r.set(f, t[f]), r), o);
|
|
82
|
+
function i(r, f) {
|
|
83
|
+
const u = r;
|
|
84
|
+
return typeof f == "number" ? [{ target: u, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: u, operator: "getProperty", param: r, value: !!f }] : typeof f == "object" ? Object.keys(f).map((b) => {
|
|
71
85
|
if (b === "length")
|
|
72
|
-
return { target:
|
|
86
|
+
return { target: u, operator: "length", param: null, value: f[b] };
|
|
73
87
|
const C = b, O = f[b];
|
|
74
|
-
return { target:
|
|
88
|
+
return { target: u, operator: "getProperty", param: C, value: O };
|
|
75
89
|
}) : [];
|
|
76
90
|
}
|
|
77
|
-
function l(
|
|
78
|
-
return Object.keys(
|
|
79
|
-
const C =
|
|
80
|
-
return
|
|
91
|
+
function l(r) {
|
|
92
|
+
return Object.keys(r).reduce((u, b) => {
|
|
93
|
+
const C = i(b, r[b]);
|
|
94
|
+
return u.push(...C), u;
|
|
81
95
|
}, []);
|
|
82
96
|
}
|
|
83
|
-
function
|
|
84
|
-
if (o.has(
|
|
85
|
-
const
|
|
86
|
-
return
|
|
97
|
+
function s(r, f) {
|
|
98
|
+
if (o.has(r.operator)) {
|
|
99
|
+
const u = o.get(r.operator);
|
|
100
|
+
return u && u(r.target, r.param, r.value, f) || !1;
|
|
87
101
|
}
|
|
88
102
|
return !1;
|
|
89
103
|
}
|
|
90
|
-
function v(
|
|
91
|
-
return l(
|
|
104
|
+
function v(r, f) {
|
|
105
|
+
return l(r).reduce((C, O) => C && s(O, f), !0);
|
|
92
106
|
}
|
|
93
|
-
function P(
|
|
94
|
-
const
|
|
107
|
+
function P(r, f) {
|
|
108
|
+
const u = Object.keys(r), b = u.includes("allOf"), C = u.includes("anyOf"), O = b || C, p = (O ? r[O ? b ? "allOf" : "anyOf" : "allOf"] : [r]).map((d) => v(d, f));
|
|
95
109
|
return b ? !p.includes(!1) : p.includes(!0);
|
|
96
110
|
}
|
|
97
111
|
return { parseValueSchema: P };
|
|
98
112
|
}
|
|
99
|
-
const
|
|
113
|
+
const j = {
|
|
100
114
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
101
115
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
102
116
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -136,24 +150,24 @@ const H = {
|
|
|
136
150
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
137
151
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
138
152
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
function
|
|
142
|
-
return G[e.title] = e, Y[e.title] = o,
|
|
143
|
-
const v =
|
|
153
|
+
}, se = {}, ce = {};
|
|
154
|
+
le();
|
|
155
|
+
function U(t, e, n = /* @__PURE__ */ new Map(), o = (s, v, P, r) => v, i = {}, l = (s) => s) {
|
|
156
|
+
return G[e.title] = e, Y[e.title] = o, se[e.title] = i, ce[e.title] = l, (s = {}) => {
|
|
157
|
+
const v = re(s, e, n), P = Object.keys(t).reduce((r, f) => (r[f] = t[f].default, r), {});
|
|
144
158
|
return Object.assign(P, v);
|
|
145
159
|
};
|
|
146
160
|
}
|
|
147
|
-
function
|
|
161
|
+
function ue(t, e) {
|
|
148
162
|
return { customClass: e.class, customStyle: e.style };
|
|
149
163
|
}
|
|
150
|
-
const
|
|
151
|
-
["appearance",
|
|
164
|
+
const Q = /* @__PURE__ */ new Map([
|
|
165
|
+
["appearance", ue]
|
|
152
166
|
]);
|
|
153
|
-
function
|
|
167
|
+
function J(t, e, n) {
|
|
154
168
|
return e;
|
|
155
169
|
}
|
|
156
|
-
const
|
|
170
|
+
const pe = "https://json-schema.org/draft/2020-12/schema", fe = "https://farris-design.gitee.io/layout.schema.json", ye = "layout", me = "A Farris Container Component", de = "object", he = {
|
|
157
171
|
id: {
|
|
158
172
|
description: "The unique identifier for layout component",
|
|
159
173
|
type: "string"
|
|
@@ -196,19 +210,19 @@ const ue = "https://json-schema.org/draft/2020-12/schema", pe = "https://farris-
|
|
|
196
210
|
type: "boolean",
|
|
197
211
|
default: !0
|
|
198
212
|
}
|
|
199
|
-
},
|
|
213
|
+
}, ve = [
|
|
200
214
|
"id",
|
|
201
215
|
"type",
|
|
202
216
|
"contents"
|
|
203
|
-
],
|
|
204
|
-
$schema:
|
|
205
|
-
$id:
|
|
206
|
-
title:
|
|
207
|
-
description:
|
|
208
|
-
type:
|
|
209
|
-
properties:
|
|
210
|
-
required:
|
|
211
|
-
},
|
|
217
|
+
], be = {
|
|
218
|
+
$schema: pe,
|
|
219
|
+
$id: fe,
|
|
220
|
+
title: ye,
|
|
221
|
+
description: me,
|
|
222
|
+
type: de,
|
|
223
|
+
properties: he,
|
|
224
|
+
required: ve
|
|
225
|
+
}, ge = "layout", ze = "A Farris Component", Pe = "object", we = {
|
|
212
226
|
basic: {
|
|
213
227
|
description: "Basic Infomation",
|
|
214
228
|
title: "基本信息",
|
|
@@ -243,41 +257,41 @@ const ue = "https://json-schema.org/draft/2020-12/schema", pe = "https://farris-
|
|
|
243
257
|
}
|
|
244
258
|
}
|
|
245
259
|
}
|
|
246
|
-
},
|
|
247
|
-
title:
|
|
248
|
-
description:
|
|
249
|
-
type:
|
|
250
|
-
categories:
|
|
260
|
+
}, Ce = {
|
|
261
|
+
title: ge,
|
|
262
|
+
description: ze,
|
|
263
|
+
type: Pe,
|
|
264
|
+
categories: we
|
|
251
265
|
}, F = {
|
|
252
266
|
customStyle: { type: String, defaut: "" },
|
|
253
267
|
customClass: { type: String, defaut: "" }
|
|
254
|
-
},
|
|
255
|
-
function
|
|
256
|
-
const e = z(-1), n = z(-1), o = z(0),
|
|
268
|
+
}, Z = U(F, be, Q, J, Ce);
|
|
269
|
+
function x(t) {
|
|
270
|
+
const e = z(-1), n = z(-1), o = z(0), i = z(0), l = z(!1), s = z(!1), v = k(() => ({
|
|
257
271
|
display: l.value ? "block" : "none",
|
|
258
272
|
left: `${o.value}px`,
|
|
259
273
|
cursor: "e-resize"
|
|
260
|
-
})), P =
|
|
261
|
-
display:
|
|
262
|
-
top: `${
|
|
274
|
+
})), P = k(() => ({
|
|
275
|
+
display: s.value ? "block" : "none",
|
|
276
|
+
top: `${i.value}px`,
|
|
263
277
|
cursor: "n-resize"
|
|
264
|
-
})),
|
|
265
|
-
display:
|
|
278
|
+
})), r = k(() => ({
|
|
279
|
+
display: s.value || l.value ? "block" : "none"
|
|
266
280
|
}));
|
|
267
281
|
function f(h, p, m, d) {
|
|
268
282
|
const R = t.value;
|
|
269
283
|
if (R) {
|
|
270
|
-
const { left: a, right:
|
|
284
|
+
const { left: a, right: c, width: g } = R.getBoundingClientRect();
|
|
271
285
|
let y = h.clientX - a;
|
|
272
|
-
d === "right" && (y =
|
|
286
|
+
d === "right" && (y = c - h.clientX), y > p && (y = p), y < m && (y = m), d === "right" && (y = g - y), o.value = y;
|
|
273
287
|
}
|
|
274
288
|
}
|
|
275
|
-
function
|
|
289
|
+
function u(h, p, m, d) {
|
|
276
290
|
const R = t.value;
|
|
277
291
|
if (R) {
|
|
278
|
-
const { top: a, bottom:
|
|
292
|
+
const { top: a, bottom: c, height: g } = R.getBoundingClientRect();
|
|
279
293
|
let y = h.clientY - a;
|
|
280
|
-
d === "bottom" && (y =
|
|
294
|
+
d === "bottom" && (y = c - h.clientY), y > p && (y = p), y < m && (y = m), d === "bottom" && (y = g - y), i.value = y;
|
|
281
295
|
}
|
|
282
296
|
}
|
|
283
297
|
function b() {
|
|
@@ -318,82 +332,82 @@ function Z(t) {
|
|
|
318
332
|
return {
|
|
319
333
|
horizontalResizeHandleStyle: v,
|
|
320
334
|
verticalResizeHandleStyle: P,
|
|
321
|
-
resizeOverlayStyle:
|
|
335
|
+
resizeOverlayStyle: r,
|
|
322
336
|
showHorizontalResizeHandle: l,
|
|
323
|
-
showVerticalResizeHandle:
|
|
337
|
+
showVerticalResizeHandle: s,
|
|
324
338
|
horizontalResizeBarPosition: e,
|
|
325
339
|
verticalResizeBarPosition: n,
|
|
326
|
-
verticalResizeHandleOffset:
|
|
340
|
+
verticalResizeHandleOffset: i,
|
|
327
341
|
horizontalResizeHandleOffset: o,
|
|
328
342
|
draggingHorizontalResizeHandle: f,
|
|
329
|
-
draggingVerticalResizeHandle:
|
|
343
|
+
draggingVerticalResizeHandle: u,
|
|
330
344
|
getPanelMaxHeight: w,
|
|
331
345
|
getPanelMaxWidth: O
|
|
332
346
|
};
|
|
333
347
|
}
|
|
334
|
-
const
|
|
335
|
-
function
|
|
348
|
+
const Be = ["moz", "ms", "webkit"];
|
|
349
|
+
function Re() {
|
|
336
350
|
let t = 0;
|
|
337
351
|
return (e) => {
|
|
338
|
-
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - t)),
|
|
352
|
+
const n = (/* @__PURE__ */ new Date()).getTime(), o = Math.max(0, 16 - (n - t)), i = setTimeout(() => {
|
|
339
353
|
e(n + o);
|
|
340
354
|
}, o);
|
|
341
|
-
return t = n + o,
|
|
355
|
+
return t = n + o, i;
|
|
342
356
|
};
|
|
343
357
|
}
|
|
344
|
-
function
|
|
358
|
+
function Oe() {
|
|
345
359
|
if (typeof window > "u")
|
|
346
360
|
return () => 0;
|
|
347
361
|
if (window.requestAnimationFrame)
|
|
348
362
|
return window.requestAnimationFrame.bind(window);
|
|
349
|
-
const t =
|
|
350
|
-
return t ? window[`${t}RequestAnimationFrame`] :
|
|
351
|
-
}
|
|
352
|
-
Re();
|
|
353
|
-
function Oe(t, e) {
|
|
354
|
-
return ((e == null ? void 0 : e.split(" ")) || []).reduce((o, r) => (r && (o[r] = !0), o), t), t;
|
|
363
|
+
const t = Be.filter((e) => `${e}RequestAnimationFrame` in window)[0];
|
|
364
|
+
return t ? window[`${t}RequestAnimationFrame`] : Re();
|
|
355
365
|
}
|
|
366
|
+
Oe();
|
|
356
367
|
function Se(t, e) {
|
|
357
|
-
return ((e == null ? void 0 : e.split("
|
|
358
|
-
|
|
359
|
-
|
|
368
|
+
return ((e == null ? void 0 : e.split(" ")) || []).reduce((o, i) => (i && (o[i] = !0), o), t), t;
|
|
369
|
+
}
|
|
370
|
+
function Me(t, e) {
|
|
371
|
+
return ((e == null ? void 0 : e.split(";")) || []).reduce((o, i) => {
|
|
372
|
+
if (i) {
|
|
373
|
+
const l = i.split(":");
|
|
360
374
|
o[l[0]] = l[1];
|
|
361
375
|
}
|
|
362
376
|
return o;
|
|
363
377
|
}, t), t;
|
|
364
378
|
}
|
|
365
|
-
const
|
|
379
|
+
const H = /* @__PURE__ */ $({
|
|
366
380
|
name: "FLayout",
|
|
367
381
|
props: F,
|
|
368
382
|
emits: [],
|
|
369
383
|
setup(t, e) {
|
|
370
|
-
const n = z(), o =
|
|
371
|
-
horizontalResizeHandleStyle:
|
|
384
|
+
const n = z(), o = x(n), {
|
|
385
|
+
horizontalResizeHandleStyle: i,
|
|
372
386
|
verticalResizeHandleStyle: l,
|
|
373
|
-
resizeOverlayStyle:
|
|
387
|
+
resizeOverlayStyle: s
|
|
374
388
|
} = o;
|
|
375
|
-
|
|
389
|
+
V("layout", {
|
|
376
390
|
useResizeHandleComposition: o
|
|
377
391
|
});
|
|
378
|
-
const v =
|
|
392
|
+
const v = k(() => Se({
|
|
379
393
|
"f-layout": !0
|
|
380
|
-
}, t == null ? void 0 : t.customClass)), P =
|
|
394
|
+
}, t == null ? void 0 : t.customClass)), P = k(() => Me({}, t == null ? void 0 : t.customStyle));
|
|
381
395
|
return () => S("div", {
|
|
382
396
|
class: v.value,
|
|
383
397
|
style: P.value,
|
|
384
398
|
ref: n
|
|
385
399
|
}, [e.slots.default && e.slots.default(), S("div", {
|
|
386
400
|
class: "f-layout-resize-overlay",
|
|
387
|
-
style:
|
|
401
|
+
style: s.value
|
|
388
402
|
}, null), S("div", {
|
|
389
403
|
class: "f-layout-horizontal-resize-proxy",
|
|
390
|
-
style:
|
|
404
|
+
style: i.value
|
|
391
405
|
}, null), S("div", {
|
|
392
406
|
class: "f-layout-vertical-resize-proxy",
|
|
393
407
|
style: l.value
|
|
394
408
|
}, null)]);
|
|
395
409
|
}
|
|
396
|
-
}), ke = "https://json-schema.org/draft/2020-12/schema",
|
|
410
|
+
}), ke = "https://json-schema.org/draft/2020-12/schema", Te = "https://farris-design.gitee.io/layout-pane.schema.json", je = "layout-pane", He = "A Farris Container Component", De = "object", $e = {
|
|
397
411
|
id: {
|
|
398
412
|
description: "The unique identifier for a layout pane",
|
|
399
413
|
type: "string"
|
|
@@ -456,14 +470,19 @@ const j = /* @__PURE__ */ E({
|
|
|
456
470
|
type: "number",
|
|
457
471
|
default: !0
|
|
458
472
|
}
|
|
459
|
-
},
|
|
473
|
+
}, Ae = [
|
|
474
|
+
"id",
|
|
475
|
+
"type",
|
|
476
|
+
"contents"
|
|
477
|
+
], Ee = {
|
|
460
478
|
$schema: ke,
|
|
461
|
-
$id:
|
|
462
|
-
title:
|
|
479
|
+
$id: Te,
|
|
480
|
+
title: je,
|
|
463
481
|
description: He,
|
|
464
|
-
type:
|
|
465
|
-
properties:
|
|
466
|
-
|
|
482
|
+
type: De,
|
|
483
|
+
properties: $e,
|
|
484
|
+
required: Ae
|
|
485
|
+
}, Le = "layout-pane", Fe = "A Farris Container Component", Ne = "object", qe = {
|
|
467
486
|
basic: {
|
|
468
487
|
description: "Basic Infomation",
|
|
469
488
|
title: "基本信息",
|
|
@@ -558,11 +577,11 @@ const j = /* @__PURE__ */ E({
|
|
|
558
577
|
}
|
|
559
578
|
}
|
|
560
579
|
}
|
|
561
|
-
},
|
|
562
|
-
title:
|
|
563
|
-
description:
|
|
564
|
-
type:
|
|
565
|
-
categories:
|
|
580
|
+
}, Ve = {
|
|
581
|
+
title: Le,
|
|
582
|
+
description: Fe,
|
|
583
|
+
type: Ne,
|
|
584
|
+
categories: qe
|
|
566
585
|
}, N = {
|
|
567
586
|
customClass: { type: String, defaut: "" },
|
|
568
587
|
customStyle: { type: String, defaut: "" },
|
|
@@ -582,112 +601,112 @@ const j = /* @__PURE__ */ E({
|
|
|
582
601
|
minWidth: { type: Number, default: 100 },
|
|
583
602
|
/** 面板最小高度 */
|
|
584
603
|
minHeight: { type: Number, default: 100 }
|
|
585
|
-
},
|
|
586
|
-
function
|
|
604
|
+
}, K = U(N, Ee, Q, J, Ve);
|
|
605
|
+
function I(t, e, n, o, i) {
|
|
587
606
|
const {
|
|
588
607
|
horizontalResizeBarPosition: l,
|
|
589
|
-
horizontalResizeHandleOffset:
|
|
608
|
+
horizontalResizeHandleOffset: s,
|
|
590
609
|
showHorizontalResizeHandle: v,
|
|
591
610
|
showVerticalResizeHandle: P,
|
|
592
|
-
verticalResizeBarPosition:
|
|
611
|
+
verticalResizeBarPosition: r,
|
|
593
612
|
verticalResizeHandleOffset: f,
|
|
594
|
-
draggingHorizontalResizeHandle:
|
|
613
|
+
draggingHorizontalResizeHandle: u,
|
|
595
614
|
draggingVerticalResizeHandle: b,
|
|
596
615
|
getPanelMaxHeight: C,
|
|
597
616
|
getPanelMaxWidth: O
|
|
598
|
-
} =
|
|
617
|
+
} = i;
|
|
599
618
|
let w = "", h, p, m;
|
|
600
|
-
function d(
|
|
619
|
+
function d(c) {
|
|
601
620
|
if ((w === "left" || w === "right") && p) {
|
|
602
|
-
const { left: g } = p.getBoundingClientRect(), { width: y } = h.getBoundingClientRect(), T =
|
|
621
|
+
const { left: g } = p.getBoundingClientRect(), { width: y } = h.getBoundingClientRect(), T = c.clientX - g;
|
|
603
622
|
let B = w === "left" ? (y || 0) + (T - l.value) : (y || 0) - (T - l.value);
|
|
604
623
|
B = n.value > 0 ? Math.max(n.value, B) : B;
|
|
605
|
-
const
|
|
606
|
-
|
|
624
|
+
const M = O(w, n.value);
|
|
625
|
+
M != null && (B = M > B ? B : M), t.value = B;
|
|
607
626
|
}
|
|
608
627
|
if ((w === "top" || w === "bottom") && p) {
|
|
609
|
-
const { top: g } = p.getBoundingClientRect(), { height: y } = h.getBoundingClientRect(), T =
|
|
610
|
-
let B = w === "top" ? (y || 0) + (T -
|
|
628
|
+
const { top: g } = p.getBoundingClientRect(), { height: y } = h.getBoundingClientRect(), T = c.clientY - g;
|
|
629
|
+
let B = w === "top" ? (y || 0) + (T - r.value) : (y || 0) - (T - r.value);
|
|
611
630
|
B = o.value > 0 ? Math.max(o.value, B) : B;
|
|
612
|
-
const
|
|
613
|
-
|
|
631
|
+
const M = C(w, o.value);
|
|
632
|
+
M != null && (B = M > B ? B : M), e.value = B;
|
|
614
633
|
}
|
|
615
|
-
|
|
616
|
-
}
|
|
617
|
-
function R(
|
|
618
|
-
if (w = g, h = y, v.value = !0, p =
|
|
619
|
-
const { left: B } = p.getBoundingClientRect(),
|
|
620
|
-
|
|
621
|
-
const
|
|
622
|
-
m = (
|
|
634
|
+
s.value = 0, f.value = 0, l.value = -1, r.value = -1, v.value = !1, P.value = !1, document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", d), document.body.style.userSelect = "", w = "", h = null, p = null;
|
|
635
|
+
}
|
|
636
|
+
function R(c, g, y) {
|
|
637
|
+
if (w = g, h = y, v.value = !0, p = c.composedPath().find((B) => (B.className || "").split(" ")[0] === "f-layout"), p) {
|
|
638
|
+
const { left: B } = p.getBoundingClientRect(), M = c.clientX - B;
|
|
639
|
+
s.value = M, l.value = M;
|
|
640
|
+
const A = O(w, n.value) || 0;
|
|
641
|
+
m = (te) => u(te, A, n.value, w), document.addEventListener("mousemove", m), document.addEventListener("mouseup", d), document.body.style.userSelect = "none";
|
|
623
642
|
}
|
|
624
643
|
}
|
|
625
|
-
function a(
|
|
626
|
-
if (w = g, h = y, P.value = !0, p =
|
|
644
|
+
function a(c, g, y) {
|
|
645
|
+
if (w = g, h = y, P.value = !0, p = c.composedPath().find((B) => (B.className || "").split(" ")[0] === "f-layout"), p) {
|
|
627
646
|
const { top: B } = p.getBoundingClientRect();
|
|
628
|
-
f.value =
|
|
629
|
-
const
|
|
630
|
-
m = (
|
|
647
|
+
f.value = c.clientY - B, r.value = c.clientY - B;
|
|
648
|
+
const M = C(w, o.value) || 0;
|
|
649
|
+
m = (A) => b(A, M, o.value, w), document.addEventListener("mousemove", m), document.addEventListener("mouseup", d), document.body.style.userSelect = "none";
|
|
631
650
|
}
|
|
632
651
|
}
|
|
633
652
|
return { onClickHorizontalResizeBar: R, onClickVerticalResizeBar: a };
|
|
634
653
|
}
|
|
635
|
-
const
|
|
654
|
+
const E = /* @__PURE__ */ $({
|
|
636
655
|
name: "FLayoutPane",
|
|
637
656
|
props: N,
|
|
638
657
|
emits: [],
|
|
639
658
|
setup(t, e) {
|
|
640
|
-
const n = z(t.minHeight <= 0 ? 100 : t.minHeight), o = z(t.minWidth <= 0 ? 100 : t.minWidth),
|
|
641
|
-
|
|
659
|
+
const n = z(t.minHeight <= 0 ? 100 : t.minHeight), o = z(t.minWidth <= 0 ? 100 : t.minWidth), i = z(t.width <= 0 ? 100 : t.width), l = z(t.height <= 100 ? 100 : t.height), s = z(Math.max(n.value, l.value)), v = z(Math.max(o.value, i.value)), P = z(), r = z(t.position), f = z(t.resizable);
|
|
660
|
+
ne(() => t.resizable, (a) => {
|
|
642
661
|
f.value = a;
|
|
643
662
|
});
|
|
644
|
-
const
|
|
663
|
+
const u = D("layout"), {
|
|
645
664
|
useResizeHandleComposition: b
|
|
646
|
-
} =
|
|
665
|
+
} = u, C = I(v, s, o, n, b), {
|
|
647
666
|
onClickHorizontalResizeBar: O,
|
|
648
667
|
onClickVerticalResizeBar: w
|
|
649
|
-
} = C, h =
|
|
668
|
+
} = C, h = k(() => ({
|
|
650
669
|
"f-layout-resize-bar": !0,
|
|
651
|
-
"f-layout-resize-bar-e":
|
|
652
|
-
"f-layout-resize-bar-n":
|
|
653
|
-
"f-layout-resize-bar-s":
|
|
654
|
-
"f-layout-resize-bar-w":
|
|
655
|
-
})), p =
|
|
656
|
-
function m(a,
|
|
657
|
-
(
|
|
670
|
+
"f-layout-resize-bar-e": r.value === "left",
|
|
671
|
+
"f-layout-resize-bar-n": r.value === "bottom",
|
|
672
|
+
"f-layout-resize-bar-s": r.value === "top",
|
|
673
|
+
"f-layout-resize-bar-w": r.value === "right"
|
|
674
|
+
})), p = k(() => r.value !== "center" && f.value);
|
|
675
|
+
function m(a, c) {
|
|
676
|
+
(c === "left" || c === "right") && O(a, c, P.value), (c === "top" || c === "bottom") && w(a, c, P.value);
|
|
658
677
|
}
|
|
659
|
-
const d =
|
|
678
|
+
const d = k(() => {
|
|
660
679
|
const a = {
|
|
661
680
|
"f-layout-pane": !0,
|
|
662
|
-
"f-page-content-nav":
|
|
663
|
-
"f-page-content-main":
|
|
681
|
+
"f-page-content-nav": r.value === "left" || r.value === "right",
|
|
682
|
+
"f-page-content-main": r.value === "center"
|
|
664
683
|
};
|
|
665
|
-
return t.customClass && String(t.customClass).split(" ").reduce((
|
|
666
|
-
}), R =
|
|
684
|
+
return t.customClass && String(t.customClass).split(" ").reduce((c, g) => (c[g] = !0, c), a), a;
|
|
685
|
+
}), R = k(() => {
|
|
667
686
|
const a = {};
|
|
668
|
-
return (v.value &&
|
|
687
|
+
return (v.value && r.value === "left" || r.value === "right") && (a.width = `${v.value}px`), (s.value && r.value === "bottom" || r.value === "top") && (a.height = `${s.value}px`), t.visible || (a.display = "none"), a;
|
|
669
688
|
});
|
|
670
689
|
return () => S("div", {
|
|
671
690
|
ref: P,
|
|
672
691
|
class: d.value,
|
|
673
692
|
style: R.value,
|
|
674
|
-
"data-position":
|
|
693
|
+
"data-position": r.value
|
|
675
694
|
}, [e.slots.default && e.slots.default(), p.value && S("span", {
|
|
676
695
|
class: h.value,
|
|
677
|
-
onMousedown: (a) => m(a,
|
|
696
|
+
onMousedown: (a) => m(a, r.value)
|
|
678
697
|
}, null)]);
|
|
679
698
|
}
|
|
680
699
|
});
|
|
681
|
-
function
|
|
700
|
+
function We(t, e) {
|
|
682
701
|
function n() {
|
|
683
702
|
return !1;
|
|
684
703
|
}
|
|
685
704
|
return { canAccepts: n };
|
|
686
705
|
}
|
|
687
|
-
function
|
|
706
|
+
function ee(t, e, n) {
|
|
688
707
|
var R;
|
|
689
|
-
const o = n && n.getStyles && n.getStyles() || "",
|
|
690
|
-
function
|
|
708
|
+
const o = n && n.getStyles && n.getStyles() || "", i = n && n.getDesignerClass && n.getDesignerClass() || "", l = z();
|
|
709
|
+
function s() {
|
|
691
710
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
|
|
692
711
|
}
|
|
693
712
|
function v() {
|
|
@@ -696,7 +715,7 @@ function I(t, e, n) {
|
|
|
696
715
|
function P() {
|
|
697
716
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
|
|
698
717
|
}
|
|
699
|
-
function
|
|
718
|
+
function r() {
|
|
700
719
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
|
|
701
720
|
}
|
|
702
721
|
function f(a) {
|
|
@@ -704,12 +723,12 @@ function I(t, e, n) {
|
|
|
704
723
|
return null;
|
|
705
724
|
if (a.value.schema && a.value.schema.type === "component")
|
|
706
725
|
return a.value;
|
|
707
|
-
const
|
|
726
|
+
const c = z(a == null ? void 0 : a.value.parent), g = f(c);
|
|
708
727
|
return g || null;
|
|
709
728
|
}
|
|
710
|
-
function
|
|
711
|
-
const { componentInstance:
|
|
712
|
-
return !
|
|
729
|
+
function u(a = e) {
|
|
730
|
+
const { componentInstance: c, designerItemElementRef: g } = a;
|
|
731
|
+
return !c || !c.value ? null : c.value.canMove ? g : u(a.parent);
|
|
713
732
|
}
|
|
714
733
|
function b(a) {
|
|
715
734
|
return !!n && n.canAccepts(a);
|
|
@@ -719,12 +738,12 @@ function I(t, e, n) {
|
|
|
719
738
|
}
|
|
720
739
|
function O() {
|
|
721
740
|
}
|
|
722
|
-
function w(a,
|
|
723
|
-
|
|
741
|
+
function w(a, c) {
|
|
742
|
+
c && n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(c);
|
|
724
743
|
}
|
|
725
|
-
function h(a,
|
|
744
|
+
function h(a, c) {
|
|
726
745
|
const { componentType: g } = a;
|
|
727
|
-
let y = X(g, a,
|
|
746
|
+
let y = X(g, a, c);
|
|
728
747
|
n && n.onResolveNewComponentSchema && (y = n.onResolveNewComponentSchema(a, y));
|
|
729
748
|
const T = g.toLowerCase().replace(/-/g, "_");
|
|
730
749
|
return y && !y.id && y.type === g && (y.id = `${T}_${Math.random().toString().slice(2, 6)}`), y;
|
|
@@ -738,26 +757,26 @@ function I(t, e, n) {
|
|
|
738
757
|
function d() {
|
|
739
758
|
n && n.onRemoveComponent && n.onRemoveComponent(), e != null && e.schema.contents && e.schema.contents.map((a) => {
|
|
740
759
|
var y;
|
|
741
|
-
let
|
|
742
|
-
a.type === "component-ref" && (
|
|
743
|
-
const g = t.value.querySelector(`#${
|
|
760
|
+
let c = a.id;
|
|
761
|
+
a.type === "component-ref" && (c = a.component);
|
|
762
|
+
const g = t.value.querySelector(`#${c}-design-item`);
|
|
744
763
|
(y = g == null ? void 0 : g.componentInstance) != null && y.value.onRemoveComponent && g.componentInstance.value.onRemoveComponent();
|
|
745
764
|
});
|
|
746
765
|
}
|
|
747
766
|
return l.value = {
|
|
748
|
-
canMove:
|
|
767
|
+
canMove: s(),
|
|
749
768
|
canSelectParent: v(),
|
|
750
769
|
canDelete: P(),
|
|
751
|
-
canNested: !
|
|
770
|
+
canNested: !r(),
|
|
752
771
|
contents: e == null ? void 0 : e.schema.contents,
|
|
753
772
|
elementRef: t,
|
|
754
773
|
parent: (R = e == null ? void 0 : e.parent) == null ? void 0 : R.componentInstance,
|
|
755
774
|
schema: e == null ? void 0 : e.schema,
|
|
756
775
|
styles: o,
|
|
757
|
-
designerClass:
|
|
776
|
+
designerClass: i,
|
|
758
777
|
canAccepts: b,
|
|
759
778
|
getBelongedComponentInstance: f,
|
|
760
|
-
getDraggableDesignItemElement:
|
|
779
|
+
getDraggableDesignItemElement: u,
|
|
761
780
|
getDraggingDisplayText: C,
|
|
762
781
|
getPropConfig: m,
|
|
763
782
|
getDragScopeElement: O,
|
|
@@ -769,21 +788,21 @@ function I(t, e, n) {
|
|
|
769
788
|
onRemoveComponent: d
|
|
770
789
|
}, l;
|
|
771
790
|
}
|
|
772
|
-
const
|
|
791
|
+
const _e = /* @__PURE__ */ $({
|
|
773
792
|
name: "FLayoutDesign",
|
|
774
793
|
props: F,
|
|
775
794
|
emits: [],
|
|
776
795
|
setup(t, e) {
|
|
777
796
|
var f;
|
|
778
|
-
const n = z(), o = D("design-item-context"),
|
|
797
|
+
const n = z(), o = D("design-item-context"), i = We(o.schema, (f = o.parent) == null ? void 0 : f.schema), l = ee(n, o, i);
|
|
779
798
|
l.value.canNested = !1;
|
|
780
|
-
const
|
|
799
|
+
const s = x(n), {
|
|
781
800
|
horizontalResizeHandleStyle: v,
|
|
782
801
|
verticalResizeHandleStyle: P,
|
|
783
|
-
resizeOverlayStyle:
|
|
784
|
-
} =
|
|
785
|
-
return
|
|
786
|
-
useResizeHandleComposition:
|
|
802
|
+
resizeOverlayStyle: r
|
|
803
|
+
} = s;
|
|
804
|
+
return V("layout", {
|
|
805
|
+
useResizeHandleComposition: s
|
|
787
806
|
}), W(() => {
|
|
788
807
|
n.value.componentInstance = l;
|
|
789
808
|
}), e.expose(l.value), () => S("div", {
|
|
@@ -791,7 +810,7 @@ const qe = /* @__PURE__ */ E({
|
|
|
791
810
|
ref: n
|
|
792
811
|
}, [e.slots.default && e.slots.default(), S("div", {
|
|
793
812
|
class: "f-layout-resize-overlay",
|
|
794
|
-
style:
|
|
813
|
+
style: r.value
|
|
795
814
|
}, null), S("div", {
|
|
796
815
|
class: "f-layout-horizontal-resize-proxy",
|
|
797
816
|
style: v.value
|
|
@@ -801,70 +820,70 @@ const qe = /* @__PURE__ */ E({
|
|
|
801
820
|
}, null)]);
|
|
802
821
|
}
|
|
803
822
|
});
|
|
804
|
-
function
|
|
823
|
+
function Ge() {
|
|
805
824
|
function t(e, n) {
|
|
806
|
-
var
|
|
825
|
+
var s;
|
|
807
826
|
if (!e)
|
|
808
827
|
return !1;
|
|
809
|
-
const o = ((
|
|
828
|
+
const o = ((s = e.targetContainer) == null ? void 0 : s.componentInstance) && e.targetContainer.componentInstance.value;
|
|
810
829
|
if (!o)
|
|
811
830
|
return !1;
|
|
812
|
-
const
|
|
813
|
-
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![
|
|
831
|
+
const i = o.schema.type, l = n == null ? void 0 : n.formSchemaUtils.getComponentById(o.belongedComponentId);
|
|
832
|
+
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![j["response-layout-item"].type, j["response-form"].type].includes(i) || (e.componentType === j.tabs.type || e.componentType === j.section.type) && ((l == null ? void 0 : l.componentType) !== "frame" || ![j["content-container"].type, j["splitter-pane"].type, j["response-layout-item"].type].includes(i)));
|
|
814
833
|
}
|
|
815
834
|
return {
|
|
816
835
|
basalDragulaRuleForContainer: t
|
|
817
836
|
};
|
|
818
837
|
}
|
|
819
|
-
function
|
|
838
|
+
function Ye(t, e) {
|
|
820
839
|
const n = t.schema;
|
|
821
840
|
function o(l) {
|
|
822
|
-
return !!
|
|
841
|
+
return !!Ge().basalDragulaRuleForContainer(l);
|
|
823
842
|
}
|
|
824
|
-
function
|
|
843
|
+
function i() {
|
|
825
844
|
const l = ["f-layout-pane"];
|
|
826
845
|
return (n.position === "left" || n.position === "right") && l.push("f-page-content-nav"), n.position === "center" && l.push("f-page-content-main"), l.join(" ");
|
|
827
846
|
}
|
|
828
|
-
return { canAccepts: o, getDesignerClass:
|
|
847
|
+
return { canAccepts: o, getDesignerClass: i };
|
|
829
848
|
}
|
|
830
|
-
const
|
|
849
|
+
const Xe = /* @__PURE__ */ $({
|
|
831
850
|
name: "FLayoutPaneDesign",
|
|
832
851
|
props: N,
|
|
833
852
|
emits: [],
|
|
834
853
|
setup(t, e) {
|
|
835
854
|
const n = z(), o = z();
|
|
836
855
|
D("designer-host-service");
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
o.value.componentInstance =
|
|
840
|
-
}), e.expose(
|
|
841
|
-
const v = z(Math.max(t.minHeight, t.height)), P = z(Math.max(t.minWidth, t.width)),
|
|
856
|
+
const i = D("design-item-context"), l = Ye(i), s = ee(o, i, l);
|
|
857
|
+
s.value.canNested = !1, s.value.canMove = !1, s.value.canDelete = !1, W(() => {
|
|
858
|
+
o.value.componentInstance = s;
|
|
859
|
+
}), e.expose(s.value);
|
|
860
|
+
const v = z(Math.max(t.minHeight, t.height)), P = z(Math.max(t.minWidth, t.width)), r = z(t.minHeight), f = z(t.minWidth), u = z(t.position), b = D("layout"), {
|
|
842
861
|
useResizeHandleComposition: C
|
|
843
|
-
} = b, O =
|
|
862
|
+
} = b, O = I(P, v, f, r, C), {
|
|
844
863
|
onClickHorizontalResizeBar: w,
|
|
845
864
|
onClickVerticalResizeBar: h
|
|
846
|
-
} = O, p =
|
|
865
|
+
} = O, p = k(() => ({
|
|
847
866
|
"f-layout-resize-bar": !0,
|
|
848
|
-
"f-layout-resize-bar-e":
|
|
849
|
-
"f-layout-resize-bar-n":
|
|
850
|
-
"f-layout-resize-bar-s":
|
|
851
|
-
"f-layout-resize-bar-w":
|
|
867
|
+
"f-layout-resize-bar-e": u.value === "left",
|
|
868
|
+
"f-layout-resize-bar-n": u.value === "bottom",
|
|
869
|
+
"f-layout-resize-bar-s": u.value === "top",
|
|
870
|
+
"f-layout-resize-bar-w": u.value === "right"
|
|
852
871
|
}));
|
|
853
|
-
function m(a,
|
|
854
|
-
(
|
|
872
|
+
function m(a, c) {
|
|
873
|
+
(c === "left" || c === "right") && w(a, c, n.value), (c === "top" || c === "bottom") && h(a, c, n.value);
|
|
855
874
|
}
|
|
856
|
-
const d =
|
|
875
|
+
const d = k(() => {
|
|
857
876
|
const a = {
|
|
858
877
|
"f-layout-pane": !0,
|
|
859
|
-
"f-page-content-nav":
|
|
860
|
-
"f-page-content-main":
|
|
878
|
+
"f-page-content-nav": u.value === "left" || u.value === "right",
|
|
879
|
+
"f-page-content-main": u.value === "center"
|
|
861
880
|
};
|
|
862
|
-
return t.customClass && String(t.customClass).split(" ").reduce((
|
|
863
|
-
}), R =
|
|
881
|
+
return t.customClass && String(t.customClass).split(" ").reduce((c, g) => (c[g] = !0, c), a), a;
|
|
882
|
+
}), R = k(() => {
|
|
864
883
|
const a = {
|
|
865
884
|
flex: "1"
|
|
866
885
|
};
|
|
867
|
-
return (P.value &&
|
|
886
|
+
return (P.value && u.value === "left" || u.value === "right") && (a.width = `${P.value}px`), (v.value && u.value === "bottom" || u.value === "top") && (a.height = `${v.value}px`), a;
|
|
868
887
|
});
|
|
869
888
|
return () => S("div", {
|
|
870
889
|
ref: n,
|
|
@@ -873,26 +892,26 @@ const Ye = /* @__PURE__ */ E({
|
|
|
873
892
|
}, [S("div", {
|
|
874
893
|
ref: o,
|
|
875
894
|
class: "drag-container",
|
|
876
|
-
"data-dragref": `${
|
|
895
|
+
"data-dragref": `${i.schema.id}-container`
|
|
877
896
|
}, [e.slots.default && e.slots.default()]), S("span", {
|
|
878
897
|
class: p.value,
|
|
879
|
-
onMousedown: (a) => m(a,
|
|
898
|
+
onMousedown: (a) => m(a, u.value)
|
|
880
899
|
}, null)]);
|
|
881
900
|
}
|
|
882
901
|
});
|
|
883
|
-
|
|
884
|
-
t.component(
|
|
902
|
+
H.install = (t) => {
|
|
903
|
+
t.component(H.name, H), t.component(E.name, E);
|
|
885
904
|
};
|
|
886
|
-
|
|
887
|
-
t.layout =
|
|
905
|
+
H.register = (t, e, n, o) => {
|
|
906
|
+
t.layout = H, e.layout = Z, t["layout-pane"] = E, e["layout-pane"] = K;
|
|
888
907
|
};
|
|
889
|
-
|
|
890
|
-
t.layout =
|
|
908
|
+
H.registerDesigner = (t, e, n) => {
|
|
909
|
+
t.layout = _e, e.layout = Z, t["layout-pane"] = Xe, e["layout-pane"] = K;
|
|
891
910
|
};
|
|
892
911
|
export {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
912
|
+
H as FLayout,
|
|
913
|
+
E as FLayoutPane,
|
|
914
|
+
H as default,
|
|
896
915
|
F as layoutProps,
|
|
897
|
-
|
|
916
|
+
Z as layoutPropsResolver
|
|
898
917
|
};
|