@farris/ui-vue 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +7 -5
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4057 -4304
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2450 -2467
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3593 -3585
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +163 -2643
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +500 -486
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +485 -470
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +2611 -2623
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +3825 -3837
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +3720 -3712
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +312 -296
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +4748 -4992
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4215 -4462
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +3015 -3027
- package/components/query-solution/index.umd.cjs +5 -5
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +293 -280
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +632 -617
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +2994 -3006
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +749 -733
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +7750 -7990
- package/farris.all.umd.cjs +12 -12
- package/package.json +1 -1
- package/types/data-view/composition/types.d.ts +0 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
- package/components/event-parameter/index.css +0 -1
- package/types/data-grid/src/components/data/data-grid-area.component.d.ts +0 -8
- package/types/data-grid/src/components/data/data-grid-area.props.d.ts +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isPlainObject as L, cloneDeep as
|
|
1
|
+
import { defineComponent as C, ref as m, watch as E, computed as R, onMounted as T, createVNode as M, nextTick as k, inject as U } from "vue";
|
|
2
|
+
import { isPlainObject as L, cloneDeep as W } from "lodash-es";
|
|
3
3
|
import { withInstall as X } from "../common/index.esm.js";
|
|
4
4
|
const Y = "https://json-schema.org/draft/2020-12/schema", Z = "https://farris-design.gitee.io/capsule.schema.json", I = "capsule", K = "A Farris Component", x = "object", ee = {
|
|
5
5
|
id: {
|
|
@@ -74,119 +74,133 @@ const Y = "https://json-schema.org/draft/2020-12/schema", Z = "https://farris-de
|
|
|
74
74
|
type: x,
|
|
75
75
|
properties: ee,
|
|
76
76
|
required: te
|
|
77
|
-
},
|
|
78
|
-
function
|
|
79
|
-
const { properties: e, title:
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
|
|
77
|
+
}, _ = {}, H = {};
|
|
78
|
+
function F(t) {
|
|
79
|
+
const { properties: e, title: u, ignore: a } = t, l = a && Array.isArray(a), r = Object.keys(e).reduce((o, h) => ((!l || !a.find((A) => A === h)) && (o[h] = e[h].type === "object" && e[h].properties ? F(e[h]) : W(e[h].default)), o), {});
|
|
80
|
+
if (u && (!l || !a.find((o) => o === "id"))) {
|
|
81
|
+
const o = u.toLowerCase().replace(/-/g, "_");
|
|
82
|
+
r.id = `${o}_${Math.random().toString().slice(2, 6)}`;
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return r;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
function ae(t) {
|
|
87
|
+
const { properties: e, title: u, required: a } = t;
|
|
88
|
+
if (a && Array.isArray(a)) {
|
|
89
|
+
const l = a.reduce((r, o) => (r[o] = e[o].type === "object" && e[o].properties ? F(e[o]) : W(e[o].default), r), {});
|
|
90
|
+
if (u && a.find((r) => r === "id")) {
|
|
91
|
+
const r = u.toLowerCase().replace(/-/g, "_");
|
|
92
|
+
l.id = `${r}_${Math.random().toString().slice(2, 6)}`;
|
|
93
|
+
}
|
|
94
|
+
return l;
|
|
92
95
|
}
|
|
93
|
-
return
|
|
96
|
+
return {
|
|
97
|
+
type: u
|
|
98
|
+
};
|
|
94
99
|
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
|
|
100
|
+
function z(t, e = {}, u) {
|
|
101
|
+
const a = _[t];
|
|
102
|
+
if (a) {
|
|
103
|
+
let l = ae(a);
|
|
104
|
+
const r = H[t];
|
|
105
|
+
return l = r ? r({ getSchemaByType: z }, l, e, u) : l, l;
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
98
108
|
}
|
|
99
109
|
function le(t, e) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
const u = F(e);
|
|
111
|
+
return Object.keys(u).reduce((a, l) => (Object.prototype.hasOwnProperty.call(t, l) && (a[l] && L(a[l]) && L(t[l] || !t[l]) ? Object.assign(a[l], t[l] || {}) : a[l] = t[l]), a), u), u;
|
|
112
|
+
}
|
|
113
|
+
function se(t, e) {
|
|
114
|
+
return Object.keys(t).filter((a) => t[a] != null).reduce((a, l) => {
|
|
115
|
+
if (e.has(l)) {
|
|
116
|
+
const r = e.get(l);
|
|
117
|
+
if (typeof r == "string")
|
|
118
|
+
a[r] = t[l];
|
|
105
119
|
else {
|
|
106
|
-
const
|
|
107
|
-
Object.assign(
|
|
120
|
+
const o = r(l, t[l], t);
|
|
121
|
+
Object.assign(a, o);
|
|
108
122
|
}
|
|
109
123
|
} else
|
|
110
|
-
l
|
|
111
|
-
return
|
|
124
|
+
a[l] = t[l];
|
|
125
|
+
return a;
|
|
112
126
|
}, {});
|
|
113
127
|
}
|
|
114
|
-
function
|
|
115
|
-
const
|
|
116
|
-
return
|
|
128
|
+
function ce(t, e, u = /* @__PURE__ */ new Map()) {
|
|
129
|
+
const a = le(t, e);
|
|
130
|
+
return se(a, u);
|
|
117
131
|
}
|
|
118
|
-
function
|
|
119
|
-
function e(c, p, f,
|
|
132
|
+
function re(t = {}) {
|
|
133
|
+
function e(c, p, f, d) {
|
|
120
134
|
if (typeof f == "number")
|
|
121
|
-
return
|
|
135
|
+
return d[c].length === f;
|
|
122
136
|
if (typeof f == "object") {
|
|
123
|
-
const y = Object.keys(f)[0],
|
|
137
|
+
const y = Object.keys(f)[0], g = f[y];
|
|
124
138
|
if (y === "not")
|
|
125
|
-
return Number(
|
|
139
|
+
return Number(d[c].length) !== Number(g);
|
|
126
140
|
if (y === "moreThan")
|
|
127
|
-
return Number(
|
|
141
|
+
return Number(d[c].length) >= Number(g);
|
|
128
142
|
if (y === "lessThan")
|
|
129
|
-
return Number(
|
|
143
|
+
return Number(d[c].length) <= Number(g);
|
|
130
144
|
}
|
|
131
145
|
return !1;
|
|
132
146
|
}
|
|
133
|
-
function
|
|
134
|
-
return
|
|
147
|
+
function u(c, p, f, d) {
|
|
148
|
+
return d[c] && d[c].propertyValue && String(d[c].propertyValue.value) === String(f);
|
|
135
149
|
}
|
|
136
|
-
const
|
|
150
|
+
const a = /* @__PURE__ */ new Map([
|
|
137
151
|
["length", e],
|
|
138
|
-
["getProperty",
|
|
152
|
+
["getProperty", u]
|
|
139
153
|
]);
|
|
140
|
-
Object.keys(t).reduce((c, p) => (c.set(p, t[p]), c),
|
|
141
|
-
function
|
|
154
|
+
Object.keys(t).reduce((c, p) => (c.set(p, t[p]), c), a);
|
|
155
|
+
function l(c, p) {
|
|
142
156
|
const f = c;
|
|
143
|
-
return typeof p == "number" ? [{ target: f, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: f, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((
|
|
144
|
-
if (
|
|
145
|
-
return { target: f, operator: "length", param: null, value: p[
|
|
146
|
-
const y =
|
|
147
|
-
return { target: f, operator: "getProperty", param: y, value:
|
|
157
|
+
return typeof p == "number" ? [{ target: f, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: f, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((d) => {
|
|
158
|
+
if (d === "length")
|
|
159
|
+
return { target: f, operator: "length", param: null, value: p[d] };
|
|
160
|
+
const y = d, g = p[d];
|
|
161
|
+
return { target: f, operator: "getProperty", param: y, value: g };
|
|
148
162
|
}) : [];
|
|
149
163
|
}
|
|
150
|
-
function
|
|
151
|
-
return Object.keys(c).reduce((f,
|
|
152
|
-
const y =
|
|
164
|
+
function r(c) {
|
|
165
|
+
return Object.keys(c).reduce((f, d) => {
|
|
166
|
+
const y = l(d, c[d]);
|
|
153
167
|
return f.push(...y), f;
|
|
154
168
|
}, []);
|
|
155
169
|
}
|
|
156
|
-
function
|
|
157
|
-
if (
|
|
158
|
-
const f =
|
|
170
|
+
function o(c, p) {
|
|
171
|
+
if (a.has(c.operator)) {
|
|
172
|
+
const f = a.get(c.operator);
|
|
159
173
|
return f && f(c.target, c.param, c.value, p) || !1;
|
|
160
174
|
}
|
|
161
175
|
return !1;
|
|
162
176
|
}
|
|
163
177
|
function h(c, p) {
|
|
164
|
-
return
|
|
178
|
+
return r(c).reduce((y, g) => y && o(g, p), !0);
|
|
165
179
|
}
|
|
166
180
|
function A(c, p) {
|
|
167
|
-
const f = Object.keys(c),
|
|
168
|
-
return
|
|
181
|
+
const f = Object.keys(c), d = f.includes("allOf"), y = f.includes("anyOf"), g = d || y, B = (g ? c[g ? d ? "allOf" : "anyOf" : "allOf"] : [c]).map(($) => h($, p));
|
|
182
|
+
return d ? !B.includes(!1) : B.includes(!0);
|
|
169
183
|
}
|
|
170
184
|
return { parseValueSchema: A };
|
|
171
185
|
}
|
|
172
|
-
const ue = {},
|
|
173
|
-
|
|
174
|
-
function
|
|
175
|
-
return
|
|
176
|
-
const h =
|
|
186
|
+
const ue = {}, oe = {};
|
|
187
|
+
re();
|
|
188
|
+
function ie(t, e, u = /* @__PURE__ */ new Map(), a = (o, h, A, c) => h, l = {}, r = (o) => o) {
|
|
189
|
+
return _[e.title] = e, H[e.title] = a, ue[e.title] = l, oe[e.title] = r, (o = {}) => {
|
|
190
|
+
const h = ce(o, e, u), A = Object.keys(t).reduce((c, p) => (c[p] = t[p].default, c), {});
|
|
177
191
|
return Object.assign(A, h);
|
|
178
192
|
};
|
|
179
193
|
}
|
|
180
|
-
function
|
|
194
|
+
function pe(t, e) {
|
|
181
195
|
return { customClass: e.class, customStyle: e.style };
|
|
182
196
|
}
|
|
183
|
-
const
|
|
184
|
-
["appearance",
|
|
197
|
+
const fe = /* @__PURE__ */ new Map([
|
|
198
|
+
["appearance", pe]
|
|
185
199
|
]);
|
|
186
|
-
function
|
|
200
|
+
function de(t, e, u) {
|
|
187
201
|
return e;
|
|
188
202
|
}
|
|
189
|
-
const ve = "capsule",
|
|
203
|
+
const ve = "capsule", me = "A Farris Component", ye = "object", he = {
|
|
190
204
|
basic: {
|
|
191
205
|
description: "Basic Infomation",
|
|
192
206
|
title: "基本信息",
|
|
@@ -208,12 +222,12 @@ const ve = "capsule", de = "A Farris Component", me = "object", ye = {
|
|
|
208
222
|
}
|
|
209
223
|
}
|
|
210
224
|
}
|
|
211
|
-
},
|
|
225
|
+
}, ge = {
|
|
212
226
|
title: ve,
|
|
213
|
-
description:
|
|
214
|
-
type:
|
|
215
|
-
categories:
|
|
216
|
-
},
|
|
227
|
+
description: me,
|
|
228
|
+
type: ye,
|
|
229
|
+
categories: he
|
|
230
|
+
}, q = {
|
|
217
231
|
items: {
|
|
218
232
|
Type: Array,
|
|
219
233
|
default: [
|
|
@@ -234,124 +248,124 @@ const ve = "capsule", de = "A Farris Component", me = "object", ye = {
|
|
|
234
248
|
index: { type: Number, default: 0 },
|
|
235
249
|
show: { type: Boolean, default: !0 },
|
|
236
250
|
disabled: { type: Boolean, default: !1 }
|
|
237
|
-
},
|
|
251
|
+
}, G = ie(q, ne, fe, de, ge), J = /* @__PURE__ */ C({
|
|
238
252
|
name: "FCapsuleItem",
|
|
239
253
|
props: be,
|
|
240
254
|
emits: ["mounted", "active"],
|
|
241
255
|
setup(t, e) {
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
256
|
+
const u = m(), a = m(t.isActive);
|
|
257
|
+
E(() => t.isActive, (o) => {
|
|
258
|
+
a.value = o;
|
|
245
259
|
});
|
|
246
|
-
const
|
|
260
|
+
const l = R(() => ({
|
|
247
261
|
"f-capsule-item": !0,
|
|
248
|
-
"f-capsule-active-item":
|
|
262
|
+
"f-capsule-active-item": a.value,
|
|
249
263
|
"f-capsule-disabled": t.disabled
|
|
250
264
|
}));
|
|
251
265
|
T(() => {
|
|
252
|
-
e.emit("mounted",
|
|
266
|
+
e.emit("mounted", u, t.value);
|
|
253
267
|
});
|
|
254
|
-
function o
|
|
255
|
-
t.disabled || e.emit("active",
|
|
268
|
+
function r(o) {
|
|
269
|
+
t.disabled || e.emit("active", o, {
|
|
256
270
|
name: t.name,
|
|
257
271
|
value: t.value
|
|
258
272
|
});
|
|
259
273
|
}
|
|
260
|
-
return () =>
|
|
261
|
-
ref:
|
|
262
|
-
class:
|
|
263
|
-
onClick: (
|
|
264
|
-
}, [t.icon &&
|
|
274
|
+
return () => M("div", {
|
|
275
|
+
ref: u,
|
|
276
|
+
class: l.value,
|
|
277
|
+
onClick: (o) => r(o)
|
|
278
|
+
}, [t.icon && M("i", {
|
|
265
279
|
class: t.icon
|
|
266
280
|
}, null), t.name]);
|
|
267
281
|
}
|
|
268
|
-
}), N = /* @__PURE__ */
|
|
282
|
+
}), N = /* @__PURE__ */ C({
|
|
269
283
|
name: "FCapsule",
|
|
270
|
-
props:
|
|
284
|
+
props: q,
|
|
271
285
|
emits: ["change", "update:modelValue"],
|
|
272
286
|
setup(t, e) {
|
|
273
|
-
const
|
|
274
|
-
const
|
|
287
|
+
const u = m(t.items), a = m(), l = 2, r = m(t.modelValue), o = m("none"), h = m(t.type), A = R(() => {
|
|
288
|
+
const s = {
|
|
275
289
|
"f-capsule-container": !0
|
|
276
290
|
};
|
|
277
|
-
return h.value && (
|
|
278
|
-
}), c =
|
|
291
|
+
return h.value && (s[h.value] = !0), s;
|
|
292
|
+
}), c = R(() => ({})), p = R(() => ({
|
|
279
293
|
"f-capsule": !0
|
|
280
|
-
})), f = m(
|
|
294
|
+
})), f = m(l), d = m(0), y = m(0), g = R(() => ({
|
|
281
295
|
left: `${f.value}px`,
|
|
282
|
-
width: `${
|
|
283
|
-
transition:
|
|
284
|
-
})), V =
|
|
296
|
+
width: `${d.value}px`,
|
|
297
|
+
transition: o.value
|
|
298
|
+
})), V = R(() => ({
|
|
285
299
|
width: `${y.value}px`
|
|
286
|
-
})),
|
|
287
|
-
function
|
|
300
|
+
})), w = /* @__PURE__ */ new Map();
|
|
301
|
+
function B(s) {
|
|
288
302
|
var n;
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
const j =
|
|
293
|
-
f.value = j.left - D.left +
|
|
303
|
+
if (w.has(s.value)) {
|
|
304
|
+
const i = (n = w.get(s.value)) == null ? void 0 : n.value;
|
|
305
|
+
if (i) {
|
|
306
|
+
const j = i.getBoundingClientRect(), D = a.value.getBoundingClientRect();
|
|
307
|
+
f.value = j.left - D.left + l + a.value.scrollLeft, d.value = j.width - 2 * l;
|
|
294
308
|
}
|
|
295
309
|
}
|
|
296
310
|
}
|
|
297
|
-
function
|
|
298
|
-
const
|
|
299
|
-
|
|
311
|
+
function S(s, n) {
|
|
312
|
+
const i = s.value;
|
|
313
|
+
r.value = i, e.emit("update:modelValue", i), B(s), n && e.emit("change", i);
|
|
300
314
|
}
|
|
301
|
-
function
|
|
302
|
-
const n =
|
|
303
|
-
n > -1 &&
|
|
315
|
+
function $(s) {
|
|
316
|
+
const n = u.value.findIndex((i) => i.value === s);
|
|
317
|
+
n > -1 && S(u.value[n], !1);
|
|
304
318
|
}
|
|
305
|
-
|
|
306
|
-
|
|
319
|
+
E(() => t.modelValue, (s) => {
|
|
320
|
+
r.value = s, $(r.value);
|
|
307
321
|
}), T(async () => {
|
|
308
|
-
|
|
322
|
+
$(r.value), await k(), o.value = "0.1s ease-out all", y.value = Array.from(w.values()).reduce((s, n) => (s += n.value.clientWidth, s), 0);
|
|
309
323
|
});
|
|
310
|
-
function
|
|
311
|
-
|
|
324
|
+
function P(s, n) {
|
|
325
|
+
S(n, !0);
|
|
312
326
|
}
|
|
313
|
-
function
|
|
314
|
-
|
|
327
|
+
function v(s, n) {
|
|
328
|
+
w.set(n, s);
|
|
315
329
|
}
|
|
316
|
-
function O(
|
|
317
|
-
Array.from(
|
|
318
|
-
|
|
330
|
+
function O(s) {
|
|
331
|
+
Array.from(w.keys()).forEach((n) => {
|
|
332
|
+
s.find((j) => j.value === n) || w.delete(n);
|
|
319
333
|
});
|
|
320
334
|
}
|
|
321
|
-
function
|
|
322
|
-
return
|
|
323
|
-
name:
|
|
324
|
-
value:
|
|
325
|
-
isActive:
|
|
335
|
+
function b(s, n) {
|
|
336
|
+
return M(J, {
|
|
337
|
+
name: s.name,
|
|
338
|
+
value: s.value,
|
|
339
|
+
isActive: s.value === r.value,
|
|
326
340
|
index: n,
|
|
327
|
-
disabled:
|
|
328
|
-
key:
|
|
329
|
-
onMounted:
|
|
330
|
-
onActive:
|
|
341
|
+
disabled: s.disabled,
|
|
342
|
+
key: s.value,
|
|
343
|
+
onMounted: v,
|
|
344
|
+
onActive: P
|
|
331
345
|
}, null);
|
|
332
346
|
}
|
|
333
|
-
return
|
|
334
|
-
const n =
|
|
335
|
-
O(n),
|
|
336
|
-
}), () =>
|
|
337
|
-
ref:
|
|
347
|
+
return E(() => t.items, async (s) => {
|
|
348
|
+
const n = s.filter((i) => i.show);
|
|
349
|
+
O(n), u.value = n, await k(), $(r.value), y.value = Array.from(w.values()).reduce((i, j) => (i += j.value.clientWidth, i), 0);
|
|
350
|
+
}), () => M("span", {
|
|
351
|
+
ref: a,
|
|
338
352
|
class: A.value,
|
|
339
353
|
style: c.value
|
|
340
|
-
}, [
|
|
354
|
+
}, [M("span", {
|
|
341
355
|
class: "f-capsule-pane"
|
|
342
|
-
}, [
|
|
356
|
+
}, [u.value.map((s, n) => b(s, n))]), M("small", {
|
|
343
357
|
class: p.value,
|
|
344
|
-
style:
|
|
345
|
-
}, null),
|
|
358
|
+
style: g.value
|
|
359
|
+
}, null), M("div", {
|
|
346
360
|
class: "f-capsule-board",
|
|
347
361
|
style: V.value
|
|
348
362
|
}, null)]);
|
|
349
363
|
}
|
|
350
364
|
});
|
|
351
|
-
function
|
|
352
|
-
var
|
|
353
|
-
const
|
|
354
|
-
function
|
|
365
|
+
function je(t, e, u) {
|
|
366
|
+
var P;
|
|
367
|
+
const a = "", l = "", r = m();
|
|
368
|
+
function o() {
|
|
355
369
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
356
370
|
}
|
|
357
371
|
function h() {
|
|
@@ -363,162 +377,162 @@ function ge(t, e, r) {
|
|
|
363
377
|
function c() {
|
|
364
378
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
365
379
|
}
|
|
366
|
-
function p(
|
|
367
|
-
if (!
|
|
380
|
+
function p(v) {
|
|
381
|
+
if (!v || !v.value)
|
|
368
382
|
return null;
|
|
369
|
-
if (
|
|
370
|
-
return
|
|
371
|
-
const O = m(
|
|
372
|
-
return
|
|
383
|
+
if (v.value.schema && v.value.schema.type === "component")
|
|
384
|
+
return v.value;
|
|
385
|
+
const O = m(v == null ? void 0 : v.value.parent), b = p(O);
|
|
386
|
+
return b || null;
|
|
373
387
|
}
|
|
374
|
-
function f(
|
|
375
|
-
const { componentInstance: O, designerItemElementRef:
|
|
376
|
-
return !O || !O.value ? null : O.value.canMove ?
|
|
388
|
+
function f(v = e) {
|
|
389
|
+
const { componentInstance: O, designerItemElementRef: b } = v;
|
|
390
|
+
return !O || !O.value ? null : O.value.canMove ? b : f(v.parent);
|
|
377
391
|
}
|
|
378
|
-
function v
|
|
379
|
-
return !!
|
|
392
|
+
function d(v) {
|
|
393
|
+
return !!u;
|
|
380
394
|
}
|
|
381
395
|
function y() {
|
|
382
396
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
383
397
|
}
|
|
384
|
-
function
|
|
398
|
+
function g() {
|
|
385
399
|
}
|
|
386
|
-
function V(
|
|
400
|
+
function V(v, O) {
|
|
387
401
|
}
|
|
388
|
-
function
|
|
389
|
-
const { componentType:
|
|
390
|
-
let
|
|
391
|
-
const n =
|
|
392
|
-
return
|
|
402
|
+
function w(v, O) {
|
|
403
|
+
const { componentType: b } = v;
|
|
404
|
+
let s = z(b, v, O);
|
|
405
|
+
const n = b.toLowerCase().replace(/-/g, "_");
|
|
406
|
+
return s && !s.id && s.type === b && (s.id = `${n}_${Math.random().toString().slice(2, 6)}`), s;
|
|
393
407
|
}
|
|
394
|
-
function
|
|
408
|
+
function B(v) {
|
|
395
409
|
}
|
|
396
|
-
function
|
|
410
|
+
function S(...v) {
|
|
397
411
|
}
|
|
398
|
-
function
|
|
399
|
-
e != null && e.schema.contents && e.schema.contents.map((
|
|
400
|
-
var
|
|
401
|
-
let O =
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
(
|
|
412
|
+
function $() {
|
|
413
|
+
e != null && e.schema.contents && e.schema.contents.map((v) => {
|
|
414
|
+
var s;
|
|
415
|
+
let O = v.id;
|
|
416
|
+
v.type === "component-ref" && (O = v.component);
|
|
417
|
+
const b = t.value.querySelector(`#${O}-design-item`);
|
|
418
|
+
(s = b == null ? void 0 : b.componentInstance) != null && s.value.onRemoveComponent && b.componentInstance.value.onRemoveComponent();
|
|
405
419
|
});
|
|
406
420
|
}
|
|
407
|
-
return
|
|
408
|
-
canMove:
|
|
421
|
+
return r.value = {
|
|
422
|
+
canMove: o(),
|
|
409
423
|
canSelectParent: h(),
|
|
410
424
|
canDelete: A(),
|
|
411
425
|
canNested: !c(),
|
|
412
426
|
contents: e == null ? void 0 : e.schema.contents,
|
|
413
427
|
elementRef: t,
|
|
414
|
-
parent: (
|
|
428
|
+
parent: (P = e == null ? void 0 : e.parent) == null ? void 0 : P.componentInstance,
|
|
415
429
|
schema: e == null ? void 0 : e.schema,
|
|
416
|
-
styles:
|
|
417
|
-
designerClass:
|
|
418
|
-
canAccepts:
|
|
430
|
+
styles: a,
|
|
431
|
+
designerClass: l,
|
|
432
|
+
canAccepts: d,
|
|
419
433
|
getBelongedComponentInstance: p,
|
|
420
434
|
getDraggableDesignItemElement: f,
|
|
421
435
|
getDraggingDisplayText: y,
|
|
422
|
-
getPropConfig:
|
|
423
|
-
getDragScopeElement:
|
|
436
|
+
getPropConfig: S,
|
|
437
|
+
getDragScopeElement: g,
|
|
424
438
|
onAcceptMovedChildElement: V,
|
|
425
|
-
onChildElementMovedOut:
|
|
426
|
-
addNewChildComponentSchema:
|
|
439
|
+
onChildElementMovedOut: B,
|
|
440
|
+
addNewChildComponentSchema: w,
|
|
427
441
|
triggerBelongedComponentToMoveWhenMoved: m(!1),
|
|
428
442
|
triggerBelongedComponentToDeleteWhenDeleted: m(!1),
|
|
429
|
-
onRemoveComponent:
|
|
430
|
-
},
|
|
443
|
+
onRemoveComponent: $
|
|
444
|
+
}, r;
|
|
431
445
|
}
|
|
432
|
-
const
|
|
446
|
+
const Oe = /* @__PURE__ */ C({
|
|
433
447
|
name: "FCapsuleDesign",
|
|
434
|
-
props:
|
|
448
|
+
props: q,
|
|
435
449
|
emits: ["change", "update:modelValue"],
|
|
436
450
|
setup(t, e) {
|
|
437
|
-
const
|
|
451
|
+
const u = m(t.items), a = m(), l = 2, r = m(t.modelValue), o = m("none"), h = m(t.type), A = U("design-item-context"), c = je(a, A);
|
|
438
452
|
T(() => {
|
|
439
|
-
|
|
453
|
+
a.value.componentInstance = c;
|
|
440
454
|
}), e.expose(c.value);
|
|
441
|
-
const p =
|
|
455
|
+
const p = R(() => {
|
|
442
456
|
const n = {
|
|
443
457
|
"f-capsule-container": !0
|
|
444
458
|
};
|
|
445
459
|
return h.value && (n[h.value] = !0), n;
|
|
446
|
-
}), f =
|
|
460
|
+
}), f = R(() => ({})), d = R(() => ({
|
|
447
461
|
"f-capsule": !0
|
|
448
|
-
})), y = m(
|
|
462
|
+
})), y = m(l), g = m(0), V = m(0), w = R(() => ({
|
|
449
463
|
left: `${y.value}px`,
|
|
450
|
-
width: `${
|
|
451
|
-
transition:
|
|
452
|
-
})),
|
|
464
|
+
width: `${g.value}px`,
|
|
465
|
+
transition: o.value
|
|
466
|
+
})), B = R(() => ({
|
|
453
467
|
width: `${V.value}px`
|
|
454
|
-
})),
|
|
455
|
-
function
|
|
456
|
-
var
|
|
457
|
-
if (
|
|
458
|
-
const j = (
|
|
468
|
+
})), S = /* @__PURE__ */ new Map();
|
|
469
|
+
function $(n) {
|
|
470
|
+
var i;
|
|
471
|
+
if (S.has(n.value)) {
|
|
472
|
+
const j = (i = S.get(n.value)) == null ? void 0 : i.value;
|
|
459
473
|
if (j) {
|
|
460
|
-
const D = j.getBoundingClientRect(),
|
|
461
|
-
y.value = D.left -
|
|
474
|
+
const D = j.getBoundingClientRect(), Q = a.value.getBoundingClientRect();
|
|
475
|
+
y.value = D.left - Q.left + l + a.value.scrollLeft, g.value = D.width - 2 * l;
|
|
462
476
|
}
|
|
463
477
|
}
|
|
464
478
|
}
|
|
465
|
-
function
|
|
479
|
+
function P(n, i) {
|
|
466
480
|
const j = n.value;
|
|
467
|
-
|
|
481
|
+
r.value = j, e.emit("update:modelValue", j), $(n), i && e.emit("change", j);
|
|
468
482
|
}
|
|
469
|
-
function
|
|
470
|
-
const
|
|
471
|
-
|
|
483
|
+
function v(n) {
|
|
484
|
+
const i = u.value.findIndex((j) => j.value === n);
|
|
485
|
+
i > -1 && P(u.value[i], !1);
|
|
472
486
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}),
|
|
476
|
-
|
|
487
|
+
E(() => t.modelValue, (n) => {
|
|
488
|
+
r.value = n, v(r.value);
|
|
489
|
+
}), E(() => t.items, async (n) => {
|
|
490
|
+
u.value = n, await k(), v(r.value), V.value = Array.from(S.values()).reduce((i, j) => (i += j.value.clientWidth, i), 0);
|
|
477
491
|
}), T(async () => {
|
|
478
|
-
|
|
492
|
+
v(r.value), await k(), o.value = "0.1s ease-out all", V.value = Array.from(S.values()).reduce((n, i) => (n += i.value.clientWidth, n), 0);
|
|
479
493
|
});
|
|
480
|
-
function O(n,
|
|
481
|
-
|
|
494
|
+
function O(n, i) {
|
|
495
|
+
P(i, !0);
|
|
482
496
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
497
|
+
function b(n, i) {
|
|
498
|
+
S.set(i, n);
|
|
485
499
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
500
|
+
function s(n, i) {
|
|
501
|
+
return M(J, {
|
|
488
502
|
name: n.name,
|
|
489
503
|
value: n.value,
|
|
490
|
-
isActive: n.value ===
|
|
491
|
-
index:
|
|
492
|
-
onMounted:
|
|
504
|
+
isActive: n.value === r.value,
|
|
505
|
+
index: i,
|
|
506
|
+
onMounted: b,
|
|
493
507
|
onActive: O
|
|
494
508
|
}, null);
|
|
495
509
|
}
|
|
496
|
-
return () =>
|
|
497
|
-
ref:
|
|
510
|
+
return () => M("span", {
|
|
511
|
+
ref: a,
|
|
498
512
|
class: p.value,
|
|
499
513
|
style: f.value
|
|
500
|
-
}, [
|
|
514
|
+
}, [M("span", {
|
|
501
515
|
class: "f-capsule-pane"
|
|
502
|
-
}, [
|
|
503
|
-
class:
|
|
504
|
-
style:
|
|
505
|
-
}, null),
|
|
516
|
+
}, [u.value.map((n, i) => s(n, i))]), M("small", {
|
|
517
|
+
class: d.value,
|
|
518
|
+
style: w.value
|
|
519
|
+
}, null), M("div", {
|
|
506
520
|
class: "f-capsule-board",
|
|
507
|
-
style:
|
|
521
|
+
style: B.value
|
|
508
522
|
}, null)]);
|
|
509
523
|
}
|
|
510
524
|
});
|
|
511
|
-
N.register = (t, e,
|
|
512
|
-
t.capsule = N, e.capsule =
|
|
525
|
+
N.register = (t, e, u) => {
|
|
526
|
+
t.capsule = N, e.capsule = G;
|
|
513
527
|
};
|
|
514
|
-
N.registerDesigner = (t, e,
|
|
515
|
-
t.capsule =
|
|
528
|
+
N.registerDesigner = (t, e, u) => {
|
|
529
|
+
t.capsule = Oe, e.capsule = G;
|
|
516
530
|
};
|
|
517
|
-
const
|
|
531
|
+
const Se = X(N);
|
|
518
532
|
export {
|
|
519
533
|
N as FCapsule,
|
|
520
534
|
be as capsuleItemProps,
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
535
|
+
q as capsuleProps,
|
|
536
|
+
Se as default,
|
|
537
|
+
G as propsResolver
|
|
524
538
|
};
|