@farris/ui-vue 1.3.3 → 1.3.4
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/binding-selector/index.esm.js +15 -15
- package/components/binding-selector/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +107 -106
- package/components/condition/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +1078 -1077
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +1272 -1272
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +4355 -3954
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +601 -593
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +161 -117
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +594 -575
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +771 -771
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +1268 -1268
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +3768 -3700
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +4274 -3873
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +935 -935
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +1672 -1671
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1107 -1106
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/property-panel/index.css +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +5721 -5490
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/schema-selector/index.esm.js +974 -972
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/section/index.esm.js +2107 -417
- package/components/section/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +577 -575
- package/components/tabs/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +84 -79
- package/components/textarea/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +1554 -1554
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +1269 -1269
- package/components/tree-view/index.umd.cjs +1 -1
- package/farris.all.esm.js +17526 -17071
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +1 -2
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +14 -3
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +28 -0
- package/types/event-parameter/src/composition/use-general-editor.d.ts +26 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +4 -4
- package/types/events-editor/src/composition/types.d.ts +1 -1
- package/types/query-solution/src/composition/types.d.ts +55 -0
- package/types/query-solution/src/composition/use-condition.d.ts +19 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +3 -2
- package/types/query-solution/src/designer/query-solution-config/converter/query-solution-config-property.converter.d.ts +4 -0
- package/types/section/index.d.ts +15 -0
- package/types/section/src/designer/section-header.design.component.d.ts +4 -0
- package/types/section/src/designer/section-toolbar-item.props.d.ts +19 -0
- package/types/section/src/designer/section-toolbar.design.component.d.ts +3 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (n, t, e) =>
|
|
4
|
-
import { defineComponent as
|
|
1
|
+
var Q = Object.defineProperty;
|
|
2
|
+
var _ = (n, t, e) => t in n ? Q(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var b = (n, t, e) => _(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { defineComponent as G, ref as B, computed as I, onMounted as q, createVNode as E, withDirectives as J, vModelText as Y, inject as U } from "vue";
|
|
5
5
|
import { isPlainObject as $, cloneDeep as W } from "lodash-es";
|
|
6
6
|
import { useTextBox as Z, useClear as K, withInstall as R } from "../common/index.esm.js";
|
|
7
|
-
import { DgControl as
|
|
7
|
+
import { DgControl as x } from "../designer-canvas/index.esm.js";
|
|
8
8
|
const O = {}, j = {};
|
|
9
9
|
function A(n) {
|
|
10
10
|
const { properties: t, title: e, ignore: a } = n, o = a && Array.isArray(a), l = Object.keys(t).reduce((s, y) => ((!o || !a.find((f) => f === y)) && (s[y] = t[y].type === "object" && t[y].properties ? A(t[y]) : W(t[y].default)), s), {});
|
|
@@ -95,8 +95,8 @@ function oe(n = {}) {
|
|
|
95
95
|
return l(i).reduce((m, d) => m && s(d, c), !0);
|
|
96
96
|
}
|
|
97
97
|
function f(i, c) {
|
|
98
|
-
const r = Object.keys(i), p = r.includes("allOf"), m = r.includes("anyOf"), d = p || m,
|
|
99
|
-
return p ? !
|
|
98
|
+
const r = Object.keys(i), p = r.includes("allOf"), m = r.includes("anyOf"), d = p || m, v = (d ? i[d ? p ? "allOf" : "anyOf" : "allOf"] : [i]).map((k) => y(k, c));
|
|
99
|
+
return p ? !v.includes(!1) : v.includes(!0);
|
|
100
100
|
}
|
|
101
101
|
return { parseValueSchema: f };
|
|
102
102
|
}
|
|
@@ -246,6 +246,8 @@ function be(n, t, e) {
|
|
|
246
246
|
return t;
|
|
247
247
|
}
|
|
248
248
|
const N = {
|
|
249
|
+
/** 是否撑开高度 */
|
|
250
|
+
autoHeight: { type: Boolean, default: !1 },
|
|
249
251
|
/** 自动聚焦 */
|
|
250
252
|
autofocus: { type: Boolean, default: !1 },
|
|
251
253
|
/** 自动完成 */
|
|
@@ -274,7 +276,7 @@ const N = {
|
|
|
274
276
|
showBorder: { Type: Boolean, default: !0 },
|
|
275
277
|
/** 键盘按键索引 */
|
|
276
278
|
tabIndex: { type: Number, default: -1 }
|
|
277
|
-
}, X = ie(N, ge, se, be), L = /* @__PURE__ */
|
|
279
|
+
}, X = ie(N, ge, se, be), L = /* @__PURE__ */ G({
|
|
278
280
|
name: "FTextarea",
|
|
279
281
|
props: N,
|
|
280
282
|
emits: ["update:modelValue", "valueChange"],
|
|
@@ -289,12 +291,15 @@ const N = {
|
|
|
289
291
|
clearButtonClass: p,
|
|
290
292
|
shouldShowClearButton: m,
|
|
291
293
|
clearButtonStyle: d
|
|
292
|
-
} = i,
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
}
|
|
294
|
+
} = i, g = I(() => n.maxLength ? n.maxLength : n.modelValue.length), C = (k) => {
|
|
295
|
+
var F, h;
|
|
296
|
+
k.stopPropagation(), t.emit("update:modelValue", (F = k.target) == null ? void 0 : F.value), t.emit("valueChange", (h = k.target) == null ? void 0 : h.value);
|
|
297
|
+
}, v = (k) => {
|
|
298
|
+
k.stopPropagation(), e.value.value = "", t.emit("update:modelValue", ""), t.emit("valueChange", "");
|
|
299
|
+
}, M = I(() => ({
|
|
300
|
+
"form-control": !0,
|
|
301
|
+
"h-100": n.autoHeight
|
|
302
|
+
}));
|
|
298
303
|
return t.expose({
|
|
299
304
|
elementRef: e
|
|
300
305
|
}), q(() => {
|
|
@@ -304,9 +309,9 @@ const N = {
|
|
|
304
309
|
onMouseleave: r,
|
|
305
310
|
style: "position:relative"
|
|
306
311
|
}, [J(E("textarea", {
|
|
307
|
-
class:
|
|
312
|
+
class: M.value,
|
|
308
313
|
id: n.id,
|
|
309
|
-
"onUpdate:modelValue": (
|
|
314
|
+
"onUpdate:modelValue": (k) => n.modelValue = k,
|
|
310
315
|
ref: e,
|
|
311
316
|
minlength: n.minLength,
|
|
312
317
|
maxlength: n.maxLength ? n.maxLength : null,
|
|
@@ -317,19 +322,19 @@ const N = {
|
|
|
317
322
|
placeholder: n.placeholder,
|
|
318
323
|
autofocus: n.autofocus,
|
|
319
324
|
rows: n.rows,
|
|
320
|
-
onInput:
|
|
325
|
+
onInput: C,
|
|
321
326
|
onFocus: f,
|
|
322
327
|
onBlur: y
|
|
323
328
|
}, null), [[Y, n.modelValue]]), m.value && E("span", {
|
|
324
329
|
id: "clearIcon",
|
|
325
330
|
class: p.value,
|
|
326
331
|
style: d.value,
|
|
327
|
-
onClick: (
|
|
332
|
+
onClick: (k) => v(k)
|
|
328
333
|
}, [E("i", {
|
|
329
334
|
class: "f-icon modal_close"
|
|
330
335
|
}, null)]), n.showCount && E("span", {
|
|
331
336
|
style: "position: absolute;bottom: 5px;right: 10px"
|
|
332
|
-
}, [`${n.modelValue.length}/${
|
|
337
|
+
}, [`${n.modelValue.length}/${g.value}`])]);
|
|
333
338
|
}
|
|
334
339
|
});
|
|
335
340
|
function ve(n, t, e) {
|
|
@@ -347,49 +352,49 @@ function ve(n, t, e) {
|
|
|
347
352
|
function i() {
|
|
348
353
|
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
|
|
349
354
|
}
|
|
350
|
-
function c(
|
|
351
|
-
if (!
|
|
355
|
+
function c(h) {
|
|
356
|
+
if (!h || !h.value)
|
|
352
357
|
return null;
|
|
353
|
-
if (
|
|
354
|
-
return
|
|
355
|
-
const
|
|
356
|
-
return
|
|
358
|
+
if (h.value.schema && h.value.schema.type === "component")
|
|
359
|
+
return h.value;
|
|
360
|
+
const w = B(h == null ? void 0 : h.value.parent), S = c(w);
|
|
361
|
+
return S || null;
|
|
357
362
|
}
|
|
358
|
-
function r(
|
|
359
|
-
const { componentInstance:
|
|
360
|
-
return !
|
|
363
|
+
function r(h = t) {
|
|
364
|
+
const { componentInstance: w, designerItemElementRef: S } = h;
|
|
365
|
+
return !w || !w.value ? null : w.value.canMove ? S : r(h.parent);
|
|
361
366
|
}
|
|
362
|
-
function p(
|
|
363
|
-
return !!e && e.canAccepts(
|
|
367
|
+
function p(h) {
|
|
368
|
+
return !!e && e.canAccepts(h);
|
|
364
369
|
}
|
|
365
370
|
function m() {
|
|
366
371
|
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
367
372
|
}
|
|
368
373
|
function d() {
|
|
369
374
|
}
|
|
370
|
-
function h
|
|
371
|
-
|
|
375
|
+
function g(h, w) {
|
|
376
|
+
w && e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(w);
|
|
372
377
|
}
|
|
373
|
-
function
|
|
374
|
-
const { componentType:
|
|
375
|
-
let
|
|
376
|
-
e && e.onResolveNewComponentSchema && (
|
|
377
|
-
const D =
|
|
378
|
-
return
|
|
378
|
+
function C(h, w) {
|
|
379
|
+
const { componentType: S } = h;
|
|
380
|
+
let T = z(S, h, w);
|
|
381
|
+
e && e.onResolveNewComponentSchema && (T = e.onResolveNewComponentSchema(h, T));
|
|
382
|
+
const D = S.toLowerCase().replace(/-/g, "_");
|
|
383
|
+
return T && !T.id && T.type === S && (T.id = `${D}_${Math.random().toString().slice(2, 6)}`), T;
|
|
379
384
|
}
|
|
380
|
-
function
|
|
385
|
+
function v(h) {
|
|
381
386
|
}
|
|
382
|
-
function
|
|
387
|
+
function M(...h) {
|
|
383
388
|
if (e && e.getPropsConfig)
|
|
384
|
-
return e.getPropsConfig(...
|
|
385
|
-
}
|
|
386
|
-
function
|
|
387
|
-
e && e.onRemoveComponent && e.onRemoveComponent(), t != null && t.schema.contents && t.schema.contents.map((
|
|
388
|
-
var
|
|
389
|
-
let
|
|
390
|
-
|
|
391
|
-
const
|
|
392
|
-
(
|
|
389
|
+
return e.getPropsConfig(...h);
|
|
390
|
+
}
|
|
391
|
+
function k() {
|
|
392
|
+
e && e.onRemoveComponent && e.onRemoveComponent(), t != null && t.schema.contents && t.schema.contents.map((h) => {
|
|
393
|
+
var T;
|
|
394
|
+
let w = h.id;
|
|
395
|
+
h.type === "component-ref" && (w = h.component);
|
|
396
|
+
const S = n.value.querySelector(`#${w}-design-item`);
|
|
397
|
+
(T = S == null ? void 0 : S.componentInstance) != null && T.value.onRemoveComponent && S.componentInstance.value.onRemoveComponent();
|
|
393
398
|
});
|
|
394
399
|
}
|
|
395
400
|
return l.value = {
|
|
@@ -407,14 +412,14 @@ function ve(n, t, e) {
|
|
|
407
412
|
getBelongedComponentInstance: c,
|
|
408
413
|
getDraggableDesignItemElement: r,
|
|
409
414
|
getDraggingDisplayText: m,
|
|
410
|
-
getPropConfig:
|
|
415
|
+
getPropConfig: M,
|
|
411
416
|
getDragScopeElement: d,
|
|
412
|
-
onAcceptMovedChildElement:
|
|
413
|
-
onChildElementMovedOut:
|
|
414
|
-
addNewChildComponentSchema:
|
|
417
|
+
onAcceptMovedChildElement: g,
|
|
418
|
+
onChildElementMovedOut: v,
|
|
419
|
+
addNewChildComponentSchema: C,
|
|
415
420
|
triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || B(!1),
|
|
416
421
|
triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || B(!1),
|
|
417
|
-
onRemoveComponent:
|
|
422
|
+
onRemoveComponent: k
|
|
418
423
|
}, l;
|
|
419
424
|
}
|
|
420
425
|
class Ce {
|
|
@@ -620,31 +625,31 @@ function we(n) {
|
|
|
620
625
|
const a = /* @__PURE__ */ new Map();
|
|
621
626
|
let o = [];
|
|
622
627
|
function l(c, r) {
|
|
623
|
-
const m = c.split(" ").filter((
|
|
628
|
+
const m = c.split(" ").filter((M) => M.startsWith("col-"));
|
|
624
629
|
if (m.length === 0) {
|
|
625
630
|
r.isSupportedClass = !1;
|
|
626
631
|
return;
|
|
627
632
|
}
|
|
628
|
-
let d = m.find((
|
|
629
|
-
d = d || "col-12", r.columnInSM = parseInt(d.replace("col-", ""), 10), r.displayWidthInSM = r.columnInSM / 12, r.displayWidthInSM !== 1 && (r.isSupportedClass = !1),
|
|
633
|
+
let d = m.find((M) => /^col-([1-9]|10|11|12)$/.test(M)), g = m.find((M) => /^col-md-([1-9]|10|11|12)$/.test(M)), C = m.find((M) => /^col-xl-([1-9]|10|11|12)$/.test(M)), v = m.find((M) => /^col-el-([1-9]|10|11|12)$/.test(M));
|
|
634
|
+
d = d || "col-12", r.columnInSM = parseInt(d.replace("col-", ""), 10), r.displayWidthInSM = r.columnInSM / 12, r.displayWidthInSM !== 1 && (r.isSupportedClass = !1), g = g || "col-md-" + r.columnInSM, r.columnInMD = parseInt(g.replace("col-md-", ""), 10), r.displayWidthInMD = r.columnInMD / 6, [1, 2].includes(r.displayWidthInMD) || (r.isSupportedClass = !1), C = C || "col-xl-" + r.columnInMD, r.columnInLG = parseInt(C.replace("col-xl-", ""), 10), r.displayWidthInLG = r.columnInLG / 3, [1, 2, 3, 4].includes(r.displayWidthInLG) || (r.isSupportedClass = !1), v = v || "col-el-" + r.columnInLG, r.columnInEL = parseInt(v.replace("col-el-", ""), 10), r.displayWidthInEL = r.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(r.displayWidthInEL) || (r.isSupportedClass = !1);
|
|
630
635
|
}
|
|
631
636
|
function s(c, r, p, m = !1) {
|
|
632
637
|
let d = !1;
|
|
633
|
-
c.contents.forEach((
|
|
634
|
-
if (
|
|
635
|
-
p += 1, s(
|
|
638
|
+
c.contents.forEach((g) => {
|
|
639
|
+
if (g.type === "fieldset") {
|
|
640
|
+
p += 1, s(g, r, p, !0), d = !0;
|
|
636
641
|
return;
|
|
637
642
|
}
|
|
638
643
|
d && (p += 1, d = !1);
|
|
639
|
-
const
|
|
640
|
-
|
|
644
|
+
const C = g.appearance && g.appearance.class, v = new ke();
|
|
645
|
+
C ? l(C, v) : v.isSupportedClass = !1, v.label = g.label || g.id, v.id = g.id, v.group = p, m && (v.fieldSetId = c.id), e === g.id && (t = p), a.set(g.id, g), r.push(v);
|
|
641
646
|
});
|
|
642
647
|
}
|
|
643
648
|
function y(c) {
|
|
644
649
|
const r = n.getComponentById(c);
|
|
645
650
|
if (!r || !r.componentType || !r.componentType.startsWith("form"))
|
|
646
651
|
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
647
|
-
const p = n.selectNode(r, (m) => m.type ===
|
|
652
|
+
const p = n.selectNode(r, (m) => m.type === x["response-form"].type);
|
|
648
653
|
return !p || !p.contents || p.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: p };
|
|
649
654
|
}
|
|
650
655
|
function f(c, r) {
|
|
@@ -653,13 +658,13 @@ function we(n) {
|
|
|
653
658
|
if (!p)
|
|
654
659
|
return { result: p, message: m };
|
|
655
660
|
e = c.id, o = [], a.clear();
|
|
656
|
-
const
|
|
657
|
-
s(d, o,
|
|
658
|
-
const
|
|
661
|
+
const g = d.contents[0].type === x.fieldset.type ? 0 : 1;
|
|
662
|
+
s(d, o, g);
|
|
663
|
+
const C = o.find((M) => !M.isSupportedClass);
|
|
659
664
|
return {
|
|
660
665
|
defaultState: {
|
|
661
666
|
defaultGroupNumber: t || 1,
|
|
662
|
-
model:
|
|
667
|
+
model: C ? "customize" : "standard"
|
|
663
668
|
},
|
|
664
669
|
importData: o
|
|
665
670
|
};
|
|
@@ -670,18 +675,18 @@ function we(n) {
|
|
|
670
675
|
if (!p)
|
|
671
676
|
return "";
|
|
672
677
|
const d = [];
|
|
673
|
-
return c.forEach((
|
|
674
|
-
var
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
const F =
|
|
678
|
-
|
|
678
|
+
return c.forEach((g) => {
|
|
679
|
+
var M;
|
|
680
|
+
const C = a.get(g.id), v = C.appearance && C.appearance.class;
|
|
681
|
+
if (v) {
|
|
682
|
+
const F = v.split(" ").filter((H) => !H.startsWith("col-")), h = "col-" + g.columnInSM, w = "col-md-" + g.columnInMD, S = "col-xl-" + g.columnInLG, T = "col-el-" + g.columnInEL, D = [h, w, S, T].concat(F);
|
|
683
|
+
C.appearance.class = D.join(" ");
|
|
679
684
|
}
|
|
680
|
-
if (
|
|
681
|
-
const
|
|
682
|
-
F ? (
|
|
685
|
+
if (g.fieldSetId) {
|
|
686
|
+
const k = m.contents.find((h) => h.id === g.fieldSetId), F = d.find((h) => h.id === g.fieldSetId);
|
|
687
|
+
F ? (M = F.contents) == null || M.push(C) : (d.push(k), k.contents = [C]);
|
|
683
688
|
} else
|
|
684
|
-
d.push(
|
|
689
|
+
d.push(C);
|
|
685
690
|
}), m.contents = d, m.id;
|
|
686
691
|
}
|
|
687
692
|
return {
|
|
@@ -907,7 +912,7 @@ class Se extends Ce {
|
|
|
907
912
|
return;
|
|
908
913
|
const l = [];
|
|
909
914
|
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(o, l, 1), a) {
|
|
910
|
-
const d = l.find((
|
|
915
|
+
const d = l.find((g) => g.id === a.id);
|
|
911
916
|
Object.assign(d || {}, a);
|
|
912
917
|
}
|
|
913
918
|
const s = l.map((d) => d.columnInSM), y = l.map((d) => d.columnInMD), f = l.map((d) => d.columnInLG), i = l.map((d) => d.columnInEL), c = this.checkIsUniqueColumn(s) ? s[0] : null, r = this.checkIsUniqueColumn(y) ? y[0] : null, p = this.checkIsUniqueColumn(f) ? f[0] : null, m = this.checkIsUniqueColumn(i) ? i[0] : null;
|
|
@@ -952,7 +957,7 @@ function Fe(n, t) {
|
|
|
952
957
|
}
|
|
953
958
|
return { getPropsConfig: a };
|
|
954
959
|
}
|
|
955
|
-
const Ee = /* @__PURE__ */
|
|
960
|
+
const Ee = /* @__PURE__ */ G({
|
|
956
961
|
name: "FTextareaDesign",
|
|
957
962
|
props: N,
|
|
958
963
|
emits: [""],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(w,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js"],m):(w=typeof globalThis<"u"?globalThis:w||self,m(w.textarea={},w.Vue,w.LodashES,w.common,w.designerCanvas))})(this,function(w,m,E,N,x){"use strict";var pe=Object.defineProperty;var de=(w,m,E)=>m in w?pe(w,m,{enumerable:!0,configurable:!0,writable:!0,value:E}):w[m]=E;var v=(w,m,E)=>de(w,typeof m!="symbol"?m+"":m,E);const j={},q={};function A(i){const{properties:t,title:e,ignore:r}=i,n=r&&Array.isArray(r),l=Object.keys(t).reduce((s,y)=>((!n||!r.find(h=>h===y))&&(s[y]=t[y].type==="object"&&t[y].properties?A(t[y]):E.cloneDeep(t[y].default)),s),{});if(e&&(!n||!r.find(s=>s==="id"))){const s=e.toLowerCase().replace(/-/g,"_");l.id=`${s}_${Math.random().toString().slice(2,6)}`}return l}function G(i,t={},e){const r=j[i];if(r){let n=A(r);const l=q[i];return n=l?l({getSchemaByType:G},n,t,e):n,n}return null}function O(i,t){const e=A(t);return Object.keys(e).reduce((r,n)=>(r[n]&&E.isPlainObject(r[n])&&E.isPlainObject(i[n]||!i[n])?Object.assign(r[n],i[n]||{}):r[n]=i[n],r),e),e}function W(i,t){return Object.keys(i).filter(r=>i[r]!=null).reduce((r,n)=>{if(t.has(n)){const l=t.get(n);if(typeof l=="string")r[l]=i[n];else{const s=l(n,i[n],i);Object.assign(r,s)}}else r[n]=i[n];return r},{})}function z(i,t,e=new Map){const r=O(i,t);return W(r,e)}function X(i={}){function t(a,c,o,d){if(typeof o=="number")return d[a].length===o;if(typeof o=="object"){const f=Object.keys(o)[0],u=o[f];if(f==="not")return Number(d[a].length)!==Number(u);if(f==="moreThan")return Number(d[a].length)>=Number(u);if(f==="lessThan")return Number(d[a].length)<=Number(u)}return!1}function e(a,c,o,d){return d[a]&&d[a].propertyValue&&String(d[a].propertyValue.value)===String(o)}const r=new Map([["length",t],["getProperty",e]]);Object.keys(i).reduce((a,c)=>(a.set(c,i[c]),a),r);function n(a,c){const o=a;return typeof c=="number"?[{target:o,operator:"length",param:null,value:Number(c)}]:typeof c=="boolean"?[{target:o,operator:"getProperty",param:a,value:!!c}]:typeof c=="object"?Object.keys(c).map(d=>{if(d==="length")return{target:o,operator:"length",param:null,value:c[d]};const f=d,u=c[d];return{target:o,operator:"getProperty",param:f,value:u}}):[]}function l(a){return Object.keys(a).reduce((o,d)=>{const f=n(d,a[d]);return o.push(...f),o},[])}function s(a,c){if(r.has(a.operator)){const o=r.get(a.operator);return o&&o(a.target,a.param,a.value,c)||!1}return!1}function y(a,c){return l(a).reduce((f,u)=>f&&s(u,c),!0)}function h(a,c){const o=Object.keys(a),d=o.includes("allOf"),f=o.includes("anyOf"),u=d||f,M=(u?a[u?d?"allOf":"anyOf":"allOf"]:[a]).map(V=>y(V,c));return d?!M.includes(!1):M.includes(!0)}return{parseValueSchema:h}}const p={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},_={},Q={};X();function H(i,t,e=new Map,r=(s,y,h,a)=>y,n={},l=s=>s){return j[t.title]=t,q[t.title]=r,_[t.title]=n,Q[t.title]=l,(s={})=>{const y=z(s,t,e),h=Object.keys(i).reduce((a,c)=>(a[c]=i[c].default,a),{});return Object.assign(h,y)}}function J(i,t){return{customClass:t.class,customStyle:t.style}}const Y=new Map([["appearance",J]]),Z={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/switch.schema.json",title:"textarea",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a textarea",type:"string"},type:{description:"The type string of textarea component",type:"string",default:"textarea"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},rows:{description:"",type:"number"},showCount:{description:"",type:"boolean",default:!0}},required:["id","type"],ignore:["id","appearance","binding","visible"]};function K(i,t,e){return t}const I={autofocus:{type:Boolean,default:!1},autocomplete:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!1},id:{type:String,default:""},minLength:{type:Number,default:0},maxLength:{type:Number},modelValue:{type:String,default:""},placeholder:{type:String,default:""},readonly:{type:Boolean,default:!1},rows:{type:Number,default:2},showCount:{type:Boolean,default:!1},showBorder:{Type:Boolean,default:!0},tabIndex:{type:Number,default:-1}},U=H(I,Z,Y,K),L=m.defineComponent({name:"FTextarea",props:I,emits:["update:modelValue","valueChange"],setup(i,t){const e=m.ref(),r=m.ref(i.modelValue),n=m.computed(()=>i.modelValue),l=N.useTextBox(i,t,r,n),{inputGroupClass:s,onBlur:y,onFocus:h}=l,a=N.useClear(i,t,l),{onMouseEnter:c,onMouseLeave:o,clearButtonClass:d,shouldShowClearButton:f,clearButtonStyle:u}=a,g=m.computed(()=>i.maxLength?i.maxLength:i.modelValue.length),k=C=>{var V,P;C.stopPropagation(),t.emit("update:modelValue",(V=C.target)==null?void 0:V.value),t.emit("valueChange",(P=C.target)==null?void 0:P.value)},M=C=>{C.stopPropagation(),e.value.value="",t.emit("update:modelValue",""),t.emit("valueChange","")};return t.expose({elementRef:e}),m.onMounted(()=>{}),()=>m.createVNode("div",{class:s.value,onMouseenter:c,onMouseleave:o,style:"position:relative"},[m.withDirectives(m.createVNode("textarea",{class:"form-control",id:i.id,"onUpdate:modelValue":C=>i.modelValue=C,ref:e,minlength:i.minLength,maxlength:i.maxLength?i.maxLength:null,tabindex:i.tabIndex,disabled:i.disabled,readonly:i.readonly,autocomplete:i.autocomplete,placeholder:i.placeholder,autofocus:i.autofocus,rows:i.rows,onInput:k,onFocus:h,onBlur:y},null),[[m.vModelText,i.modelValue]]),f.value&&m.createVNode("span",{id:"clearIcon",class:d.value,style:u.value,onClick:C=>M(C)},[m.createVNode("i",{class:"f-icon modal_close"},null)]),i.showCount&&m.createVNode("span",{style:"position: absolute;bottom: 5px;right: 10px"},[`${i.modelValue.length}/${g.value}`])])}});function R(i,t,e){var P;const r=e&&e.getStyles&&e.getStyles()||"",n=e&&e.getDesignerClass&&e.getDesignerClass()||"",l=m.ref();function s(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanMoveComponent?e.checkCanMoveComponent():!0}function y(){return!1}function h(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanDeleteComponent?e.checkCanDeleteComponent():!0}function a(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:e&&e.hideNestedPaddingInDesginerView?e.hideNestedPaddingInDesginerView():!1}function c(b){if(!b||!b.value)return null;if(b.value.schema&&b.value.schema.type==="component")return b.value;const S=m.ref(b==null?void 0:b.value.parent),T=c(S);return T||null}function o(b=t){const{componentInstance:S,designerItemElementRef:T}=b;return!S||!S.value?null:S.value.canMove?T:o(b.parent)}function d(b){return!!e&&e.canAccepts(b)}function f(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function u(){}function g(b,S){S&&e!=null&&e.onAcceptMovedChildElement&&e.onAcceptMovedChildElement(S)}function k(b,S){const{componentType:T}=b;let F=G(T,b,S);e&&e.onResolveNewComponentSchema&&(F=e.onResolveNewComponentSchema(b,F));const $=T.toLowerCase().replace(/-/g,"_");return F&&!F.id&&F.type===T&&(F.id=`${$}_${Math.random().toString().slice(2,6)}`),F}function M(b){}function C(...b){if(e&&e.getPropsConfig)return e.getPropsConfig(...b)}function V(){e&&e.onRemoveComponent&&e.onRemoveComponent(),t!=null&&t.schema.contents&&t.schema.contents.map(b=>{var F;let S=b.id;b.type==="component-ref"&&(S=b.component);const T=i.value.querySelector(`#${S}-design-item`);(F=T==null?void 0:T.componentInstance)!=null&&F.value.onRemoveComponent&&T.componentInstance.value.onRemoveComponent()})}return l.value={canMove:s(),canSelectParent:y(),canDelete:h(),canNested:!a(),contents:t==null?void 0:t.schema.contents,elementRef:i,parent:(P=t==null?void 0:t.parent)==null?void 0:P.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:n,canAccepts:d,getBelongedComponentInstance:c,getDraggableDesignItemElement:o,getDraggingDisplayText:f,getPropConfig:C,getDragScopeElement:u,onAcceptMovedChildElement:g,onChildElementMovedOut:M,addNewChildComponentSchema:k,triggerBelongedComponentToMoveWhenMoved:!!e&&e.triggerBelongedComponentToMoveWhenMoved||m.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!e&&e.triggerBelongedComponentToDeleteWhenDeleted||m.ref(!1),onRemoveComponent:V},l}class ee{constructor(t,e){v(this,"componentId");v(this,"viewModelId");v(this,"eventsEditorUtils");v(this,"formSchemaUtils");v(this,"formMetadataConverter");v(this,"designViewModelUtils");v(this,"designViewModelField");v(this,"controlCreatorUtils");v(this,"designerHostService");v(this,"schemaService",null);v(this,"metadataService",null);v(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var r;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const n=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=n.fields.find(l=>l.id===e)}t.updateOn=(r=this.designViewModelField)==null?void 0:r.updateOn}}changeFieldEditorType(t,e){}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:t.type,name:p[t.type].name}]}}}}}getAppearanceConfig(t=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(t,e){const r=e&&e.parent&&e.parent.schema;if(!r)return;const n=r.contents.findIndex(s=>s.id===t),l=E.cloneDeep(r.contents[n]);r.contents.splice(n,1),r.contents.splice(n,0,l)}}const B=class B{static getEditorTypesByMDataType(t){const e=B.fieldControlTypeMapping[t];return e||[{key:"",value:""}]}static getAllInputTypes(){const t=[];for(const e in B.fieldControlTypeMapping)B.fieldControlTypeMapping[e].forEach(r=>{t.find(n=>n.key===r.key&&n.value===r.value)||t.push({key:r.key,value:r.value})});return t}};v(B,"fieldControlTypeMapping",{String:[{key:p["input-group"].type,value:p["input-group"].name},{key:p.lookup.type,value:p.lookup.name},{key:p["date-picker"].type,value:p["date-picker"].name},{key:p["check-box"].type,value:p["check-box"].name},{key:p["check-group"].type,value:p["check-group"].name},{key:p["radio-group"].type,value:p["radio-group"].name},{key:p["combo-list"].type,value:p["combo-list"].name},{key:p.textarea.type,value:p.textarea.name}],Text:[{key:p.textarea.type,value:p.textarea.name},{key:p.lookup.type,value:p.lookup.name}],Decimal:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Integer:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Number:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],BigNumber:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Date:[{key:p["date-picker"].type,value:p["date-picker"].name}],DateTime:[{key:p["date-picker"].type,value:p["date-picker"].name}],Boolean:[{key:p.switch.type,value:p.switch.name},{key:p["check-box"].type,value:p["check-box"].name}],Enum:[{key:p["combo-list"].type,value:p["combo-list"].name},{key:p["radio-group"].type,value:p["radio-group"].name}],Object:[{key:p.lookup.type,value:p.lookup.name},{key:p["combo-list"].type,value:p["combo-list"].name},{key:p["radio-group"].type,value:p["radio-group"].name}]});let D=B;const te=m.ref(0);class ne{constructor(){v(this,"label","");v(this,"id","");v(this,"columnInSM",12);v(this,"columnInMD",6);v(this,"columnInLG",3);v(this,"columnInEL",2);v(this,"displayWidthInSM",1);v(this,"displayWidthInMD",1);v(this,"displayWidthInLG",1);v(this,"displayWidthInEL",1);v(this,"displayColumnCountAtBreakPoint","md");v(this,"tagRow",0);v(this,"showTopBorder",0);v(this,"group",1);v(this,"isSupportedClass",!0);v(this,"fieldSetId","")}}function oe(i){let t,e;const r=new Map;let n=[];function l(c,o){const f=c.split(" ").filter(C=>C.startsWith("col-"));if(f.length===0){o.isSupportedClass=!1;return}let u=f.find(C=>/^col-([1-9]|10|11|12)$/.test(C)),g=f.find(C=>/^col-md-([1-9]|10|11|12)$/.test(C)),k=f.find(C=>/^col-xl-([1-9]|10|11|12)$/.test(C)),M=f.find(C=>/^col-el-([1-9]|10|11|12)$/.test(C));u=u||"col-12",o.columnInSM=parseInt(u.replace("col-",""),10),o.displayWidthInSM=o.columnInSM/12,o.displayWidthInSM!==1&&(o.isSupportedClass=!1),g=g||"col-md-"+o.columnInSM,o.columnInMD=parseInt(g.replace("col-md-",""),10),o.displayWidthInMD=o.columnInMD/6,[1,2].includes(o.displayWidthInMD)||(o.isSupportedClass=!1),k=k||"col-xl-"+o.columnInMD,o.columnInLG=parseInt(k.replace("col-xl-",""),10),o.displayWidthInLG=o.columnInLG/3,[1,2,3,4].includes(o.displayWidthInLG)||(o.isSupportedClass=!1),M=M||"col-el-"+o.columnInLG,o.columnInEL=parseInt(M.replace("col-el-",""),10),o.displayWidthInEL=o.columnInEL/2,[1,2,3,4,5,6].includes(o.displayWidthInEL)||(o.isSupportedClass=!1)}function s(c,o,d,f=!1){let u=!1;c.contents.forEach(g=>{if(g.type==="fieldset"){d+=1,s(g,o,d,!0),u=!0;return}u&&(d+=1,u=!1);const k=g.appearance&&g.appearance.class,M=new ne;k?l(k,M):M.isSupportedClass=!1,M.label=g.label||g.id,M.id=g.id,M.group=d,f&&(M.fieldSetId=c.id),e===g.id&&(t=d),r.set(g.id,g),o.push(M)})}function y(c){const o=i.getComponentById(c);if(!o||!o.componentType||!o.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const d=i.selectNode(o,f=>f.type===x.DgControl["response-form"].type);return!d||!d.contents||d.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:d}}function h(c,o){o=o||c.id;const{result:d,message:f,formNode:u}=y(o);if(!d)return{result:d,message:f};e=c.id,n=[],r.clear();const g=u.contents[0].type===x.DgControl.fieldset.type?0:1;s(u,n,g);const k=n.find(C=>!C.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:k?"customize":"standard"},importData:n}}function a(c,o){o=o;const{result:d,formNode:f}=y(o);if(!d)return"";const u=[];return c.forEach(g=>{var C;const k=r.get(g.id),M=k.appearance&&k.appearance.class;if(M){const P=M.split(" ").filter(ce=>!ce.startsWith("col-")),b="col-"+g.columnInSM,S="col-md-"+g.columnInMD,T="col-xl-"+g.columnInLG,F="col-el-"+g.columnInEL,$=[b,S,T,F].concat(P);k.appearance.class=$.join(" ")}if(g.fieldSetId){const V=f.contents.find(b=>b.id===g.fieldSetId),P=u.find(b=>b.id===g.fieldSetId);P?(C=P.contents)==null||C.push(k):(u.push(V),V.contents=[k])}else u.push(k)}),f.contents=u,f.id}return{checkCanFindFormNode:y,checkCanOpenLayoutEditor:h,changeFormControlsByResponseLayoutConfig:a,getResonseFormLayoutConfig:s}}class re extends ee{constructor(e,r){super(e,r);v(this,"responseLayoutEditorFunction");this.responseLayoutEditorFunction=oe(this.formSchemaUtils)}getPropertyConfig(e,r){return this.propertyConfig.categories.basic=this.getBasicProperties(e,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,r),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig}getBasicProperties(e,r){var l;const n=this;return this.setDesignViewModelField(e),this.formSchemaUtils.getFormMetadataBasicInfo(),{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",refreshPanelAfterChanged:!0,$converter:"/converter/change-editor.converter",editor:{type:"combo-list",textField:"value",valueField:"key",editable:!1,data:n.designViewModelField?D.getEditorTypesByMDataType((l=n.designViewModelField.type)==null?void 0:l.name):D.getAllInputTypes()}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"}}},setPropertyRelates(s,y){if(s)switch(s&&s.propertyID){case"type":{n.changeControlType(e,s,r);break}case"label":{s.needRefreshControlTree=!0;break}}}}}getAppearanceProperties(e,r){const n=this;return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",initialState:n.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,n.componentId)}}},setPropertyRelates(l,s){if(l)switch(l&&l.propertyID){case"responseLayout":n.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(l.propertyValue,n.componentId||e.id),n.updateUnifiedLayoutAfterResponseLayoutChanged(n.componentId),n.updateElementByParentContainer(e.id,r),delete e.responseLayout;break;case"class":n.updateUnifiedLayoutAfterControlChanged(l.propertyValue,e.id,this.componentId),n.updateElementByParentContainer(e.id,r);break}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,r,n){var c,o,d,f;const l=r.propertyValue,s=n&&n.parent&&n.parent.schema;if(!s)return;const y=s.contents.findIndex(u=>u.id===e.id),h=s.contents[y];let a;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:l},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),a=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,l)),a||(a=this.controlCreatorUtils.createFormGroupWithoutField(l)),Object.assign(a,{id:h.id,appearance:h.appearance,size:h.size,label:h.label,binding:h.binding,visible:h.visible}),Object.assign(a.editor,{isTextArea:a.isTextArea&&h.isTextArea,placeholder:(c=h.editor)==null?void 0:c.placeholder,holdPlace:(o=h.editor)==null?void 0:o.holdPlace,readonly:(d=h.editor)==null?void 0:d.readonly,require:(f=h.editor)==null?void 0:f.require}),s.contents.splice(y,1),s.contents.splice(y,0,a),n.schema=Object.assign(h,a),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(u=>u.classList.remove("dgComponentSelected")),te.value++}getComponentConfig(e,r={},n={}){const l=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter"},r),s=Object.assign({readonly:{description:"",title:"只读",type:"boolean"},disabled:{description:"",title:"禁用",type:"boolean"},placeholder:{description:"空值时,输入控件内的占位文本",title:"提示文本",type:"string"}},n);return{...l,properties:{...s}}}updateUnifiedLayoutAfterControlChanged(e,r,n){const l=e.split(" ");let s=l.find(o=>/^col-([1-9]|10|11|12)$/.test(o)),y=l.find(o=>/^col-md-([1-9]|10|11|12)$/.test(o)),h=l.find(o=>/^col-xl-([1-9]|10|11|12)$/.test(o)),a=l.find(o=>/^col-el-([1-9]|10|11|12)$/.test(o));s=s||"col-12",y=y||"col-md-"+s.replace("col-",""),h=h||"col-xl-"+y.replace("col-md-",""),a=a||"col-el-"+h.replace("col-xl-","");const c={id:r,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(y.replace("col-md-",""),10),columnInLG:parseInt(h.replace("col-xl-",""),10),columnInEL:parseInt(a.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(n,c)}updateUnifiedLayoutAfterResponseLayoutChanged(e,r){const{formNode:n}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!n||!n.unifiedLayout)return;const l=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(n,l,1),r){const u=l.find(g=>g.id===r.id);Object.assign(u||{},r)}const s=l.map(u=>u.columnInSM),y=l.map(u=>u.columnInMD),h=l.map(u=>u.columnInLG),a=l.map(u=>u.columnInEL),c=this.checkIsUniqueColumn(s)?s[0]:null,o=this.checkIsUniqueColumn(y)?y[0]:null,d=this.checkIsUniqueColumn(h)?h[0]:null,f=this.checkIsUniqueColumn(a)?a[0]:null;Object.assign(n.unifiedLayout,{uniqueColClassInSM:c,uniqueColClassInMD:o,uniqueColClassInLG:d,uniqueColClassInEL:f})}checkIsUniqueColumn(e){const r=new Set(e);return Array.from(r).length===1}}class ie extends re{constructor(t,e){super(t,e)}getEditorProperties(t){return this.getComponentConfig(t,{type:"textarea"},{rows:{description:"",title:"文本区域可见的行数",type:"number"},showCount:{description:"",title:"展示输入文本数量",type:"boolean"}})}}function ae(i,t){const e=i.schema;function r(n,l){return new ie(n,t).getPropertyConfig(e,l)}return{getPropsConfig:r}}const le=m.defineComponent({name:"FTextareaDesign",props:I,emits:[""],setup(i,t){const e=m.ref(),r=m.inject("designer-host-service"),n=m.inject("design-item-context"),l=ae(n,r),s=R(e,n,l),y=m.computed(()=>i.maxLength?i.maxLength:i.modelValue.length),h=m.computed(()=>({position:"relative"})),a=m.computed(()=>({"box-shadow":"0 0 0 1px #dcdfe6 inset",border:"none",padding:"5px 10px",width:"100%"})),c={position:"absolute",bottom:"5px",right:"10px"};return m.onMounted(()=>{e.value.componentInstance=s}),t.expose(s.value),()=>m.createVNode("div",{style:h.value,ref:e},[m.createVNode("textarea",{id:i.id,tabindex:i.tabIndex,disabled:!1,readonly:!0,style:a.value,placeholder:i.placeholder,rows:i.rows},null),i.showCount&&m.createVNode("span",{style:c},[`${i.modelValue.length}/${y.value}`])])}});L.register=(i,t,e,r)=>{i.textarea=L,t.textarea=U},L.registerDesigner=(i,t,e)=>{i.textarea=le,t.textarea=U};const se=N.withInstall(L);w.FTextarea=L,w.default=se,w.propsResolver=U,w.textAreaProps=I,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(k,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js"],m):(k=typeof globalThis<"u"?globalThis:k||self,m(k.textarea={},k.Vue,k.LodashES,k.common,k.designerCanvas))})(this,function(k,m,B,N,x){"use strict";var pe=Object.defineProperty;var de=(k,m,B)=>m in k?pe(k,m,{enumerable:!0,configurable:!0,writable:!0,value:B}):k[m]=B;var C=(k,m,B)=>de(k,typeof m!="symbol"?m+"":m,B);const j={},q={};function A(a){const{properties:t,title:e,ignore:r}=a,n=r&&Array.isArray(r),l=Object.keys(t).reduce((s,y)=>((!n||!r.find(h=>h===y))&&(s[y]=t[y].type==="object"&&t[y].properties?A(t[y]):B.cloneDeep(t[y].default)),s),{});if(e&&(!n||!r.find(s=>s==="id"))){const s=e.toLowerCase().replace(/-/g,"_");l.id=`${s}_${Math.random().toString().slice(2,6)}`}return l}function G(a,t={},e){const r=j[a];if(r){let n=A(r);const l=q[a];return n=l?l({getSchemaByType:G},n,t,e):n,n}return null}function O(a,t){const e=A(t);return Object.keys(e).reduce((r,n)=>(r[n]&&B.isPlainObject(r[n])&&B.isPlainObject(a[n]||!a[n])?Object.assign(r[n],a[n]||{}):r[n]=a[n],r),e),e}function W(a,t){return Object.keys(a).filter(r=>a[r]!=null).reduce((r,n)=>{if(t.has(n)){const l=t.get(n);if(typeof l=="string")r[l]=a[n];else{const s=l(n,a[n],a);Object.assign(r,s)}}else r[n]=a[n];return r},{})}function z(a,t,e=new Map){const r=O(a,t);return W(r,e)}function X(a={}){function t(i,c,o,d){if(typeof o=="number")return d[i].length===o;if(typeof o=="object"){const f=Object.keys(o)[0],u=o[f];if(f==="not")return Number(d[i].length)!==Number(u);if(f==="moreThan")return Number(d[i].length)>=Number(u);if(f==="lessThan")return Number(d[i].length)<=Number(u)}return!1}function e(i,c,o,d){return d[i]&&d[i].propertyValue&&String(d[i].propertyValue.value)===String(o)}const r=new Map([["length",t],["getProperty",e]]);Object.keys(a).reduce((i,c)=>(i.set(c,a[c]),i),r);function n(i,c){const o=i;return typeof c=="number"?[{target:o,operator:"length",param:null,value:Number(c)}]:typeof c=="boolean"?[{target:o,operator:"getProperty",param:i,value:!!c}]:typeof c=="object"?Object.keys(c).map(d=>{if(d==="length")return{target:o,operator:"length",param:null,value:c[d]};const f=d,u=c[d];return{target:o,operator:"getProperty",param:f,value:u}}):[]}function l(i){return Object.keys(i).reduce((o,d)=>{const f=n(d,i[d]);return o.push(...f),o},[])}function s(i,c){if(r.has(i.operator)){const o=r.get(i.operator);return o&&o(i.target,i.param,i.value,c)||!1}return!1}function y(i,c){return l(i).reduce((f,u)=>f&&s(u,c),!0)}function h(i,c){const o=Object.keys(i),d=o.includes("allOf"),f=o.includes("anyOf"),u=d||f,v=(u?i[u?d?"allOf":"anyOf":"allOf"]:[i]).map(S=>y(S,c));return d?!v.includes(!1):v.includes(!0)}return{parseValueSchema:h}}const p={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},_={},H={};X();function Q(a,t,e=new Map,r=(s,y,h,i)=>y,n={},l=s=>s){return j[t.title]=t,q[t.title]=r,_[t.title]=n,H[t.title]=l,(s={})=>{const y=z(s,t,e),h=Object.keys(a).reduce((i,c)=>(i[c]=a[c].default,i),{});return Object.assign(h,y)}}function J(a,t){return{customClass:t.class,customStyle:t.style}}const Y=new Map([["appearance",J]]),Z={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/switch.schema.json",title:"textarea",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a textarea",type:"string"},type:{description:"The type string of textarea component",type:"string",default:"textarea"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0},rows:{description:"",type:"number"},showCount:{description:"",type:"boolean",default:!0}},required:["id","type"],ignore:["id","appearance","binding","visible"]};function K(a,t,e){return t}const I={autoHeight:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},autocomplete:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},enableClear:{type:Boolean,default:!1},id:{type:String,default:""},minLength:{type:Number,default:0},maxLength:{type:Number},modelValue:{type:String,default:""},placeholder:{type:String,default:""},readonly:{type:Boolean,default:!1},rows:{type:Number,default:2},showCount:{type:Boolean,default:!1},showBorder:{Type:Boolean,default:!0},tabIndex:{type:Number,default:-1}},U=Q(I,Z,Y,K),L=m.defineComponent({name:"FTextarea",props:I,emits:["update:modelValue","valueChange"],setup(a,t){const e=m.ref(),r=m.ref(a.modelValue),n=m.computed(()=>a.modelValue),l=N.useTextBox(a,t,r,n),{inputGroupClass:s,onBlur:y,onFocus:h}=l,i=N.useClear(a,t,l),{onMouseEnter:c,onMouseLeave:o,clearButtonClass:d,shouldShowClearButton:f,clearButtonStyle:u}=i,b=m.computed(()=>a.maxLength?a.maxLength:a.modelValue.length),M=S=>{var P,g;S.stopPropagation(),t.emit("update:modelValue",(P=S.target)==null?void 0:P.value),t.emit("valueChange",(g=S.target)==null?void 0:g.value)},v=S=>{S.stopPropagation(),e.value.value="",t.emit("update:modelValue",""),t.emit("valueChange","")},w=m.computed(()=>({"form-control":!0,"h-100":a.autoHeight}));return t.expose({elementRef:e}),m.onMounted(()=>{}),()=>m.createVNode("div",{class:s.value,onMouseenter:c,onMouseleave:o,style:"position:relative"},[m.withDirectives(m.createVNode("textarea",{class:w.value,id:a.id,"onUpdate:modelValue":S=>a.modelValue=S,ref:e,minlength:a.minLength,maxlength:a.maxLength?a.maxLength:null,tabindex:a.tabIndex,disabled:a.disabled,readonly:a.readonly,autocomplete:a.autocomplete,placeholder:a.placeholder,autofocus:a.autofocus,rows:a.rows,onInput:M,onFocus:h,onBlur:y},null),[[m.vModelText,a.modelValue]]),f.value&&m.createVNode("span",{id:"clearIcon",class:d.value,style:u.value,onClick:S=>v(S)},[m.createVNode("i",{class:"f-icon modal_close"},null)]),a.showCount&&m.createVNode("span",{style:"position: absolute;bottom: 5px;right: 10px"},[`${a.modelValue.length}/${b.value}`])])}});function R(a,t,e){var P;const r=e&&e.getStyles&&e.getStyles()||"",n=e&&e.getDesignerClass&&e.getDesignerClass()||"",l=m.ref();function s(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanMoveComponent?e.checkCanMoveComponent():!0}function y(){return!1}function h(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanDeleteComponent?e.checkCanDeleteComponent():!0}function i(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:e&&e.hideNestedPaddingInDesginerView?e.hideNestedPaddingInDesginerView():!1}function c(g){if(!g||!g.value)return null;if(g.value.schema&&g.value.schema.type==="component")return g.value;const T=m.ref(g==null?void 0:g.value.parent),F=c(T);return F||null}function o(g=t){const{componentInstance:T,designerItemElementRef:F}=g;return!T||!T.value?null:T.value.canMove?F:o(g.parent)}function d(g){return!!e&&e.canAccepts(g)}function f(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function u(){}function b(g,T){T&&e!=null&&e.onAcceptMovedChildElement&&e.onAcceptMovedChildElement(T)}function M(g,T){const{componentType:F}=g;let V=G(F,g,T);e&&e.onResolveNewComponentSchema&&(V=e.onResolveNewComponentSchema(g,V));const $=F.toLowerCase().replace(/-/g,"_");return V&&!V.id&&V.type===F&&(V.id=`${$}_${Math.random().toString().slice(2,6)}`),V}function v(g){}function w(...g){if(e&&e.getPropsConfig)return e.getPropsConfig(...g)}function S(){e&&e.onRemoveComponent&&e.onRemoveComponent(),t!=null&&t.schema.contents&&t.schema.contents.map(g=>{var V;let T=g.id;g.type==="component-ref"&&(T=g.component);const F=a.value.querySelector(`#${T}-design-item`);(V=F==null?void 0:F.componentInstance)!=null&&V.value.onRemoveComponent&&F.componentInstance.value.onRemoveComponent()})}return l.value={canMove:s(),canSelectParent:y(),canDelete:h(),canNested:!i(),contents:t==null?void 0:t.schema.contents,elementRef:a,parent:(P=t==null?void 0:t.parent)==null?void 0:P.componentInstance,schema:t==null?void 0:t.schema,styles:r,designerClass:n,canAccepts:d,getBelongedComponentInstance:c,getDraggableDesignItemElement:o,getDraggingDisplayText:f,getPropConfig:w,getDragScopeElement:u,onAcceptMovedChildElement:b,onChildElementMovedOut:v,addNewChildComponentSchema:M,triggerBelongedComponentToMoveWhenMoved:!!e&&e.triggerBelongedComponentToMoveWhenMoved||m.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!e&&e.triggerBelongedComponentToDeleteWhenDeleted||m.ref(!1),onRemoveComponent:S},l}class ee{constructor(t,e){C(this,"componentId");C(this,"viewModelId");C(this,"eventsEditorUtils");C(this,"formSchemaUtils");C(this,"formMetadataConverter");C(this,"designViewModelUtils");C(this,"designViewModelField");C(this,"controlCreatorUtils");C(this,"designerHostService");C(this,"schemaService",null);C(this,"metadataService",null);C(this,"propertyConfig",{type:"object",categories:{}});var r;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((r=this.formSchemaUtils)==null?void 0:r.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var r;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const n=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=n.fields.find(l=>l.id===e)}t.updateOn=(r=this.designViewModelField)==null?void 0:r.updateOn}}changeFieldEditorType(t,e){}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:t.type,name:p[t.type].name}]}}}}}getAppearanceConfig(t=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(t,e){const r=e&&e.parent&&e.parent.schema;if(!r)return;const n=r.contents.findIndex(s=>s.id===t),l=B.cloneDeep(r.contents[n]);r.contents.splice(n,1),r.contents.splice(n,0,l)}}const E=class E{static getEditorTypesByMDataType(t){const e=E.fieldControlTypeMapping[t];return e||[{key:"",value:""}]}static getAllInputTypes(){const t=[];for(const e in E.fieldControlTypeMapping)E.fieldControlTypeMapping[e].forEach(r=>{t.find(n=>n.key===r.key&&n.value===r.value)||t.push({key:r.key,value:r.value})});return t}};C(E,"fieldControlTypeMapping",{String:[{key:p["input-group"].type,value:p["input-group"].name},{key:p.lookup.type,value:p.lookup.name},{key:p["date-picker"].type,value:p["date-picker"].name},{key:p["check-box"].type,value:p["check-box"].name},{key:p["check-group"].type,value:p["check-group"].name},{key:p["radio-group"].type,value:p["radio-group"].name},{key:p["combo-list"].type,value:p["combo-list"].name},{key:p.textarea.type,value:p.textarea.name}],Text:[{key:p.textarea.type,value:p.textarea.name},{key:p.lookup.type,value:p.lookup.name}],Decimal:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Integer:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Number:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],BigNumber:[{key:p["number-spinner"].type,value:p["number-spinner"].name}],Date:[{key:p["date-picker"].type,value:p["date-picker"].name}],DateTime:[{key:p["date-picker"].type,value:p["date-picker"].name}],Boolean:[{key:p.switch.type,value:p.switch.name},{key:p["check-box"].type,value:p["check-box"].name}],Enum:[{key:p["combo-list"].type,value:p["combo-list"].name},{key:p["radio-group"].type,value:p["radio-group"].name}],Object:[{key:p.lookup.type,value:p.lookup.name},{key:p["combo-list"].type,value:p["combo-list"].name},{key:p["radio-group"].type,value:p["radio-group"].name}]});let D=E;const te=m.ref(0);class ne{constructor(){C(this,"label","");C(this,"id","");C(this,"columnInSM",12);C(this,"columnInMD",6);C(this,"columnInLG",3);C(this,"columnInEL",2);C(this,"displayWidthInSM",1);C(this,"displayWidthInMD",1);C(this,"displayWidthInLG",1);C(this,"displayWidthInEL",1);C(this,"displayColumnCountAtBreakPoint","md");C(this,"tagRow",0);C(this,"showTopBorder",0);C(this,"group",1);C(this,"isSupportedClass",!0);C(this,"fieldSetId","")}}function oe(a){let t,e;const r=new Map;let n=[];function l(c,o){const f=c.split(" ").filter(w=>w.startsWith("col-"));if(f.length===0){o.isSupportedClass=!1;return}let u=f.find(w=>/^col-([1-9]|10|11|12)$/.test(w)),b=f.find(w=>/^col-md-([1-9]|10|11|12)$/.test(w)),M=f.find(w=>/^col-xl-([1-9]|10|11|12)$/.test(w)),v=f.find(w=>/^col-el-([1-9]|10|11|12)$/.test(w));u=u||"col-12",o.columnInSM=parseInt(u.replace("col-",""),10),o.displayWidthInSM=o.columnInSM/12,o.displayWidthInSM!==1&&(o.isSupportedClass=!1),b=b||"col-md-"+o.columnInSM,o.columnInMD=parseInt(b.replace("col-md-",""),10),o.displayWidthInMD=o.columnInMD/6,[1,2].includes(o.displayWidthInMD)||(o.isSupportedClass=!1),M=M||"col-xl-"+o.columnInMD,o.columnInLG=parseInt(M.replace("col-xl-",""),10),o.displayWidthInLG=o.columnInLG/3,[1,2,3,4].includes(o.displayWidthInLG)||(o.isSupportedClass=!1),v=v||"col-el-"+o.columnInLG,o.columnInEL=parseInt(v.replace("col-el-",""),10),o.displayWidthInEL=o.columnInEL/2,[1,2,3,4,5,6].includes(o.displayWidthInEL)||(o.isSupportedClass=!1)}function s(c,o,d,f=!1){let u=!1;c.contents.forEach(b=>{if(b.type==="fieldset"){d+=1,s(b,o,d,!0),u=!0;return}u&&(d+=1,u=!1);const M=b.appearance&&b.appearance.class,v=new ne;M?l(M,v):v.isSupportedClass=!1,v.label=b.label||b.id,v.id=b.id,v.group=d,f&&(v.fieldSetId=c.id),e===b.id&&(t=d),r.set(b.id,b),o.push(v)})}function y(c){const o=a.getComponentById(c);if(!o||!o.componentType||!o.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const d=a.selectNode(o,f=>f.type===x.DgControl["response-form"].type);return!d||!d.contents||d.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:d}}function h(c,o){o=o||c.id;const{result:d,message:f,formNode:u}=y(o);if(!d)return{result:d,message:f};e=c.id,n=[],r.clear();const b=u.contents[0].type===x.DgControl.fieldset.type?0:1;s(u,n,b);const M=n.find(w=>!w.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:M?"customize":"standard"},importData:n}}function i(c,o){o=o;const{result:d,formNode:f}=y(o);if(!d)return"";const u=[];return c.forEach(b=>{var w;const M=r.get(b.id),v=M.appearance&&M.appearance.class;if(v){const P=v.split(" ").filter(ce=>!ce.startsWith("col-")),g="col-"+b.columnInSM,T="col-md-"+b.columnInMD,F="col-xl-"+b.columnInLG,V="col-el-"+b.columnInEL,$=[g,T,F,V].concat(P);M.appearance.class=$.join(" ")}if(b.fieldSetId){const S=f.contents.find(g=>g.id===b.fieldSetId),P=u.find(g=>g.id===b.fieldSetId);P?(w=P.contents)==null||w.push(M):(u.push(S),S.contents=[M])}else u.push(M)}),f.contents=u,f.id}return{checkCanFindFormNode:y,checkCanOpenLayoutEditor:h,changeFormControlsByResponseLayoutConfig:i,getResonseFormLayoutConfig:s}}class re extends ee{constructor(e,r){super(e,r);C(this,"responseLayoutEditorFunction");this.responseLayoutEditorFunction=oe(this.formSchemaUtils)}getPropertyConfig(e,r){return this.propertyConfig.categories.basic=this.getBasicProperties(e,r),this.propertyConfig.categories.appearance=this.getAppearanceProperties(e,r),this.propertyConfig.categories.editor=this.getEditorProperties(e),this.propertyConfig}getBasicProperties(e,r){var l;const n=this;return this.setDesignViewModelField(e),this.formSchemaUtils.getFormMetadataBasicInfo(),{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"编辑器类型",title:"编辑器类型",type:"string",refreshPanelAfterChanged:!0,$converter:"/converter/change-editor.converter",editor:{type:"combo-list",textField:"value",valueField:"key",editable:!1,data:n.designViewModelField?D.getEditorTypesByMDataType((l=n.designViewModelField.type)==null?void 0:l.name):D.getAllInputTypes()}},label:{title:"标签",type:"string",$converter:"/converter/form-group-label.converter"},binding:{description:"绑定的表单字段",title:"绑定",editor:{type:"binding-selector",bindingType:{enable:!1},editorParams:{componentSchema:e,needSyncToViewModel:!0,viewModelId:this.viewModelId,designerHostService:this.designerHostService,disableOccupiedFields:!0},textField:"bindingField"}}},setPropertyRelates(s,y){if(s)switch(s&&s.propertyID){case"type":{n.changeControlType(e,s,r);break}case"label":{s.needRefreshControlTree=!0;break}}}}}getAppearanceProperties(e,r){const n=this;return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"},responseLayout:{description:"响应式列宽",title:"响应式列宽",type:"boolean",visible:!0,refreshPanelAfterChanged:!0,editor:{type:"response-layout-editor-setting",initialState:n.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e,n.componentId)}}},setPropertyRelates(l,s){if(l)switch(l&&l.propertyID){case"responseLayout":n.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(l.propertyValue,n.componentId||e.id),n.updateUnifiedLayoutAfterResponseLayoutChanged(n.componentId),n.updateElementByParentContainer(e.id,r),delete e.responseLayout;break;case"class":n.updateUnifiedLayoutAfterControlChanged(l.propertyValue,e.id,this.componentId),n.updateElementByParentContainer(e.id,r);break}}}}getEditorProperties(e){return this.getComponentConfig(e)}changeControlType(e,r,n){var c,o,d,f;const l=r.propertyValue,s=n&&n.parent&&n.parent.schema;if(!s)return;const y=s.contents.findIndex(u=>u.id===e.id),h=s.contents[y];let i;this.designViewModelField&&(this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id,{editor:{$type:l},name:this.designViewModelField.name,require:this.designViewModelField.require,readonly:this.designViewModelField.readonly},!1),i=this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField,l)),i||(i=this.controlCreatorUtils.createFormGroupWithoutField(l)),Object.assign(i,{id:h.id,appearance:h.appearance,size:h.size,label:h.label,binding:h.binding,visible:h.visible}),Object.assign(i.editor,{isTextArea:i.isTextArea&&h.isTextArea,placeholder:(c=h.editor)==null?void 0:c.placeholder,holdPlace:(o=h.editor)==null?void 0:o.holdPlace,readonly:(d=h.editor)==null?void 0:d.readonly,require:(f=h.editor)==null?void 0:f.require}),s.contents.splice(y,1),s.contents.splice(y,0,i),n.schema=Object.assign(h,i),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(u=>u.classList.remove("dgComponentSelected")),te.value++}getComponentConfig(e,r={},n={}){const l=Object.assign({description:"编辑器",title:"编辑器",type:"input-group",$converter:"/converter/property-editor.converter"},r),s=Object.assign({readonly:{description:"",title:"只读",type:"boolean"},disabled:{description:"",title:"禁用",type:"boolean"},placeholder:{description:"空值时,输入控件内的占位文本",title:"提示文本",type:"string"}},n);return{...l,properties:{...s}}}updateUnifiedLayoutAfterControlChanged(e,r,n){const l=e.split(" ");let s=l.find(o=>/^col-([1-9]|10|11|12)$/.test(o)),y=l.find(o=>/^col-md-([1-9]|10|11|12)$/.test(o)),h=l.find(o=>/^col-xl-([1-9]|10|11|12)$/.test(o)),i=l.find(o=>/^col-el-([1-9]|10|11|12)$/.test(o));s=s||"col-12",y=y||"col-md-"+s.replace("col-",""),h=h||"col-xl-"+y.replace("col-md-",""),i=i||"col-el-"+h.replace("col-xl-","");const c={id:r,columnInSM:parseInt(s.replace("col-",""),10),columnInMD:parseInt(y.replace("col-md-",""),10),columnInLG:parseInt(h.replace("col-xl-",""),10),columnInEL:parseInt(i.replace("col-el-",""),10)};this.updateUnifiedLayoutAfterResponseLayoutChanged(n,c)}updateUnifiedLayoutAfterResponseLayoutChanged(e,r){const{formNode:n}=this.responseLayoutEditorFunction.checkCanFindFormNode(e);if(!n||!n.unifiedLayout)return;const l=[];if(this.responseLayoutEditorFunction.getResonseFormLayoutConfig(n,l,1),r){const u=l.find(b=>b.id===r.id);Object.assign(u||{},r)}const s=l.map(u=>u.columnInSM),y=l.map(u=>u.columnInMD),h=l.map(u=>u.columnInLG),i=l.map(u=>u.columnInEL),c=this.checkIsUniqueColumn(s)?s[0]:null,o=this.checkIsUniqueColumn(y)?y[0]:null,d=this.checkIsUniqueColumn(h)?h[0]:null,f=this.checkIsUniqueColumn(i)?i[0]:null;Object.assign(n.unifiedLayout,{uniqueColClassInSM:c,uniqueColClassInMD:o,uniqueColClassInLG:d,uniqueColClassInEL:f})}checkIsUniqueColumn(e){const r=new Set(e);return Array.from(r).length===1}}class ae extends re{constructor(t,e){super(t,e)}getEditorProperties(t){return this.getComponentConfig(t,{type:"textarea"},{rows:{description:"",title:"文本区域可见的行数",type:"number"},showCount:{description:"",title:"展示输入文本数量",type:"boolean"}})}}function ie(a,t){const e=a.schema;function r(n,l){return new ae(n,t).getPropertyConfig(e,l)}return{getPropsConfig:r}}const le=m.defineComponent({name:"FTextareaDesign",props:I,emits:[""],setup(a,t){const e=m.ref(),r=m.inject("designer-host-service"),n=m.inject("design-item-context"),l=ie(n,r),s=R(e,n,l),y=m.computed(()=>a.maxLength?a.maxLength:a.modelValue.length),h=m.computed(()=>({position:"relative"})),i=m.computed(()=>({"box-shadow":"0 0 0 1px #dcdfe6 inset",border:"none",padding:"5px 10px",width:"100%"})),c={position:"absolute",bottom:"5px",right:"10px"};return m.onMounted(()=>{e.value.componentInstance=s}),t.expose(s.value),()=>m.createVNode("div",{style:h.value,ref:e},[m.createVNode("textarea",{id:a.id,tabindex:a.tabIndex,disabled:!1,readonly:!0,style:i.value,placeholder:a.placeholder,rows:a.rows},null),a.showCount&&m.createVNode("span",{style:c},[`${a.modelValue.length}/${y.value}`])])}});L.register=(a,t,e,r)=>{a.textarea=L,t.textarea=U},L.registerDesigner=(a,t,e)=>{a.textarea=le,t.textarea=U};const se=N.withInstall(L);k.FTextarea=L,k.default=se,k.propsResolver=U,k.textAreaProps=I,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|