@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,8 +1,8 @@
|
|
|
1
1
|
var Ie = Object.defineProperty;
|
|
2
|
-
var Se = (
|
|
3
|
-
var D = (
|
|
4
|
-
import { computed as V, getCurrentInstance as
|
|
5
|
-
import { isPlainObject as
|
|
2
|
+
var Se = (o, e, n) => e in o ? Ie(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
|
|
3
|
+
var D = (o, e, n) => Se(o, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { computed as V, getCurrentInstance as de, createVNode as y, ref as M, defineComponent as Y, onMounted as H, onUnmounted as ue, watch as Q, inject as L, createTextVNode as pe, provide as De, onBeforeUnmount as Me, withModifiers as Ee } from "vue";
|
|
5
|
+
import { isPlainObject as ce, cloneDeep as ee } from "lodash-es";
|
|
6
6
|
import { getCustomClass as J, withInstall as Re } from "../common/index.esm.js";
|
|
7
7
|
import { useDesignerInnerComponent as fe } from "../designer-canvas/index.esm.js";
|
|
8
8
|
class ge {
|
|
@@ -73,11 +73,11 @@ class ke extends ge {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
function me() {
|
|
76
|
-
function
|
|
76
|
+
function o(e) {
|
|
77
77
|
const n = [];
|
|
78
|
-
return e.reduce((i,
|
|
78
|
+
return e.reduce((i, a) => (a.children && a.children.length > 0 ? i.push(new z(a)) : i.push(new ke(a)), i), n), n;
|
|
79
79
|
}
|
|
80
|
-
return { buildResponseToolbarItems:
|
|
80
|
+
return { buildResponseToolbarItems: o };
|
|
81
81
|
}
|
|
82
82
|
const { buildResponseToolbarItems: Pe } = me();
|
|
83
83
|
class z extends ge {
|
|
@@ -94,12 +94,12 @@ class z extends ge {
|
|
|
94
94
|
D(this, "children", []);
|
|
95
95
|
D(this, "expanded", !1);
|
|
96
96
|
const i = ["isDP", "class", "dropdownClass", "menuClass", "placement", "split", "expanded"];
|
|
97
|
-
Object.keys(n).filter((
|
|
98
|
-
this[
|
|
97
|
+
Object.keys(n).filter((a) => i.indexOf(a) > -1).forEach((a) => {
|
|
98
|
+
this[a] = n[a];
|
|
99
99
|
}), n.children && n.children.length && (this.children = Pe(n.children));
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
class
|
|
102
|
+
class Mt {
|
|
103
103
|
constructor(e, n) {
|
|
104
104
|
D(this, "id");
|
|
105
105
|
D(this, "name");
|
|
@@ -145,101 +145,115 @@ class Dt {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
const he = {}, be = {};
|
|
148
|
-
function
|
|
149
|
-
const { properties: e, title: n, ignore: i } =
|
|
150
|
-
if (n && (!
|
|
148
|
+
function te(o) {
|
|
149
|
+
const { properties: e, title: n, ignore: i } = o, a = i && Array.isArray(i), f = Object.keys(e).reduce((p, T) => ((!a || !i.find((x) => x === T)) && (p[T] = e[T].type === "object" && e[T].properties ? te(e[T]) : ee(e[T].default)), p), {});
|
|
150
|
+
if (n && (!a || !i.find((p) => p === "id"))) {
|
|
151
151
|
const p = n.toLowerCase().replace(/-/g, "_");
|
|
152
|
-
|
|
152
|
+
f.id = `${p}_${Math.random().toString().slice(2, 6)}`;
|
|
153
153
|
}
|
|
154
|
-
return
|
|
154
|
+
return f;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const i =
|
|
156
|
+
function Be(o) {
|
|
157
|
+
const { properties: e, title: n, required: i } = o;
|
|
158
|
+
if (i && Array.isArray(i)) {
|
|
159
|
+
const a = i.reduce((f, p) => (f[p] = e[p].type === "object" && e[p].properties ? te(e[p]) : ee(e[p].default), f), {});
|
|
160
|
+
if (n && i.find((f) => f === "id")) {
|
|
161
|
+
const f = n.toLowerCase().replace(/-/g, "_");
|
|
162
|
+
a.id = `${f}_${Math.random().toString().slice(2, 6)}`;
|
|
163
|
+
}
|
|
164
|
+
return a;
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
type: n
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function Z(o, e = {}, n) {
|
|
171
|
+
const i = he[o];
|
|
158
172
|
if (i) {
|
|
159
|
-
let
|
|
160
|
-
const
|
|
161
|
-
return
|
|
173
|
+
let a = Be(i);
|
|
174
|
+
const f = be[o];
|
|
175
|
+
return a = f ? f({ getSchemaByType: Z }, a, e, n) : a, a;
|
|
162
176
|
}
|
|
163
177
|
return null;
|
|
164
178
|
}
|
|
165
|
-
function
|
|
166
|
-
const n =
|
|
167
|
-
return Object.keys(n).reduce((i,
|
|
179
|
+
function Ae(o, e) {
|
|
180
|
+
const n = te(e);
|
|
181
|
+
return Object.keys(n).reduce((i, a) => (Object.prototype.hasOwnProperty.call(o, a) && (i[a] && ce(i[a]) && ce(o[a] || !o[a]) ? Object.assign(i[a], o[a] || {}) : i[a] = o[a]), i), n), n;
|
|
168
182
|
}
|
|
169
|
-
function
|
|
170
|
-
return Object.keys(
|
|
171
|
-
if (e.has(
|
|
172
|
-
const
|
|
173
|
-
if (typeof
|
|
174
|
-
i[
|
|
183
|
+
function Oe(o, e) {
|
|
184
|
+
return Object.keys(o).filter((i) => o[i] != null).reduce((i, a) => {
|
|
185
|
+
if (e.has(a)) {
|
|
186
|
+
const f = e.get(a);
|
|
187
|
+
if (typeof f == "string")
|
|
188
|
+
i[f] = o[a];
|
|
175
189
|
else {
|
|
176
|
-
const p =
|
|
190
|
+
const p = f(a, o[a], o);
|
|
177
191
|
Object.assign(i, p);
|
|
178
192
|
}
|
|
179
193
|
} else
|
|
180
|
-
i[
|
|
194
|
+
i[a] = o[a];
|
|
181
195
|
return i;
|
|
182
196
|
}, {});
|
|
183
197
|
}
|
|
184
|
-
function
|
|
185
|
-
const i =
|
|
186
|
-
return
|
|
198
|
+
function _e(o, e, n = /* @__PURE__ */ new Map()) {
|
|
199
|
+
const i = Ae(o, e);
|
|
200
|
+
return Oe(i, n);
|
|
187
201
|
}
|
|
188
|
-
function
|
|
189
|
-
function e(
|
|
202
|
+
function je(o = {}) {
|
|
203
|
+
function e(g, m, l, c) {
|
|
190
204
|
if (typeof l == "number")
|
|
191
|
-
return c[
|
|
205
|
+
return c[g].length === l;
|
|
192
206
|
if (typeof l == "object") {
|
|
193
207
|
const u = Object.keys(l)[0], b = l[u];
|
|
194
208
|
if (u === "not")
|
|
195
|
-
return Number(c[
|
|
209
|
+
return Number(c[g].length) !== Number(b);
|
|
196
210
|
if (u === "moreThan")
|
|
197
|
-
return Number(c[
|
|
211
|
+
return Number(c[g].length) >= Number(b);
|
|
198
212
|
if (u === "lessThan")
|
|
199
|
-
return Number(c[
|
|
213
|
+
return Number(c[g].length) <= Number(b);
|
|
200
214
|
}
|
|
201
215
|
return !1;
|
|
202
216
|
}
|
|
203
|
-
function n(
|
|
204
|
-
return c[
|
|
217
|
+
function n(g, m, l, c) {
|
|
218
|
+
return c[g] && c[g].propertyValue && String(c[g].propertyValue.value) === String(l);
|
|
205
219
|
}
|
|
206
220
|
const i = /* @__PURE__ */ new Map([
|
|
207
221
|
["length", e],
|
|
208
222
|
["getProperty", n]
|
|
209
223
|
]);
|
|
210
|
-
Object.keys(
|
|
211
|
-
function
|
|
212
|
-
const l =
|
|
213
|
-
return typeof
|
|
224
|
+
Object.keys(o).reduce((g, m) => (g.set(m, o[m]), g), i);
|
|
225
|
+
function a(g, m) {
|
|
226
|
+
const l = g;
|
|
227
|
+
return typeof m == "number" ? [{ target: l, operator: "length", param: null, value: Number(m) }] : typeof m == "boolean" ? [{ target: l, operator: "getProperty", param: g, value: !!m }] : typeof m == "object" ? Object.keys(m).map((c) => {
|
|
214
228
|
if (c === "length")
|
|
215
|
-
return { target: l, operator: "length", param: null, value:
|
|
216
|
-
const u = c, b =
|
|
229
|
+
return { target: l, operator: "length", param: null, value: m[c] };
|
|
230
|
+
const u = c, b = m[c];
|
|
217
231
|
return { target: l, operator: "getProperty", param: u, value: b };
|
|
218
232
|
}) : [];
|
|
219
233
|
}
|
|
220
|
-
function
|
|
221
|
-
return Object.keys(
|
|
222
|
-
const u =
|
|
234
|
+
function f(g) {
|
|
235
|
+
return Object.keys(g).reduce((l, c) => {
|
|
236
|
+
const u = a(c, g[c]);
|
|
223
237
|
return l.push(...u), l;
|
|
224
238
|
}, []);
|
|
225
239
|
}
|
|
226
|
-
function p(
|
|
227
|
-
if (i.has(
|
|
228
|
-
const l = i.get(
|
|
229
|
-
return l && l(
|
|
240
|
+
function p(g, m) {
|
|
241
|
+
if (i.has(g.operator)) {
|
|
242
|
+
const l = i.get(g.operator);
|
|
243
|
+
return l && l(g.target, g.param, g.value, m) || !1;
|
|
230
244
|
}
|
|
231
245
|
return !1;
|
|
232
246
|
}
|
|
233
|
-
function T(
|
|
234
|
-
return
|
|
247
|
+
function T(g, m) {
|
|
248
|
+
return f(g).reduce((u, b) => u && p(b, m), !0);
|
|
235
249
|
}
|
|
236
|
-
function x(
|
|
237
|
-
const l = Object.keys(
|
|
250
|
+
function x(g, m) {
|
|
251
|
+
const l = Object.keys(g), c = l.includes("allOf"), u = l.includes("anyOf"), b = c || u, O = (b ? g[b ? c ? "allOf" : "anyOf" : "allOf"] : [g]).map((j) => T(j, m));
|
|
238
252
|
return c ? !O.includes(!1) : O.includes(!0);
|
|
239
253
|
}
|
|
240
254
|
return { parseValueSchema: x };
|
|
241
255
|
}
|
|
242
|
-
const
|
|
256
|
+
const ne = {
|
|
243
257
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
244
258
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
245
259
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -279,31 +293,31 @@ const te = {
|
|
|
279
293
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
280
294
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
281
295
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
282
|
-
},
|
|
283
|
-
|
|
284
|
-
function ye(
|
|
285
|
-
return he[e.title] = e, be[e.title] = i,
|
|
286
|
-
const T =
|
|
296
|
+
}, $e = {}, Fe = {};
|
|
297
|
+
je();
|
|
298
|
+
function ye(o, e, n = /* @__PURE__ */ new Map(), i = (p, T, x, g) => T, a = {}, f = (p) => p) {
|
|
299
|
+
return he[e.title] = e, be[e.title] = i, $e[e.title] = a, Fe[e.title] = f, (p = {}) => {
|
|
300
|
+
const T = _e(p, e, n), x = Object.keys(o).reduce((g, m) => (g[m] = o[m].default, g), {});
|
|
287
301
|
return Object.assign(x, T);
|
|
288
302
|
};
|
|
289
303
|
}
|
|
290
|
-
function
|
|
304
|
+
function Ne(o, e) {
|
|
291
305
|
return { customClass: e.class, customStyle: e.style };
|
|
292
306
|
}
|
|
293
|
-
const
|
|
307
|
+
const Le = /* @__PURE__ */ new Map([
|
|
294
308
|
["buttons", "items"],
|
|
295
|
-
["appearance",
|
|
309
|
+
["appearance", Ne]
|
|
296
310
|
]);
|
|
297
|
-
function
|
|
311
|
+
function Ve(o, e) {
|
|
298
312
|
return { class: e.class, style: e.style };
|
|
299
313
|
}
|
|
300
|
-
const
|
|
301
|
-
["appearance",
|
|
314
|
+
const Ue = /* @__PURE__ */ new Map([
|
|
315
|
+
["appearance", Ve]
|
|
302
316
|
]);
|
|
303
|
-
function ve(
|
|
317
|
+
function ve(o, e, n) {
|
|
304
318
|
return e;
|
|
305
319
|
}
|
|
306
|
-
const
|
|
320
|
+
const We = "https://json-schema.org/draft/2020-12/schema", qe = "https://farris-design.gitee.io/response-toolbar.schema.json", ze = "response-toolbar", Ge = "A Farris Toolbar Component", He = "object", Qe = {
|
|
307
321
|
id: {
|
|
308
322
|
description: "The unique identifier for a Response Toolbar",
|
|
309
323
|
type: "string"
|
|
@@ -333,19 +347,19 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
333
347
|
type: "array",
|
|
334
348
|
default: []
|
|
335
349
|
}
|
|
336
|
-
},
|
|
350
|
+
}, Je = [
|
|
337
351
|
"id",
|
|
338
352
|
"type",
|
|
339
353
|
"buttons"
|
|
340
|
-
],
|
|
341
|
-
$schema:
|
|
342
|
-
$id:
|
|
343
|
-
title:
|
|
344
|
-
description:
|
|
345
|
-
type:
|
|
346
|
-
properties:
|
|
347
|
-
required:
|
|
348
|
-
},
|
|
354
|
+
], Xe = {
|
|
355
|
+
$schema: We,
|
|
356
|
+
$id: qe,
|
|
357
|
+
title: ze,
|
|
358
|
+
description: Ge,
|
|
359
|
+
type: He,
|
|
360
|
+
properties: Qe,
|
|
361
|
+
required: Je
|
|
362
|
+
}, Ye = "https://json-schema.org/draft/2020-12/schema", Ze = "https://farris-design.gitee.io/response-toolbar-item.schema.json", Ke = "response-toolbar-item", et = "A Farris Toolbar Item Component", tt = "object", nt = {
|
|
349
363
|
id: {
|
|
350
364
|
description: "The unique identifier for a Response Toolbar",
|
|
351
365
|
type: "string"
|
|
@@ -390,19 +404,19 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
390
404
|
type: "string",
|
|
391
405
|
default: ""
|
|
392
406
|
}
|
|
393
|
-
},
|
|
407
|
+
}, ot = [
|
|
394
408
|
"id",
|
|
395
409
|
"type",
|
|
396
410
|
"text"
|
|
397
|
-
],
|
|
398
|
-
$schema:
|
|
399
|
-
$id:
|
|
400
|
-
title:
|
|
401
|
-
description:
|
|
402
|
-
type:
|
|
403
|
-
properties:
|
|
404
|
-
required:
|
|
405
|
-
},
|
|
411
|
+
], st = {
|
|
412
|
+
$schema: Ye,
|
|
413
|
+
$id: Ze,
|
|
414
|
+
title: Ke,
|
|
415
|
+
description: et,
|
|
416
|
+
type: tt,
|
|
417
|
+
properties: nt,
|
|
418
|
+
required: ot
|
|
419
|
+
}, oe = {
|
|
406
420
|
/** 组件自定义样式 */
|
|
407
421
|
customClass: { type: String, default: "" },
|
|
408
422
|
alignment: { Type: String, default: "right" },
|
|
@@ -410,12 +424,12 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
410
424
|
Type: Array,
|
|
411
425
|
default: []
|
|
412
426
|
}
|
|
413
|
-
},
|
|
427
|
+
}, rt = Object.assign({}, oe, {
|
|
414
428
|
componentId: { type: String, default: "" }
|
|
415
|
-
}),
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
429
|
+
}), se = ye(
|
|
430
|
+
oe,
|
|
431
|
+
Xe,
|
|
432
|
+
Le,
|
|
419
433
|
ve
|
|
420
434
|
), Ce = {
|
|
421
435
|
id: { type: String, default: "" },
|
|
@@ -426,29 +440,29 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
426
440
|
icon: { type: String, default: "" },
|
|
427
441
|
componentId: { type: String, default: "" },
|
|
428
442
|
alignment: { Type: String, default: "right" }
|
|
429
|
-
},
|
|
443
|
+
}, it = ye(
|
|
430
444
|
Ce,
|
|
431
|
-
|
|
432
|
-
|
|
445
|
+
st,
|
|
446
|
+
Ue,
|
|
433
447
|
ve
|
|
434
448
|
);
|
|
435
449
|
function we() {
|
|
436
|
-
function
|
|
450
|
+
function o(n) {
|
|
437
451
|
const i = {
|
|
438
452
|
"f-icon": !0
|
|
439
453
|
};
|
|
440
454
|
if (n.icon) {
|
|
441
|
-
const
|
|
442
|
-
|
|
455
|
+
const a = n.icon.trim().split(" ");
|
|
456
|
+
a && a.length && a.reduce((f, p) => (f[p] = !0, f), i);
|
|
443
457
|
}
|
|
444
458
|
return i;
|
|
445
459
|
}
|
|
446
460
|
function e(n) {
|
|
447
461
|
return !!(n.icon && n.icon.trim());
|
|
448
462
|
}
|
|
449
|
-
return { iconClass:
|
|
463
|
+
return { iconClass: o, shouldShowIcon: e };
|
|
450
464
|
}
|
|
451
|
-
function
|
|
465
|
+
function ct(o) {
|
|
452
466
|
function e(l) {
|
|
453
467
|
const c = {
|
|
454
468
|
"dropdown-menu": !0
|
|
@@ -475,14 +489,14 @@ function it(s) {
|
|
|
475
489
|
}, u = l.class.split(" ");
|
|
476
490
|
return u && u.length && u.reduce((b, I) => (b[I] = !0, b), c), c;
|
|
477
491
|
}
|
|
478
|
-
let
|
|
479
|
-
const
|
|
492
|
+
let a;
|
|
493
|
+
const f = /* @__PURE__ */ new Map();
|
|
480
494
|
function p(l, c, u) {
|
|
481
495
|
var I;
|
|
482
496
|
((I = l.target) == null ? void 0 : I.id) === c.id && l.stopPropagation();
|
|
483
497
|
const b = u ? u.id : "__top_item__";
|
|
484
|
-
if (c.children && c.children.length && (c.expanded = !c.expanded, c.expanded ?
|
|
485
|
-
const B =
|
|
498
|
+
if (c.children && c.children.length && (c.expanded = !c.expanded, c.expanded ? f.set(b, c) : f.delete(b)), f.has(b) && f.get(b) !== c) {
|
|
499
|
+
const B = f.get(b);
|
|
486
500
|
B && (B.expanded = !1);
|
|
487
501
|
}
|
|
488
502
|
}
|
|
@@ -501,16 +515,16 @@ function it(s) {
|
|
|
501
515
|
}, [c.text, y("i", {
|
|
502
516
|
class: "f-icon f-icon-arrow-chevron-right",
|
|
503
517
|
style: "display: inline-block;float: right;line-height: 1.25rem;"
|
|
504
|
-
}, null)]),
|
|
518
|
+
}, null)]), a(c, c)]) : y("li", {
|
|
505
519
|
class: i(c),
|
|
506
520
|
id: c.id,
|
|
507
521
|
onClick: (u) => T(u, c),
|
|
508
522
|
onMouseover: (u) => c.enable && p(u, c, l)
|
|
509
|
-
}, [
|
|
510
|
-
class:
|
|
523
|
+
}, [o.shouldShowIcon(c) && y("i", {
|
|
524
|
+
class: o.iconClass(c)
|
|
511
525
|
}, null), c.text]));
|
|
512
526
|
}
|
|
513
|
-
function
|
|
527
|
+
function g(l, c, u) {
|
|
514
528
|
const b = {
|
|
515
529
|
display: l.expanded ? "block" : "none",
|
|
516
530
|
position: "fixed",
|
|
@@ -533,103 +547,103 @@ function it(s) {
|
|
|
533
547
|
const h = P.getBoundingClientRect();
|
|
534
548
|
if (u) {
|
|
535
549
|
b.top = `${F - 6}px`;
|
|
536
|
-
const
|
|
537
|
-
b.left = `${
|
|
550
|
+
const s = Math.ceil(j + A);
|
|
551
|
+
b.left = `${s}px`;
|
|
538
552
|
}
|
|
539
553
|
I - A - j < h.width && (b.left = `${(u ? A : k) - h.width}px`);
|
|
540
554
|
}
|
|
541
555
|
}
|
|
542
556
|
return b;
|
|
543
557
|
}
|
|
544
|
-
|
|
558
|
+
a = function(l, c) {
|
|
545
559
|
var B, O;
|
|
546
|
-
const u =
|
|
560
|
+
const u = de(), b = c ? c.id : l.id, I = (O = (B = u == null ? void 0 : u.exposed) == null ? void 0 : B.elementRef.value) == null ? void 0 : O.querySelector("#" + b);
|
|
547
561
|
return y("ul", {
|
|
548
562
|
class: e(l),
|
|
549
|
-
style:
|
|
563
|
+
style: g(l, I, c),
|
|
550
564
|
id: l.id + "_menu"
|
|
551
565
|
}, [x(l)]);
|
|
552
566
|
};
|
|
553
|
-
function
|
|
554
|
-
|
|
567
|
+
function m() {
|
|
568
|
+
f.forEach((l) => {
|
|
555
569
|
l.expanded = !1;
|
|
556
|
-
}),
|
|
570
|
+
}), f.clear();
|
|
557
571
|
}
|
|
558
572
|
return {
|
|
559
|
-
renderDropdownMenu:
|
|
560
|
-
clearAllDropDownMenu:
|
|
573
|
+
renderDropdownMenu: a,
|
|
574
|
+
clearAllDropDownMenu: m
|
|
561
575
|
};
|
|
562
576
|
}
|
|
563
|
-
function
|
|
564
|
-
const n = M(
|
|
577
|
+
function lt(o, e) {
|
|
578
|
+
const n = M(o.alignment), {
|
|
565
579
|
renderDropdownMenu: i,
|
|
566
|
-
clearAllDropDownMenu:
|
|
567
|
-
} =
|
|
568
|
-
function m
|
|
580
|
+
clearAllDropDownMenu: a
|
|
581
|
+
} = ct(e);
|
|
582
|
+
function f(m) {
|
|
569
583
|
const l = {
|
|
570
584
|
"btn-group": !0,
|
|
571
585
|
"f-rt-dropdown": !0,
|
|
572
586
|
"f-btn-ml": n.value === "right",
|
|
573
587
|
"f-btn-mr": n.value === "left"
|
|
574
|
-
}, c =
|
|
588
|
+
}, c = m.dropdownClass.split(" ");
|
|
575
589
|
return c && c.length && c.reduce((u, b) => (u[b] = !0, u), l), l;
|
|
576
590
|
}
|
|
577
|
-
function p(
|
|
591
|
+
function p(m) {
|
|
578
592
|
const l = {
|
|
579
593
|
btn: !0,
|
|
580
|
-
disabled: !
|
|
594
|
+
disabled: !m.enable,
|
|
581
595
|
"f-rt-btn": !0,
|
|
582
|
-
"btn-icontext": !!(
|
|
596
|
+
"btn-icontext": !!(m.icon && m.icon.trim())
|
|
583
597
|
};
|
|
584
|
-
if (
|
|
585
|
-
const c =
|
|
598
|
+
if (m.class) {
|
|
599
|
+
const c = m.class.split(" ");
|
|
586
600
|
c && c.length && c.reduce((u, b) => (u[b] = !0, u), l);
|
|
587
601
|
}
|
|
588
602
|
return l;
|
|
589
603
|
}
|
|
590
|
-
function T(
|
|
591
|
-
|
|
604
|
+
function T(m, l) {
|
|
605
|
+
m.stopPropagation();
|
|
592
606
|
const c = l.expanded;
|
|
593
607
|
document.body.click(), l.expanded = !c;
|
|
594
608
|
}
|
|
595
|
-
function x(
|
|
609
|
+
function x(m) {
|
|
596
610
|
return y("div", {
|
|
597
|
-
id:
|
|
598
|
-
class: m
|
|
611
|
+
id: m.id,
|
|
612
|
+
class: f(m)
|
|
599
613
|
}, [y("div", {
|
|
600
|
-
class: p(
|
|
614
|
+
class: p(m),
|
|
601
615
|
style: "display: flex;padding-right: 0.1rem;border-top-right-radius: 6px;border-bottom-right-radius: 6px",
|
|
602
|
-
onClick: (l) =>
|
|
603
|
-
}, [e.shouldShowIcon(
|
|
604
|
-
class: e.iconClass(
|
|
605
|
-
}, null), y("span", null, [
|
|
616
|
+
onClick: (l) => m.enable && T(l, m)
|
|
617
|
+
}, [e.shouldShowIcon(m) && y("i", {
|
|
618
|
+
class: e.iconClass(m)
|
|
619
|
+
}, null), y("span", null, [m.text]), y("i", {
|
|
606
620
|
class: "f-icon f-icon-arrow-chevron-down",
|
|
607
621
|
style: "display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"
|
|
608
|
-
}, null)]), i(
|
|
622
|
+
}, null)]), i(m)]);
|
|
609
623
|
}
|
|
610
|
-
function
|
|
611
|
-
|
|
624
|
+
function g() {
|
|
625
|
+
a();
|
|
612
626
|
}
|
|
613
627
|
return {
|
|
614
628
|
renderToolbarDropdown: x,
|
|
615
|
-
clearAllDropDown:
|
|
629
|
+
clearAllDropDown: g
|
|
616
630
|
};
|
|
617
631
|
}
|
|
618
632
|
const {
|
|
619
|
-
buildResponseToolbarItems:
|
|
633
|
+
buildResponseToolbarItems: le
|
|
620
634
|
} = me(), X = /* @__PURE__ */ Y({
|
|
621
635
|
name: "FResponseToolbar",
|
|
622
|
-
props:
|
|
636
|
+
props: oe,
|
|
623
637
|
emits: ["click"],
|
|
624
|
-
setup(
|
|
625
|
-
const n = M(
|
|
638
|
+
setup(o, e) {
|
|
639
|
+
const n = M(le(o.items)), i = M(), a = M(), f = M(), p = M(o.alignment), T = {
|
|
626
640
|
id: "__more_buttons__",
|
|
627
641
|
text: "更多"
|
|
628
|
-
}, x = M(new z(T)),
|
|
642
|
+
}, x = M(new z(T)), g = we(), m = V(() => x.value.children.length > 0), l = V(() => J({
|
|
629
643
|
"f-toolbar": !0,
|
|
630
644
|
"f-response-toolbar": !0,
|
|
631
645
|
"position-relative": !0
|
|
632
|
-
},
|
|
646
|
+
}, o.customClass)), c = V(() => ({
|
|
633
647
|
"w-100": !0,
|
|
634
648
|
"d-flex": !0,
|
|
635
649
|
"flex-nowrap": !0,
|
|
@@ -638,7 +652,7 @@ const {
|
|
|
638
652
|
})), {
|
|
639
653
|
renderToolbarDropdown: u,
|
|
640
654
|
clearAllDropDown: b
|
|
641
|
-
} =
|
|
655
|
+
} = lt(o, g);
|
|
642
656
|
function I() {
|
|
643
657
|
n.value.filter((v) => v.children && v.children.length > 0).forEach((v) => {
|
|
644
658
|
v.expanded = !1;
|
|
@@ -654,7 +668,7 @@ const {
|
|
|
654
668
|
};
|
|
655
669
|
if (v.class) {
|
|
656
670
|
const P = v.class.split(" ");
|
|
657
|
-
P && P.length && P.reduce((h,
|
|
671
|
+
P && P.length && P.reduce((h, s) => (h[s] = !0, h), E);
|
|
658
672
|
}
|
|
659
673
|
return E;
|
|
660
674
|
}
|
|
@@ -668,17 +682,17 @@ const {
|
|
|
668
682
|
id: v.id,
|
|
669
683
|
disabled: !v.enable,
|
|
670
684
|
onClick: (E) => O(E, v)
|
|
671
|
-
}, [
|
|
672
|
-
class:
|
|
685
|
+
}, [g.shouldShowIcon(v) && y("i", {
|
|
686
|
+
class: g.iconClass(v)
|
|
673
687
|
}, null), v.text]);
|
|
674
688
|
}
|
|
675
689
|
const j = /* @__PURE__ */ new Map(), A = [];
|
|
676
690
|
function k(v) {
|
|
677
|
-
const E =
|
|
691
|
+
const E = f.value;
|
|
678
692
|
let P = v;
|
|
679
|
-
const h = Array.from(E.children),
|
|
680
|
-
if (
|
|
681
|
-
const C =
|
|
693
|
+
const h = Array.from(E.children), s = h[h.length - 1].id === "__more_buttons__" ? h[h.length - 1] : null;
|
|
694
|
+
if (s) {
|
|
695
|
+
const C = s.computedStyleMap().get("margin-left"), S = s.computedStyleMap().get("margin-right"), $ = (C ? C.value : 0) + s.getBoundingClientRect().width + (S ? S.value : 0);
|
|
682
696
|
P -= $;
|
|
683
697
|
}
|
|
684
698
|
const t = h.filter((C) => C.id !== "__more_buttons__");
|
|
@@ -699,22 +713,22 @@ const {
|
|
|
699
713
|
}
|
|
700
714
|
const r = Object.assign({}, x.value);
|
|
701
715
|
r.children = [];
|
|
702
|
-
const
|
|
703
|
-
x.value =
|
|
716
|
+
const d = new z(r), w = n.value.reduce((C, S) => (j.has(S.id) && d.children.push(S), S.visible = !j.has(S.id), C.push(S), C), []);
|
|
717
|
+
x.value = d, n.value = w;
|
|
704
718
|
}
|
|
705
719
|
const R = new ResizeObserver((v) => {
|
|
706
720
|
if (v.length) {
|
|
707
|
-
const P = v[0].contentRect.width,
|
|
708
|
-
(P <
|
|
721
|
+
const P = v[0].contentRect.width, s = f.value.getBoundingClientRect().width;
|
|
722
|
+
(P < s || A.length) && (k(P), I());
|
|
709
723
|
}
|
|
710
724
|
});
|
|
711
725
|
return H(() => {
|
|
712
|
-
const v =
|
|
726
|
+
const v = a.value;
|
|
713
727
|
R.observe(v), document.body.addEventListener("click", I), document.body.addEventListener("wheel", I);
|
|
714
|
-
}),
|
|
728
|
+
}), ue(() => {
|
|
715
729
|
R.disconnect(), document.body.removeEventListener("click", I), document.body.removeEventListener("wheel", I);
|
|
716
|
-
}), Q(() =>
|
|
717
|
-
n.value =
|
|
730
|
+
}), Q(() => o.items, () => {
|
|
731
|
+
n.value = le(o.items);
|
|
718
732
|
}, {
|
|
719
733
|
deep: !0
|
|
720
734
|
}), e.expose({
|
|
@@ -723,72 +737,72 @@ const {
|
|
|
723
737
|
class: l.value,
|
|
724
738
|
ref: i
|
|
725
739
|
}, [y("div", {
|
|
726
|
-
ref:
|
|
740
|
+
ref: a,
|
|
727
741
|
class: c.value
|
|
728
742
|
}, [y("div", {
|
|
729
|
-
ref:
|
|
743
|
+
ref: f,
|
|
730
744
|
class: "d-inline-block f-response-content",
|
|
731
745
|
style: "white-space: nowrap;"
|
|
732
|
-
}, [n.value.filter((v) => v.visible).map((v) => v.children && v.children.length > 0 ? u(v) : F(v)),
|
|
746
|
+
}, [n.value.filter((v) => v.visible).map((v) => v.children && v.children.length > 0 ? u(v) : F(v)), m.value && u(x.value)])])]);
|
|
733
747
|
}
|
|
734
748
|
});
|
|
735
|
-
function
|
|
749
|
+
function at(o, e) {
|
|
736
750
|
const n = L("design-item-context"), i = L("toolbar-item-handler", () => {
|
|
737
751
|
});
|
|
738
|
-
function
|
|
752
|
+
function a() {
|
|
739
753
|
i && i();
|
|
740
754
|
}
|
|
741
|
-
function
|
|
755
|
+
function f(s) {
|
|
742
756
|
const t = {
|
|
743
757
|
"dropdown-menu": !0
|
|
744
758
|
};
|
|
745
|
-
if (
|
|
746
|
-
const r =
|
|
747
|
-
r && r.length && r.reduce((
|
|
759
|
+
if (s.class) {
|
|
760
|
+
const r = s.menuClass.split(" ");
|
|
761
|
+
r && r.length && r.reduce((d, w) => (d[w] = !0, d), t);
|
|
748
762
|
}
|
|
749
763
|
return t;
|
|
750
764
|
}
|
|
751
|
-
function p(
|
|
765
|
+
function p(s) {
|
|
752
766
|
const t = {
|
|
753
|
-
disabled: !
|
|
767
|
+
disabled: !s.enable,
|
|
754
768
|
"dropdown-submenu": !0,
|
|
755
769
|
"f-rt-dropdown": !0
|
|
756
|
-
}, r =
|
|
757
|
-
return r && r.length && r.reduce((
|
|
770
|
+
}, r = s.dropdownClass.split(" ");
|
|
771
|
+
return r && r.length && r.reduce((d, w) => (d[w] = !0, d), t), t;
|
|
758
772
|
}
|
|
759
|
-
function T(
|
|
773
|
+
function T(s) {
|
|
760
774
|
const t = {
|
|
761
|
-
disabled: !
|
|
775
|
+
disabled: !s.enable,
|
|
762
776
|
"dropdown-item": !0,
|
|
763
777
|
"f-rt-btn": !0,
|
|
764
778
|
"position-relative": !0,
|
|
765
779
|
"farris-component": !0
|
|
766
|
-
}, r =
|
|
767
|
-
return r && r.length && r.reduce((
|
|
780
|
+
}, r = s.class.split(" ");
|
|
781
|
+
return r && r.length && r.reduce((d, w) => (d[w] = !0, d), t), t;
|
|
768
782
|
}
|
|
769
783
|
let x;
|
|
770
|
-
const
|
|
771
|
-
function
|
|
784
|
+
const g = /* @__PURE__ */ new Map();
|
|
785
|
+
function m(s, t, r) {
|
|
772
786
|
var w;
|
|
773
|
-
((w =
|
|
774
|
-
const
|
|
775
|
-
if (t.children && t.children.length && (t.expanded = !t.expanded, t.expanded ?
|
|
776
|
-
const C =
|
|
787
|
+
((w = s.target) == null ? void 0 : w.id) === t.id && s.stopPropagation();
|
|
788
|
+
const d = r ? r.id : "__top_item__";
|
|
789
|
+
if (t.children && t.children.length && (t.expanded = !t.expanded, t.expanded ? g.set(d, t) : g.delete(d)), g.has(d) && g.get(d) !== t) {
|
|
790
|
+
const C = g.get(d);
|
|
777
791
|
C && (C.expanded = !1);
|
|
778
792
|
}
|
|
779
793
|
}
|
|
780
|
-
function l(
|
|
781
|
-
|
|
794
|
+
function l(s) {
|
|
795
|
+
s && (s.stopPropagation(), s.preventDefault());
|
|
782
796
|
}
|
|
783
797
|
function c() {
|
|
784
798
|
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((t) => t.classList.remove("dgComponentFocused"));
|
|
785
|
-
const
|
|
786
|
-
Array.from(
|
|
799
|
+
const s = document.getElementsByClassName("dgComponentSelected");
|
|
800
|
+
Array.from(s).forEach((t) => t.classList.remove("dgComponentSelected"));
|
|
787
801
|
}
|
|
788
|
-
function u(
|
|
789
|
-
|
|
802
|
+
function u(s) {
|
|
803
|
+
s.currentTarget.classList.add("dgComponentFocused", "dgComponentSelected");
|
|
790
804
|
}
|
|
791
|
-
function b(
|
|
805
|
+
function b(s) {
|
|
792
806
|
const {
|
|
793
807
|
buttons: t = []
|
|
794
808
|
} = n.schema;
|
|
@@ -796,49 +810,49 @@ function lt(s, e) {
|
|
|
796
810
|
t.forEach((C) => {
|
|
797
811
|
r = r.concat(C.children || []);
|
|
798
812
|
});
|
|
799
|
-
const
|
|
813
|
+
const d = r.findIndex((C) => C.id === s), w = d === -1 ? null : r[d];
|
|
800
814
|
return {
|
|
801
|
-
index:
|
|
815
|
+
index: d,
|
|
802
816
|
item: w
|
|
803
817
|
};
|
|
804
818
|
}
|
|
805
|
-
function I(
|
|
819
|
+
function I(s) {
|
|
806
820
|
const {
|
|
807
821
|
buttons: t = []
|
|
808
|
-
} = n.schema, r = t.findIndex((w) => w.id ===
|
|
822
|
+
} = n.schema, r = t.findIndex((w) => w.id === s), d = r === -1 ? null : t[r];
|
|
809
823
|
return {
|
|
810
824
|
index: r,
|
|
811
|
-
item:
|
|
825
|
+
item: d
|
|
812
826
|
};
|
|
813
827
|
}
|
|
814
|
-
function B(
|
|
815
|
-
var
|
|
828
|
+
function B(s) {
|
|
829
|
+
var d;
|
|
816
830
|
n.schema;
|
|
817
831
|
const {
|
|
818
832
|
index: t,
|
|
819
833
|
item: r
|
|
820
|
-
} = b(
|
|
821
|
-
(
|
|
834
|
+
} = b(s);
|
|
835
|
+
(d = n == null ? void 0 : n.setupContext) == null || d.emit("selectionChange", r == null ? void 0 : r.type, r);
|
|
822
836
|
}
|
|
823
|
-
const O = function(
|
|
837
|
+
const O = function(s) {
|
|
824
838
|
const {
|
|
825
839
|
componentType: t
|
|
826
|
-
} =
|
|
827
|
-
return r && !r.id && r.type === t && (r.id = `${
|
|
840
|
+
} = s, r = Z(t, s), d = t.toLowerCase().replace("-", "_");
|
|
841
|
+
return r && !r.id && r.type === t && (r.id = `${d}_${Math.random().toString().slice(2, 6)}`), r;
|
|
828
842
|
}, F = function() {
|
|
829
|
-
const
|
|
843
|
+
const s = {
|
|
830
844
|
componentType: "response-toolbar-item",
|
|
831
845
|
parentComponentInstance: e.value,
|
|
832
846
|
targetPosition: -1
|
|
833
847
|
};
|
|
834
|
-
return O(
|
|
848
|
+
return O(s);
|
|
835
849
|
};
|
|
836
|
-
function j(
|
|
837
|
-
l(
|
|
850
|
+
function j(s, t) {
|
|
851
|
+
l(s), c(), u(s), B(t.id);
|
|
838
852
|
}
|
|
839
|
-
function A(
|
|
840
|
-
l(
|
|
841
|
-
const
|
|
853
|
+
function A(s, t, r) {
|
|
854
|
+
l(s);
|
|
855
|
+
const d = t.id, w = r && r.id, {
|
|
842
856
|
buttons: C = []
|
|
843
857
|
} = n.schema;
|
|
844
858
|
if (!w)
|
|
@@ -850,44 +864,44 @@ function lt(s, e) {
|
|
|
850
864
|
return;
|
|
851
865
|
const {
|
|
852
866
|
index: $
|
|
853
|
-
} = b(
|
|
854
|
-
$ !== -1 && (C[S].children.splice($, 1),
|
|
867
|
+
} = b(d);
|
|
868
|
+
$ !== -1 && (C[S].children.splice($, 1), a());
|
|
855
869
|
}
|
|
856
|
-
function k(
|
|
857
|
-
l(
|
|
858
|
-
const
|
|
870
|
+
function k(s, t, r) {
|
|
871
|
+
l(s);
|
|
872
|
+
const d = r && r.id, {
|
|
859
873
|
buttons: w = []
|
|
860
874
|
} = n.schema;
|
|
861
|
-
if (!
|
|
875
|
+
if (!d)
|
|
862
876
|
return;
|
|
863
877
|
const {
|
|
864
878
|
index: C
|
|
865
|
-
} = I(
|
|
879
|
+
} = I(d);
|
|
866
880
|
if (C === -1)
|
|
867
881
|
return;
|
|
868
882
|
const S = F(), $ = Object.assign({}, S, {
|
|
869
883
|
text: t.text
|
|
870
884
|
});
|
|
871
|
-
w[C].children.push($),
|
|
885
|
+
w[C].children.push($), a();
|
|
872
886
|
}
|
|
873
|
-
function R(
|
|
874
|
-
l(
|
|
875
|
-
const
|
|
887
|
+
function R(s, t, r) {
|
|
888
|
+
l(s);
|
|
889
|
+
const d = r && r.id, {
|
|
876
890
|
buttons: w = []
|
|
877
891
|
} = n.schema;
|
|
878
|
-
if (!
|
|
892
|
+
if (!d)
|
|
879
893
|
return;
|
|
880
894
|
const {
|
|
881
895
|
index: C
|
|
882
|
-
} = I(
|
|
896
|
+
} = I(d);
|
|
883
897
|
if (C === -1)
|
|
884
898
|
return;
|
|
885
899
|
const S = F(), $ = Object.assign({}, S, {
|
|
886
900
|
text: "按钮"
|
|
887
901
|
});
|
|
888
|
-
w[C].children.push($),
|
|
902
|
+
w[C].children.push($), a();
|
|
889
903
|
}
|
|
890
|
-
function v(
|
|
904
|
+
function v(s, t) {
|
|
891
905
|
return y("div", {
|
|
892
906
|
class: "component-btn-group"
|
|
893
907
|
}, [y("div", null, [y("div", {
|
|
@@ -896,7 +910,7 @@ function lt(s, e) {
|
|
|
896
910
|
title: "删除",
|
|
897
911
|
ref: "removeButton",
|
|
898
912
|
style: "position:static;",
|
|
899
|
-
onClick: (r) => A(r,
|
|
913
|
+
onClick: (r) => A(r, s, t)
|
|
900
914
|
}, [y("i", {
|
|
901
915
|
class: "f-icon f-icon-yxs_delete"
|
|
902
916
|
}, null)]), y("div", {
|
|
@@ -905,7 +919,7 @@ function lt(s, e) {
|
|
|
905
919
|
title: "复制",
|
|
906
920
|
ref: "copyButton",
|
|
907
921
|
style: "position:static;",
|
|
908
|
-
onClick: (r) => k(r,
|
|
922
|
+
onClick: (r) => k(r, s, t)
|
|
909
923
|
}, [y("i", {
|
|
910
924
|
class: "f-icon f-icon-yxs_copy"
|
|
911
925
|
}, null)]), y("div", {
|
|
@@ -914,22 +928,22 @@ function lt(s, e) {
|
|
|
914
928
|
title: "新增同级",
|
|
915
929
|
ref: "appendSame",
|
|
916
930
|
style: "width:85px!important;padding:0 5px;position:static;",
|
|
917
|
-
onClick: (r) => R(r,
|
|
931
|
+
onClick: (r) => R(r, s, t)
|
|
918
932
|
}, [y("i", {
|
|
919
933
|
class: "f-icon f-icon-plus-circle text-white mr-1"
|
|
920
934
|
}, null), y("span", {
|
|
921
935
|
style: "font-size:13px;margin:auto"
|
|
922
|
-
}, [
|
|
936
|
+
}, [pe("新增同级")])])])]);
|
|
923
937
|
}
|
|
924
|
-
function E(
|
|
925
|
-
return
|
|
938
|
+
function E(s) {
|
|
939
|
+
return s.children.map((t) => t.children && t.children.length ? y("li", {
|
|
926
940
|
class: p(t),
|
|
927
941
|
id: t.id,
|
|
928
|
-
onClick: (r) => t.enable &&
|
|
942
|
+
onClick: (r) => t.enable && m(r, t, s)
|
|
929
943
|
}, [y("span", {
|
|
930
944
|
id: t.id,
|
|
931
945
|
class: T(t),
|
|
932
|
-
onMouseover: (r) => t.enable &&
|
|
946
|
+
onMouseover: (r) => t.enable && m(r, t, s)
|
|
933
947
|
}, [t.text, y("i", {
|
|
934
948
|
class: "f-icon f-icon-arrow-chevron-right",
|
|
935
949
|
style: "display: inline-block;float: right;line-height: 1.25rem;"
|
|
@@ -937,13 +951,13 @@ function lt(s, e) {
|
|
|
937
951
|
class: T(t),
|
|
938
952
|
id: t.id,
|
|
939
953
|
onClick: (r) => j(r, t)
|
|
940
|
-
}, [v(t,
|
|
941
|
-
class:
|
|
954
|
+
}, [v(t, s), o.shouldShowIcon(t) && y("i", {
|
|
955
|
+
class: o.iconClass(t)
|
|
942
956
|
}, null), t.text]));
|
|
943
957
|
}
|
|
944
|
-
function P(
|
|
945
|
-
const
|
|
946
|
-
display:
|
|
958
|
+
function P(s, t, r) {
|
|
959
|
+
const d = {
|
|
960
|
+
display: s.expanded ? "block" : "none",
|
|
947
961
|
position: "fixed",
|
|
948
962
|
maxWidth: "300px",
|
|
949
963
|
width: "auto",
|
|
@@ -957,60 +971,60 @@ function lt(s, e) {
|
|
|
957
971
|
right: _,
|
|
958
972
|
height: N
|
|
959
973
|
} = S[0], q = Math.ceil(N + $);
|
|
960
|
-
|
|
961
|
-
const G =
|
|
974
|
+
d.top = `${q}px`, d.left = `${W}px`;
|
|
975
|
+
const G = s.id + "_menu", K = t ? t.querySelector("#" + G) : null;
|
|
962
976
|
if (K) {
|
|
963
|
-
|
|
964
|
-
const
|
|
977
|
+
d.display === "block" && (K.style.display = "block");
|
|
978
|
+
const ie = K.getBoundingClientRect();
|
|
965
979
|
if (r) {
|
|
966
|
-
|
|
980
|
+
d.top = `${$ - 6}px`;
|
|
967
981
|
const Te = Math.ceil(U + W);
|
|
968
|
-
|
|
982
|
+
d.left = `${Te}px`;
|
|
969
983
|
}
|
|
970
|
-
w - W - U <
|
|
984
|
+
w - W - U < ie.width && (d.left = `${(r ? W : _) - ie.width}px`);
|
|
971
985
|
}
|
|
972
986
|
}
|
|
973
|
-
return
|
|
987
|
+
return d;
|
|
974
988
|
}
|
|
975
|
-
x = function(
|
|
989
|
+
x = function(s, t) {
|
|
976
990
|
var C, S;
|
|
977
|
-
const r =
|
|
991
|
+
const r = de(), d = t ? t.id : s.id, w = (S = (C = r == null ? void 0 : r.exposed) == null ? void 0 : C.elementRef.value) == null ? void 0 : S.querySelector("#" + d);
|
|
978
992
|
return y("ul", {
|
|
979
|
-
class:
|
|
980
|
-
style: P(
|
|
981
|
-
id:
|
|
982
|
-
}, [E(
|
|
993
|
+
class: f(s),
|
|
994
|
+
style: P(s, w, t),
|
|
995
|
+
id: s.id + "_menu"
|
|
996
|
+
}, [E(s)]);
|
|
983
997
|
};
|
|
984
998
|
function h() {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
}),
|
|
999
|
+
g.forEach((s) => {
|
|
1000
|
+
s.expanded = !1;
|
|
1001
|
+
}), g.clear();
|
|
988
1002
|
}
|
|
989
1003
|
return {
|
|
990
1004
|
renderDropdownMenu: x,
|
|
991
1005
|
clearAllDropDownMenu: h
|
|
992
1006
|
};
|
|
993
1007
|
}
|
|
994
|
-
function
|
|
995
|
-
const i = M(
|
|
996
|
-
renderDropdownMenu:
|
|
997
|
-
clearAllDropDownMenu:
|
|
998
|
-
} =
|
|
1008
|
+
function dt(o, e, n) {
|
|
1009
|
+
const i = M(o.alignment), {
|
|
1010
|
+
renderDropdownMenu: a,
|
|
1011
|
+
clearAllDropDownMenu: f
|
|
1012
|
+
} = at(e, n), p = L("design-item-context"), T = L("toolbar-item-handler", () => {
|
|
999
1013
|
});
|
|
1000
1014
|
function x() {
|
|
1001
1015
|
T && T();
|
|
1002
1016
|
}
|
|
1003
|
-
function
|
|
1004
|
-
const
|
|
1017
|
+
function g(h) {
|
|
1018
|
+
const s = {
|
|
1005
1019
|
"btn-group": !0,
|
|
1006
1020
|
"f-rt-dropdown": !0,
|
|
1007
1021
|
"f-btn-ml": i.value === "right",
|
|
1008
1022
|
"f-btn-mr": i.value === "left"
|
|
1009
1023
|
}, t = h.dropdownClass.split(" ");
|
|
1010
|
-
return t && t.length && t.reduce((r,
|
|
1024
|
+
return t && t.length && t.reduce((r, d) => (r[d] = !0, r), s), s;
|
|
1011
1025
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const
|
|
1026
|
+
function m(h) {
|
|
1027
|
+
const s = {
|
|
1014
1028
|
btn: !0,
|
|
1015
1029
|
disabled: !h.enable,
|
|
1016
1030
|
"position-relative": !0,
|
|
@@ -1020,23 +1034,23 @@ function at(s, e, n) {
|
|
|
1020
1034
|
};
|
|
1021
1035
|
if (h.class) {
|
|
1022
1036
|
const t = h.class.split(" ");
|
|
1023
|
-
t && t.length && t.reduce((r,
|
|
1037
|
+
t && t.length && t.reduce((r, d) => (r[d] = !0, r), s);
|
|
1024
1038
|
}
|
|
1025
|
-
return
|
|
1039
|
+
return s;
|
|
1026
1040
|
}
|
|
1027
1041
|
function l(h) {
|
|
1028
1042
|
h && (h.stopPropagation(), h.preventDefault());
|
|
1029
1043
|
}
|
|
1030
|
-
function c(h,
|
|
1044
|
+
function c(h, s) {
|
|
1031
1045
|
l(h);
|
|
1032
|
-
const t =
|
|
1033
|
-
document.body.click(),
|
|
1046
|
+
const t = s.expanded;
|
|
1047
|
+
document.body.click(), s.expanded = !t;
|
|
1034
1048
|
}
|
|
1035
1049
|
const u = function(h) {
|
|
1036
1050
|
const {
|
|
1037
|
-
componentType:
|
|
1038
|
-
} = h, t = Z(
|
|
1039
|
-
return t && !t.id && t.type ===
|
|
1051
|
+
componentType: s
|
|
1052
|
+
} = h, t = Z(s, h), r = s.toLowerCase().replace("-", "_");
|
|
1053
|
+
return t && !t.id && t.type === s && (t.id = `${r}_${Math.random().toString().slice(2, 6)}`), t;
|
|
1040
1054
|
}, b = function() {
|
|
1041
1055
|
const h = {
|
|
1042
1056
|
componentType: "response-toolbar-item",
|
|
@@ -1046,39 +1060,39 @@ function at(s, e, n) {
|
|
|
1046
1060
|
return u(h);
|
|
1047
1061
|
};
|
|
1048
1062
|
function I(h) {
|
|
1049
|
-
const
|
|
1063
|
+
const s = p.schema.buttons || p.schema.contents, t = s == null ? void 0 : s.findIndex((d) => d.id === h), r = t === -1 ? null : s[t];
|
|
1050
1064
|
return {
|
|
1051
1065
|
index: t,
|
|
1052
1066
|
toolbarItem: r
|
|
1053
1067
|
};
|
|
1054
1068
|
}
|
|
1055
|
-
function B(h,
|
|
1069
|
+
function B(h, s) {
|
|
1056
1070
|
var S;
|
|
1057
1071
|
const {
|
|
1058
1072
|
index: t,
|
|
1059
1073
|
toolbarItem: r
|
|
1060
|
-
} = I(
|
|
1074
|
+
} = I(s);
|
|
1061
1075
|
if (t === -1)
|
|
1062
1076
|
return;
|
|
1063
|
-
const
|
|
1064
|
-
text:
|
|
1077
|
+
const d = r.text || "按钮", w = b(), C = Object.assign({}, w, {
|
|
1078
|
+
text: d
|
|
1065
1079
|
});
|
|
1066
1080
|
(S = p.schema.buttons) == null || S.push(C), x();
|
|
1067
1081
|
}
|
|
1068
|
-
function O(h,
|
|
1082
|
+
function O(h, s) {
|
|
1069
1083
|
const {
|
|
1070
1084
|
index: t,
|
|
1071
1085
|
toolbarItem: r
|
|
1072
|
-
} = I(
|
|
1086
|
+
} = I(s);
|
|
1073
1087
|
if (t === -1)
|
|
1074
1088
|
return;
|
|
1075
|
-
const
|
|
1076
|
-
text:
|
|
1089
|
+
const d = r.text || "按钮", w = b(), C = Object.assign({}, w, {
|
|
1090
|
+
text: d
|
|
1077
1091
|
}), S = p.schema.buttons[t].children || [];
|
|
1078
1092
|
S.push(C), p.schema.buttons[t].children = S, x();
|
|
1079
1093
|
}
|
|
1080
|
-
function F(h,
|
|
1081
|
-
const t = p.schema.buttons || p.schema.contents, r = t == null ? void 0 : t.findIndex((
|
|
1094
|
+
function F(h, s) {
|
|
1095
|
+
const t = p.schema.buttons || p.schema.contents, r = t == null ? void 0 : t.findIndex((d) => d.id === s);
|
|
1082
1096
|
r !== -1 && (t.splice(r, 1), x());
|
|
1083
1097
|
}
|
|
1084
1098
|
function j(h) {
|
|
@@ -1090,7 +1104,7 @@ function at(s, e, n) {
|
|
|
1090
1104
|
title: "删除",
|
|
1091
1105
|
ref: "removeButton",
|
|
1092
1106
|
style: "position:static;",
|
|
1093
|
-
onClick: (
|
|
1107
|
+
onClick: (s) => F(s, h)
|
|
1094
1108
|
}, [y("i", {
|
|
1095
1109
|
class: "f-icon f-icon-yxs_delete"
|
|
1096
1110
|
}, null)]), y("div", {
|
|
@@ -1099,7 +1113,7 @@ function at(s, e, n) {
|
|
|
1099
1113
|
title: "复制",
|
|
1100
1114
|
ref: "copyButton",
|
|
1101
1115
|
style: "position:static;",
|
|
1102
|
-
onClick: (
|
|
1116
|
+
onClick: (s) => B(s, h)
|
|
1103
1117
|
}, [y("i", {
|
|
1104
1118
|
class: "f-icon f-icon-yxs_copy"
|
|
1105
1119
|
}, null)]), y("div", {
|
|
@@ -1108,56 +1122,56 @@ function at(s, e, n) {
|
|
|
1108
1122
|
title: "新增子级",
|
|
1109
1123
|
ref: "appendChildButton",
|
|
1110
1124
|
style: "width:85px!important;padding:0 5px;position:static;",
|
|
1111
|
-
onClick: (
|
|
1125
|
+
onClick: (s) => O(s, h)
|
|
1112
1126
|
}, [y("i", {
|
|
1113
1127
|
class: "f-icon f-icon-plus-circle text-white mr-1"
|
|
1114
1128
|
}, null), y("span", {
|
|
1115
1129
|
style: "font-size:13px;margin:auto"
|
|
1116
|
-
}, [
|
|
1130
|
+
}, [pe("新增子级")])])])]);
|
|
1117
1131
|
}
|
|
1118
1132
|
function A() {
|
|
1119
|
-
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((
|
|
1133
|
+
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((s) => s.classList.remove("dgComponentFocused"));
|
|
1120
1134
|
const h = document.getElementsByClassName("dgComponentSelected");
|
|
1121
|
-
Array.from(h).forEach((
|
|
1135
|
+
Array.from(h).forEach((s) => s.classList.remove("dgComponentSelected"));
|
|
1122
1136
|
}
|
|
1123
1137
|
function k(h) {
|
|
1124
1138
|
h.currentTarget.classList.add("dgComponentFocused", "dgComponentSelected");
|
|
1125
1139
|
}
|
|
1126
1140
|
function R(h) {
|
|
1127
|
-
var
|
|
1128
|
-
const
|
|
1141
|
+
var d;
|
|
1142
|
+
const s = p.schema.buttons || p.schema.contents, t = s == null ? void 0 : s.findIndex((w) => w.id === h);
|
|
1129
1143
|
if (t === -1)
|
|
1130
1144
|
return;
|
|
1131
|
-
const r =
|
|
1132
|
-
(
|
|
1145
|
+
const r = s[t];
|
|
1146
|
+
(d = p == null ? void 0 : p.setupContext) == null || d.emit("selectionChange", "response-toolbar-item", r);
|
|
1133
1147
|
}
|
|
1134
|
-
function v(h,
|
|
1135
|
-
l(h), A(), k(h), l(h), c(h,
|
|
1148
|
+
function v(h, s) {
|
|
1149
|
+
l(h), A(), k(h), l(h), c(h, s), R(s.id);
|
|
1136
1150
|
}
|
|
1137
1151
|
function E(h) {
|
|
1138
1152
|
return y("div", {
|
|
1139
1153
|
id: h.id,
|
|
1140
|
-
class:
|
|
1154
|
+
class: g(h)
|
|
1141
1155
|
}, [y("div", {
|
|
1142
|
-
class:
|
|
1156
|
+
class: m(h),
|
|
1143
1157
|
style: "display: flex;padding-right: 0.1rem;",
|
|
1144
|
-
onClick: (
|
|
1158
|
+
onClick: (s) => h.enable && v(s, h)
|
|
1145
1159
|
}, [j(h.id), e.shouldShowIcon(h) && y("i", {
|
|
1146
1160
|
class: e.iconClass(h)
|
|
1147
1161
|
}, null), y("span", null, [h.text]), y("i", {
|
|
1148
1162
|
class: "f-icon f-icon-arrow-chevron-down",
|
|
1149
1163
|
style: "display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"
|
|
1150
|
-
}, null)]),
|
|
1164
|
+
}, null)]), a(h)]);
|
|
1151
1165
|
}
|
|
1152
1166
|
function P() {
|
|
1153
|
-
|
|
1167
|
+
f();
|
|
1154
1168
|
}
|
|
1155
1169
|
return {
|
|
1156
1170
|
renderToolbarDropdown: E,
|
|
1157
1171
|
clearAllDropDown: P
|
|
1158
1172
|
};
|
|
1159
1173
|
}
|
|
1160
|
-
class
|
|
1174
|
+
class re {
|
|
1161
1175
|
constructor(e, n) {
|
|
1162
1176
|
D(this, "componentId");
|
|
1163
1177
|
D(this, "viewModelId");
|
|
@@ -1186,8 +1200,8 @@ class se {
|
|
|
1186
1200
|
const n = e.binding && e.binding.type === "Form" && e.binding.field;
|
|
1187
1201
|
if (n) {
|
|
1188
1202
|
if (!this.designViewModelField) {
|
|
1189
|
-
const
|
|
1190
|
-
this.designViewModelField =
|
|
1203
|
+
const a = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
1204
|
+
this.designViewModelField = a.fields.find((f) => f.id === n);
|
|
1191
1205
|
}
|
|
1192
1206
|
e.updateOn = (i = this.designViewModelField) == null ? void 0 : i.updateOn;
|
|
1193
1207
|
}
|
|
@@ -1213,7 +1227,7 @@ class se {
|
|
|
1213
1227
|
type: "combo-list",
|
|
1214
1228
|
textField: "name",
|
|
1215
1229
|
valueField: "value",
|
|
1216
|
-
data: [{ value: e.type, name:
|
|
1230
|
+
data: [{ value: e.type, name: ne[e.type].name }]
|
|
1217
1231
|
}
|
|
1218
1232
|
}
|
|
1219
1233
|
}
|
|
@@ -1249,11 +1263,11 @@ class se {
|
|
|
1249
1263
|
const i = n && n.parent && n.parent.schema;
|
|
1250
1264
|
if (!i)
|
|
1251
1265
|
return;
|
|
1252
|
-
const
|
|
1253
|
-
i.contents.splice(
|
|
1266
|
+
const a = i.contents.findIndex((p) => p.id === e), f = ee(i.contents[a]);
|
|
1267
|
+
i.contents.splice(a, 1), i.contents.splice(a, 0, f);
|
|
1254
1268
|
}
|
|
1255
1269
|
}
|
|
1256
|
-
class
|
|
1270
|
+
class ut extends re {
|
|
1257
1271
|
constructor(e, n) {
|
|
1258
1272
|
super(e, n);
|
|
1259
1273
|
}
|
|
@@ -1293,7 +1307,7 @@ class dt extends se {
|
|
|
1293
1307
|
type: "combo-list",
|
|
1294
1308
|
textField: "value",
|
|
1295
1309
|
valueField: "key",
|
|
1296
|
-
data: [{ key: "response-toolbar", value:
|
|
1310
|
+
data: [{ key: "response-toolbar", value: ne["response-toolbar"].name }]
|
|
1297
1311
|
}
|
|
1298
1312
|
}
|
|
1299
1313
|
}
|
|
@@ -1336,15 +1350,15 @@ class dt extends se {
|
|
|
1336
1350
|
};
|
|
1337
1351
|
}
|
|
1338
1352
|
}
|
|
1339
|
-
function
|
|
1340
|
-
const n =
|
|
1341
|
-
function i(
|
|
1353
|
+
function pt(o, e) {
|
|
1354
|
+
const n = o.schema;
|
|
1355
|
+
function i(m) {
|
|
1342
1356
|
return !1;
|
|
1343
1357
|
}
|
|
1344
|
-
function
|
|
1345
|
-
return l.text =
|
|
1358
|
+
function a(m, l) {
|
|
1359
|
+
return l.text = m.label, l;
|
|
1346
1360
|
}
|
|
1347
|
-
function
|
|
1361
|
+
function f() {
|
|
1348
1362
|
return !1;
|
|
1349
1363
|
}
|
|
1350
1364
|
function p() {
|
|
@@ -1356,20 +1370,20 @@ function ut(s, e) {
|
|
|
1356
1370
|
function x() {
|
|
1357
1371
|
return !0;
|
|
1358
1372
|
}
|
|
1359
|
-
function
|
|
1360
|
-
return new
|
|
1373
|
+
function g(m) {
|
|
1374
|
+
return new ut(m, e).getPropertyConfig(n);
|
|
1361
1375
|
}
|
|
1362
1376
|
return {
|
|
1363
1377
|
canAccepts: i,
|
|
1364
1378
|
checkCanAddComponent: T,
|
|
1365
1379
|
checkCanDeleteComponent: p,
|
|
1366
|
-
checkCanMoveComponent:
|
|
1380
|
+
checkCanMoveComponent: f,
|
|
1367
1381
|
hideNestedPaddingInDesginerView: x,
|
|
1368
|
-
onResolveNewComponentSchema:
|
|
1369
|
-
getPropsConfig:
|
|
1382
|
+
onResolveNewComponentSchema: a,
|
|
1383
|
+
getPropsConfig: g
|
|
1370
1384
|
};
|
|
1371
1385
|
}
|
|
1372
|
-
const
|
|
1386
|
+
const ft = {
|
|
1373
1387
|
id: { type: String, default: "" },
|
|
1374
1388
|
componentId: { type: String, default: "" },
|
|
1375
1389
|
canAdd: { type: Boolean, default: !1 },
|
|
@@ -1382,38 +1396,38 @@ const pt = {
|
|
|
1382
1396
|
* 组件值
|
|
1383
1397
|
*/
|
|
1384
1398
|
modelValue: { type: Object }
|
|
1385
|
-
},
|
|
1386
|
-
function
|
|
1387
|
-
const n = e.getBoundingClientRect(), i =
|
|
1388
|
-
return
|
|
1399
|
+
}, ae = M(0);
|
|
1400
|
+
function gt(o, e) {
|
|
1401
|
+
const n = e.getBoundingClientRect(), i = o.getBoundingClientRect(), a = i.top >= n.top, f = i.top <= n.bottom;
|
|
1402
|
+
return a && f;
|
|
1389
1403
|
}
|
|
1390
|
-
function
|
|
1391
|
-
if (!
|
|
1404
|
+
function mt(o) {
|
|
1405
|
+
if (!o)
|
|
1392
1406
|
return;
|
|
1393
1407
|
let e;
|
|
1394
|
-
if (
|
|
1408
|
+
if (o.className.includes("dgComponentSelected") ? e = o : e = o.querySelector(".dgComponentSelected"), !e)
|
|
1395
1409
|
return;
|
|
1396
1410
|
const n = e.getBoundingClientRect();
|
|
1397
1411
|
if (n.width === 0 && n.height === 0)
|
|
1398
1412
|
return;
|
|
1399
1413
|
const i = e.querySelector(".component-btn-group");
|
|
1400
1414
|
if (i) {
|
|
1401
|
-
if (!
|
|
1415
|
+
if (!gt(e, o)) {
|
|
1402
1416
|
i.style.display = "none";
|
|
1403
1417
|
return;
|
|
1404
1418
|
}
|
|
1405
1419
|
i.style.display = "";
|
|
1406
|
-
const
|
|
1420
|
+
const f = i.getBoundingClientRect(), p = i.querySelector("div");
|
|
1407
1421
|
if (p) {
|
|
1408
1422
|
const T = p.getBoundingClientRect();
|
|
1409
|
-
p.style.top =
|
|
1423
|
+
p.style.top = f.top + "px", p.style.left = f.left - T.width + "px";
|
|
1410
1424
|
}
|
|
1411
1425
|
}
|
|
1412
1426
|
}
|
|
1413
|
-
function
|
|
1427
|
+
function ht(o, e, n) {
|
|
1414
1428
|
var A;
|
|
1415
|
-
const i = "",
|
|
1416
|
-
function
|
|
1429
|
+
const i = "", a = M();
|
|
1430
|
+
function f() {
|
|
1417
1431
|
return !0;
|
|
1418
1432
|
}
|
|
1419
1433
|
function p() {
|
|
@@ -1425,13 +1439,13 @@ function mt(s, e, n) {
|
|
|
1425
1439
|
function x() {
|
|
1426
1440
|
return !0;
|
|
1427
1441
|
}
|
|
1428
|
-
function
|
|
1442
|
+
function g() {
|
|
1429
1443
|
return !0;
|
|
1430
1444
|
}
|
|
1431
|
-
function
|
|
1445
|
+
function m(k) {
|
|
1432
1446
|
if (!k || !k.value)
|
|
1433
1447
|
return null;
|
|
1434
|
-
const R = M(k == null ? void 0 : k.value.parent), v =
|
|
1448
|
+
const R = M(k == null ? void 0 : k.value.parent), v = m(R);
|
|
1435
1449
|
return v || null;
|
|
1436
1450
|
}
|
|
1437
1451
|
function l(k = e) {
|
|
@@ -1461,19 +1475,19 @@ function mt(s, e, n) {
|
|
|
1461
1475
|
}
|
|
1462
1476
|
function j() {
|
|
1463
1477
|
}
|
|
1464
|
-
return
|
|
1465
|
-
canMove:
|
|
1478
|
+
return a.value = {
|
|
1479
|
+
canMove: f(),
|
|
1466
1480
|
canSelectParent: p(),
|
|
1467
1481
|
canAdd: x(),
|
|
1468
1482
|
canDelete: T(),
|
|
1469
|
-
canNested: !
|
|
1483
|
+
canNested: !g(),
|
|
1470
1484
|
contents: [],
|
|
1471
|
-
elementRef:
|
|
1485
|
+
elementRef: o,
|
|
1472
1486
|
parent: (A = e.parent) == null ? void 0 : A.componentInstance,
|
|
1473
1487
|
schema: e.schema,
|
|
1474
1488
|
styles: i,
|
|
1475
1489
|
canAccepts: c,
|
|
1476
|
-
getBelongedComponentInstance:
|
|
1490
|
+
getBelongedComponentInstance: m,
|
|
1477
1491
|
getDraggableDesignItemElement: l,
|
|
1478
1492
|
getDraggingDisplayText: u,
|
|
1479
1493
|
getPropConfig: F,
|
|
@@ -1484,17 +1498,17 @@ function mt(s, e, n) {
|
|
|
1484
1498
|
onRemoveComponent: j,
|
|
1485
1499
|
triggerBelongedComponentToMoveWhenMoved: M(!1),
|
|
1486
1500
|
triggerBelongedComponentToDeleteWhenDeleted: M(!1)
|
|
1487
|
-
},
|
|
1501
|
+
}, a;
|
|
1488
1502
|
}
|
|
1489
|
-
const
|
|
1503
|
+
const bt = /* @__PURE__ */ Y({
|
|
1490
1504
|
name: "FDesignerInnerItem",
|
|
1491
|
-
props:
|
|
1505
|
+
props: ft,
|
|
1492
1506
|
emits: ["selectionChange", "addComponent", "removeComponent"],
|
|
1493
|
-
setup(
|
|
1494
|
-
const n = M(
|
|
1507
|
+
setup(o, e) {
|
|
1508
|
+
const n = M(o.canMove), i = M(o.canAdd), a = M(o.canDelete), f = M(!1), p = M(o.contentKey), T = M(o.childType), x = M(o.childLabel), g = M(o.modelValue), m = M(""), l = M(), c = L("canvas-dragula"), u = M(), b = L("design-item-context"), I = {
|
|
1495
1509
|
designerItemElementRef: l,
|
|
1496
1510
|
componentInstance: u,
|
|
1497
|
-
schema:
|
|
1511
|
+
schema: g.value,
|
|
1498
1512
|
parent: b,
|
|
1499
1513
|
setupContext: e
|
|
1500
1514
|
};
|
|
@@ -1502,24 +1516,24 @@ const ht = /* @__PURE__ */ Y({
|
|
|
1502
1516
|
const B = V(() => ({
|
|
1503
1517
|
"farris-component": !0,
|
|
1504
1518
|
// 受position-relative影响,整个容器的高度不能被撑起
|
|
1505
|
-
"flex-fill":
|
|
1506
|
-
"position-relative": n.value ||
|
|
1507
|
-
"farris-nested":
|
|
1519
|
+
"flex-fill": o.id === "root-component",
|
|
1520
|
+
"position-relative": n.value || a.value,
|
|
1521
|
+
"farris-nested": f.value,
|
|
1508
1522
|
"can-move": n.value,
|
|
1509
1523
|
"d-none": l.value && l.value.classList.contains("d-none")
|
|
1510
1524
|
})), O = V(() => {
|
|
1511
1525
|
const t = {};
|
|
1512
|
-
return
|
|
1513
|
-
const [w, C] =
|
|
1526
|
+
return m.value && m.value.split(";").reduce((r, d) => {
|
|
1527
|
+
const [w, C] = d.split(":");
|
|
1514
1528
|
return w && (r[w] = C), r;
|
|
1515
1529
|
}, t), t;
|
|
1516
1530
|
});
|
|
1517
1531
|
function F(t, r) {
|
|
1518
1532
|
if (b && b.schema[p.value]) {
|
|
1519
|
-
const
|
|
1520
|
-
if (
|
|
1521
|
-
const w = b.schema[p.value].length, C = b.schema[p.value][
|
|
1522
|
-
b.designerItemElementRef.value.querySelector(`#${C.id}-design-item`), b.schema[p.value].splice(
|
|
1533
|
+
const d = b.schema[p.value].findIndex((w) => w.id === r.id);
|
|
1534
|
+
if (d > -1) {
|
|
1535
|
+
const w = b.schema[p.value].length, C = b.schema[p.value][d % w];
|
|
1536
|
+
b.designerItemElementRef.value.querySelector(`#${C.id}-design-item`), b.schema[p.value].splice(d, 1), ae.value++, e.emit("removeComponent");
|
|
1523
1537
|
}
|
|
1524
1538
|
}
|
|
1525
1539
|
}
|
|
@@ -1530,8 +1544,8 @@ const ht = /* @__PURE__ */ Y({
|
|
|
1530
1544
|
label: x.value,
|
|
1531
1545
|
parentComponentInstance: u.value,
|
|
1532
1546
|
targetPosition: -1
|
|
1533
|
-
},
|
|
1534
|
-
|
|
1547
|
+
}, d = u.value.addNewChildComponentSchema(r);
|
|
1548
|
+
g.value[p.value].push(d), e.emit("addComponent");
|
|
1535
1549
|
}
|
|
1536
1550
|
}
|
|
1537
1551
|
function A() {
|
|
@@ -1548,7 +1562,7 @@ const ht = /* @__PURE__ */ Y({
|
|
|
1548
1562
|
}, null)]);
|
|
1549
1563
|
}
|
|
1550
1564
|
function k(t) {
|
|
1551
|
-
return
|
|
1565
|
+
return a.value && y("div", {
|
|
1552
1566
|
role: "button",
|
|
1553
1567
|
class: "btn component-settings-button",
|
|
1554
1568
|
title: "删除",
|
|
@@ -1575,52 +1589,52 @@ const ht = /* @__PURE__ */ Y({
|
|
|
1575
1589
|
"data-noattach": "true"
|
|
1576
1590
|
}, [y("div", null, [A(), R(), k(t)])]);
|
|
1577
1591
|
}
|
|
1578
|
-
Q(() =>
|
|
1579
|
-
|
|
1592
|
+
Q(() => o.modelValue, (t) => {
|
|
1593
|
+
g.value = t, I.schema = t;
|
|
1580
1594
|
});
|
|
1581
1595
|
function E(t) {
|
|
1582
1596
|
const r = t.target;
|
|
1583
|
-
|
|
1597
|
+
mt(r);
|
|
1584
1598
|
}
|
|
1585
1599
|
function P() {
|
|
1586
1600
|
var t, r;
|
|
1587
|
-
(r = (t =
|
|
1601
|
+
(r = (t = g.value) == null ? void 0 : t.contents) != null && r.length && l.value && l.value.addEventListener("scroll", E);
|
|
1588
1602
|
}
|
|
1589
1603
|
function h() {
|
|
1590
1604
|
const t = l.value, r = M(t.children[1]);
|
|
1591
|
-
return
|
|
1605
|
+
return ht(r, I).value;
|
|
1592
1606
|
}
|
|
1593
1607
|
H(() => {
|
|
1594
1608
|
if (l.value) {
|
|
1595
|
-
const t = l.value.querySelector(`[data-dragref='${
|
|
1596
|
-
u.value = t && t.componentInstance ? t.componentInstance.value : h(), c && t && c.attachComponents(t,
|
|
1609
|
+
const t = l.value.querySelector(`[data-dragref='${g.value.id}-container']`);
|
|
1610
|
+
u.value = t && t.componentInstance ? t.componentInstance.value : h(), c && t && c.attachComponents(t, g.value), f.value = u.value.canNested !== void 0 ? u.value.canNested : f.value, i.value = u.value.canAdd !== void 0 ? u.value.canAdd : i.value, a.value = u.value.canDelete !== void 0 ? u.value.canDelete : a.value, n.value = u.value.canMove !== void 0 ? u.value.canMove : n.value, m.value = u.value.styles || "", l.value && (l.value.componentInstance = u, l.value.designItemContext = I);
|
|
1597
1611
|
}
|
|
1598
|
-
P(),
|
|
1612
|
+
P(), ae.value++;
|
|
1599
1613
|
}), Me(() => {
|
|
1600
1614
|
l.value && l.value.removeEventListener("scroll", E);
|
|
1601
1615
|
});
|
|
1602
|
-
function
|
|
1616
|
+
function s(t) {
|
|
1603
1617
|
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((w) => w.classList.remove("dgComponentFocused")), t && (t.preventDefault(), t.stopPropagation());
|
|
1604
1618
|
let r = I.designerItemElementRef;
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1619
|
+
const d = l.value;
|
|
1620
|
+
if (d) {
|
|
1607
1621
|
const w = document.getElementsByClassName("dgComponentSelected");
|
|
1608
|
-
w && w.length === 1 && w[0] === l.value || (Array.from(w).forEach((S) => S.classList.remove("dgComponentSelected")),
|
|
1622
|
+
w && w.length === 1 && w[0] === l.value || (Array.from(w).forEach((S) => S.classList.remove("dgComponentSelected")), d.classList.add("dgComponentFocused"), e.emit("selectionChange", g.value.type, g.value, o.componentId, u.value), r = u.value.getDraggableDesignItemElement(I), r && r.value && r.value.classList.add("dgComponentSelected"));
|
|
1609
1623
|
}
|
|
1610
1624
|
E({
|
|
1611
1625
|
target: r == null ? void 0 : r.value
|
|
1612
1626
|
});
|
|
1613
1627
|
}
|
|
1614
1628
|
return () => y("div", {
|
|
1615
|
-
id: `${
|
|
1629
|
+
id: `${o.id}-design-item`,
|
|
1616
1630
|
ref: l,
|
|
1617
1631
|
class: B.value,
|
|
1618
1632
|
style: O.value,
|
|
1619
|
-
onClick:
|
|
1620
|
-
}, [v(
|
|
1633
|
+
onClick: s
|
|
1634
|
+
}, [v(g.value), e.slots.default && e.slots.default()]);
|
|
1621
1635
|
}
|
|
1622
1636
|
});
|
|
1623
|
-
class
|
|
1637
|
+
class yt extends re {
|
|
1624
1638
|
constructor(e, n) {
|
|
1625
1639
|
super(e, n);
|
|
1626
1640
|
}
|
|
@@ -1681,16 +1695,16 @@ class bt extends se {
|
|
|
1681
1695
|
label: "onClick",
|
|
1682
1696
|
name: "点击事件"
|
|
1683
1697
|
}
|
|
1684
|
-
], i = this,
|
|
1685
|
-
|
|
1698
|
+
], i = this, a = i.eventsEditorUtils.formProperties(e, i.viewModelId, n), f = {};
|
|
1699
|
+
f[i.viewModelId] = {
|
|
1686
1700
|
type: "events-editor",
|
|
1687
1701
|
editor: {
|
|
1688
|
-
initialData:
|
|
1702
|
+
initialData: a
|
|
1689
1703
|
}
|
|
1690
1704
|
}, this.propertyConfig.categories.eventsEditor = {
|
|
1691
1705
|
title: "事件",
|
|
1692
1706
|
hideTitle: !0,
|
|
1693
|
-
properties:
|
|
1707
|
+
properties: f,
|
|
1694
1708
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
1695
1709
|
refreshPanelAfterChanged: !0,
|
|
1696
1710
|
tabId: "commands",
|
|
@@ -1702,7 +1716,7 @@ class bt extends se {
|
|
|
1702
1716
|
};
|
|
1703
1717
|
}
|
|
1704
1718
|
}
|
|
1705
|
-
class
|
|
1719
|
+
class vt extends re {
|
|
1706
1720
|
constructor(e, n) {
|
|
1707
1721
|
super(e, n);
|
|
1708
1722
|
}
|
|
@@ -1728,7 +1742,7 @@ class yt extends se {
|
|
|
1728
1742
|
type: "combo-list",
|
|
1729
1743
|
textField: "value",
|
|
1730
1744
|
valueField: "key",
|
|
1731
|
-
data: [{ key: "response-toolbar-item", value:
|
|
1745
|
+
data: [{ key: "response-toolbar-item", value: ne["response-toolbar-item"].name }]
|
|
1732
1746
|
}
|
|
1733
1747
|
},
|
|
1734
1748
|
text: {
|
|
@@ -1779,16 +1793,16 @@ class yt extends se {
|
|
|
1779
1793
|
label: "onClick",
|
|
1780
1794
|
name: "点击事件"
|
|
1781
1795
|
}
|
|
1782
|
-
], i = this,
|
|
1783
|
-
|
|
1796
|
+
], i = this, a = i.eventsEditorUtils.formProperties(e, i.viewModelId, n), f = {};
|
|
1797
|
+
f[i.viewModelId] = {
|
|
1784
1798
|
type: "events-editor",
|
|
1785
1799
|
editor: {
|
|
1786
|
-
initialData:
|
|
1800
|
+
initialData: a
|
|
1787
1801
|
}
|
|
1788
1802
|
}, this.propertyConfig.categories.eventsEditor = {
|
|
1789
1803
|
title: "事件",
|
|
1790
1804
|
hideTitle: !0,
|
|
1791
|
-
properties:
|
|
1805
|
+
properties: f,
|
|
1792
1806
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
1793
1807
|
refreshPanelAfterChanged: !0,
|
|
1794
1808
|
tabId: "commands",
|
|
@@ -1800,35 +1814,35 @@ class yt extends se {
|
|
|
1800
1814
|
};
|
|
1801
1815
|
}
|
|
1802
1816
|
}
|
|
1803
|
-
function
|
|
1817
|
+
function Ct(o, e) {
|
|
1804
1818
|
function n(T) {
|
|
1805
1819
|
return !1;
|
|
1806
1820
|
}
|
|
1807
1821
|
function i() {
|
|
1808
1822
|
return !1;
|
|
1809
1823
|
}
|
|
1810
|
-
function
|
|
1824
|
+
function a() {
|
|
1811
1825
|
return !0;
|
|
1812
1826
|
}
|
|
1813
|
-
function
|
|
1827
|
+
function f() {
|
|
1814
1828
|
return !1;
|
|
1815
1829
|
}
|
|
1816
1830
|
function p(T) {
|
|
1817
1831
|
let x;
|
|
1818
|
-
switch (
|
|
1832
|
+
switch (o.schema.type) {
|
|
1819
1833
|
case "tab-toolbar-item":
|
|
1820
|
-
x = new
|
|
1834
|
+
x = new yt(T, e);
|
|
1821
1835
|
break;
|
|
1822
1836
|
default:
|
|
1823
|
-
x = new
|
|
1837
|
+
x = new vt(T, e);
|
|
1824
1838
|
}
|
|
1825
|
-
return x.getPropertyConfig(
|
|
1839
|
+
return x.getPropertyConfig(o.schema);
|
|
1826
1840
|
}
|
|
1827
1841
|
return {
|
|
1828
1842
|
canAccepts: n,
|
|
1829
1843
|
checkCanMoveComponent: i,
|
|
1830
|
-
checkCanDeleteComponent:
|
|
1831
|
-
checkCanAddComponent:
|
|
1844
|
+
checkCanDeleteComponent: a,
|
|
1845
|
+
checkCanAddComponent: f,
|
|
1832
1846
|
getPropsConfig: p
|
|
1833
1847
|
};
|
|
1834
1848
|
}
|
|
@@ -1836,26 +1850,26 @@ const xe = /* @__PURE__ */ Y({
|
|
|
1836
1850
|
name: "FResponseToolbarItemDesign",
|
|
1837
1851
|
props: Ce,
|
|
1838
1852
|
emits: ["Click"],
|
|
1839
|
-
setup(
|
|
1853
|
+
setup(o, e) {
|
|
1840
1854
|
M(), M();
|
|
1841
|
-
const n = M(
|
|
1855
|
+
const n = M(o.alignment), i = {
|
|
1842
1856
|
id: "__more_buttons__",
|
|
1843
1857
|
text: "More"
|
|
1844
|
-
},
|
|
1845
|
-
V(() =>
|
|
1846
|
-
const
|
|
1858
|
+
}, a = M(new z(i));
|
|
1859
|
+
V(() => a.value.children.length > 0);
|
|
1860
|
+
const f = M(), p = L("designer-host-service"), T = L("design-item-context"), x = Ct(T, p), g = fe(f, T, x);
|
|
1847
1861
|
L("toolbar-item-handler", () => {
|
|
1848
1862
|
}), H(() => {
|
|
1849
|
-
|
|
1850
|
-
}), e.expose(
|
|
1851
|
-
function
|
|
1863
|
+
f.value.componentInstance = g;
|
|
1864
|
+
}), e.expose(g.value);
|
|
1865
|
+
function m() {
|
|
1852
1866
|
const u = {
|
|
1853
1867
|
"f-icon": !0
|
|
1854
|
-
}, b =
|
|
1868
|
+
}, b = o.icon ? o.icon.trim() : "";
|
|
1855
1869
|
return J(u, b);
|
|
1856
1870
|
}
|
|
1857
1871
|
function l() {
|
|
1858
|
-
return !!(
|
|
1872
|
+
return !!(o.icon && o.icon.trim());
|
|
1859
1873
|
}
|
|
1860
1874
|
function c() {
|
|
1861
1875
|
const u = {
|
|
@@ -1863,40 +1877,40 @@ const xe = /* @__PURE__ */ Y({
|
|
|
1863
1877
|
"f-rt-btn": !0,
|
|
1864
1878
|
"f-btn-ml": n.value === "right",
|
|
1865
1879
|
"f-btn-mr": n.value === "left",
|
|
1866
|
-
"btn-icontext": !!(
|
|
1867
|
-
disabled:
|
|
1880
|
+
"btn-icontext": !!(o.icon && o.icon.trim()),
|
|
1881
|
+
disabled: o.disabled === !0
|
|
1868
1882
|
};
|
|
1869
|
-
return J(u,
|
|
1883
|
+
return J(u, o.class);
|
|
1870
1884
|
}
|
|
1871
1885
|
return () => y("div", {
|
|
1872
|
-
ref:
|
|
1886
|
+
ref: f,
|
|
1873
1887
|
"data-dragref": `${T.schema.id}-container`,
|
|
1874
1888
|
class: "farris-component position-relative",
|
|
1875
1889
|
style: "display:inline-block!important;"
|
|
1876
1890
|
}, [y("button", {
|
|
1877
1891
|
type: "button",
|
|
1878
1892
|
class: c(),
|
|
1879
|
-
id:
|
|
1893
|
+
id: o.id
|
|
1880
1894
|
}, [l() && y("i", {
|
|
1881
|
-
class:
|
|
1882
|
-
}, null),
|
|
1895
|
+
class: m()
|
|
1896
|
+
}, null), o.text])]);
|
|
1883
1897
|
}
|
|
1884
|
-
}),
|
|
1898
|
+
}), wt = /* @__PURE__ */ Y({
|
|
1885
1899
|
name: "FResponseToolbarDesign",
|
|
1886
|
-
props:
|
|
1900
|
+
props: rt,
|
|
1887
1901
|
emits: ["Click"],
|
|
1888
|
-
setup(
|
|
1889
|
-
const n = M(
|
|
1902
|
+
setup(o, e) {
|
|
1903
|
+
const n = M(o.items);
|
|
1890
1904
|
let i = new Array(n.value.length).fill(M());
|
|
1891
|
-
const
|
|
1905
|
+
const a = M(), f = M(), p = M(o.alignment), T = {
|
|
1892
1906
|
id: "__more_buttons__",
|
|
1893
1907
|
text: "More"
|
|
1894
|
-
}, x = M(new z(T)),
|
|
1908
|
+
}, x = M(new z(T)), g = we();
|
|
1895
1909
|
V(() => x.value.children.length > 0);
|
|
1896
|
-
const
|
|
1910
|
+
const m = M(), l = L("designer-host-service"), c = L("design-item-context"), u = pt(c, l), b = fe(m, c, u), I = L("toolbar-item-handler", () => {
|
|
1897
1911
|
});
|
|
1898
1912
|
H(() => {
|
|
1899
|
-
|
|
1913
|
+
m.value.componentInstance = b;
|
|
1900
1914
|
}), e.expose(b.value);
|
|
1901
1915
|
function B() {
|
|
1902
1916
|
I && I();
|
|
@@ -1905,7 +1919,7 @@ const xe = /* @__PURE__ */ Y({
|
|
|
1905
1919
|
"f-toolbar": !0,
|
|
1906
1920
|
"f-response-toolbar": !0,
|
|
1907
1921
|
"position-relative": !0
|
|
1908
|
-
},
|
|
1922
|
+
}, o.customClass)), F = V(() => ({
|
|
1909
1923
|
"d-flex": !0,
|
|
1910
1924
|
"flex-nowrap": !0,
|
|
1911
1925
|
"justify-content-end": p.value === "right",
|
|
@@ -1913,7 +1927,7 @@ const xe = /* @__PURE__ */ Y({
|
|
|
1913
1927
|
})), {
|
|
1914
1928
|
renderToolbarDropdown: j,
|
|
1915
1929
|
clearAllDropDown: A
|
|
1916
|
-
} =
|
|
1930
|
+
} = dt(o, g, b);
|
|
1917
1931
|
function k() {
|
|
1918
1932
|
n.value.filter((t) => t.children && t.children.length > 0).forEach((t) => {
|
|
1919
1933
|
t.expanded = !1;
|
|
@@ -1921,26 +1935,26 @@ const xe = /* @__PURE__ */ Y({
|
|
|
1921
1935
|
}
|
|
1922
1936
|
const R = /* @__PURE__ */ new Map(), v = [];
|
|
1923
1937
|
function E(t) {
|
|
1924
|
-
const r =
|
|
1925
|
-
let
|
|
1938
|
+
const r = f.value;
|
|
1939
|
+
let d = t;
|
|
1926
1940
|
const w = Array.from(r.children), C = w[w.length - 1].id === "__more_buttons__" ? w[w.length - 1] : null;
|
|
1927
1941
|
if (C) {
|
|
1928
1942
|
const _ = C.computedStyleMap().get("margin-left"), N = C.computedStyleMap().get("margin-right"), q = (_ ? _.value : 0) + C.getBoundingClientRect().width + (N ? N.value : 0);
|
|
1929
|
-
|
|
1943
|
+
d -= q;
|
|
1930
1944
|
}
|
|
1931
1945
|
const S = w.filter((_) => _.id !== "__more_buttons__");
|
|
1932
1946
|
for (const _ of S) {
|
|
1933
1947
|
const N = _.computedStyleMap().get("margin-left"), q = _.computedStyleMap().get("margin-right"), G = (N ? N.value : 0) + _.getBoundingClientRect().width + (q ? q.value : 0);
|
|
1934
|
-
|
|
1948
|
+
d < G ? (R.set(_.id, !0), v.push({
|
|
1935
1949
|
id: _.id,
|
|
1936
1950
|
width: G
|
|
1937
|
-
})) :
|
|
1951
|
+
})) : d -= G;
|
|
1938
1952
|
}
|
|
1939
1953
|
if (v.length)
|
|
1940
1954
|
for (let _ = v.length - 1; _ >= 0; _--) {
|
|
1941
1955
|
const N = v[_].width;
|
|
1942
|
-
if (
|
|
1943
|
-
|
|
1956
|
+
if (d >= N)
|
|
1957
|
+
d -= N, R.delete(v[_].id), v.pop();
|
|
1944
1958
|
else
|
|
1945
1959
|
break;
|
|
1946
1960
|
}
|
|
@@ -1951,82 +1965,82 @@ const xe = /* @__PURE__ */ Y({
|
|
|
1951
1965
|
}
|
|
1952
1966
|
const P = new ResizeObserver((t) => {
|
|
1953
1967
|
if (t.length) {
|
|
1954
|
-
const
|
|
1955
|
-
(
|
|
1968
|
+
const d = t[0].contentRect.width, C = f.value.getBoundingClientRect().width;
|
|
1969
|
+
(d < C || v.length) && E(d);
|
|
1956
1970
|
}
|
|
1957
1971
|
});
|
|
1958
1972
|
H(() => {
|
|
1959
|
-
const t =
|
|
1973
|
+
const t = a.value;
|
|
1960
1974
|
P.observe(t), document.body.addEventListener("click", k);
|
|
1961
|
-
}),
|
|
1975
|
+
}), ue(() => {
|
|
1962
1976
|
P.disconnect(), document.body.removeEventListener("click", k);
|
|
1963
|
-
}), Q(() =>
|
|
1964
|
-
n.value =
|
|
1977
|
+
}), Q(() => o.items, () => {
|
|
1978
|
+
n.value = o.items;
|
|
1965
1979
|
}, {
|
|
1966
1980
|
deep: !0
|
|
1967
1981
|
}), Q(n, (t) => {
|
|
1968
1982
|
i = new Array(n.value.length).fill(M());
|
|
1969
1983
|
});
|
|
1970
|
-
function h(t, r,
|
|
1971
|
-
c && c.setupContext && c.setupContext.emit("selectionChange", t, r,
|
|
1984
|
+
function h(t, r, d, w) {
|
|
1985
|
+
c && c.setupContext && c.setupContext.emit("selectionChange", t, r, d, w);
|
|
1972
1986
|
}
|
|
1973
|
-
function
|
|
1974
|
-
const t =
|
|
1987
|
+
function s() {
|
|
1988
|
+
const t = f.value.querySelector(".dgComponentFocused.dgComponentSelected");
|
|
1975
1989
|
t == null || t.classList.remove("dgComponentSelected"), t == null || t.classList.remove("dgComponentFocused"), B();
|
|
1976
1990
|
}
|
|
1977
1991
|
return () => y("div", {
|
|
1978
|
-
ref:
|
|
1992
|
+
ref: m,
|
|
1979
1993
|
"data-dragref": `${c.schema.id}-container`,
|
|
1980
1994
|
class: O.value
|
|
1981
1995
|
}, [y("div", {
|
|
1982
|
-
ref:
|
|
1996
|
+
ref: a,
|
|
1983
1997
|
class: F.value
|
|
1984
1998
|
}, [y("div", {
|
|
1985
|
-
ref:
|
|
1999
|
+
ref: f,
|
|
1986
2000
|
class: "d-inline-block f-response-content",
|
|
1987
2001
|
style: "white-space: nowrap;"
|
|
1988
|
-
}, [n.value.map((t, r) => y(
|
|
2002
|
+
}, [n.value.map((t, r) => y(bt, {
|
|
1989
2003
|
ref: i[r],
|
|
1990
2004
|
class: "p-0 display-inline-block",
|
|
1991
2005
|
modelValue: t,
|
|
1992
|
-
"onUpdate:modelValue": (
|
|
2006
|
+
"onUpdate:modelValue": (d) => t = d,
|
|
1993
2007
|
canMove: !0,
|
|
1994
2008
|
childType: "response-toolbar-item",
|
|
1995
2009
|
childLabel: "按钮",
|
|
1996
2010
|
contentKey: "buttons",
|
|
1997
|
-
componentId:
|
|
2011
|
+
componentId: o.componentId,
|
|
1998
2012
|
id: t.id,
|
|
1999
2013
|
style: "padding:0 !important;display:inline-block",
|
|
2000
2014
|
onSelectionChange: h,
|
|
2001
|
-
onRemoveComponent:
|
|
2015
|
+
onRemoveComponent: s
|
|
2002
2016
|
}, {
|
|
2003
2017
|
default: () => {
|
|
2004
|
-
var
|
|
2018
|
+
var d;
|
|
2005
2019
|
return [y(xe, {
|
|
2006
2020
|
id: t.id,
|
|
2007
2021
|
disabled: t.disabled,
|
|
2008
2022
|
text: t.text,
|
|
2009
2023
|
icon: t.icon,
|
|
2010
|
-
class: ((
|
|
2011
|
-
alignment:
|
|
2012
|
-
componentId:
|
|
2024
|
+
class: ((d = t.appearance) == null ? void 0 : d.class) || "btn-secondary",
|
|
2025
|
+
alignment: o.alignment || "right",
|
|
2026
|
+
componentId: o.componentId
|
|
2013
2027
|
}, null)];
|
|
2014
2028
|
}
|
|
2015
2029
|
}))])])]);
|
|
2016
2030
|
}
|
|
2017
|
-
}),
|
|
2018
|
-
X.register = (
|
|
2019
|
-
|
|
2031
|
+
}), Et = se;
|
|
2032
|
+
X.register = (o, e, n) => {
|
|
2033
|
+
o["response-toolbar"] = X, e["response-toolbar"] = se;
|
|
2020
2034
|
};
|
|
2021
|
-
X.registerDesigner = (
|
|
2022
|
-
|
|
2035
|
+
X.registerDesigner = (o, e, n) => {
|
|
2036
|
+
o["response-toolbar"] = wt, e["response-toolbar"] = se, o["response-toolbar-item"] = xe, e["response-toolbar-item"] = it;
|
|
2023
2037
|
};
|
|
2024
|
-
const
|
|
2038
|
+
const Rt = Re(X);
|
|
2025
2039
|
export {
|
|
2026
2040
|
X as FResponseToolbar,
|
|
2027
2041
|
z as ResponseToolbarDropDownItem,
|
|
2028
|
-
|
|
2042
|
+
Mt as ResponseToolbarGroup,
|
|
2029
2043
|
ke as ResponseToolbarItem,
|
|
2030
|
-
|
|
2031
|
-
|
|
2044
|
+
Rt as default,
|
|
2045
|
+
Et as responseToolbarResolver
|
|
2032
2046
|
};
|