@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,57 +1,71 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isPlainObject as F, cloneDeep as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { properties: e, title: t, ignore:
|
|
6
|
-
if (t && (!a || !
|
|
1
|
+
import { defineComponent as E, ref as g, computed as j, createVNode as v, inject as A, onMounted as _ } from "vue";
|
|
2
|
+
import { isPlainObject as F, cloneDeep as V } from "lodash-es";
|
|
3
|
+
const $ = {}, q = {};
|
|
4
|
+
function S(r) {
|
|
5
|
+
const { properties: e, title: t, ignore: s } = r, a = s && Array.isArray(s), o = Object.keys(e).reduce((n, u) => ((!a || !s.find((f) => f === u)) && (n[u] = e[u].type === "object" && e[u].properties ? S(e[u]) : V(e[u].default)), n), {});
|
|
6
|
+
if (t && (!a || !s.find((n) => n === "id"))) {
|
|
7
7
|
const n = t.toLowerCase().replace(/-/g, "_");
|
|
8
8
|
o.id = `${n}_${Math.random().toString().slice(2, 6)}`;
|
|
9
9
|
}
|
|
10
10
|
return o;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
function G(r) {
|
|
13
|
+
const { properties: e, title: t, required: s } = r;
|
|
14
|
+
if (s && Array.isArray(s)) {
|
|
15
|
+
const a = s.reduce((o, n) => (o[n] = e[n].type === "object" && e[n].properties ? S(e[n]) : V(e[n].default), o), {});
|
|
16
|
+
if (t && s.find((o) => o === "id")) {
|
|
17
|
+
const o = t.toLowerCase().replace(/-/g, "_");
|
|
18
|
+
a.id = `${o}_${Math.random().toString().slice(2, 6)}`;
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
type: t
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function R(r, e = {}, t) {
|
|
27
|
+
const s = $[r];
|
|
28
|
+
if (s) {
|
|
29
|
+
let a = G(s);
|
|
30
|
+
const o = q[r];
|
|
17
31
|
return a = o ? o({ getSchemaByType: R }, a, e, t) : a, a;
|
|
18
32
|
}
|
|
19
33
|
return null;
|
|
20
34
|
}
|
|
21
|
-
function W(
|
|
22
|
-
const t =
|
|
23
|
-
return Object.keys(t).reduce((
|
|
35
|
+
function W(r, e) {
|
|
36
|
+
const t = S(e);
|
|
37
|
+
return Object.keys(t).reduce((s, a) => (Object.prototype.hasOwnProperty.call(r, a) && (s[a] && F(s[a]) && F(r[a] || !r[a]) ? Object.assign(s[a], r[a] || {}) : s[a] = r[a]), s), t), t;
|
|
24
38
|
}
|
|
25
|
-
function
|
|
26
|
-
return Object.keys(
|
|
39
|
+
function U(r, e) {
|
|
40
|
+
return Object.keys(r).filter((s) => r[s] != null).reduce((s, a) => {
|
|
27
41
|
if (e.has(a)) {
|
|
28
42
|
const o = e.get(a);
|
|
29
43
|
if (typeof o == "string")
|
|
30
|
-
|
|
44
|
+
s[o] = r[a];
|
|
31
45
|
else {
|
|
32
|
-
const n = o(a,
|
|
33
|
-
Object.assign(
|
|
46
|
+
const n = o(a, r[a], r);
|
|
47
|
+
Object.assign(s, n);
|
|
34
48
|
}
|
|
35
49
|
} else
|
|
36
|
-
|
|
37
|
-
return
|
|
50
|
+
s[a] = r[a];
|
|
51
|
+
return s;
|
|
38
52
|
}, {});
|
|
39
53
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return
|
|
54
|
+
function Q(r, e, t = /* @__PURE__ */ new Map()) {
|
|
55
|
+
const s = W(r, e);
|
|
56
|
+
return U(s, t);
|
|
43
57
|
}
|
|
44
|
-
function
|
|
58
|
+
function H(r = {}) {
|
|
45
59
|
function e(l, c, i, p) {
|
|
46
60
|
if (typeof i == "number")
|
|
47
61
|
return p[l].length === i;
|
|
48
62
|
if (typeof i == "object") {
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
63
|
+
const d = Object.keys(i)[0], y = i[d];
|
|
64
|
+
if (d === "not")
|
|
51
65
|
return Number(p[l].length) !== Number(y);
|
|
52
|
-
if (
|
|
66
|
+
if (d === "moreThan")
|
|
53
67
|
return Number(p[l].length) >= Number(y);
|
|
54
|
-
if (
|
|
68
|
+
if (d === "lessThan")
|
|
55
69
|
return Number(p[l].length) <= Number(y);
|
|
56
70
|
}
|
|
57
71
|
return !1;
|
|
@@ -59,43 +73,43 @@ function Q(s = {}) {
|
|
|
59
73
|
function t(l, c, i, p) {
|
|
60
74
|
return p[l] && p[l].propertyValue && String(p[l].propertyValue.value) === String(i);
|
|
61
75
|
}
|
|
62
|
-
const
|
|
76
|
+
const s = /* @__PURE__ */ new Map([
|
|
63
77
|
["length", e],
|
|
64
78
|
["getProperty", t]
|
|
65
79
|
]);
|
|
66
|
-
Object.keys(
|
|
80
|
+
Object.keys(r).reduce((l, c) => (l.set(c, r[c]), l), s);
|
|
67
81
|
function a(l, c) {
|
|
68
82
|
const i = l;
|
|
69
83
|
return typeof c == "number" ? [{ target: i, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: i, operator: "getProperty", param: l, value: !!c }] : typeof c == "object" ? Object.keys(c).map((p) => {
|
|
70
84
|
if (p === "length")
|
|
71
85
|
return { target: i, operator: "length", param: null, value: c[p] };
|
|
72
|
-
const
|
|
73
|
-
return { target: i, operator: "getProperty", param:
|
|
86
|
+
const d = p, y = c[p];
|
|
87
|
+
return { target: i, operator: "getProperty", param: d, value: y };
|
|
74
88
|
}) : [];
|
|
75
89
|
}
|
|
76
90
|
function o(l) {
|
|
77
91
|
return Object.keys(l).reduce((i, p) => {
|
|
78
|
-
const
|
|
79
|
-
return i.push(...
|
|
92
|
+
const d = a(p, l[p]);
|
|
93
|
+
return i.push(...d), i;
|
|
80
94
|
}, []);
|
|
81
95
|
}
|
|
82
96
|
function n(l, c) {
|
|
83
|
-
if (
|
|
84
|
-
const i =
|
|
97
|
+
if (s.has(l.operator)) {
|
|
98
|
+
const i = s.get(l.operator);
|
|
85
99
|
return i && i(l.target, l.param, l.value, c) || !1;
|
|
86
100
|
}
|
|
87
101
|
return !1;
|
|
88
102
|
}
|
|
89
103
|
function u(l, c) {
|
|
90
|
-
return o(l).reduce((
|
|
104
|
+
return o(l).reduce((d, y) => d && n(y, c), !0);
|
|
91
105
|
}
|
|
92
106
|
function f(l, c) {
|
|
93
|
-
const i = Object.keys(l), p = i.includes("allOf"),
|
|
94
|
-
return p ? !
|
|
107
|
+
const i = Object.keys(l), p = i.includes("allOf"), d = i.includes("anyOf"), y = p || d, D = (y ? l[y ? p ? "allOf" : "anyOf" : "allOf"] : [l]).map((N) => u(N, c));
|
|
108
|
+
return p ? !D.includes(!1) : D.includes(!0);
|
|
95
109
|
}
|
|
96
110
|
return { parseValueSchema: f };
|
|
97
111
|
}
|
|
98
|
-
const
|
|
112
|
+
const T = {
|
|
99
113
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
100
114
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
101
115
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -135,24 +149,24 @@ const D = {
|
|
|
135
149
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
136
150
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
137
151
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
function
|
|
141
|
-
return
|
|
142
|
-
const u =
|
|
152
|
+
}, J = {}, X = {};
|
|
153
|
+
H();
|
|
154
|
+
function Y(r, e, t = /* @__PURE__ */ new Map(), s = (n, u, f, l) => u, a = {}, o = (n) => n) {
|
|
155
|
+
return $[e.title] = e, q[e.title] = s, J[e.title] = a, X[e.title] = o, (n = {}) => {
|
|
156
|
+
const u = Q(n, e, t), f = Object.keys(r).reduce((l, c) => (l[c] = r[c].default, l), {});
|
|
143
157
|
return Object.assign(f, u);
|
|
144
158
|
};
|
|
145
159
|
}
|
|
146
|
-
function
|
|
160
|
+
function Z(r, e) {
|
|
147
161
|
return { customClass: e.class, customStyle: e.style };
|
|
148
162
|
}
|
|
149
|
-
const
|
|
150
|
-
["appearance",
|
|
163
|
+
const K = /* @__PURE__ */ new Map([
|
|
164
|
+
["appearance", Z]
|
|
151
165
|
]);
|
|
152
|
-
function
|
|
166
|
+
function I(r, e, t) {
|
|
153
167
|
return e;
|
|
154
168
|
}
|
|
155
|
-
const
|
|
169
|
+
const x = "https://json-schema.org/draft/2020-12/schema", ee = "https://farris-design.gitee.io/list-nav.schema.json", te = "list-nav", ne = "A Farris Container Component", ae = "object", oe = {
|
|
156
170
|
id: {
|
|
157
171
|
description: "The unique identifier for a list-nav",
|
|
158
172
|
type: "string"
|
|
@@ -198,19 +212,19 @@ const I = "https://json-schema.org/draft/2020-12/schema", x = "https://farris-de
|
|
|
198
212
|
type: "boolean",
|
|
199
213
|
default: !0
|
|
200
214
|
}
|
|
201
|
-
},
|
|
215
|
+
}, re = [
|
|
202
216
|
"id",
|
|
203
217
|
"type",
|
|
204
218
|
"contents"
|
|
205
219
|
], se = {
|
|
206
|
-
$schema:
|
|
207
|
-
$id:
|
|
208
|
-
title:
|
|
209
|
-
description:
|
|
210
|
-
type:
|
|
211
|
-
properties:
|
|
212
|
-
required:
|
|
213
|
-
},
|
|
220
|
+
$schema: x,
|
|
221
|
+
$id: ee,
|
|
222
|
+
title: te,
|
|
223
|
+
description: ne,
|
|
224
|
+
type: ae,
|
|
225
|
+
properties: oe,
|
|
226
|
+
required: re
|
|
227
|
+
}, le = "list-nav", ce = "A Farris Component", ie = "object", pe = {
|
|
214
228
|
basic: {
|
|
215
229
|
description: "Basic Infomation",
|
|
216
230
|
title: "基本信息",
|
|
@@ -229,12 +243,12 @@ const I = "https://json-schema.org/draft/2020-12/schema", x = "https://farris-de
|
|
|
229
243
|
}
|
|
230
244
|
}
|
|
231
245
|
}
|
|
232
|
-
},
|
|
233
|
-
title:
|
|
234
|
-
description:
|
|
235
|
-
type:
|
|
236
|
-
categories:
|
|
237
|
-
},
|
|
246
|
+
}, ue = {
|
|
247
|
+
title: le,
|
|
248
|
+
description: ce,
|
|
249
|
+
type: ie,
|
|
250
|
+
categories: pe
|
|
251
|
+
}, B = {
|
|
238
252
|
/** 位置 */
|
|
239
253
|
position: { Type: String, default: "left" },
|
|
240
254
|
/** listNav名称 */
|
|
@@ -249,51 +263,51 @@ const I = "https://json-schema.org/draft/2020-12/schema", x = "https://farris-de
|
|
|
249
263
|
disabled: { Type: Boolean, default: !1 },
|
|
250
264
|
/** 是否启用拖拽 TODO */
|
|
251
265
|
draggable: { Type: Boolean, default: !1 }
|
|
252
|
-
},
|
|
266
|
+
}, O = Y(B, se, K, I, ue), P = /* @__PURE__ */ E({
|
|
253
267
|
name: "FListNav",
|
|
254
|
-
props:
|
|
268
|
+
props: B,
|
|
255
269
|
emits: ["collapse"],
|
|
256
|
-
setup(
|
|
257
|
-
const t = g(
|
|
270
|
+
setup(r, e) {
|
|
271
|
+
const t = g(r.position), s = g(r.title), a = g(r.folded), o = g(!1);
|
|
258
272
|
function n(f) {
|
|
259
|
-
f && f.stopPropagation(), !
|
|
273
|
+
f && f.stopPropagation(), !r.disabled && (o.value = !0, a.value = !a.value, e.emit("collapse", a.value));
|
|
260
274
|
}
|
|
261
275
|
const u = j(() => {
|
|
262
276
|
const f = {}, l = ["top", "bottom"].indexOf(t.value) > -1 ? "height" : "width";
|
|
263
|
-
return f[l] = a.value ? "0px" :
|
|
277
|
+
return f[l] = a.value ? "0px" : r.size + "px", f;
|
|
264
278
|
});
|
|
265
|
-
return () =>
|
|
279
|
+
return () => v("div", {
|
|
266
280
|
class: `f-list-nav f-list-nav-${t.value}`
|
|
267
|
-
}, [
|
|
281
|
+
}, [v("div", {
|
|
268
282
|
class: "f-list-nav-in",
|
|
269
283
|
style: u.value
|
|
270
|
-
}, [
|
|
284
|
+
}, [v("div", {
|
|
271
285
|
class: "f-list-nav-main"
|
|
272
|
-
}, [e.slots.navHeader &&
|
|
286
|
+
}, [e.slots.navHeader && v("div", {
|
|
273
287
|
class: "f-list-nav-header"
|
|
274
|
-
}, [e.slots.navHeader()]), !e.slots.navHeader &&
|
|
288
|
+
}, [e.slots.navHeader()]), !e.slots.navHeader && s.value && v("div", {
|
|
275
289
|
class: "f-list-nav-header"
|
|
276
|
-
}, [
|
|
290
|
+
}, [v("div", {
|
|
277
291
|
class: "f-list-nav-title"
|
|
278
|
-
}, [
|
|
292
|
+
}, [s.value])]), e.slots.navContent && v("div", {
|
|
279
293
|
class: "f-list-nav-content"
|
|
280
|
-
}, [e.slots.navContent()]), e.slots.navFooter &&
|
|
294
|
+
}, [e.slots.navContent()]), e.slots.navFooter && v("div", {
|
|
281
295
|
class: "f-list-nav-footer"
|
|
282
|
-
}, [e.slots.navFooter()])]),
|
|
296
|
+
}, [e.slots.navFooter()])]), r.collapsible && v("div", {
|
|
283
297
|
class: ["f-list-nav-toggle-sidebar", {
|
|
284
|
-
disabled:
|
|
298
|
+
disabled: r.disabled,
|
|
285
299
|
active: a.value,
|
|
286
300
|
"splitter-pane-collapse-animate": o.value
|
|
287
301
|
}],
|
|
288
302
|
onClick: (f) => n(f)
|
|
289
|
-
}, [
|
|
303
|
+
}, [v("span", {
|
|
290
304
|
class: "triangle"
|
|
291
305
|
}, null)])])]);
|
|
292
306
|
}
|
|
293
307
|
});
|
|
294
|
-
function
|
|
308
|
+
function fe(r, e, t) {
|
|
295
309
|
var w;
|
|
296
|
-
const
|
|
310
|
+
const s = t && t.getStyles && t.getStyles() || "", a = t && t.getDesignerClass && t.getDesignerClass() || "", o = g();
|
|
297
311
|
function n() {
|
|
298
312
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
|
|
299
313
|
}
|
|
@@ -321,7 +335,7 @@ function ue(s, e, t) {
|
|
|
321
335
|
function p(m) {
|
|
322
336
|
return !!t && t.canAccepts(m);
|
|
323
337
|
}
|
|
324
|
-
function
|
|
338
|
+
function d() {
|
|
325
339
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
326
340
|
}
|
|
327
341
|
function y() {
|
|
@@ -333,10 +347,10 @@ function ue(s, e, t) {
|
|
|
333
347
|
const { componentType: b } = m;
|
|
334
348
|
let C = R(b, m, h);
|
|
335
349
|
t && t.onResolveNewComponentSchema && (C = t.onResolveNewComponentSchema(m, C));
|
|
336
|
-
const
|
|
337
|
-
return C && !C.id && C.type === b && (C.id = `${
|
|
350
|
+
const z = b.toLowerCase().replace(/-/g, "_");
|
|
351
|
+
return C && !C.id && C.type === b && (C.id = `${z}_${Math.random().toString().slice(2, 6)}`), C;
|
|
338
352
|
}
|
|
339
|
-
function
|
|
353
|
+
function D(m) {
|
|
340
354
|
}
|
|
341
355
|
function k(...m) {
|
|
342
356
|
if (t && t.getPropsConfig)
|
|
@@ -347,7 +361,7 @@ function ue(s, e, t) {
|
|
|
347
361
|
var C;
|
|
348
362
|
let h = m.id;
|
|
349
363
|
m.type === "component-ref" && (h = m.component);
|
|
350
|
-
const b =
|
|
364
|
+
const b = r.value.querySelector(`#${h}-design-item`);
|
|
351
365
|
(C = b == null ? void 0 : b.componentInstance) != null && C.value.onRemoveComponent && b.componentInstance.value.onRemoveComponent();
|
|
352
366
|
});
|
|
353
367
|
}
|
|
@@ -357,43 +371,43 @@ function ue(s, e, t) {
|
|
|
357
371
|
canDelete: f(),
|
|
358
372
|
canNested: !l(),
|
|
359
373
|
contents: e == null ? void 0 : e.schema.contents,
|
|
360
|
-
elementRef:
|
|
374
|
+
elementRef: r,
|
|
361
375
|
parent: (w = e == null ? void 0 : e.parent) == null ? void 0 : w.componentInstance,
|
|
362
376
|
schema: e == null ? void 0 : e.schema,
|
|
363
|
-
styles:
|
|
377
|
+
styles: s,
|
|
364
378
|
designerClass: a,
|
|
365
379
|
canAccepts: p,
|
|
366
380
|
getBelongedComponentInstance: c,
|
|
367
381
|
getDraggableDesignItemElement: i,
|
|
368
|
-
getDraggingDisplayText:
|
|
382
|
+
getDraggingDisplayText: d,
|
|
369
383
|
getPropConfig: k,
|
|
370
384
|
getDragScopeElement: y,
|
|
371
385
|
onAcceptMovedChildElement: M,
|
|
372
|
-
onChildElementMovedOut:
|
|
386
|
+
onChildElementMovedOut: D,
|
|
373
387
|
addNewChildComponentSchema: L,
|
|
374
388
|
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || g(!1),
|
|
375
389
|
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || g(!1),
|
|
376
390
|
onRemoveComponent: N
|
|
377
391
|
}, o;
|
|
378
392
|
}
|
|
379
|
-
function
|
|
380
|
-
function
|
|
393
|
+
function me() {
|
|
394
|
+
function r(e, t) {
|
|
381
395
|
var n;
|
|
382
396
|
if (!e)
|
|
383
397
|
return !1;
|
|
384
|
-
const
|
|
385
|
-
if (!
|
|
398
|
+
const s = ((n = e.targetContainer) == null ? void 0 : n.componentInstance) && e.targetContainer.componentInstance.value;
|
|
399
|
+
if (!s)
|
|
386
400
|
return !1;
|
|
387
|
-
const a =
|
|
388
|
-
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![
|
|
401
|
+
const a = s.schema.type, o = t == null ? void 0 : t.formSchemaUtils.getComponentById(s.belongedComponentId);
|
|
402
|
+
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![T["response-layout-item"].type, T["response-form"].type].includes(a) || (e.componentType === T.tabs.type || e.componentType === T.section.type) && ((o == null ? void 0 : o.componentType) !== "frame" || ![T["content-container"].type, T["splitter-pane"].type, T["response-layout-item"].type].includes(a)));
|
|
389
403
|
}
|
|
390
404
|
return {
|
|
391
|
-
basalDragulaRuleForContainer:
|
|
405
|
+
basalDragulaRuleForContainer: r
|
|
392
406
|
};
|
|
393
407
|
}
|
|
394
|
-
class
|
|
408
|
+
class de {
|
|
395
409
|
getTemplateRule(e, t) {
|
|
396
|
-
const
|
|
410
|
+
const s = t == null ? void 0 : t.formSchemaUtils, a = s == null ? void 0 : s.getFormTemplateRule(), o = { canAccept: !0, canDelete: !0, canMove: !0 };
|
|
397
411
|
if (!a)
|
|
398
412
|
return o;
|
|
399
413
|
const n = this.getComponentContext(e), { componentClassList: u } = n;
|
|
@@ -408,9 +422,9 @@ class me {
|
|
|
408
422
|
return typeof e == "boolean" ? e : this.parseRuleValueSchema(e, t);
|
|
409
423
|
}
|
|
410
424
|
parseRuleValueSchema(e, t) {
|
|
411
|
-
const
|
|
425
|
+
const s = e.invalidContext || [];
|
|
412
426
|
let a = !0;
|
|
413
|
-
for (const o of
|
|
427
|
+
for (const o of s) {
|
|
414
428
|
if (o.firstLevelChild) {
|
|
415
429
|
if (o.firstLevelChild.class) {
|
|
416
430
|
const { firstLevelChildClassList: n } = t;
|
|
@@ -465,10 +479,10 @@ class me {
|
|
|
465
479
|
return !a;
|
|
466
480
|
}
|
|
467
481
|
getComponentContext(e) {
|
|
468
|
-
var M, L,
|
|
469
|
-
const t = e.schema,
|
|
482
|
+
var M, L, D, k;
|
|
483
|
+
const t = e.schema, s = t.appearance && t.appearance.class || "", a = s.split(" ") || [], o = t.contents || [], n = o.length ? o[0] : null, u = n && n.appearance ? n.appearance.class : "", f = u ? u.split(" ") : [], l = (M = n == null ? void 0 : n.contents) != null && M.length ? n == null ? void 0 : n.contents[0] : null, c = l && l.appearance ? l.appearance.class : "", i = c ? c.split(" ") : [], p = t.type === "component" ? (D = (L = e.parent) == null ? void 0 : L.parent) == null ? void 0 : D.schema : (k = e.parent) == null ? void 0 : k.schema, d = p && p.appearance && p.appearance.class || "", y = d ? d.split(" ") : [];
|
|
470
484
|
return {
|
|
471
|
-
componentClass:
|
|
485
|
+
componentClass: s,
|
|
472
486
|
componentClassList: a,
|
|
473
487
|
childContents: o,
|
|
474
488
|
firstLevelChildSchema: n,
|
|
@@ -478,27 +492,27 @@ class me {
|
|
|
478
492
|
secondLevelChildClass: c,
|
|
479
493
|
secondLevelChildClassList: i,
|
|
480
494
|
parentSchema: p,
|
|
481
|
-
parentClass:
|
|
495
|
+
parentClass: d,
|
|
482
496
|
parentClassList: y
|
|
483
497
|
};
|
|
484
498
|
}
|
|
485
499
|
}
|
|
486
|
-
function ve(
|
|
487
|
-
const t = new
|
|
500
|
+
function ve(r, e) {
|
|
501
|
+
const t = new de(), { canMove: s, canAccept: a, canDelete: o } = t.getTemplateRule(r, e);
|
|
488
502
|
function n(i) {
|
|
489
|
-
return
|
|
503
|
+
return me().basalDragulaRuleForContainer(i, e) ? a : !1;
|
|
490
504
|
}
|
|
491
505
|
function u() {
|
|
492
506
|
return "display: flex;flex-direction:column;height:100%";
|
|
493
507
|
}
|
|
494
508
|
function f() {
|
|
495
|
-
return
|
|
509
|
+
return s;
|
|
496
510
|
}
|
|
497
511
|
function l() {
|
|
498
512
|
return o;
|
|
499
513
|
}
|
|
500
514
|
function c() {
|
|
501
|
-
return !
|
|
515
|
+
return !s && !o;
|
|
502
516
|
}
|
|
503
517
|
return {
|
|
504
518
|
canAccepts: n,
|
|
@@ -508,60 +522,60 @@ function ve(s, e) {
|
|
|
508
522
|
hideNestedPaddingInDesginerView: c
|
|
509
523
|
};
|
|
510
524
|
}
|
|
511
|
-
const
|
|
525
|
+
const ye = /* @__PURE__ */ E({
|
|
512
526
|
name: "FListNavDesign",
|
|
513
|
-
props:
|
|
527
|
+
props: B,
|
|
514
528
|
emits: [],
|
|
515
|
-
setup(
|
|
516
|
-
const t = g(),
|
|
529
|
+
setup(r, e) {
|
|
530
|
+
const t = g(), s = A("designer-host-service"), a = A("design-item-context"), o = ve(a, s), n = fe(t, a, o);
|
|
517
531
|
n.value.canMove = !1, n.value.canNested = !1;
|
|
518
|
-
const u = g(
|
|
519
|
-
const p = {},
|
|
520
|
-
return p[
|
|
532
|
+
const u = g(r.position), f = g(r.title), l = g(!1), c = g(!1), i = j(() => {
|
|
533
|
+
const p = {}, d = ["top", "bottom"].indexOf(u.value) > -1 ? "height" : "width";
|
|
534
|
+
return p[d] = l.value ? "0px" : r.size + "px", p;
|
|
521
535
|
});
|
|
522
|
-
return
|
|
536
|
+
return _(() => {
|
|
523
537
|
t.value.componentInstance = n;
|
|
524
|
-
}), e.expose(n.value), () =>
|
|
538
|
+
}), e.expose(n.value), () => v("div", {
|
|
525
539
|
class: `f-list-nav f-list-nav-${u.value}`
|
|
526
|
-
}, [
|
|
540
|
+
}, [v("div", {
|
|
527
541
|
class: "f-list-nav-in",
|
|
528
542
|
style: i.value
|
|
529
|
-
}, [
|
|
543
|
+
}, [v("div", {
|
|
530
544
|
class: "f-list-nav-main"
|
|
531
|
-
}, [e.slots.navHeader &&
|
|
545
|
+
}, [e.slots.navHeader && v("div", {
|
|
532
546
|
class: "f-list-nav-header"
|
|
533
|
-
}, [e.slots.navHeader()]), !e.slots.navHeader && f.value &&
|
|
547
|
+
}, [e.slots.navHeader()]), !e.slots.navHeader && f.value && v("div", {
|
|
534
548
|
class: "f-list-nav-header"
|
|
535
|
-
}, [
|
|
549
|
+
}, [v("div", {
|
|
536
550
|
class: "f-list-nav-title"
|
|
537
|
-
}, [f.value])]), e.slots.navContent &&
|
|
551
|
+
}, [f.value])]), e.slots.navContent && v("div", {
|
|
538
552
|
class: "f-list-nav-content"
|
|
539
|
-
}, [e.slots.navContent()]), e.slots.navFooter &&
|
|
553
|
+
}, [e.slots.navContent()]), e.slots.navFooter && v("div", {
|
|
540
554
|
class: "f-list-nav-footer"
|
|
541
|
-
}, [e.slots.navFooter()])]),
|
|
555
|
+
}, [e.slots.navFooter()])]), r.collapsible && v("div", {
|
|
542
556
|
class: ["f-list-nav-toggle-sidebar", {
|
|
543
|
-
disabled:
|
|
557
|
+
disabled: r.disabled,
|
|
544
558
|
active: l.value,
|
|
545
559
|
"splitter-pane-collapse-animate": c.value
|
|
546
560
|
}]
|
|
547
|
-
}, [
|
|
561
|
+
}, [v("span", {
|
|
548
562
|
class: "triangle"
|
|
549
563
|
}, null)])])]);
|
|
550
564
|
}
|
|
551
|
-
}),
|
|
552
|
-
install(
|
|
553
|
-
|
|
565
|
+
}), ge = {
|
|
566
|
+
install(r) {
|
|
567
|
+
r.component(P.name, P);
|
|
554
568
|
},
|
|
555
|
-
register(
|
|
556
|
-
|
|
569
|
+
register(r, e, t, s) {
|
|
570
|
+
r["list-nav"] = P, e["list-nav"] = O;
|
|
557
571
|
},
|
|
558
|
-
registerDesigner(
|
|
559
|
-
|
|
572
|
+
registerDesigner(r, e, t) {
|
|
573
|
+
r["list-nav"] = ye, e["list-nav"] = O;
|
|
560
574
|
}
|
|
561
575
|
};
|
|
562
576
|
export {
|
|
563
577
|
P as FListNav,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
578
|
+
ge as default,
|
|
579
|
+
B as listNavProps,
|
|
580
|
+
O as propsResolver
|
|
567
581
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g["list-nav"]={},g.Vue,g.LodashES))})(this,function(g,l,P){"use strict";const w={},A={};function S(r){const{properties:e,title:t,ignore:s}=r,o=s&&Array.isArray(s),a=Object.keys(e).reduce((n,f)=>((!o||!s.find(m=>m===f))&&(n[f]=e[f].type==="object"&&e[f].properties?S(e[f]):P.cloneDeep(e[f].default)),n),{});if(t&&(!o||!s.find(n=>n==="id"))){const n=t.toLowerCase().replace(/-/g,"_");a.id=`${n}_${Math.random().toString().slice(2,6)}`}return a}function F(r,e={},t){const s=w[r];if(s){let o=S(s);const a=A[r];return o=a?a({getSchemaByType:F},o,e,t):o,o}return null}function $(r,e){const t=S(e);return Object.keys(t).reduce((s,o)=>(s[o]&&P.isPlainObject(s[o])&&P.isPlainObject(r[o]||!r[o])?Object.assign(s[o],r[o]||{}):s[o]=r[o],s),t),t}function E(r,e){return Object.keys(r).filter(s=>r[s]!=null).reduce((s,o)=>{if(e.has(o)){const a=e.get(o);if(typeof a=="string")s[a]=r[o];else{const n=a(o,r[o],r);Object.assign(s,n)}}else s[o]=r[o];return s},{})}function q(r,e,t=new Map){const s=$(r,e);return E(s,t)}function R(r={}){function e(c,i,p,u){if(typeof p=="number")return u[c].length===p;if(typeof p=="object"){const y=Object.keys(p)[0],h=p[y];if(y==="not")return Number(u[c].length)!==Number(h);if(y==="moreThan")return Number(u[c].length)>=Number(h);if(y==="lessThan")return Number(u[c].length)<=Number(h)}return!1}function t(c,i,p,u){return u[c]&&u[c].propertyValue&&String(u[c].propertyValue.value)===String(p)}const s=new Map([["length",e],["getProperty",t]]);Object.keys(r).reduce((c,i)=>(c.set(i,r[i]),c),s);function o(c,i){const p=c;return typeof i=="number"?[{target:p,operator:"length",param:null,value:Number(i)}]:typeof i=="boolean"?[{target:p,operator:"getProperty",param:c,value:!!i}]:typeof i=="object"?Object.keys(i).map(u=>{if(u==="length")return{target:p,operator:"length",param:null,value:i[u]};const y=u,h=i[u];return{target:p,operator:"getProperty",param:y,value:h}}):[]}function a(c){return Object.keys(c).reduce((p,u)=>{const y=o(u,c[u]);return p.push(...y),p},[])}function n(c,i){if(s.has(c.operator)){const p=s.get(c.operator);return p&&p(c.target,c.param,c.value,i)||!1}return!1}function f(c,i){return a(c).reduce((y,h)=>y&&n(h,i),!0)}function m(c,i){const p=Object.keys(c),u=p.includes("allOf"),y=p.includes("anyOf"),h=u||y,C=(h?c[h?u?"allOf":"anyOf":"allOf"]:[c]).map(j=>f(j,i));return u?!C.includes(!1):C.includes(!0)}return{parseValueSchema:m}}const T={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},z={},_={};R();function G(r,e,t=new Map,s=(n,f,m,c)=>f,o={},a=n=>n){return w[e.title]=e,A[e.title]=s,z[e.title]=o,_[e.title]=a,(n={})=>{const f=q(n,e,t),m=Object.keys(r).reduce((c,i)=>(c[i]=r[i].default,c),{});return Object.assign(m,f)}}function W(r,e){return{customClass:e.class,customStyle:e.style}}const U=new Map([["appearance",W]]);function Q(r,e,t){return e}const H={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/list-nav.schema.json",title:"list-nav",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a list-nav",type:"string"},type:{description:"The type string of list-nav component",type:"string",default:"list-nav"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},J={title:"list-nav",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0}}}}},V={position:{Type:String,default:"left"},title:{Type:String,default:""},size:{Type:Number||String,default:218},collapsible:{Type:Boolean,default:!0},folded:{Type:Boolean,default:!1},disabled:{Type:Boolean,default:!1},draggable:{Type:Boolean,default:!1}},B=G(V,H,U,Q,J),k=l.defineComponent({name:"FListNav",props:V,emits:["collapse"],setup(r,e){const t=l.ref(r.position),s=l.ref(r.title),o=l.ref(r.folded),a=l.ref(!1);function n(m){m&&m.stopPropagation(),!r.disabled&&(a.value=!0,o.value=!o.value,e.emit("collapse",o.value))}const f=l.computed(()=>{const m={},c=["top","bottom"].indexOf(t.value)>-1?"height":"width";return m[c]=o.value?"0px":r.size+"px",m});return()=>l.createVNode("div",{class:`f-list-nav f-list-nav-${t.value}`},[l.createVNode("div",{class:"f-list-nav-in",style:f.value},[l.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&l.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&s.value&&l.createVNode("div",{class:"f-list-nav-header"},[l.createVNode("div",{class:"f-list-nav-title"},[s.value])]),e.slots.navContent&&l.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&l.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),r.collapsible&&l.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:r.disabled,active:o.value,"splitter-pane-collapse-animate":a.value}],onClick:m=>n(m)},[l.createVNode("span",{class:"triangle"},null)])])])}});function X(r,e,t){var O;const s=t&&t.getStyles&&t.getStyles()||"",o=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=l.ref();function n(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function f(){return!1}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function i(d){if(!d||!d.value)return null;if(d.value.schema&&d.value.schema.type==="component")return d.value;const v=l.ref(d==null?void 0:d.value.parent),b=i(v);return b||null}function p(d=e){const{componentInstance:v,designerItemElementRef:b}=d;return!v||!v.value?null:v.value.canMove?b:p(d.parent)}function u(d){return!!t&&t.canAccepts(d)}function y(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function h(){}function D(d,v){v&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(v)}function M(d,v){const{componentType:b}=d;let N=F(b,d,v);t&&t.onResolveNewComponentSchema&&(N=t.onResolveNewComponentSchema(d,N));const ee=b.toLowerCase().replace(/-/g,"_");return N&&!N.id&&N.type===b&&(N.id=`${ee}_${Math.random().toString().slice(2,6)}`),N}function C(d){}function L(...d){if(t&&t.getPropsConfig)return t.getPropsConfig(...d)}function j(){t&&t.onRemoveComponent&&t.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(d=>{var N;let v=d.id;d.type==="component-ref"&&(v=d.component);const b=r.value.querySelector(`#${v}-design-item`);(N=b==null?void 0:b.componentInstance)!=null&&N.value.onRemoveComponent&&b.componentInstance.value.onRemoveComponent()})}return a.value={canMove:n(),canSelectParent:f(),canDelete:m(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:r,parent:(O=e==null?void 0:e.parent)==null?void 0:O.componentInstance,schema:e==null?void 0:e.schema,styles:s,designerClass:o,canAccepts:u,getBelongedComponentInstance:i,getDraggableDesignItemElement:p,getDraggingDisplayText:y,getPropConfig:L,getDragScopeElement:h,onAcceptMovedChildElement:D,onChildElementMovedOut:C,addNewChildComponentSchema:M,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||l.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||l.ref(!1),onRemoveComponent:j},a}function Y(){function r(e,t){var n;if(!e)return!1;const s=((n=e.targetContainer)==null?void 0:n.componentInstance)&&e.targetContainer.componentInstance.value;if(!s)return!1;const o=s.schema.type,a=t==null?void 0:t.formSchemaUtils.getComponentById(s.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![T["response-layout-item"].type,T["response-form"].type].includes(o)||(e.componentType===T.tabs.type||e.componentType===T.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![T["content-container"].type,T["splitter-pane"].type,T["response-layout-item"].type].includes(o)))}return{basalDragulaRuleForContainer:r}}class Z{getTemplateRule(e,t){const s=t==null?void 0:t.formSchemaUtils,o=s==null?void 0:s.getFormTemplateRule(),a={canAccept:!0,canDelete:!0,canMove:!0};if(!o)return a;const n=this.getComponentContext(e),{componentClassList:f}=n;return f.forEach(m=>{if(!m||!o[m])return;const{canMove:c,canDelete:i,canAccept:p}=o[m];a.canMove=a.canMove&&this.resolveRuleValue(c,n),a.canDelete=a.canDelete&&this.resolveRuleValue(i,n),a.canAccept=a.canAccept&&this.resolveRuleValue(p,n)}),a}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const s=e.invalidContext||[];let o=!0;for(const a of s){if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:n}=t;if(n&&!n.includes(a.firstLevelChild.class)){o=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:n}=t;if(!n||n.type!==a.firstLevelChild.type){o=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:n}=t;if(n&&!n.includes(a.secondLevelChild.class)){o=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:n}=t;if(!n||n.type!==a.secondLevelChild.type){o=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:n}=t;if(n&&!n.includes(a.parent.class)){o=!1;continue}}if(a.parent.type){const{parentSchema:n}=t;if(n&&n.type!==a.parent.type){o=!1;continue}}}o=!0;break}return!o}getComponentContext(e){var D,M,C,L;const t=e.schema,s=t.appearance&&t.appearance.class||"",o=s.split(" ")||[],a=t.contents||[],n=a.length?a[0]:null,f=n&&n.appearance?n.appearance.class:"",m=f?f.split(" "):[],c=(D=n==null?void 0:n.contents)!=null&&D.length?n==null?void 0:n.contents[0]:null,i=c&&c.appearance?c.appearance.class:"",p=i?i.split(" "):[],u=t.type==="component"?(C=(M=e.parent)==null?void 0:M.parent)==null?void 0:C.schema:(L=e.parent)==null?void 0:L.schema,y=u&&u.appearance&&u.appearance.class||"",h=y?y.split(" "):[];return{componentClass:s,componentClassList:o,childContents:a,firstLevelChildSchema:n,firstLevelChildClass:f,firstLevelChildClassList:m,secondLevelChildSchema:c,secondLevelChildClass:i,secondLevelChildClassList:p,parentSchema:u,parentClass:y,parentClassList:h}}}function K(r,e){const t=new Z,{canMove:s,canAccept:o,canDelete:a}=t.getTemplateRule(r,e);function n(p){return Y().basalDragulaRuleForContainer(p,e)?o:!1}function f(){return"display: flex;flex-direction:column;height:100%"}function m(){return s}function c(){return a}function i(){return!s&&!a}return{canAccepts:n,getStyles:f,checkCanMoveComponent:m,checkCanDeleteComponent:c,hideNestedPaddingInDesginerView:i}}const I=l.defineComponent({name:"FListNavDesign",props:V,emits:[],setup(r,e){const t=l.ref(),s=l.inject("designer-host-service"),o=l.inject("design-item-context"),a=K(o,s),n=X(t,o,a);n.value.canMove=!1,n.value.canNested=!1;const f=l.ref(r.position),m=l.ref(r.title),c=l.ref(!1),i=l.ref(!1),p=l.computed(()=>{const u={},y=["top","bottom"].indexOf(f.value)>-1?"height":"width";return u[y]=c.value?"0px":r.size+"px",u});return l.onMounted(()=>{t.value.componentInstance=n}),e.expose(n.value),()=>l.createVNode("div",{class:`f-list-nav f-list-nav-${f.value}`},[l.createVNode("div",{class:"f-list-nav-in",style:p.value},[l.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&l.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&m.value&&l.createVNode("div",{class:"f-list-nav-header"},[l.createVNode("div",{class:"f-list-nav-title"},[m.value])]),e.slots.navContent&&l.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&l.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),r.collapsible&&l.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:r.disabled,active:c.value,"splitter-pane-collapse-animate":i.value}]},[l.createVNode("span",{class:"triangle"},null)])])])}}),x={install(r){r.component(k.name,k)},register(r,e,t,s){r["list-nav"]=k,e["list-nav"]=B},registerDesigner(r,e,t){r["list-nav"]=I,e["list-nav"]=B}};g.FListNav=k,g.default=x,g.listNavProps=V,g.propsResolver=B,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(g,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],i):(g=typeof globalThis<"u"?globalThis:g||self,i(g["list-nav"]={},g.Vue,g.LodashES))})(this,function(g,i,V){"use strict";const A={},j={};function S(r){const{properties:e,title:t,ignore:s}=r,o=s&&Array.isArray(s),a=Object.keys(e).reduce((n,f)=>((!o||!s.find(d=>d===f))&&(n[f]=e[f].type==="object"&&e[f].properties?S(e[f]):V.cloneDeep(e[f].default)),n),{});if(t&&(!o||!s.find(n=>n==="id"))){const n=t.toLowerCase().replace(/-/g,"_");a.id=`${n}_${Math.random().toString().slice(2,6)}`}return a}function F(r){const{properties:e,title:t,required:s}=r;if(s&&Array.isArray(s)){const o=s.reduce((a,n)=>(a[n]=e[n].type==="object"&&e[n].properties?S(e[n]):V.cloneDeep(e[n].default),a),{});if(t&&s.find(a=>a==="id")){const a=t.toLowerCase().replace(/-/g,"_");o.id=`${a}_${Math.random().toString().slice(2,6)}`}return o}return{type:t}}function O(r,e={},t){const s=A[r];if(s){let o=F(s);const a=j[r];return o=a?a({getSchemaByType:O},o,e,t):o,o}return null}function E(r,e){const t=S(e);return Object.keys(t).reduce((s,o)=>(Object.prototype.hasOwnProperty.call(r,o)&&(s[o]&&V.isPlainObject(s[o])&&V.isPlainObject(r[o]||!r[o])?Object.assign(s[o],r[o]||{}):s[o]=r[o]),s),t),t}function q(r,e){return Object.keys(r).filter(s=>r[s]!=null).reduce((s,o)=>{if(e.has(o)){const a=e.get(o);if(typeof a=="string")s[a]=r[o];else{const n=a(o,r[o],r);Object.assign(s,n)}}else s[o]=r[o];return s},{})}function R(r,e,t=new Map){const s=E(r,e);return q(s,t)}function _(r={}){function e(c,l,p,u){if(typeof p=="number")return u[c].length===p;if(typeof p=="object"){const y=Object.keys(p)[0],h=p[y];if(y==="not")return Number(u[c].length)!==Number(h);if(y==="moreThan")return Number(u[c].length)>=Number(h);if(y==="lessThan")return Number(u[c].length)<=Number(h)}return!1}function t(c,l,p,u){return u[c]&&u[c].propertyValue&&String(u[c].propertyValue.value)===String(p)}const s=new Map([["length",e],["getProperty",t]]);Object.keys(r).reduce((c,l)=>(c.set(l,r[l]),c),s);function o(c,l){const p=c;return typeof l=="number"?[{target:p,operator:"length",param:null,value:Number(l)}]:typeof l=="boolean"?[{target:p,operator:"getProperty",param:c,value:!!l}]:typeof l=="object"?Object.keys(l).map(u=>{if(u==="length")return{target:p,operator:"length",param:null,value:l[u]};const y=u,h=l[u];return{target:p,operator:"getProperty",param:y,value:h}}):[]}function a(c){return Object.keys(c).reduce((p,u)=>{const y=o(u,c[u]);return p.push(...y),p},[])}function n(c,l){if(s.has(c.operator)){const p=s.get(c.operator);return p&&p(c.target,c.param,c.value,l)||!1}return!1}function f(c,l){return a(c).reduce((y,h)=>y&&n(h,l),!0)}function d(c,l){const p=Object.keys(c),u=p.includes("allOf"),y=p.includes("anyOf"),h=u||y,T=(h?c[h?u?"allOf":"anyOf":"allOf"]:[c]).map(w=>f(w,l));return u?!T.includes(!1):T.includes(!0)}return{parseValueSchema:d}}const C={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},z={},G={};_();function W(r,e,t=new Map,s=(n,f,d,c)=>f,o={},a=n=>n){return A[e.title]=e,j[e.title]=s,z[e.title]=o,G[e.title]=a,(n={})=>{const f=R(n,e,t),d=Object.keys(r).reduce((c,l)=>(c[l]=r[l].default,c),{});return Object.assign(d,f)}}function U(r,e){return{customClass:e.class,customStyle:e.style}}const Q=new Map([["appearance",U]]);function H(r,e,t){return e}const J={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/list-nav.schema.json",title:"list-nav",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a list-nav",type:"string"},type:{description:"The type string of list-nav component",type:"string",default:"list-nav"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},X={title:"list-nav",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0}}}}},P={position:{Type:String,default:"left"},title:{Type:String,default:""},size:{Type:Number||String,default:218},collapsible:{Type:Boolean,default:!0},folded:{Type:Boolean,default:!1},disabled:{Type:Boolean,default:!1},draggable:{Type:Boolean,default:!1}},B=W(P,J,Q,H,X),k=i.defineComponent({name:"FListNav",props:P,emits:["collapse"],setup(r,e){const t=i.ref(r.position),s=i.ref(r.title),o=i.ref(r.folded),a=i.ref(!1);function n(d){d&&d.stopPropagation(),!r.disabled&&(a.value=!0,o.value=!o.value,e.emit("collapse",o.value))}const f=i.computed(()=>{const d={},c=["top","bottom"].indexOf(t.value)>-1?"height":"width";return d[c]=o.value?"0px":r.size+"px",d});return()=>i.createVNode("div",{class:`f-list-nav f-list-nav-${t.value}`},[i.createVNode("div",{class:"f-list-nav-in",style:f.value},[i.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&i.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&s.value&&i.createVNode("div",{class:"f-list-nav-header"},[i.createVNode("div",{class:"f-list-nav-title"},[s.value])]),e.slots.navContent&&i.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&i.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),r.collapsible&&i.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:r.disabled,active:o.value,"splitter-pane-collapse-animate":a.value}],onClick:d=>n(d)},[i.createVNode("span",{class:"triangle"},null)])])])}});function Y(r,e,t){var $;const s=t&&t.getStyles&&t.getStyles()||"",o=t&&t.getDesignerClass&&t.getDesignerClass()||"",a=i.ref();function n(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function f(){return!1}function d(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function l(m){if(!m||!m.value)return null;if(m.value.schema&&m.value.schema.type==="component")return m.value;const v=i.ref(m==null?void 0:m.value.parent),b=l(v);return b||null}function p(m=e){const{componentInstance:v,designerItemElementRef:b}=m;return!v||!v.value?null:v.value.canMove?b:p(m.parent)}function u(m){return!!t&&t.canAccepts(m)}function y(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function h(){}function D(m,v){v&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(v)}function M(m,v){const{componentType:b}=m;let N=O(b,m,v);t&&t.onResolveNewComponentSchema&&(N=t.onResolveNewComponentSchema(m,N));const te=b.toLowerCase().replace(/-/g,"_");return N&&!N.id&&N.type===b&&(N.id=`${te}_${Math.random().toString().slice(2,6)}`),N}function T(m){}function L(...m){if(t&&t.getPropsConfig)return t.getPropsConfig(...m)}function w(){t&&t.onRemoveComponent&&t.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(m=>{var N;let v=m.id;m.type==="component-ref"&&(v=m.component);const b=r.value.querySelector(`#${v}-design-item`);(N=b==null?void 0:b.componentInstance)!=null&&N.value.onRemoveComponent&&b.componentInstance.value.onRemoveComponent()})}return a.value={canMove:n(),canSelectParent:f(),canDelete:d(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:r,parent:($=e==null?void 0:e.parent)==null?void 0:$.componentInstance,schema:e==null?void 0:e.schema,styles:s,designerClass:o,canAccepts:u,getBelongedComponentInstance:l,getDraggableDesignItemElement:p,getDraggingDisplayText:y,getPropConfig:L,getDragScopeElement:h,onAcceptMovedChildElement:D,onChildElementMovedOut:T,addNewChildComponentSchema:M,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||i.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||i.ref(!1),onRemoveComponent:w},a}function Z(){function r(e,t){var n;if(!e)return!1;const s=((n=e.targetContainer)==null?void 0:n.componentInstance)&&e.targetContainer.componentInstance.value;if(!s)return!1;const o=s.schema.type,a=t==null?void 0:t.formSchemaUtils.getComponentById(s.belongedComponentId);return!((e.componentCategory==="input"||e.componentType==="form-group")&&![C["response-layout-item"].type,C["response-form"].type].includes(o)||(e.componentType===C.tabs.type||e.componentType===C.section.type)&&((a==null?void 0:a.componentType)!=="frame"||![C["content-container"].type,C["splitter-pane"].type,C["response-layout-item"].type].includes(o)))}return{basalDragulaRuleForContainer:r}}class K{getTemplateRule(e,t){const s=t==null?void 0:t.formSchemaUtils,o=s==null?void 0:s.getFormTemplateRule(),a={canAccept:!0,canDelete:!0,canMove:!0};if(!o)return a;const n=this.getComponentContext(e),{componentClassList:f}=n;return f.forEach(d=>{if(!d||!o[d])return;const{canMove:c,canDelete:l,canAccept:p}=o[d];a.canMove=a.canMove&&this.resolveRuleValue(c,n),a.canDelete=a.canDelete&&this.resolveRuleValue(l,n),a.canAccept=a.canAccept&&this.resolveRuleValue(p,n)}),a}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const s=e.invalidContext||[];let o=!0;for(const a of s){if(a.firstLevelChild){if(a.firstLevelChild.class){const{firstLevelChildClassList:n}=t;if(n&&!n.includes(a.firstLevelChild.class)){o=!1;continue}}if(a.firstLevelChild.type){const{firstLevelChildSchema:n}=t;if(!n||n.type!==a.firstLevelChild.type){o=!1;continue}}}if(a.secondLevelChild){if(a.secondLevelChild.class){const{secondLevelChildClassList:n}=t;if(n&&!n.includes(a.secondLevelChild.class)){o=!1;continue}}if(a.secondLevelChild.type){const{secondLevelChildSchema:n}=t;if(!n||n.type!==a.secondLevelChild.type){o=!1;continue}}}if(a.parent){if(a.parent.class){const{parentClassList:n}=t;if(n&&!n.includes(a.parent.class)){o=!1;continue}}if(a.parent.type){const{parentSchema:n}=t;if(n&&n.type!==a.parent.type){o=!1;continue}}}o=!0;break}return!o}getComponentContext(e){var D,M,T,L;const t=e.schema,s=t.appearance&&t.appearance.class||"",o=s.split(" ")||[],a=t.contents||[],n=a.length?a[0]:null,f=n&&n.appearance?n.appearance.class:"",d=f?f.split(" "):[],c=(D=n==null?void 0:n.contents)!=null&&D.length?n==null?void 0:n.contents[0]:null,l=c&&c.appearance?c.appearance.class:"",p=l?l.split(" "):[],u=t.type==="component"?(T=(M=e.parent)==null?void 0:M.parent)==null?void 0:T.schema:(L=e.parent)==null?void 0:L.schema,y=u&&u.appearance&&u.appearance.class||"",h=y?y.split(" "):[];return{componentClass:s,componentClassList:o,childContents:a,firstLevelChildSchema:n,firstLevelChildClass:f,firstLevelChildClassList:d,secondLevelChildSchema:c,secondLevelChildClass:l,secondLevelChildClassList:p,parentSchema:u,parentClass:y,parentClassList:h}}}function I(r,e){const t=new K,{canMove:s,canAccept:o,canDelete:a}=t.getTemplateRule(r,e);function n(p){return Z().basalDragulaRuleForContainer(p,e)?o:!1}function f(){return"display: flex;flex-direction:column;height:100%"}function d(){return s}function c(){return a}function l(){return!s&&!a}return{canAccepts:n,getStyles:f,checkCanMoveComponent:d,checkCanDeleteComponent:c,hideNestedPaddingInDesginerView:l}}const x=i.defineComponent({name:"FListNavDesign",props:P,emits:[],setup(r,e){const t=i.ref(),s=i.inject("designer-host-service"),o=i.inject("design-item-context"),a=I(o,s),n=Y(t,o,a);n.value.canMove=!1,n.value.canNested=!1;const f=i.ref(r.position),d=i.ref(r.title),c=i.ref(!1),l=i.ref(!1),p=i.computed(()=>{const u={},y=["top","bottom"].indexOf(f.value)>-1?"height":"width";return u[y]=c.value?"0px":r.size+"px",u});return i.onMounted(()=>{t.value.componentInstance=n}),e.expose(n.value),()=>i.createVNode("div",{class:`f-list-nav f-list-nav-${f.value}`},[i.createVNode("div",{class:"f-list-nav-in",style:p.value},[i.createVNode("div",{class:"f-list-nav-main"},[e.slots.navHeader&&i.createVNode("div",{class:"f-list-nav-header"},[e.slots.navHeader()]),!e.slots.navHeader&&d.value&&i.createVNode("div",{class:"f-list-nav-header"},[i.createVNode("div",{class:"f-list-nav-title"},[d.value])]),e.slots.navContent&&i.createVNode("div",{class:"f-list-nav-content"},[e.slots.navContent()]),e.slots.navFooter&&i.createVNode("div",{class:"f-list-nav-footer"},[e.slots.navFooter()])]),r.collapsible&&i.createVNode("div",{class:["f-list-nav-toggle-sidebar",{disabled:r.disabled,active:c.value,"splitter-pane-collapse-animate":l.value}]},[i.createVNode("span",{class:"triangle"},null)])])])}}),ee={install(r){r.component(k.name,k)},register(r,e,t,s){r["list-nav"]=k,e["list-nav"]=B},registerDesigner(r,e,t){r["list-nav"]=x,e["list-nav"]=B}};g.FListNav=k,g.default=ee,g.listNavProps=P,g.propsResolver=B,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|